From 2f5600b44b85c52fe83cb2da51be203c4a026acc Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Wed, 30 Aug 2017 22:35:55 -0700 Subject: [PATCH 01/95] Support out and ref parameters Merge ObjectStore into Bindings Move NativeScriptConstants that couldn't really change to parameters or their users Don't make handles for more than one of the same object Make a lot of JSON fields optional by defaulting to empty arrays Allow for pseudo-null System::Object instances Add various overloaded operators for System::Object Update README --- README.md | 8 +- Unity/Assets/NativeScript/Bindings.cs | 415 ++- Unity/Assets/NativeScript/BootScript.cs | 4 +- .../NativeScript/Editor/GenerateBindings.cs | 2699 ++++++++++------- Unity/Assets/NativeScript/ObjectStore.cs | 138 - Unity/Assets/NativeScript/ObjectStore.cs.meta | 12 - Unity/Assets/NativeScriptConstants.cs | 21 - Unity/Assets/NativeScriptTypes.json | 77 +- Unity/CppSource/NativeScript/Bindings.cpp | 158 +- Unity/CppSource/NativeScript/Bindings.h | 46 + 10 files changed, 2126 insertions(+), 1452 deletions(-) delete mode 100644 Unity/Assets/NativeScript/ObjectStore.cs delete mode 100644 Unity/Assets/NativeScript/ObjectStore.cs.meta diff --git a/README.md b/README.md index 08c33a6..5febbff 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,12 @@ C++ has no required garbage collector and features optional automatic memory man While IL2CPP transforms C# into C++ already, it generates a lot of overhead. There are many [surprises](http://jacksondunstan.com/articles/3916) if you read through the generated C++. For example, there's overhead for any function using a static variable and an extra two pointers are stored at the beginning of every class. The same goes for all sorts of features such as `sizeof()`, mandatory null checks, and so forth. Instead, you could write C++ directly and not need to work around IL2CPP. -This project aims to give you a viable alternative to C#. Scripting in C++ isn't right for every project, but now it's an option. +This project aims to give you a viable alternative to C#. Scripting in C++ isn't right for all parts of every project, but now it's an option. # Features * Supports Windows, macOS, iOS, and Android (editor and standalone) +* Plays nice with other C# scripts- no need to use 100% C++ * Object-oriented API just like in C# > @@ -153,15 +154,18 @@ The code generator supports: * Properties (getters and setters) * Generic return types * `MonoBehaviour` classes with "message" functions (except `OnAudioFilterRead`) +* `out` and `ref` parameters The code generator does not support (yet): * Struct types * Arrays (single- or multi-dimensional) * Generic functions and types -* `out` and `ref` parameters * Delegates * `MonoBehaviour` contents (e.g. fields) except for "message" functions +* Overloaded operators +* Exceptions +* Default parameters The JSON file is laid out as follows: diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index b5ee2e5..9aea668 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -21,11 +21,23 @@ namespace NativeScript /// public static class Bindings { + // 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 - public static IntPtr libraryHandle; + static IntPtr libraryHandle; - public delegate void InitDelegate( + delegate void InitDelegate( int maxManagedObjects, IntPtr releaseObject, IntPtr stringNew, @@ -46,7 +58,10 @@ public delegate void InitDelegate( IntPtr transformPropertySetPosition, IntPtr debugMethodLogSystemObject, IntPtr assertFieldGetRaiseExceptions, - IntPtr assertFieldSetRaiseExceptions + IntPtr assertFieldSetRaiseExceptions, + IntPtr audioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32, + IntPtr networkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte, + IntPtr networkTransportMethodInit /*END INIT PARAMS*/); /*BEGIN MONOBEHAVIOUR DELEGATES*/ @@ -66,20 +81,21 @@ IntPtr assertFieldSetRaiseExceptions #if UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX [DllImport("__Internal")] - public static extern IntPtr dlopen( + static extern IntPtr dlopen( string path, int flag); [DllImport("__Internal")] - public static extern IntPtr dlsym( + static extern IntPtr dlsym( IntPtr handle, string symbolName); [DllImport("__Internal")] - public static extern int dlclose( + static extern int dlclose( IntPtr handle); - public static IntPtr OpenLibrary(string path) + static IntPtr OpenLibrary( + string path) { IntPtr handle = dlopen(path, 0); if (handle == IntPtr.Zero) @@ -88,13 +104,14 @@ public static IntPtr OpenLibrary(string path) } return handle; } - - public static void CloseLibrary(IntPtr libraryHandle) + + static void CloseLibrary( + IntPtr libraryHandle) { dlclose(libraryHandle); } - - public static T GetDelegate( + + static T GetDelegate( IntPtr libraryHandle, string functionName) where T : class { @@ -109,19 +126,19 @@ public static T GetDelegate( } #elif UNITY_EDITOR_WIN [DllImport("kernel32")] - public static extern IntPtr LoadLibrary( + static extern IntPtr LoadLibrary( string path); - + [DllImport("kernel32")] - public static extern IntPtr GetProcAddress( + static extern IntPtr GetProcAddress( IntPtr libraryHandle, string symbolName); - + [DllImport("kernel32")] - public static extern bool FreeLibrary( + static extern bool FreeLibrary( IntPtr libraryHandle); - - public static IntPtr OpenLibrary(string path) + + static IntPtr OpenLibrary(string path) { IntPtr handle = LoadLibrary(path); if (handle == IntPtr.Zero) @@ -130,13 +147,13 @@ public static IntPtr OpenLibrary(string path) } return handle; } - - public static void CloseLibrary(IntPtr libraryHandle) + + static void CloseLibrary(IntPtr libraryHandle) { FreeLibrary(libraryHandle); } - - public static T GetDelegate( + + static T GetDelegate( IntPtr libraryHandle, string functionName) where T : class { @@ -150,7 +167,7 @@ public static T GetDelegate( typeof(T)) as T; } #else - [DllImport(NativeScriptConstants.PluginName)] + [DllImport(PluginName)] static extern void Init( int maxManagedObjects, IntPtr releaseObject, @@ -172,26 +189,28 @@ static extern void Init( IntPtr transformPropertySetPosition, IntPtr debugMethodLogSystemObject, IntPtr assertFieldGetRaiseExceptions, - IntPtr assertFieldSetRaiseExceptions + IntPtr assertFieldSetRaiseExceptions, + IntPtr audioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32, + IntPtr networkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte, + IntPtr networkTransportMethodInit /*END INIT PARAMS*/); - + /*BEGIN MONOBEHAVIOUR IMPORTS*/ - [DllImport(NativeScriptConstants.PluginName)] + [DllImport(Constants.PluginName)] public static extern void TestScriptAwake(int thisHandle); - [DllImport(NativeScriptConstants.PluginName)] + [DllImport(Constants.PluginName)] public static extern void TestScriptOnAnimatorIK(int thisHandle, int param0); - [DllImport(NativeScriptConstants.PluginName)] + [DllImport(Constants.PluginName)] public static extern void TestScriptOnCollisionEnter(int thisHandle, int param0); - [DllImport(NativeScriptConstants.PluginName)] + [DllImport(Constants.PluginName)] public static extern void TestScriptUpdate(int thisHandle); /*END MONOBEHAVIOUR IMPORTS*/ #endif - - delegate void ReleaseObjectDelegate(int handle); + delegate void ReleaseObjectDelegate(int handle); delegate int StringNewDelegate(string chars); /*BEGIN DELEGATE TYPES*/ @@ -212,15 +231,172 @@ IntPtr assertFieldSetRaiseExceptions delegate void DebugMethodLogSystemObjectDelegate(int messageHandle); delegate bool AssertFieldGetRaiseExceptionsDelegate(); delegate void AssertFieldSetRaiseExceptionsDelegate(bool value); + delegate void AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate(out int bufferLength, out int numBuffers); + delegate void NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate(int hostId, ref int addressHandle, out int port, out byte error); + delegate void NetworkTransportMethodInitDelegate(); /*END DELEGATE TYPES*/ + + // Stored objects. The first is always 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 int StoreObject(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 GetObject(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 -1; + } + + public static void RemoveObject(int handle) + { + if (handle != 0) + { + lock (objects) + { + // Forget the object + object obj = objects[handle]; + objects[handle] = null; - public static void Open() + // 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); + } + } + } + + /// + /// Open the C++ plugin and call its PluginMain() + /// + /// + /// + /// Maximum number of simultaneous managed objects that the C++ plugin + /// uses. + /// + public static void Open( + int maxManagedObjects) { + Bindings.maxObjects = maxManagedObjects; + + // Initialize the objects as all null plus room for the + // first to always be null. + objects = new object[maxManagedObjects + 1]; + + // Initialize the handles stack as 1, 2, 3, ... + handles = new int[maxManagedObjects]; + for ( + int i = 0, handle = maxManagedObjects; + i < maxManagedObjects; + ++i, --handle) + { + handles[i] = handle; + } + nextHandleIndex = maxManagedObjects - 1; + + // Initialize the hash table + keys = new object[maxManagedObjects]; + values = new int[maxManagedObjects]; + #if UNITY_EDITOR // Open native library libraryHandle = OpenLibrary( - Application.dataPath + NativeScriptConstants.PluginPath); + Application.dataPath + PluginPath); InitDelegate Init = GetDelegate( libraryHandle, "Init"); @@ -232,11 +408,10 @@ public static void Open() /*END MONOBEHAVIOUR GETDELEGATE CALLS*/ #endif - + // Init C++ library - ObjectStore.Init(NativeScriptConstants.MaxManagedObjects); Init( - NativeScriptConstants.MaxManagedObjects, + maxManagedObjects, Marshal.GetFunctionPointerForDelegate(new ReleaseObjectDelegate(ReleaseObject)), Marshal.GetFunctionPointerForDelegate(new StringNewDelegate(StringNew)), /*BEGIN INIT CALL*/ @@ -256,11 +431,17 @@ public static void Open() Marshal.GetFunctionPointerForDelegate(new TransformPropertySetPositionDelegate(TransformPropertySetPosition)), Marshal.GetFunctionPointerForDelegate(new DebugMethodLogSystemObjectDelegate(DebugMethodLogSystemObject)), Marshal.GetFunctionPointerForDelegate(new AssertFieldGetRaiseExceptionsDelegate(AssertFieldGetRaiseExceptions)), - Marshal.GetFunctionPointerForDelegate(new AssertFieldSetRaiseExceptionsDelegate(AssertFieldSetRaiseExceptions)) + Marshal.GetFunctionPointerForDelegate(new AssertFieldSetRaiseExceptionsDelegate(AssertFieldSetRaiseExceptions)), + Marshal.GetFunctionPointerForDelegate(new AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate(AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)), + Marshal.GetFunctionPointerForDelegate(new NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate(NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)), + Marshal.GetFunctionPointerForDelegate(new NetworkTransportMethodInitDelegate(NetworkTransportMethodInit)) /*END INIT CALL*/ ); } + /// + /// Close the C++ plugin + /// public static void Close() { #if UNITY_EDITOR @@ -279,7 +460,7 @@ static void ReleaseObject( { if (handle != 0) { - ObjectStore.Remove(handle); + NativeScript.Bindings.RemoveObject(handle); } } @@ -287,7 +468,7 @@ static void ReleaseObject( static int StringNew( string chars) { - int handle = ObjectStore.Store(chars); + int handle = NativeScript.Bindings.StoreObject(chars); return handle; } @@ -295,123 +476,162 @@ static int StringNew( [MonoPInvokeCallback(typeof(StopwatchConstructorDelegate))] static int StopwatchConstructor() { - var obj = ObjectStore.Store(new System.Diagnostics.Stopwatch()); - return obj; + var returnValue = NativeScript.Bindings.StoreObject(new System.Diagnostics.Stopwatch()); + return returnValue; } [MonoPInvokeCallback(typeof(StopwatchPropertyGetElapsedMillisecondsDelegate))] static long StopwatchPropertyGetElapsedMilliseconds(int thisHandle) { - var thiz = (System.Diagnostics.Stopwatch)ObjectStore.Get(thisHandle); - var obj = thiz.ElapsedMilliseconds; - return obj; + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.GetObject(thisHandle); + var returnValue = thiz.ElapsedMilliseconds; + return returnValue; } [MonoPInvokeCallback(typeof(StopwatchMethodStartDelegate))] static void StopwatchMethodStart(int thisHandle) { - var thiz = (System.Diagnostics.Stopwatch)ObjectStore.Get(thisHandle); + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.GetObject(thisHandle); thiz.Start(); } [MonoPInvokeCallback(typeof(StopwatchMethodResetDelegate))] static void StopwatchMethodReset(int thisHandle) { - var thiz = (System.Diagnostics.Stopwatch)ObjectStore.Get(thisHandle); + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.GetObject(thisHandle); thiz.Reset(); } [MonoPInvokeCallback(typeof(ObjectPropertyGetNameDelegate))] static int ObjectPropertyGetName(int thisHandle) { - var thiz = (UnityEngine.Object)ObjectStore.Get(thisHandle); - var obj = thiz.name; - int handle = ObjectStore.Store(obj); - return handle; + var thiz = (UnityEngine.Object)NativeScript.Bindings.GetObject(thisHandle); + var returnValue = thiz.name; + int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); + if (returnValueHandle < 0) + { + return NativeScript.Bindings.StoreObject(returnValue); + } + else + { + return returnValueHandle; + } } [MonoPInvokeCallback(typeof(ObjectPropertySetNameDelegate))] static void ObjectPropertySetName(int thisHandle, int valueHandle) { - var thiz = (UnityEngine.Object)ObjectStore.Get(thisHandle); - thiz.name = (string)ObjectStore.Get(valueHandle); + var thiz = (UnityEngine.Object)NativeScript.Bindings.GetObject(thisHandle); + var value = (System.String)NativeScript.Bindings.GetObject(valueHandle); + thiz.name = value; } [MonoPInvokeCallback(typeof(GameObjectConstructorDelegate))] static int GameObjectConstructor() { - var obj = ObjectStore.Store(new UnityEngine.GameObject()); - return obj; + var returnValue = NativeScript.Bindings.StoreObject(new UnityEngine.GameObject()); + return returnValue; } [MonoPInvokeCallback(typeof(GameObjectConstructorSystemStringDelegate))] static int GameObjectConstructorSystemString(int nameHandle) { - var obj = ObjectStore.Store(new UnityEngine.GameObject((System.String)ObjectStore.Get(nameHandle))); - return obj; + var name = (System.String)NativeScript.Bindings.GetObject(nameHandle); + var returnValue = NativeScript.Bindings.StoreObject(new UnityEngine.GameObject(name)); + return returnValue; } [MonoPInvokeCallback(typeof(GameObjectPropertyGetTransformDelegate))] static int GameObjectPropertyGetTransform(int thisHandle) { - var thiz = (UnityEngine.GameObject)ObjectStore.Get(thisHandle); - var obj = thiz.transform; - int handle = ObjectStore.Store(obj); - return handle; + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.GetObject(thisHandle); + var returnValue = thiz.transform; + int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); + if (returnValueHandle < 0) + { + return NativeScript.Bindings.StoreObject(returnValue); + } + else + { + return returnValueHandle; + } } [MonoPInvokeCallback(typeof(GameObjectMethodFindSystemStringDelegate))] static int GameObjectMethodFindSystemString(int nameHandle) { - var obj = UnityEngine.GameObject.Find((System.String)ObjectStore.Get(nameHandle)); - int handle = ObjectStore.Store(obj); - return handle; + var name = (System.String)NativeScript.Bindings.GetObject(nameHandle); + var returnValue = UnityEngine.GameObject.Find(name); + int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); + if (returnValueHandle < 0) + { + return NativeScript.Bindings.StoreObject(returnValue); + } + else + { + return returnValueHandle; + } } [MonoPInvokeCallback(typeof(GameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate))] static int GameObjectMethodAddComponentMyGameMonoBehavioursTestScript(int thisHandle) { - var thiz = (UnityEngine.GameObject)ObjectStore.Get(thisHandle); - var obj = thiz.AddComponent(); - int handle = ObjectStore.Store(obj); - return handle; + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.GetObject(thisHandle); + var returnValue = thiz.AddComponent(); + int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); + if (returnValueHandle < 0) + { + return NativeScript.Bindings.StoreObject(returnValue); + } + else + { + return returnValueHandle; + } } [MonoPInvokeCallback(typeof(ComponentPropertyGetTransformDelegate))] static int ComponentPropertyGetTransform(int thisHandle) { - var thiz = (UnityEngine.Component)ObjectStore.Get(thisHandle); - var obj = thiz.transform; - int handle = ObjectStore.Store(obj); - return handle; + var thiz = (UnityEngine.Component)NativeScript.Bindings.GetObject(thisHandle); + var returnValue = thiz.transform; + int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); + if (returnValueHandle < 0) + { + return NativeScript.Bindings.StoreObject(returnValue); + } + else + { + return returnValueHandle; + } } [MonoPInvokeCallback(typeof(TransformPropertyGetPositionDelegate))] static UnityEngine.Vector3 TransformPropertyGetPosition(int thisHandle) { - var thiz = (UnityEngine.Transform)ObjectStore.Get(thisHandle); - var obj = thiz.position; - return obj; + var thiz = (UnityEngine.Transform)NativeScript.Bindings.GetObject(thisHandle); + var returnValue = thiz.position; + return returnValue; } [MonoPInvokeCallback(typeof(TransformPropertySetPositionDelegate))] static void TransformPropertySetPosition(int thisHandle, UnityEngine.Vector3 value) { - var thiz = (UnityEngine.Transform)ObjectStore.Get(thisHandle); + var thiz = (UnityEngine.Transform)NativeScript.Bindings.GetObject(thisHandle); thiz.position = value; } [MonoPInvokeCallback(typeof(DebugMethodLogSystemObjectDelegate))] static void DebugMethodLogSystemObject(int messageHandle) { - UnityEngine.Debug.Log(ObjectStore.Get(messageHandle)); + var message = NativeScript.Bindings.GetObject(messageHandle); + UnityEngine.Debug.Log(message); } [MonoPInvokeCallback(typeof(AssertFieldGetRaiseExceptionsDelegate))] static bool AssertFieldGetRaiseExceptions() { - var obj = UnityEngine.Assertions.Assert.raiseExceptions; - return obj; + var returnValue = UnityEngine.Assertions.Assert.raiseExceptions; + return returnValue; } [MonoPInvokeCallback(typeof(AssertFieldSetRaiseExceptionsDelegate))] @@ -419,6 +639,34 @@ static void AssertFieldSetRaiseExceptions(bool value) { UnityEngine.Assertions.Assert.raiseExceptions = value; } + + [MonoPInvokeCallback(typeof(AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate))] + static void AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(out int bufferLength, out int numBuffers) + { + UnityEngine.AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers); + } + + [MonoPInvokeCallback(typeof(NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate))] + static void NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(int hostId, ref int addressHandle, out int port, out byte error) + { + var address = (System.String)NativeScript.Bindings.GetObject(addressHandle); + UnityEngine.Networking.NetworkTransport.GetBroadcastConnectionInfo(hostId, out address, out port, out error); + int addressHandleNew = NativeScript.Bindings.GetHandle(address); + if (addressHandleNew < 0) + { + addressHandle = NativeScript.Bindings.StoreObject(address); + } + else + { + addressHandle = addressHandleNew; + } + } + + [MonoPInvokeCallback(typeof(NetworkTransportMethodInitDelegate))] + static void NetworkTransportMethodInit() + { + UnityEngine.Networking.NetworkTransport.Init(); + } /*END FUNCTIONS*/ } } @@ -430,11 +678,11 @@ namespace MonoBehaviours { public class TestScript : UnityEngine.MonoBehaviour { - private int thisHandle; + int thisHandle; public TestScript() { - thisHandle = NativeScript.ObjectStore.Store(this); + thisHandle = NativeScript.Bindings.StoreObject(this); } public void Awake() @@ -449,9 +697,12 @@ public void OnAnimatorIK(int param0) public void OnCollisionEnter(UnityEngine.Collision param0) { - int param0Handle = NativeScript.ObjectStore.Store(param0); + int param0Handle = NativeScript.Bindings.GetHandle(param0); + if (param0Handle < 0) + { + param0Handle = NativeScript.Bindings.StoreObject(param0); + } NativeScript.Bindings.TestScriptOnCollisionEnter(thisHandle, param0Handle); - NativeScript.ObjectStore.Remove(param0Handle); } public void Update() diff --git a/Unity/Assets/NativeScript/BootScript.cs b/Unity/Assets/NativeScript/BootScript.cs index bf3b0eb..356f3a5 100644 --- a/Unity/Assets/NativeScript/BootScript.cs +++ b/Unity/Assets/NativeScript/BootScript.cs @@ -13,10 +13,12 @@ namespace NativeScript /// class BootScript : MonoBehaviour { + public int MaxManagedObjects = 1024; + void Awake() { DontDestroyOnLoad(gameObject); - Bindings.Open(); + Bindings.Open(MaxManagedObjects); } void OnApplicationQuit() diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 3e0c0f4..588e048 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -18,14 +18,19 @@ namespace NativeScript /// * Fields /// * Methods /// * Class types (static and regular) + /// * Generic return values + /// * out and ref parameters /// /// Does Not Support: /// * Arrays (single- or multi-dimensional) - /// * out or ref parameters /// * Struct types - /// * Generic functions + /// * Generic method parameters /// * Generic types /// * Delegates + /// * MonoBehaviour contents (e.g. fields) except for "message" functions + /// * Overloaded operators + /// * Exceptions + /// * Default parameters /// /// TODO: /// * Prefix binding function names with namespaces @@ -43,20 +48,20 @@ public static class GenerateBindings #pragma warning disable CS0649 [Serializable] - private class JsonConstructor + class JsonConstructor { public string[] Types; } [Serializable] - private class JsonGenericType + class JsonGenericType { public string Name; public string Type; } [Serializable] - private class JsonMethod + class JsonMethod { public string Name; public string ReturnType; @@ -65,7 +70,7 @@ private class JsonMethod } [Serializable] - private class JsonType + class JsonType { public string Name; public JsonConstructor[] Constructors; @@ -75,14 +80,14 @@ private class JsonType } [Serializable] - private class JsonAssembly + class JsonAssembly { public string Path; public JsonType[] Types; } [Serializable] - private class JsonMonoBehaviour + class JsonMonoBehaviour { public string Name; public string Namespace; @@ -90,39 +95,61 @@ private class JsonMonoBehaviour } [Serializable] - private class JsonDocument + class JsonDocument { public JsonAssembly[] Assemblies; public JsonMonoBehaviour[] MonoBehaviours; } - private class StringBuilders + const int InitialStringBuilderCapacity = 1024 * 5; + + class StringBuilders { - public StringBuilder CsharpInitParams = new StringBuilder(); - public StringBuilder CsharpDelegateTypes = new StringBuilder(); - public StringBuilder CsharpInitCall = new StringBuilder(); - public StringBuilder CsharpFunctions = new StringBuilder(); - public StringBuilder CsharpMonoBehaviours = new StringBuilder(); - public StringBuilder CsharpMonoBehaviourDelegates = new StringBuilder(); - public StringBuilder CsharpMonoBehaviourImports = new StringBuilder(); - public StringBuilder CsharpMonoBehaviourGetDelegateCalls = new StringBuilder(); - public StringBuilder CppFunctionPointers = new StringBuilder(); - public StringBuilder CppTypeDeclarations = new StringBuilder(); - public StringBuilder CppTypeDefinitions = new StringBuilder(); - public StringBuilder CppMethodDefinitions = new StringBuilder(); - public StringBuilder CppInitParams = new StringBuilder(); - public StringBuilder CppInitBody = new StringBuilder(); - public StringBuilder CppMonoBehaviourMessages = new StringBuilder(); - public StringBuilder TempStrBuilder = new StringBuilder(); + public StringBuilder CsharpInitParams = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CsharpDelegateTypes = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CsharpInitCall = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CsharpFunctions = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CsharpMonoBehaviours = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CsharpMonoBehaviourDelegates = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CsharpMonoBehaviourImports = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CsharpMonoBehaviourGetDelegateCalls = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CppFunctionPointers = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CppTypeDeclarations = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CppTypeDefinitions = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CppMethodDefinitions = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CppInitParams = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CppInitBody = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CppMonoBehaviourMessages = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder TempStrBuilder = + new StringBuilder(InitialStringBuilderCapacity); } - private class ParameterInfo + class ParameterInfo { public string Name; public Type ParameterType; + public Type DereferencedParameterType; + public bool IsOut; + public bool IsRef; + public bool IsStruct; } - private class MessageInfo + class MessageInfo { public string Name; public Type[] ParameterTypes; @@ -137,7 +164,7 @@ public MessageInfo( } } - private static readonly MessageInfo[] messageInfos = new[] { + static readonly MessageInfo[] messageInfos = new[] { new MessageInfo("Awake"), new MessageInfo("FixedUpdate"), new MessageInfo("LateUpdate"), @@ -254,11 +281,40 @@ static void Generate(bool dryRun) { JsonDocument doc = LoadJson(); - // Generate stub classes extending MonoBehaviour + // Generate stub types // We'll need to be able to get these via reflection later - StringBuilder output = new StringBuilder(1024*5); + StringBuilder csharpMonoBehaviours = new StringBuilder( + InitialStringBuilderCapacity); string timestamp = DateTime.Now.ToLongTimeString(); - foreach (JsonMonoBehaviour monoBehaviour in doc.MonoBehaviours) + AppendStubMonoBehaviours( + doc.MonoBehaviours, + timestamp, + csharpMonoBehaviours); + + // Inject + string csharpContents = File.ReadAllText(CsharpPath); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN MONOBEHAVIOURS*/\n", + "\n/*END MONOBEHAVIOURS*/", + csharpMonoBehaviours.ToString()); + File.WriteAllText(CsharpPath, csharpContents); + + // Compile and continue after scripts are refreshed + Debug.Log("Waiting for compile..."); + AssetDatabase.Refresh(); + EditorPrefs.SetBool(PostCompileWorkPref, true); + } + } + + static void AppendStubMonoBehaviours( + JsonMonoBehaviour[] monoBehaviours, + string timestamp, + StringBuilder output) + { + if (monoBehaviours != null) + { + foreach (JsonMonoBehaviour monoBehaviour in monoBehaviours) { int csharpIndent = AppendNamespaceBeginning( monoBehaviour.Namespace, @@ -277,25 +333,11 @@ static void Generate(bool dryRun) output.Append("}\n"); AppendNamespaceEnding(csharpIndent, output); } - - // Inject - File.WriteAllText( - CsharpPath, - InjectIntoString( - File.ReadAllText(CsharpPath), - "/*BEGIN MONOBEHAVIOURS*/\n", - "\n/*END MONOBEHAVIOURS*/", - output.ToString())); - - // Compile and continue after scripts are refreshed - Debug.Log("Waiting for compile..."); - AssetDatabase.Refresh(); - EditorPrefs.SetBool(PostCompileWorkPref, true); } } [UnityEditor.Callbacks.DidReloadScripts] - private static void OnScriptsReloaded() + static void OnScriptsReloaded() { // Scripts get reloaded for many reasons, not just our work // Check if this reload is due to us refreshing the asset DB @@ -314,777 +356,35 @@ static void DoPostCompileWork() JsonDocument doc = LoadJson(); - // Build binding strings StringBuilders builders = new StringBuilders(); - StringBuilder csharpInitParams = builders.CsharpInitParams; - StringBuilder csharpDelegateTypes = builders.CsharpDelegateTypes; - StringBuilder csharpInitCall = builders.CsharpInitCall; - StringBuilder csharpFunctions = builders.CsharpFunctions; - StringBuilder csharpMonoBehaviours = builders.CsharpMonoBehaviours; - StringBuilder csharpMonoBehaviourDelegates = builders.CsharpMonoBehaviourDelegates; - StringBuilder csharpMonoBehaviourImports = builders.CsharpMonoBehaviourImports; - StringBuilder csharpMonoBehaviourGetDelegateCalls = builders.CsharpMonoBehaviourGetDelegateCalls; - StringBuilder cppFunctionPointers = builders.CppFunctionPointers; - StringBuilder cppTypeDeclarations = builders.CppTypeDeclarations; - StringBuilder cppTypeDefinitions = builders.CppTypeDefinitions; - StringBuilder cppMethodDefinitions = builders.CppMethodDefinitions; - StringBuilder cppInitParams = builders.CppInitParams; - StringBuilder cppInitBody = builders.CppInitBody; - StringBuilder cppMonoBehaviourMessages = builders.CppMonoBehaviourMessages; - StringBuilder tempStrBuilder = builders.TempStrBuilder; - foreach (JsonAssembly jsonAssembly in doc.Assemblies) - { - Assembly assembly = Assembly.LoadFrom(jsonAssembly.Path); - foreach (JsonType jsonType in jsonAssembly.Types) - { - Type type = assembly.GetType(jsonType.Name); - string typeNameLower = char.ToLower(type.Name[0]) - + type.Name.Substring(1); - bool isStatic = type.IsAbstract && type.IsSealed; - - // C++ type declaration - int indent = AppendCppTypeDeclaration( - type.Namespace, - type.Name, - isStatic, - cppTypeDeclarations); - - // C++ type definition (beginning) - AppendCppTypeDefinitionBegin( - type.Namespace, - type.Name, - type.BaseType.Namespace, - type.BaseType.Name, - isStatic, - indent, - cppTypeDefinitions); - - // C++ method definition - int cppMethodDefinitionsIndent = AppendCppMethodDefinitionBegin( - type.Namespace, - type.Name, - type.BaseType.Namespace, - type.BaseType.Name, - isStatic, - indent, - cppMethodDefinitions); - - // Constructors - foreach (JsonConstructor jsonCtor in jsonType.Constructors) - { - Type[] paramTypes = GetTypes(jsonCtor.Types, assembly); - ConstructorInfo ctor = type.GetConstructor(paramTypes); - ParameterInfo[] parameters = ConvertParameters( - ctor.GetParameters()); - - // Build uppercase function name - tempStrBuilder.Length = 0; - tempStrBuilder.Append(type.Name); - tempStrBuilder.Append("Constructor"); - AppendTypeNames(paramTypes, tempStrBuilder); - string funcName = tempStrBuilder.ToString(); - - // Build lowercase function name - tempStrBuilder.Length = 0; - tempStrBuilder.Append(typeNameLower); - tempStrBuilder.Append("Constructor"); - AppendTypeNames(paramTypes, tempStrBuilder); - string funcNameLower = tempStrBuilder.ToString(); - - // C# init param declaration - AppendCsharpInitParam(funcNameLower, csharpInitParams); - - // C# delegate type - AppendCsharpDelegateType( - funcName, - true, - typeof(int), - parameters, - csharpDelegateTypes); - - // C# init call param - AppendCsharpInitCallArg(funcName, csharpInitCall); - - // C# function - AppendCsharpFunctionBeginning( - type, - funcName, - true, - typeof(int), - null, - parameters, - csharpFunctions); - csharpFunctions.Append("ObjectStore.Store("); - csharpFunctions.Append("new "); - AppendCsharpTypeName( - type, - csharpFunctions); - AppendCsharpFunctionCallParameters( - true, - parameters, - csharpFunctions); - csharpFunctions.Append(");"); - AppendCsharpFunctionReturn( - typeof(int), - csharpFunctions); - - // C++ function pointer - AppendCppFunctionPointerDefinition( - funcName, - true, - parameters, - type, - cppFunctionPointers); - - // C++ type declaration - AppendIndent( - indent + 1, - cppTypeDefinitions); - AppendCppMethodDeclaration( - type.Name, - false, - null, - null, - parameters, - cppTypeDefinitions); - - // C++ method definition - AppendCppMethodDefinition( - type, - null, - type.Name, - null, - parameters, - indent, - cppMethodDefinitions); - AppendIndent(indent + 1, cppMethodDefinitions); - cppMethodDefinitions.Append(": "); - cppMethodDefinitions.Append(type.Name); - cppMethodDefinitions.Append('('); - cppMethodDefinitions.Append(type.Name); - cppMethodDefinitions.Append('('); - AppendCppPluginFunctionCall( - true, - type, - funcName, - parameters, - cppMethodDefinitions); - cppMethodDefinitions.Append(")\n"); - AppendIndent(indent, cppMethodDefinitions); - cppMethodDefinitions.Append("{\n"); - AppendIndent(indent, cppMethodDefinitions); - cppMethodDefinitions.Append("}\n"); - AppendIndent(indent, cppMethodDefinitions); - cppMethodDefinitions.Append("\n"); - - // C++ init params - AppendCppInitParam( - funcNameLower, - true, - parameters, - type, - cppInitParams); - - // C++ init body - AppendCppInitBody(funcName, funcNameLower, cppInitBody); - } - - // Properties - foreach (string jsonPropertyName in jsonType.Properties) - { - PropertyInfo property = type.GetProperty( - jsonPropertyName); - MethodInfo getMethod = property.GetGetMethod(); - if (getMethod != null && getMethod.IsPublic) - { - AppendGetter( - property.Name, - typeNameLower, - "Property", - ConvertParameters(getMethod.GetParameters()), - getMethod.IsStatic, - type, - property.PropertyType, - indent, - builders); - } - MethodInfo setMethod = property.GetSetMethod(); - if (setMethod != null && setMethod.IsPublic) - { - AppendSetter( - property.Name, - "Property", - typeNameLower, - ConvertParameters(setMethod.GetParameters()), - setMethod.IsStatic, - type, - property.PropertyType, - indent, - builders); - } - } - - // Fields - foreach (string jsonFieldName in jsonType.Fields) - { - FieldInfo field = type.GetField(jsonFieldName); - AppendGetter( - field.Name, - typeNameLower, - "Field", - new ParameterInfo[0], - field.IsStatic, - type, - field.FieldType, - indent, - builders); - ParameterInfo setParam = new ParameterInfo(); - setParam.Name = "value"; - setParam.ParameterType = field.FieldType; - ParameterInfo[] parameters = new []{ setParam }; - AppendSetter( - field.Name, - "Field", - typeNameLower, - parameters, - field.IsStatic, - type, - field.FieldType, - indent, - builders); - } - - // Methods - foreach (JsonMethod jsonMethod in jsonType.Methods) - { - MethodInfo method = GetMethod( - type, - jsonMethod.Name, - jsonMethod.ReturnType, - jsonMethod.ParamTypes); - ParameterInfo[] parameters = ConvertParameters( - method.GetParameters()); - Type[] paramTypes = GetTypes( - jsonMethod.ParamTypes, - assembly); - - if (jsonMethod.GenericTypes != null) - { - foreach (JsonGenericType genericType in jsonMethod.GenericTypes) - { - Type returnType; - if (genericType.Name == method.ReturnType.Name) - { - returnType = GetType(genericType.Type, assembly); - } - else - { - returnType = method.ReturnType; - } - Type[] typeParams = new[] { returnType }; - - AppendMethod( - type, - typeNameLower, - method.Name, - method.IsStatic, - returnType, - typeParams, - parameters, - paramTypes, - indent, - builders); - } - } - else - { - AppendMethod( - type, - typeNameLower, - method.Name, - method.IsStatic, - method.ReturnType, - null, - parameters, - paramTypes, - indent, - builders); - } - } - - // C++ type definition (ending) - AppendCppTypeDefinitionEnd( - isStatic, - indent, - cppTypeDefinitions); - - // C++ method definition (ending) - AppendCppMethodDefinitionEnd( - cppMethodDefinitionsIndent, - cppMethodDefinitions); + if (doc.Assemblies != null) + { + foreach (JsonAssembly jsonAssembly in doc.Assemblies) + { + AppendAssembly( + jsonAssembly, + builders); } } - foreach (JsonMonoBehaviour monoBehaviour in doc.MonoBehaviours) + if (doc.MonoBehaviours != null) { - // C++ Type Declaration - int cppIndent = AppendCppTypeDeclaration( - monoBehaviour.Namespace, - monoBehaviour.Name, - false, - cppTypeDeclarations); - - // C++ Type Definition (begin) - AppendCppTypeDefinitionBegin( - monoBehaviour.Namespace, - monoBehaviour.Name, - "UnityEngine", - "MonoBehaviour", - false, - cppIndent, - cppTypeDefinitions - ); - - // C++ method definition - int cppMethodDefinitionsIndent = AppendCppMethodDefinitionBegin( - monoBehaviour.Namespace, - monoBehaviour.Name, - "UnityEngine", - "MonoBehaviour", - false, - cppIndent, - cppMethodDefinitions); - AppendCppMethodDefinitionEnd( - cppMethodDefinitionsIndent, - cppMethodDefinitions); - - // C# Class extending MonoBehaviour - int csharpIndent = AppendNamespaceBeginning( - monoBehaviour.Namespace, - csharpMonoBehaviours); - AppendIndent(csharpIndent, csharpMonoBehaviours); - csharpMonoBehaviours.Append("public class "); - csharpMonoBehaviours.Append(monoBehaviour.Name); - csharpMonoBehaviours.Append(" : UnityEngine.MonoBehaviour\n"); - AppendIndent(csharpIndent, csharpMonoBehaviours); - csharpMonoBehaviours.Append("{\n"); - AppendIndent(csharpIndent + 1, csharpMonoBehaviours); - csharpMonoBehaviours.Append("private int thisHandle;\n"); - AppendIndent(csharpIndent + 1, csharpMonoBehaviours); - csharpMonoBehaviours.Append('\n'); - AppendIndent(csharpIndent + 1, csharpMonoBehaviours); - csharpMonoBehaviours.Append("public "); - csharpMonoBehaviours.Append(monoBehaviour.Name); - csharpMonoBehaviours.Append("()\n"); - AppendIndent(csharpIndent + 1, csharpMonoBehaviours); - csharpMonoBehaviours.Append("{\n"); - AppendIndent(csharpIndent + 2, csharpMonoBehaviours); - csharpMonoBehaviours.Append("thisHandle = NativeScript.ObjectStore.Store(this);\n"); - AppendIndent(csharpIndent + 1, csharpMonoBehaviours); - csharpMonoBehaviours.Append("}\n"); - if (monoBehaviour.Messages.Length > 0) - { - AppendIndent(csharpIndent + 1, csharpMonoBehaviours); - csharpMonoBehaviours.Append('\n'); - } - for (int messageIndex = 0; messageIndex < monoBehaviour.Messages.Length; ++messageIndex) - { - string message = monoBehaviour.Messages[messageIndex]; - MessageInfo messageInfo = null; - foreach (MessageInfo mi in messageInfos) - { - if (mi.Name == message) - { - messageInfo = mi; - break; - } - } - Type[] paramTypes = messageInfo.ParameterTypes; - int numParams = paramTypes.Length; - ParameterInfo[] parameters = ConvertParameters( - paramTypes); - - // C++ Method Declaration - AppendIndent( - cppIndent + 1, - cppTypeDefinitions); - AppendCppMethodDeclaration( - messageInfo.Name, - false, - typeof(void), - null, - parameters, - cppTypeDefinitions); - - AppendIndent(csharpIndent + 1, csharpMonoBehaviours); - csharpMonoBehaviours.Append("public "); - AppendCsharpTypeName( - typeof(void), - csharpMonoBehaviours); - csharpMonoBehaviours.Append(' '); - csharpMonoBehaviours.Append(messageInfo.Name); - csharpMonoBehaviours.Append('('); - for (int i = 0; i < numParams; ++i) - { - Type paramType = paramTypes[i]; - AppendCsharpTypeName( - paramType, - csharpMonoBehaviours); - csharpMonoBehaviours.Append(' '); - csharpMonoBehaviours.Append("param"); - csharpMonoBehaviours.Append(i); - if (i != numParams - 1) - { - csharpMonoBehaviours.Append(", "); - } - } - csharpMonoBehaviours.Append(")\n"); - AppendIndent(csharpIndent + 1, csharpMonoBehaviours); - csharpMonoBehaviours.Append("{\n"); - for (int i = 0; i < numParams; ++i) - { - Type paramType = paramTypes[i]; - if (!paramType.IsValueType) - { - AppendIndent(csharpIndent + 2, csharpMonoBehaviours); - csharpMonoBehaviours.Append("int param"); - csharpMonoBehaviours.Append(i); - csharpMonoBehaviours.Append("Handle = NativeScript.ObjectStore.Store("); - csharpMonoBehaviours.Append("param"); - csharpMonoBehaviours.Append(i); - csharpMonoBehaviours.Append(");\n"); - } - } - AppendIndent(csharpIndent + 2, csharpMonoBehaviours); - csharpMonoBehaviours.Append("NativeScript.Bindings."); - csharpMonoBehaviours.Append(monoBehaviour.Name); - csharpMonoBehaviours.Append(messageInfo.Name); - csharpMonoBehaviours.Append("(thisHandle"); - if (numParams > 0) - { - csharpMonoBehaviours.Append(", "); - } - for (int i = 0; i < numParams; ++i) - { - csharpMonoBehaviours.Append("param"); - csharpMonoBehaviours.Append(i); - Type paramType = paramTypes[i]; - if (!paramType.IsValueType) - { - csharpMonoBehaviours.Append("Handle"); - } - if (i != numParams - 1) - { - csharpMonoBehaviours.Append(", "); - } - } - csharpMonoBehaviours.Append(");\n"); - for (int i = 0; i < numParams; ++i) - { - Type paramType = paramTypes[i]; - if (!paramType.IsValueType) - { - AppendIndent(csharpIndent + 2, csharpMonoBehaviours); - csharpMonoBehaviours.Append("NativeScript.ObjectStore.Remove(param"); - csharpMonoBehaviours.Append(i); - if (!paramType.IsValueType) - { - csharpMonoBehaviours.Append("Handle"); - } - csharpMonoBehaviours.Append(");\n"); - } - } - AppendIndent(csharpIndent + 1, csharpMonoBehaviours); - csharpMonoBehaviours.Append("}\n"); - if (messageIndex != monoBehaviour.Messages.Length - 1) - { - AppendIndent(csharpIndent + 1, csharpMonoBehaviours); - csharpMonoBehaviours.Append('\n'); - } - - // C# Delegate - csharpMonoBehaviourDelegates.Append("\t\tpublic delegate void "); - csharpMonoBehaviourDelegates.Append(monoBehaviour.Name); - csharpMonoBehaviourDelegates.Append(messageInfo.Name); - csharpMonoBehaviourDelegates.Append("Delegate(int thisHandle"); - if (numParams > 0) - { - csharpMonoBehaviourDelegates.Append(", "); - } - for (int i = 0; i < numParams; ++i) - { - Type paramType = paramTypes[i]; - if (paramType.IsValueType) - { - AppendCsharpTypeName( - paramType, - csharpMonoBehaviourDelegates); - csharpMonoBehaviourDelegates.Append(" param"); - csharpMonoBehaviourDelegates.Append(i); - } - else - { - csharpMonoBehaviourDelegates.Append("int param"); - csharpMonoBehaviourDelegates.Append(i); - } - if (i != numParams-1) - { - csharpMonoBehaviourDelegates.Append(", "); - } - } - csharpMonoBehaviourDelegates.Append(");\n"); - csharpMonoBehaviourDelegates.Append("\t\tpublic static "); - csharpMonoBehaviourDelegates.Append(monoBehaviour.Name); - csharpMonoBehaviourDelegates.Append(messageInfo.Name); - csharpMonoBehaviourDelegates.Append("Delegate "); - csharpMonoBehaviourDelegates.Append(monoBehaviour.Name); - csharpMonoBehaviourDelegates.Append(messageInfo.Name); - csharpMonoBehaviourDelegates.Append(";\n\t\t\n"); - - // C# Import - csharpMonoBehaviourImports.Append("\t\t[DllImport(Constants.PluginName)]\n"); - csharpMonoBehaviourImports.Append("\t\tpublic static extern void "); - csharpMonoBehaviourImports.Append(monoBehaviour.Name); - csharpMonoBehaviourImports.Append(messageInfo.Name); - csharpMonoBehaviourImports.Append("(int thisHandle"); - if (numParams > 0) - { - csharpMonoBehaviourImports.Append(", "); - } - for (int i = 0; i < numParams; ++i) - { - Type paramType = paramTypes[i]; - if (paramType.IsValueType) - { - AppendCsharpTypeName( - paramType, - csharpMonoBehaviourImports); - csharpMonoBehaviourImports.Append(" param"); - csharpMonoBehaviourImports.Append(i); - } - else - { - csharpMonoBehaviourImports.Append("int param"); - csharpMonoBehaviourImports.Append(i); - } - if (i != numParams-1) - { - csharpMonoBehaviourImports.Append(", "); - } - } - csharpMonoBehaviourImports.Append(");\n\t\t\n"); - - // C# GetDelegate Call - csharpMonoBehaviourGetDelegateCalls.Append("\t\t\t"); - csharpMonoBehaviourGetDelegateCalls.Append(monoBehaviour.Name); - csharpMonoBehaviourGetDelegateCalls.Append(messageInfo.Name); - csharpMonoBehaviourGetDelegateCalls.Append(" = GetDelegate<"); - csharpMonoBehaviourGetDelegateCalls.Append(monoBehaviour.Name); - csharpMonoBehaviourGetDelegateCalls.Append(messageInfo.Name); - csharpMonoBehaviourGetDelegateCalls.Append("Delegate>(libraryHandle, \""); - csharpMonoBehaviourGetDelegateCalls.Append(monoBehaviour.Name); - csharpMonoBehaviourGetDelegateCalls.Append(messageInfo.Name); - csharpMonoBehaviourGetDelegateCalls.Append("\");\n"); - - // C++ Message - cppMonoBehaviourMessages.Append("DLLEXPORT void "); - cppMonoBehaviourMessages.Append(monoBehaviour.Name); - cppMonoBehaviourMessages.Append(messageInfo.Name); - cppMonoBehaviourMessages.Append("(int32_t thisHandle"); - if (numParams > 0) - { - cppMonoBehaviourMessages.Append(", "); - } - for (int i = 0; i < numParams; ++i) - { - Type paramType = paramTypes[i]; - if (paramType.IsValueType) - { - AppendCppTypeName( - paramType, - cppMonoBehaviourMessages); - cppMonoBehaviourMessages.Append(" param"); - cppMonoBehaviourMessages.Append(i); - } - else - { - cppMonoBehaviourMessages.Append("int32_t param"); - cppMonoBehaviourMessages.Append(i); - cppMonoBehaviourMessages.Append("Handle"); - } - if (i != numParams-1) - { - cppMonoBehaviourMessages.Append(", "); - } - } - cppMonoBehaviourMessages.Append(")\n{\n\t"); - AppendCppTypeName( - monoBehaviour.Namespace, - monoBehaviour.Name, - cppMonoBehaviourMessages); - cppMonoBehaviourMessages.Append(" thiz(thisHandle);\n"); - for (int i = 0; i < numParams; ++i) - { - Type paramType = paramTypes[i]; - if (!paramType.IsValueType) - { - cppMonoBehaviourMessages.Append('\t'); - AppendCppTypeName( - paramType, - cppMonoBehaviourMessages); - cppMonoBehaviourMessages.Append(" param"); - cppMonoBehaviourMessages.Append(i); - cppMonoBehaviourMessages.Append("(param"); - cppMonoBehaviourMessages.Append(i); - cppMonoBehaviourMessages.Append("Handle);\n"); - } - } - cppMonoBehaviourMessages.Append("\tthiz."); - cppMonoBehaviourMessages.Append(messageInfo.Name); - cppMonoBehaviourMessages.Append("("); - for (int i = 0; i < numParams; ++i) - { - cppMonoBehaviourMessages.Append("param"); - cppMonoBehaviourMessages.Append(i); - if (i != numParams-1) - { - cppMonoBehaviourMessages.Append(", "); - } - } - cppMonoBehaviourMessages.Append(");\n}\n\n"); + foreach (JsonMonoBehaviour jsonMonoBehaviour in doc.MonoBehaviours) + { + AppendMonoBehaviour( + jsonMonoBehaviour, + builders); } - - // C# Class extending MonoBehaviour (end) - AppendIndent(csharpIndent, csharpMonoBehaviours); - csharpMonoBehaviours.Append("}\n"); - AppendNamespaceEnding(csharpIndent, csharpMonoBehaviours); - - // C++ Type Definition (end) - AppendCppTypeDefinitionEnd( - false, - cppIndent, - cppTypeDefinitions); - } - - // Remove trailing chars (e.g. commas) for last elements - RemoveTrailingChars(csharpInitParams); - RemoveTrailingChars(csharpDelegateTypes); - RemoveTrailingChars(csharpInitCall); - RemoveTrailingChars(csharpFunctions); - RemoveTrailingChars(csharpMonoBehaviours); - RemoveTrailingChars(csharpMonoBehaviourDelegates); - RemoveTrailingChars(csharpMonoBehaviourImports); - RemoveTrailingChars(csharpMonoBehaviourGetDelegateCalls); - RemoveTrailingChars(cppFunctionPointers); - RemoveTrailingChars(cppTypeDeclarations); - RemoveTrailingChars(cppMethodDefinitions); - RemoveTrailingChars(cppTypeDefinitions); - RemoveTrailingChars(cppInitParams); - RemoveTrailingChars(cppInitBody); - RemoveTrailingChars(cppMonoBehaviourMessages); + } + + RemoveTrailingChars(builders); if (dryRun) { - LogStringBuilder("C# init params", csharpInitParams); - LogStringBuilder("C# delegates", csharpDelegateTypes); - LogStringBuilder("C# init call", csharpInitCall); - LogStringBuilder("C# functions", csharpFunctions); - LogStringBuilder("C# MonoBehaviours", csharpMonoBehaviours); - LogStringBuilder("C# MonoBehaviour Delegates", csharpMonoBehaviourDelegates); - LogStringBuilder("C# MonoBehaviour Imports", csharpMonoBehaviourImports); - LogStringBuilder("C# MonoBehaviour GetDelegate Calls", csharpMonoBehaviourGetDelegateCalls); - LogStringBuilder("C++ function pointers", cppFunctionPointers); - LogStringBuilder("C++ type declarations", cppTypeDeclarations); - LogStringBuilder("C++ type definitions", cppTypeDefinitions); - LogStringBuilder("C++ method definitions", cppMethodDefinitions); - LogStringBuilder("C++ init params", cppInitParams); - LogStringBuilder("C++ init body", cppInitBody); - LogStringBuilder("C++ MonoBehaviour messages", cppMonoBehaviourMessages); + LogStringBuilders(builders); } else { - // Inject into source files - string csharpContents = File.ReadAllText(CsharpPath); - string cppHeaderContents = File.ReadAllText(CppHeaderPath); - string cppSourceContents = File.ReadAllText(CppSourcePath); - csharpContents = InjectIntoString( - csharpContents, - "/*BEGIN INIT PARAMS*/\n", - "\n\t\t\t/*END INIT PARAMS*/", - csharpInitParams.ToString()); - csharpContents = InjectIntoString( - csharpContents, - "/*BEGIN DELEGATE TYPES*/\n", - "\n\t\t/*END DELEGATE TYPES*/", - csharpDelegateTypes.ToString()); - csharpContents = InjectIntoString( - csharpContents, - "/*BEGIN INIT CALL*/\n", - "\n\t\t\t\t/*END INIT CALL*/", - csharpInitCall.ToString()); - csharpContents = InjectIntoString( - csharpContents, - "/*BEGIN FUNCTIONS*/\n", - "\n\t\t/*END FUNCTIONS*/", - csharpFunctions.ToString()); - csharpContents = InjectIntoString( - csharpContents, - "/*BEGIN MONOBEHAVIOURS*/\n", - "\n/*END MONOBEHAVIOURS*/", - csharpMonoBehaviours.ToString()); - csharpContents = InjectIntoString( - csharpContents, - "/*BEGIN MONOBEHAVIOUR DELEGATES*/\n", - "\n\t\t/*END MONOBEHAVIOUR DELEGATES*/", - csharpMonoBehaviourDelegates.ToString()); - csharpContents = InjectIntoString( - csharpContents, - "/*BEGIN MONOBEHAVIOUR IMPORTS*/\n", - "\n\t\t/*END MONOBEHAVIOUR IMPORTS*/", - csharpMonoBehaviourImports.ToString()); - csharpContents = InjectIntoString( - csharpContents, - "/*BEGIN MONOBEHAVIOUR GETDELEGATE CALLS*/\n", - "\n\t\t\t/*END MONOBEHAVIOUR GETDELEGATE CALLS*/", - csharpMonoBehaviourGetDelegateCalls.ToString()); - cppSourceContents = InjectIntoString( - cppSourceContents, - "/*BEGIN FUNCTION POINTERS*/\n", - "\n\t/*END FUNCTION POINTERS*/", - cppFunctionPointers.ToString()); - cppHeaderContents = InjectIntoString( - cppHeaderContents, - "/*BEGIN TYPE DECLARATIONS*/\n", - "\n/*END TYPE DECLARATIONS*/", - cppTypeDeclarations.ToString()); - cppHeaderContents = InjectIntoString( - cppHeaderContents, - "/*BEGIN TYPE DEFINITIONS*/\n", - "\n/*END TYPE DEFINITIONS*/", - cppTypeDefinitions.ToString()); - cppSourceContents = InjectIntoString( - cppSourceContents, - "/*BEGIN METHOD DEFINITIONS*/\n", - "\n/*END METHOD DEFINITIONS*/", - cppMethodDefinitions.ToString()); - cppSourceContents = InjectIntoString( - cppSourceContents, - "/*BEGIN INIT PARAMS*/\n", - "\n\t/*END INIT PARAMS*/", - cppInitParams.ToString()); - cppSourceContents = InjectIntoString( - cppSourceContents, - "/*BEGIN INIT BODY*/\n", - "\n\t/*END INIT BODY*/", - cppInitBody.ToString()); - cppSourceContents = InjectIntoString( - cppSourceContents, - "/*BEGIN MONOBEHAVIOUR MESSAGES*/\n", - "\n/*END MONOBEHAVIOUR MESSAGES*/", - cppMonoBehaviourMessages.ToString()); - - File.WriteAllText(CsharpPath, csharpContents); - File.WriteAllText(CppHeaderPath, cppHeaderContents); - File.WriteAllText(CppSourcePath, cppSourceContents); + InjectBuilders(builders); Debug.Log( "Can't auto-refresh due to a bug in Unity. " + "Please manually refresh assets with Assets -> Refresh."); @@ -1117,9 +417,19 @@ static Type GetType( string typeName, Assembly assembly) { - return assembly.GetType(typeName) + Type type = assembly.GetType(typeName) ?? typeof(string).Assembly.GetType(typeName) + ?? typeof(Vector3).Assembly.GetType(typeName) ?? typeof(Bindings).Assembly.GetType(typeName); + if (type == null) + { + StringBuilder errorBuilder = new StringBuilder(1024); + errorBuilder.Append("Couldn't find type \""); + errorBuilder.Append(typeName); + errorBuilder.Append('"'); + throw new Exception(errorBuilder.ToString()); + } + return type; } static MethodInfo GetMethod( @@ -1130,49 +440,74 @@ static MethodInfo GetMethod( { foreach (MethodInfo method in type.GetMethods()) { - if (method.Name == methodName) + if (method.Name != methodName) + { + continue; + } + if (returnTypeName != null) { - if (returnTypeName != null) + if (string.IsNullOrEmpty(method.ReturnType.Namespace)) { - if (string.IsNullOrEmpty(method.ReturnType.Namespace)) + if (method.ReturnType.Name != returnTypeName) { - if (method.ReturnType.Name != returnTypeName) - { - continue; - } + continue; } - else + } + else + { + if ( + method.ReturnType.Namespace + "." + method.ReturnType.Name + != returnTypeName) { - if (method.ReturnType.Namespace + "." + method.ReturnType.Name != returnTypeName) - { - continue; - } + continue; } } - System.Reflection.ParameterInfo[] parameters = method.GetParameters(); - for (int i = 0; i < parameters.Length; ++i) + } + ParameterInfo[] parameters = ConvertParameters( + method.GetParameters()); + for (int i = 0; i < parameters.Length; ++i) + { + Type paramType = parameters[i].DereferencedParameterType; + if (string.IsNullOrEmpty(paramType.Namespace)) { - Type paramType = parameters[i].ParameterType; - if (string.IsNullOrEmpty(paramType.Namespace)) + if (paramType.Name != paramTypeNames[i]) { - if (paramType.Name != paramTypeNames[i]) - { - goto mismatch; - } + goto mismatch; } - else + } + else + { + if ( + paramType.Namespace + "." + paramType.Name + != paramTypeNames[i]) { - if (paramType.Namespace + "." + paramType.Name != paramTypeNames[i]) - { - goto mismatch; - } + goto mismatch; } } - return method; - mismatch:; + } + return method; + mismatch:; + } + + // Throw an exception so the user knows what to fix in the JSON + StringBuilder errorBuilder = new StringBuilder(1024); + errorBuilder.Append("Method \""); + errorBuilder.Append(returnTypeName ?? "void"); + errorBuilder.Append(' '); + AppendCsharpTypeName(type, errorBuilder); + errorBuilder.Append('.'); + errorBuilder.Append(methodName); + errorBuilder.Append('('); + for (int i = 0; i < paramTypeNames.Length; ++i) + { + errorBuilder.Append(paramTypeNames[i]); + if (i != paramTypeNames.Length - 1) + { + errorBuilder.Append(", "); } } - return null; + errorBuilder.Append(")\" not found"); + throw new Exception(errorBuilder.ToString()); } static void AppendTypeNames( @@ -1201,19 +536,26 @@ static void AppendNamespace( { do { - int dotIndex = namespaceName.IndexOf( + int separatorIndex = namespaceName.IndexOf( '.', startIndex); - if (dotIndex < 0) + if (separatorIndex < 0) { + separatorIndex = namespaceName.IndexOf( + '+', + startIndex); + if (separatorIndex < 0) + { + break; + } break; } output.Append( namespaceName, startIndex, - dotIndex - startIndex); + separatorIndex - startIndex); output.Append(separator); - startIndex = dotIndex + 1; + startIndex = separatorIndex + 1; } while (true); output.Append( @@ -1234,6 +576,12 @@ static ParameterInfo[] ConvertParameters( ParameterInfo info = new ParameterInfo(); info.Name = reflectionInfo.Name; info.ParameterType = reflectionInfo.ParameterType; + info.IsOut = reflectionInfo.IsOut; + info.IsRef = !info.IsOut && info.ParameterType.IsByRef; + info.DereferencedParameterType = info.IsRef || info.IsOut + ? info.ParameterType.GetElementType() + : info.ParameterType; + info.IsStruct = info.DereferencedParameterType.IsValueType; parameters[i] = info; } return parameters; @@ -1250,141 +598,553 @@ static ParameterInfo[] ConvertParameters( ParameterInfo info = new ParameterInfo(); info.Name = "param" + i; info.ParameterType = paramType; + info.IsOut = false; + info.IsRef = false; + info.DereferencedParameterType = paramType; + info.IsStruct = info.DereferencedParameterType.IsValueType; parameters[i] = info; } return parameters; } - static void AppendGetter( - string fieldName, - string enclosingTypeNameLower, - string syntaxType, - ParameterInfo[] parameters, - bool isStatic, - Type enclosingType, - Type fieldType, - int indent, - StringBuilders stringBuilders) + static string GetTypeNameLower(Type type) { - // Build uppercased field name - stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append(char.ToUpper(fieldName[0])); - stringBuilders.TempStrBuilder.Append( - fieldName, - 1, - fieldName.Length-1); - string fieldNameUpper = stringBuilders.TempStrBuilder.ToString(); - - // Build uppercase function name - stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append(enclosingType.Name); - stringBuilders.TempStrBuilder.Append(syntaxType); - stringBuilders.TempStrBuilder.Append("Get"); - stringBuilders.TempStrBuilder.Append(fieldNameUpper); - string funcName = stringBuilders.TempStrBuilder.ToString(); + return char.ToLower(type.Name[0]) + type.Name.Substring(1); + } + + static bool IsStatic(Type type) + { + return type.IsAbstract && type.IsSealed; + } + + static void AppendAssembly( + JsonAssembly jsonAssembly, + StringBuilders builders) + { + Assembly assembly = Assembly.LoadFrom(jsonAssembly.Path); + foreach (JsonType jsonType in jsonAssembly.Types) + { + AppendType( + jsonType, + assembly, + builders); + } + } + + static void AppendType( + JsonType jsonType, + Assembly assembly, + StringBuilders builders) + { + Type type = GetType(jsonType.Name, assembly); + string typeNameLower = GetTypeNameLower(type); + bool isStatic = IsStatic(type); - // Build lowercase function name - stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append(enclosingTypeNameLower); - stringBuilders.TempStrBuilder.Append(syntaxType); - stringBuilders.TempStrBuilder.Append("Get"); - stringBuilders.TempStrBuilder.Append(fieldNameUpper); - string funcNameLower = stringBuilders.TempStrBuilder.ToString(); + // C++ type declaration + int indent = AppendCppTypeDeclaration( + type.Namespace, + type.Name, + isStatic, + builders.CppTypeDeclarations); - // Build method name - stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append("Get"); - stringBuilders.TempStrBuilder.Append(fieldNameUpper); - string methodName = stringBuilders.TempStrBuilder.ToString(); + // C++ type definition (beginning) + AppendCppTypeDefinitionBegin( + type.Namespace, + type.Name, + type.BaseType.Namespace, + type.BaseType.Name, + isStatic, + indent, + builders.CppTypeDefinitions); - // C# init param declaration - AppendCsharpInitParam( - funcNameLower, - stringBuilders.CsharpInitParams); - - // C# delegate type - AppendCsharpDelegateType( - funcName, + // C++ method definition + int cppMethodDefinitionsIndent = AppendCppMethodDefinitionBegin( + type.Namespace, + type.Name, + type.BaseType.Namespace, + type.BaseType.Name, isStatic, - fieldType, + indent, + builders.CppMethodDefinitions); + + // Constructors + if (jsonType.Constructors != null) + { + foreach (JsonConstructor jsonCtor in jsonType.Constructors) + { + AppendConstructor( + jsonCtor, + assembly, + type, + typeNameLower, + indent, + builders); + } + } + + // Properties + if (jsonType.Properties != null) + { + foreach (string jsonPropertyName in jsonType.Properties) + { + AppendProperty( + jsonPropertyName, + type, + typeNameLower, + indent, + builders); + } + } + + // Fields + if (jsonType.Fields != null) + { + foreach (string jsonFieldName in jsonType.Fields) + { + AppendField( + jsonFieldName, + type, + typeNameLower, + indent, + builders + ); + } + } + + // Methods + if (jsonType.Methods != null) + { + foreach (JsonMethod jsonMethod in jsonType.Methods) + { + AppendMethod( + jsonMethod, + assembly, + type, + typeNameLower, + indent, + builders); + } + } + + // C++ type definition (ending) + AppendCppTypeDefinitionEnd( + isStatic, + indent, + builders.CppTypeDefinitions); + + // C++ method definition (ending) + AppendCppMethodDefinitionEnd( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + } + + static void AppendConstructor( + JsonConstructor jsonCtor, + Assembly assembly, + Type enclosingType, + string typeNameLower, + int indent, + StringBuilders builders) + { + Type[] paramTypes = GetTypes(jsonCtor.Types, assembly); + ConstructorInfo ctor = enclosingType.GetConstructor(paramTypes); + ParameterInfo[] parameters = ConvertParameters( + ctor.GetParameters()); + + // Build uppercase function name + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append(enclosingType.Name); + builders.TempStrBuilder.Append("Constructor"); + AppendTypeNames(paramTypes, builders.TempStrBuilder); + string funcName = builders.TempStrBuilder.ToString(); + + // Build lowercase function name + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append(typeNameLower); + builders.TempStrBuilder.Append("Constructor"); + AppendTypeNames(paramTypes, builders.TempStrBuilder); + string funcNameLower = builders.TempStrBuilder.ToString(); + + // C# init param declaration + AppendCsharpInitParam(funcNameLower, builders.CsharpInitParams); + + // C# delegate type + AppendCsharpDelegateType( + funcName, + true, + typeof(int), parameters, - stringBuilders.CsharpDelegateTypes); + builders.CsharpDelegateTypes); + // C# init call param + AppendCsharpInitCallArg(funcName, builders.CsharpInitCall); + + // C# function + AppendCsharpFunctionBeginning( + enclosingType, + funcName, + true, + typeof(int), + null, + parameters, + builders.CsharpFunctions); + builders.CsharpFunctions.Append("NativeScript.Bindings.StoreObject("); + builders.CsharpFunctions.Append("new "); + AppendCsharpTypeName( + enclosingType, + builders.CsharpFunctions); + AppendCsharpFunctionCallParameters( + true, + parameters, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(");"); + AppendCsharpFunctionReturn( + parameters, + typeof(int), + builders.CsharpFunctions); + + // C++ function pointer + AppendCppFunctionPointerDefinition( + funcName, + true, + parameters, + enclosingType, + builders.CppFunctionPointers); + + // C++ type declaration + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + enclosingType.Name, + false, + null, + null, + parameters, + builders.CppTypeDefinitions); + + // C++ method definition + AppendCppMethodDefinition( + enclosingType, + null, + enclosingType.Name, + null, + parameters, + indent, + builders.CppMethodDefinitions); + AppendIndent(indent + 1, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(" : "); + AppendCppTypeName( + enclosingType.BaseType, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("(0)\n"); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendCppPluginFunctionCall( + true, + enclosingType, + funcName, + parameters, + indent + 1, + builders.CppMethodDefinitions); + AppendIndent(indent + 1, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("SetHandle(returnValue);\n"); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + + // C++ init params + AppendCppInitParam( + funcNameLower, + true, + parameters, + enclosingType, + builders.CppInitParams); + + // C++ init body + AppendCppInitBody( + funcName, + funcNameLower, + builders.CppInitBody); + } + + static void AppendProperty( + string jsonPropertyName, + Type type, + string typeNameLower, + int indent, + StringBuilders builders) + { + PropertyInfo property = type.GetProperty( + jsonPropertyName); + MethodInfo getMethod = property.GetGetMethod(); + if (getMethod != null && getMethod.IsPublic) + { + AppendGetter( + property.Name, + typeNameLower, + "Property", + ConvertParameters(getMethod.GetParameters()), + getMethod.IsStatic, + type, + property.PropertyType, + indent, + builders); + } + MethodInfo setMethod = property.GetSetMethod(); + if (setMethod != null && setMethod.IsPublic) + { + AppendSetter( + property.Name, + "Property", + typeNameLower, + ConvertParameters(setMethod.GetParameters()), + setMethod.IsStatic, + type, + property.PropertyType, + indent, + builders); + } + } + + static void AppendField( + string jsonFieldName, + Type type, + string typeNameLower, + int indent, + StringBuilders builders + ) + { + FieldInfo field = type.GetField(jsonFieldName); + AppendGetter( + field.Name, + typeNameLower, + "Field", + new ParameterInfo[0], + field.IsStatic, + type, + field.FieldType, + indent, + builders); + ParameterInfo setParam = new ParameterInfo(); + setParam.Name = "value"; + setParam.ParameterType = field.FieldType; + setParam.IsOut = false; + setParam.IsRef = false; + setParam.DereferencedParameterType = setParam.ParameterType; + setParam.IsStruct = setParam.DereferencedParameterType.IsValueType; + ParameterInfo[] parameters = new []{ setParam }; + AppendSetter( + field.Name, + "Field", + typeNameLower, + parameters, + field.IsStatic, + type, + field.FieldType, + indent, + builders); + } + + static void AppendMethod( + JsonMethod jsonMethod, + Assembly assembly, + Type type, + string typeNameLower, + int indent, + StringBuilders builders) + { + MethodInfo method = GetMethod( + type, + jsonMethod.Name, + jsonMethod.ReturnType, + jsonMethod.ParamTypes); + ParameterInfo[] parameters = ConvertParameters( + method.GetParameters()); + Type[] paramTypes = GetTypes( + jsonMethod.ParamTypes, + assembly); + + if (jsonMethod.GenericTypes != null) + { + foreach (JsonGenericType genericType in jsonMethod.GenericTypes) + { + Type returnType; + if (genericType.Name == method.ReturnType.Name) + { + returnType = GetType(genericType.Type, assembly); + } + else + { + returnType = method.ReturnType; + } + Type[] typeParams = new[] { returnType }; + + AppendMethod( + type, + assembly, + typeNameLower, + method.Name, + method.IsStatic, + returnType, + typeParams, + parameters, + paramTypes, + indent, + builders); + } + } + else + { + AppendMethod( + type, + assembly, + typeNameLower, + method.Name, + method.IsStatic, + method.ReturnType, + null, + parameters, + paramTypes, + indent, + builders); + } + } + + static void AppendMethod( + Type type, + Assembly assembly, + string typeNameLower, + string methodName, + bool isStatic, + Type returnType, + Type[] typeParameters, + ParameterInfo[] parameters, + Type[] paramTypes, + int indent, + StringBuilders stringBuilders) + { + // Build uppercase function name + stringBuilders.TempStrBuilder.Length = 0; + AppendMethodFuncName( + type.Name, + methodName, + paramTypes, + typeParameters, + stringBuilders.TempStrBuilder); + string funcName = stringBuilders.TempStrBuilder.ToString(); + + // Build lowercase function name + stringBuilders.TempStrBuilder.Length = 0; + AppendMethodFuncName( + typeNameLower, + methodName, + paramTypes, + typeParameters, + stringBuilders.TempStrBuilder); + string funcNameLower = stringBuilders.TempStrBuilder.ToString(); + + // C# init param declaration + AppendCsharpInitParam( + funcNameLower, + stringBuilders.CsharpInitParams); + + // C# delegate type + AppendCsharpDelegateType( + funcName, + isStatic, + returnType, + parameters, + stringBuilders.CsharpDelegateTypes); + // C# init call param AppendCsharpInitCallArg( funcName, stringBuilders.CsharpInitCall); - + // C# function AppendCsharpFunctionBeginning( - enclosingType, + type, funcName, isStatic, - fieldType, - null, + returnType, + typeParameters, parameters, stringBuilders.CsharpFunctions); AppendCsharpFunctionCallSubject( - enclosingType, + type, isStatic, stringBuilders.CsharpFunctions); - stringBuilders.CsharpFunctions.Append(fieldName); + stringBuilders.CsharpFunctions.Append(methodName); + AppendCSharpTypeParameters( + typeParameters, + stringBuilders.CsharpFunctions); + AppendCsharpFunctionCallParameters( + isStatic, + parameters, + stringBuilders.CsharpFunctions); stringBuilders.CsharpFunctions.Append(';'); AppendCsharpFunctionReturn( - fieldType, + parameters, + returnType, stringBuilders.CsharpFunctions); - + // C++ function pointer AppendCppFunctionPointerDefinition( funcName, isStatic, parameters, - fieldType, + returnType, stringBuilders.CppFunctionPointers); - + // C++ method declaration - AppendIndent(indent + 1, stringBuilders.CppTypeDefinitions); + AppendIndent( + indent + 1, + stringBuilders.CppTypeDefinitions); AppendCppMethodDeclaration( methodName, isStatic, - fieldType, - null, + returnType, + typeParameters, parameters, stringBuilders.CppTypeDefinitions); // C++ method definition AppendCppMethodDefinition( - enclosingType, - fieldType, + type, + returnType, methodName, - null, + typeParameters, parameters, indent, stringBuilders.CppMethodDefinitions); - AppendIndent(indent, stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append("{\n"); - AppendIndent(indent + 1, stringBuilders.CppMethodDefinitions); - AppendCppMethodReturn( - fieldType, + AppendIndent( + indent, stringBuilders.CppMethodDefinitions); + stringBuilders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( isStatic, - fieldType, + returnType, funcName, parameters, + indent + 1, stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append(";\n"); - AppendIndent(indent, stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append("}\n"); - AppendIndent(indent, stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append("\n"); - + AppendCppMethodReturn( + returnType, + indent + 1, + stringBuilders.CppMethodDefinitions); + AppendIndent( + indent, + stringBuilders.CppMethodDefinitions); + stringBuilders.CppMethodDefinitions.Append("}\n\t\n"); + // C++ init params AppendCppInitParam( funcNameLower, isStatic, parameters, - fieldType, + returnType, stringBuilders.CppInitParams); // C++ init body @@ -1394,10 +1154,424 @@ static void AppendGetter( stringBuilders.CppInitBody); } - static void AppendSetter( + static void AppendMethodFuncName( + string typeName, + string methodName, + Type[] paramTypes, + Type[] typeParameters, + StringBuilder output) + { + output.Append(typeName); + output.Append("Method"); + output.Append(methodName); + AppendTypeNames(paramTypes, output); + if (typeParameters != null) + { + foreach (Type typeParam in typeParameters) + { + AppendNamespace( + typeParam.Namespace, + string.Empty, + output); + output.Append(typeParam.Name); + } + } + } + + static void AppendCSharpTypeParameters( + Type[] typeParameters, + StringBuilder output + ) + { + if (typeParameters != null) + { + output.Append('<'); + for (int i = 0; i < typeParameters.Length; ++i) + { + Type typeParam = typeParameters[i]; + AppendCsharpTypeName(typeParam, output); + if (i != typeParameters.Length - 1) + { + output.Append(", "); + } + } + output.Append('>'); + } + } + + static void AppendMonoBehaviour( + JsonMonoBehaviour jsonMonoBehaviour, + StringBuilders builders) + { + // C++ Type Declaration + int cppIndent = AppendCppTypeDeclaration( + jsonMonoBehaviour.Namespace, + jsonMonoBehaviour.Name, + false, + builders.CppTypeDeclarations); + + // C++ Type Definition (begin) + AppendCppTypeDefinitionBegin( + jsonMonoBehaviour.Namespace, + jsonMonoBehaviour.Name, + "UnityEngine", + "MonoBehaviour", + false, + cppIndent, + builders.CppTypeDefinitions + ); + + // C++ method definition + int cppMethodDefinitionsIndent = AppendCppMethodDefinitionBegin( + jsonMonoBehaviour.Namespace, + jsonMonoBehaviour.Name, + "UnityEngine", + "MonoBehaviour", + false, + cppIndent, + builders.CppMethodDefinitions); + AppendCppMethodDefinitionEnd( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + + // C# Class extending MonoBehaviour + int csharpIndent = AppendNamespaceBeginning( + jsonMonoBehaviour.Namespace, + builders.CsharpMonoBehaviours); + AppendIndent(csharpIndent, builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("public class "); + builders.CsharpMonoBehaviours.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviours.Append(" : UnityEngine.MonoBehaviour\n"); + AppendIndent(csharpIndent, builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("{\n"); + AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("int thisHandle;\n"); + AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append('\n'); + AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("public "); + builders.CsharpMonoBehaviours.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviours.Append("()\n"); + AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("{\n"); + AppendIndent(csharpIndent + 2, builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("thisHandle = NativeScript.Bindings.StoreObject(this);\n"); + AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("}\n"); + if (jsonMonoBehaviour.Messages.Length > 0) + { + AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append('\n'); + } + for ( + int messageIndex = 0; + messageIndex < jsonMonoBehaviour.Messages.Length; + ++messageIndex) + { + string message = jsonMonoBehaviour.Messages[messageIndex]; + MessageInfo messageInfo = null; + foreach (MessageInfo mi in messageInfos) + { + if (mi.Name == message) + { + messageInfo = mi; + break; + } + } + Type[] paramTypes = messageInfo.ParameterTypes; + int numParams = paramTypes.Length; + ParameterInfo[] parameters = ConvertParameters( + paramTypes); + + // C++ Method Declaration + AppendIndent( + cppIndent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + messageInfo.Name, + false, + typeof(void), + null, + parameters, + builders.CppTypeDefinitions); + + AppendIndent( + csharpIndent + 1, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("public "); + AppendCsharpTypeName( + typeof(void), + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append(' '); + builders.CsharpMonoBehaviours.Append(messageInfo.Name); + builders.CsharpMonoBehaviours.Append('('); + for (int i = 0; i < numParams; ++i) + { + Type paramType = paramTypes[i]; + AppendCsharpTypeName( + paramType, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append(' '); + builders.CsharpMonoBehaviours.Append("param"); + builders.CsharpMonoBehaviours.Append(i); + if (i != numParams - 1) + { + builders.CsharpMonoBehaviours.Append(", "); + } + } + builders.CsharpMonoBehaviours.Append(")\n"); + AppendIndent( + csharpIndent + 1, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("{\n"); + for (int i = 0; i < numParams; ++i) + { + if (!parameters[i].IsStruct) + { + AppendIndent( + csharpIndent + 2, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("int param"); + builders.CsharpMonoBehaviours.Append(i); + builders.CsharpMonoBehaviours.Append("Handle = "); + builders.CsharpMonoBehaviours.Append("NativeScript.Bindings.GetHandle("); + builders.CsharpMonoBehaviours.Append("param"); + builders.CsharpMonoBehaviours.Append(i); + builders.CsharpMonoBehaviours.Append(");\n"); + AppendIndent( + csharpIndent + 2, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("if (param"); + builders.CsharpMonoBehaviours.Append(i); + builders.CsharpMonoBehaviours.Append("Handle < 0)\n"); + AppendIndent( + csharpIndent + 2, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("{\n"); + AppendIndent( + csharpIndent + 3, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("param"); + builders.CsharpMonoBehaviours.Append(i); + builders.CsharpMonoBehaviours.Append("Handle = NativeScript.Bindings.StoreObject("); + builders.CsharpMonoBehaviours.Append("param"); + builders.CsharpMonoBehaviours.Append(i); + builders.CsharpMonoBehaviours.Append(");\n"); + AppendIndent( + csharpIndent + 2, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("}\n"); + } + } + AppendIndent( + csharpIndent + 2, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("NativeScript.Bindings."); + builders.CsharpMonoBehaviours.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviours.Append(messageInfo.Name); + builders.CsharpMonoBehaviours.Append("(thisHandle"); + if (numParams > 0) + { + builders.CsharpMonoBehaviours.Append(", "); + } + for (int i = 0; i < numParams; ++i) + { + builders.CsharpMonoBehaviours.Append("param"); + builders.CsharpMonoBehaviours.Append(i); + if (!parameters[i].IsStruct) + { + builders.CsharpMonoBehaviours.Append("Handle"); + } + if (i != numParams - 1) + { + builders.CsharpMonoBehaviours.Append(", "); + } + } + builders.CsharpMonoBehaviours.Append(");\n"); + AppendIndent( + csharpIndent + 1, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("}\n"); + if (messageIndex != jsonMonoBehaviour.Messages.Length - 1) + { + AppendIndent( + csharpIndent + 1, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append('\n'); + } + + // C# Delegate + builders.CsharpMonoBehaviourDelegates.Append( + "\t\tpublic delegate void "); + builders.CsharpMonoBehaviourDelegates.Append( + jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviourDelegates.Append( + messageInfo.Name); + builders.CsharpMonoBehaviourDelegates.Append( + "Delegate(int thisHandle"); + if (numParams > 0) + { + builders.CsharpMonoBehaviourDelegates.Append(", "); + } + for (int i = 0; i < numParams; ++i) + { + ParameterInfo param = parameters[i]; + if (param.IsStruct) + { + AppendCsharpTypeName( + param.ParameterType, + builders.CsharpMonoBehaviourDelegates); + builders.CsharpMonoBehaviourDelegates.Append(" param"); + builders.CsharpMonoBehaviourDelegates.Append(i); + } + else + { + builders.CsharpMonoBehaviourDelegates.Append("int param"); + builders.CsharpMonoBehaviourDelegates.Append(i); + } + if (i != numParams-1) + { + builders.CsharpMonoBehaviourDelegates.Append(", "); + } + } + builders.CsharpMonoBehaviourDelegates.Append(");\n"); + builders.CsharpMonoBehaviourDelegates.Append("\t\tpublic static "); + builders.CsharpMonoBehaviourDelegates.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviourDelegates.Append(messageInfo.Name); + builders.CsharpMonoBehaviourDelegates.Append("Delegate "); + builders.CsharpMonoBehaviourDelegates.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviourDelegates.Append(messageInfo.Name); + builders.CsharpMonoBehaviourDelegates.Append(";\n\t\t\n"); + + // C# Import + builders.CsharpMonoBehaviourImports.Append("\t\t[DllImport(Constants.PluginName)]\n"); + builders.CsharpMonoBehaviourImports.Append("\t\tpublic static extern void "); + builders.CsharpMonoBehaviourImports.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviourImports.Append(messageInfo.Name); + builders.CsharpMonoBehaviourImports.Append("(int thisHandle"); + if (numParams > 0) + { + builders.CsharpMonoBehaviourImports.Append(", "); + } + for (int i = 0; i < numParams; ++i) + { + ParameterInfo param = parameters[i]; + if (param.IsStruct) + { + AppendCsharpTypeName( + param.ParameterType, + builders.CsharpMonoBehaviourImports); + builders.CsharpMonoBehaviourImports.Append(" param"); + builders.CsharpMonoBehaviourImports.Append(i); + } + else + { + builders.CsharpMonoBehaviourImports.Append("int param"); + builders.CsharpMonoBehaviourImports.Append(i); + } + if (i != numParams-1) + { + builders.CsharpMonoBehaviourImports.Append(", "); + } + } + builders.CsharpMonoBehaviourImports.Append(");\n\t\t\n"); + + // C# GetDelegate Call + builders.CsharpMonoBehaviourGetDelegateCalls.Append("\t\t\t"); + builders.CsharpMonoBehaviourGetDelegateCalls.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviourGetDelegateCalls.Append(messageInfo.Name); + builders.CsharpMonoBehaviourGetDelegateCalls.Append(" = GetDelegate<"); + builders.CsharpMonoBehaviourGetDelegateCalls.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviourGetDelegateCalls.Append(messageInfo.Name); + builders.CsharpMonoBehaviourGetDelegateCalls.Append("Delegate>(libraryHandle, \""); + builders.CsharpMonoBehaviourGetDelegateCalls.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviourGetDelegateCalls.Append(messageInfo.Name); + builders.CsharpMonoBehaviourGetDelegateCalls.Append("\");\n"); + + // C++ Message + builders.CppMonoBehaviourMessages.Append("DLLEXPORT void "); + builders.CppMonoBehaviourMessages.Append(jsonMonoBehaviour.Name); + builders.CppMonoBehaviourMessages.Append(messageInfo.Name); + builders.CppMonoBehaviourMessages.Append("(int32_t thisHandle"); + if (numParams > 0) + { + builders.CppMonoBehaviourMessages.Append(", "); + } + for (int i = 0; i < numParams; ++i) + { + ParameterInfo param = parameters[i]; + if (param.IsStruct) + { + AppendCppTypeName( + param.ParameterType, + builders.CppMonoBehaviourMessages); + builders.CppMonoBehaviourMessages.Append(" param"); + builders.CppMonoBehaviourMessages.Append(i); + } + else + { + builders.CppMonoBehaviourMessages.Append("int32_t param"); + builders.CppMonoBehaviourMessages.Append(i); + builders.CppMonoBehaviourMessages.Append("Handle"); + } + if (i != numParams-1) + { + builders.CppMonoBehaviourMessages.Append(", "); + } + } + builders.CppMonoBehaviourMessages.Append(")\n{\n\t"); + AppendCppTypeName( + jsonMonoBehaviour.Namespace, + jsonMonoBehaviour.Name, + builders.CppMonoBehaviourMessages); + builders.CppMonoBehaviourMessages.Append(" thiz(thisHandle);\n"); + for (int i = 0; i < numParams; ++i) + { + ParameterInfo param = parameters[i]; + if (!param.IsStruct) + { + builders.CppMonoBehaviourMessages.Append('\t'); + AppendCppTypeName( + param.ParameterType, + builders.CppMonoBehaviourMessages); + builders.CppMonoBehaviourMessages.Append(" param"); + builders.CppMonoBehaviourMessages.Append(i); + builders.CppMonoBehaviourMessages.Append("(param"); + builders.CppMonoBehaviourMessages.Append(i); + builders.CppMonoBehaviourMessages.Append("Handle);\n"); + } + } + builders.CppMonoBehaviourMessages.Append("\tthiz."); + builders.CppMonoBehaviourMessages.Append(messageInfo.Name); + builders.CppMonoBehaviourMessages.Append("("); + for (int i = 0; i < numParams; ++i) + { + builders.CppMonoBehaviourMessages.Append("param"); + builders.CppMonoBehaviourMessages.Append(i); + if (i != numParams-1) + { + builders.CppMonoBehaviourMessages.Append(", "); + } + } + builders.CppMonoBehaviourMessages.Append(");\n}\n\n"); + } + + // C# Class extending MonoBehaviour (end) + AppendIndent(csharpIndent, builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("}\n"); + AppendNamespaceEnding(csharpIndent, builders.CsharpMonoBehaviours); + + // C++ Type Definition (end) + AppendCppTypeDefinitionEnd( + false, + cppIndent, + builders.CppTypeDefinitions); + } + + static void AppendGetter( string fieldName, - string syntaxType, string enclosingTypeNameLower, + string syntaxType, ParameterInfo[] parameters, bool isStatic, Type enclosingType, @@ -1418,7 +1592,7 @@ static void AppendSetter( stringBuilders.TempStrBuilder.Length = 0; stringBuilders.TempStrBuilder.Append(enclosingType.Name); stringBuilders.TempStrBuilder.Append(syntaxType); - stringBuilders.TempStrBuilder.Append("Set"); + stringBuilders.TempStrBuilder.Append("Get"); stringBuilders.TempStrBuilder.Append(fieldNameUpper); string funcName = stringBuilders.TempStrBuilder.ToString(); @@ -1426,13 +1600,13 @@ static void AppendSetter( stringBuilders.TempStrBuilder.Length = 0; stringBuilders.TempStrBuilder.Append(enclosingTypeNameLower); stringBuilders.TempStrBuilder.Append(syntaxType); - stringBuilders.TempStrBuilder.Append("Set"); + stringBuilders.TempStrBuilder.Append("Get"); stringBuilders.TempStrBuilder.Append(fieldNameUpper); string funcNameLower = stringBuilders.TempStrBuilder.ToString(); // Build method name stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append("Set"); + stringBuilders.TempStrBuilder.Append("Get"); stringBuilders.TempStrBuilder.Append(fieldNameUpper); string methodName = stringBuilders.TempStrBuilder.ToString(); @@ -1440,26 +1614,26 @@ static void AppendSetter( AppendCsharpInitParam( funcNameLower, stringBuilders.CsharpInitParams); - + // C# delegate type AppendCsharpDelegateType( funcName, isStatic, - typeof(void), + fieldType, parameters, stringBuilders.CsharpDelegateTypes); - + // C# init call param AppendCsharpInitCallArg( funcName, stringBuilders.CsharpInitCall); - + // C# function AppendCsharpFunctionBeginning( enclosingType, funcName, isStatic, - typeof(void), + fieldType, null, parameters, stringBuilders.CsharpFunctions); @@ -1468,38 +1642,26 @@ static void AppendSetter( isStatic, stringBuilders.CsharpFunctions); stringBuilders.CsharpFunctions.Append(fieldName); - stringBuilders.CsharpFunctions.Append(" = "); - if (fieldType.IsValueType) - { - stringBuilders.CsharpFunctions.Append("value;"); - } - else - { - stringBuilders.CsharpFunctions.Append('('); - AppendCsharpTypeName( - fieldType, - stringBuilders.CsharpFunctions); - stringBuilders.CsharpFunctions.Append( - ")ObjectStore.Get(valueHandle);"); - } + stringBuilders.CsharpFunctions.Append(';'); AppendCsharpFunctionReturn( - typeof(void), + parameters, + fieldType, stringBuilders.CsharpFunctions); - + // C++ function pointer AppendCppFunctionPointerDefinition( funcName, isStatic, parameters, - typeof(void), + fieldType, stringBuilders.CppFunctionPointers); - + // C++ method declaration AppendIndent(indent + 1, stringBuilders.CppTypeDefinitions); AppendCppMethodDeclaration( methodName, isStatic, - typeof(void), + fieldType, null, parameters, stringBuilders.CppTypeDefinitions); @@ -1507,7 +1669,7 @@ static void AppendSetter( // C++ method definition AppendCppMethodDefinition( enclosingType, - typeof(void), + fieldType, methodName, null, parameters, @@ -1515,25 +1677,28 @@ static void AppendSetter( stringBuilders.CppMethodDefinitions); AppendIndent(indent, stringBuilders.CppMethodDefinitions); stringBuilders.CppMethodDefinitions.Append("{\n"); - AppendIndent(indent + 1, stringBuilders.CppMethodDefinitions); AppendCppPluginFunctionCall( isStatic, - typeof(void), + fieldType, funcName, parameters, + indent + 1, + stringBuilders.CppMethodDefinitions); + AppendCppMethodReturn( + fieldType, + indent + 1, stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append(";\n"); AppendIndent(indent, stringBuilders.CppMethodDefinitions); stringBuilders.CppMethodDefinitions.Append("}\n"); AppendIndent(indent, stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append('\n'); - + stringBuilders.CppMethodDefinitions.Append("\n"); + // C++ init params AppendCppInitParam( funcNameLower, isStatic, parameters, - typeof(void), + fieldType, stringBuilders.CppInitParams); // C++ init body @@ -1543,111 +1708,85 @@ static void AppendSetter( stringBuilders.CppInitBody); } - static void AppendMethod( - Type type, - string typeNameLower, - string methodName, - bool isStatic, - Type returnType, - Type[] typeParameters, + static void AppendSetter( + string fieldName, + string syntaxType, + string enclosingTypeNameLower, ParameterInfo[] parameters, - Type[] paramTypes, + bool isStatic, + Type enclosingType, + Type fieldType, int indent, StringBuilders stringBuilders) { + // Build uppercased field name + stringBuilders.TempStrBuilder.Length = 0; + stringBuilders.TempStrBuilder.Append(char.ToUpper(fieldName[0])); + stringBuilders.TempStrBuilder.Append( + fieldName, + 1, + fieldName.Length-1); + string fieldNameUpper = stringBuilders.TempStrBuilder.ToString(); + // Build uppercase function name stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append(type.Name); - stringBuilders.TempStrBuilder.Append("Method"); - stringBuilders.TempStrBuilder.Append(methodName); - AppendTypeNames(paramTypes, stringBuilders.TempStrBuilder); - if (typeParameters != null) - { - foreach (Type typeParam in typeParameters) - { - AppendNamespace( - typeParam.Namespace, - string.Empty, - stringBuilders.TempStrBuilder); - stringBuilders.TempStrBuilder.Append(typeParam.Name); - } - } + stringBuilders.TempStrBuilder.Append(enclosingType.Name); + stringBuilders.TempStrBuilder.Append(syntaxType); + stringBuilders.TempStrBuilder.Append("Set"); + stringBuilders.TempStrBuilder.Append(fieldNameUpper); string funcName = stringBuilders.TempStrBuilder.ToString(); // Build lowercase function name stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append(typeNameLower); - stringBuilders.TempStrBuilder.Append("Method"); - stringBuilders.TempStrBuilder.Append(methodName); - AppendTypeNames(paramTypes, stringBuilders.TempStrBuilder); - if (typeParameters != null) - { - foreach (Type typeParam in typeParameters) - { - AppendNamespace( - typeParam.Namespace, - string.Empty, - stringBuilders.TempStrBuilder); - stringBuilders.TempStrBuilder.Append(typeParam.Name); - } - } + stringBuilders.TempStrBuilder.Append(enclosingTypeNameLower); + stringBuilders.TempStrBuilder.Append(syntaxType); + stringBuilders.TempStrBuilder.Append("Set"); + stringBuilders.TempStrBuilder.Append(fieldNameUpper); string funcNameLower = stringBuilders.TempStrBuilder.ToString(); + // Build method name + stringBuilders.TempStrBuilder.Length = 0; + stringBuilders.TempStrBuilder.Append("Set"); + stringBuilders.TempStrBuilder.Append(fieldNameUpper); + string methodName = stringBuilders.TempStrBuilder.ToString(); + // C# init param declaration AppendCsharpInitParam( funcNameLower, stringBuilders.CsharpInitParams); - + // C# delegate type AppendCsharpDelegateType( funcName, isStatic, - returnType, + typeof(void), parameters, stringBuilders.CsharpDelegateTypes); - + // C# init call param AppendCsharpInitCallArg( funcName, stringBuilders.CsharpInitCall); - + // C# function AppendCsharpFunctionBeginning( - type, + enclosingType, funcName, isStatic, - returnType, - typeParameters, + typeof(void), + null, parameters, stringBuilders.CsharpFunctions); AppendCsharpFunctionCallSubject( - type, - isStatic, - stringBuilders.CsharpFunctions); - stringBuilders.CsharpFunctions.Append(methodName); - if (typeParameters != null) - { - stringBuilders.CsharpFunctions.Append('<'); - for (int i = 0; i < typeParameters.Length; ++i) - { - Type typeParam = typeParameters[i]; - AppendCsharpTypeName( - typeParam, - stringBuilders.CsharpFunctions); - if (i != typeParameters.Length - 1) - { - stringBuilders.CsharpFunctions.Append(", "); - } - } - stringBuilders.CsharpFunctions.Append('>'); - } - AppendCsharpFunctionCallParameters( + enclosingType, isStatic, - parameters, stringBuilders.CsharpFunctions); - stringBuilders.CsharpFunctions.Append(';'); + stringBuilders.CsharpFunctions.Append(fieldName); + stringBuilders.CsharpFunctions.Append(" = "); + stringBuilders.CsharpFunctions.Append("value;"); AppendCsharpFunctionReturn( - returnType, + parameters, + typeof(void), stringBuilders.CsharpFunctions); // C++ function pointer @@ -1655,58 +1794,48 @@ static void AppendMethod( funcName, isStatic, parameters, - returnType, + typeof(void), stringBuilders.CppFunctionPointers); // C++ method declaration - AppendIndent( - indent + 1, - stringBuilders.CppTypeDefinitions); + AppendIndent(indent + 1, stringBuilders.CppTypeDefinitions); AppendCppMethodDeclaration( methodName, isStatic, - returnType, - typeParameters, + typeof(void), + null, parameters, stringBuilders.CppTypeDefinitions); // C++ method definition AppendCppMethodDefinition( - type, - returnType, + enclosingType, + typeof(void), methodName, - typeParameters, + null, parameters, indent, stringBuilders.CppMethodDefinitions); - AppendIndent( - indent, - stringBuilders.CppMethodDefinitions); + AppendIndent(indent, stringBuilders.CppMethodDefinitions); stringBuilders.CppMethodDefinitions.Append("{\n"); - AppendIndent( - indent + 1, - stringBuilders.CppMethodDefinitions); - AppendCppMethodReturn( - returnType, - stringBuilders.CppMethodDefinitions); AppendCppPluginFunctionCall( isStatic, - returnType, + null, funcName, parameters, + indent + 1, stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append(";\n"); - AppendIndent( - indent, - stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append("}\n\t\n"); + AppendIndent(indent, stringBuilders.CppMethodDefinitions); + stringBuilders.CppMethodDefinitions.Append("}\n"); + AppendIndent(indent, stringBuilders.CppMethodDefinitions); + stringBuilders.CppMethodDefinitions.Append('\n'); // C++ init params AppendCppInitParam( funcNameLower, isStatic, parameters, - returnType, + typeof(void), stringBuilders.CppInitParams); // C++ init body @@ -1720,8 +1849,7 @@ static int AppendCppTypeDeclaration( string typeNamespace, string typeName, bool isStatic, - StringBuilder output - ) + StringBuilder output) { int indent = AppendNamespaceBeginning( typeNamespace, @@ -1776,10 +1904,13 @@ StringBuilder output { output.Append("struct "); output.Append(typeName); - output.Append(" : "); - output.Append(baseTypeNamespace); - output.Append("::"); - output.Append(baseTypeName); + if (baseTypeNamespace != null && baseTypeName != null) + { + output.Append(" : "); + output.Append(baseTypeNamespace); + output.Append("::"); + output.Append(baseTypeName); + } } output.Append('\n'); AppendIndent( @@ -1804,22 +1935,21 @@ StringBuilder output static void AppendCppTypeDefinitionEnd( bool isStatic, int indent, - StringBuilder cppTypeDefinitions - ) + StringBuilder output) { AppendIndent( indent, - cppTypeDefinitions); - cppTypeDefinitions.Append('}'); + output); + output.Append('}'); if (!isStatic) { - cppTypeDefinitions.Append(';'); + output.Append(';'); } - cppTypeDefinitions.Append('\n'); + output.Append('\n'); AppendNamespaceEnding( indent, - cppTypeDefinitions); - cppTypeDefinitions.Append('\n'); + output); + output.Append('\n'); } static int AppendCppMethodDefinitionBegin( @@ -1869,14 +1999,17 @@ static void AppendSystemObjectLifecycleCall( string baseTypeName, StringBuilder output) { - output.Append(macroName); - output.Append('('); - output.Append(typeName); - output.Append(", "); - output.Append(baseTypeNamespace); - output.Append("::"); - output.Append(baseTypeName); - output.Append(")"); + if (baseTypeNamespace != null && baseTypeName != null) + { + output.Append(macroName); + output.Append('('); + output.Append(typeName); + output.Append(", "); + output.Append(baseTypeNamespace); + output.Append("::"); + output.Append(baseTypeName); + output.Append(")"); + } } static int AppendNamespaceBeginning( @@ -1983,10 +2116,8 @@ static void AppendCsharpDelegateType( output.Append(", "); } } - AppendParameterDeclaration( + AppendCsharpParameterDeclaration( parameters, - "int", - AppendCsharpTypeName, output); output.Append(");\n"); } @@ -2033,10 +2164,8 @@ static void AppendCsharpFunctionBeginning( output.Append(", "); } } - AppendParameterDeclaration( + AppendCsharpParameterDeclaration( parameters, - "int", - AppendCsharpTypeName, output); output.Append(")\n\t\t{\n\t\t\t"); @@ -2048,13 +2177,34 @@ static void AppendCsharpFunctionBeginning( enclosingType, output); output.Append( - ")ObjectStore.Get(thisHandle);\n\t\t\t"); + ")NativeScript.Bindings.GetObject(thisHandle);\n\t\t\t"); + } + + // Get reference type params from ObjectStore + foreach (ParameterInfo param in parameters) + { + Type paramType = param.DereferencedParameterType; + if (!param.IsStruct) + { + output.Append("var "); + output.Append(param.Name); + output.Append(" = "); + if (!paramType.Equals(typeof(object))) + { + output.Append('('); + output.Append(paramType); + output.Append(')'); + } + output.Append("NativeScript.Bindings.GetObject("); + output.Append(param.Name); + output.Append("Handle);\n\t\t\t"); + } } // Save return value as local variable if (!returnType.Equals(typeof(void))) { - output.Append("var obj = "); + output.Append("var returnValue = "); }; } @@ -2084,23 +2234,16 @@ static void AppendCsharpFunctionCallParameters( output.Append('('); for (int i = 0; i < parameters.Length; ++i) { - ParameterInfo parameter = parameters[i]; - if (parameter.ParameterType.IsValueType) + ParameterInfo param = parameters[i]; + if (param.IsOut) { - output.Append(parameter.Name); + output.Append("out "); } - else + else if (param.IsRef) { - if (!parameter.ParameterType.Equals(typeof(object))) - { - output.Append('('); - output.Append(parameter.ParameterType); - output.Append(')'); - } - output.Append("ObjectStore.Get("); - output.Append(parameter.Name); - output.Append("Handle)"); + output.Append("ref "); } + output.Append(param.Name); if (i != parameters.Length - 1) { output.Append(", "); @@ -2110,47 +2253,90 @@ static void AppendCsharpFunctionCallParameters( } static void AppendCsharpFunctionReturn( + ParameterInfo[] parameters, Type returnType, StringBuilder output) { + // Store reference out and ref params and overwrite handles + foreach (ParameterInfo param in parameters) + { + if (!param.IsStruct && (param.IsOut || param.IsRef)) + { + output.Append("\n\t\t\tint "); + output.Append(param.Name); + output.Append("HandleNew = NativeScript.Bindings.GetHandle("); + output.Append(param.Name); + output.Append(");\n\t\t\tif ("); + output.Append(param.Name); + output.Append("HandleNew < 0)\n\t\t\t{\n\t\t\t\t"); + output.Append(param.Name); + output.Append("Handle = NativeScript.Bindings.StoreObject("); + output.Append(param.Name); + output.Append(");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t"); + output.Append(param.Name); + output.Append("Handle = "); + output.Append(param.Name); + output.Append("HandleNew;\n\t\t\t}"); + } + } if (!returnType.Equals(typeof(void))) { - output.Append("\n\t\t\t"); + output.Append('\n'); if (returnType.IsValueType) { - output.Append("return obj;"); + output.Append("\t\t\treturn returnValue;"); } else { - output.Append( - "int handle = ObjectStore.Store(obj);\n"); - output.Append("\t\t\treturn handle;"); + output.Append("\t\t\tint returnValueHandle = NativeScript.Bindings.GetHandle(returnValue);\n"); + output.Append("\t\t\tif (returnValueHandle < 0)\n"); + output.Append("\t\t\t{\n"); + output.Append("\t\t\t\treturn NativeScript.Bindings.StoreObject(returnValue);\n"); + output.Append("\t\t\t}\n"); + output.Append("\t\t\telse\n"); + output.Append("\t\t\t{\n"); + output.Append("\t\t\t\treturn returnValueHandle;\n"); + output.Append("\t\t\t}"); } } output.Append("\n\t\t}\n\t\t\n"); } - static void AppendParameterDeclaration( + static void AppendCsharpParameterDeclaration( ParameterInfo[] parameters, - string handleType, - Action appendTypeName, - StringBuilder output - ) + StringBuilder output) { for (int i = 0; i < parameters.Length; ++i) { - ParameterInfo parameter = parameters[i]; - if (handleType == null || parameter.ParameterType.IsValueType) + ParameterInfo param = parameters[i]; + if (param.IsOut) { - appendTypeName(parameter.ParameterType, output); + if (param.IsStruct) + { + output.Append("out "); + } + else + { + output.Append("ref "); + } + } + if (param.IsRef) + { + output.Append("ref "); + } + if (param.IsStruct) + { + AppendCsharpTypeName( + param.DereferencedParameterType, + output); } else { - output.Append(handleType); + output.Append("int"); } output.Append(' '); - output.Append(parameter.Name); - if (handleType != null && !parameter.ParameterType.IsValueType) + output.Append(param.Name); + if (!param.IsStruct) { output.Append("Handle"); } @@ -2161,6 +2347,29 @@ StringBuilder output } } + static void AppendCppParameterDeclaration( + ParameterInfo[] parameters, + StringBuilder output) + { + for (int i = 0; i < parameters.Length; ++i) + { + ParameterInfo param = parameters[i]; + AppendCppTypeName( + param.DereferencedParameterType, + output); + if (param.IsOut || param.IsRef) + { + output.Append('*'); + } + output.Append(' '); + output.Append(param.Name); + if (i != parameters.Length - 1) + { + output.Append(", "); + } + } + } + static void AppendParameterCall( ParameterInfo[] parameters, string separator, @@ -2170,7 +2379,7 @@ static void AppendParameterCall( { ParameterInfo parameter = parameters[i]; output.Append(parameter.Name); - if (!parameter.ParameterType.IsValueType) + if (!parameter.IsStruct) { output.Append("Handle"); } @@ -2231,27 +2440,21 @@ static void AppendCppMethodDefinition( output.Append(">"); } output.Append('('); - AppendParameterDeclaration( + AppendCppParameterDeclaration( parameters, - null, - AppendCppTypeName, output); output.Append(")\n"); } static void AppendCppMethodReturn( Type returnType, - StringBuilder output - ) + int indent, + StringBuilder output) { if (returnType != null && !returnType.Equals(typeof(void))) { - output.Append("return "); - if (!returnType.IsValueType) - { - AppendCppTypeName(returnType, output); - output.Append('('); - } + AppendIndent(indent, output); + output.Append("return returnValue;\n"); } } @@ -2260,8 +2463,29 @@ static void AppendCppPluginFunctionCall( Type returnType, string funcName, ParameterInfo[] parameters, + int indent, StringBuilder output) { + // Gather handles for out and ref parameters + foreach (ParameterInfo param in parameters) + { + if (!param.IsStruct && (param.IsOut || param.IsRef)) + { + AppendIndent(indent, output); + output.Append("int32_t "); + output.Append(param.Name); + output.Append("Handle = "); + output.Append(param.Name); + output.Append("->Handle;\n"); + } + } + + // Call the function + AppendIndent(indent, output); + if (returnType != null && returnType != typeof(void)) + { + output.Append("auto returnValue = "); + } output.Append("Plugin::"); output.Append(funcName); output.Append("("); @@ -2275,23 +2499,43 @@ static void AppendCppPluginFunctionCall( } for (int i = 0; i < parameters.Length; ++i) { - Type paramType = parameters[i].ParameterType; - output.Append(parameters[i].Name); - if (!paramType.IsValueType) + ParameterInfo param = parameters[i]; + if (param.IsStruct) + { + output.Append(param.Name); + } + else { - output.Append(".Handle"); + if (param.IsOut || param.IsRef) + { + output.Append('&'); + output.Append(param.Name); + } + else + { + output.Append(param.Name); + output.Append('.'); + } + output.Append("Handle"); } if (i != parameters.Length - 1) { output.Append(", "); } } - output.Append(")"); - if (returnType != null - && !returnType.Equals(typeof(void)) - && !returnType.IsValueType) + output.Append(");\n"); + + // Set out and ref parameters + foreach (ParameterInfo param in parameters) { - output.Append(')'); + if (!param.IsStruct && (param.IsOut || param.IsRef)) + { + AppendIndent(indent, output); + output.Append(param.Name); + output.Append("->SetHandle("); + output.Append(param.Name); + output.Append("Handle);\n"); + } } } @@ -2341,8 +2585,7 @@ static void AppendCppFunctionPointer( ParameterInfo[] parameters, Type returnType, char separator, - StringBuilder output - ) + StringBuilder output) { // Return type if (returnType.IsValueType) @@ -2365,12 +2608,35 @@ StringBuilder output output.Append(", "); } } - AppendParameterDeclaration( - parameters, - "int32_t", - AppendCppTypeName, - output); - output.Append(")"); + for (int i = 0; i < parameters.Length; ++i) + { + ParameterInfo param = parameters[i]; + if (param.IsStruct) + { + AppendCppTypeName( + param.DereferencedParameterType, + output); + } + else + { + output.Append("int32_t"); + } + if (param.IsOut || param.IsRef) + { + output.Append('*'); + } + output.Append(' '); + output.Append(param.Name); + if (!param.IsStruct) + { + output.Append("Handle"); + } + if (i != parameters.Length - 1) + { + output.Append(", "); + } + } + output.Append(')'); output.Append(separator); } @@ -2417,10 +2683,8 @@ static void AppendCppMethodDeclaration( output.Append('('); // Parameters - AppendParameterDeclaration( + AppendCppParameterDeclaration( parameters, - null, - AppendCppTypeName, output); output.Append(");\n"); } @@ -2548,6 +2812,56 @@ static void AppendCppTypeName( output.Append(name); } + static void LogStringBuilders( + StringBuilders builders) + { + LogStringBuilder( + "C# init params", + builders.CsharpInitParams); + LogStringBuilder( + "C# delegates", + builders.CsharpDelegateTypes); + LogStringBuilder( + "C# init call", + builders.CsharpInitCall); + LogStringBuilder( + "C# functions", + builders.CsharpFunctions); + LogStringBuilder( + "C# MonoBehaviours", + builders.CsharpMonoBehaviours); + LogStringBuilder( + "C# MonoBehaviour Delegates", + builders.CsharpMonoBehaviourDelegates); + LogStringBuilder( + "C# MonoBehaviour Imports", + builders.CsharpMonoBehaviourImports); + LogStringBuilder( + "C# MonoBehaviour GetDelegate Calls", + builders.CsharpMonoBehaviourGetDelegateCalls); + LogStringBuilder( + "C++ function pointers", + builders.CppFunctionPointers); + LogStringBuilder( + "C++ type declarations", + builders.CppTypeDeclarations); + LogStringBuilder( + "C++ type definitions", + builders.CppTypeDefinitions); + LogStringBuilder( + "C++ method definitions", + builders.CppMethodDefinitions); + LogStringBuilder( + "C++ init params", + builders.CppInitParams); + LogStringBuilder( + "C++ init body", + builders.CppInitBody); + LogStringBuilder( + "C++ MonoBehaviour messages", + builders.CppMonoBehaviourMessages); + } + static void LogStringBuilder( string title, StringBuilder builder) @@ -2558,6 +2872,27 @@ static void LogStringBuilder( builder); } + static void RemoveTrailingChars( + StringBuilders builders) + { + RemoveTrailingChars(builders.CsharpInitParams); + RemoveTrailingChars(builders.CsharpDelegateTypes); + RemoveTrailingChars(builders.CsharpInitCall); + RemoveTrailingChars(builders.CsharpFunctions); + RemoveTrailingChars(builders.CsharpMonoBehaviours); + RemoveTrailingChars(builders.CsharpMonoBehaviourDelegates); + RemoveTrailingChars(builders.CsharpMonoBehaviourImports); + RemoveTrailingChars(builders.CsharpMonoBehaviourGetDelegateCalls); + RemoveTrailingChars(builders.CppFunctionPointers); + RemoveTrailingChars(builders.CppTypeDeclarations); + RemoveTrailingChars(builders.CppMethodDefinitions); + RemoveTrailingChars(builders.CppTypeDefinitions); + RemoveTrailingChars(builders.CppInitParams); + RemoveTrailingChars(builders.CppInitBody); + RemoveTrailingChars(builders.CppMonoBehaviourMessages); + } + + // Remove trailing chars (e.g. commas) for last elements static void RemoveTrailingChars( StringBuilder builder) { @@ -2583,6 +2918,94 @@ static void RemoveTrailingChars( } } + static void InjectBuilders( + StringBuilders builders) + { + // Inject into source files + string csharpContents = File.ReadAllText(CsharpPath); + string cppHeaderContents = File.ReadAllText(CppHeaderPath); + string cppSourceContents = File.ReadAllText(CppSourcePath); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN INIT PARAMS*/\n", + "\n\t\t\t/*END INIT PARAMS*/", + builders.CsharpInitParams.ToString()); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN DELEGATE TYPES*/\n", + "\n\t\t/*END DELEGATE TYPES*/", + builders.CsharpDelegateTypes.ToString()); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN INIT CALL*/\n", + "\n\t\t\t\t/*END INIT CALL*/", + builders.CsharpInitCall.ToString()); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN FUNCTIONS*/\n", + "\n\t\t/*END FUNCTIONS*/", + builders.CsharpFunctions.ToString()); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN MONOBEHAVIOURS*/\n", + "\n/*END MONOBEHAVIOURS*/", + builders.CsharpMonoBehaviours.ToString()); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN MONOBEHAVIOUR DELEGATES*/\n", + "\n\t\t/*END MONOBEHAVIOUR DELEGATES*/", + builders.CsharpMonoBehaviourDelegates.ToString()); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN MONOBEHAVIOUR IMPORTS*/\n", + "\n\t\t/*END MONOBEHAVIOUR IMPORTS*/", + builders.CsharpMonoBehaviourImports.ToString()); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN MONOBEHAVIOUR GETDELEGATE CALLS*/\n", + "\n\t\t\t/*END MONOBEHAVIOUR GETDELEGATE CALLS*/", + builders.CsharpMonoBehaviourGetDelegateCalls.ToString()); + cppSourceContents = InjectIntoString( + cppSourceContents, + "/*BEGIN FUNCTION POINTERS*/\n", + "\n\t/*END FUNCTION POINTERS*/", + builders.CppFunctionPointers.ToString()); + cppHeaderContents = InjectIntoString( + cppHeaderContents, + "/*BEGIN TYPE DECLARATIONS*/\n", + "\n/*END TYPE DECLARATIONS*/", + builders.CppTypeDeclarations.ToString()); + cppHeaderContents = InjectIntoString( + cppHeaderContents, + "/*BEGIN TYPE DEFINITIONS*/\n", + "\n/*END TYPE DEFINITIONS*/", + builders.CppTypeDefinitions.ToString()); + cppSourceContents = InjectIntoString( + cppSourceContents, + "/*BEGIN METHOD DEFINITIONS*/\n", + "\n/*END METHOD DEFINITIONS*/", + builders.CppMethodDefinitions.ToString()); + cppSourceContents = InjectIntoString( + cppSourceContents, + "/*BEGIN INIT PARAMS*/\n", + "\n\t/*END INIT PARAMS*/", + builders.CppInitParams.ToString()); + cppSourceContents = InjectIntoString( + cppSourceContents, + "/*BEGIN INIT BODY*/\n", + "\n\t/*END INIT BODY*/", + builders.CppInitBody.ToString()); + cppSourceContents = InjectIntoString( + cppSourceContents, + "/*BEGIN MONOBEHAVIOUR MESSAGES*/\n", + "\n/*END MONOBEHAVIOUR MESSAGES*/", + builders.CppMonoBehaviourMessages.ToString()); + + File.WriteAllText(CsharpPath, csharpContents); + File.WriteAllText(CppHeaderPath, cppHeaderContents); + File.WriteAllText(CppSourcePath, cppSourceContents); + } + static string InjectIntoString( string contents, string beginMarker, diff --git a/Unity/Assets/NativeScript/ObjectStore.cs b/Unity/Assets/NativeScript/ObjectStore.cs deleted file mode 100644 index 2b41d9d..0000000 --- a/Unity/Assets/NativeScript/ObjectStore.cs +++ /dev/null @@ -1,138 +0,0 @@ -namespace NativeScript -{ - /// - /// Stores objects and allows access to them via an int. - /// This class is thread-safe. - /// - /// - /// - /// JacksonDunstan, http://JacksonDunstan.com/articles/3908 - /// - /// - /// - /// MIT - /// - public static class ObjectStore - { - // Stored objects. The first is always null. - private static object[] objects; - - // Stack of available handles - private static int[] handles; - - // Index of the next available handle - private static int nextHandleIndex; - - /// - /// Initialize the object storage and reset the handles - /// - /// - /// - /// Maximum number of objects to store. Must be positive. - /// - public static void Init(int 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; - } - - /// - /// Store an object - /// - /// - /// - /// Object to store. This can be null. - /// - /// - /// - /// An handle to the stored object that can be used with - /// and . If - /// has not yet been called, a - /// will be thrown. - /// - 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; - - // Return the handle - return handle; - } - } - - /// - /// Get the object for a given handle - /// - /// - /// - /// Handle of the object to get. If this is less than zero - /// or greater than the maximum number of objects passed to - /// , this function will throw an - /// . If this - /// is zero, not a handle returned by , - /// a handle returned by a call to with - /// a null parameter, or a handle passed to - /// and not subsequently returned by - /// , this function will return null. If - /// has not yet been called, a - /// will be thrown. - /// - public static object Get(int handle) - { - return objects[handle]; - } - - /// - /// Remove a stored object - /// - /// - /// - /// Handle of the object to Remove. If this is less than - /// zero or greater than the maximum number of objects - /// passed to , this function will throw - /// an . The - /// handle may be be reused. If has not - /// yet been called, a - /// will be thrown. - /// - public static void Remove(int handle) - { - if (handle != 0) - { - lock (objects) - { - // Forget the object - objects[handle] = null; - - // Push the handle onto the stack - nextHandleIndex++; - handles[nextHandleIndex] = handle; - } - } - } - } -} \ No newline at end of file diff --git a/Unity/Assets/NativeScript/ObjectStore.cs.meta b/Unity/Assets/NativeScript/ObjectStore.cs.meta deleted file mode 100644 index c203e63..0000000 --- a/Unity/Assets/NativeScript/ObjectStore.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: da44db2587e2f46d58d0318a1a71bd03 -timeCreated: 1499537422 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Unity/Assets/NativeScriptConstants.cs b/Unity/Assets/NativeScriptConstants.cs index 91c3171..8d8f46e 100644 --- a/Unity/Assets/NativeScriptConstants.cs +++ b/Unity/Assets/NativeScriptConstants.cs @@ -10,27 +10,6 @@ /// public static class NativeScriptConstants { - /// - /// Name of the plugin used by [DllImport] when running outside the editor - /// - public const string PluginName = "NativeScript"; - - /// - /// Path to load the plugin from when running inside the editor - /// -#if UNITY_EDITOR_OSX - public const string PluginPath = "/Plugins/Editor/NativeScript.bundle/Contents/MacOS/NativeScript"; -#elif UNITY_EDITOR_LINUX - public const string PluginPath = "/Plugins/Editor/libNativeScript.so"; -#elif UNITY_EDITOR_WIN - public const string PluginPath = "/Plugins/Editor/NativeScript.dll"; -#endif - - /// - /// Maximum number of simultaneous managed objects that the C++ plugin uses - /// - public const int MaxManagedObjects = 1024; - /// /// Path within the Unity project to the exposed types JSON file /// diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 2f80abf..c2eadfa 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -20,8 +20,7 @@ "ParamTypes": [] } ], - "Properties": [ "ElapsedMilliseconds" ], - "Fields": [] + "Properties": [ "ElapsedMilliseconds" ] } ] }, @@ -30,10 +29,7 @@ "Types": [ { "Name": "UnityEngine.Object", - "Constructors": [], - "Methods": [], - "Properties": [ "name" ], - "Fields": [] + "Properties": [ "name" ] }, { "Name": "UnityEngine.GameObject", @@ -63,62 +59,67 @@ ] } ], - "Properties": [ "transform" ], - "Fields": [] + "Properties": [ "transform" ] }, { "Name": "UnityEngine.Component", - "Constructors": [], - "Methods": [], - "Properties": [ "transform" ], - "Fields": [] + "Properties": [ "transform" ] }, { "Name": "UnityEngine.Transform", - "Constructors": [], - "Methods": [], - "Properties": [ "position" ], - "Fields": [] + "Properties": [ "position" ] }, { "Name": "UnityEngine.Debug", - "Constructors": [], "Methods": [ { "Name": "Log", "ParamTypes": [ "System.Object" ] } - ], - "Properties": [], - "Fields": [] + ] }, { "Name": "UnityEngine.Assertions.Assert", - "Constructors": [], - "Methods": [], - "Properties": [], "Fields": [ "raiseExceptions" ] }, { - "Name": "UnityEngine.Collision", - "Constructors": [], - "Methods": [], - "Properties": [], - "Fields": [] + "Name": "UnityEngine.Collision" + }, + { + "Name": "UnityEngine.Behaviour" + }, + { + "Name": "UnityEngine.MonoBehaviour" }, { - "Name": "UnityEngine.Behaviour", - "Constructors": [], - "Methods": [], - "Properties": [], - "Fields": [] + "Name": "UnityEngine.AudioSettings", + "Methods": [ + { + "Name": "GetDSPBufferSize", + "ParamTypes": [ + "System.Int32", + "System.Int32" + ] + } + ] }, { - "Name": "UnityEngine.MonoBehaviour", - "Constructors": [], - "Methods": [], - "Properties": [], - "Fields": [] + "Name": "UnityEngine.Networking.NetworkTransport", + "Methods": [ + { + "Name": "GetBroadcastConnectionInfo", + "ParamTypes": [ + "System.Int32", + "System.String", + "System.Int32", + "System.Byte" + ] + }, + { + "Name": "Init", + "ParamTypes": [] + } + ] } ] } diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 1ba55f0..0773c2e 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -59,6 +59,9 @@ namespace Plugin void (*DebugMethodLogSystemObject)(int32_t messageHandle); System::Boolean (*AssertFieldGetRaiseExceptions)(); void (*AssertFieldSetRaiseExceptions)(System::Boolean value); + void (*AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)(int32_t* bufferLength, int32_t* numBuffers); + void (*NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)(int32_t hostId, int32_t* addressHandle, int32_t* port, uint8_t* error); + void (*NetworkTransportMethodInit)(); /*END FUNCTION POINTERS*/ } @@ -100,17 +103,23 @@ namespace Plugin //////////////////////////////////////////////////////////////// namespace System -{ +{ Object::Object(int32_t handle) { Handle = handle; - Plugin::ReferenceManagedObject(handle); + if (handle) + { + Plugin::ReferenceManagedObject(handle); + } } Object::Object(const Object& other) { Handle = other.Handle; - Plugin::ReferenceManagedObject(Handle); + if (Handle) + { + Plugin::ReferenceManagedObject(Handle); + } } Object::Object(Object&& other) @@ -119,7 +128,53 @@ namespace System other.Handle = 0; } + void Object::SetHandle(int32_t handle) + { + if (Handle != handle) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedObject(handle); + } + } + } + + Object::operator bool() const + { + return Handle != 0; + } + + bool Object::operator==(const Object& other) const + { + return Handle == other.Handle; + } + + bool Object::operator!=(const Object& other) const + { + return Handle != other.Handle; + } + + bool Object::operator==(std::nullptr_t other) const + { + return Handle == 0; + } + + bool Object::operator!=(std::nullptr_t other) const + { + return Handle != 0; + } + #define SYSTEM_OBJECT_LIFECYCLE_DEFINITION(ClassName, BaseClassName) \ + ClassName::ClassName(std::nullptr_t n) \ + : BaseClassName(0) \ + { \ + } \ + \ ClassName::ClassName(int32_t handle) \ : BaseClassName(handle) \ { \ @@ -137,20 +192,33 @@ namespace System \ ClassName::~ClassName() \ { \ - Plugin::DereferenceManagedObject(Handle); \ + if (Handle) \ + { \ + Plugin::DereferenceManagedObject(Handle); \ + } \ } \ \ ClassName& ClassName::operator=(const ClassName& other) \ { \ - Plugin::DereferenceManagedObject(Handle); \ - Handle = other.Handle; \ - Plugin::ReferenceManagedObject(Handle); \ + SetHandle(other.Handle); \ + return *this; \ + } \ + ClassName& ClassName::operator=(std::nullptr_t other) \ + { \ + if (Handle) \ + { \ + Plugin::DereferenceManagedObject(Handle); \ + Handle = 0; \ + } \ return *this; \ } \ \ ClassName& ClassName::operator=(ClassName&& other) \ { \ - Plugin::DereferenceManagedObject(Handle); \ + if (Handle) \ + { \ + Plugin::DereferenceManagedObject(Handle); \ + } \ Handle = other.Handle; \ other.Handle = 0; \ return *this; \ @@ -172,13 +240,16 @@ namespace System SYSTEM_OBJECT_LIFECYCLE_DEFINITION(Stopwatch, System::Object) Stopwatch::Stopwatch() - : Stopwatch(Stopwatch(Plugin::StopwatchConstructor())) + : System::Object(0) { + auto returnValue = Plugin::StopwatchConstructor(); + SetHandle(returnValue); } int64_t Stopwatch::GetElapsedMilliseconds() { - return Plugin::StopwatchPropertyGetElapsedMilliseconds(Handle); + auto returnValue = Plugin::StopwatchPropertyGetElapsedMilliseconds(Handle); + return returnValue; } void Stopwatch::Start() @@ -199,7 +270,8 @@ namespace UnityEngine System::String Object::GetName() { - return System::String(Plugin::ObjectPropertyGetName(Handle)); + auto returnValue = Plugin::ObjectPropertyGetName(Handle); + return returnValue; } void Object::SetName(System::String value) @@ -213,28 +285,35 @@ namespace UnityEngine SYSTEM_OBJECT_LIFECYCLE_DEFINITION(GameObject, UnityEngine::Object) GameObject::GameObject() - : GameObject(GameObject(Plugin::GameObjectConstructor())) + : UnityEngine::Object(0) { + auto returnValue = Plugin::GameObjectConstructor(); + SetHandle(returnValue); } GameObject::GameObject(System::String name) - : GameObject(GameObject(Plugin::GameObjectConstructorSystemString(name.Handle))) + : UnityEngine::Object(0) { + auto returnValue = Plugin::GameObjectConstructorSystemString(name.Handle); + SetHandle(returnValue); } UnityEngine::Transform GameObject::GetTransform() { - return UnityEngine::Transform(Plugin::GameObjectPropertyGetTransform(Handle)); + auto returnValue = Plugin::GameObjectPropertyGetTransform(Handle); + return returnValue; } UnityEngine::GameObject GameObject::Find(System::String name) { - return UnityEngine::GameObject(Plugin::GameObjectMethodFindSystemString(name.Handle)); + auto returnValue = Plugin::GameObjectMethodFindSystemString(name.Handle); + return returnValue; } template<> MyGame::MonoBehaviours::TestScript GameObject::AddComponent() { - return MyGame::MonoBehaviours::TestScript(Plugin::GameObjectMethodAddComponentMyGameMonoBehavioursTestScript(Handle)); + auto returnValue = Plugin::GameObjectMethodAddComponentMyGameMonoBehavioursTestScript(Handle); + return returnValue; } } @@ -244,7 +323,8 @@ namespace UnityEngine UnityEngine::Transform Component::GetTransform() { - return UnityEngine::Transform(Plugin::ComponentPropertyGetTransform(Handle)); + auto returnValue = Plugin::ComponentPropertyGetTransform(Handle); + return returnValue; } } @@ -254,7 +334,8 @@ namespace UnityEngine UnityEngine::Vector3 Transform::GetPosition() { - return Plugin::TransformPropertyGetPosition(Handle); + auto returnValue = Plugin::TransformPropertyGetPosition(Handle); + return returnValue; } void Transform::SetPosition(UnityEngine::Vector3 value) @@ -279,7 +360,8 @@ namespace UnityEngine { System::Boolean Assert::GetRaiseExceptions() { - return Plugin::AssertFieldGetRaiseExceptions(); + auto returnValue = Plugin::AssertFieldGetRaiseExceptions(); + return returnValue; } void Assert::SetRaiseExceptions(System::Boolean value) @@ -304,6 +386,36 @@ namespace UnityEngine SYSTEM_OBJECT_LIFECYCLE_DEFINITION(MonoBehaviour, UnityEngine::Behaviour) } +namespace UnityEngine +{ + SYSTEM_OBJECT_LIFECYCLE_DEFINITION(AudioSettings, System::Object) + + void AudioSettings::GetDSPBufferSize(int32_t* bufferLength, int32_t* numBuffers) + { + Plugin::AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(bufferLength, numBuffers); + } +} + +namespace UnityEngine +{ + namespace Networking + { + SYSTEM_OBJECT_LIFECYCLE_DEFINITION(NetworkTransport, System::Object) + + void NetworkTransport::GetBroadcastConnectionInfo(int32_t hostId, System::String* address, int32_t* port, uint8_t* error) + { + int32_t addressHandle = address->Handle; + Plugin::NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(hostId, &addressHandle, port, error); + address->SetHandle(addressHandle); + } + + void NetworkTransport::Init() + { + Plugin::NetworkTransportMethodInit(); + } + } +} + namespace MyGame { namespace MonoBehaviours @@ -346,7 +458,10 @@ DLLEXPORT void Init( void (*transformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3 value), void (*debugMethodLogSystemObject)(int32_t messageHandle), System::Boolean (*assertFieldGetRaiseExceptions)(), - void (*assertFieldSetRaiseExceptions)(System::Boolean value) + void (*assertFieldSetRaiseExceptions)(System::Boolean value), + void (*audioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)(int32_t* bufferLength, int32_t* numBuffers), + void (*networkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)(int32_t hostId, int32_t* addressHandle, int32_t* port, uint8_t* error), + void (*networkTransportMethodInit)() /*END INIT PARAMS*/) { using namespace Plugin; @@ -378,6 +493,9 @@ DLLEXPORT void Init( DebugMethodLogSystemObject = debugMethodLogSystemObject; AssertFieldGetRaiseExceptions = assertFieldGetRaiseExceptions; AssertFieldSetRaiseExceptions = assertFieldSetRaiseExceptions; + AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32 = audioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32; + NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte = networkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte; + NetworkTransportMethodInit = networkTransportMethodInit; /*END INIT BODY*/ PluginMain(); diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index e02e014..61f3afb 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -13,6 +13,9 @@ // For int32_t, etc. #include +// For nullptr_t +#include + //////////////////////////////////////////////////////////////// // C# struct types //////////////////////////////////////////////////////////////// @@ -86,14 +89,22 @@ namespace System Object(int32_t handle); Object(const Object& other); Object(Object&& other); + void SetHandle(int32_t handle); + operator bool() const; + bool operator==(const Object& other) const; + bool operator!=(const Object& other) const; + bool operator==(std::nullptr_t other) const; + bool operator!=(std::nullptr_t other) const; }; #define SYSTEM_OBJECT_LIFECYCLE_DECLARATION(ClassName, BaseClassName) \ + ClassName(std::nullptr_t n); \ ClassName(int32_t handle); \ ClassName(const ClassName& other); \ ClassName(ClassName&& other); \ ~ClassName(); \ ClassName& operator=(const ClassName& other); \ + ClassName& operator=(std::nullptr_t other); \ ClassName& operator=(ClassName&& other); struct String : Object @@ -162,6 +173,19 @@ namespace UnityEngine struct MonoBehaviour; } +namespace UnityEngine +{ + struct AudioSettings; +} + +namespace UnityEngine +{ + namespace Networking + { + struct NetworkTransport; + } +} + namespace MyGame { namespace MonoBehaviours @@ -274,6 +298,28 @@ namespace UnityEngine }; } +namespace UnityEngine +{ + struct AudioSettings : System::Object + { + SYSTEM_OBJECT_LIFECYCLE_DECLARATION(AudioSettings, System::Object) + static void GetDSPBufferSize(int32_t* bufferLength, int32_t* numBuffers); + }; +} + +namespace UnityEngine +{ + namespace Networking + { + struct NetworkTransport : System::Object + { + SYSTEM_OBJECT_LIFECYCLE_DECLARATION(NetworkTransport, System::Object) + static void GetBroadcastConnectionInfo(int32_t hostId, System::String* address, int32_t* port, uint8_t* error); + static void Init(); + }; + } +} + namespace MyGame { namespace MonoBehaviours From 466b95cadf839ba5961fcdfcac14c3e2cb0ae897 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 10 Sep 2017 21:37:02 -0700 Subject: [PATCH 02/95] Support generic types Support generic parameters for methods and constructors Support generic fields Support generic properties Support deriving from generic classes Allow JSON types to use any assembly Add default assemblies for .NET, Unity, and the project Prefix binding function names with namespaces Fix linker error with static functions of static classes Eliminate SYSTEM_OBJECT_LIFECYCLE_* macros in favor of code generation Make Boolean a struct type with better bool compatibility Update README --- README.md | 51 +- Unity/Assets/NativeScript/Bindings.cs | 383 ++-- .../NativeScript/Editor/GenerateBindings.cs | 1889 ++++++++++++----- Unity/Assets/NativeScriptTypes.json | 256 ++- Unity/CppSource/Game/Game.cpp | 25 +- Unity/CppSource/NativeScript/Bindings.cpp | 1355 ++++++++++-- Unity/CppSource/NativeScript/Bindings.h | 404 +++- 7 files changed, 3386 insertions(+), 977 deletions(-) diff --git a/README.md b/README.md index 5febbff..518859b 100644 --- a/README.md +++ b/README.md @@ -147,45 +147,46 @@ To configure the code generator, open `NativeScriptTypes.json` and notice the ex The code generator supports: -* Class types (i.e. Classes with methods, etc. Parameters, etc. are fine.) -* Constructors -* Methods -* Fields -* Properties (getters and setters) -* Generic return types -* `MonoBehaviour` classes with "message" functions (except `OnAudioFilterRead`) +* Class types (including generics) +* Base classes (including generics) +* Constructors (including generic parameters) +* Methods (including generic parameters and return types) +* Fields (including generic types) +* Properties (getters and setters) (including generic types) +* `MonoBehaviour` classes with "message" functions like `Update` (except `OnAudioFilterRead`) * `out` and `ref` parameters The code generator does not support (yet): * Struct types * Arrays (single- or multi-dimensional) -* Generic functions and types * Delegates * `MonoBehaviour` contents (e.g. fields) except for "message" functions * Overloaded operators * Exceptions * Default parameters +* Interfaces The JSON file is laid out as follows: -* Path - Absolute path to the DLL -* Types - Array of types in the DLL to generate - * Name - Name of the type including namespace (e.g. `UnityEngine.GameObject`) - * Constructors - Array of constructors to generate - * Types - Parameter types of the constructor including namespace - * Methods - Array of methods to generate - * Name - Name of the method - * ParamTypes - Parameter types to the method including namespace - * GenericTypes - Sets of type parameters to generate - * Name - Name of the type parameter (e.g. `T`) - * Type - Type to generate for the type parameter including namespace - * Properties - Array of property names to generate - * Fields - Array of field names to generate -* MonoBehaviours - * Name - Name of the `MonoBehaviour` class to generate - * Namespace - Namespace to put the `MonoBehaviour` class in - * Messages - Array of message names to generate (e.g. `Update`) +* **Assemblies** - Paths to custom DLLs. Unity, .NET, and your project are already included. `UNITY_PROJECT`, `UNITY_ASSETS`, `DOTNET_DLLS`, and `UNITY_DLLS` be be replaced by the appropriate path. +* **Types** - Array of types in the DLL to generate + * **Name** - Name of the type including namespace (e.g. `UnityEngine.GameObject`) + * **Constructors** - Array of constructors to generate + * **Types** - Parameter types of the constructor including namespace + * **Methods** - Array of methods to generate + * **Name** - Name of the method + * **ParamTypes** - Parameter types to the method including namespace + * **GenericTypes** - Sets of type parameters to generate (for the method) + * **Types** - Type names in the set + * **Properties** - Array of property names to generate + * **Fields** - Array of field names to generate + * **GenericTypes** - Sets of type parameters to generate (for the type) + * **Types** - Type names in the set +* **MonoBehaviours** + * **Name** - Name of the `MonoBehaviour` class to generate + * **Namespace** - Namespace to put the `MonoBehaviour` class in + * **Messages** - Array of message names to generate (e.g. `Update`) # Updating To A New Version diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 9aea668..a53cfaf 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -42,26 +42,36 @@ delegate void InitDelegate( IntPtr releaseObject, IntPtr stringNew, /*BEGIN INIT PARAMS*/ - IntPtr stopwatchConstructor, - IntPtr stopwatchPropertyGetElapsedMilliseconds, - IntPtr stopwatchMethodStart, - IntPtr stopwatchMethodReset, - IntPtr objectPropertyGetName, - IntPtr objectPropertySetName, - IntPtr gameObjectConstructor, - IntPtr gameObjectConstructorSystemString, - IntPtr gameObjectPropertyGetTransform, - IntPtr gameObjectMethodFindSystemString, - IntPtr gameObjectMethodAddComponentMyGameMonoBehavioursTestScript, - IntPtr componentPropertyGetTransform, - IntPtr transformPropertyGetPosition, - IntPtr transformPropertySetPosition, - IntPtr debugMethodLogSystemObject, - IntPtr assertFieldGetRaiseExceptions, - IntPtr assertFieldSetRaiseExceptions, - IntPtr audioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32, - IntPtr networkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte, - IntPtr networkTransportMethodInit + IntPtr systemDiagnosticsStopwatchConstructor, + IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds, + IntPtr systemDiagnosticsStopwatchMethodStart, + IntPtr systemDiagnosticsStopwatchMethodReset, + IntPtr unityEngineObjectPropertyGetName, + IntPtr unityEngineObjectPropertySetName, + IntPtr unityEngineGameObjectConstructor, + IntPtr unityEngineGameObjectConstructorSystemString, + IntPtr unityEngineGameObjectPropertyGetTransform, + IntPtr unityEngineGameObjectMethodFindSystemString, + 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 systemCollectionsGenericListSystemStringConstructor, + IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString, + IntPtr systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString, + IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue, + IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue, + IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString, + IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue, + IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue /*END INIT PARAMS*/); /*BEGIN MONOBEHAVIOUR DELEGATES*/ @@ -173,26 +183,36 @@ static extern void Init( IntPtr releaseObject, IntPtr stringNew, /*BEGIN INIT PARAMS*/ - IntPtr stopwatchConstructor, - IntPtr stopwatchPropertyGetElapsedMilliseconds, - IntPtr stopwatchMethodStart, - IntPtr stopwatchMethodReset, - IntPtr objectPropertyGetName, - IntPtr objectPropertySetName, - IntPtr gameObjectConstructor, - IntPtr gameObjectConstructorSystemString, - IntPtr gameObjectPropertyGetTransform, - IntPtr gameObjectMethodFindSystemString, - IntPtr gameObjectMethodAddComponentMyGameMonoBehavioursTestScript, - IntPtr componentPropertyGetTransform, - IntPtr transformPropertyGetPosition, - IntPtr transformPropertySetPosition, - IntPtr debugMethodLogSystemObject, - IntPtr assertFieldGetRaiseExceptions, - IntPtr assertFieldSetRaiseExceptions, - IntPtr audioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32, - IntPtr networkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte, - IntPtr networkTransportMethodInit + IntPtr systemDiagnosticsStopwatchConstructor, + IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds, + IntPtr systemDiagnosticsStopwatchMethodStart, + IntPtr systemDiagnosticsStopwatchMethodReset, + IntPtr unityEngineObjectPropertyGetName, + IntPtr unityEngineObjectPropertySetName, + IntPtr unityEngineGameObjectConstructor, + IntPtr unityEngineGameObjectConstructorSystemString, + IntPtr unityEngineGameObjectPropertyGetTransform, + IntPtr unityEngineGameObjectMethodFindSystemString, + 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 systemCollectionsGenericListSystemStringConstructor, + IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString, + IntPtr systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString, + IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue, + IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue, + IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString, + IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue, + IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue /*END INIT PARAMS*/); /*BEGIN MONOBEHAVIOUR IMPORTS*/ @@ -214,26 +234,36 @@ IntPtr networkTransportMethodInit delegate int StringNewDelegate(string chars); /*BEGIN DELEGATE TYPES*/ - delegate int StopwatchConstructorDelegate(); - delegate long StopwatchPropertyGetElapsedMillisecondsDelegate(int thisHandle); - delegate void StopwatchMethodStartDelegate(int thisHandle); - delegate void StopwatchMethodResetDelegate(int thisHandle); - delegate int ObjectPropertyGetNameDelegate(int thisHandle); - delegate void ObjectPropertySetNameDelegate(int thisHandle, int valueHandle); - delegate int GameObjectConstructorDelegate(); - delegate int GameObjectConstructorSystemStringDelegate(int nameHandle); - delegate int GameObjectPropertyGetTransformDelegate(int thisHandle); - delegate int GameObjectMethodFindSystemStringDelegate(int nameHandle); - delegate int GameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate(int thisHandle); - delegate int ComponentPropertyGetTransformDelegate(int thisHandle); - delegate UnityEngine.Vector3 TransformPropertyGetPositionDelegate(int thisHandle); - delegate void TransformPropertySetPositionDelegate(int thisHandle, UnityEngine.Vector3 value); - delegate void DebugMethodLogSystemObjectDelegate(int messageHandle); - delegate bool AssertFieldGetRaiseExceptionsDelegate(); - delegate void AssertFieldSetRaiseExceptionsDelegate(bool value); - delegate void AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate(out int bufferLength, out int numBuffers); - delegate void NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate(int hostId, ref int addressHandle, out int port, out byte error); - delegate void NetworkTransportMethodInitDelegate(); + 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 int UnityEngineGameObjectConstructorDelegate(); + delegate int UnityEngineGameObjectConstructorSystemStringDelegate(int nameHandle); + delegate int UnityEngineGameObjectPropertyGetTransformDelegate(int thisHandle); + delegate int UnityEngineGameObjectMethodFindSystemStringDelegate(int nameHandle); + delegate int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate(int thisHandle); + delegate int UnityEngineComponentPropertyGetTransformDelegate(int thisHandle); + delegate UnityEngine.Vector3 UnityEngineTransformPropertyGetPositionDelegate(int thisHandle); + delegate void UnityEngineTransformPropertySetPositionDelegate(int thisHandle, 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(out int bufferLength, out int numBuffers); + delegate void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate(int hostId, ref int addressHandle, out int port, out byte error); + delegate void UnityEngineNetworkingNetworkTransportMethodInitDelegate(); + delegate int SystemCollectionsGenericListSystemStringConstructorDelegate(); + 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); /*END DELEGATE TYPES*/ // Stored objects. The first is always null. @@ -415,26 +445,36 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new ReleaseObjectDelegate(ReleaseObject)), Marshal.GetFunctionPointerForDelegate(new StringNewDelegate(StringNew)), /*BEGIN INIT CALL*/ - Marshal.GetFunctionPointerForDelegate(new StopwatchConstructorDelegate(StopwatchConstructor)), - Marshal.GetFunctionPointerForDelegate(new StopwatchPropertyGetElapsedMillisecondsDelegate(StopwatchPropertyGetElapsedMilliseconds)), - Marshal.GetFunctionPointerForDelegate(new StopwatchMethodStartDelegate(StopwatchMethodStart)), - Marshal.GetFunctionPointerForDelegate(new StopwatchMethodResetDelegate(StopwatchMethodReset)), - Marshal.GetFunctionPointerForDelegate(new ObjectPropertyGetNameDelegate(ObjectPropertyGetName)), - Marshal.GetFunctionPointerForDelegate(new ObjectPropertySetNameDelegate(ObjectPropertySetName)), - Marshal.GetFunctionPointerForDelegate(new GameObjectConstructorDelegate(GameObjectConstructor)), - Marshal.GetFunctionPointerForDelegate(new GameObjectConstructorSystemStringDelegate(GameObjectConstructorSystemString)), - Marshal.GetFunctionPointerForDelegate(new GameObjectPropertyGetTransformDelegate(GameObjectPropertyGetTransform)), - Marshal.GetFunctionPointerForDelegate(new GameObjectMethodFindSystemStringDelegate(GameObjectMethodFindSystemString)), - Marshal.GetFunctionPointerForDelegate(new GameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate(GameObjectMethodAddComponentMyGameMonoBehavioursTestScript)), - Marshal.GetFunctionPointerForDelegate(new ComponentPropertyGetTransformDelegate(ComponentPropertyGetTransform)), - Marshal.GetFunctionPointerForDelegate(new TransformPropertyGetPositionDelegate(TransformPropertyGetPosition)), - Marshal.GetFunctionPointerForDelegate(new TransformPropertySetPositionDelegate(TransformPropertySetPosition)), - Marshal.GetFunctionPointerForDelegate(new DebugMethodLogSystemObjectDelegate(DebugMethodLogSystemObject)), - Marshal.GetFunctionPointerForDelegate(new AssertFieldGetRaiseExceptionsDelegate(AssertFieldGetRaiseExceptions)), - Marshal.GetFunctionPointerForDelegate(new AssertFieldSetRaiseExceptionsDelegate(AssertFieldSetRaiseExceptions)), - Marshal.GetFunctionPointerForDelegate(new AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate(AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)), - Marshal.GetFunctionPointerForDelegate(new NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate(NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)), - Marshal.GetFunctionPointerForDelegate(new NetworkTransportMethodInitDelegate(NetworkTransportMethodInit)) + 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 UnityEngineGameObjectConstructorDelegate(UnityEngineGameObjectConstructor)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectConstructorSystemStringDelegate(UnityEngineGameObjectConstructorSystemString)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectPropertyGetTransformDelegate(UnityEngineGameObjectPropertyGetTransform)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodFindSystemStringDelegate(UnityEngineGameObjectMethodFindSystemString)), + 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 SystemCollectionsGenericListSystemStringConstructorDelegate(SystemCollectionsGenericListSystemStringConstructor)), + 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)) /*END INIT CALL*/ ); } @@ -473,37 +513,37 @@ static int StringNew( } /*BEGIN FUNCTIONS*/ - [MonoPInvokeCallback(typeof(StopwatchConstructorDelegate))] - static int StopwatchConstructor() + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchConstructorDelegate))] + static int SystemDiagnosticsStopwatchConstructor() { var returnValue = NativeScript.Bindings.StoreObject(new System.Diagnostics.Stopwatch()); return returnValue; } - [MonoPInvokeCallback(typeof(StopwatchPropertyGetElapsedMillisecondsDelegate))] - static long StopwatchPropertyGetElapsedMilliseconds(int thisHandle) + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate))] + static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHandle) { var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.GetObject(thisHandle); var returnValue = thiz.ElapsedMilliseconds; return returnValue; } - [MonoPInvokeCallback(typeof(StopwatchMethodStartDelegate))] - static void StopwatchMethodStart(int thisHandle) + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodStartDelegate))] + static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) { var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.GetObject(thisHandle); thiz.Start(); } - [MonoPInvokeCallback(typeof(StopwatchMethodResetDelegate))] - static void StopwatchMethodReset(int thisHandle) + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodResetDelegate))] + static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) { var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.GetObject(thisHandle); thiz.Reset(); } - [MonoPInvokeCallback(typeof(ObjectPropertyGetNameDelegate))] - static int ObjectPropertyGetName(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineObjectPropertyGetNameDelegate))] + static int UnityEngineObjectPropertyGetName(int thisHandle) { var thiz = (UnityEngine.Object)NativeScript.Bindings.GetObject(thisHandle); var returnValue = thiz.name; @@ -518,31 +558,31 @@ static int ObjectPropertyGetName(int thisHandle) } } - [MonoPInvokeCallback(typeof(ObjectPropertySetNameDelegate))] - static void ObjectPropertySetName(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(UnityEngineObjectPropertySetNameDelegate))] + static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) { var thiz = (UnityEngine.Object)NativeScript.Bindings.GetObject(thisHandle); - var value = (System.String)NativeScript.Bindings.GetObject(valueHandle); + var value = (string)NativeScript.Bindings.GetObject(valueHandle); thiz.name = value; } - [MonoPInvokeCallback(typeof(GameObjectConstructorDelegate))] - static int GameObjectConstructor() + [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorDelegate))] + static int UnityEngineGameObjectConstructor() { var returnValue = NativeScript.Bindings.StoreObject(new UnityEngine.GameObject()); return returnValue; } - [MonoPInvokeCallback(typeof(GameObjectConstructorSystemStringDelegate))] - static int GameObjectConstructorSystemString(int nameHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorSystemStringDelegate))] + static int UnityEngineGameObjectConstructorSystemString(int nameHandle) { - var name = (System.String)NativeScript.Bindings.GetObject(nameHandle); + var name = (string)NativeScript.Bindings.GetObject(nameHandle); var returnValue = NativeScript.Bindings.StoreObject(new UnityEngine.GameObject(name)); return returnValue; } - [MonoPInvokeCallback(typeof(GameObjectPropertyGetTransformDelegate))] - static int GameObjectPropertyGetTransform(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectPropertyGetTransformDelegate))] + static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) { var thiz = (UnityEngine.GameObject)NativeScript.Bindings.GetObject(thisHandle); var returnValue = thiz.transform; @@ -557,10 +597,10 @@ static int GameObjectPropertyGetTransform(int thisHandle) } } - [MonoPInvokeCallback(typeof(GameObjectMethodFindSystemStringDelegate))] - static int GameObjectMethodFindSystemString(int nameHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodFindSystemStringDelegate))] + static int UnityEngineGameObjectMethodFindSystemString(int nameHandle) { - var name = (System.String)NativeScript.Bindings.GetObject(nameHandle); + var name = (string)NativeScript.Bindings.GetObject(nameHandle); var returnValue = UnityEngine.GameObject.Find(name); int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); if (returnValueHandle < 0) @@ -573,8 +613,8 @@ static int GameObjectMethodFindSystemString(int nameHandle) } } - [MonoPInvokeCallback(typeof(GameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate))] - static int GameObjectMethodAddComponentMyGameMonoBehavioursTestScript(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate))] + static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(int thisHandle) { var thiz = (UnityEngine.GameObject)NativeScript.Bindings.GetObject(thisHandle); var returnValue = thiz.AddComponent(); @@ -589,8 +629,8 @@ static int GameObjectMethodAddComponentMyGameMonoBehavioursTestScript(int thisHa } } - [MonoPInvokeCallback(typeof(ComponentPropertyGetTransformDelegate))] - static int ComponentPropertyGetTransform(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineComponentPropertyGetTransformDelegate))] + static int UnityEngineComponentPropertyGetTransform(int thisHandle) { var thiz = (UnityEngine.Component)NativeScript.Bindings.GetObject(thisHandle); var returnValue = thiz.transform; @@ -605,51 +645,67 @@ static int ComponentPropertyGetTransform(int thisHandle) } } - [MonoPInvokeCallback(typeof(TransformPropertyGetPositionDelegate))] - static UnityEngine.Vector3 TransformPropertyGetPosition(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineTransformPropertyGetPositionDelegate))] + static UnityEngine.Vector3 UnityEngineTransformPropertyGetPosition(int thisHandle) { var thiz = (UnityEngine.Transform)NativeScript.Bindings.GetObject(thisHandle); var returnValue = thiz.position; return returnValue; } - [MonoPInvokeCallback(typeof(TransformPropertySetPositionDelegate))] - static void TransformPropertySetPosition(int thisHandle, UnityEngine.Vector3 value) + [MonoPInvokeCallback(typeof(UnityEngineTransformPropertySetPositionDelegate))] + static void UnityEngineTransformPropertySetPosition(int thisHandle, UnityEngine.Vector3 value) { var thiz = (UnityEngine.Transform)NativeScript.Bindings.GetObject(thisHandle); thiz.position = value; } - [MonoPInvokeCallback(typeof(DebugMethodLogSystemObjectDelegate))] - static void DebugMethodLogSystemObject(int messageHandle) + [MonoPInvokeCallback(typeof(UnityEngineDebugMethodLogSystemObjectDelegate))] + static void UnityEngineDebugMethodLogSystemObject(int messageHandle) { var message = NativeScript.Bindings.GetObject(messageHandle); UnityEngine.Debug.Log(message); } - [MonoPInvokeCallback(typeof(AssertFieldGetRaiseExceptionsDelegate))] - static bool AssertFieldGetRaiseExceptions() + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldGetRaiseExceptionsDelegate))] + static bool UnityEngineAssertionsAssertFieldGetRaiseExceptions() { var returnValue = UnityEngine.Assertions.Assert.raiseExceptions; return returnValue; } - [MonoPInvokeCallback(typeof(AssertFieldSetRaiseExceptionsDelegate))] - static void AssertFieldSetRaiseExceptions(bool value) + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldSetRaiseExceptionsDelegate))] + static void UnityEngineAssertionsAssertFieldSetRaiseExceptions(bool value) { UnityEngine.Assertions.Assert.raiseExceptions = value; } - [MonoPInvokeCallback(typeof(AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate))] - static void AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(out int bufferLength, out int numBuffers) + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemStringDelegate))] + static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(int expectedHandle, int actualHandle) + { + var expected = (string)NativeScript.Bindings.GetObject(expectedHandle); + var actual = (string)NativeScript.Bindings.GetObject(actualHandle); + UnityEngine.Assertions.Assert.AreEqual(expected, actual); + } + + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObjectDelegate))] + static void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(int expectedHandle, int actualHandle) + { + var expected = (UnityEngine.GameObject)NativeScript.Bindings.GetObject(expectedHandle); + var actual = (UnityEngine.GameObject)NativeScript.Bindings.GetObject(actualHandle); + UnityEngine.Assertions.Assert.AreEqual(expected, actual); + } + + [MonoPInvokeCallback(typeof(UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate))] + static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(out int bufferLength, out int numBuffers) { UnityEngine.AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers); } - [MonoPInvokeCallback(typeof(NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate))] - static void NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(int hostId, ref int addressHandle, out int port, out byte error) + [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate))] + static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(int hostId, ref int addressHandle, out int port, out byte error) { - var address = (System.String)NativeScript.Bindings.GetObject(addressHandle); + var address = (string)NativeScript.Bindings.GetObject(addressHandle); UnityEngine.Networking.NetworkTransport.GetBroadcastConnectionInfo(hostId, out address, out port, out error); int addressHandleNew = NativeScript.Bindings.GetHandle(address); if (addressHandleNew < 0) @@ -662,11 +718,90 @@ static void NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemSt } } - [MonoPInvokeCallback(typeof(NetworkTransportMethodInitDelegate))] - static void NetworkTransportMethodInit() + [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodInitDelegate))] + static void UnityEngineNetworkingNetworkTransportMethodInit() { UnityEngine.Networking.NetworkTransport.Init(); } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringConstructorDelegate))] + static int SystemCollectionsGenericListSystemStringConstructor() + { + var returnValue = NativeScript.Bindings.StoreObject(new System.Collections.Generic.List()); + return returnValue; + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate))] + static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int thisHandle, int itemHandle) + { + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.GetObject(thisHandle); + var item = (string)NativeScript.Bindings.GetObject(itemHandle); + thiz.Add(item); + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate))] + static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(int valueHandle) + { + var value = (string)NativeScript.Bindings.GetObject(valueHandle); + var returnValue = NativeScript.Bindings.StoreObject(new System.Collections.Generic.LinkedListNode(value)); + return returnValue; + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate))] + static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(int thisHandle) + { + var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.GetObject(thisHandle); + var returnValue = thiz.Value; + int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); + if (returnValueHandle < 0) + { + return NativeScript.Bindings.StoreObject(returnValue); + } + else + { + return returnValueHandle; + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate))] + static void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(int thisHandle, int valueHandle) + { + var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.GetObject(thisHandle); + var value = (string)NativeScript.Bindings.GetObject(valueHandle); + thiz.Value = value; + } + + [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate))] + static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(int valueHandle) + { + var value = (string)NativeScript.Bindings.GetObject(valueHandle); + var returnValue = NativeScript.Bindings.StoreObject(new System.Runtime.CompilerServices.StrongBox(value)); + return returnValue; + } + + [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate))] + static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int thisHandle) + { + var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.GetObject(thisHandle); + var returnValue = thiz.Value; + int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); + if (returnValueHandle < 0) + { + return NativeScript.Bindings.StoreObject(returnValue); + } + else + { + return returnValueHandle; + } + } + + [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate))] + static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int thisHandle, int valueHandle) + { + var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.GetObject(thisHandle); + var value = (string)NativeScript.Bindings.GetObject(valueHandle); + thiz.Value = value; + } /*END FUNCTIONS*/ } } diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 588e048..a505d30 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -10,30 +10,8 @@ namespace NativeScript { /// /// Code generator that reads a JSON file and outputs C# and C++ code - /// bindings so C++ can call managed functions. - /// - /// Supports: - /// * Constructors - /// * Properties (get and set) - /// * Fields - /// * Methods - /// * Class types (static and regular) - /// * Generic return values - /// * out and ref parameters - /// - /// Does Not Support: - /// * Arrays (single- or multi-dimensional) - /// * Struct types - /// * Generic method parameters - /// * Generic types - /// * Delegates - /// * MonoBehaviour contents (e.g. fields) except for "message" functions - /// * Overloaded operators - /// * Exceptions - /// * Default parameters - /// - /// TODO: - /// * Prefix binding function names with namespaces + /// bindings so C++ can call managed functions and MonoBehaviour "messages" + /// like Update() can call their C++ counterparts. /// /// /// Jackson Dunstan, 2017, http://JacksonDunstan.com @@ -50,23 +28,21 @@ public static class GenerateBindings [Serializable] class JsonConstructor { - public string[] Types; + public string[] ParamTypes; } [Serializable] - class JsonGenericType + class JsonGenericParams { - public string Name; - public string Type; + public string[] Types; } [Serializable] class JsonMethod { public string Name; - public string ReturnType; public string[] ParamTypes; - public JsonGenericType[] GenericTypes; + public JsonGenericParams[] GenericParams; } [Serializable] @@ -77,27 +53,21 @@ class JsonType public JsonMethod[] Methods; public string[] Properties; public string[] Fields; - } - - [Serializable] - class JsonAssembly - { - public string Path; - public JsonType[] Types; + public JsonGenericParams[] GenericParams; } [Serializable] class JsonMonoBehaviour { public string Name; - public string Namespace; public string[] Messages; } [Serializable] class JsonDocument { - public JsonAssembly[] Assemblies; + public string[] Assemblies; + public JsonType[] Types; public JsonMonoBehaviour[] MonoBehaviours; } @@ -234,16 +204,25 @@ public MessageInfo( const string PostCompileWorkPref = "NativeScriptGenerateBindingsPostCompileWork"; const string DryRunPref = "NativeScriptGenerateBindingsDryRun"; + static readonly string DotNetDllsDirPath = new FileInfo( + new Uri(typeof(string).Assembly.CodeBase).LocalPath + ).DirectoryName; + static readonly string UnityDllsDirPath = new FileInfo( + new Uri(typeof(GameObject).Assembly.CodeBase).LocalPath + ).DirectoryName; + static readonly string AssetsDirPath = Application.dataPath; + static readonly string ProjectDirPath = + new DirectoryInfo(AssetsDirPath) + .Parent + .FullName; static readonly string CppDirPath = Path.Combine( Path.Combine( - new DirectoryInfo(Application.dataPath) - .Parent - .FullName, + ProjectDirPath, "CppSource"), "NativeScript"); static readonly string CsharpPath = Path.Combine( - Application.dataPath, + AssetsDirPath, Path.Combine( "NativeScript", "Bindings.cs")); @@ -314,24 +293,43 @@ static void AppendStubMonoBehaviours( { if (monoBehaviours != null) { - foreach (JsonMonoBehaviour monoBehaviour in monoBehaviours) + foreach (JsonMonoBehaviour jsonMonoBehaviour in monoBehaviours) { - int csharpIndent = AppendNamespaceBeginning( - monoBehaviour.Namespace, + // Split namespace from name + string fullName = jsonMonoBehaviour.Name; + string monoBehaviourName; + string monoBehaviourNamespace; + int index = fullName.LastIndexOf('.'); + if (index >= 0) + { + monoBehaviourNamespace = fullName.Substring( + 0, + index); + monoBehaviourName = fullName.Substring( + index + 1); + } + else + { + monoBehaviourName = fullName; + monoBehaviourNamespace = string.Empty; + } + + int indent = AppendNamespaceBeginning( + monoBehaviourNamespace, output); - AppendIndent(csharpIndent, output); + AppendIndent(indent, output); output.Append("public class "); - output.Append(monoBehaviour.Name); + output.Append(monoBehaviourName); output.Append(" : UnityEngine.MonoBehaviour\n"); - AppendIndent(csharpIndent, output); + AppendIndent(indent, output); output.Append("{\n"); - AppendIndent(csharpIndent + 1, output); + AppendIndent(indent + 1, output); output.Append("// Stub version. GenerateBindings is still in progress. "); output.Append(timestamp); output.Append('\n'); - AppendIndent(csharpIndent, output); + AppendIndent(indent, output); output.Append("}\n"); - AppendNamespaceEnding(csharpIndent, output); + AppendNamespaceEnding(indent, output); } } } @@ -356,22 +354,58 @@ static void DoPostCompileWork() JsonDocument doc = LoadJson(); - StringBuilders builders = new StringBuilders(); - if (doc.Assemblies != null) + // Gather assemblies + const int numDefaultAssemblies = 7; + int numAssemblies; + Assembly[] assemblies; + if (doc.Assemblies == null) { - foreach (JsonAssembly jsonAssembly in doc.Assemblies) + numAssemblies = numDefaultAssemblies; + assemblies = new Assembly[numAssemblies]; + } + else + { + numAssemblies = numDefaultAssemblies + doc.Assemblies.Length; + assemblies = new Assembly[numAssemblies]; + + for (int i = 0; i < doc.Assemblies.Length; ++i) { - AppendAssembly( - jsonAssembly, - builders); + string path = doc.Assemblies[i] + .Replace("UNITY_PROJECT", ProjectDirPath) + .Replace("UNITY_ASSETS", AssetsDirPath) + .Replace("DOTNET_DLLS", DotNetDllsDirPath) + .Replace("UNITY_DLLS", UnityDllsDirPath); + Assembly assembly = Assembly.LoadFrom(path); + assemblies[numDefaultAssemblies + i] = assembly; } } + assemblies[0] = typeof(string).Assembly; // .NET: mscorlib + assemblies[1] = typeof(Uri).Assembly; // .NET: System + assemblies[2] = typeof(Action).Assembly; // .NET: System.Core + assemblies[3] = typeof(Vector3).Assembly; // UnityEngine + assemblies[4] = typeof(Bindings).Assembly; // Runtime scripts + assemblies[5] = typeof(GenerateBindings).Assembly; // Editor scripts + assemblies[6] = typeof(EditorPrefs).Assembly; // UnityEditor + + StringBuilders builders = new StringBuilders(); + + // Generate types + foreach (JsonType jsonType in doc.Types) + { + AppendType( + jsonType, + assemblies, + builders); + } + + // Generate MonoBehaviours if (doc.MonoBehaviours != null) { - foreach (JsonMonoBehaviour jsonMonoBehaviour in doc.MonoBehaviours) + foreach (JsonMonoBehaviour monoBehaviour in doc.MonoBehaviours) { AppendMonoBehaviour( - jsonMonoBehaviour, + monoBehaviour, + assemblies, builders); } } @@ -402,98 +436,95 @@ static JsonDocument LoadJson() static Type[] GetTypes( string[] typeNames, - Assembly assembly) + Assembly[] assemblies) { - Assembly systemAssembly = typeof(string).Assembly; Type[] types = new Type[typeNames.Length]; for (int i = 0; i < typeNames.Length; ++i) { - types[i] = GetType(typeNames[i], assembly); + types[i] = GetType(typeNames[i], assemblies); } return types; } static Type GetType( string typeName, - Assembly assembly) + Assembly[] assemblies) + { + // Search all assemblies for the type + foreach (Assembly assembly in assemblies) + { + Type type = assembly.GetType(typeName); + if (type != null) + { + return type; + } + } + + // Not finding a type is a fatal error + StringBuilder errorBuilder = new StringBuilder(1024); + errorBuilder.Append("Couldn't find type \""); + errorBuilder.Append(typeName); + errorBuilder.Append('"'); + throw new Exception(errorBuilder.ToString()); + } + + static ConstructorInfo GetConstructor( + Type type, + string[] paramTypeNames) { - Type type = assembly.GetType(typeName) - ?? typeof(string).Assembly.GetType(typeName) - ?? typeof(Vector3).Assembly.GetType(typeName) - ?? typeof(Bindings).Assembly.GetType(typeName); - if (type == null) + foreach (ConstructorInfo ctor in type.GetConstructors()) + { + if (CheckParametersMatch( + paramTypeNames, + ctor.GetParameters())) + { + return ctor; + } + } + + // Throw an exception so the user knows what to fix in the JSON + StringBuilder errorBuilder = new StringBuilder(1024); + errorBuilder.Append("Constructor \""); + AppendCsharpTypeName(type, errorBuilder); + errorBuilder.Append('('); + for (int i = 0; i < paramTypeNames.Length; ++i) { - StringBuilder errorBuilder = new StringBuilder(1024); - errorBuilder.Append("Couldn't find type \""); - errorBuilder.Append(typeName); - errorBuilder.Append('"'); - throw new Exception(errorBuilder.ToString()); + errorBuilder.Append(paramTypeNames[i]); + if (i != paramTypeNames.Length - 1) + { + errorBuilder.Append(", "); + } } - return type; + errorBuilder.Append(")\" not found"); + throw new Exception(errorBuilder.ToString()); } static MethodInfo GetMethod( Type type, + MethodInfo[] methods, string methodName, - string returnTypeName, string[] paramTypeNames) { - foreach (MethodInfo method in type.GetMethods()) + foreach (MethodInfo method in methods) { + // Name must match if (method.Name != methodName) { continue; } - if (returnTypeName != null) - { - if (string.IsNullOrEmpty(method.ReturnType.Namespace)) - { - if (method.ReturnType.Name != returnTypeName) - { - continue; - } - } - else - { - if ( - method.ReturnType.Namespace + "." + method.ReturnType.Name - != returnTypeName) - { - continue; - } - } - } - ParameterInfo[] parameters = ConvertParameters( - method.GetParameters()); - for (int i = 0; i < parameters.Length; ++i) + + // All parameters must match + if (CheckParametersMatch( + paramTypeNames, + method.GetParameters())) { - Type paramType = parameters[i].DereferencedParameterType; - if (string.IsNullOrEmpty(paramType.Namespace)) - { - if (paramType.Name != paramTypeNames[i]) - { - goto mismatch; - } - } - else - { - if ( - paramType.Namespace + "." + paramType.Name - != paramTypeNames[i]) - { - goto mismatch; - } - } + return method; } - return method; - mismatch:; } // Throw an exception so the user knows what to fix in the JSON StringBuilder errorBuilder = new StringBuilder(1024); errorBuilder.Append("Method \""); - errorBuilder.Append(returnTypeName ?? "void"); - errorBuilder.Append(' '); AppendCsharpTypeName(type, errorBuilder); errorBuilder.Append('.'); errorBuilder.Append(methodName); @@ -510,13 +541,85 @@ static MethodInfo GetMethod( throw new Exception(errorBuilder.ToString()); } - static void AppendTypeNames( - Type[] types, + static bool CheckParametersMatch( + string[] paramTypeNames, + System.Reflection.ParameterInfo[] reflectionParams) + { + // Length must match + if (reflectionParams.Length != paramTypeNames.Length) + { + return false; + } + + // All params must match + for (int i = 0; i < reflectionParams.Length; ++i) + { + Type type = DereferenceParameterType( + reflectionParams[i]); + string typeName = paramTypeNames[i]; + if (!CheckTypeNameMatches(typeName, type)) + { + return false; + } + } + + return true; + } + + static bool CheckTypeNameMatches( + string typeName, + Type type) + { + // No namespace. Only name must match. + if (string.IsNullOrEmpty(type.Namespace)) + { + if (type.Name != typeName) + { + return false; + } + } + // Must be: Namespace.Name + else + { + // Length must be the same as (namespace + '.' + name) + if ( + typeName.Length != + type.Namespace.Length + + 1 + + type.Name.Length) + { + return false; + } + + // Must start with namespace + if (!typeName.StartsWith(type.Namespace)) + { + return false; + } + + // Namespace must be followed by '.' + if (typeName[type.Namespace.Length] != '.') + { + return false; + } + + // Must end with name + if (!typeName.EndsWith(type.Name)) + { + return false; + } + } + + return true; + } + + static void AppendParameterTypeNames( + ParameterInfo[] parameters, StringBuilder output) { - for (int i = 0, len = types.Length; i < len; ++i) + for (int i = 0, len = parameters.Length; i < len; ++i) { - Type type = types[i]; + Type type = parameters[i].DereferencedParameterType; AppendNamespace(type.Namespace, string.Empty, output); output.Append(type.Name); if (i != len - 1) @@ -526,6 +629,28 @@ static void AppendTypeNames( } } + static void AppendTypeNames( + Type[] typeParams, + StringBuilder output) + { + if (typeParams != null) + { + for (int i = 0, len = typeParams.Length; i < len; ++i) + { + Type curType = typeParams[i]; + AppendNamespace( + curType.Namespace, + string.Empty, + output); + output.Append(curType.Name); + if (i != len - 1) + { + output.Append('_'); + } + } + } + } + static void AppendNamespace( string namespaceName, string separator, @@ -578,15 +703,25 @@ static ParameterInfo[] ConvertParameters( info.ParameterType = reflectionInfo.ParameterType; info.IsOut = reflectionInfo.IsOut; info.IsRef = !info.IsOut && info.ParameterType.IsByRef; - info.DereferencedParameterType = info.IsRef || info.IsOut - ? info.ParameterType.GetElementType() - : info.ParameterType; + info.DereferencedParameterType = DereferenceParameterType( + reflectionInfo); info.IsStruct = info.DereferencedParameterType.IsValueType; parameters[i] = info; } return parameters; } + static Type DereferenceParameterType( + System.Reflection.ParameterInfo info) + { + Type paramType = info.ParameterType; + return info.IsOut + ? paramType.GetElementType() + : paramType.IsByRef + ? paramType.GetElementType() + : paramType; + } + static ParameterInfo[] ConvertParameters( Type[] paramTypes) { @@ -607,37 +742,106 @@ static ParameterInfo[] ConvertParameters( return parameters; } - static string GetTypeNameLower(Type type) + static bool IsStatic(Type type) { - return char.ToLower(type.Name[0]) + type.Name.Substring(1); + return type.IsAbstract && type.IsSealed; } - static bool IsStatic(Type type) + static void AppendWithoutGenericTypeCountSuffix( + string typeName, + StringBuilder output) { - return type.IsAbstract && type.IsSealed; + // Names are like "List`1" or "Dictionary`2" + // Remove the backtick (`) and everything after it + int backtickIndex = typeName.IndexOf('`'); + if (backtickIndex < 0) + { + output.Append(typeName); + } + else + { + output.Append(typeName, 0, backtickIndex); + } } - static void AppendAssembly( - JsonAssembly jsonAssembly, + static void AppendType( + JsonType jsonType, + Assembly[] assemblies, StringBuilders builders) { - Assembly assembly = Assembly.LoadFrom(jsonAssembly.Path); - foreach (JsonType jsonType in jsonAssembly.Types) + Type type = GetType(jsonType.Name, assemblies); + Type[] genericArgTypes = type.GetGenericArguments(); + if (jsonType.GenericParams != null) + { + // Template declaration for the type + if (!IsStatic(type)) + { + int indent = AppendNamespaceBeginning( + type.Namespace, + builders.CppTypeDeclarations); + AppendIndent( + indent, + builders.CppTypeDeclarations); + AppendCppTemplateTypenames( + genericArgTypes.Length, + builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append("struct "); + AppendWithoutGenericTypeCountSuffix( + type.Name, + builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append(";"); + builders.CppTypeDeclarations.Append('\n'); + AppendNamespaceEnding( + indent, + builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append('\n'); + } + + foreach (JsonGenericParams jsonGenericParams + in jsonType.GenericParams) + { + Type[] typeParams = GetTypes( + jsonGenericParams.Types, + assemblies); + type = type.MakeGenericType(typeParams); + AppendType( + jsonType, + genericArgTypes, + type, + typeParams, + assemblies, + builders); + } + } + else { AppendType( jsonType, - assembly, + genericArgTypes, + type, + null, + assemblies, builders); } } static void AppendType( JsonType jsonType, - Assembly assembly, + Type[] genericArgTypes, + Type type, + Type[] typeParams, + Assembly[] assemblies, StringBuilders builders) { - Type type = GetType(jsonType.Name, assembly); - string typeNameLower = GetTypeNameLower(type); + // Build type name starting with a lowercase letter + builders.TempStrBuilder.Length = 0; + AppendWithoutGenericTypeCountSuffix( + type.Name, + builders.TempStrBuilder); + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string typeNameLower = builders.TempStrBuilder.ToString(); + bool isStatic = IsStatic(type); // C++ type declaration @@ -645,24 +849,23 @@ static void AppendType( type.Namespace, type.Name, isStatic, + typeParams, builders.CppTypeDeclarations); // C++ type definition (beginning) AppendCppTypeDefinitionBegin( - type.Namespace, - type.Name, - type.BaseType.Namespace, - type.BaseType.Name, + type, + typeParams, + type.BaseType, isStatic, indent, builders.CppTypeDefinitions); // C++ method definition int cppMethodDefinitionsIndent = AppendCppMethodDefinitionBegin( - type.Namespace, - type.Name, - type.BaseType.Namespace, - type.BaseType.Name, + type, + typeParams, + type.BaseType, isStatic, indent, builders.CppMethodDefinitions); @@ -674,8 +877,11 @@ static void AppendType( { AppendConstructor( jsonCtor, - assembly, type, + isStatic, + assemblies, + typeParams, + genericArgTypes, typeNameLower, indent, builders); @@ -690,7 +896,9 @@ static void AppendType( AppendProperty( jsonPropertyName, type, - typeNameLower, + isStatic, + typeParams, + genericArgTypes, indent, builders); } @@ -704,7 +912,9 @@ static void AppendType( AppendField( jsonFieldName, type, - typeNameLower, + isStatic, + typeParams, + genericArgTypes, indent, builders ); @@ -714,13 +924,18 @@ static void AppendType( // Methods if (jsonType.Methods != null) { + MethodInfo[] methods = type.GetMethods(); foreach (JsonMethod jsonMethod in jsonType.Methods) { AppendMethod( jsonMethod, - assembly, + assemblies, type, + isStatic, + methods, + typeParams, typeNameLower, + genericArgTypes, indent, builders); } @@ -740,33 +955,84 @@ static void AppendType( static void AppendConstructor( JsonConstructor jsonCtor, - Assembly assembly, Type enclosingType, + bool enclosingTypeIsStatic, + Assembly[] assemblies, + Type[] typeTypeParams, + Type[] genericArgTypes, string typeNameLower, int indent, StringBuilders builders) { - Type[] paramTypes = GetTypes(jsonCtor.Types, assembly); - ConstructorInfo ctor = enclosingType.GetConstructor(paramTypes); + ConstructorInfo ctor; + if (enclosingType.IsGenericType) + { + string[] overriddenParamTypeNames = OverrideGenericTypeNames( + jsonCtor.ParamTypes, + genericArgTypes, + typeTypeParams); + ctor = GetConstructor( + enclosingType, + overriddenParamTypeNames); + } + else + { + ctor = GetConstructor( + enclosingType, + jsonCtor.ParamTypes); + } ParameterInfo[] parameters = ConvertParameters( ctor.GetParameters()); - + AppendConstructor( + ctor, + typeTypeParams, + parameters, + assemblies, + enclosingType, + enclosingTypeIsStatic, + typeNameLower, + indent, + builders); + } + + static void AppendConstructor( + ConstructorInfo ctor, + Type[] typeParams, + ParameterInfo[] parameters, + Assembly[] assemblies, + Type enclosingType, + bool enclosingTypeIsStatic, + string typeNameLower, + int indent, + StringBuilders builders) + { // Build uppercase function name builders.TempStrBuilder.Length = 0; - builders.TempStrBuilder.Append(enclosingType.Name); + AppendNamespace( + enclosingType.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendWithoutGenericTypeCountSuffix( + enclosingType.Name, + builders.TempStrBuilder); + AppendTypeNames( + typeParams, + builders.TempStrBuilder); builders.TempStrBuilder.Append("Constructor"); - AppendTypeNames(paramTypes, builders.TempStrBuilder); + AppendParameterTypeNames( + parameters, + builders.TempStrBuilder); string funcName = builders.TempStrBuilder.ToString(); // Build lowercase function name - builders.TempStrBuilder.Length = 0; - builders.TempStrBuilder.Append(typeNameLower); - builders.TempStrBuilder.Append("Constructor"); - AppendTypeNames(paramTypes, builders.TempStrBuilder); + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); string funcNameLower = builders.TempStrBuilder.ToString(); // C# init param declaration - AppendCsharpInitParam(funcNameLower, builders.CsharpInitParams); + AppendCsharpInitParam( + funcNameLower, + builders.CsharpInitParams); // C# delegate type AppendCsharpDelegateType( @@ -788,8 +1054,8 @@ static void AppendConstructor( null, parameters, builders.CsharpFunctions); - builders.CsharpFunctions.Append("NativeScript.Bindings.StoreObject("); - builders.CsharpFunctions.Append("new "); + builders.CsharpFunctions.Append( + "NativeScript.Bindings.StoreObject(new "); AppendCsharpTypeName( enclosingType, builders.CsharpFunctions); @@ -817,6 +1083,7 @@ static void AppendConstructor( builders.CppTypeDefinitions); AppendCppMethodDeclaration( enclosingType.Name, + enclosingTypeIsStatic, false, null, null, @@ -828,17 +1095,22 @@ static void AppendConstructor( enclosingType, null, enclosingType.Name, + typeParams, null, parameters, indent, builders.CppMethodDefinitions); - AppendIndent(indent + 1, builders.CppMethodDefinitions); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append(" : "); AppendCppTypeName( enclosingType.BaseType, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("(0)\n"); - AppendIndent(indent, builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( true, @@ -847,11 +1119,17 @@ static void AppendConstructor( parameters, indent + 1, builders.CppMethodDefinitions); - AppendIndent(indent + 1, builders.CppMethodDefinitions); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("SetHandle(returnValue);\n"); - AppendIndent(indent, builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("}\n"); - AppendIndent(indent, builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("\n"); // C++ init params @@ -871,38 +1149,58 @@ static void AppendConstructor( static void AppendProperty( string jsonPropertyName, - Type type, - string typeNameLower, + Type enclosingType, + bool enclosingTypeIsStatic, + Type[] typeParams, + Type[] typeGenericArgumentTypes, int indent, StringBuilders builders) { - PropertyInfo property = type.GetProperty( + PropertyInfo property = enclosingType.GetProperty( jsonPropertyName); + Type propertyType = OverrideGenericType( + property.PropertyType, + typeGenericArgumentTypes, + typeParams); MethodInfo getMethod = property.GetGetMethod(); if (getMethod != null && getMethod.IsPublic) { + ParameterInfo[] parameters = ConvertParameters( + getMethod.GetParameters()); + OverrideGenericParameterTypes( + parameters, + typeGenericArgumentTypes, + typeParams); AppendGetter( property.Name, - typeNameLower, "Property", - ConvertParameters(getMethod.GetParameters()), + parameters, + enclosingTypeIsStatic, getMethod.IsStatic, - type, - property.PropertyType, + enclosingType, + typeParams, + propertyType, indent, builders); } MethodInfo setMethod = property.GetSetMethod(); if (setMethod != null && setMethod.IsPublic) { + ParameterInfo[] parameters = ConvertParameters( + setMethod.GetParameters()); + OverrideGenericParameterTypes( + parameters, + typeGenericArgumentTypes, + typeParams); AppendSetter( property.Name, "Property", - typeNameLower, - ConvertParameters(setMethod.GetParameters()), + parameters, + enclosingTypeIsStatic, setMethod.IsStatic, - type, - property.PropertyType, + enclosingType, + typeParams, + propertyType, indent, builders); } @@ -910,26 +1208,33 @@ static void AppendProperty( static void AppendField( string jsonFieldName, - Type type, - string typeNameLower, + Type enclosingType, + bool enclosingTypeIsStatic, + Type[] typeTypeParams, + Type[] typeGenericArgumentTypes, int indent, StringBuilders builders ) { - FieldInfo field = type.GetField(jsonFieldName); + FieldInfo field = enclosingType.GetField(jsonFieldName); + Type fieldType = OverrideGenericType( + field.FieldType, + typeGenericArgumentTypes, + typeTypeParams); AppendGetter( field.Name, - typeNameLower, "Field", new ParameterInfo[0], + enclosingTypeIsStatic, field.IsStatic, - type, - field.FieldType, + enclosingType, + typeTypeParams, + fieldType, indent, builders); ParameterInfo setParam = new ParameterInfo(); setParam.Name = "value"; - setParam.ParameterType = field.FieldType; + setParam.ParameterType = fieldType; setParam.IsOut = false; setParam.IsRef = false; setParam.DereferencedParameterType = setParam.ParameterType; @@ -938,259 +1243,341 @@ StringBuilders builders AppendSetter( field.Name, "Field", - typeNameLower, parameters, + enclosingTypeIsStatic, field.IsStatic, - type, - field.FieldType, + enclosingType, + typeTypeParams, + fieldType, indent, builders); } static void AppendMethod( JsonMethod jsonMethod, - Assembly assembly, - Type type, + Assembly[] assemblies, + Type enclosingType, + bool enclosingTypeIsStatic, + MethodInfo[] methods, + Type[] typeTypeParams, string typeNameLower, + Type[] genericArgTypes, int indent, StringBuilders builders) { - MethodInfo method = GetMethod( - type, - jsonMethod.Name, - jsonMethod.ReturnType, - jsonMethod.ParamTypes); - ParameterInfo[] parameters = ConvertParameters( - method.GetParameters()); - Type[] paramTypes = GetTypes( - jsonMethod.ParamTypes, - assembly); + // Get the method + MethodInfo method; + if (enclosingType.IsGenericType) + { + string[] overriddenParamTypeNames = OverrideGenericTypeNames( + jsonMethod.ParamTypes, + genericArgTypes, + typeTypeParams); + method = GetMethod( + enclosingType, + methods, + jsonMethod.Name, + overriddenParamTypeNames); + } + else + { + method = GetMethod( + enclosingType, + methods, + jsonMethod.Name, + jsonMethod.ParamTypes); + } - if (jsonMethod.GenericTypes != null) + if (jsonMethod.GenericParams != null) { - foreach (JsonGenericType genericType in jsonMethod.GenericTypes) + // Generate for each set of generic types + foreach (JsonGenericParams jsonGenericParams + in jsonMethod.GenericParams) { - Type returnType; - if (genericType.Name == method.ReturnType.Name) - { - returnType = GetType(genericType.Type, assembly); - } - else - { - returnType = method.ReturnType; - } - Type[] typeParams = new[] { returnType }; - + Type[] methodTypeParams = GetTypes( + jsonGenericParams.Types, + assemblies); + method = method.MakeGenericMethod(methodTypeParams); + ParameterInfo[] parameters = ConvertParameters( + method.GetParameters()); AppendMethod( - type, - assembly, + enclosingType, + assemblies, typeNameLower, method.Name, + enclosingTypeIsStatic, method.IsStatic, - returnType, - typeParams, + method.ReturnType, + typeTypeParams, + methodTypeParams, parameters, - paramTypes, indent, builders); } } else { + ParameterInfo[] parameters = ConvertParameters( + method.GetParameters()); AppendMethod( - type, - assembly, + enclosingType, + assemblies, typeNameLower, method.Name, + enclosingTypeIsStatic, method.IsStatic, method.ReturnType, + typeTypeParams, null, parameters, - paramTypes, indent, builders); } } + static Type OverrideGenericType( + Type genericType, + Type[] genericArgumentTypes, + Type[] overrideTypes) + { + if (genericType.IsGenericParameter) + { + for (int i = 0, len = genericArgumentTypes.Length; i < len; ++i) + { + if (genericType.Equals(genericArgumentTypes[i])) + { + return overrideTypes[i]; + } + } + } + return genericType; + } + + static void OverrideGenericParameterTypes( + ParameterInfo[] parameters, + Type[] typeGenericArgumentTypes, + Type[] typeParams) + { + for (int i = 0; i < parameters.Length; ++i) + { + ParameterInfo info = parameters[i]; + info.ParameterType = OverrideGenericType( + info.ParameterType, + typeGenericArgumentTypes, + typeParams); + } + } + + static string[] OverrideGenericTypeNames( + string[] typeNames, + Type[] genericArgTypes, + Type[] typeParams) + { + int numParams = typeNames.Length; + string[] overriddenParamTypeNames = new string[numParams]; + for (int i = 0; i < numParams; ++i) + { + string typeName = typeNames[i]; + for (int j = 0; j < genericArgTypes.Length; ++j) + { + if (CheckTypeNameMatches( + typeName, + genericArgTypes[j])) + { + typeName = typeParams[i].FullName; + break; + } + } + overriddenParamTypeNames[i] = typeName; + } + return overriddenParamTypeNames; + } + static void AppendMethod( - Type type, - Assembly assembly, + Type enclosingType, + Assembly[] assemblies, string typeNameLower, string methodName, - bool isStatic, + bool enclosingTypeIsStatic, + bool methodIsStatic, Type returnType, - Type[] typeParameters, + Type[] typeTypeParams, + Type[] methodTypeParams, ParameterInfo[] parameters, - Type[] paramTypes, int indent, - StringBuilders stringBuilders) + StringBuilders builders) { // Build uppercase function name - stringBuilders.TempStrBuilder.Length = 0; - AppendMethodFuncName( - type.Name, - methodName, - paramTypes, - typeParameters, - stringBuilders.TempStrBuilder); - string funcName = stringBuilders.TempStrBuilder.ToString(); + builders.TempStrBuilder.Length = 0; + AppendNamespace( + enclosingType.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendWithoutGenericTypeCountSuffix( + enclosingType.Name, + builders.TempStrBuilder); + AppendTypeNames( + typeTypeParams, + builders.TempStrBuilder); + builders.TempStrBuilder.Append("Method"); + builders.TempStrBuilder.Append(methodName); + AppendTypeNames( + methodTypeParams, + builders.TempStrBuilder); + AppendParameterTypeNames( + parameters, + builders.TempStrBuilder); + string funcName = builders.TempStrBuilder.ToString(); // Build lowercase function name - stringBuilders.TempStrBuilder.Length = 0; - AppendMethodFuncName( - typeNameLower, - methodName, - paramTypes, - typeParameters, - stringBuilders.TempStrBuilder); - string funcNameLower = stringBuilders.TempStrBuilder.ToString(); + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string funcNameLower = builders.TempStrBuilder.ToString(); // C# init param declaration AppendCsharpInitParam( funcNameLower, - stringBuilders.CsharpInitParams); + builders.CsharpInitParams); // C# delegate type AppendCsharpDelegateType( funcName, - isStatic, + methodIsStatic, returnType, parameters, - stringBuilders.CsharpDelegateTypes); + builders.CsharpDelegateTypes); // C# init call param AppendCsharpInitCallArg( funcName, - stringBuilders.CsharpInitCall); + builders.CsharpInitCall); // C# function AppendCsharpFunctionBeginning( - type, + enclosingType, funcName, - isStatic, + methodIsStatic, returnType, - typeParameters, + methodTypeParams, parameters, - stringBuilders.CsharpFunctions); + builders.CsharpFunctions); AppendCsharpFunctionCallSubject( - type, - isStatic, - stringBuilders.CsharpFunctions); - stringBuilders.CsharpFunctions.Append(methodName); + enclosingType, + methodIsStatic, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(methodName); AppendCSharpTypeParameters( - typeParameters, - stringBuilders.CsharpFunctions); + methodTypeParams, + builders.CsharpFunctions); AppendCsharpFunctionCallParameters( - isStatic, + methodIsStatic, parameters, - stringBuilders.CsharpFunctions); - stringBuilders.CsharpFunctions.Append(';'); + builders.CsharpFunctions); + builders.CsharpFunctions.Append(';'); AppendCsharpFunctionReturn( parameters, returnType, - stringBuilders.CsharpFunctions); + builders.CsharpFunctions); // C++ function pointer AppendCppFunctionPointerDefinition( funcName, - isStatic, + methodIsStatic, parameters, returnType, - stringBuilders.CppFunctionPointers); + builders.CppFunctionPointers); // C++ method declaration AppendIndent( indent + 1, - stringBuilders.CppTypeDefinitions); + builders.CppTypeDefinitions); AppendCppMethodDeclaration( methodName, - isStatic, + enclosingTypeIsStatic, + methodIsStatic, returnType, - typeParameters, + methodTypeParams, parameters, - stringBuilders.CppTypeDefinitions); + builders.CppTypeDefinitions); // C++ method definition AppendCppMethodDefinition( - type, + enclosingType, returnType, methodName, - typeParameters, + typeTypeParams, + methodTypeParams, parameters, indent, - stringBuilders.CppMethodDefinitions); + builders.CppMethodDefinitions); AppendIndent( indent, - stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( - isStatic, + methodIsStatic, returnType, funcName, parameters, indent + 1, - stringBuilders.CppMethodDefinitions); + builders.CppMethodDefinitions); AppendCppMethodReturn( returnType, indent + 1, - stringBuilders.CppMethodDefinitions); + builders.CppMethodDefinitions); AppendIndent( indent, - stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append("}\n\t\n"); + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n\t\n"); // C++ init params AppendCppInitParam( funcNameLower, - isStatic, + methodIsStatic, parameters, returnType, - stringBuilders.CppInitParams); + builders.CppInitParams); // C++ init body AppendCppInitBody( funcName, funcNameLower, - stringBuilders.CppInitBody); + builders.CppInitBody); } - static void AppendMethodFuncName( - string typeName, - string methodName, - Type[] paramTypes, - Type[] typeParameters, - StringBuilder output) + static void AppendCSharpTypeParameters( + Type[] typeParams, + StringBuilder output + ) { - output.Append(typeName); - output.Append("Method"); - output.Append(methodName); - AppendTypeNames(paramTypes, output); - if (typeParameters != null) + if (typeParams != null && typeParams.Length > 0) { - foreach (Type typeParam in typeParameters) + output.Append('<'); + for (int i = 0; i < typeParams.Length; ++i) { - AppendNamespace( - typeParam.Namespace, - string.Empty, - output); - output.Append(typeParam.Name); + Type typeParam = typeParams[i]; + AppendCsharpTypeName(typeParam, output); + if (i != typeParams.Length - 1) + { + output.Append(", "); + } } + output.Append('>'); } } - static void AppendCSharpTypeParameters( - Type[] typeParameters, - StringBuilder output - ) + static void AppendCppTypeParameters( + Type[] typeParams, + StringBuilder output) { - if (typeParameters != null) + if (typeParams != null && typeParams.Length > 0) { output.Append('<'); - for (int i = 0; i < typeParameters.Length; ++i) + for (int i = 0; i < typeParams.Length; ++i) { - Type typeParam = typeParameters[i]; - AppendCsharpTypeName(typeParam, output); - if (i != typeParameters.Length - 1) + Type typeParam = typeParams[i]; + AppendCppTypeName(typeParam, output); + if (i != typeParams.Length - 1) { output.Append(", "); } @@ -1201,21 +1588,26 @@ StringBuilder output static void AppendMonoBehaviour( JsonMonoBehaviour jsonMonoBehaviour, + Assembly[] assemblies, StringBuilders builders) { + Type type = GetType( + jsonMonoBehaviour.Name, + assemblies); + // C++ Type Declaration int cppIndent = AppendCppTypeDeclaration( - jsonMonoBehaviour.Namespace, - jsonMonoBehaviour.Name, + type.Namespace, + type.Name, false, + null, builders.CppTypeDeclarations); // C++ Type Definition (begin) AppendCppTypeDefinitionBegin( - jsonMonoBehaviour.Namespace, - jsonMonoBehaviour.Name, - "UnityEngine", - "MonoBehaviour", + type, + null, + typeof(MonoBehaviour), false, cppIndent, builders.CppTypeDefinitions @@ -1223,10 +1615,9 @@ static void AppendMonoBehaviour( // C++ method definition int cppMethodDefinitionsIndent = AppendCppMethodDefinitionBegin( - jsonMonoBehaviour.Namespace, - jsonMonoBehaviour.Name, - "UnityEngine", - "MonoBehaviour", + type, + null, + typeof(MonoBehaviour), false, cppIndent, builders.CppMethodDefinitions); @@ -1236,11 +1627,11 @@ static void AppendMonoBehaviour( // C# Class extending MonoBehaviour int csharpIndent = AppendNamespaceBeginning( - jsonMonoBehaviour.Namespace, + type.Namespace, builders.CsharpMonoBehaviours); AppendIndent(csharpIndent, builders.CsharpMonoBehaviours); builders.CsharpMonoBehaviours.Append("public class "); - builders.CsharpMonoBehaviours.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviours.Append(type.Name); builders.CsharpMonoBehaviours.Append(" : UnityEngine.MonoBehaviour\n"); AppendIndent(csharpIndent, builders.CsharpMonoBehaviours); builders.CsharpMonoBehaviours.Append("{\n"); @@ -1250,7 +1641,7 @@ static void AppendMonoBehaviour( builders.CsharpMonoBehaviours.Append('\n'); AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); builders.CsharpMonoBehaviours.Append("public "); - builders.CsharpMonoBehaviours.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviours.Append(type.Name); builders.CsharpMonoBehaviours.Append("()\n"); AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); builders.CsharpMonoBehaviours.Append("{\n"); @@ -1268,6 +1659,7 @@ static void AppendMonoBehaviour( messageIndex < jsonMonoBehaviour.Messages.Length; ++messageIndex) { + // Find the MessageInfo string message = jsonMonoBehaviour.Messages[messageIndex]; MessageInfo messageInfo = null; foreach (MessageInfo mi in messageInfos) @@ -1278,10 +1670,11 @@ static void AppendMonoBehaviour( break; } } - Type[] paramTypes = messageInfo.ParameterTypes; - int numParams = paramTypes.Length; + + // Build ParameterInfos ParameterInfo[] parameters = ConvertParameters( - paramTypes); + messageInfo.ParameterTypes); + int numParams = parameters.Length; // C++ Method Declaration AppendIndent( @@ -1290,6 +1683,7 @@ static void AppendMonoBehaviour( AppendCppMethodDeclaration( messageInfo.Name, false, + false, typeof(void), null, parameters, @@ -1307,7 +1701,7 @@ static void AppendMonoBehaviour( builders.CsharpMonoBehaviours.Append('('); for (int i = 0; i < numParams; ++i) { - Type paramType = paramTypes[i]; + Type paramType = parameters[i].ParameterType; AppendCsharpTypeName( paramType, builders.CsharpMonoBehaviours); @@ -1367,7 +1761,7 @@ static void AppendMonoBehaviour( csharpIndent + 2, builders.CsharpMonoBehaviours); builders.CsharpMonoBehaviours.Append("NativeScript.Bindings."); - builders.CsharpMonoBehaviours.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviours.Append(type.Name); builders.CsharpMonoBehaviours.Append(messageInfo.Name); builders.CsharpMonoBehaviours.Append("(thisHandle"); if (numParams > 0) @@ -1404,7 +1798,7 @@ static void AppendMonoBehaviour( builders.CsharpMonoBehaviourDelegates.Append( "\t\tpublic delegate void "); builders.CsharpMonoBehaviourDelegates.Append( - jsonMonoBehaviour.Name); + type.Name); builders.CsharpMonoBehaviourDelegates.Append( messageInfo.Name); builders.CsharpMonoBehaviourDelegates.Append( @@ -1436,17 +1830,17 @@ static void AppendMonoBehaviour( } builders.CsharpMonoBehaviourDelegates.Append(");\n"); builders.CsharpMonoBehaviourDelegates.Append("\t\tpublic static "); - builders.CsharpMonoBehaviourDelegates.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviourDelegates.Append(type.Name); builders.CsharpMonoBehaviourDelegates.Append(messageInfo.Name); builders.CsharpMonoBehaviourDelegates.Append("Delegate "); - builders.CsharpMonoBehaviourDelegates.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviourDelegates.Append(type.Name); builders.CsharpMonoBehaviourDelegates.Append(messageInfo.Name); builders.CsharpMonoBehaviourDelegates.Append(";\n\t\t\n"); // C# Import builders.CsharpMonoBehaviourImports.Append("\t\t[DllImport(Constants.PluginName)]\n"); builders.CsharpMonoBehaviourImports.Append("\t\tpublic static extern void "); - builders.CsharpMonoBehaviourImports.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviourImports.Append(type.Name); builders.CsharpMonoBehaviourImports.Append(messageInfo.Name); builders.CsharpMonoBehaviourImports.Append("(int thisHandle"); if (numParams > 0) @@ -1478,19 +1872,19 @@ static void AppendMonoBehaviour( // C# GetDelegate Call builders.CsharpMonoBehaviourGetDelegateCalls.Append("\t\t\t"); - builders.CsharpMonoBehaviourGetDelegateCalls.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviourGetDelegateCalls.Append(type.Name); builders.CsharpMonoBehaviourGetDelegateCalls.Append(messageInfo.Name); builders.CsharpMonoBehaviourGetDelegateCalls.Append(" = GetDelegate<"); - builders.CsharpMonoBehaviourGetDelegateCalls.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviourGetDelegateCalls.Append(type.Name); builders.CsharpMonoBehaviourGetDelegateCalls.Append(messageInfo.Name); builders.CsharpMonoBehaviourGetDelegateCalls.Append("Delegate>(libraryHandle, \""); - builders.CsharpMonoBehaviourGetDelegateCalls.Append(jsonMonoBehaviour.Name); + builders.CsharpMonoBehaviourGetDelegateCalls.Append(type.Name); builders.CsharpMonoBehaviourGetDelegateCalls.Append(messageInfo.Name); builders.CsharpMonoBehaviourGetDelegateCalls.Append("\");\n"); // C++ Message builders.CppMonoBehaviourMessages.Append("DLLEXPORT void "); - builders.CppMonoBehaviourMessages.Append(jsonMonoBehaviour.Name); + builders.CppMonoBehaviourMessages.Append(type.Name); builders.CppMonoBehaviourMessages.Append(messageInfo.Name); builders.CppMonoBehaviourMessages.Append("(int32_t thisHandle"); if (numParams > 0) @@ -1521,8 +1915,7 @@ static void AppendMonoBehaviour( } builders.CppMonoBehaviourMessages.Append(")\n{\n\t"); AppendCppTypeName( - jsonMonoBehaviour.Namespace, - jsonMonoBehaviour.Name, + type, builders.CppMonoBehaviourMessages); builders.CppMonoBehaviourMessages.Append(" thiz(thisHandle);\n"); for (int i = 0; i < numParams; ++i) @@ -1570,285 +1963,304 @@ static void AppendMonoBehaviour( static void AppendGetter( string fieldName, - string enclosingTypeNameLower, string syntaxType, ParameterInfo[] parameters, - bool isStatic, + bool enclosingTypeIsStatic, + bool methodIsStatic, Type enclosingType, + Type[] typeTypeParams, Type fieldType, int indent, - StringBuilders stringBuilders) + StringBuilders builders) { - // Build uppercased field name - stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append(char.ToUpper(fieldName[0])); - stringBuilders.TempStrBuilder.Append( + // Build uppercase field name + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append(char.ToUpper(fieldName[0])); + builders.TempStrBuilder.Append( fieldName, 1, fieldName.Length-1); - string fieldNameUpper = stringBuilders.TempStrBuilder.ToString(); + string fieldNameUpper = builders.TempStrBuilder.ToString(); // Build uppercase function name - stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append(enclosingType.Name); - stringBuilders.TempStrBuilder.Append(syntaxType); - stringBuilders.TempStrBuilder.Append("Get"); - stringBuilders.TempStrBuilder.Append(fieldNameUpper); - string funcName = stringBuilders.TempStrBuilder.ToString(); + builders.TempStrBuilder.Length = 0; + AppendNamespace( + enclosingType.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendWithoutGenericTypeCountSuffix( + enclosingType.Name, + builders.TempStrBuilder); + AppendTypeNames( + typeTypeParams, + builders.TempStrBuilder); + builders.TempStrBuilder.Append(syntaxType); + builders.TempStrBuilder.Append("Get"); + builders.TempStrBuilder.Append(fieldNameUpper); + string funcName = builders.TempStrBuilder.ToString(); // Build lowercase function name - stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append(enclosingTypeNameLower); - stringBuilders.TempStrBuilder.Append(syntaxType); - stringBuilders.TempStrBuilder.Append("Get"); - stringBuilders.TempStrBuilder.Append(fieldNameUpper); - string funcNameLower = stringBuilders.TempStrBuilder.ToString(); + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string funcNameLower = builders.TempStrBuilder.ToString(); // Build method name - stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append("Get"); - stringBuilders.TempStrBuilder.Append(fieldNameUpper); - string methodName = stringBuilders.TempStrBuilder.ToString(); + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("Get"); + builders.TempStrBuilder.Append(fieldNameUpper); + string methodName = builders.TempStrBuilder.ToString(); // C# init param declaration AppendCsharpInitParam( funcNameLower, - stringBuilders.CsharpInitParams); + builders.CsharpInitParams); // C# delegate type AppendCsharpDelegateType( funcName, - isStatic, + methodIsStatic, fieldType, parameters, - stringBuilders.CsharpDelegateTypes); + builders.CsharpDelegateTypes); // C# init call param AppendCsharpInitCallArg( funcName, - stringBuilders.CsharpInitCall); + builders.CsharpInitCall); // C# function AppendCsharpFunctionBeginning( enclosingType, funcName, - isStatic, + methodIsStatic, fieldType, - null, + typeTypeParams, parameters, - stringBuilders.CsharpFunctions); + builders.CsharpFunctions); AppendCsharpFunctionCallSubject( enclosingType, - isStatic, - stringBuilders.CsharpFunctions); - stringBuilders.CsharpFunctions.Append(fieldName); - stringBuilders.CsharpFunctions.Append(';'); + methodIsStatic, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(fieldName); + builders.CsharpFunctions.Append(';'); AppendCsharpFunctionReturn( parameters, fieldType, - stringBuilders.CsharpFunctions); + builders.CsharpFunctions); // C++ function pointer AppendCppFunctionPointerDefinition( funcName, - isStatic, + methodIsStatic, parameters, fieldType, - stringBuilders.CppFunctionPointers); + builders.CppFunctionPointers); // C++ method declaration - AppendIndent(indent + 1, stringBuilders.CppTypeDefinitions); + AppendIndent(indent + 1, builders.CppTypeDefinitions); AppendCppMethodDeclaration( methodName, - isStatic, + enclosingTypeIsStatic, + methodIsStatic, fieldType, null, parameters, - stringBuilders.CppTypeDefinitions); + builders.CppTypeDefinitions); // C++ method definition AppendCppMethodDefinition( enclosingType, fieldType, methodName, + typeTypeParams, null, parameters, indent, - stringBuilders.CppMethodDefinitions); - AppendIndent(indent, stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( - isStatic, + methodIsStatic, fieldType, funcName, parameters, indent + 1, - stringBuilders.CppMethodDefinitions); + builders.CppMethodDefinitions); AppendCppMethodReturn( fieldType, indent + 1, - stringBuilders.CppMethodDefinitions); - AppendIndent(indent, stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append("}\n"); - AppendIndent(indent, stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append("\n"); + builders.CppMethodDefinitions); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); // C++ init params AppendCppInitParam( funcNameLower, - isStatic, + methodIsStatic, parameters, fieldType, - stringBuilders.CppInitParams); + builders.CppInitParams); // C++ init body AppendCppInitBody( funcName, funcNameLower, - stringBuilders.CppInitBody); + builders.CppInitBody); } static void AppendSetter( string fieldName, string syntaxType, - string enclosingTypeNameLower, ParameterInfo[] parameters, - bool isStatic, + bool enclosingTypeIsStatic, + bool methodIsStatic, Type enclosingType, + Type[] typeTypeParams, Type fieldType, int indent, - StringBuilders stringBuilders) + StringBuilders builders) { // Build uppercased field name - stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append(char.ToUpper(fieldName[0])); - stringBuilders.TempStrBuilder.Append( + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append(char.ToUpper(fieldName[0])); + builders.TempStrBuilder.Append( fieldName, 1, fieldName.Length-1); - string fieldNameUpper = stringBuilders.TempStrBuilder.ToString(); + string fieldNameUpper = builders.TempStrBuilder.ToString(); // Build uppercase function name - stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append(enclosingType.Name); - stringBuilders.TempStrBuilder.Append(syntaxType); - stringBuilders.TempStrBuilder.Append("Set"); - stringBuilders.TempStrBuilder.Append(fieldNameUpper); - string funcName = stringBuilders.TempStrBuilder.ToString(); + builders.TempStrBuilder.Length = 0; + AppendNamespace( + enclosingType.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendWithoutGenericTypeCountSuffix( + enclosingType.Name, + builders.TempStrBuilder); + AppendTypeNames( + typeTypeParams, + builders.TempStrBuilder); + builders.TempStrBuilder.Append(syntaxType); + builders.TempStrBuilder.Append("Set"); + builders.TempStrBuilder.Append(fieldNameUpper); + string funcName = builders.TempStrBuilder.ToString(); // Build lowercase function name - stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append(enclosingTypeNameLower); - stringBuilders.TempStrBuilder.Append(syntaxType); - stringBuilders.TempStrBuilder.Append("Set"); - stringBuilders.TempStrBuilder.Append(fieldNameUpper); - string funcNameLower = stringBuilders.TempStrBuilder.ToString(); + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string funcNameLower = builders.TempStrBuilder.ToString(); // Build method name - stringBuilders.TempStrBuilder.Length = 0; - stringBuilders.TempStrBuilder.Append("Set"); - stringBuilders.TempStrBuilder.Append(fieldNameUpper); - string methodName = stringBuilders.TempStrBuilder.ToString(); + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("Set"); + builders.TempStrBuilder.Append(fieldNameUpper); + string methodName = builders.TempStrBuilder.ToString(); // C# init param declaration AppendCsharpInitParam( funcNameLower, - stringBuilders.CsharpInitParams); + builders.CsharpInitParams); // C# delegate type AppendCsharpDelegateType( funcName, - isStatic, + methodIsStatic, typeof(void), parameters, - stringBuilders.CsharpDelegateTypes); + builders.CsharpDelegateTypes); // C# init call param AppendCsharpInitCallArg( funcName, - stringBuilders.CsharpInitCall); + builders.CsharpInitCall); // C# function AppendCsharpFunctionBeginning( enclosingType, funcName, - isStatic, + methodIsStatic, typeof(void), - null, + typeTypeParams, parameters, - stringBuilders.CsharpFunctions); + builders.CsharpFunctions); AppendCsharpFunctionCallSubject( enclosingType, - isStatic, - stringBuilders.CsharpFunctions); - stringBuilders.CsharpFunctions.Append(fieldName); - stringBuilders.CsharpFunctions.Append(" = "); - stringBuilders.CsharpFunctions.Append("value;"); + methodIsStatic, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(fieldName); + builders.CsharpFunctions.Append(" = "); + builders.CsharpFunctions.Append("value;"); AppendCsharpFunctionReturn( parameters, typeof(void), - stringBuilders.CsharpFunctions); + builders.CsharpFunctions); // C++ function pointer AppendCppFunctionPointerDefinition( funcName, - isStatic, + methodIsStatic, parameters, typeof(void), - stringBuilders.CppFunctionPointers); + builders.CppFunctionPointers); // C++ method declaration - AppendIndent(indent + 1, stringBuilders.CppTypeDefinitions); + AppendIndent(indent + 1, builders.CppTypeDefinitions); AppendCppMethodDeclaration( methodName, - isStatic, + enclosingTypeIsStatic, + methodIsStatic, typeof(void), null, parameters, - stringBuilders.CppTypeDefinitions); + builders.CppTypeDefinitions); // C++ method definition AppendCppMethodDefinition( enclosingType, typeof(void), methodName, + typeTypeParams, null, parameters, indent, - stringBuilders.CppMethodDefinitions); - AppendIndent(indent, stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( - isStatic, + methodIsStatic, null, funcName, parameters, indent + 1, - stringBuilders.CppMethodDefinitions); - AppendIndent(indent, stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append("}\n"); - AppendIndent(indent, stringBuilders.CppMethodDefinitions); - stringBuilders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); // C++ init params AppendCppInitParam( funcNameLower, - isStatic, + methodIsStatic, parameters, typeof(void), - stringBuilders.CppInitParams); + builders.CppInitParams); // C++ init body AppendCppInitBody( funcName, funcNameLower, - stringBuilders.CppInitBody); + builders.CppInitBody); } static int AppendCppTypeDeclaration( string typeNamespace, string typeName, bool isStatic, + Type[] typeParams, StringBuilder output) { int indent = AppendNamespaceBeginning( @@ -1858,7 +2270,9 @@ static int AppendCppTypeDeclaration( if (isStatic) { output.Append("namespace "); - output.Append(typeName); + AppendWithoutGenericTypeCountSuffix( + typeName, + output); output.Append('\n'); AppendIndent(indent, output); output.Append("{\n"); @@ -1867,8 +2281,17 @@ static int AppendCppTypeDeclaration( } else { + if (typeParams != null) + { + output.Append("template<> "); + } output.Append("struct "); - output.Append(typeName); + AppendWithoutGenericTypeCountSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); output.Append(";"); } output.Append('\n'); @@ -1880,17 +2303,16 @@ static int AppendCppTypeDeclaration( } static void AppendCppTypeDefinitionBegin( - string typeNamespace, - string typeName, - string baseTypeNamespace, - string baseTypeName, + Type type, + Type[] typeParams, + Type baseType, bool isStatic, int indent, StringBuilder output ) { AppendNamespaceBeginning( - typeNamespace, + type.Namespace, output); AppendIndent( indent, @@ -1898,18 +2320,27 @@ StringBuilder output if (isStatic) { output.Append("namespace "); - output.Append(typeName); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); } else { + if (typeParams != null) + { + output.Append("template<> "); + } output.Append("struct "); - output.Append(typeName); - if (baseTypeNamespace != null && baseTypeName != null) + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters(typeParams, output); + if (baseType != null) { output.Append(" : "); - output.Append(baseTypeNamespace); - output.Append("::"); - output.Append(baseTypeName); + AppendCppTypeName( + baseType, + output); } } output.Append('\n'); @@ -1919,16 +2350,114 @@ StringBuilder output output.Append("{\n"); if (!isStatic) { - AppendIndent( - indent + 1, + // Constructor from nullptr_t + AppendIndent(indent + 1, output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("(std::nullptr_t n);\n"); + + // Constructor from handle + AppendIndent(indent + 1, output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("(int32_t handle);\n"); + + // Copy constructor + AppendIndent(indent + 1, output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("(const "); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& other);\n"); + + // Move constructor + AppendIndent(indent + 1, output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append('('); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, output); - AppendSystemObjectLifecycleCall( - "SYSTEM_OBJECT_LIFECYCLE_DECLARATION", - typeName, - baseTypeNamespace, - baseTypeName, + output.Append("&& other);\n"); + + // Destructor + AppendIndent(indent + 1, output); + output.Append('~'); + AppendWithoutGenericTypeCountSuffix( + type.Name, output); - output.Append('\n'); + AppendCppTypeParameters( + typeParams, + output); + output.Append("();\n"); + + // Assignment operator to same type + AppendIndent(indent + 1, output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& operator=(const "); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& other);\n"); + + // Assignment operator to nullptr_t + AppendIndent(indent + 1, output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& operator=(std::nullptr_t other);\n"); + + // Move assignment operator to same type + AppendIndent(indent + 1, output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& operator=("); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("&& other);\n"); } } @@ -1953,27 +2482,289 @@ static void AppendCppTypeDefinitionEnd( } static int AppendCppMethodDefinitionBegin( - string typeNamespace, - string typeName, - string baseTypeNamespace, - string baseTypeName, + Type type, + Type[] typeParams, + Type baseType, bool isStatic, int indent, StringBuilder output) { int cppMethodDefinitionsIndent = AppendNamespaceBeginning( - typeNamespace, + type.Namespace, output); if (!isStatic) { + if (baseType == null) + { + baseType = typeof(object); + } + + // Construct with nullptr_t AppendIndent(indent, output); - AppendSystemObjectLifecycleCall( - "SYSTEM_OBJECT_LIFECYCLE_DEFINITION", - typeName, - baseTypeNamespace, - baseTypeName, + AppendWithoutGenericTypeCountSuffix( + type.Name, output); - output.Append('\n'); + AppendCppTypeParameters( + typeParams, + output); + output.Append("::"); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + output.Append("(std::nullptr_t n)\n"); + AppendIndent(indent, output); + output.Append("\t: "); + AppendCppTypeName( + baseType, + output); + output.Append("(0)\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("\n"); + + // Construct with handle + AppendIndent(indent, output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("::"); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + output.Append("(int32_t handle)\n"); + AppendIndent(indent, output); + output.Append("\t: "); + AppendCppTypeName( + baseType, + output); + output.Append("(handle)\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("\n"); + + // Copy constructor + AppendIndent(indent, output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("::"); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + output.Append("(const "); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& other)\n"); + AppendIndent(indent, output); + output.Append("\t: "); + AppendCppTypeName( + baseType, + output); + output.Append("(other)\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("\n"); + + // Move constructor + AppendIndent(indent, output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("::"); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + output.Append("("); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("&& other)\n"); + AppendIndent(indent, output); + output.Append("\t: "); + AppendCppTypeName( + baseType, + output); + output.Append("(std::forward<"); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append(">(other))\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("\n"); + + // Destructor + AppendIndent(indent, output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("::~"); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("()\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent, output); + output.Append("\tif (Handle)\n"); + AppendIndent(indent, output); + output.Append("\t{\n"); + AppendIndent(indent, output); + output.Append("\t\tPlugin::DereferenceManagedObject(Handle);\n"); + AppendIndent(indent, output); + output.Append("\t}\n"); + AppendIndent(indent, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("\n"); + + // Assignment operator to same type + AppendIndent(indent, output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& "); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("::operator=(const "); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& other)\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent, output); + output.Append("\tSetHandle(other.Handle);\n"); + AppendIndent(indent, output); + output.Append("\treturn *this;\n"); + AppendIndent(indent, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("\n"); + + // Assignment operator to nullptr_t + AppendIndent(indent, output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& "); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("::operator=(std::nullptr_t other)\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent, output); + output.Append("\tif (Handle)\n"); + AppendIndent(indent, output); + output.Append("\t{\n"); + AppendIndent(indent, output); + output.Append("\t\tPlugin::DereferenceManagedObject(Handle);\n"); + AppendIndent(indent, output); + output.Append("\t\tHandle = 0;\n"); + AppendIndent(indent, output); + output.Append("\t}\n"); + AppendIndent(indent, output); + output.Append("\treturn *this;\n"); + AppendIndent(indent, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("\n"); + + // Move assignment operator to same type + AppendIndent(indent, output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& "); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("::operator=("); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("&& other)\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent, output); + output.Append("\tif (Handle)\n"); + AppendIndent(indent, output); + output.Append("\t{\n"); + AppendIndent(indent, output); + output.Append("\t\tPlugin::DereferenceManagedObject(Handle);\n"); + AppendIndent(indent, output); + output.Append("\t}\n"); + AppendIndent(indent, output); + output.Append("\tHandle = other.Handle;\n"); + AppendIndent(indent, output); + output.Append("\tother.Handle = 0;\n"); + AppendIndent(indent, output); + output.Append("\treturn *this;\n"); + AppendIndent(indent, output); + output.Append("}\n"); AppendIndent(indent, output); output.Append('\n'); } @@ -1992,26 +2783,6 @@ static void AppendCppMethodDefinitionEnd( output.Append('\n'); } - static void AppendSystemObjectLifecycleCall( - string macroName, - string typeName, - string baseTypeNamespace, - string baseTypeName, - StringBuilder output) - { - if (baseTypeNamespace != null && baseTypeName != null) - { - output.Append(macroName); - output.Append('('); - output.Append(typeName); - output.Append(", "); - output.Append(baseTypeNamespace); - output.Append("::"); - output.Append(baseTypeName); - output.Append(")"); - } - } - static int AppendNamespaceBeginning( string namespaceName, StringBuilder output) @@ -2127,7 +2898,7 @@ static void AppendCsharpFunctionBeginning( string funcName, bool isStatic, Type returnType, - Type[] typeParameters, + Type[] typeParams, ParameterInfo[] parameters, StringBuilder output) { @@ -2192,7 +2963,7 @@ static void AppendCsharpFunctionBeginning( if (!paramType.Equals(typeof(object))) { output.Append('('); - output.Append(paramType); + AppendCsharpTypeName(paramType, output); output.Append(')'); } output.Append("NativeScript.Bindings.GetObject("); @@ -2407,38 +3178,52 @@ static void AppendCppMethodDefinition( Type enclosingType, Type returnType, string methodName, - Type[] typeParameters, + Type[] typeTypeParams, + Type[] methodTypeParams, ParameterInfo[] parameters, int indent, StringBuilder output) { - AppendIndent(indent, output); - if (typeParameters != null) + // Indent + AppendIndent( + indent, + output); + + // Template + if (methodTypeParams != null) { output.Append("template<> "); } + + // Return type if (returnType != null) { - AppendCppTypeName(returnType, output); + AppendCppTypeName( + returnType, + output); output.Append(' '); } - output.Append(enclosingType.Name); + + // Type name + AppendWithoutGenericTypeCountSuffix( + enclosingType.Name, + output); + AppendCppTypeParameters( + typeTypeParams, + output); output.Append("::"); - output.Append(methodName); - if (typeParameters != null) - { - output.Append("<"); - for (int i = 0; i < typeParameters.Length; ++i) - { - Type typeParam = typeParameters[i]; - AppendCppTypeName(typeParam, output); - if (i != typeParameters.Length - 1) - { - output.Append(", "); - } - } - output.Append(">"); - } + + // Method name + AppendWithoutGenericTypeCountSuffix( + methodName, + output); + + // Template parameters + AppendCppTypeParameters( + methodTypeParams, + output); + + // Parameters output.Append('('); AppendCppParameterDeclaration( parameters, @@ -2640,49 +3425,61 @@ static void AppendCppFunctionPointer( output.Append(separator); } - static void AppendCppMethodDeclaration( - string methodName, - bool isStatic, - Type returnType, - Type[] typeParameters, - ParameterInfo[] parameters, + static void AppendCppTemplateTypenames( + int numTypeParameters, StringBuilder output) { - if (typeParameters != null) + if (numTypeParameters > 0) { - output.Append("template "); } + } + + static void AppendCppMethodDeclaration( + string methodName, + bool enclosingTypeIsStatic, + bool methodIsStatic, + Type returnType, + Type[] typeParameters, + ParameterInfo[] parameters, + StringBuilder output) + { + AppendCppTemplateTypenames( + typeParameters == null ? 0 : typeParameters.Length, + output); - if (isStatic) + if (!enclosingTypeIsStatic && methodIsStatic) { output.Append("static "); } // Return type - if (typeParameters != null) - { - output.Append("T0 "); - } - else if (returnType != null) + if (returnType != null) { - AppendCppTypeName(returnType, output); + AppendCppTypeName( + returnType, + output); output.Append(' '); } - output.Append(methodName); - output.Append('('); + // Method name might be a constructor/type name, so remove suffix + // just in case + AppendWithoutGenericTypeCountSuffix( + methodName, + output); // Parameters + output.Append('('); AppendCppParameterDeclaration( parameters, output); @@ -2741,7 +3538,13 @@ static void AppendCsharpTypeName( { output.Append(type.Namespace); output.Append('.'); - output.Append(type.Name); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + Type[] genTypes = type.GetGenericArguments(); + AppendCSharpTypeParameters( + genTypes, + output); } } @@ -2799,6 +3602,10 @@ static void AppendCppTypeName( type.Namespace, type.Name, output); + Type[] genTypes = type.GetGenericArguments(); + AppendCppTypeParameters( + genTypes, + output); } } @@ -2809,7 +3616,9 @@ static void AppendCppTypeName( { AppendNamespace(namespaceName, "::", output); output.Append("::"); - output.Append(name); + AppendWithoutGenericTypeCountSuffix( + name, + output); } static void LogStringBuilders( diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index c2eadfa..0e4238e 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -1,133 +1,183 @@ { "Assemblies": [ + "DOTNET_DLLS/System.Xml.dll" + ], + "Types": [ { - "Path": "/Applications/Unity/Unity.app/Contents/Mono/lib/mono/unity/System.dll", - "Types": [ - { - "Name": "System.Diagnostics.Stopwatch", - "Constructors": [ - { - "Types": [] - } - ], - "Methods": [ - { - "Name": "Start", - "ParamTypes": [] - }, - { - "Name": "Reset", - "ParamTypes": [] - } - ], - "Properties": [ "ElapsedMilliseconds" ] + "Name": "System.Diagnostics.Stopwatch", + "Constructors": [ + { + "ParamTypes": [] } - ] + ], + "Methods": [ + { + "Name": "Start", + "ParamTypes": [] + }, + { + "Name": "Reset", + "ParamTypes": [] + } + ], + "Properties": [ "ElapsedMilliseconds" ] + }, + { + "Name": "UnityEngine.Object", + "Properties": [ "name" ] }, { - "Path": "/Applications/Unity/Unity.app/Contents/Managed/UnityEngine.dll", - "Types": [ + "Name": "UnityEngine.GameObject", + "Constructors": [ { - "Name": "UnityEngine.Object", - "Properties": [ "name" ] + "ParamTypes": [] }, { - "Name": "UnityEngine.GameObject", - "Constructors": [ - { - "Types": [] - }, - { - "Types": [ "System.String" ] - } - ], - "Methods": [ - { - "Name": "Find", - "ReturnType": "UnityEngine.GameObject", - "ParamTypes": [ "System.String" ] - }, - { - "Name": "AddComponent", - "ReturnType": "T", - "ParamTypes": [], - "GenericTypes": [ - { - "Name": "T", - "Type": "MyGame.MonoBehaviours.TestScript" - } - ] - } - ], - "Properties": [ "transform" ] - }, + "ParamTypes": [ "System.String" ] + } + ], + "Methods": [ { - "Name": "UnityEngine.Component", - "Properties": [ "transform" ] + "Name": "Find", + "ParamTypes": [ "System.String" ] }, { - "Name": "UnityEngine.Transform", - "Properties": [ "position" ] - }, + "Name": "AddComponent", + "ParamTypes": [], + "GenericParams": [ + { "Types": [ "MyGame.MonoBehaviours.TestScript" ] } + ] + } + ], + "Properties": [ "transform" ] + }, + { + "Name": "UnityEngine.Component", + "Properties": [ "transform" ] + }, + { + "Name": "UnityEngine.Transform", + "Properties": [ "position" ] + }, + { + "Name": "UnityEngine.Debug", + "Methods": [ { - "Name": "UnityEngine.Debug", - "Methods": [ - { - "Name": "Log", - "ParamTypes": [ "System.Object" ] - } + "Name": "Log", + "ParamTypes": [ "System.Object" ] + } + ] + }, + { + "Name": "UnityEngine.Assertions.Assert", + "Fields": [ "raiseExceptions" ], + "Methods": [ + { + "Name": "AreEqual", + "ParamTypes": [ "T", "T" ], + "GenericParams": [ + { "Types": [ "System.String" ] }, + { "Types": [ "UnityEngine.GameObject" ] } ] - }, + } + ] + }, + { + "Name": "UnityEngine.Collision" + }, + { + "Name": "UnityEngine.Behaviour" + }, + { + "Name": "UnityEngine.MonoBehaviour" + }, + { + "Name": "UnityEngine.AudioSettings", + "Methods": [ { - "Name": "UnityEngine.Assertions.Assert", - "Fields": [ "raiseExceptions" ] - }, + "Name": "GetDSPBufferSize", + "ParamTypes": [ + "System.Int32", + "System.Int32" + ] + } + ] + }, + { + "Name": "UnityEngine.Networking.NetworkTransport", + "Methods": [ { - "Name": "UnityEngine.Collision" + "Name": "GetBroadcastConnectionInfo", + "ParamTypes": [ + "System.Int32", + "System.String", + "System.Int32", + "System.Byte" + ] }, { - "Name": "UnityEngine.Behaviour" - }, + "Name": "Init", + "ParamTypes": [] + } + ] + }, + { + "Name": "System.Collections.Generic.List`1", + "GenericParams": [ + { "Types": [ "System.String" ] } + ], + "Constructors": [ { - "Name": "UnityEngine.MonoBehaviour" - }, + "ParamTypes": [] + } + ], + "Methods": [ { - "Name": "UnityEngine.AudioSettings", - "Methods": [ - { - "Name": "GetDSPBufferSize", - "ParamTypes": [ - "System.Int32", - "System.Int32" - ] - } - ] - }, + "Name": "Add", + "ParamTypes": [ "T" ] + } + ] + }, + { + "Name": "System.Collections.Generic.LinkedListNode`1", + "GenericParams": [ + { "Types": [ "System.String" ] } + ], + "Constructors": [ { - "Name": "UnityEngine.Networking.NetworkTransport", - "Methods": [ - { - "Name": "GetBroadcastConnectionInfo", - "ParamTypes": [ - "System.Int32", - "System.String", - "System.Int32", - "System.Byte" - ] - }, - { - "Name": "Init", - "ParamTypes": [] - } - ] + "ParamTypes": [ "T" ] + } + ], + "Properties": [ "Value" ] + }, + { + "Name": " System.Runtime.CompilerServices.StrongBox`1", + "GenericParams": [ + { "Types": [ "System.String" ] } + ], + "Fields": [ "Value" ], + "Constructors": [ + { + "ParamTypes": [ "T" ] } ] + }, + { + "Name": "System.Collections.ObjectModel.Collection`1", + "GenericParams": [ + { "Types": [ "System.Int32" ] } + ] + }, + { + "Name": "System.Collections.ObjectModel.KeyedCollection`2", + "GenericParams": [ + { "Types": [ "System.String", "System.Int32" ] } + ] } ], "MonoBehaviours": [ { - "Name": "TestScript", - "Namespace": "MyGame.MonoBehaviours", + "Name": "MyGame.MonoBehaviours.TestScript", "Messages": [ "Awake", "OnAnimatorIK", diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index f4c1ad4..28807b2 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -16,11 +16,34 @@ using namespace UnityEngine; void PrintPlatformDefines(); // Called when the plugin is initialized +// This is mostly full of test code. Feel free to remove it all. void PluginMain() { PrintPlatformDefines(); Debug::Log(String("Game booted up")); - GameObject go(String("GameObject with a TestScript")); + + if (!UnityEngine::Assertions::Assert::GetRaiseExceptions()) + { + UnityEngine::Assertions::Assert::SetRaiseExceptions(true); + } + + System::Collections::Generic::List strings; + strings.Add("one"); + strings.Add("two"); + strings.Add("three"); + Debug::Log(strings); + + System::Runtime::CompilerServices::StrongBox strongbox("secret"); + Debug::Log(strongbox.GetValue()); + strongbox.SetValue("new secret"); + Debug::Log(strongbox.GetValue()); + + System::Collections::Generic::LinkedListNode node("node val"); + Debug::Log(node.GetValue()); + node.SetValue("new node val"); + Debug::Log(node.GetValue()); + + GameObject go("GameObject with a TestScript"); go.AddComponent(); } diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 0773c2e..ada5ac1 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -42,26 +42,36 @@ namespace Plugin int32_t (*StringNew)(const char* chars); /*BEGIN FUNCTION POINTERS*/ - int32_t (*StopwatchConstructor)(); - int64_t (*StopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle); - void (*StopwatchMethodStart)(int32_t thisHandle); - void (*StopwatchMethodReset)(int32_t thisHandle); - int32_t (*ObjectPropertyGetName)(int32_t thisHandle); - void (*ObjectPropertySetName)(int32_t thisHandle, int32_t valueHandle); - int32_t (*GameObjectConstructor)(); - int32_t (*GameObjectConstructorSystemString)(int32_t nameHandle); - int32_t (*GameObjectPropertyGetTransform)(int32_t thisHandle); - int32_t (*GameObjectMethodFindSystemString)(int32_t nameHandle); - int32_t (*GameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle); - int32_t (*ComponentPropertyGetTransform)(int32_t thisHandle); - UnityEngine::Vector3 (*TransformPropertyGetPosition)(int32_t thisHandle); - void (*TransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3 value); - void (*DebugMethodLogSystemObject)(int32_t messageHandle); - System::Boolean (*AssertFieldGetRaiseExceptions)(); - void (*AssertFieldSetRaiseExceptions)(System::Boolean value); - void (*AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)(int32_t* bufferLength, int32_t* numBuffers); - void (*NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)(int32_t hostId, int32_t* addressHandle, int32_t* port, uint8_t* error); - void (*NetworkTransportMethodInit)(); + int32_t (*SystemDiagnosticsStopwatchConstructor)(); + int64_t (*SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle); + void (*SystemDiagnosticsStopwatchMethodStart)(int32_t thisHandle); + void (*SystemDiagnosticsStopwatchMethodReset)(int32_t thisHandle); + int32_t (*UnityEngineObjectPropertyGetName)(int32_t thisHandle); + void (*UnityEngineObjectPropertySetName)(int32_t thisHandle, int32_t valueHandle); + int32_t (*UnityEngineGameObjectConstructor)(); + int32_t (*UnityEngineGameObjectConstructorSystemString)(int32_t nameHandle); + int32_t (*UnityEngineGameObjectPropertyGetTransform)(int32_t thisHandle); + int32_t (*UnityEngineGameObjectMethodFindSystemString)(int32_t nameHandle); + int32_t (*UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle); + int32_t (*UnityEngineComponentPropertyGetTransform)(int32_t thisHandle); + UnityEngine::Vector3 (*UnityEngineTransformPropertyGetPosition)(int32_t thisHandle); + void (*UnityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3 value); + void (*UnityEngineDebugMethodLogSystemObject)(int32_t messageHandle); + System::Boolean (*UnityEngineAssertionsAssertFieldGetRaiseExceptions)(); + void (*UnityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value); + void (*UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString)(int32_t expectedHandle, int32_t actualHandle); + void (*UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject)(int32_t expectedHandle, int32_t actualHandle); + void (*UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)(int32_t* bufferLength, int32_t* numBuffers); + void (*UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)(int32_t hostId, int32_t* addressHandle, int32_t* port, uint8_t* error); + void (*UnityEngineNetworkingNetworkTransportMethodInit)(); + int32_t (*SystemCollectionsGenericListSystemStringConstructor)(); + void (*SystemCollectionsGenericListSystemStringMethodAddSystemString)(int32_t thisHandle, int32_t itemHandle); + int32_t (*SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)(int32_t valueHandle); + int32_t (*SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue)(int32_t thisHandle); + void (*SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue)(int32_t thisHandle, int32_t valueHandle); + int32_t (*SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString)(int32_t valueHandle); + int32_t (*SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)(int32_t thisHandle); + void (*SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)(int32_t thisHandle, int32_t valueHandle); /*END FUNCTION POINTERS*/ } @@ -169,62 +179,59 @@ namespace System return Handle != 0; } - #define SYSTEM_OBJECT_LIFECYCLE_DEFINITION(ClassName, BaseClassName) \ - ClassName::ClassName(std::nullptr_t n) \ - : BaseClassName(0) \ - { \ - } \ - \ - ClassName::ClassName(int32_t handle) \ - : BaseClassName(handle) \ - { \ - } \ - \ - ClassName::ClassName(const ClassName& other) \ - : BaseClassName(other) \ - { \ - } \ - \ - ClassName::ClassName(ClassName&& other) \ - : BaseClassName(std::forward(other)) \ - { \ - } \ - \ - ClassName::~ClassName() \ - { \ - if (Handle) \ - { \ - Plugin::DereferenceManagedObject(Handle); \ - } \ - } \ - \ - ClassName& ClassName::operator=(const ClassName& other) \ - { \ - SetHandle(other.Handle); \ - return *this; \ - } \ - ClassName& ClassName::operator=(std::nullptr_t other) \ - { \ - if (Handle) \ - { \ - Plugin::DereferenceManagedObject(Handle); \ - Handle = 0; \ - } \ - return *this; \ - } \ - \ - ClassName& ClassName::operator=(ClassName&& other) \ - { \ - if (Handle) \ - { \ - Plugin::DereferenceManagedObject(Handle); \ - } \ - Handle = other.Handle; \ - other.Handle = 0; \ - return *this; \ - } - - SYSTEM_OBJECT_LIFECYCLE_DEFINITION(String, System::Object) + String::String(std::nullptr_t n) + : Object(0) + { + } + + String::String(int32_t handle) + : Object(handle) + { + } + + String::String(const String& other) + : Object(other) + { + } + + String::String(String&& other) + : Object(std::forward(other)) + { + } + + String::~String() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + String& String::operator=(const String& other) + { + SetHandle(other.Handle); + return *this; + } + String& String::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + String& String::operator=(String&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } String::String(const char* chars) : String(Plugin::StringNew(chars)) @@ -237,120 +244,438 @@ namespace System { namespace Diagnostics { - SYSTEM_OBJECT_LIFECYCLE_DEFINITION(Stopwatch, System::Object) + Stopwatch::Stopwatch(std::nullptr_t n) + : System::Object(0) + { + } + + Stopwatch::Stopwatch(int32_t handle) + : System::Object(handle) + { + } + + Stopwatch::Stopwatch(const Stopwatch& other) + : System::Object(other) + { + } + + Stopwatch::Stopwatch(Stopwatch&& other) + : System::Object(std::forward(other)) + { + } + + Stopwatch::~Stopwatch() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + Stopwatch& Stopwatch::operator=(const Stopwatch& other) + { + SetHandle(other.Handle); + return *this; + } + + Stopwatch& Stopwatch::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + Stopwatch& Stopwatch::operator=(Stopwatch&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } Stopwatch::Stopwatch() : System::Object(0) { - auto returnValue = Plugin::StopwatchConstructor(); + auto returnValue = Plugin::SystemDiagnosticsStopwatchConstructor(); SetHandle(returnValue); } int64_t Stopwatch::GetElapsedMilliseconds() { - auto returnValue = Plugin::StopwatchPropertyGetElapsedMilliseconds(Handle); + auto returnValue = Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(Handle); return returnValue; } void Stopwatch::Start() { - Plugin::StopwatchMethodStart(Handle); + Plugin::SystemDiagnosticsStopwatchMethodStart(Handle); } void Stopwatch::Reset() { - Plugin::StopwatchMethodReset(Handle); + Plugin::SystemDiagnosticsStopwatchMethodReset(Handle); } } } namespace UnityEngine { - SYSTEM_OBJECT_LIFECYCLE_DEFINITION(Object, System::Object) + Object::Object(std::nullptr_t n) + : System::Object(0) + { + } + + Object::Object(int32_t handle) + : System::Object(handle) + { + } + + Object::Object(const Object& other) + : System::Object(other) + { + } + + Object::Object(Object&& other) + : System::Object(std::forward(other)) + { + } + + Object::~Object() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + Object& Object::operator=(const Object& other) + { + SetHandle(other.Handle); + return *this; + } + + Object& Object::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + Object& Object::operator=(Object&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } System::String Object::GetName() { - auto returnValue = Plugin::ObjectPropertyGetName(Handle); + auto returnValue = Plugin::UnityEngineObjectPropertyGetName(Handle); return returnValue; } void Object::SetName(System::String value) { - Plugin::ObjectPropertySetName(Handle, value.Handle); + Plugin::UnityEngineObjectPropertySetName(Handle, value.Handle); } } namespace UnityEngine { - SYSTEM_OBJECT_LIFECYCLE_DEFINITION(GameObject, UnityEngine::Object) + GameObject::GameObject(std::nullptr_t n) + : UnityEngine::Object(0) + { + } + + GameObject::GameObject(int32_t handle) + : UnityEngine::Object(handle) + { + } + + GameObject::GameObject(const GameObject& other) + : UnityEngine::Object(other) + { + } + + GameObject::GameObject(GameObject&& other) + : UnityEngine::Object(std::forward(other)) + { + } + + GameObject::~GameObject() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + GameObject& GameObject::operator=(const GameObject& other) + { + SetHandle(other.Handle); + return *this; + } + + GameObject& GameObject::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + GameObject& GameObject::operator=(GameObject&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } GameObject::GameObject() : UnityEngine::Object(0) { - auto returnValue = Plugin::GameObjectConstructor(); + auto returnValue = Plugin::UnityEngineGameObjectConstructor(); SetHandle(returnValue); } GameObject::GameObject(System::String name) : UnityEngine::Object(0) { - auto returnValue = Plugin::GameObjectConstructorSystemString(name.Handle); + auto returnValue = Plugin::UnityEngineGameObjectConstructorSystemString(name.Handle); SetHandle(returnValue); } UnityEngine::Transform GameObject::GetTransform() { - auto returnValue = Plugin::GameObjectPropertyGetTransform(Handle); + auto returnValue = Plugin::UnityEngineGameObjectPropertyGetTransform(Handle); return returnValue; } UnityEngine::GameObject GameObject::Find(System::String name) { - auto returnValue = Plugin::GameObjectMethodFindSystemString(name.Handle); + auto returnValue = Plugin::UnityEngineGameObjectMethodFindSystemString(name.Handle); return returnValue; } template<> MyGame::MonoBehaviours::TestScript GameObject::AddComponent() { - auto returnValue = Plugin::GameObjectMethodAddComponentMyGameMonoBehavioursTestScript(Handle); + auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(Handle); return returnValue; } } namespace UnityEngine { - SYSTEM_OBJECT_LIFECYCLE_DEFINITION(Component, UnityEngine::Object) + Component::Component(std::nullptr_t n) + : UnityEngine::Object(0) + { + } + + Component::Component(int32_t handle) + : UnityEngine::Object(handle) + { + } + + Component::Component(const Component& other) + : UnityEngine::Object(other) + { + } + + Component::Component(Component&& other) + : UnityEngine::Object(std::forward(other)) + { + } + + Component::~Component() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + Component& Component::operator=(const Component& other) + { + SetHandle(other.Handle); + return *this; + } + + Component& Component::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + Component& Component::operator=(Component&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } UnityEngine::Transform Component::GetTransform() { - auto returnValue = Plugin::ComponentPropertyGetTransform(Handle); + auto returnValue = Plugin::UnityEngineComponentPropertyGetTransform(Handle); return returnValue; } } namespace UnityEngine { - SYSTEM_OBJECT_LIFECYCLE_DEFINITION(Transform, UnityEngine::Component) + Transform::Transform(std::nullptr_t n) + : UnityEngine::Component(0) + { + } + + Transform::Transform(int32_t handle) + : UnityEngine::Component(handle) + { + } + + Transform::Transform(const Transform& other) + : UnityEngine::Component(other) + { + } + + Transform::Transform(Transform&& other) + : UnityEngine::Component(std::forward(other)) + { + } + + Transform::~Transform() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + Transform& Transform::operator=(const Transform& other) + { + SetHandle(other.Handle); + return *this; + } + + Transform& Transform::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + Transform& Transform::operator=(Transform&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } UnityEngine::Vector3 Transform::GetPosition() { - auto returnValue = Plugin::TransformPropertyGetPosition(Handle); + auto returnValue = Plugin::UnityEngineTransformPropertyGetPosition(Handle); return returnValue; } void Transform::SetPosition(UnityEngine::Vector3 value) { - Plugin::TransformPropertySetPosition(Handle, value); + Plugin::UnityEngineTransformPropertySetPosition(Handle, value); } } namespace UnityEngine { - SYSTEM_OBJECT_LIFECYCLE_DEFINITION(Debug, System::Object) + Debug::Debug(std::nullptr_t n) + : System::Object(0) + { + } + + Debug::Debug(int32_t handle) + : System::Object(handle) + { + } + + Debug::Debug(const Debug& other) + : System::Object(other) + { + } + + Debug::Debug(Debug&& other) + : System::Object(std::forward(other)) + { + } + + Debug::~Debug() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + Debug& Debug::operator=(const Debug& other) + { + SetHandle(other.Handle); + return *this; + } + + Debug& Debug::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + Debug& Debug::operator=(Debug&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } void Debug::Log(System::Object message) { - Plugin::DebugMethodLogSystemObject(message.Handle); + Plugin::UnityEngineDebugMethodLogSystemObject(message.Handle); } } @@ -360,39 +685,261 @@ namespace UnityEngine { System::Boolean Assert::GetRaiseExceptions() { - auto returnValue = Plugin::AssertFieldGetRaiseExceptions(); + auto returnValue = Plugin::UnityEngineAssertionsAssertFieldGetRaiseExceptions(); return returnValue; } void Assert::SetRaiseExceptions(System::Boolean value) { - Plugin::AssertFieldSetRaiseExceptions(value); + Plugin::UnityEngineAssertionsAssertFieldSetRaiseExceptions(value); + } + + template<> void Assert::AreEqual(System::String expected, System::String actual) + { + Plugin::UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(expected.Handle, actual.Handle); + } + + template<> void Assert::AreEqual(UnityEngine::GameObject expected, UnityEngine::GameObject actual) + { + Plugin::UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(expected.Handle, actual.Handle); } } } namespace UnityEngine { - SYSTEM_OBJECT_LIFECYCLE_DEFINITION(Collision, System::Object) -} - -namespace UnityEngine -{ - SYSTEM_OBJECT_LIFECYCLE_DEFINITION(Behaviour, UnityEngine::Component) -} - -namespace UnityEngine -{ - SYSTEM_OBJECT_LIFECYCLE_DEFINITION(MonoBehaviour, UnityEngine::Behaviour) -} + Collision::Collision(std::nullptr_t n) + : System::Object(0) + { + } + + Collision::Collision(int32_t handle) + : System::Object(handle) + { + } + + Collision::Collision(const Collision& other) + : System::Object(other) + { + } + + Collision::Collision(Collision&& other) + : System::Object(std::forward(other)) + { + } + + Collision::~Collision() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + Collision& Collision::operator=(const Collision& other) + { + SetHandle(other.Handle); + return *this; + } + + Collision& Collision::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + Collision& Collision::operator=(Collision&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } +} + +namespace UnityEngine +{ + Behaviour::Behaviour(std::nullptr_t n) + : UnityEngine::Component(0) + { + } + + Behaviour::Behaviour(int32_t handle) + : UnityEngine::Component(handle) + { + } + + Behaviour::Behaviour(const Behaviour& other) + : UnityEngine::Component(other) + { + } + + Behaviour::Behaviour(Behaviour&& other) + : UnityEngine::Component(std::forward(other)) + { + } + + Behaviour::~Behaviour() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + Behaviour& Behaviour::operator=(const Behaviour& other) + { + SetHandle(other.Handle); + return *this; + } + + Behaviour& Behaviour::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + Behaviour& Behaviour::operator=(Behaviour&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } +} + +namespace UnityEngine +{ + MonoBehaviour::MonoBehaviour(std::nullptr_t n) + : UnityEngine::Behaviour(0) + { + } + + MonoBehaviour::MonoBehaviour(int32_t handle) + : UnityEngine::Behaviour(handle) + { + } + + MonoBehaviour::MonoBehaviour(const MonoBehaviour& other) + : UnityEngine::Behaviour(other) + { + } + + MonoBehaviour::MonoBehaviour(MonoBehaviour&& other) + : UnityEngine::Behaviour(std::forward(other)) + { + } + + MonoBehaviour::~MonoBehaviour() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + MonoBehaviour& MonoBehaviour::operator=(const MonoBehaviour& other) + { + SetHandle(other.Handle); + return *this; + } + + MonoBehaviour& MonoBehaviour::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + MonoBehaviour& MonoBehaviour::operator=(MonoBehaviour&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } +} namespace UnityEngine { - SYSTEM_OBJECT_LIFECYCLE_DEFINITION(AudioSettings, System::Object) + AudioSettings::AudioSettings(std::nullptr_t n) + : System::Object(0) + { + } + + AudioSettings::AudioSettings(int32_t handle) + : System::Object(handle) + { + } + + AudioSettings::AudioSettings(const AudioSettings& other) + : System::Object(other) + { + } + + AudioSettings::AudioSettings(AudioSettings&& other) + : System::Object(std::forward(other)) + { + } + + AudioSettings::~AudioSettings() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + AudioSettings& AudioSettings::operator=(const AudioSettings& other) + { + SetHandle(other.Handle); + return *this; + } + + AudioSettings& AudioSettings::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + AudioSettings& AudioSettings::operator=(AudioSettings&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } void AudioSettings::GetDSPBufferSize(int32_t* bufferLength, int32_t* numBuffers) { - Plugin::AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(bufferLength, numBuffers); + Plugin::UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(bufferLength, numBuffers); } } @@ -400,18 +947,439 @@ namespace UnityEngine { namespace Networking { - SYSTEM_OBJECT_LIFECYCLE_DEFINITION(NetworkTransport, System::Object) + NetworkTransport::NetworkTransport(std::nullptr_t n) + : System::Object(0) + { + } + + NetworkTransport::NetworkTransport(int32_t handle) + : System::Object(handle) + { + } + + NetworkTransport::NetworkTransport(const NetworkTransport& other) + : System::Object(other) + { + } + + NetworkTransport::NetworkTransport(NetworkTransport&& other) + : System::Object(std::forward(other)) + { + } + + NetworkTransport::~NetworkTransport() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + NetworkTransport& NetworkTransport::operator=(const NetworkTransport& other) + { + SetHandle(other.Handle); + return *this; + } + + NetworkTransport& NetworkTransport::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + NetworkTransport& NetworkTransport::operator=(NetworkTransport&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } void NetworkTransport::GetBroadcastConnectionInfo(int32_t hostId, System::String* address, int32_t* port, uint8_t* error) { int32_t addressHandle = address->Handle; - Plugin::NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(hostId, &addressHandle, port, error); + Plugin::UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(hostId, &addressHandle, port, error); address->SetHandle(addressHandle); } void NetworkTransport::Init() { - Plugin::NetworkTransportMethodInit(); + Plugin::UnityEngineNetworkingNetworkTransportMethodInit(); + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + List::List(std::nullptr_t n) + : System::Object(0) + { + } + + List::List(int32_t handle) + : System::Object(handle) + { + } + + List::List(const List& other) + : System::Object(other) + { + } + + List::List(List&& other) + : System::Object(std::forward>(other)) + { + } + + List::~List() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + List& List::operator=(const List& other) + { + SetHandle(other.Handle); + return *this; + } + + List& List::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + List& List::operator=(List&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + List::List() + : System::Object(0) + { + auto returnValue = Plugin::SystemCollectionsGenericListSystemStringConstructor(); + SetHandle(returnValue); + } + + void List::Add(System::String item) + { + Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString(Handle, item.Handle); + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + LinkedListNode::LinkedListNode(std::nullptr_t n) + : System::Object(0) + { + } + + LinkedListNode::LinkedListNode(int32_t handle) + : System::Object(handle) + { + } + + LinkedListNode::LinkedListNode(const LinkedListNode& other) + : System::Object(other) + { + } + + LinkedListNode::LinkedListNode(LinkedListNode&& other) + : System::Object(std::forward>(other)) + { + } + + LinkedListNode::~LinkedListNode() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + LinkedListNode& LinkedListNode::operator=(const LinkedListNode& other) + { + SetHandle(other.Handle); + return *this; + } + + LinkedListNode& LinkedListNode::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + LinkedListNode& LinkedListNode::operator=(LinkedListNode&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + LinkedListNode::LinkedListNode(System::String value) + : System::Object(0) + { + auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(value.Handle); + SetHandle(returnValue); + } + + System::String LinkedListNode::GetValue() + { + auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(Handle); + return returnValue; + } + + void LinkedListNode::SetValue(System::String value) + { + Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(Handle, value.Handle); + } + } + } +} + +namespace System +{ + namespace Runtime + { + namespace CompilerServices + { + StrongBox::StrongBox(std::nullptr_t n) + : System::Object(0) + { + } + + StrongBox::StrongBox(int32_t handle) + : System::Object(handle) + { + } + + StrongBox::StrongBox(const StrongBox& other) + : System::Object(other) + { + } + + StrongBox::StrongBox(StrongBox&& other) + : System::Object(std::forward>(other)) + { + } + + StrongBox::~StrongBox() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + StrongBox& StrongBox::operator=(const StrongBox& other) + { + SetHandle(other.Handle); + return *this; + } + + StrongBox& StrongBox::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + StrongBox& StrongBox::operator=(StrongBox&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + StrongBox::StrongBox(System::String value) + : System::Object(0) + { + auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(value.Handle); + SetHandle(returnValue); + } + + System::String StrongBox::GetValue() + { + auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(Handle); + return returnValue; + } + + void StrongBox::SetValue(System::String value) + { + Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(Handle, value.Handle); + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + Collection::Collection(std::nullptr_t n) + : System::Object(0) + { + } + + Collection::Collection(int32_t handle) + : System::Object(handle) + { + } + + Collection::Collection(const Collection& other) + : System::Object(other) + { + } + + Collection::Collection(Collection&& other) + : System::Object(std::forward>(other)) + { + } + + Collection::~Collection() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + Collection& Collection::operator=(const Collection& other) + { + SetHandle(other.Handle); + return *this; + } + + Collection& Collection::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + Collection& Collection::operator=(Collection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + KeyedCollection::KeyedCollection(std::nullptr_t n) + : System::Collections::ObjectModel::Collection(0) + { + } + + KeyedCollection::KeyedCollection(int32_t handle) + : System::Collections::ObjectModel::Collection(handle) + { + } + + KeyedCollection::KeyedCollection(const KeyedCollection& other) + : System::Collections::ObjectModel::Collection(other) + { + } + + KeyedCollection::KeyedCollection(KeyedCollection&& other) + : System::Collections::ObjectModel::Collection(std::forward>(other)) + { + } + + KeyedCollection::~KeyedCollection() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + KeyedCollection& KeyedCollection::operator=(const KeyedCollection& other) + { + SetHandle(other.Handle); + return *this; + } + + KeyedCollection& KeyedCollection::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + KeyedCollection& KeyedCollection::operator=(KeyedCollection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } } } } @@ -420,7 +1388,60 @@ namespace MyGame { namespace MonoBehaviours { - SYSTEM_OBJECT_LIFECYCLE_DEFINITION(TestScript, UnityEngine::MonoBehaviour) + TestScript::TestScript(std::nullptr_t n) + : UnityEngine::MonoBehaviour(0) + { + } + + TestScript::TestScript(int32_t handle) + : UnityEngine::MonoBehaviour(handle) + { + } + + TestScript::TestScript(const TestScript& other) + : UnityEngine::MonoBehaviour(other) + { + } + + TestScript::TestScript(TestScript&& other) + : UnityEngine::MonoBehaviour(std::forward(other)) + { + } + + TestScript::~TestScript() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + TestScript& TestScript::operator=(const TestScript& other) + { + SetHandle(other.Handle); + return *this; + } + + TestScript& TestScript::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + TestScript& TestScript::operator=(TestScript&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } } } /*END METHOD DEFINITIONS*/ @@ -442,26 +1463,36 @@ DLLEXPORT void Init( void (*releaseObject)(int32_t handle), int32_t (*stringNew)(const char* chars), /*BEGIN INIT PARAMS*/ - int32_t (*stopwatchConstructor)(), - int64_t (*stopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle), - void (*stopwatchMethodStart)(int32_t thisHandle), - void (*stopwatchMethodReset)(int32_t thisHandle), - int32_t (*objectPropertyGetName)(int32_t thisHandle), - void (*objectPropertySetName)(int32_t thisHandle, int32_t valueHandle), - int32_t (*gameObjectConstructor)(), - int32_t (*gameObjectConstructorSystemString)(int32_t nameHandle), - int32_t (*gameObjectPropertyGetTransform)(int32_t thisHandle), - int32_t (*gameObjectMethodFindSystemString)(int32_t nameHandle), - int32_t (*gameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle), - int32_t (*componentPropertyGetTransform)(int32_t thisHandle), - UnityEngine::Vector3 (*transformPropertyGetPosition)(int32_t thisHandle), - void (*transformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3 value), - void (*debugMethodLogSystemObject)(int32_t messageHandle), - System::Boolean (*assertFieldGetRaiseExceptions)(), - void (*assertFieldSetRaiseExceptions)(System::Boolean value), - void (*audioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)(int32_t* bufferLength, int32_t* numBuffers), - void (*networkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)(int32_t hostId, int32_t* addressHandle, int32_t* port, uint8_t* error), - void (*networkTransportMethodInit)() + int32_t (*systemDiagnosticsStopwatchConstructor)(), + int64_t (*systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle), + void (*systemDiagnosticsStopwatchMethodStart)(int32_t thisHandle), + void (*systemDiagnosticsStopwatchMethodReset)(int32_t thisHandle), + int32_t (*unityEngineObjectPropertyGetName)(int32_t thisHandle), + void (*unityEngineObjectPropertySetName)(int32_t thisHandle, int32_t valueHandle), + int32_t (*unityEngineGameObjectConstructor)(), + int32_t (*unityEngineGameObjectConstructorSystemString)(int32_t nameHandle), + int32_t (*unityEngineGameObjectPropertyGetTransform)(int32_t thisHandle), + int32_t (*unityEngineGameObjectMethodFindSystemString)(int32_t nameHandle), + int32_t (*unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle), + int32_t (*unityEngineComponentPropertyGetTransform)(int32_t thisHandle), + UnityEngine::Vector3 (*unityEngineTransformPropertyGetPosition)(int32_t thisHandle), + void (*unityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3 value), + void (*unityEngineDebugMethodLogSystemObject)(int32_t messageHandle), + System::Boolean (*unityEngineAssertionsAssertFieldGetRaiseExceptions)(), + void (*unityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value), + void (*unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString)(int32_t expectedHandle, int32_t actualHandle), + void (*unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject)(int32_t expectedHandle, int32_t actualHandle), + void (*unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)(int32_t* bufferLength, int32_t* numBuffers), + void (*unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)(int32_t hostId, int32_t* addressHandle, int32_t* port, uint8_t* error), + void (*unityEngineNetworkingNetworkTransportMethodInit)(), + int32_t (*systemCollectionsGenericListSystemStringConstructor)(), + void (*systemCollectionsGenericListSystemStringMethodAddSystemString)(int32_t thisHandle, int32_t itemHandle), + int32_t (*systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)(int32_t valueHandle), + int32_t (*systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue)(int32_t thisHandle), + void (*systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue)(int32_t thisHandle, int32_t valueHandle), + int32_t (*systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString)(int32_t valueHandle), + int32_t (*systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)(int32_t thisHandle), + void (*systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)(int32_t thisHandle, int32_t valueHandle) /*END INIT PARAMS*/) { using namespace Plugin; @@ -476,26 +1507,36 @@ DLLEXPORT void Init( StringNew = stringNew; ReleaseObject = releaseObject; /*BEGIN INIT BODY*/ - StopwatchConstructor = stopwatchConstructor; - StopwatchPropertyGetElapsedMilliseconds = stopwatchPropertyGetElapsedMilliseconds; - StopwatchMethodStart = stopwatchMethodStart; - StopwatchMethodReset = stopwatchMethodReset; - ObjectPropertyGetName = objectPropertyGetName; - ObjectPropertySetName = objectPropertySetName; - GameObjectConstructor = gameObjectConstructor; - GameObjectConstructorSystemString = gameObjectConstructorSystemString; - GameObjectPropertyGetTransform = gameObjectPropertyGetTransform; - GameObjectMethodFindSystemString = gameObjectMethodFindSystemString; - GameObjectMethodAddComponentMyGameMonoBehavioursTestScript = gameObjectMethodAddComponentMyGameMonoBehavioursTestScript; - ComponentPropertyGetTransform = componentPropertyGetTransform; - TransformPropertyGetPosition = transformPropertyGetPosition; - TransformPropertySetPosition = transformPropertySetPosition; - DebugMethodLogSystemObject = debugMethodLogSystemObject; - AssertFieldGetRaiseExceptions = assertFieldGetRaiseExceptions; - AssertFieldSetRaiseExceptions = assertFieldSetRaiseExceptions; - AudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32 = audioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32; - NetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte = networkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte; - NetworkTransportMethodInit = networkTransportMethodInit; + SystemDiagnosticsStopwatchConstructor = systemDiagnosticsStopwatchConstructor; + SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds = systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds; + SystemDiagnosticsStopwatchMethodStart = systemDiagnosticsStopwatchMethodStart; + SystemDiagnosticsStopwatchMethodReset = systemDiagnosticsStopwatchMethodReset; + UnityEngineObjectPropertyGetName = unityEngineObjectPropertyGetName; + UnityEngineObjectPropertySetName = unityEngineObjectPropertySetName; + UnityEngineGameObjectConstructor = unityEngineGameObjectConstructor; + UnityEngineGameObjectConstructorSystemString = unityEngineGameObjectConstructorSystemString; + UnityEngineGameObjectPropertyGetTransform = unityEngineGameObjectPropertyGetTransform; + UnityEngineGameObjectMethodFindSystemString = unityEngineGameObjectMethodFindSystemString; + UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript = unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript; + UnityEngineComponentPropertyGetTransform = unityEngineComponentPropertyGetTransform; + UnityEngineTransformPropertyGetPosition = unityEngineTransformPropertyGetPosition; + UnityEngineTransformPropertySetPosition = unityEngineTransformPropertySetPosition; + UnityEngineDebugMethodLogSystemObject = unityEngineDebugMethodLogSystemObject; + UnityEngineAssertionsAssertFieldGetRaiseExceptions = unityEngineAssertionsAssertFieldGetRaiseExceptions; + UnityEngineAssertionsAssertFieldSetRaiseExceptions = unityEngineAssertionsAssertFieldSetRaiseExceptions; + UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString = unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString; + UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject = unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject; + UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32 = unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32; + UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte = unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte; + UnityEngineNetworkingNetworkTransportMethodInit = unityEngineNetworkingNetworkTransportMethodInit; + SystemCollectionsGenericListSystemStringConstructor = systemCollectionsGenericListSystemStringConstructor; + SystemCollectionsGenericListSystemStringMethodAddSystemString = systemCollectionsGenericListSystemStringMethodAddSystemString; + SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString = systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString; + SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue = systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue; + SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue = systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue; + SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString = systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString; + SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue; + SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue; /*END INIT BODY*/ PluginMain(); diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 61f3afb..5d98c5a 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -23,7 +23,51 @@ namespace System { // .NET booleans are four bytes long - typedef int32_t Boolean; + // This struct makes them feel like C++'s bool type + struct Boolean + { + int32_t Value; + + Boolean() + : Value(0) + { + } + + Boolean(const Boolean& other) + : Value(other.Value) + { + } + + Boolean(bool value) + : Value((int32_t)value) + { + } + + operator bool() const + { + return (bool)Value; + } + + bool operator==(const Boolean other) const + { + return Value == other.Value; + } + + bool operator!=(const Boolean other) const + { + return Value != other.Value; + } + + bool operator==(const bool other) const + { + return Value == other; + } + + bool operator!=(const bool other) const + { + return Value != other; + } + }; } namespace UnityEngine @@ -97,19 +141,16 @@ namespace System bool operator!=(std::nullptr_t other) const; }; -#define SYSTEM_OBJECT_LIFECYCLE_DECLARATION(ClassName, BaseClassName) \ - ClassName(std::nullptr_t n); \ - ClassName(int32_t handle); \ - ClassName(const ClassName& other); \ - ClassName(ClassName&& other); \ - ~ClassName(); \ - ClassName& operator=(const ClassName& other); \ - ClassName& operator=(std::nullptr_t other); \ - ClassName& operator=(ClassName&& other); - struct String : Object { - SYSTEM_OBJECT_LIFECYCLE_DECLARATION(String, Object); + String(std::nullptr_t n); + String(int32_t handle); + String(const String& other); + String(String&& other); + ~String(); + String& operator=(const String& other); + String& operator=(std::nullptr_t other); + String& operator=(String&& other); String(const char* chars); }; } @@ -186,6 +227,116 @@ namespace UnityEngine } } +namespace System +{ + namespace Collections + { + namespace Generic + { + template struct List; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct List; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template struct LinkedListNode; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct LinkedListNode; + } + } +} + +namespace System +{ + namespace Runtime + { + namespace CompilerServices + { + template struct StrongBox; + } + } +} + +namespace System +{ + namespace Runtime + { + namespace CompilerServices + { + template<> struct StrongBox; + } + } +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + template struct Collection; + } + } +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + template<> struct Collection; + } + } +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + template struct KeyedCollection; + } + } +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + template<> struct KeyedCollection; + } + } +} + namespace MyGame { namespace MonoBehaviours @@ -202,7 +353,14 @@ namespace System { struct Stopwatch : System::Object { - SYSTEM_OBJECT_LIFECYCLE_DECLARATION(Stopwatch, System::Object) + Stopwatch(std::nullptr_t n); + Stopwatch(int32_t handle); + Stopwatch(const Stopwatch& other); + Stopwatch(Stopwatch&& other); + ~Stopwatch(); + Stopwatch& operator=(const Stopwatch& other); + Stopwatch& operator=(std::nullptr_t other); + Stopwatch& operator=(Stopwatch&& other); Stopwatch(); int64_t GetElapsedMilliseconds(); void Start(); @@ -215,7 +373,14 @@ namespace UnityEngine { struct Object : System::Object { - SYSTEM_OBJECT_LIFECYCLE_DECLARATION(Object, System::Object) + Object(std::nullptr_t n); + Object(int32_t handle); + Object(const Object& other); + Object(Object&& other); + ~Object(); + Object& operator=(const Object& other); + Object& operator=(std::nullptr_t other); + Object& operator=(Object&& other); System::String GetName(); void SetName(System::String value); }; @@ -225,12 +390,19 @@ namespace UnityEngine { struct GameObject : UnityEngine::Object { - SYSTEM_OBJECT_LIFECYCLE_DECLARATION(GameObject, UnityEngine::Object) + GameObject(std::nullptr_t n); + GameObject(int32_t handle); + GameObject(const GameObject& other); + GameObject(GameObject&& other); + ~GameObject(); + GameObject& operator=(const GameObject& other); + GameObject& operator=(std::nullptr_t other); + GameObject& operator=(GameObject&& other); GameObject(); GameObject(System::String name); UnityEngine::Transform GetTransform(); static UnityEngine::GameObject Find(System::String name); - template T0 AddComponent(); + template MyGame::MonoBehaviours::TestScript AddComponent(); }; } @@ -238,7 +410,14 @@ namespace UnityEngine { struct Component : UnityEngine::Object { - SYSTEM_OBJECT_LIFECYCLE_DECLARATION(Component, UnityEngine::Object) + Component(std::nullptr_t n); + Component(int32_t handle); + Component(const Component& other); + Component(Component&& other); + ~Component(); + Component& operator=(const Component& other); + Component& operator=(std::nullptr_t other); + Component& operator=(Component&& other); UnityEngine::Transform GetTransform(); }; } @@ -247,7 +426,14 @@ namespace UnityEngine { struct Transform : UnityEngine::Component { - SYSTEM_OBJECT_LIFECYCLE_DECLARATION(Transform, UnityEngine::Component) + Transform(std::nullptr_t n); + Transform(int32_t handle); + Transform(const Transform& other); + Transform(Transform&& other); + ~Transform(); + Transform& operator=(const Transform& other); + Transform& operator=(std::nullptr_t other); + Transform& operator=(Transform&& other); UnityEngine::Vector3 GetPosition(); void SetPosition(UnityEngine::Vector3 value); }; @@ -257,7 +443,14 @@ namespace UnityEngine { struct Debug : System::Object { - SYSTEM_OBJECT_LIFECYCLE_DECLARATION(Debug, System::Object) + Debug(std::nullptr_t n); + Debug(int32_t handle); + Debug(const Debug& other); + Debug(Debug&& other); + ~Debug(); + Debug& operator=(const Debug& other); + Debug& operator=(std::nullptr_t other); + Debug& operator=(Debug&& other); static void Log(System::Object message); }; } @@ -268,8 +461,10 @@ namespace UnityEngine { namespace Assert { - static System::Boolean GetRaiseExceptions(); - static void SetRaiseExceptions(System::Boolean value); + System::Boolean GetRaiseExceptions(); + void SetRaiseExceptions(System::Boolean value); + template void AreEqual(System::String expected, System::String actual); + template void AreEqual(UnityEngine::GameObject expected, UnityEngine::GameObject actual); } } } @@ -278,7 +473,14 @@ namespace UnityEngine { struct Collision : System::Object { - SYSTEM_OBJECT_LIFECYCLE_DECLARATION(Collision, System::Object) + Collision(std::nullptr_t n); + Collision(int32_t handle); + Collision(const Collision& other); + Collision(Collision&& other); + ~Collision(); + Collision& operator=(const Collision& other); + Collision& operator=(std::nullptr_t other); + Collision& operator=(Collision&& other); }; } @@ -286,7 +488,14 @@ namespace UnityEngine { struct Behaviour : UnityEngine::Component { - SYSTEM_OBJECT_LIFECYCLE_DECLARATION(Behaviour, UnityEngine::Component) + Behaviour(std::nullptr_t n); + Behaviour(int32_t handle); + Behaviour(const Behaviour& other); + Behaviour(Behaviour&& other); + ~Behaviour(); + Behaviour& operator=(const Behaviour& other); + Behaviour& operator=(std::nullptr_t other); + Behaviour& operator=(Behaviour&& other); }; } @@ -294,7 +503,14 @@ namespace UnityEngine { struct MonoBehaviour : UnityEngine::Behaviour { - SYSTEM_OBJECT_LIFECYCLE_DECLARATION(MonoBehaviour, UnityEngine::Behaviour) + MonoBehaviour(std::nullptr_t n); + MonoBehaviour(int32_t handle); + MonoBehaviour(const MonoBehaviour& other); + MonoBehaviour(MonoBehaviour&& other); + ~MonoBehaviour(); + MonoBehaviour& operator=(const MonoBehaviour& other); + MonoBehaviour& operator=(std::nullptr_t other); + MonoBehaviour& operator=(MonoBehaviour&& other); }; } @@ -302,7 +518,14 @@ namespace UnityEngine { struct AudioSettings : System::Object { - SYSTEM_OBJECT_LIFECYCLE_DECLARATION(AudioSettings, System::Object) + AudioSettings(std::nullptr_t n); + AudioSettings(int32_t handle); + AudioSettings(const AudioSettings& other); + AudioSettings(AudioSettings&& other); + ~AudioSettings(); + AudioSettings& operator=(const AudioSettings& other); + AudioSettings& operator=(std::nullptr_t other); + AudioSettings& operator=(AudioSettings&& other); static void GetDSPBufferSize(int32_t* bufferLength, int32_t* numBuffers); }; } @@ -313,20 +536,147 @@ namespace UnityEngine { struct NetworkTransport : System::Object { - SYSTEM_OBJECT_LIFECYCLE_DECLARATION(NetworkTransport, System::Object) + NetworkTransport(std::nullptr_t n); + NetworkTransport(int32_t handle); + NetworkTransport(const NetworkTransport& other); + NetworkTransport(NetworkTransport&& other); + ~NetworkTransport(); + NetworkTransport& operator=(const NetworkTransport& other); + NetworkTransport& operator=(std::nullptr_t other); + NetworkTransport& operator=(NetworkTransport&& other); static void GetBroadcastConnectionInfo(int32_t hostId, System::String* address, int32_t* port, uint8_t* error); static void Init(); }; } } +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct List : System::Object + { + List(std::nullptr_t n); + List(int32_t handle); + List(const List& other); + List(List&& other); + ~List(); + List& operator=(const List& other); + List& operator=(std::nullptr_t other); + List& operator=(List&& other); + List(); + void Add(System::String item); + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct LinkedListNode : System::Object + { + LinkedListNode(std::nullptr_t n); + LinkedListNode(int32_t handle); + LinkedListNode(const LinkedListNode& other); + LinkedListNode(LinkedListNode&& other); + ~LinkedListNode(); + LinkedListNode& operator=(const LinkedListNode& other); + LinkedListNode& operator=(std::nullptr_t other); + LinkedListNode& operator=(LinkedListNode&& other); + LinkedListNode(System::String value); + System::String GetValue(); + void SetValue(System::String value); + }; + } + } +} + +namespace System +{ + namespace Runtime + { + namespace CompilerServices + { + template<> struct StrongBox : System::Object + { + StrongBox(std::nullptr_t n); + StrongBox(int32_t handle); + StrongBox(const StrongBox& other); + StrongBox(StrongBox&& other); + ~StrongBox(); + StrongBox& operator=(const StrongBox& other); + StrongBox& operator=(std::nullptr_t other); + StrongBox& operator=(StrongBox&& other); + StrongBox(System::String value); + System::String GetValue(); + void SetValue(System::String value); + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + template<> struct Collection : System::Object + { + Collection(std::nullptr_t n); + Collection(int32_t handle); + Collection(const Collection& other); + Collection(Collection&& other); + ~Collection(); + Collection& operator=(const Collection& other); + Collection& operator=(std::nullptr_t other); + Collection& operator=(Collection&& other); + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + template<> struct KeyedCollection : System::Collections::ObjectModel::Collection + { + KeyedCollection(std::nullptr_t n); + KeyedCollection(int32_t handle); + KeyedCollection(const KeyedCollection& other); + KeyedCollection(KeyedCollection&& other); + ~KeyedCollection(); + KeyedCollection& operator=(const KeyedCollection& other); + KeyedCollection& operator=(std::nullptr_t other); + KeyedCollection& operator=(KeyedCollection&& other); + }; + } + } +} + namespace MyGame { namespace MonoBehaviours { struct TestScript : UnityEngine::MonoBehaviour { - SYSTEM_OBJECT_LIFECYCLE_DECLARATION(TestScript, UnityEngine::MonoBehaviour) + TestScript(std::nullptr_t n); + TestScript(int32_t handle); + TestScript(const TestScript& other); + TestScript(TestScript&& other); + ~TestScript(); + TestScript& operator=(const TestScript& other); + TestScript& operator=(std::nullptr_t other); + TestScript& operator=(TestScript&& other); void Awake(); void OnAnimatorIK(int32_t param0); void OnCollisionEnter(UnityEngine::Collision param0); From 81d0f976c012be4108d116bd83055b2725fc2986 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 17 Sep 2017 23:16:16 -0700 Subject: [PATCH 03/95] Support struct types Support enum types Remove hard-coded C++ Vector3 Add C++ System::Char --- README.md | 5 +- Unity/Assets/NativeScript/Bindings.cs | 673 +++++--- Unity/Assets/NativeScript/BootScene.unity | Bin 9312 -> 12816 bytes .../NativeScript/Editor/GenerateBindings.cs | 1455 +++++++++++++---- Unity/Assets/NativeScriptTypes.json | 191 ++- Unity/CppSource/Game/Game.cpp | 5 +- Unity/CppSource/NativeScript/Bindings.cpp | 269 ++- Unity/CppSource/NativeScript/Bindings.h | 194 ++- 8 files changed, 2112 insertions(+), 680 deletions(-) diff --git a/README.md b/README.md index 518859b..80cca56 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,7 @@ To configure the code generator, open `NativeScriptTypes.json` and notice the ex The code generator supports: * Class types (including generics) +* Struct types (including generics) * Base classes (including generics) * Constructors (including generic parameters) * Methods (including generic parameters and return types) @@ -155,10 +156,10 @@ The code generator supports: * Properties (getters and setters) (including generic types) * `MonoBehaviour` classes with "message" functions like `Update` (except `OnAudioFilterRead`) * `out` and `ref` parameters +* Enumerations The code generator does not support (yet): -* Struct types * Arrays (single- or multi-dimensional) * Delegates * `MonoBehaviour` contents (e.g. fields) except for "message" functions @@ -166,6 +167,8 @@ The code generator does not support (yet): * Exceptions * Default parameters * Interfaces +* `decimal` +* Pointers The JSON file is laid out as follows: diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index a53cfaf..0f65685 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -21,6 +21,231 @@ namespace NativeScript /// 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 void Remove(int handle) + { + if (handle != 0) + { + 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); + } + } + } + } + + // Holds structs and provides handles to them in the form of ints + public static class StructStore + 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"; @@ -64,6 +289,15 @@ delegate void InitDelegate( IntPtr unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32, IntPtr unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte, IntPtr unityEngineNetworkingNetworkTransportMethodInit, + IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, + IntPtr unityEngineVector3PropertyGetMagnitude, + IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, + IntPtr unityEngineRaycastHitPropertyGetPoint, + IntPtr unityEngineRaycastHitPropertySetPoint, + IntPtr unityEngineRaycastHitPropertyGetTransform, + IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble, + IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey, + IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue, IntPtr systemCollectionsGenericListSystemStringConstructor, IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString, IntPtr systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString, @@ -205,6 +439,15 @@ static extern void Init( IntPtr unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32, IntPtr unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte, IntPtr unityEngineNetworkingNetworkTransportMethodInit, + IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, + IntPtr unityEngineVector3PropertyGetMagnitude, + IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, + IntPtr unityEngineRaycastHitPropertyGetPoint, + IntPtr unityEngineRaycastHitPropertySetPoint, + IntPtr unityEngineRaycastHitPropertyGetTransform, + IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble, + IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey, + IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue, IntPtr systemCollectionsGenericListSystemStringConstructor, IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString, IntPtr systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString, @@ -247,15 +490,26 @@ IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue delegate int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate(int thisHandle); delegate int UnityEngineComponentPropertyGetTransformDelegate(int thisHandle); delegate UnityEngine.Vector3 UnityEngineTransformPropertyGetPositionDelegate(int thisHandle); - delegate void UnityEngineTransformPropertySetPositionDelegate(int thisHandle, UnityEngine.Vector3 value); + 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(out int bufferLength, out int numBuffers); - delegate void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate(int hostId, ref int addressHandle, out int port, out byte error); + 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 int ReleaseObjectUnityEngineRaycastHitDelegate(int handle); + delegate UnityEngine.Vector3 UnityEngineRaycastHitPropertyGetPointDelegate(int thisHandle); + delegate void UnityEngineRaycastHitPropertySetPointDelegate(int thisHandle, ref UnityEngine.Vector3 value); + delegate int UnityEngineRaycastHitPropertyGetTransformDelegate(int thisHandle); + delegate int ReleaseObjectSystemCollectionsGenericKeyValuePairSystemString_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 void SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate(int thisHandle, int itemHandle); delegate int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate(int valueHandle); @@ -266,130 +520,6 @@ IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue delegate void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate(int thisHandle, int valueHandle); /*END DELEGATE TYPES*/ - // Stored objects. The first is always 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 int StoreObject(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 GetObject(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 -1; - } - - public static void RemoveObject(int handle) - { - if (handle != 0) - { - 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); - } - } - } - /// /// Open the C++ plugin and call its PluginMain() /// @@ -401,26 +531,11 @@ public static void RemoveObject(int handle) public static void Open( int maxManagedObjects) { - Bindings.maxObjects = maxManagedObjects; - - // Initialize the objects as all null plus room for the - // first to always be null. - objects = new object[maxManagedObjects + 1]; - - // Initialize the handles stack as 1, 2, 3, ... - handles = new int[maxManagedObjects]; - for ( - int i = 0, handle = maxManagedObjects; - i < maxManagedObjects; - ++i, --handle) - { - handles[i] = handle; - } - nextHandleIndex = maxManagedObjects - 1; - - // Initialize the hash table - keys = new object[maxManagedObjects]; - values = new int[maxManagedObjects]; + ObjectStore.Init(maxManagedObjects); + /*BEGIN STRUCTSTORE INIT CALLS*/ + NativeScript.Bindings.StructStore.Init(1000); + NativeScript.Bindings.StructStore>.Init(maxManagedObjects); + /*END STRUCTSTORE INIT CALLS*/ #if UNITY_EDITOR @@ -467,6 +582,15 @@ public static void Open( 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 UnityEngineRaycastHitPropertyGetPointDelegate(UnityEngineRaycastHitPropertyGetPoint)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertySetPointDelegate(UnityEngineRaycastHitPropertySetPoint)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetTransformDelegate(UnityEngineRaycastHitPropertyGetTransform)), + 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 SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate(SystemCollectionsGenericListSystemStringMethodAddSystemString)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)), @@ -489,7 +613,7 @@ public static void Close() libraryHandle = IntPtr.Zero; #endif } - + //////////////////////////////////////////////////////////////// // C# functions for C++ to call //////////////////////////////////////////////////////////////// @@ -500,7 +624,7 @@ static void ReleaseObject( { if (handle != 0) { - NativeScript.Bindings.RemoveObject(handle); + NativeScript.Bindings.ObjectStore.Remove(handle); } } @@ -508,7 +632,7 @@ static void ReleaseObject( static int StringNew( string chars) { - int handle = NativeScript.Bindings.StoreObject(chars); + int handle = NativeScript.Bindings.ObjectStore.Store(chars); return handle; } @@ -516,14 +640,14 @@ static int StringNew( [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchConstructorDelegate))] static int SystemDiagnosticsStopwatchConstructor() { - var returnValue = NativeScript.Bindings.StoreObject(new System.Diagnostics.Stopwatch()); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Diagnostics.Stopwatch()); return returnValue; } [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate))] static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHandle) { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.GetObject(thisHandle); + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz.ElapsedMilliseconds; return returnValue; } @@ -531,139 +655,99 @@ static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHan [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodStartDelegate))] static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.GetObject(thisHandle); + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz.Start(); } [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodResetDelegate))] static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.GetObject(thisHandle); + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz.Reset(); } [MonoPInvokeCallback(typeof(UnityEngineObjectPropertyGetNameDelegate))] static int UnityEngineObjectPropertyGetName(int thisHandle) { - var thiz = (UnityEngine.Object)NativeScript.Bindings.GetObject(thisHandle); + var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz.name; - int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); - if (returnValueHandle < 0) - { - return NativeScript.Bindings.StoreObject(returnValue); - } - else - { - return returnValueHandle; - } + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } [MonoPInvokeCallback(typeof(UnityEngineObjectPropertySetNameDelegate))] static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) { - var thiz = (UnityEngine.Object)NativeScript.Bindings.GetObject(thisHandle); - var value = (string)NativeScript.Bindings.GetObject(valueHandle); + var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); thiz.name = value; } [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorDelegate))] static int UnityEngineGameObjectConstructor() { - var returnValue = NativeScript.Bindings.StoreObject(new UnityEngine.GameObject()); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject()); return returnValue; } [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorSystemStringDelegate))] static int UnityEngineGameObjectConstructorSystemString(int nameHandle) { - var name = (string)NativeScript.Bindings.GetObject(nameHandle); - var returnValue = NativeScript.Bindings.StoreObject(new UnityEngine.GameObject(name)); + var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject(name)); return returnValue; } [MonoPInvokeCallback(typeof(UnityEngineGameObjectPropertyGetTransformDelegate))] static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.GetObject(thisHandle); + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz.transform; - int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); - if (returnValueHandle < 0) - { - return NativeScript.Bindings.StoreObject(returnValue); - } - else - { - return returnValueHandle; - } + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodFindSystemStringDelegate))] static int UnityEngineGameObjectMethodFindSystemString(int nameHandle) { - var name = (string)NativeScript.Bindings.GetObject(nameHandle); + var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); var returnValue = UnityEngine.GameObject.Find(name); - int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); - if (returnValueHandle < 0) - { - return NativeScript.Bindings.StoreObject(returnValue); - } - else - { - return returnValueHandle; - } + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate))] static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(int thisHandle) { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.GetObject(thisHandle); + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz.AddComponent(); - int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); - if (returnValueHandle < 0) - { - return NativeScript.Bindings.StoreObject(returnValue); - } - else - { - return returnValueHandle; - } + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } [MonoPInvokeCallback(typeof(UnityEngineComponentPropertyGetTransformDelegate))] static int UnityEngineComponentPropertyGetTransform(int thisHandle) { - var thiz = (UnityEngine.Component)NativeScript.Bindings.GetObject(thisHandle); + var thiz = (UnityEngine.Component)NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz.transform; - int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); - if (returnValueHandle < 0) - { - return NativeScript.Bindings.StoreObject(returnValue); - } - else - { - return returnValueHandle; - } + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } [MonoPInvokeCallback(typeof(UnityEngineTransformPropertyGetPositionDelegate))] static UnityEngine.Vector3 UnityEngineTransformPropertyGetPosition(int thisHandle) { - var thiz = (UnityEngine.Transform)NativeScript.Bindings.GetObject(thisHandle); + var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz.position; return returnValue; } [MonoPInvokeCallback(typeof(UnityEngineTransformPropertySetPositionDelegate))] - static void UnityEngineTransformPropertySetPosition(int thisHandle, UnityEngine.Vector3 value) + static void UnityEngineTransformPropertySetPosition(int thisHandle, ref UnityEngine.Vector3 value) { - var thiz = (UnityEngine.Transform)NativeScript.Bindings.GetObject(thisHandle); + var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz.position = value; } [MonoPInvokeCallback(typeof(UnityEngineDebugMethodLogSystemObjectDelegate))] static void UnityEngineDebugMethodLogSystemObject(int messageHandle) { - var message = NativeScript.Bindings.GetObject(messageHandle); + var message = NativeScript.Bindings.ObjectStore.Get(messageHandle); UnityEngine.Debug.Log(message); } @@ -683,123 +767,186 @@ static void UnityEngineAssertionsAssertFieldSetRaiseExceptions(bool value) [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemStringDelegate))] static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(int expectedHandle, int actualHandle) { - var expected = (string)NativeScript.Bindings.GetObject(expectedHandle); - var actual = (string)NativeScript.Bindings.GetObject(actualHandle); + var expected = (string)NativeScript.Bindings.ObjectStore.Get(expectedHandle); + var actual = (string)NativeScript.Bindings.ObjectStore.Get(actualHandle); UnityEngine.Assertions.Assert.AreEqual(expected, actual); } [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObjectDelegate))] static void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(int expectedHandle, int actualHandle) { - var expected = (UnityEngine.GameObject)NativeScript.Bindings.GetObject(expectedHandle); - var actual = (UnityEngine.GameObject)NativeScript.Bindings.GetObject(actualHandle); + var expected = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(expectedHandle); + var actual = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(actualHandle); UnityEngine.Assertions.Assert.AreEqual(expected, actual); } [MonoPInvokeCallback(typeof(UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate))] - static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(out int bufferLength, out int numBuffers) + static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(ref int bufferLength, ref int numBuffers) { UnityEngine.AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers); } [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate))] - static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(int hostId, ref int addressHandle, out int port, out byte error) + static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(int hostId, ref int addressHandle, ref int port, ref byte error) { - var address = (string)NativeScript.Bindings.GetObject(addressHandle); + var address = (string)NativeScript.Bindings.ObjectStore.Get(addressHandle); UnityEngine.Networking.NetworkTransport.GetBroadcastConnectionInfo(hostId, out address, out port, out error); - int addressHandleNew = NativeScript.Bindings.GetHandle(address); - if (addressHandleNew < 0) + int addressHandleNew = NativeScript.Bindings.ObjectStore.GetHandle(address); + addressHandle = addressHandleNew; + } + + [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodInitDelegate))] + static void UnityEngineNetworkingNetworkTransportMethodInit() + { + UnityEngine.Networking.NetworkTransport.Init(); + } + + [MonoPInvokeCallback(typeof(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate))] + static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(float x, float y, float z) + { + var returnValue = new UnityEngine.Vector3(x, y, z); + return returnValue; + } + + [MonoPInvokeCallback(typeof(UnityEngineVector3PropertyGetMagnitudeDelegate))] + static float UnityEngineVector3PropertyGetMagnitude(ref UnityEngine.Vector3 thiz) + { + var returnValue = thiz.magnitude; + return returnValue; + } + + [MonoPInvokeCallback(typeof(UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingleDelegate))] + static void UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(ref UnityEngine.Vector3 thiz, float newX, float newY, float newZ) + { + thiz.Set(newX, newY, newZ); + } + + [MonoPInvokeCallback(typeof(ReleaseObjectUnityEngineRaycastHitDelegate))] + static void ReleaseObjectUnityEngineRaycastHit(int handle) + { + if (handle != 0) { - addressHandle = NativeScript.Bindings.StoreObject(address); + NativeScript.Bindings.StructStore.Remove(handle); } - else + } + + [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertyGetPointDelegate))] + static UnityEngine.Vector3 UnityEngineRaycastHitPropertyGetPoint(int thisHandle) + { + var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); + var returnValue = thiz.point; + return returnValue; + } + + [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertySetPointDelegate))] + static void UnityEngineRaycastHitPropertySetPoint(int thisHandle, ref UnityEngine.Vector3 value) + { + var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); + thiz.point = value; + NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); + } + + [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertyGetTransformDelegate))] + static int UnityEngineRaycastHitPropertyGetTransform(int thisHandle) + { + var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + + [MonoPInvokeCallback(typeof(ReleaseObjectSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate))] + static void ReleaseObjectSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int handle) + { + if (handle != 0) { - addressHandle = addressHandleNew; + NativeScript.Bindings.StructStore>.Remove(handle); } } - [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodInitDelegate))] - static void UnityEngineNetworkingNetworkTransportMethodInit() + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate))] + static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(int keyHandle, double value) { - UnityEngine.Networking.NetworkTransport.Init(); + var key = (string)NativeScript.Bindings.ObjectStore.Get(keyHandle); + var returnValue = NativeScript.Bindings.StructStore>.Store(new System.Collections.Generic.KeyValuePair(key, value)); + return returnValue; + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate))] + static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(int thisHandle) + { + var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); + var returnValue = thiz.Key; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate))] + static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(int thisHandle) + { + var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); + var returnValue = thiz.Value; + return returnValue; } [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringConstructorDelegate))] static int SystemCollectionsGenericListSystemStringConstructor() { - var returnValue = NativeScript.Bindings.StoreObject(new System.Collections.Generic.List()); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); return returnValue; } [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate))] static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int thisHandle, int itemHandle) { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.GetObject(thisHandle); - var item = (string)NativeScript.Bindings.GetObject(itemHandle); + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); thiz.Add(item); } [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate))] static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(int valueHandle) { - var value = (string)NativeScript.Bindings.GetObject(valueHandle); - var returnValue = NativeScript.Bindings.StoreObject(new System.Collections.Generic.LinkedListNode(value)); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.LinkedListNode(value)); return returnValue; } [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate))] static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(int thisHandle) { - var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.GetObject(thisHandle); + var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz.Value; - int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); - if (returnValueHandle < 0) - { - return NativeScript.Bindings.StoreObject(returnValue); - } - else - { - return returnValueHandle; - } + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate))] static void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(int thisHandle, int valueHandle) { - var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.GetObject(thisHandle); - var value = (string)NativeScript.Bindings.GetObject(valueHandle); + var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); thiz.Value = value; } [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate))] static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(int valueHandle) { - var value = (string)NativeScript.Bindings.GetObject(valueHandle); - var returnValue = NativeScript.Bindings.StoreObject(new System.Runtime.CompilerServices.StrongBox(value)); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Runtime.CompilerServices.StrongBox(value)); return returnValue; } [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate))] static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int thisHandle) { - var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.GetObject(thisHandle); + var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz.Value; - int returnValueHandle = NativeScript.Bindings.GetHandle(returnValue); - if (returnValueHandle < 0) - { - return NativeScript.Bindings.StoreObject(returnValue); - } - else - { - return returnValueHandle; - } + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate))] static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int thisHandle, int valueHandle) { - var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.GetObject(thisHandle); - var value = (string)NativeScript.Bindings.GetObject(valueHandle); + var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); thiz.Value = value; } /*END FUNCTIONS*/ @@ -817,7 +964,7 @@ public class TestScript : UnityEngine.MonoBehaviour public TestScript() { - thisHandle = NativeScript.Bindings.StoreObject(this); + thisHandle = NativeScript.Bindings.ObjectStore.Store(this); } public void Awake() @@ -832,11 +979,7 @@ public void OnAnimatorIK(int param0) public void OnCollisionEnter(UnityEngine.Collision param0) { - int param0Handle = NativeScript.Bindings.GetHandle(param0); - if (param0Handle < 0) - { - param0Handle = NativeScript.Bindings.StoreObject(param0); - } + int param0Handle = NativeScript.Bindings.ObjectStore.Store(param0); NativeScript.Bindings.TestScriptOnCollisionEnter(thisHandle, param0Handle); } diff --git a/Unity/Assets/NativeScript/BootScene.unity b/Unity/Assets/NativeScript/BootScene.unity index 5491c696086a7f56d5a96e7c7a6407959dbfaf39..3f7e5df7b6dbb4c552975aef829dbee6cc2a46cc 100644 GIT binary patch delta 2559 zcmZ9NYitx%6vyu@i%NMdwzRfgVYlsCD7EDo2_dv)OQ8vch0+>K3=X@~-66X(b#}H; zh}k6}K{UQHMulj!#zam0g8gKOK|X21D=`xJB;b>nCPsqsld1pzotf=!Z+dp_{hf2q zJ@=k_Pw(z|GZhk|^Rf^d@f9o3zx!6GPN}&VYif-BI{WUaP|NizTTlPeTr>K6W+eFS zzuW%YcWv|R*ITCkUe(@+Dchz~jqyN(A{6nH5T!LhLC6yjH0Pz&YgY`ZCx%o*O>3$B zM~`VqJ3oD+xj)$6K!e%Yi;4Ra>&_mYdFTGBjx%puy0QT@6cF&|Hs`OEoyt-tT;Hs; zIz8bArPE2&ccWjbXaB=6`!~Z4#ZK5i2C0GcK^W3rg!H^3N_4hZGM9g}K$Nz4<0bgA z(Vjdm`$8;rVVNKD_%d=d-##V#q9~S2Jg1m&6@n)#dR=}C3%rKmEE-N5;gJUv?7BoD zf1JFRe1SaEX3XK4){>)vpz9FE}U4~*&O zNeCNGsLIbO$z1OHDKht~%L+wohNFKlrlSaiZN8(ZWYv!7r=`plF(pJPgl+PKc(S-o z5ch7ifa6cJ3FN<0vEEa}=1n-@@u$dpT}OO3N5Hv2dxbsuDUYwI;8WnQdwgw~7u`rd z_7ojug(9ZGu0ePb>mWidTz#aSW&1$YU3t39-3NZp^WRm$Be*LMHbKG5(k&G{7DZ5@ z0FtjK?-gQ5%V!R1MoP0Z3*}*5F|OwA;f$IxkLN}1$U!Zs=@Z%<7&2|$G)7T3Op6A4 z^>oHgSmse}B#)XRr;KHxhE)|FQfB=q9`0? zbRzG5<7UCItBntuCW&09&q!uW3!}M+M$K#?r|qB6EK5%@wBe+h)dme|kyFRzR4uPr z6WYiqH#3+vil(LQGp!r~9WbqUMz!pI&35-gi`=+r*{Wgh9;82wJJnLVQaX;qJx1<@ zYYpj!o-5>}hhhCBQD4C}M@CV9`}I70B&%4Tk(k9L#lPF-fe|)ghxtn>YzjAoy!o#gEvf7-2FxhO+;F=CN<2CKda#_7&vU+#P z>K&8SyGvH@7_0XN-Y34i%IXadtl;wAvU;=mFF59mD-A_|7Hc)`pS*OKQF_)JSJrBB z|9=5XwbJL>Pk|>f=JS)KTFzC(Z@9c!^p`+nsTL8rI_(Q!u-`3Yt*%fUcNJc(o|`b~ zako}S#PE0q4vS z0GZr2AL0_>)J6)*9_L)7`MIk@%>pF@6+s-DABl*n=_Syy3Bz z!MO27keeR+Cg@y_g7=zkB0q6 zAa0V~2u2KBMe0&;Ugvz$+Q#*o{4FW6x%uJq=~?64Ywd0jr5WlyY delta 124 zcmbP`^1wrYfk9E3fk7pKfq_8~$aa`0Ai~JLQB_J(kK@LJSShuVsVAyWt37)Y(a9R* z-Jd$I`d@h1MdSE4D!U|rS~P%|5s29tH_OSeF>WrFGGUygs yField.MetadataToken + ? 1 + : 0; + } } class MessageInfo @@ -233,6 +291,9 @@ public MessageInfo( CppDirPath, "Bindings.cpp"); + static readonly FieldOrderComparer DefaultFieldOrderComparer + = new FieldOrderComparer(); + // Restore unused field types #pragma warning restore CS0649 @@ -254,35 +315,71 @@ static void Generate(bool dryRun) EditorPrefs.SetBool(DryRunPref, dryRun); if (dryRun) { - DoPostCompileWork(); + DoPostCompileWork(true); } else { JsonDocument doc = LoadJson(); + Assembly[] assemblies = GetAssemblies(doc.Assemblies); - // Generate stub types - // We'll need to be able to get these via reflection later - StringBuilder csharpMonoBehaviours = new StringBuilder( - InitialStringBuilderCapacity); - string timestamp = DateTime.Now.ToLongTimeString(); - AppendStubMonoBehaviours( - doc.MonoBehaviours, - timestamp, - csharpMonoBehaviours); - - // Inject - string csharpContents = File.ReadAllText(CsharpPath); - csharpContents = InjectIntoString( - csharpContents, - "/*BEGIN MONOBEHAVIOURS*/\n", - "\n/*END MONOBEHAVIOURS*/", - csharpMonoBehaviours.ToString()); - File.WriteAllText(CsharpPath, csharpContents); + // Determine whether we need to generate stubs + // We can skip this step if we've already generated all the + // required MonoBehaviour classes and their messages + bool needStubs = false; + foreach (JsonMonoBehaviour monoBehaviour in doc.MonoBehaviours) + { + // Check if the MonoBehaviour type is already generated + Type type = TryGetType( + monoBehaviour.Name, + assemblies); + if (type == null) + { + needStubs = true; + break; + } + + // Check if all the messages are already generated + foreach (string message in monoBehaviour.Messages) + { + MethodInfo methodInfo = type.GetMethod(message); + if (methodInfo == null) + { + needStubs = true; + goto determinedNeedStubs; + } + } + } + determinedNeedStubs:; - // Compile and continue after scripts are refreshed - Debug.Log("Waiting for compile..."); - AssetDatabase.Refresh(); - EditorPrefs.SetBool(PostCompileWorkPref, true); + if (needStubs) + { + // We'll need to be able to get these via reflection later + StringBuilder csharpMonoBehaviours = new StringBuilder( + InitialStringBuilderCapacity); + string timestamp = DateTime.Now.ToLongTimeString(); + AppendStubMonoBehaviours( + doc.MonoBehaviours, + timestamp, + csharpMonoBehaviours); + + // Inject + string csharpContents = File.ReadAllText(CsharpPath); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN MONOBEHAVIOURS*/\n", + "\n/*END MONOBEHAVIOURS*/", + csharpMonoBehaviours.ToString()); + File.WriteAllText(CsharpPath, csharpContents); + + // Compile and continue after scripts are refreshed + Debug.Log("Waiting for compile..."); + AssetDatabase.Refresh(); + EditorPrefs.SetBool(PostCompileWorkPref, true); + } + else + { + DoPostCompileWork(true); + } } } @@ -343,50 +440,17 @@ static void OnScriptsReloaded() EditorPrefs.DeleteKey(PostCompileWorkPref); if (doWork) { - DoPostCompileWork(); + DoPostCompileWork(false); } } - static void DoPostCompileWork() + static void DoPostCompileWork(bool canRefreshAssetDb) { bool dryRun = EditorPrefs.GetBool(DryRunPref); EditorPrefs.DeleteKey(DryRunPref); JsonDocument doc = LoadJson(); - - // Gather assemblies - const int numDefaultAssemblies = 7; - int numAssemblies; - Assembly[] assemblies; - if (doc.Assemblies == null) - { - numAssemblies = numDefaultAssemblies; - assemblies = new Assembly[numAssemblies]; - } - else - { - numAssemblies = numDefaultAssemblies + doc.Assemblies.Length; - assemblies = new Assembly[numAssemblies]; - - for (int i = 0; i < doc.Assemblies.Length; ++i) - { - string path = doc.Assemblies[i] - .Replace("UNITY_PROJECT", ProjectDirPath) - .Replace("UNITY_ASSETS", AssetsDirPath) - .Replace("DOTNET_DLLS", DotNetDllsDirPath) - .Replace("UNITY_DLLS", UnityDllsDirPath); - Assembly assembly = Assembly.LoadFrom(path); - assemblies[numDefaultAssemblies + i] = assembly; - } - } - assemblies[0] = typeof(string).Assembly; // .NET: mscorlib - assemblies[1] = typeof(Uri).Assembly; // .NET: System - assemblies[2] = typeof(Action).Assembly; // .NET: System.Core - assemblies[3] = typeof(Vector3).Assembly; // UnityEngine - assemblies[4] = typeof(Bindings).Assembly; // Runtime scripts - assemblies[5] = typeof(GenerateBindings).Assembly; // Editor scripts - assemblies[6] = typeof(EditorPrefs).Assembly; // UnityEditor - + Assembly[] assemblies = GetAssemblies(doc.Assemblies); StringBuilders builders = new StringBuilders(); // Generate types @@ -419,9 +483,18 @@ static void DoPostCompileWork() else { InjectBuilders(builders); - Debug.Log( - "Can't auto-refresh due to a bug in Unity. " + - "Please manually refresh assets with Assets -> Refresh."); + if (canRefreshAssetDb) + { + AssetDatabase.Refresh(); + Debug.Log("Done generating bindings."); + } + else + { + Debug.LogWarning( + "Can't auto-refresh due to a bug in Unity. " + + "Please manually refresh assets with " + + "Assets -> Refresh to finish generating bindings"); + } } } @@ -434,6 +507,42 @@ static JsonDocument LoadJson() return JsonUtility.FromJson(json); } + static Assembly[] GetAssemblies(string[] assemblyNames) + { + const int numDefaultAssemblies = 7; + int numAssemblies; + Assembly[] assemblies; + if (assemblyNames == null) + { + numAssemblies = numDefaultAssemblies; + assemblies = new Assembly[numAssemblies]; + } + else + { + numAssemblies = numDefaultAssemblies + assemblyNames.Length; + assemblies = new Assembly[numAssemblies]; + + for (int i = 0; i < assemblyNames.Length; ++i) + { + string path = assemblyNames[i] + .Replace("UNITY_PROJECT", ProjectDirPath) + .Replace("UNITY_ASSETS", AssetsDirPath) + .Replace("DOTNET_DLLS", DotNetDllsDirPath) + .Replace("UNITY_DLLS", UnityDllsDirPath); + Assembly assembly = Assembly.LoadFrom(path); + assemblies[numDefaultAssemblies + i] = assembly; + } + } + assemblies[0] = typeof(string).Assembly; // .NET: mscorlib + assemblies[1] = typeof(Uri).Assembly; // .NET: System + assemblies[2] = typeof(Action).Assembly; // .NET: System.Core + assemblies[3] = typeof(Vector3).Assembly; // UnityEngine + assemblies[4] = typeof(Bindings).Assembly; // Runtime scripts + assemblies[5] = typeof(GenerateBindings).Assembly; // Editor scripts + assemblies[6] = typeof(EditorPrefs).Assembly; // UnityEditor + return assemblies; + } + static Type[] GetTypes( string[] typeNames, Assembly[] assemblies) @@ -449,6 +558,26 @@ static Type[] GetTypes( static Type GetType( string typeName, Assembly[] assemblies) + { + Type type = TryGetType( + typeName, + assemblies); + if (type != null) + { + return type; + } + + // Not finding a type is a fatal error + StringBuilder errorBuilder = new StringBuilder(1024); + errorBuilder.Append("Couldn't find type \""); + errorBuilder.Append(typeName); + errorBuilder.Append('"'); + throw new Exception(errorBuilder.ToString()); + } + + static Type TryGetType( + string typeName, + Assembly[] assemblies) { // Search all assemblies for the type foreach (Assembly assembly in assemblies) @@ -459,26 +588,54 @@ static Type GetType( return type; } } + return null; + } + + static TypeKind GetTypeKind(Type type) + { + if (type.IsPointer) + { + return TypeKind.Pointer; + } - // Not finding a type is a fatal error - StringBuilder errorBuilder = new StringBuilder(1024); - errorBuilder.Append("Couldn't find type \""); - errorBuilder.Append(typeName); - errorBuilder.Append('"'); - throw new Exception(errorBuilder.ToString()); + if (type.IsEnum) + { + return TypeKind.Enum; + } + + if (type.IsPrimitive) + { + return TypeKind.Primitive; + } + + if (!type.IsValueType) + { + return TypeKind.Class; + } + + // Decimal (currently) can't be represented on the C++ side, so + // don't count it as a full struct + if (type != typeof(decimal) && IsFullValueType(type)) + { + return TypeKind.FullStruct; + } + + return TypeKind.ManagedStruct; } - static ConstructorInfo GetConstructor( + static ParameterInfo[] GetConstructorParameters( Type type, string[] paramTypeNames) { foreach (ConstructorInfo ctor in type.GetConstructors()) { + System.Reflection.ParameterInfo[] reflectionParams + = ctor.GetParameters(); if (CheckParametersMatch( paramTypeNames, - ctor.GetParameters())) + reflectionParams)) { - return ctor; + return ConvertParameters(reflectionParams); } } @@ -705,7 +862,8 @@ static ParameterInfo[] ConvertParameters( info.IsRef = !info.IsOut && info.ParameterType.IsByRef; info.DereferencedParameterType = DereferenceParameterType( reflectionInfo); - info.IsStruct = info.DereferencedParameterType.IsValueType; + info.Kind = GetTypeKind( + info.DereferencedParameterType); parameters[i] = info; } return parameters; @@ -736,7 +894,8 @@ static ParameterInfo[] ConvertParameters( info.IsOut = false; info.IsRef = false; info.DereferencedParameterType = paramType; - info.IsStruct = info.DereferencedParameterType.IsValueType; + info.Kind = GetTypeKind( + info.DereferencedParameterType); parameters[i] = info; } return parameters; @@ -747,6 +906,36 @@ static bool IsStatic(Type type) return type.IsAbstract && type.IsSealed; } + static bool IsManagedValueType(Type type) + { + return type.IsValueType && !IsFullValueType(type); + } + + static bool IsFullValueType(Type type) + { + if (!type.IsValueType) + { + return false; + } + if (type.IsPrimitive || type.IsEnum) + { + return true; + } + const BindingFlags bindingFlags = + BindingFlags.Instance + | BindingFlags.NonPublic + | BindingFlags.Public; + foreach (FieldInfo field in type.GetFields(bindingFlags)) + { + if (!field.IsStatic + && !IsFullValueType(field.FieldType)) + { + return false; + } + } + return true; + } + static void AppendWithoutGenericTypeCountSuffix( string typeName, StringBuilder output) @@ -770,59 +959,69 @@ static void AppendType( StringBuilders builders) { Type type = GetType(jsonType.Name, assemblies); - Type[] genericArgTypes = type.GetGenericArguments(); - if (jsonType.GenericParams != null) + if (type.IsEnum) { - // Template declaration for the type - if (!IsStatic(type)) + AppendEnum( + type, + assemblies, + builders); + } + else + { + Type[] genericArgTypes = type.GetGenericArguments(); + if (jsonType.GenericParams != null) { - int indent = AppendNamespaceBeginning( - type.Namespace, - builders.CppTypeDeclarations); - AppendIndent( - indent, - builders.CppTypeDeclarations); - AppendCppTemplateTypenames( - genericArgTypes.Length, - builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append("struct "); - AppendWithoutGenericTypeCountSuffix( - type.Name, - builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append(";"); - builders.CppTypeDeclarations.Append('\n'); - AppendNamespaceEnding( - indent, - builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append('\n'); + // Template declaration for the type + if (!IsStatic(type)) + { + int indent = AppendNamespaceBeginning( + type.Namespace, + builders.CppTypeDeclarations); + AppendIndent( + indent, + builders.CppTypeDeclarations); + AppendCppTemplateTypenames( + genericArgTypes.Length, + builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append("struct "); + AppendWithoutGenericTypeCountSuffix( + type.Name, + builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append(";"); + builders.CppTypeDeclarations.Append('\n'); + AppendNamespaceEnding( + indent, + builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append('\n'); + } + + foreach (JsonGenericParams jsonGenericParams + in jsonType.GenericParams) + { + Type[] typeParams = GetTypes( + jsonGenericParams.Types, + assemblies); + type = type.MakeGenericType(typeParams); + AppendType( + jsonType, + genericArgTypes, + type, + typeParams, + assemblies, + builders); + } } - - foreach (JsonGenericParams jsonGenericParams - in jsonType.GenericParams) + else { - Type[] typeParams = GetTypes( - jsonGenericParams.Types, - assemblies); - type = type.MakeGenericType(typeParams); AppendType( jsonType, genericArgTypes, type, - typeParams, + null, assemblies, builders); } } - else - { - AppendType( - jsonType, - genericArgTypes, - type, - null, - assemblies, - builders); - } } static void AppendType( @@ -843,6 +1042,102 @@ static void AppendType( string typeNameLower = builders.TempStrBuilder.ToString(); bool isStatic = IsStatic(type); + TypeKind typeKind = GetTypeKind(type); + if (!isStatic && typeKind == TypeKind.ManagedStruct) + { + // C# StructStore Init call + builders.CsharpStructStoreInitCalls.Append( + "\t\t\tNativeScript.Bindings.StructStore<"); + AppendCsharpTypeName( + type, + builders.CsharpStructStoreInitCalls); + builders.CsharpStructStoreInitCalls.Append( + ">.Init("); + if (jsonType.MaxSimultaneous > 0) + { + builders.CsharpStructStoreInitCalls.Append( + jsonType.MaxSimultaneous); + } + else + { + builders.CsharpStructStoreInitCalls.Append( + "maxManagedObjects"); + } + builders.CsharpStructStoreInitCalls.Append( + ");\n"); + + // Build function name + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("ReleaseObject"); + AppendNamespace( + type.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendWithoutGenericTypeCountSuffix( + type.Name, + builders.TempStrBuilder); + if (typeParams != null) + { + for (int i = 0, len = typeParams.Length; i < len; ++i) + { + Type typeParam = typeParams[i]; + AppendNamespace( + typeParam.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendWithoutGenericTypeCountSuffix( + typeParam.Name, + builders.TempStrBuilder); + if (i != len - 1) + { + builders.TempStrBuilder.Append('_'); + } + } + } + string funcName = builders.TempStrBuilder.ToString(); + + // Build ReleaseObject parameters + ParameterInfo paramInfo = new ParameterInfo(); + paramInfo.Name = "handle"; + paramInfo.ParameterType = typeof(int); + paramInfo.IsOut = false; + paramInfo.IsRef = false; + paramInfo.DereferencedParameterType = typeof(int); + paramInfo.Kind = TypeKind.Primitive; + ParameterInfo[] parameters = new[] { paramInfo }; + + // ReleaseObject C# delegate type + AppendCsharpDelegateType( + funcName, + true, + type, + typeKind, + typeof(int), + parameters, + builders.CsharpDelegateTypes); + + // ReleaseObject C# function + AppendCsharpFunctionBeginning( + type, + funcName, + true, + typeKind, + typeof(void), + null, + parameters, + builders.CsharpFunctions); + builders.CsharpFunctions.Append( + "if (handle != 0)\n\t\t\t{\n"); + builders.CsharpFunctions.Append( + "\t\t\t\tNativeScript.Bindings.StructStore<"); + AppendCsharpTypeName( + type, + builders.CsharpFunctions); + builders.CsharpFunctions.Append( + ">.Remove(handle);\n\t\t\t}"); + AppendCsharpFunctionEnd( + builders.CsharpFunctions); + } // C++ type declaration int indent = AppendCppTypeDeclaration( @@ -871,6 +1166,13 @@ static void AppendType( builders.CppMethodDefinitions); // Constructors + if (typeKind == TypeKind.FullStruct) + { + AppendFullValueTypeDefaultConstructor( + type, + indent, + builders); + } if (jsonType.Constructors != null) { foreach (JsonConstructor jsonCtor in jsonType.Constructors) @@ -879,6 +1181,7 @@ static void AppendType( jsonCtor, type, isStatic, + typeKind, assemblies, typeParams, genericArgTypes, @@ -891,12 +1194,13 @@ static void AppendType( // Properties if (jsonType.Properties != null) { - foreach (string jsonPropertyName in jsonType.Properties) + foreach (JsonProperty jsonProperty in jsonType.Properties) { AppendProperty( - jsonPropertyName, + jsonProperty, type, isStatic, + typeKind, typeParams, genericArgTypes, indent, @@ -905,19 +1209,30 @@ static void AppendType( } // Fields - if (jsonType.Fields != null) + if (typeKind == TypeKind.FullStruct) { - foreach (string jsonFieldName in jsonType.Fields) + AppendFullValueTypeFields( + type, + indent + 1, + builders); + } + else + { + if (jsonType.Fields != null) { - AppendField( - jsonFieldName, - type, - isStatic, - typeParams, - genericArgTypes, - indent, - builders - ); + foreach (string jsonFieldName in jsonType.Fields) + { + AppendField( + jsonFieldName, + type, + isStatic, + typeKind, + typeParams, + genericArgTypes, + indent, + builders + ); + } } } @@ -932,6 +1247,7 @@ static void AppendType( assemblies, type, isStatic, + typeKind, methods, typeParams, typeNameLower, @@ -953,59 +1269,116 @@ static void AppendType( builders.CppMethodDefinitions); } - static void AppendConstructor( - JsonConstructor jsonCtor, - Type enclosingType, - bool enclosingTypeIsStatic, + static void AppendEnum( + Type type, Assembly[] assemblies, - Type[] typeTypeParams, - Type[] genericArgTypes, - string typeNameLower, - int indent, StringBuilders builders) { - ConstructorInfo ctor; - if (enclosingType.IsGenericType) + // C++ type declaration (actually definition) + int indent = AppendNamespaceBeginning( + type.Namespace, + builders.CppTypeDeclarations); + AppendIndent( + indent, + builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append("enum struct "); + builders.CppTypeDeclarations.Append(type.Name); + builders.CppTypeDeclarations.Append(" : "); + AppendCppTypeName( + Enum.GetUnderlyingType(type), + builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append('\n'); + AppendIndent( + indent, + builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append("{\n"); + FieldInfo[] fields = type.GetFields( + BindingFlags.Static + | BindingFlags.Public); + for (int i = 0; i < fields.Length; ++i) { - string[] overriddenParamTypeNames = OverrideGenericTypeNames( - jsonCtor.ParamTypes, - genericArgTypes, - typeTypeParams); - ctor = GetConstructor( - enclosingType, - overriddenParamTypeNames); + FieldInfo field = fields[i]; + AppendIndent( + indent + 1, + builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append(field.Name); + builders.CppTypeDeclarations.Append(" = "); + builders.CppTypeDeclarations.Append( + field.GetRawConstantValue()); + if (i != fields.Length - 1) + { + builders.CppTypeDeclarations.Append(','); + } + builders.CppTypeDeclarations.Append('\n'); + } + AppendIndent( + indent, + builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append("};\n"); + AppendNamespaceEnding( + indent, + builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append('\n'); + } + + static void AppendHandleStoreTypeName( + Type type, + StringBuilder output) + { + output.Append("NativeScript.Bindings."); + if (IsManagedValueType(type)) + { + output.Append("StructStore<"); + AppendCsharpTypeName(type, output); + output.Append('>'); } else { - ctor = GetConstructor( - enclosingType, - jsonCtor.ParamTypes); + output.Append("ObjectStore"); } - ParameterInfo[] parameters = ConvertParameters( - ctor.GetParameters()); - AppendConstructor( - ctor, - typeTypeParams, - parameters, - assemblies, - enclosingType, - enclosingTypeIsStatic, - typeNameLower, - indent, - builders); } static void AppendConstructor( - ConstructorInfo ctor, - Type[] typeParams, - ParameterInfo[] parameters, - Assembly[] assemblies, + JsonConstructor jsonCtor, Type enclosingType, bool enclosingTypeIsStatic, + TypeKind enclosingTypeKind, + Assembly[] assemblies, + Type[] typeTypeParams, + Type[] genericArgTypes, string typeNameLower, int indent, StringBuilders builders) { + // Get the constructor's parameters + ParameterInfo[] parameters; + if (enclosingType.IsValueType + && !enclosingType.IsPrimitive + && !enclosingType.IsEnum + && jsonCtor.ParamTypes.Length == 0) + { + // Allow parameterless constructor for structs + parameters = new ParameterInfo[0]; + } + else + { + string[] constructorParamTypeNames; + if (enclosingType.IsGenericType) + { + constructorParamTypeNames = OverrideGenericTypeNames( + jsonCtor.ParamTypes, + genericArgTypes, + typeTypeParams); + } + else + { + constructorParamTypeNames = jsonCtor.ParamTypes; + } + parameters = GetConstructorParameters( + enclosingType, + constructorParamTypeNames); + } + // Build uppercase function name builders.TempStrBuilder.Length = 0; AppendNamespace( @@ -1016,7 +1389,7 @@ static void AppendConstructor( enclosingType.Name, builders.TempStrBuilder); AppendTypeNames( - typeParams, + typeTypeParams, builders.TempStrBuilder); builders.TempStrBuilder.Append("Constructor"); AppendParameterTypeNames( @@ -1035,10 +1408,21 @@ static void AppendConstructor( builders.CsharpInitParams); // C# delegate type + Type delegateReturnType; + if (enclosingTypeKind == TypeKind.FullStruct) + { + delegateReturnType = enclosingType; + } + else + { + delegateReturnType = typeof(int); + } AppendCsharpDelegateType( funcName, true, - typeof(int), + enclosingType, + enclosingTypeKind, + delegateReturnType, parameters, builders.CsharpDelegateTypes); @@ -1046,33 +1430,67 @@ static void AppendConstructor( AppendCsharpInitCallArg(funcName, builders.CsharpInitCall); // C# function - AppendCsharpFunctionBeginning( - enclosingType, - funcName, - true, - typeof(int), - null, - parameters, - builders.CsharpFunctions); - builders.CsharpFunctions.Append( - "NativeScript.Bindings.StoreObject(new "); - AppendCsharpTypeName( - enclosingType, - builders.CsharpFunctions); - AppendCsharpFunctionCallParameters( - true, - parameters, - builders.CsharpFunctions); - builders.CsharpFunctions.Append(");"); - AppendCsharpFunctionReturn( - parameters, - typeof(int), - builders.CsharpFunctions); + if (enclosingTypeKind == TypeKind.FullStruct) + { + AppendCsharpFunctionBeginning( + enclosingType, + funcName, + true, + enclosingTypeKind, + enclosingType, + null, + parameters, + builders.CsharpFunctions); + builders.CsharpFunctions.Append("new "); + AppendCsharpTypeName( + enclosingType, + builders.CsharpFunctions); + AppendCsharpFunctionCallParameters( + true, + parameters, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(";"); + AppendCsharpFunctionReturn( + parameters, + enclosingType, + builders.CsharpFunctions); + } + else + { + AppendCsharpFunctionBeginning( + enclosingType, + funcName, + true, + enclosingTypeKind, + typeof(int), + null, + parameters, + builders.CsharpFunctions); + AppendHandleStoreTypeName( + enclosingType, + builders.CsharpFunctions); + builders.CsharpFunctions.Append( + ".Store(new "); + AppendCsharpTypeName( + enclosingType, + builders.CsharpFunctions); + AppendCsharpFunctionCallParameters( + true, + parameters, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(");"); + AppendCsharpFunctionReturn( + parameters, + typeof(int), + builders.CsharpFunctions); + } // C++ function pointer AppendCppFunctionPointerDefinition( funcName, true, + enclosingType, + enclosingTypeKind, parameters, enclosingType, builders.CppFunctionPointers); @@ -1095,25 +1513,29 @@ static void AppendConstructor( enclosingType, null, enclosingType.Name, - typeParams, + typeTypeParams, null, parameters, indent, builders.CppMethodDefinitions); - AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(" : "); - AppendCppTypeName( - enclosingType.BaseType, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("(0)\n"); + if (enclosingTypeKind != TypeKind.FullStruct) + { + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(" : "); + AppendCppTypeName( + enclosingType.BaseType, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("(0)\n"); + } AppendIndent( indent, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( true, + enclosingTypeKind, enclosingType, funcName, parameters, @@ -1122,7 +1544,16 @@ static void AppendConstructor( AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("SetHandle(returnValue);\n"); + if (enclosingTypeKind == TypeKind.FullStruct) + { + builders.CppMethodDefinitions.Append( + "*this = returnValue;\n"); + } + else + { + builders.CppMethodDefinitions.Append( + "SetHandle(returnValue);\n"); + } AppendIndent( indent, builders.CppMethodDefinitions); @@ -1136,6 +1567,8 @@ static void AppendConstructor( AppendCppInitParam( funcNameLower, true, + enclosingType, + enclosingTypeKind, parameters, enclosingType, builders.CppInitParams); @@ -1148,16 +1581,17 @@ static void AppendConstructor( } static void AppendProperty( - string jsonPropertyName, + JsonProperty jsonProperty, Type enclosingType, bool enclosingTypeIsStatic, + TypeKind enclosingTypeKind, Type[] typeParams, Type[] typeGenericArgumentTypes, int indent, StringBuilders builders) { PropertyInfo property = enclosingType.GetProperty( - jsonPropertyName); + jsonProperty.Name); Type propertyType = OverrideGenericType( property.PropertyType, typeGenericArgumentTypes, @@ -1176,7 +1610,9 @@ static void AppendProperty( "Property", parameters, enclosingTypeIsStatic, + enclosingTypeKind, getMethod.IsStatic, + jsonProperty.GetIsReadOnly, enclosingType, typeParams, propertyType, @@ -1186,23 +1622,87 @@ static void AppendProperty( MethodInfo setMethod = property.GetSetMethod(); if (setMethod != null && setMethod.IsPublic) { - ParameterInfo[] parameters = ConvertParameters( - setMethod.GetParameters()); - OverrideGenericParameterTypes( - parameters, - typeGenericArgumentTypes, - typeParams); - AppendSetter( - property.Name, - "Property", - parameters, - enclosingTypeIsStatic, - setMethod.IsStatic, - enclosingType, - typeParams, - propertyType, + ParameterInfo[] parameters = ConvertParameters( + setMethod.GetParameters()); + OverrideGenericParameterTypes( + parameters, + typeGenericArgumentTypes, + typeParams); + AppendSetter( + property.Name, + "Property", + parameters, + enclosingTypeIsStatic, + enclosingTypeKind, + setMethod.IsStatic, + jsonProperty.SetIsReadOnly, + enclosingType, + typeParams, + propertyType, + indent, + builders); + } + } + + static void AppendFullValueTypeDefaultConstructor( + Type enclosingType, + int indent, + StringBuilders builders) + { + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendWithoutGenericTypeCountSuffix( + enclosingType.Name, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("();\n"); + + AppendIndent( + indent, + builders.CppMethodDefinitions); + AppendWithoutGenericTypeCountSuffix( + enclosingType.Name, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("::"); + AppendWithoutGenericTypeCountSuffix( + enclosingType.Name, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("()\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + } + + static void AppendFullValueTypeFields( + Type enclosingType, + int indent, + StringBuilders builders) + { + FieldInfo[] fields = enclosingType.GetFields( + BindingFlags.Instance + | BindingFlags.Public + | BindingFlags.NonPublic); + Array.Sort(fields, DefaultFieldOrderComparer); + foreach (FieldInfo field in fields) + { + AppendIndent( indent, - builders); + builders.CppTypeDefinitions); + AppendCppTypeName( + field.FieldType, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append(' '); + builders.CppTypeDefinitions.Append(field.Name); + builders.CppTypeDefinitions.Append(";\n"); } } @@ -1210,6 +1710,7 @@ static void AppendField( string jsonFieldName, Type enclosingType, bool enclosingTypeIsStatic, + TypeKind enclosingTypeKind, Type[] typeTypeParams, Type[] typeGenericArgumentTypes, int indent, @@ -1226,7 +1727,9 @@ StringBuilders builders "Field", new ParameterInfo[0], enclosingTypeIsStatic, + enclosingTypeKind, field.IsStatic, + true, enclosingType, typeTypeParams, fieldType, @@ -1238,14 +1741,17 @@ StringBuilders builders setParam.IsOut = false; setParam.IsRef = false; setParam.DereferencedParameterType = setParam.ParameterType; - setParam.IsStruct = setParam.DereferencedParameterType.IsValueType; + setParam.Kind = GetTypeKind( + setParam.DereferencedParameterType); ParameterInfo[] parameters = new []{ setParam }; AppendSetter( field.Name, "Field", parameters, enclosingTypeIsStatic, + enclosingTypeKind, field.IsStatic, + false, enclosingType, typeTypeParams, fieldType, @@ -1258,6 +1764,7 @@ static void AppendMethod( Assembly[] assemblies, Type enclosingType, bool enclosingTypeIsStatic, + TypeKind enclosingTypeKind, MethodInfo[] methods, Type[] typeTypeParams, string typeNameLower, @@ -1306,7 +1813,9 @@ static void AppendMethod( typeNameLower, method.Name, enclosingTypeIsStatic, + enclosingTypeKind, method.IsStatic, + jsonMethod.IsReadOnly, method.ReturnType, typeTypeParams, methodTypeParams, @@ -1325,7 +1834,9 @@ static void AppendMethod( typeNameLower, method.Name, enclosingTypeIsStatic, + enclosingTypeKind, method.IsStatic, + jsonMethod.IsReadOnly, method.ReturnType, typeTypeParams, null, @@ -1399,7 +1910,9 @@ static void AppendMethod( string typeNameLower, string methodName, bool enclosingTypeIsStatic, + TypeKind enclosingTypeKind, bool methodIsStatic, + bool isReadOnly, Type returnType, Type[] typeTypeParams, Type[] methodTypeParams, @@ -1443,6 +1956,8 @@ static void AppendMethod( AppendCsharpDelegateType( funcName, methodIsStatic, + enclosingType, + enclosingTypeKind, returnType, parameters, builders.CsharpDelegateTypes); @@ -1457,6 +1972,7 @@ static void AppendMethod( enclosingType, funcName, methodIsStatic, + enclosingTypeKind, returnType, methodTypeParams, parameters, @@ -1474,6 +1990,15 @@ static void AppendMethod( parameters, builders.CsharpFunctions); builders.CsharpFunctions.Append(';'); + if (!isReadOnly + && enclosingTypeKind == TypeKind.ManagedStruct) + { + AppendStructStoreReplace( + enclosingType, + "thisHandle", + "thiz", + builders.CsharpFunctions); + } AppendCsharpFunctionReturn( parameters, returnType, @@ -1483,6 +2008,8 @@ static void AppendMethod( AppendCppFunctionPointerDefinition( funcName, methodIsStatic, + enclosingType, + enclosingTypeKind, parameters, returnType, builders.CppFunctionPointers); @@ -1516,6 +2043,7 @@ static void AppendMethod( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( methodIsStatic, + enclosingTypeKind, returnType, funcName, parameters, @@ -1534,6 +2062,8 @@ static void AppendMethod( AppendCppInitParam( funcNameLower, methodIsStatic, + enclosingType, + enclosingTypeKind, parameters, returnType, builders.CppInitParams); @@ -1646,7 +2176,11 @@ static void AppendMonoBehaviour( AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); builders.CsharpMonoBehaviours.Append("{\n"); AppendIndent(csharpIndent + 2, builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("thisHandle = NativeScript.Bindings.StoreObject(this);\n"); + builders.CsharpMonoBehaviours.Append("thisHandle = "); + AppendHandleStoreTypeName( + type, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append(".Store(this);\n"); AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); builders.CsharpMonoBehaviours.Append("}\n"); if (jsonMonoBehaviour.Messages.Length > 0) @@ -1720,7 +2254,9 @@ static void AppendMonoBehaviour( builders.CsharpMonoBehaviours.Append("{\n"); for (int i = 0; i < numParams; ++i) { - if (!parameters[i].IsStruct) + ParameterInfo param = parameters[i]; + if (param.Kind == TypeKind.Class + || param.Kind == TypeKind.ManagedStruct) { AppendIndent( csharpIndent + 2, @@ -1728,33 +2264,22 @@ static void AppendMonoBehaviour( builders.CsharpMonoBehaviours.Append("int param"); builders.CsharpMonoBehaviours.Append(i); builders.CsharpMonoBehaviours.Append("Handle = "); - builders.CsharpMonoBehaviours.Append("NativeScript.Bindings.GetHandle("); - builders.CsharpMonoBehaviours.Append("param"); - builders.CsharpMonoBehaviours.Append(i); - builders.CsharpMonoBehaviours.Append(");\n"); - AppendIndent( - csharpIndent + 2, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("if (param"); - builders.CsharpMonoBehaviours.Append(i); - builders.CsharpMonoBehaviours.Append("Handle < 0)\n"); - AppendIndent( - csharpIndent + 2, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("{\n"); - AppendIndent( - csharpIndent + 3, + AppendHandleStoreTypeName( + param.DereferencedParameterType, builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("param"); - builders.CsharpMonoBehaviours.Append(i); - builders.CsharpMonoBehaviours.Append("Handle = NativeScript.Bindings.StoreObject("); + builders.CsharpMonoBehaviours.Append('.'); + if (param.Kind == TypeKind.ManagedStruct) + { + builders.CsharpMonoBehaviours.Append("GetHandle"); + } + else + { + builders.CsharpMonoBehaviours.Append("Store"); + } + builders.CsharpMonoBehaviours.Append('('); builders.CsharpMonoBehaviours.Append("param"); builders.CsharpMonoBehaviours.Append(i); builders.CsharpMonoBehaviours.Append(");\n"); - AppendIndent( - csharpIndent + 2, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("}\n"); } } AppendIndent( @@ -1772,7 +2297,9 @@ static void AppendMonoBehaviour( { builders.CsharpMonoBehaviours.Append("param"); builders.CsharpMonoBehaviours.Append(i); - if (!parameters[i].IsStruct) + ParameterInfo param = parameters[i]; + if (param.Kind == TypeKind.Class + || param.Kind == TypeKind.ManagedStruct) { builders.CsharpMonoBehaviours.Append("Handle"); } @@ -1810,7 +2337,7 @@ static void AppendMonoBehaviour( for (int i = 0; i < numParams; ++i) { ParameterInfo param = parameters[i]; - if (param.IsStruct) + if (param.Kind == TypeKind.FullStruct) { AppendCsharpTypeName( param.ParameterType, @@ -1850,7 +2377,7 @@ static void AppendMonoBehaviour( for (int i = 0; i < numParams; ++i) { ParameterInfo param = parameters[i]; - if (param.IsStruct) + if (param.Kind == TypeKind.FullStruct) { AppendCsharpTypeName( param.ParameterType, @@ -1894,19 +2421,22 @@ static void AppendMonoBehaviour( for (int i = 0; i < numParams; ++i) { ParameterInfo param = parameters[i]; - if (param.IsStruct) - { - AppendCppTypeName( - param.ParameterType, - builders.CppMonoBehaviourMessages); - builders.CppMonoBehaviourMessages.Append(" param"); - builders.CppMonoBehaviourMessages.Append(i); - } - else + switch (param.Kind) { - builders.CppMonoBehaviourMessages.Append("int32_t param"); - builders.CppMonoBehaviourMessages.Append(i); - builders.CppMonoBehaviourMessages.Append("Handle"); + case TypeKind.FullStruct: + case TypeKind.Primitive: + case TypeKind.Enum: + AppendCppTypeName( + param.ParameterType, + builders.CppMonoBehaviourMessages); + builders.CppMonoBehaviourMessages.Append(" param"); + builders.CppMonoBehaviourMessages.Append(i); + break; + default: + builders.CppMonoBehaviourMessages.Append("int32_t param"); + builders.CppMonoBehaviourMessages.Append(i); + builders.CppMonoBehaviourMessages.Append("Handle"); + break; } if (i != numParams-1) { @@ -1921,7 +2451,8 @@ static void AppendMonoBehaviour( for (int i = 0; i < numParams; ++i) { ParameterInfo param = parameters[i]; - if (!param.IsStruct) + if (param.Kind == TypeKind.Class + || param.Kind == TypeKind.ManagedStruct) { builders.CppMonoBehaviourMessages.Append('\t'); AppendCppTypeName( @@ -1966,7 +2497,9 @@ static void AppendGetter( string syntaxType, ParameterInfo[] parameters, bool enclosingTypeIsStatic, + TypeKind enclosingTypeKind, bool methodIsStatic, + bool isReadOnly, Type enclosingType, Type[] typeTypeParams, Type fieldType, @@ -2019,6 +2552,8 @@ static void AppendGetter( AppendCsharpDelegateType( funcName, methodIsStatic, + enclosingType, + enclosingTypeKind, fieldType, parameters, builders.CsharpDelegateTypes); @@ -2033,6 +2568,7 @@ static void AppendGetter( enclosingType, funcName, methodIsStatic, + enclosingTypeKind, fieldType, typeTypeParams, parameters, @@ -2043,6 +2579,15 @@ static void AppendGetter( builders.CsharpFunctions); builders.CsharpFunctions.Append(fieldName); builders.CsharpFunctions.Append(';'); + if (!isReadOnly + && enclosingTypeKind == TypeKind.ManagedStruct) + { + AppendStructStoreReplace( + enclosingType, + "thisHandle", + "thiz", + builders.CsharpFunctions); + } AppendCsharpFunctionReturn( parameters, fieldType, @@ -2052,6 +2597,8 @@ static void AppendGetter( AppendCppFunctionPointerDefinition( funcName, methodIsStatic, + enclosingType, + enclosingTypeKind, parameters, fieldType, builders.CppFunctionPointers); @@ -2081,6 +2628,7 @@ static void AppendGetter( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( methodIsStatic, + enclosingTypeKind, fieldType, funcName, parameters, @@ -2093,12 +2641,14 @@ static void AppendGetter( AppendIndent(indent, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("}\n"); AppendIndent(indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); + builders.CppMethodDefinitions.Append('\n'); // C++ init params AppendCppInitParam( funcNameLower, methodIsStatic, + enclosingType, + enclosingTypeKind, parameters, fieldType, builders.CppInitParams); @@ -2115,7 +2665,9 @@ static void AppendSetter( string syntaxType, ParameterInfo[] parameters, bool enclosingTypeIsStatic, + TypeKind enclosingTypeKind, bool methodIsStatic, + bool isReadOnly, Type enclosingType, Type[] typeTypeParams, Type fieldType, @@ -2168,6 +2720,8 @@ static void AppendSetter( AppendCsharpDelegateType( funcName, methodIsStatic, + enclosingType, + enclosingTypeKind, typeof(void), parameters, builders.CsharpDelegateTypes); @@ -2182,6 +2736,7 @@ static void AppendSetter( enclosingType, funcName, methodIsStatic, + enclosingTypeKind, typeof(void), typeTypeParams, parameters, @@ -2193,6 +2748,15 @@ static void AppendSetter( builders.CsharpFunctions.Append(fieldName); builders.CsharpFunctions.Append(" = "); builders.CsharpFunctions.Append("value;"); + if (!isReadOnly + && enclosingTypeKind == TypeKind.ManagedStruct) + { + AppendStructStoreReplace( + enclosingType, + "thisHandle", + "thiz", + builders.CsharpFunctions); + } AppendCsharpFunctionReturn( parameters, typeof(void), @@ -2202,6 +2766,8 @@ static void AppendSetter( AppendCppFunctionPointerDefinition( funcName, methodIsStatic, + enclosingType, + enclosingTypeKind, parameters, typeof(void), builders.CppFunctionPointers); @@ -2231,6 +2797,7 @@ static void AppendSetter( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( methodIsStatic, + enclosingTypeKind, null, funcName, parameters, @@ -2245,6 +2812,8 @@ static void AppendSetter( AppendCppInitParam( funcNameLower, methodIsStatic, + enclosingType, + enclosingTypeKind, parameters, typeof(void), builders.CppInitParams); @@ -2335,7 +2904,8 @@ StringBuilder output type.Name, output); AppendCppTypeParameters(typeParams, output); - if (baseType != null) + if (baseType != null + && !IsFullValueType(type)) { output.Append(" : "); AppendCppTypeName( @@ -2348,7 +2918,7 @@ StringBuilder output indent, output); output.Append("{\n"); - if (!isStatic) + if (!isStatic && !IsFullValueType(type)) { // Constructor from nullptr_t AppendIndent(indent + 1, output); @@ -2492,7 +3062,7 @@ static int AppendCppMethodDefinitionBegin( int cppMethodDefinitionsIndent = AppendNamespaceBeginning( type.Namespace, output); - if (!isStatic) + if (!isStatic && !IsFullValueType(type)) { if (baseType == null) { @@ -2858,6 +3428,8 @@ static void AppendCsharpInitCallArg( static void AppendCsharpDelegateType( string funcName, bool isStatic, + Type enclosingType, + TypeKind enclosingTypeKind, Type returnType, ParameterInfo[] parameters, StringBuilder output) @@ -2865,7 +3437,7 @@ static void AppendCsharpDelegateType( output.Append("\t\tdelegate "); // Return type - if (returnType.IsValueType) + if (IsFullValueType(returnType)) { AppendCsharpTypeName( returnType, @@ -2881,7 +3453,18 @@ static void AppendCsharpDelegateType( output.Append("Delegate("); if (!isStatic) { - output.Append("int thisHandle"); + if (enclosingTypeKind == TypeKind.FullStruct) + { + output.Append("ref "); + AppendCsharpTypeName( + enclosingType, + output); + output.Append(" thiz"); + } + else + { + output.Append("int thisHandle"); + } if (parameters.Length > 0) { output.Append(", "); @@ -2897,6 +3480,7 @@ static void AppendCsharpFunctionBeginning( Type enclosingType, string funcName, bool isStatic, + TypeKind enclosingTypeKind, Type returnType, Type[] typeParams, ParameterInfo[] parameters, @@ -2909,7 +3493,7 @@ static void AppendCsharpFunctionBeginning( // Return type if (returnType != null) { - if (returnType.IsValueType) + if (IsFullValueType(returnType)) { AppendCsharpTypeName( returnType, @@ -2929,7 +3513,18 @@ static void AppendCsharpFunctionBeginning( output.Append("("); if (!isStatic) { - output.Append("int thisHandle"); + if (enclosingTypeKind == TypeKind.FullStruct) + { + output.Append("ref "); + AppendCsharpTypeName( + enclosingType, + output); + output.Append(" thiz"); + } + else + { + output.Append("int thisHandle"); + } if (parameters.Length > 0) { output.Append(", "); @@ -2941,21 +3536,27 @@ static void AppendCsharpFunctionBeginning( output.Append(")\n\t\t{\n\t\t\t"); // Get "this" - if (!isStatic) + if (!isStatic + && enclosingTypeKind != TypeKind.FullStruct) { output.Append("var thiz = ("); AppendCsharpTypeName( enclosingType, output); + output.Append(')'); + AppendHandleStoreTypeName( + enclosingType, + output); output.Append( - ")NativeScript.Bindings.GetObject(thisHandle);\n\t\t\t"); + ".Get(thisHandle);\n\t\t\t"); } - // Get reference type params from ObjectStore + // Get managed type params from ObjectStore foreach (ParameterInfo param in parameters) { Type paramType = param.DereferencedParameterType; - if (!param.IsStruct) + if (param.Kind == TypeKind.Class + || param.Kind == TypeKind.ManagedStruct) { output.Append("var "); output.Append(param.Name); @@ -2966,7 +3567,8 @@ static void AppendCsharpFunctionBeginning( AppendCsharpTypeName(paramType, output); output.Append(')'); } - output.Append("NativeScript.Bindings.GetObject("); + AppendHandleStoreTypeName(paramType, output); + output.Append(".Get("); output.Append(param.Name); output.Append("Handle);\n\t\t\t"); } @@ -3023,6 +3625,23 @@ static void AppendCsharpFunctionCallParameters( output.Append(')'); } + static void AppendStructStoreReplace( + Type enclosingType, + string handleVariable, + string structVariable, + StringBuilder output) + { + output.Append("\n\t\t\t"); + AppendHandleStoreTypeName( + enclosingType, + output); + output.Append(".Replace("); + output.Append(handleVariable); + output.Append(", ref "); + output.Append(structVariable); + output.Append(");"); + } + static void AppendCsharpFunctionReturn( ParameterInfo[] parameters, Type returnType, @@ -3031,45 +3650,59 @@ static void AppendCsharpFunctionReturn( // Store reference out and ref params and overwrite handles foreach (ParameterInfo param in parameters) { - if (!param.IsStruct && (param.IsOut || param.IsRef)) + if ((param.Kind == TypeKind.Class + || param.Kind == TypeKind.ManagedStruct) + && (param.IsOut || param.IsRef)) { output.Append("\n\t\t\tint "); output.Append(param.Name); - output.Append("HandleNew = NativeScript.Bindings.GetHandle("); - output.Append(param.Name); - output.Append(");\n\t\t\tif ("); - output.Append(param.Name); - output.Append("HandleNew < 0)\n\t\t\t{\n\t\t\t\t"); - output.Append(param.Name); - output.Append("Handle = NativeScript.Bindings.StoreObject("); + output.Append("HandleNew = "); + AppendHandleStoreTypeName( + param.DereferencedParameterType, + output); + output.Append('.'); + if (param.Kind == TypeKind.ManagedStruct) + { + output.Append("Store"); + } + else + { + output.Append("GetHandle"); + } + output.Append('('); output.Append(param.Name); - output.Append(");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t"); + output.Append(");\n\t\t\t"); output.Append(param.Name); output.Append("Handle = "); output.Append(param.Name); - output.Append("HandleNew;\n\t\t\t}"); + output.Append("HandleNew;"); } } + + // Return if (!returnType.Equals(typeof(void))) { - output.Append('\n'); - if (returnType.IsValueType) + output.Append("\n\t\t\treturn "); + if (IsFullValueType(returnType)) { - output.Append("\t\t\treturn returnValue;"); + output.Append("returnValue"); } else { - output.Append("\t\t\tint returnValueHandle = NativeScript.Bindings.GetHandle(returnValue);\n"); - output.Append("\t\t\tif (returnValueHandle < 0)\n"); - output.Append("\t\t\t{\n"); - output.Append("\t\t\t\treturn NativeScript.Bindings.StoreObject(returnValue);\n"); - output.Append("\t\t\t}\n"); - output.Append("\t\t\telse\n"); - output.Append("\t\t\t{\n"); - output.Append("\t\t\t\treturn returnValueHandle;\n"); - output.Append("\t\t\t}"); + AppendHandleStoreTypeName( + returnType, + output); + output.Append(".GetHandle(returnValue)"); } + output.Append(';'); } + + // Returning ends the function + AppendCsharpFunctionEnd(output); + } + + static void AppendCsharpFunctionEnd(StringBuilder output) + { output.Append("\n\t\t}\n\t\t\n"); } @@ -3080,37 +3713,56 @@ static void AppendCsharpParameterDeclaration( for (int i = 0; i < parameters.Length; ++i) { ParameterInfo param = parameters[i]; - if (param.IsOut) - { - if (param.IsStruct) - { - output.Append("out "); - } - else - { - output.Append("ref "); - } - } - if (param.IsRef) - { - output.Append("ref "); - } - if (param.IsStruct) + + // out or ref qualifiers if necessary + switch (param.Kind) { - AppendCsharpTypeName( - param.DereferencedParameterType, - output); + case TypeKind.FullStruct: + if (param.IsOut) + { + output.Append("out "); + } + else + { + output.Append("ref "); + } + break; + case TypeKind.ManagedStruct: + case TypeKind.Primitive: + case TypeKind.Enum: + case TypeKind.Class: + if (param.IsOut || param.IsRef) + { + output.Append("ref "); + } + break; } - else + + // Param type- int for handles + switch (param.Kind) { - output.Append("int"); + case TypeKind.ManagedStruct: + case TypeKind.Class: + output.Append("int"); + break; + default: + AppendCsharpTypeName( + param.DereferencedParameterType, + output); + break; } + + // Param name output.Append(' '); output.Append(param.Name); - if (!param.IsStruct) + + // Handle suffix if necessary + if (param.Kind == TypeKind.Class + || param.Kind == TypeKind.ManagedStruct) { output.Append("Handle"); } + if (i != parameters.Length - 1) { output.Append(", "); @@ -3128,12 +3780,21 @@ static void AppendCppParameterDeclaration( AppendCppTypeName( param.DereferencedParameterType, output); + + // Pointer (*) or reference (&) suffix if necessary if (param.IsOut || param.IsRef) { output.Append('*'); } + else if (param.Kind == TypeKind.FullStruct) + { + output.Append('&'); + } + + // Param name output.Append(' '); output.Append(param.Name); + if (i != parameters.Length - 1) { output.Append(", "); @@ -3150,7 +3811,8 @@ static void AppendParameterCall( { ParameterInfo parameter = parameters[i]; output.Append(parameter.Name); - if (!parameter.IsStruct) + if (parameter.Kind == TypeKind.Class + || parameter.Kind == TypeKind.ManagedStruct) { output.Append("Handle"); } @@ -3245,6 +3907,7 @@ static void AppendCppMethodReturn( static void AppendCppPluginFunctionCall( bool isStatic, + TypeKind enclosingTypeKind, Type returnType, string funcName, ParameterInfo[] parameters, @@ -3254,7 +3917,9 @@ static void AppendCppPluginFunctionCall( // Gather handles for out and ref parameters foreach (ParameterInfo param in parameters) { - if (!param.IsStruct && (param.IsOut || param.IsRef)) + if ((param.Kind == TypeKind.Class + || param.Kind == TypeKind.ManagedStruct) + && (param.IsOut || param.IsRef)) { AppendIndent(indent, output); output.Append("int32_t "); @@ -3276,7 +3941,14 @@ static void AppendCppPluginFunctionCall( output.Append("("); if (!isStatic) { - output.Append("Handle"); + if (enclosingTypeKind == TypeKind.FullStruct) + { + output.Append("this"); + } + else + { + output.Append("Handle"); + } if (parameters.Length > 0) { output.Append(", "); @@ -3285,23 +3957,26 @@ static void AppendCppPluginFunctionCall( for (int i = 0; i < parameters.Length; ++i) { ParameterInfo param = parameters[i]; - if (param.IsStruct) - { - output.Append(param.Name); - } - else + switch (param.Kind) { - if (param.IsOut || param.IsRef) - { - output.Append('&'); - output.Append(param.Name); - } - else - { + case TypeKind.FullStruct: + case TypeKind.Primitive: + case TypeKind.Enum: output.Append(param.Name); - output.Append('.'); - } - output.Append("Handle"); + break; + default: + if (param.IsOut || param.IsRef) + { + output.Append('&'); + output.Append(param.Name); + } + else + { + output.Append(param.Name); + output.Append('.'); + } + output.Append("Handle"); + break; } if (i != parameters.Length - 1) { @@ -3313,7 +3988,9 @@ static void AppendCppPluginFunctionCall( // Set out and ref parameters foreach (ParameterInfo param in parameters) { - if (!param.IsStruct && (param.IsOut || param.IsRef)) + if ((param.Kind == TypeKind.Class + || param.Kind == TypeKind.ManagedStruct) + && (param.IsOut || param.IsRef)) { AppendIndent(indent, output); output.Append(param.Name); @@ -3327,6 +4004,8 @@ static void AppendCppPluginFunctionCall( static void AppendCppInitParam( string funcName, bool isStatic, + Type enclosingType, + TypeKind enclosingTypeKind, ParameterInfo[] parameters, Type returnType, StringBuilder output @@ -3336,6 +4015,8 @@ StringBuilder output AppendCppFunctionPointer( funcName, isStatic, + enclosingType, + enclosingTypeKind, parameters, returnType, ',', @@ -3347,6 +4028,8 @@ StringBuilder output static void AppendCppFunctionPointerDefinition( string funcName, bool isStatic, + Type enclosingType, + TypeKind enclosingTypeKind, ParameterInfo[] parameters, Type returnType, StringBuilder output @@ -3356,6 +4039,8 @@ StringBuilder output AppendCppFunctionPointer( funcName, isStatic, + enclosingType, + enclosingTypeKind, parameters, returnType, ';', @@ -3367,13 +4052,15 @@ StringBuilder output static void AppendCppFunctionPointer( string funcName, bool isStatic, + Type enclosingType, + TypeKind enclosingTypeKind, ParameterInfo[] parameters, Type returnType, char separator, StringBuilder output) { // Return type - if (returnType.IsValueType) + if (IsFullValueType(returnType)) { AppendCppTypeName(returnType, output); } @@ -3387,7 +4074,19 @@ static void AppendCppFunctionPointer( output.Append(")("); if (!isStatic) { - output.Append("int32_t thisHandle"); + switch (enclosingTypeKind) + { + case TypeKind.FullStruct: + case TypeKind.Primitive: + AppendCppTypeName( + enclosingType, + output); + output.Append("* thiz"); + break; + default: + output.Append("int32_t thisHandle"); + break; + } if (parameters.Length > 0) { output.Append(", "); @@ -3396,23 +4095,44 @@ static void AppendCppFunctionPointer( for (int i = 0; i < parameters.Length; ++i) { ParameterInfo param = parameters[i]; - if (param.IsStruct) - { - AppendCppTypeName( - param.DereferencedParameterType, - output); - } - else + switch (param.Kind) { - output.Append("int32_t"); - } - if (param.IsOut || param.IsRef) - { - output.Append('*'); + case TypeKind.Primitive: + case TypeKind.Enum: + AppendCppTypeName( + param.DereferencedParameterType, + output); + if (param.IsOut || param.IsRef) + { + output.Append('*'); + } + break; + case TypeKind.FullStruct: + AppendCppTypeName( + param.DereferencedParameterType, + output); + if (param.IsOut || param.IsRef) + { + output.Append('*'); + } + else + { + output.Append('&'); + } + break; + case TypeKind.Class: + case TypeKind.ManagedStruct: + output.Append("int32_t"); + if (param.IsOut || param.IsRef) + { + output.Append('*'); + } + break; } output.Append(' '); output.Append(param.Name); - if (!param.IsStruct) + if (param.Kind == TypeKind.Class + || param.Kind == TypeKind.ManagedStruct) { output.Append("Handle"); } @@ -3530,6 +4250,18 @@ static void AppendCsharpTypeName( { output.Append("ulong"); } + else if (type.Equals(typeof(char))) + { + output.Append("char"); + } + else if (type.Equals(typeof(float))) + { + output.Append("float"); + } + else if (type.Equals(typeof(double))) + { + output.Append("double"); + } else if (type.Equals(typeof(string))) { output.Append("string"); @@ -3592,6 +4324,18 @@ static void AppendCppTypeName( { output.Append("uint64_t"); } + else if (type.Equals(typeof(char))) + { + output.Append("System::Char"); + } + else if (type.Equals(typeof(float))) + { + output.Append("float"); + } + else if (type.Equals(typeof(double))) + { + output.Append("double"); + } else if (type.Equals(typeof(string))) { output.Append("System::String"); @@ -3630,6 +4374,9 @@ static void LogStringBuilders( LogStringBuilder( "C# delegates", builders.CsharpDelegateTypes); + LogStringBuilder( + "C# StructStore Init calls", + builders.CsharpStructStoreInitCalls); LogStringBuilder( "C# init call", builders.CsharpInitCall); @@ -3686,6 +4433,7 @@ static void RemoveTrailingChars( { RemoveTrailingChars(builders.CsharpInitParams); RemoveTrailingChars(builders.CsharpDelegateTypes); + RemoveTrailingChars(builders.CsharpStructStoreInitCalls); RemoveTrailingChars(builders.CsharpInitCall); RemoveTrailingChars(builders.CsharpFunctions); RemoveTrailingChars(builders.CsharpMonoBehaviours); @@ -3744,6 +4492,11 @@ static void InjectBuilders( "/*BEGIN DELEGATE TYPES*/\n", "\n\t\t/*END DELEGATE TYPES*/", builders.CsharpDelegateTypes.ToString()); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN STRUCTSTORE INIT CALLS*/\n", + "\n\t\t\t/*END STRUCTSTORE INIT CALLS*/", + builders.CsharpStructStoreInitCalls.ToString()); csharpContents = InjectIntoString( csharpContents, "/*BEGIN INIT CALL*/\n", diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 0e4238e..b375aa6 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -20,11 +20,19 @@ "ParamTypes": [] } ], - "Properties": [ "ElapsedMilliseconds" ] + "Properties": [ + { + "Name": "ElapsedMilliseconds" + } + ] }, { "Name": "UnityEngine.Object", - "Properties": [ "name" ] + "Properties": [ + { + "Name": "name" + } + ] }, { "Name": "UnityEngine.GameObject", @@ -33,51 +41,86 @@ "ParamTypes": [] }, { - "ParamTypes": [ "System.String" ] + "ParamTypes": [ + "System.String" + ] } ], "Methods": [ { "Name": "Find", - "ParamTypes": [ "System.String" ] + "ParamTypes": [ + "System.String" + ] }, { "Name": "AddComponent", "ParamTypes": [], "GenericParams": [ - { "Types": [ "MyGame.MonoBehaviours.TestScript" ] } + { + "Types": [ + "MyGame.MonoBehaviours.TestScript" + ] + } ] } ], - "Properties": [ "transform" ] + "Properties": [ + { + "Name": "transform" + } + ] }, { "Name": "UnityEngine.Component", - "Properties": [ "transform" ] + "Properties": [ + { + "Name": "transform" + } + ] }, { "Name": "UnityEngine.Transform", - "Properties": [ "position" ] + "Properties": [ + { + "Name": "position" + } + ] }, { "Name": "UnityEngine.Debug", "Methods": [ { "Name": "Log", - "ParamTypes": [ "System.Object" ] + "ParamTypes": [ + "System.Object" + ] } ] }, { "Name": "UnityEngine.Assertions.Assert", - "Fields": [ "raiseExceptions" ], + "Fields": [ + "raiseExceptions" + ], "Methods": [ { "Name": "AreEqual", - "ParamTypes": [ "T", "T" ], + "ParamTypes": [ + "T", + "T" + ], "GenericParams": [ - { "Types": [ "System.String" ] }, - { "Types": [ "UnityEngine.GameObject" ] } + { + "Types": [ + "System.String" + ] + }, + { + "Types": [ + "UnityEngine.GameObject" + ] + } ] } ] @@ -121,10 +164,83 @@ } ] }, + { + "Name": "UnityEngine.Vector3", + "Constructors": [ + { + "ParamTypes": [ + "System.Single", + "System.Single", + "System.Single" + ] + } + ], + "Methods": [ + { + "Name": "Set", + "ParamTypes": [ + "System.Single", + "System.Single", + "System.Single" + ] + } + ], + "Properties": [ + { + "Name": "magnitude" + } + ] + }, + { + "Name": "UnityEngine.RaycastHit", + "MaxSimultaneous": 1000, + "Properties": [ + { + "Name": "point" + }, + { + "Name": "transform" + } + ] + }, + { + "Name": "UnityEngine.QueryTriggerInteraction" + }, + { + "Name": "System.Collections.Generic.KeyValuePair`2", + "GenericParams": [ + { + "Types": [ + "System.String", + "System.Double" + ] + } + ], + "Constructors": [ + { + "ParamTypes": [ + "TKey", + "TValue" + ] + } + ], + "Properties": [ + { + "Name": "Key" + }, + { + "Name": "Value" + } + ] + }, { "Name": "System.Collections.Generic.List`1", "GenericParams": [ - { "Types": [ "System.String" ] } + { + "Types": [ + "System.String" + ] + } ], "Constructors": [ { @@ -134,44 +250,73 @@ "Methods": [ { "Name": "Add", - "ParamTypes": [ "T" ] + "ParamTypes": [ + "T" + ] } ] }, { "Name": "System.Collections.Generic.LinkedListNode`1", "GenericParams": [ - { "Types": [ "System.String" ] } + { + "Types": [ + "System.String" + ] + } ], "Constructors": [ { - "ParamTypes": [ "T" ] + "ParamTypes": [ + "T" + ] } ], - "Properties": [ "Value" ] + "Properties": [ + { + "Name": "Value" + } + ] }, { "Name": " System.Runtime.CompilerServices.StrongBox`1", "GenericParams": [ - { "Types": [ "System.String" ] } + { + "Types": [ + "System.String" + ] + } + ], + "Fields": [ + "Value" ], - "Fields": [ "Value" ], "Constructors": [ { - "ParamTypes": [ "T" ] + "ParamTypes": [ + "T" + ] } ] }, { "Name": "System.Collections.ObjectModel.Collection`1", "GenericParams": [ - { "Types": [ "System.Int32" ] } + { + "Types": [ + "System.Int32" + ] + } ] }, { "Name": "System.Collections.ObjectModel.KeyedCollection`2", "GenericParams": [ - { "Types": [ "System.String", "System.Int32" ] } + { + "Types": [ + "System.String", + "System.Int32" + ] + } ] } ], diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index 28807b2..e030b6d 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -43,6 +43,9 @@ void PluginMain() node.SetValue("new node val"); Debug::Log(node.GetValue()); + Collections::Generic::KeyValuePair kvp("C++ key", 3.14); + Debug::Log(kvp.GetKey()); + GameObject go("GameObject with a TestScript"); go.AddComponent(); } @@ -70,7 +73,7 @@ void MyGame::MonoBehaviours::TestScript::Update() GameObject go; Transform transform = go.GetTransform(); float comp = (float)numCreated; - Vector3 position(comp, comp, comp); + Vector3 position(comp, comp*10.0f, comp*100.0f); transform.SetPosition(position); numCreated++; if (numCreated == 10) diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index ada5ac1..de75e70 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -55,7 +55,7 @@ namespace Plugin int32_t (*UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle); int32_t (*UnityEngineComponentPropertyGetTransform)(int32_t thisHandle); UnityEngine::Vector3 (*UnityEngineTransformPropertyGetPosition)(int32_t thisHandle); - void (*UnityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3 value); + void (*UnityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value); void (*UnityEngineDebugMethodLogSystemObject)(int32_t messageHandle); System::Boolean (*UnityEngineAssertionsAssertFieldGetRaiseExceptions)(); void (*UnityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value); @@ -64,6 +64,15 @@ namespace Plugin void (*UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)(int32_t* bufferLength, int32_t* numBuffers); void (*UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)(int32_t hostId, int32_t* addressHandle, int32_t* port, uint8_t* error); void (*UnityEngineNetworkingNetworkTransportMethodInit)(); + UnityEngine::Vector3 (*UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z); + float (*UnityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz); + void (*UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ); + UnityEngine::Vector3 (*UnityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle); + void (*UnityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value); + int32_t (*UnityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble)(int32_t keyHandle, double value); + int32_t (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)(int32_t thisHandle); + double (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle); int32_t (*SystemCollectionsGenericListSystemStringConstructor)(); void (*SystemCollectionsGenericListSystemStringMethodAddSystemString)(int32_t thisHandle, int32_t itemHandle); int32_t (*SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)(int32_t valueHandle); @@ -179,6 +188,60 @@ namespace System return Handle != 0; } + ValueType::ValueType(std::nullptr_t n) + : Object(0) + { + } + + ValueType::ValueType(int32_t handle) + : Object(handle) + { + } + + ValueType::ValueType(const ValueType& other) + : Object(other) + { + } + + ValueType::ValueType(ValueType&& other) + : Object(std::forward(other)) + { + } + + ValueType::~ValueType() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + ValueType& ValueType::operator=(const ValueType& other) + { + SetHandle(other.Handle); + return *this; + } + ValueType& ValueType::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + ValueType& ValueType::operator=(ValueType&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + String::String(std::nullptr_t n) : Object(0) { @@ -610,7 +673,7 @@ namespace UnityEngine return returnValue; } - void Transform::SetPosition(UnityEngine::Vector3 value) + void Transform::SetPosition(UnityEngine::Vector3& value) { Plugin::UnityEngineTransformPropertySetPosition(Handle, value); } @@ -1016,6 +1079,188 @@ namespace UnityEngine } } +namespace UnityEngine +{ + Vector3::Vector3() + { + } + + Vector3::Vector3(float x, float y, float z) + { + auto returnValue = Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(x, y, z); + *this = returnValue; + } + + float Vector3::GetMagnitude() + { + auto returnValue = Plugin::UnityEngineVector3PropertyGetMagnitude(this); + return returnValue; + } + + void Vector3::Set(float newX, float newY, float newZ) + { + Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(this, newX, newY, newZ); + } +} + +namespace UnityEngine +{ + RaycastHit::RaycastHit(std::nullptr_t n) + : System::ValueType(0) + { + } + + RaycastHit::RaycastHit(int32_t handle) + : System::ValueType(handle) + { + } + + RaycastHit::RaycastHit(const RaycastHit& other) + : System::ValueType(other) + { + } + + RaycastHit::RaycastHit(RaycastHit&& other) + : System::ValueType(std::forward(other)) + { + } + + RaycastHit::~RaycastHit() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + RaycastHit& RaycastHit::operator=(const RaycastHit& other) + { + SetHandle(other.Handle); + return *this; + } + + RaycastHit& RaycastHit::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + RaycastHit& RaycastHit::operator=(RaycastHit&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + UnityEngine::Vector3 RaycastHit::GetPoint() + { + auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetPoint(Handle); + return returnValue; + } + + void RaycastHit::SetPoint(UnityEngine::Vector3& value) + { + Plugin::UnityEngineRaycastHitPropertySetPoint(Handle, value); + } + + UnityEngine::Transform RaycastHit::GetTransform() + { + auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetTransform(Handle); + return returnValue; + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + KeyValuePair::KeyValuePair(std::nullptr_t n) + : System::ValueType(0) + { + } + + KeyValuePair::KeyValuePair(int32_t handle) + : System::ValueType(handle) + { + } + + KeyValuePair::KeyValuePair(const KeyValuePair& other) + : System::ValueType(other) + { + } + + KeyValuePair::KeyValuePair(KeyValuePair&& other) + : System::ValueType(std::forward>(other)) + { + } + + KeyValuePair::~KeyValuePair() + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + } + + KeyValuePair& KeyValuePair::operator=(const KeyValuePair& other) + { + SetHandle(other.Handle); + return *this; + } + + KeyValuePair& KeyValuePair::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + Handle = 0; + } + return *this; + } + + KeyValuePair& KeyValuePair::operator=(KeyValuePair&& other) + { + if (Handle) + { + Plugin::DereferenceManagedObject(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + KeyValuePair::KeyValuePair(System::String key, double value) + : System::ValueType(0) + { + auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(key.Handle, value); + SetHandle(returnValue); + } + + System::String KeyValuePair::GetKey() + { + auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(Handle); + return returnValue; + } + + double KeyValuePair::GetValue() + { + auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(Handle); + return returnValue; + } + } + } +} + namespace System { namespace Collections @@ -1476,7 +1721,7 @@ DLLEXPORT void Init( int32_t (*unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle), int32_t (*unityEngineComponentPropertyGetTransform)(int32_t thisHandle), UnityEngine::Vector3 (*unityEngineTransformPropertyGetPosition)(int32_t thisHandle), - void (*unityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3 value), + void (*unityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value), void (*unityEngineDebugMethodLogSystemObject)(int32_t messageHandle), System::Boolean (*unityEngineAssertionsAssertFieldGetRaiseExceptions)(), void (*unityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value), @@ -1485,6 +1730,15 @@ DLLEXPORT void Init( void (*unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)(int32_t* bufferLength, int32_t* numBuffers), void (*unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)(int32_t hostId, int32_t* addressHandle, int32_t* port, uint8_t* error), void (*unityEngineNetworkingNetworkTransportMethodInit)(), + UnityEngine::Vector3 (*unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z), + float (*unityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz), + void (*unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ), + UnityEngine::Vector3 (*unityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle), + void (*unityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value), + int32_t (*unityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle), + int32_t (*systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble)(int32_t keyHandle, double value), + int32_t (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)(int32_t thisHandle), + double (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle), int32_t (*systemCollectionsGenericListSystemStringConstructor)(), void (*systemCollectionsGenericListSystemStringMethodAddSystemString)(int32_t thisHandle, int32_t itemHandle), int32_t (*systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)(int32_t valueHandle), @@ -1529,6 +1783,15 @@ DLLEXPORT void Init( UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32 = unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32; UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte = unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte; UnityEngineNetworkingNetworkTransportMethodInit = unityEngineNetworkingNetworkTransportMethodInit; + UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle = unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle; + UnityEngineVector3PropertyGetMagnitude = unityEngineVector3PropertyGetMagnitude; + UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle = unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle; + UnityEngineRaycastHitPropertyGetPoint = unityEngineRaycastHitPropertyGetPoint; + UnityEngineRaycastHitPropertySetPoint = unityEngineRaycastHitPropertySetPoint; + UnityEngineRaycastHitPropertyGetTransform = unityEngineRaycastHitPropertyGetTransform; + SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble = systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble; + SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey; + SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue; SystemCollectionsGenericListSystemStringConstructor = systemCollectionsGenericListSystemStringConstructor; SystemCollectionsGenericListSystemStringMethodAddSystemString = systemCollectionsGenericListSystemStringMethodAddSystemString; SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString = systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString; diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 5d98c5a..dba9430 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -34,7 +34,12 @@ namespace System } Boolean(const Boolean& other) - : Value(other.Value) + : Value(other.Value) + { + } + + Boolean(const Boolean&& other) + : Value(other.Value) { } @@ -68,55 +73,61 @@ namespace System return Value != other; } }; -} - -namespace UnityEngine -{ - struct Vector3 + + // .NET chars are two bytes long + // This struct helps them interoperate with C++'s char type + struct Char { - float x; - float y; - float z; + int16_t Value; - Vector3() - : x(0.0f) - , y(0.0f) - , z(0.0f) + Char() + : Value(0) { } - Vector3( - float x, - float y, - float z) - : x(x) - , y(y) - , z(z) + Char(const Char& other) + : Value(other.Value) { } - Vector3 operator+(const Vector3& other) + Char(const Char&& other) + : Value(other.Value) { - return { - x + other.x, - y + other.y, - z + other.z }; } - Vector3& operator=(const Vector3& other) + Char(char value) + : Value(value) { - x = other.x; - y = other.y; - z = other.z; - return *this; } - Vector3& operator+=(const Vector3& other) + Char(int16_t value) + : Value(value) { - x += other.x; - y += other.y; - z += other.z; - return *this; + } + + operator bool() const + { + return (bool)Value; + } + + bool operator==(const Char other) const + { + return Value == other.Value; + } + + bool operator!=(const Char other) const + { + return Value != other.Value; + } + + bool operator==(const char other) const + { + return Value == other; + } + + bool operator!=(const char other) const + { + return Value != other; } }; } @@ -141,6 +152,19 @@ namespace System bool operator!=(std::nullptr_t other) const; }; + struct ValueType : Object + { + ValueType(std::nullptr_t n); + ValueType(int32_t handle); + ValueType(const ValueType& other); + ValueType(ValueType&& other); + ~ValueType(); + ValueType& operator=(const ValueType& other); + ValueType& operator=(std::nullptr_t other); + ValueType& operator=(ValueType&& other); + ValueType(const char* chars); + }; + struct String : Object { String(std::nullptr_t n); @@ -227,6 +251,48 @@ namespace UnityEngine } } +namespace UnityEngine +{ + struct Vector3; +} + +namespace UnityEngine +{ + struct RaycastHit; +} + +namespace UnityEngine +{ + enum struct QueryTriggerInteraction : int32_t + { + UseGlobal = 0, + Ignore = 1, + Collide = 2 + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template struct KeyValuePair; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct KeyValuePair; + } + } +} + namespace System { namespace Collections @@ -435,7 +501,7 @@ namespace UnityEngine Transform& operator=(std::nullptr_t other); Transform& operator=(Transform&& other); UnityEngine::Vector3 GetPosition(); - void SetPosition(UnityEngine::Vector3 value); + void SetPosition(UnityEngine::Vector3& value); }; } @@ -550,6 +616,62 @@ namespace UnityEngine } } +namespace UnityEngine +{ + struct Vector3 + { + Vector3(); + Vector3(float x, float y, float z); + float GetMagnitude(); + float x; + float y; + float z; + void Set(float newX, float newY, float newZ); + }; +} + +namespace UnityEngine +{ + struct RaycastHit : System::ValueType + { + RaycastHit(std::nullptr_t n); + RaycastHit(int32_t handle); + RaycastHit(const RaycastHit& other); + RaycastHit(RaycastHit&& other); + ~RaycastHit(); + RaycastHit& operator=(const RaycastHit& other); + RaycastHit& operator=(std::nullptr_t other); + RaycastHit& operator=(RaycastHit&& other); + UnityEngine::Vector3 GetPoint(); + void SetPoint(UnityEngine::Vector3& value); + UnityEngine::Transform GetTransform(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct KeyValuePair : System::ValueType + { + KeyValuePair(std::nullptr_t n); + KeyValuePair(int32_t handle); + KeyValuePair(const KeyValuePair& other); + KeyValuePair(KeyValuePair&& other); + ~KeyValuePair(); + KeyValuePair& operator=(const KeyValuePair& other); + KeyValuePair& operator=(std::nullptr_t other); + KeyValuePair& operator=(KeyValuePair&& other); + KeyValuePair(System::String key, double value); + System::String GetKey(); + double GetValue(); + }; + } + } +} + namespace System { namespace Collections From 8486b8426b11587505f354154d0a5da7b28b1cf1 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 23 Sep 2017 11:53:35 -0700 Subject: [PATCH 04/95] Pass StructStore sizes to C++ Generate and use C++ reference/dereference functions for managed structs --- Unity/Assets/NativeScript/Bindings.cs | 24 +- .../NativeScript/Editor/GenerateBindings.cs | 367 ++++++++++++++---- Unity/CppSource/NativeScript/Bindings.cpp | 302 ++++++++------ 3 files changed, 490 insertions(+), 203 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 0f65685..82ce979 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -292,9 +292,13 @@ delegate void InitDelegate( IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3PropertyGetMagnitude, IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, + IntPtr releaseUnityEngineRaycastHit, + int ReleaseUnityEngineRaycastHit, IntPtr unityEngineRaycastHitPropertyGetPoint, IntPtr unityEngineRaycastHitPropertySetPoint, IntPtr unityEngineRaycastHitPropertyGetTransform, + IntPtr releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, + int ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue, @@ -442,9 +446,13 @@ static extern void Init( IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3PropertyGetMagnitude, IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, + IntPtr releaseUnityEngineRaycastHit, + int ReleaseUnityEngineRaycastHit, IntPtr unityEngineRaycastHitPropertyGetPoint, IntPtr unityEngineRaycastHitPropertySetPoint, IntPtr unityEngineRaycastHitPropertyGetTransform, + IntPtr releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, + int ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue, @@ -502,11 +510,11 @@ IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue 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 int ReleaseObjectUnityEngineRaycastHitDelegate(int handle); + 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 int ReleaseObjectSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate(int handle); + 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); @@ -585,9 +593,13 @@ public static void Open( 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 ReleaseUnityEngineRaycastHitDelegate(ReleaseUnityEngineRaycastHit)), + 1000, Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetPointDelegate(UnityEngineRaycastHitPropertyGetPoint)), Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertySetPointDelegate(UnityEngineRaycastHitPropertySetPoint)), Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetTransformDelegate(UnityEngineRaycastHitPropertyGetTransform)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate(ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)), + maxManagedObjects, Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate(SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)), @@ -821,8 +833,8 @@ static void UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(re thiz.Set(newX, newY, newZ); } - [MonoPInvokeCallback(typeof(ReleaseObjectUnityEngineRaycastHitDelegate))] - static void ReleaseObjectUnityEngineRaycastHit(int handle) + [MonoPInvokeCallback(typeof(ReleaseUnityEngineRaycastHitDelegate))] + static void ReleaseUnityEngineRaycastHit(int handle) { if (handle != 0) { @@ -854,8 +866,8 @@ static int UnityEngineRaycastHitPropertyGetTransform(int thisHandle) return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } - [MonoPInvokeCallback(typeof(ReleaseObjectSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate))] - static void ReleaseObjectSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int handle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate))] + static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int handle) { if (handle != 0) { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index cdd6fc4..44aae49 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -118,6 +118,10 @@ class StringBuilders new StringBuilder(InitialStringBuilderCapacity); public StringBuilder CppMonoBehaviourMessages = new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CppRefCountsStateAndFunctions = + new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CppRefCountsInit = + new StringBuilder(InitialStringBuilderCapacity); public StringBuilder TempStrBuilder = new StringBuilder(InitialStringBuilderCapacity); } @@ -134,6 +138,9 @@ class ParameterInfo enum TypeKind { + // No type (e.g. a global function) + None, + // An instance of any class Class, @@ -1066,37 +1073,40 @@ static void AppendType( builders.CsharpStructStoreInitCalls.Append( ");\n"); - // Build function name + // Build function name suffix builders.TempStrBuilder.Length = 0; - builders.TempStrBuilder.Append("ReleaseObject"); - AppendNamespace( - type.Namespace, - string.Empty, + AppendReleaseFunctionNameSuffix( + type, + typeParams, builders.TempStrBuilder); - AppendWithoutGenericTypeCountSuffix( - type.Name, + string funcNameSuffix = builders.TempStrBuilder.ToString(); + + // Build function name + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("Release"); + AppendReleaseFunctionNameSuffix( + type, + typeParams, builders.TempStrBuilder); - if (typeParams != null) - { - for (int i = 0, len = typeParams.Length; i < len; ++i) - { - Type typeParam = typeParams[i]; - AppendNamespace( - typeParam.Namespace, - string.Empty, - builders.TempStrBuilder); - AppendWithoutGenericTypeCountSuffix( - typeParam.Name, - builders.TempStrBuilder); - if (i != len - 1) - { - builders.TempStrBuilder.Append('_'); - } - } - } string funcName = builders.TempStrBuilder.ToString(); - // Build ReleaseObject parameters + // Build lowercase function name + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string funcNameLower = builders.TempStrBuilder.ToString(); + + // Ref counts array length name + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("RefCountsLen"); + builders.TempStrBuilder.Append(funcNameSuffix); + string refCountsArrayLengthName = builders.TempStrBuilder.ToString(); + + // Ref counts array length name (lowercase) + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string refCountsArrayLengthNameLower = builders.TempStrBuilder.ToString(); + + // Build ReleaseX parameters ParameterInfo paramInfo = new ParameterInfo(); paramInfo.Name = "handle"; paramInfo.ParameterType = typeof(int); @@ -1106,17 +1116,17 @@ static void AppendType( paramInfo.Kind = TypeKind.Primitive; ParameterInfo[] parameters = new[] { paramInfo }; - // ReleaseObject C# delegate type + // ReleaseX C# delegate type AppendCsharpDelegateType( funcName, true, type, typeKind, - typeof(int), + typeof(void), parameters, builders.CsharpDelegateTypes); - // ReleaseObject C# function + // ReleaseX C# function AppendCsharpFunctionBeginning( type, funcName, @@ -1137,6 +1147,119 @@ static void AppendType( ">.Remove(handle);\n\t\t\t}"); AppendCsharpFunctionEnd( builders.CsharpFunctions); + + // C++ function pointer definition + AppendCppFunctionPointerDefinition( + funcName, + true, + null, + TypeKind.None, + parameters, + typeof(void), + builders.CppFunctionPointers); + + // C++ init param for ReleaseX + AppendCppInitParam( + funcNameLower, + true, + null, + TypeKind.None, + parameters, + typeof(void), + builders.CppInitParams); + + // C++ init body for ReleaseX + AppendCppInitBody( + funcName, + funcNameLower, + builders.CppInitBody); + + // C# init param for ReleaseX + AppendCsharpInitParam( + funcNameLower, + builders.CsharpInitParams); + + // C# init call arg for ReleaseX + AppendCsharpInitCallArg( + funcName, + builders.CsharpInitCall); + + // C++ init param for handle array length + builders.CppInitParams.Append("\tint32_t "); + builders.CppInitParams.Append(refCountsArrayLengthNameLower); + builders.CppInitParams.Append(",\n"); + + // C++ init body for handle array length + AppendCppInitBody( + refCountsArrayLengthName, + refCountsArrayLengthNameLower, + builders.CppInitBody); + builders.CppInitBody.Append("\tPlugin::RefCounts"); + builders.CppInitBody.Append(funcNameSuffix); + builders.CppInitBody.Append(" = (int32_t*)calloc("); + builders.CppInitBody.Append(refCountsArrayLengthNameLower); + builders.CppInitBody.Append(", sizeof(int32_t));\n"); + + // C# init param for handle array length + builders.CsharpInitParams.Append("\t\t\tint "); + builders.CsharpInitParams.Append(funcName); + builders.CsharpInitParams.Append(",\n"); + + // C# init call arg for handle array length + builders.CsharpInitCall.Append( + "\t\t\t\t"); + if (jsonType.MaxSimultaneous > 0) + { + builders.CsharpInitCall.Append( + jsonType.MaxSimultaneous); + } + else + { + builders.CsharpInitCall.Append( + "maxManagedObjects"); + } + builders.CsharpInitCall.Append(",\n"); + + // C++ ref count state and functions + builders.CppRefCountsStateAndFunctions.Append("\tint32_t RefCountsLen"); + builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); + builders.CppRefCountsStateAndFunctions.Append(";\n\tint32_t* RefCounts"); + builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); + builders.CppRefCountsStateAndFunctions.Append(";\n\t\n\tvoid ReferenceManaged"); + builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); + builders.CppRefCountsStateAndFunctions.Append("(int32_t handle)\n"); + builders.CppRefCountsStateAndFunctions.Append("\t{\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\tassert(handle >= 0 && handle < RefCountsLen"); + builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); + builders.CppRefCountsStateAndFunctions.Append(");\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\tif (handle != 0)\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\t{\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\t\tRefCounts"); + builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); + builders.CppRefCountsStateAndFunctions.Append("[handle]++;\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\t}\n"); + builders.CppRefCountsStateAndFunctions.Append("\t}\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\n"); + builders.CppRefCountsStateAndFunctions.Append("\tvoid DereferenceManaged"); + builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); + builders.CppRefCountsStateAndFunctions.Append("(int32_t handle)\n"); + builders.CppRefCountsStateAndFunctions.Append("\t{\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\tassert(handle >= 0 && handle < RefCountsLen"); + builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); + builders.CppRefCountsStateAndFunctions.Append(");\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\tif (handle != 0)\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\t{\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\t\tint32_t numRemain = --RefCounts"); + builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); + builders.CppRefCountsStateAndFunctions.Append("[handle];\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\t\tif (numRemain == 0)\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\t\t{\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\t\t\tRelease"); + builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); + builders.CppRefCountsStateAndFunctions.Append("(handle);\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\t\t}\n"); + builders.CppRefCountsStateAndFunctions.Append("\t\t}\n"); + builders.CppRefCountsStateAndFunctions.Append("\t}\n\t\n"); } // C++ type declaration @@ -1159,6 +1282,7 @@ static void AppendType( // C++ method definition int cppMethodDefinitionsIndent = AppendCppMethodDefinitionBegin( type, + typeKind, typeParams, type.BaseType, isStatic, @@ -1269,6 +1393,38 @@ static void AppendType( builders.CppMethodDefinitions); } + static void AppendReleaseFunctionNameSuffix( + Type type, + Type[] typeParams, + StringBuilder output) + { + AppendNamespace( + type.Namespace, + string.Empty, + output); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + if (typeParams != null) + { + for (int i = 0, len = typeParams.Length; i < len; ++i) + { + Type typeParam = typeParams[i]; + AppendNamespace( + typeParam.Namespace, + string.Empty, + output); + AppendWithoutGenericTypeCountSuffix( + typeParam.Name, + output); + if (i != len - 1) + { + output.Append('_'); + } + } + } + } + static void AppendEnum( Type type, Assembly[] assemblies, @@ -2146,6 +2302,7 @@ static void AppendMonoBehaviour( // C++ method definition int cppMethodDefinitionsIndent = AppendCppMethodDefinitionBegin( type, + TypeKind.Class, null, typeof(MonoBehaviour), false, @@ -3052,17 +3209,20 @@ static void AppendCppTypeDefinitionEnd( } static int AppendCppMethodDefinitionBegin( - Type type, - Type[] typeParams, + Type enclosingType, + TypeKind enclosingTypeKind, + Type[] enclosingTypeParams, Type baseType, bool isStatic, int indent, StringBuilder output) { int cppMethodDefinitionsIndent = AppendNamespaceBeginning( - type.Namespace, + enclosingType.Namespace, output); - if (!isStatic && !IsFullValueType(type)) + if (!isStatic && ( + enclosingTypeKind == TypeKind.Class + || enclosingTypeKind == TypeKind.ManagedStruct)) { if (baseType == null) { @@ -3072,14 +3232,14 @@ static int AppendCppMethodDefinitionBegin( // Construct with nullptr_t AppendIndent(indent, output); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("::"); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); output.Append("(std::nullptr_t n)\n"); AppendIndent(indent, output); @@ -3098,14 +3258,14 @@ static int AppendCppMethodDefinitionBegin( // Construct with handle AppendIndent(indent, output); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("::"); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); output.Append("(int32_t handle)\n"); AppendIndent(indent, output); @@ -3124,21 +3284,21 @@ static int AppendCppMethodDefinitionBegin( // Copy constructor AppendIndent(indent, output); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("::"); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); output.Append("(const "); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("& other)\n"); AppendIndent(indent, output); @@ -3157,21 +3317,21 @@ static int AppendCppMethodDefinitionBegin( // Move constructor AppendIndent(indent, output); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("::"); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); output.Append("("); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("&& other)\n"); AppendIndent(indent, output); @@ -3181,10 +3341,10 @@ static int AppendCppMethodDefinitionBegin( output); output.Append("(std::forward<"); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append(">(other))\n"); AppendIndent(indent, output); @@ -3197,17 +3357,17 @@ static int AppendCppMethodDefinitionBegin( // Destructor AppendIndent(indent, output); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("::~"); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("()\n"); AppendIndent(indent, output); @@ -3217,7 +3377,13 @@ static int AppendCppMethodDefinitionBegin( AppendIndent(indent, output); output.Append("\t{\n"); AppendIndent(indent, output); - output.Append("\t\tPlugin::DereferenceManagedObject(Handle);\n"); + output.Append("\t\t"); + AppendDereferenceManagedHandleFunctionCall( + enclosingType, + enclosingTypeKind, + enclosingTypeParams, + output); + output.Append(";\n"); AppendIndent(indent, output); output.Append("\t}\n"); AppendIndent(indent, output); @@ -3228,24 +3394,24 @@ static int AppendCppMethodDefinitionBegin( // Assignment operator to same type AppendIndent(indent, output); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("& "); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("::operator=(const "); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("& other)\n"); AppendIndent(indent, output); @@ -3262,17 +3428,17 @@ static int AppendCppMethodDefinitionBegin( // Assignment operator to nullptr_t AppendIndent(indent, output); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("& "); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("::operator=(std::nullptr_t other)\n"); AppendIndent(indent, output); @@ -3282,7 +3448,13 @@ static int AppendCppMethodDefinitionBegin( AppendIndent(indent, output); output.Append("\t{\n"); AppendIndent(indent, output); - output.Append("\t\tPlugin::DereferenceManagedObject(Handle);\n"); + output.Append("\t\t"); + AppendDereferenceManagedHandleFunctionCall( + enclosingType, + enclosingTypeKind, + enclosingTypeParams, + output); + output.Append(";\n"); AppendIndent(indent, output); output.Append("\t\tHandle = 0;\n"); AppendIndent(indent, output); @@ -3297,24 +3469,24 @@ static int AppendCppMethodDefinitionBegin( // Move assignment operator to same type AppendIndent(indent, output); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("& "); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("::operator=("); AppendWithoutGenericTypeCountSuffix( - type.Name, + enclosingType.Name, output); AppendCppTypeParameters( - typeParams, + enclosingTypeParams, output); output.Append("&& other)\n"); AppendIndent(indent, output); @@ -3324,7 +3496,13 @@ static int AppendCppMethodDefinitionBegin( AppendIndent(indent, output); output.Append("\t{\n"); AppendIndent(indent, output); - output.Append("\t\tPlugin::DereferenceManagedObject(Handle);\n"); + output.Append("\t\t"); + AppendDereferenceManagedHandleFunctionCall( + enclosingType, + enclosingTypeKind, + enclosingTypeParams, + output); + output.Append(";\n"); AppendIndent(indent, output); output.Append("\t}\n"); AppendIndent(indent, output); @@ -3341,6 +3519,27 @@ static int AppendCppMethodDefinitionBegin( return cppMethodDefinitionsIndent; } + static void AppendDereferenceManagedHandleFunctionCall( + Type enclosingType, + TypeKind enclosingTypeKind, + Type[] enclosingTypeParams, + StringBuilder output) + { + if (enclosingTypeKind == TypeKind.ManagedStruct) + { + output.Append("Plugin::DereferenceManaged"); + AppendReleaseFunctionNameSuffix( + enclosingType, + enclosingTypeParams, + output); + output.Append("(Handle)"); + } + else + { + output.Append("Plugin::DereferenceManagedClass(Handle)"); + } + } + static void AppendCppMethodDefinitionEnd( int indent, StringBuilder output) @@ -3825,14 +4024,14 @@ static void AppendParameterCall( } static void AppendCppInitBody( - string funcName, - string funcNameLower, + string globalVariableName, + string paramName, StringBuilder output) { - output.Append('\t'); - output.Append(funcName); + output.Append("\tPlugin::"); + output.Append(globalVariableName); output.Append(" = "); - output.Append(funcNameLower); + output.Append(paramName); output.Append(";\n"); } @@ -4562,6 +4761,16 @@ static void InjectBuilders( "/*BEGIN MONOBEHAVIOUR MESSAGES*/\n", "\n/*END MONOBEHAVIOUR MESSAGES*/", builders.CppMonoBehaviourMessages.ToString()); + cppSourceContents = InjectIntoString( + cppSourceContents, + "/*BEGIN REF COUNTS STATE AND FUNCTIONS*/\n", + "\n\t/*END REF COUNTS STATE AND FUNCTIONS*/", + builders.CppRefCountsStateAndFunctions.ToString()); + cppSourceContents = InjectIntoString( + cppSourceContents, + "/*BEGIN REF COUNTS INIT*/\n", + "\n\t/*END REF COUNTS INIT*/", + builders.CppRefCountsInit.ToString()); File.WriteAllText(CsharpPath, csharpContents); File.WriteAllText(CppHeaderPath, cppHeaderContents); diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index de75e70..22c60c7 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -67,9 +67,11 @@ namespace Plugin UnityEngine::Vector3 (*UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z); float (*UnityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz); void (*UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ); + void (*ReleaseUnityEngineRaycastHit)(int32_t handle); UnityEngine::Vector3 (*UnityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle); void (*UnityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value); int32_t (*UnityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle); + void (*ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)(int32_t handle); int32_t (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble)(int32_t keyHandle, double value); int32_t (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)(int32_t thisHandle); double (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle); @@ -90,30 +92,84 @@ namespace Plugin namespace Plugin { - int32_t managedObjectsRefCountLen; - int32_t* managedObjectRefCounts; + int32_t RefCountsLenClass; + int32_t* RefCountsClass; - void ReferenceManagedObject(int32_t handle) + void ReferenceManagedClass(int32_t handle) { - assert(handle >= 0 && handle < managedObjectsRefCountLen); + assert(handle >= 0 && handle < RefCountsLenClass); if (handle != 0) { - managedObjectRefCounts[handle]++; + RefCountsClass[handle]++; } } - void DereferenceManagedObject(int32_t handle) + void DereferenceManagedClass(int32_t handle) { - assert(handle >= 0 && handle < managedObjectsRefCountLen); + assert(handle >= 0 && handle < RefCountsLenClass); if (handle != 0) { - int32_t numRemain = --managedObjectRefCounts[handle]; + int32_t numRemain = --RefCountsClass[handle]; if (numRemain == 0) { ReleaseObject(handle); } } } + + /*BEGIN REF COUNTS STATE AND FUNCTIONS*/ + int32_t RefCountsLenUnityEngineRaycastHit; + int32_t* RefCountsUnityEngineRaycastHit; + + void ReferenceManagedUnityEngineRaycastHit(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineRaycastHit); + if (handle != 0) + { + RefCountsUnityEngineRaycastHit[handle]++; + } + } + + void DereferenceManagedUnityEngineRaycastHit(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineRaycastHit); + if (handle != 0) + { + int32_t numRemain = --RefCountsUnityEngineRaycastHit[handle]; + if (numRemain == 0) + { + ReleaseUnityEngineRaycastHit(handle); + } + } + } + + int32_t RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; + int32_t* RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; + + void ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble); + if (handle != 0) + { + RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble[handle]++; + } + } + + void DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble); + if (handle != 0) + { + int32_t numRemain = --RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble[handle]; + if (numRemain == 0) + { + ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(handle); + } + } + } + + + /*END REF COUNTS STATE AND FUNCTIONS*/ } //////////////////////////////////////////////////////////////// @@ -128,7 +184,7 @@ namespace System Handle = handle; if (handle) { - Plugin::ReferenceManagedObject(handle); + Plugin::ReferenceManagedClass(handle); } } @@ -137,7 +193,7 @@ namespace System Handle = other.Handle; if (Handle) { - Plugin::ReferenceManagedObject(Handle); + Plugin::ReferenceManagedClass(Handle); } } @@ -153,12 +209,12 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = handle; if (handle) { - Plugin::ReferenceManagedObject(handle); + Plugin::ReferenceManagedClass(handle); } } } @@ -212,7 +268,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -225,7 +281,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -235,7 +291,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -266,7 +322,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -279,7 +335,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -289,7 +345,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -331,7 +387,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -345,7 +401,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -355,7 +411,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -413,7 +469,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -427,7 +483,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -437,7 +493,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -482,7 +538,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -496,7 +552,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -506,7 +562,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -572,7 +628,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -586,7 +642,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -596,7 +652,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -636,7 +692,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -650,7 +706,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -660,7 +716,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -705,7 +761,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -719,7 +775,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -729,7 +785,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -795,7 +851,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -809,7 +865,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -819,7 +875,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -853,7 +909,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -867,7 +923,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -877,7 +933,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -911,7 +967,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -925,7 +981,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -935,7 +991,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -969,7 +1025,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -983,7 +1039,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -993,7 +1049,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -1034,7 +1090,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -1048,7 +1104,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -1058,7 +1114,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -1129,7 +1185,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); } } @@ -1143,7 +1199,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); Handle = 0; } return *this; @@ -1153,7 +1209,7 @@ namespace UnityEngine { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); } Handle = other.Handle; other.Handle = 0; @@ -1208,7 +1264,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); } } @@ -1222,7 +1278,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); Handle = 0; } return *this; @@ -1232,7 +1288,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); } Handle = other.Handle; other.Handle = 0; @@ -1291,7 +1347,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -1305,7 +1361,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -1315,7 +1371,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -1367,7 +1423,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -1381,7 +1437,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -1391,7 +1447,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -1449,7 +1505,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -1463,7 +1519,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -1473,7 +1529,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -1531,7 +1587,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -1545,7 +1601,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -1555,7 +1611,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -1595,7 +1651,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -1609,7 +1665,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -1619,7 +1675,7 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -1657,7 +1713,7 @@ namespace MyGame { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } } @@ -1671,7 +1727,7 @@ namespace MyGame { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; @@ -1681,7 +1737,7 @@ namespace MyGame { if (Handle) { - Plugin::DereferenceManagedObject(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; @@ -1733,9 +1789,13 @@ DLLEXPORT void Init( UnityEngine::Vector3 (*unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z), float (*unityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz), void (*unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ), + void (*releaseUnityEngineRaycastHit)(int32_t handle), + int32_t refCountsLenUnityEngineRaycastHit, UnityEngine::Vector3 (*unityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle), void (*unityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value), int32_t (*unityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle), + void (*releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)(int32_t handle), + int32_t refCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, int32_t (*systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble)(int32_t keyHandle, double value), int32_t (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)(int32_t thisHandle), double (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle), @@ -1752,54 +1812,60 @@ DLLEXPORT void Init( using namespace Plugin; // Init managed object ref counting - managedObjectsRefCountLen = maxManagedObjects; - managedObjectRefCounts = (int32_t*)calloc( + Plugin::RefCountsLenClass = maxManagedObjects; + Plugin::RefCountsClass = (int32_t*)calloc( maxManagedObjects, sizeof(int32_t)); // Init pointers to C# functions - StringNew = stringNew; - ReleaseObject = releaseObject; + Plugin::StringNew = stringNew; + Plugin::ReleaseObject = releaseObject; /*BEGIN INIT BODY*/ - SystemDiagnosticsStopwatchConstructor = systemDiagnosticsStopwatchConstructor; - SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds = systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds; - SystemDiagnosticsStopwatchMethodStart = systemDiagnosticsStopwatchMethodStart; - SystemDiagnosticsStopwatchMethodReset = systemDiagnosticsStopwatchMethodReset; - UnityEngineObjectPropertyGetName = unityEngineObjectPropertyGetName; - UnityEngineObjectPropertySetName = unityEngineObjectPropertySetName; - UnityEngineGameObjectConstructor = unityEngineGameObjectConstructor; - UnityEngineGameObjectConstructorSystemString = unityEngineGameObjectConstructorSystemString; - UnityEngineGameObjectPropertyGetTransform = unityEngineGameObjectPropertyGetTransform; - UnityEngineGameObjectMethodFindSystemString = unityEngineGameObjectMethodFindSystemString; - UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript = unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript; - UnityEngineComponentPropertyGetTransform = unityEngineComponentPropertyGetTransform; - UnityEngineTransformPropertyGetPosition = unityEngineTransformPropertyGetPosition; - UnityEngineTransformPropertySetPosition = unityEngineTransformPropertySetPosition; - UnityEngineDebugMethodLogSystemObject = unityEngineDebugMethodLogSystemObject; - UnityEngineAssertionsAssertFieldGetRaiseExceptions = unityEngineAssertionsAssertFieldGetRaiseExceptions; - UnityEngineAssertionsAssertFieldSetRaiseExceptions = unityEngineAssertionsAssertFieldSetRaiseExceptions; - UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString = unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString; - UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject = unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject; - UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32 = unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32; - UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte = unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte; - UnityEngineNetworkingNetworkTransportMethodInit = unityEngineNetworkingNetworkTransportMethodInit; - UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle = unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle; - UnityEngineVector3PropertyGetMagnitude = unityEngineVector3PropertyGetMagnitude; - UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle = unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle; - UnityEngineRaycastHitPropertyGetPoint = unityEngineRaycastHitPropertyGetPoint; - UnityEngineRaycastHitPropertySetPoint = unityEngineRaycastHitPropertySetPoint; - UnityEngineRaycastHitPropertyGetTransform = unityEngineRaycastHitPropertyGetTransform; - SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble = systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble; - SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey; - SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue; - SystemCollectionsGenericListSystemStringConstructor = systemCollectionsGenericListSystemStringConstructor; - SystemCollectionsGenericListSystemStringMethodAddSystemString = systemCollectionsGenericListSystemStringMethodAddSystemString; - SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString = systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString; - SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue = systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue; - SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue = systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue; - SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString = systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString; - SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue; - SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue; + Plugin::SystemDiagnosticsStopwatchConstructor = systemDiagnosticsStopwatchConstructor; + Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds = systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds; + Plugin::SystemDiagnosticsStopwatchMethodStart = systemDiagnosticsStopwatchMethodStart; + Plugin::SystemDiagnosticsStopwatchMethodReset = systemDiagnosticsStopwatchMethodReset; + Plugin::UnityEngineObjectPropertyGetName = unityEngineObjectPropertyGetName; + Plugin::UnityEngineObjectPropertySetName = unityEngineObjectPropertySetName; + Plugin::UnityEngineGameObjectConstructor = unityEngineGameObjectConstructor; + Plugin::UnityEngineGameObjectConstructorSystemString = unityEngineGameObjectConstructorSystemString; + Plugin::UnityEngineGameObjectPropertyGetTransform = unityEngineGameObjectPropertyGetTransform; + Plugin::UnityEngineGameObjectMethodFindSystemString = unityEngineGameObjectMethodFindSystemString; + Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript = unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript; + Plugin::UnityEngineComponentPropertyGetTransform = unityEngineComponentPropertyGetTransform; + Plugin::UnityEngineTransformPropertyGetPosition = unityEngineTransformPropertyGetPosition; + Plugin::UnityEngineTransformPropertySetPosition = unityEngineTransformPropertySetPosition; + Plugin::UnityEngineDebugMethodLogSystemObject = unityEngineDebugMethodLogSystemObject; + Plugin::UnityEngineAssertionsAssertFieldGetRaiseExceptions = unityEngineAssertionsAssertFieldGetRaiseExceptions; + Plugin::UnityEngineAssertionsAssertFieldSetRaiseExceptions = unityEngineAssertionsAssertFieldSetRaiseExceptions; + Plugin::UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString = unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString; + Plugin::UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject = unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject; + Plugin::UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32 = unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32; + Plugin::UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte = unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte; + Plugin::UnityEngineNetworkingNetworkTransportMethodInit = unityEngineNetworkingNetworkTransportMethodInit; + Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle = unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle; + Plugin::UnityEngineVector3PropertyGetMagnitude = unityEngineVector3PropertyGetMagnitude; + Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle = unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle; + Plugin::ReleaseUnityEngineRaycastHit = releaseUnityEngineRaycastHit; + Plugin::RefCountsLenUnityEngineRaycastHit = refCountsLenUnityEngineRaycastHit; + Plugin::RefCountsUnityEngineRaycastHit = (int32_t*)calloc(refCountsLenUnityEngineRaycastHit, sizeof(int32_t)); + Plugin::UnityEngineRaycastHitPropertyGetPoint = unityEngineRaycastHitPropertyGetPoint; + Plugin::UnityEngineRaycastHitPropertySetPoint = unityEngineRaycastHitPropertySetPoint; + Plugin::UnityEngineRaycastHitPropertyGetTransform = unityEngineRaycastHitPropertyGetTransform; + Plugin::ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; + Plugin::RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = refCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; + Plugin::RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = (int32_t*)calloc(refCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, sizeof(int32_t)); + Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble = systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble; + Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey; + Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue; + Plugin::SystemCollectionsGenericListSystemStringConstructor = systemCollectionsGenericListSystemStringConstructor; + Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString = systemCollectionsGenericListSystemStringMethodAddSystemString; + Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString = systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString; + Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue = systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue; + Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue = systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue; + Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString = systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString; + Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue; + Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue; /*END INIT BODY*/ PluginMain(); From 838f19855d4bd3ebf6d67ce48b4c4acf3f5adb54 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 23 Sep 2017 13:11:08 -0700 Subject: [PATCH 05/95] Forward unhandled C++ exceptions to C# --- Unity/Assets/NativeScript/Bindings.cs | 64 +++++++- .../NativeScript/Editor/GenerateBindings.cs | 53 ++++++- Unity/Assets/NativeScriptTypes.json | 10 ++ Unity/CppSource/NativeScript/Bindings.cpp | 146 +++++++++++++++++- Unity/CppSource/NativeScript/Bindings.h | 21 +++ 5 files changed, 278 insertions(+), 16 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 82ce979..42714d4 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -266,6 +266,7 @@ delegate void InitDelegate( int maxManagedObjects, IntPtr releaseObject, IntPtr stringNew, + IntPtr setException, /*BEGIN INIT PARAMS*/ IntPtr systemDiagnosticsStopwatchConstructor, IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds, @@ -309,7 +310,8 @@ delegate void InitDelegate( IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue, IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString, IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue, - IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue + IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue, + IntPtr systemExceptionConstructorSystemString /*END INIT PARAMS*/); /*BEGIN MONOBEHAVIOUR DELEGATES*/ @@ -420,6 +422,7 @@ static extern void Init( int maxManagedObjects, IntPtr releaseObject, IntPtr stringNew, + IntPtr setException, /*BEGIN INIT PARAMS*/ IntPtr systemDiagnosticsStopwatchConstructor, IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds, @@ -463,7 +466,8 @@ static extern void Init( IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue, IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString, IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue, - IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue + IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue, + IntPtr systemExceptionConstructorSystemString /*END INIT PARAMS*/); /*BEGIN MONOBEHAVIOUR IMPORTS*/ @@ -483,6 +487,7 @@ IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue delegate void ReleaseObjectDelegate(int handle); delegate int StringNewDelegate(string chars); + delegate void SetExceptionDelegate(int handle); /*BEGIN DELEGATE TYPES*/ delegate int SystemDiagnosticsStopwatchConstructorDelegate(); @@ -526,8 +531,11 @@ IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue delegate int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate(int valueHandle); delegate int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate(int thisHandle); delegate void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate(int thisHandle, int valueHandle); + delegate int SystemExceptionConstructorSystemStringDelegate(int messageHandle); /*END DELEGATE TYPES*/ + public static Exception UnhandledCppException; + /// /// Open the C++ plugin and call its PluginMain() /// @@ -567,6 +575,7 @@ public static void Open( maxManagedObjects, Marshal.GetFunctionPointerForDelegate(new ReleaseObjectDelegate(ReleaseObject)), Marshal.GetFunctionPointerForDelegate(new StringNewDelegate(StringNew)), + Marshal.GetFunctionPointerForDelegate(new SetExceptionDelegate(SetException)), /*BEGIN INIT CALL*/ Marshal.GetFunctionPointerForDelegate(new SystemDiagnosticsStopwatchConstructorDelegate(SystemDiagnosticsStopwatchConstructor)), Marshal.GetFunctionPointerForDelegate(new SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate(SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)), @@ -610,9 +619,16 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate(SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue)), Marshal.GetFunctionPointerForDelegate(new SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate(SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString)), Marshal.GetFunctionPointerForDelegate(new SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)), - Marshal.GetFunctionPointerForDelegate(new SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)) + Marshal.GetFunctionPointerForDelegate(new SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)), + Marshal.GetFunctionPointerForDelegate(new SystemExceptionConstructorSystemStringDelegate(SystemExceptionConstructorSystemString)) /*END INIT CALL*/ ); + if (UnhandledCppException != null) + { + Exception ex = UnhandledCppException; + UnhandledCppException = null; + throw new Exception("Unhandled C++ exception in Init", ex); + } } /// @@ -636,7 +652,7 @@ static void ReleaseObject( { if (handle != 0) { - NativeScript.Bindings.ObjectStore.Remove(handle); + ObjectStore.Remove(handle); } } @@ -644,10 +660,16 @@ static void ReleaseObject( static int StringNew( string chars) { - int handle = NativeScript.Bindings.ObjectStore.Store(chars); + int handle = ObjectStore.Store(chars); return handle; } + [MonoPInvokeCallback(typeof(SetExceptionDelegate))] + static void SetException(int handle) + { + UnhandledCppException = ObjectStore.Get(handle) as Exception; + } + /*BEGIN FUNCTIONS*/ [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchConstructorDelegate))] static int SystemDiagnosticsStopwatchConstructor() @@ -961,6 +983,14 @@ static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); thiz.Value = value; } + + [MonoPInvokeCallback(typeof(SystemExceptionConstructorSystemStringDelegate))] + static int SystemExceptionConstructorSystemString(int messageHandle) + { + var message = (string)NativeScript.Bindings.ObjectStore.Get(messageHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Exception(message)); + return returnValue; + } /*END FUNCTIONS*/ } } @@ -982,22 +1012,46 @@ public TestScript() public void Awake() { NativeScript.Bindings.TestScriptAwake(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } } public void OnAnimatorIK(int param0) { NativeScript.Bindings.TestScriptOnAnimatorIK(thisHandle, param0); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } } public void OnCollisionEnter(UnityEngine.Collision param0) { int param0Handle = NativeScript.Bindings.ObjectStore.Store(param0); NativeScript.Bindings.TestScriptOnCollisionEnter(thisHandle, param0Handle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } } public void Update() { NativeScript.Bindings.TestScriptUpdate(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } } } } diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 44aae49..b81212d 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -203,10 +203,10 @@ public MessageInfo( new MessageInfo("Awake"), new MessageInfo("FixedUpdate"), new MessageInfo("LateUpdate"), - new MessageInfo("OnAnimatorIK",typeof(int)), + new MessageInfo("OnAnimatorIK", typeof(int)), new MessageInfo("OnAnimatorMove"), - new MessageInfo("OnApplicationFocus",typeof(bool)), - new MessageInfo("OnApplicationPause",typeof(bool)), + new MessageInfo("OnApplicationFocus", typeof(bool)), + new MessageInfo("OnApplicationPause", typeof(bool)), new MessageInfo("OnApplicationQuit"), // TODO re-enable when arrays are supported // new MessageInfo("OnAudioFilterRead", typeof(float[]), typeof(int)), @@ -2466,6 +2466,30 @@ static void AppendMonoBehaviour( } } builders.CsharpMonoBehaviours.Append(");\n"); + AppendIndent( + csharpIndent + 2, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("if (NativeScript.Bindings.UnhandledCppException != null)\n"); + AppendIndent( + csharpIndent + 2, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("{\n"); + AppendIndent( + csharpIndent + 3, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("Exception ex = NativeScript.Bindings.UnhandledCppException;\n"); + AppendIndent( + csharpIndent + 3, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("NativeScript.Bindings.UnhandledCppException = null;\n"); + AppendIndent( + csharpIndent + 3, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("throw ex;\n"); + AppendIndent( + csharpIndent + 2, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append("}\n"); AppendIndent( csharpIndent + 1, builders.CsharpMonoBehaviours); @@ -2622,7 +2646,9 @@ static void AppendMonoBehaviour( builders.CppMonoBehaviourMessages.Append("Handle);\n"); } } - builders.CppMonoBehaviourMessages.Append("\tthiz."); + builders.CppMonoBehaviourMessages.Append("\ttry\n"); + builders.CppMonoBehaviourMessages.Append("\t{\n"); + builders.CppMonoBehaviourMessages.Append("\t\tthiz."); builders.CppMonoBehaviourMessages.Append(messageInfo.Name); builders.CppMonoBehaviourMessages.Append("("); for (int i = 0; i < numParams; ++i) @@ -2634,7 +2660,24 @@ static void AppendMonoBehaviour( builders.CppMonoBehaviourMessages.Append(", "); } } - builders.CppMonoBehaviourMessages.Append(");\n}\n\n"); + builders.CppMonoBehaviourMessages.Append(");\n"); + builders.CppMonoBehaviourMessages.Append("\t}\n"); + builders.CppMonoBehaviourMessages.Append("\tcatch (System::Exception ex)\n"); + builders.CppMonoBehaviourMessages.Append("\t{\n"); + builders.CppMonoBehaviourMessages.Append("\t\tPlugin::SetException(ex.Handle);\n"); + builders.CppMonoBehaviourMessages.Append("\t}\n"); + builders.CppMonoBehaviourMessages.Append("\tcatch (...)\n"); + builders.CppMonoBehaviourMessages.Append("\t{\n"); + builders.CppMonoBehaviourMessages.Append("\t\tSystem::Exception ex(System::String(\"Unhandled exception in "); + AppendCppTypeName( + type, + builders.CppMonoBehaviourMessages); + builders.CppMonoBehaviourMessages.Append("::"); + builders.CppMonoBehaviourMessages.Append(messageInfo.Name); + builders.CppMonoBehaviourMessages.Append("\"));\n"); + builders.CppMonoBehaviourMessages.Append("\t\tPlugin::SetException(ex.Handle);\n"); + builders.CppMonoBehaviourMessages.Append("\t}\n"); + builders.CppMonoBehaviourMessages.Append("}\n\n\n"); } // C# Class extending MonoBehaviour (end) diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index b375aa6..b25e613 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -318,6 +318,16 @@ ] } ] + }, + { + "Name": "System.Exception", + "Constructors": [ + { + "ParamTypes": [ + "System.String" + ] + } + ] } ], "MonoBehaviours": [ diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 22c60c7..f54a654 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -38,6 +38,7 @@ namespace Plugin { void (*ReleaseObject)(int32_t handle); + void (*SetException)(int32_t handle); int32_t (*StringNew)(const char* chars); @@ -83,6 +84,7 @@ namespace Plugin int32_t (*SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString)(int32_t valueHandle); int32_t (*SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)(int32_t thisHandle); void (*SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)(int32_t thisHandle, int32_t valueHandle); + int32_t (*SystemExceptionConstructorSystemString)(int32_t messageHandle); /*END FUNCTION POINTERS*/ } @@ -1685,6 +1687,71 @@ namespace System } } +namespace System +{ + Exception::Exception(std::nullptr_t n) + : System::Object(0) + { + } + + Exception::Exception(int32_t handle) + : System::Object(handle) + { + } + + Exception::Exception(const Exception& other) + : System::Object(other) + { + } + + Exception::Exception(Exception&& other) + : System::Object(std::forward(other)) + { + } + + Exception::~Exception() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + } + + Exception& Exception::operator=(const Exception& other) + { + SetHandle(other.Handle); + return *this; + } + + Exception& Exception::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Exception& Exception::operator=(Exception&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + Exception::Exception(System::String message) + : System::Object(0) + { + auto returnValue = Plugin::SystemExceptionConstructorSystemString(message.Handle); + SetHandle(returnValue); + } +} + namespace MyGame { namespace MonoBehaviours @@ -1763,6 +1830,7 @@ DLLEXPORT void Init( int32_t maxManagedObjects, void (*releaseObject)(int32_t handle), int32_t (*stringNew)(const char* chars), + void (*setException)(int32_t handle), /*BEGIN INIT PARAMS*/ int32_t (*systemDiagnosticsStopwatchConstructor)(), int64_t (*systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle), @@ -1806,7 +1874,8 @@ DLLEXPORT void Init( void (*systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue)(int32_t thisHandle, int32_t valueHandle), int32_t (*systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString)(int32_t valueHandle), int32_t (*systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)(int32_t thisHandle), - void (*systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)(int32_t thisHandle, int32_t valueHandle) + void (*systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)(int32_t thisHandle, int32_t valueHandle), + int32_t (*systemExceptionConstructorSystemString)(int32_t messageHandle) /*END INIT PARAMS*/) { using namespace Plugin; @@ -1820,6 +1889,7 @@ DLLEXPORT void Init( // Init pointers to C# functions Plugin::StringNew = stringNew; Plugin::ReleaseObject = releaseObject; + Plugin::SetException = setException; /*BEGIN INIT BODY*/ Plugin::SystemDiagnosticsStopwatchConstructor = systemDiagnosticsStopwatchConstructor; Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds = systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds; @@ -1866,34 +1936,98 @@ DLLEXPORT void Init( Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString = systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString; Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue; Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue; + Plugin::SystemExceptionConstructorSystemString = systemExceptionConstructorSystemString; /*END INIT BODY*/ - PluginMain(); + try + { + PluginMain(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::Exception ex(System::String("Unhandled exception in PluginMain")); + Plugin::SetException(ex.Handle); + } } /*BEGIN MONOBEHAVIOUR MESSAGES*/ DLLEXPORT void TestScriptAwake(int32_t thisHandle) { MyGame::MonoBehaviours::TestScript thiz(thisHandle); - thiz.Awake(); + try + { + thiz.Awake(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::Exception ex(System::String("Unhandled exception in MyGame::MonoBehaviours::TestScript::Awake")); + Plugin::SetException(ex.Handle); + } } + DLLEXPORT void TestScriptOnAnimatorIK(int32_t thisHandle, int32_t param0) { MyGame::MonoBehaviours::TestScript thiz(thisHandle); - thiz.OnAnimatorIK(param0); + try + { + thiz.OnAnimatorIK(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::Exception ex(System::String("Unhandled exception in MyGame::MonoBehaviours::TestScript::OnAnimatorIK")); + Plugin::SetException(ex.Handle); + } } + DLLEXPORT void TestScriptOnCollisionEnter(int32_t thisHandle, int32_t param0Handle) { MyGame::MonoBehaviours::TestScript thiz(thisHandle); UnityEngine::Collision param0(param0Handle); - thiz.OnCollisionEnter(param0); + try + { + thiz.OnCollisionEnter(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::Exception ex(System::String("Unhandled exception in MyGame::MonoBehaviours::TestScript::OnCollisionEnter")); + Plugin::SetException(ex.Handle); + } } + DLLEXPORT void TestScriptUpdate(int32_t thisHandle) { MyGame::MonoBehaviours::TestScript thiz(thisHandle); - thiz.Update(); + try + { + thiz.Update(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::Exception ex(System::String("Unhandled exception in MyGame::MonoBehaviours::TestScript::Update")); + Plugin::SetException(ex.Handle); + } } /*END MONOBEHAVIOUR MESSAGES*/ diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index dba9430..03befe9 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -403,6 +403,11 @@ namespace System } } +namespace System +{ + struct Exception; +} + namespace MyGame { namespace MonoBehaviours @@ -785,6 +790,22 @@ namespace System } } +namespace System +{ + struct Exception : System::Object + { + Exception(std::nullptr_t n); + Exception(int32_t handle); + Exception(const Exception& other); + Exception(Exception&& other); + ~Exception(); + Exception& operator=(const Exception& other); + Exception& operator=(std::nullptr_t other); + Exception& operator=(Exception&& other); + Exception(System::String message); + }; +} + namespace MyGame { namespace MonoBehaviours From 0d7e4a9ac00f0078e1a06d06c431d115fb42554c Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 23 Sep 2017 14:54:17 -0700 Subject: [PATCH 06/95] Make C++ use the right reference functions to avoid collision with classes Eliminate some System::Object and System::ValueType base functionality in favor of derived types Add equality and inequality operators to C++ types Lookup MonoBehaviour instances on-demand to avoid invalid handles if ref count drops to zero Drop dependency on the C++ utility header --- Unity/Assets/NativeScript/Bindings.cs | 68 +- .../NativeScript/Editor/GenerateBindings.cs | 351 +++++-- Unity/CppSource/NativeScript/Bindings.cpp | 924 +++++++++++++++--- Unity/CppSource/NativeScript/Bindings.h | 53 +- 4 files changed, 1120 insertions(+), 276 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 42714d4..8a83b91 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -137,38 +137,41 @@ public static int GetHandle(object obj) public static void Remove(int handle) { - if (handle != 0) + // Null is never stored, so there's nothing to remove + if (handle == 0) + { + return; + } + + lock (objects) { - 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 { - // 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)) { - 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; + // 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; } - while (index != initialIndex); + index = (index + 1) % maxObjects; } + while (index != initialIndex); } } } @@ -1002,15 +1005,9 @@ namespace MonoBehaviours { public class TestScript : UnityEngine.MonoBehaviour { - int thisHandle; - - public TestScript() - { - thisHandle = NativeScript.Bindings.ObjectStore.Store(this); - } - public void Awake() { + int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); NativeScript.Bindings.TestScriptAwake(thisHandle); if (NativeScript.Bindings.UnhandledCppException != null) { @@ -1022,6 +1019,7 @@ public void Awake() public void OnAnimatorIK(int param0) { + int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); NativeScript.Bindings.TestScriptOnAnimatorIK(thisHandle, param0); if (NativeScript.Bindings.UnhandledCppException != null) { @@ -1034,6 +1032,7 @@ public void OnAnimatorIK(int param0) public void OnCollisionEnter(UnityEngine.Collision param0) { int param0Handle = NativeScript.Bindings.ObjectStore.Store(param0); + int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); NativeScript.Bindings.TestScriptOnCollisionEnter(thisHandle, param0Handle); if (NativeScript.Bindings.UnhandledCppException != null) { @@ -1045,6 +1044,7 @@ public void OnCollisionEnter(UnityEngine.Collision param0) public void Update() { + int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); NativeScript.Bindings.TestScriptUpdate(thisHandle); if (NativeScript.Bindings.UnhandledCppException != null) { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index b81212d..7c4097e 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -1500,7 +1500,7 @@ static void AppendConstructor( bool enclosingTypeIsStatic, TypeKind enclosingTypeKind, Assembly[] assemblies, - Type[] typeTypeParams, + Type[] enclosingTypeParams, Type[] genericArgTypes, string typeNameLower, int indent, @@ -1524,7 +1524,7 @@ static void AppendConstructor( constructorParamTypeNames = OverrideGenericTypeNames( jsonCtor.ParamTypes, genericArgTypes, - typeTypeParams); + enclosingTypeParams); } else { @@ -1545,7 +1545,7 @@ static void AppendConstructor( enclosingType.Name, builders.TempStrBuilder); AppendTypeNames( - typeTypeParams, + enclosingTypeParams, builders.TempStrBuilder); builders.TempStrBuilder.Append("Constructor"); AppendParameterTypeNames( @@ -1669,7 +1669,7 @@ static void AppendConstructor( enclosingType, null, enclosingType.Name, - typeTypeParams, + enclosingTypeParams, null, parameters, indent, @@ -1691,24 +1691,54 @@ static void AppendConstructor( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( true, + enclosingType, enclosingTypeKind, + enclosingTypeParams, enclosingType, funcName, parameters, indent + 1, builders.CppMethodDefinitions); - AppendIndent( - indent + 1, - builders.CppMethodDefinitions); if (enclosingTypeKind == TypeKind.FullStruct) { + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append( "*this = returnValue;\n"); } else { + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append( - "SetHandle(returnValue);\n"); + "Handle = returnValue;\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "if (returnValue)\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "{\n"); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + AppendReferenceManagedHandleFunctionCall( + enclosingType, + enclosingTypeKind, + enclosingTypeParams, + "returnValue", + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(";\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "}\n"); } AppendIndent( indent, @@ -2070,7 +2100,7 @@ static void AppendMethod( bool methodIsStatic, bool isReadOnly, Type returnType, - Type[] typeTypeParams, + Type[] enclosingTypeParams, Type[] methodTypeParams, ParameterInfo[] parameters, int indent, @@ -2086,7 +2116,7 @@ static void AppendMethod( enclosingType.Name, builders.TempStrBuilder); AppendTypeNames( - typeTypeParams, + enclosingTypeParams, builders.TempStrBuilder); builders.TempStrBuilder.Append("Method"); builders.TempStrBuilder.Append(methodName); @@ -2188,7 +2218,7 @@ static void AppendMethod( enclosingType, returnType, methodName, - typeTypeParams, + enclosingTypeParams, methodTypeParams, parameters, indent, @@ -2199,7 +2229,9 @@ static void AppendMethod( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( methodIsStatic, + enclosingType, enclosingTypeKind, + enclosingTypeParams, returnType, funcName, parameters, @@ -2322,29 +2354,6 @@ static void AppendMonoBehaviour( builders.CsharpMonoBehaviours.Append(" : UnityEngine.MonoBehaviour\n"); AppendIndent(csharpIndent, builders.CsharpMonoBehaviours); builders.CsharpMonoBehaviours.Append("{\n"); - AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("int thisHandle;\n"); - AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append('\n'); - AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("public "); - builders.CsharpMonoBehaviours.Append(type.Name); - builders.CsharpMonoBehaviours.Append("()\n"); - AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("{\n"); - AppendIndent(csharpIndent + 2, builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("thisHandle = "); - AppendHandleStoreTypeName( - type, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append(".Store(this);\n"); - AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("}\n"); - if (jsonMonoBehaviour.Messages.Length > 0) - { - AppendIndent(csharpIndent + 1, builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append('\n'); - } for ( int messageIndex = 0; messageIndex < jsonMonoBehaviour.Messages.Length; @@ -2380,6 +2389,7 @@ static void AppendMonoBehaviour( parameters, builders.CppTypeDefinitions); + // C# message function AppendIndent( csharpIndent + 1, builders.CsharpMonoBehaviours); @@ -2439,6 +2449,11 @@ static void AppendMonoBehaviour( builders.CsharpMonoBehaviours.Append(");\n"); } } + AppendIndent( + csharpIndent + 2, + builders.CsharpMonoBehaviours); + builders.CsharpMonoBehaviours.Append( + "int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this);\n"); AppendIndent( csharpIndent + 2, builders.CsharpMonoBehaviours); @@ -2701,7 +2716,7 @@ static void AppendGetter( bool methodIsStatic, bool isReadOnly, Type enclosingType, - Type[] typeTypeParams, + Type[] enclosingTypeParams, Type fieldType, int indent, StringBuilders builders) @@ -2725,7 +2740,7 @@ static void AppendGetter( enclosingType.Name, builders.TempStrBuilder); AppendTypeNames( - typeTypeParams, + enclosingTypeParams, builders.TempStrBuilder); builders.TempStrBuilder.Append(syntaxType); builders.TempStrBuilder.Append("Get"); @@ -2770,7 +2785,7 @@ static void AppendGetter( methodIsStatic, enclosingTypeKind, fieldType, - typeTypeParams, + enclosingTypeParams, parameters, builders.CsharpFunctions); AppendCsharpFunctionCallSubject( @@ -2819,7 +2834,7 @@ static void AppendGetter( enclosingType, fieldType, methodName, - typeTypeParams, + enclosingTypeParams, null, parameters, indent, @@ -2828,7 +2843,9 @@ static void AppendGetter( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( methodIsStatic, + enclosingType, enclosingTypeKind, + enclosingTypeParams, fieldType, funcName, parameters, @@ -2869,7 +2886,7 @@ static void AppendSetter( bool methodIsStatic, bool isReadOnly, Type enclosingType, - Type[] typeTypeParams, + Type[] enclosingTypeParams, Type fieldType, int indent, StringBuilders builders) @@ -2893,7 +2910,7 @@ static void AppendSetter( enclosingType.Name, builders.TempStrBuilder); AppendTypeNames( - typeTypeParams, + enclosingTypeParams, builders.TempStrBuilder); builders.TempStrBuilder.Append(syntaxType); builders.TempStrBuilder.Append("Set"); @@ -2938,7 +2955,7 @@ static void AppendSetter( methodIsStatic, enclosingTypeKind, typeof(void), - typeTypeParams, + enclosingTypeParams, parameters, builders.CsharpFunctions); AppendCsharpFunctionCallSubject( @@ -2988,7 +3005,7 @@ static void AppendSetter( enclosingType, typeof(void), methodName, - typeTypeParams, + enclosingTypeParams, null, parameters, indent, @@ -2997,7 +3014,9 @@ static void AppendSetter( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( methodIsStatic, + enclosingType, enclosingTypeKind, + enclosingTypeParams, null, funcName, parameters, @@ -3228,6 +3247,28 @@ StringBuilder output typeParams, output); output.Append("&& other);\n"); + + // Equality operator with same type + AppendIndent(indent + 1, output); + output.Append("bool operator==(const "); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& other) const;\n"); + + // Inequality operator with same type + AppendIndent(indent + 1, output); + output.Append("bool operator!=(const "); + AppendWithoutGenericTypeCountSuffix( + type.Name, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& other) const;\n"); } } @@ -3319,6 +3360,20 @@ static int AppendCppMethodDefinitionBegin( output.Append("(handle)\n"); AppendIndent(indent, output); output.Append("{\n"); + AppendIndent(indent + 1, output); + output.Append("if (handle)\n"); + AppendIndent(indent + 1, output); + output.Append("{\n"); + AppendIndent(indent + 2, output); + AppendReferenceManagedHandleFunctionCall( + enclosingType, + enclosingTypeKind, + enclosingTypeParams, + "handle", + output); + output.Append(";\n"); + AppendIndent(indent + 1, output); + output.Append("}\n"); AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); @@ -3349,9 +3404,23 @@ static int AppendCppMethodDefinitionBegin( AppendCppTypeName( baseType, output); - output.Append("(other)\n"); + output.Append("(other.Handle)\n"); AppendIndent(indent, output); output.Append("{\n"); + AppendIndent(indent + 1, output); + output.Append("if (Handle)\n"); + AppendIndent(indent + 1, output); + output.Append("{\n"); + AppendIndent(indent + 2, output); + AppendReferenceManagedHandleFunctionCall( + enclosingType, + enclosingTypeKind, + enclosingTypeParams, + "Handle", + output); + output.Append(";\n"); + AppendIndent(indent + 1, output); + output.Append("}\n"); AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); @@ -3382,16 +3451,11 @@ static int AppendCppMethodDefinitionBegin( AppendCppTypeName( baseType, output); - output.Append("(std::forward<"); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, - output); - AppendCppTypeParameters( - enclosingTypeParams, - output); - output.Append(">(other))\n"); + output.Append("(other.Handle)\n"); AppendIndent(indent, output); output.Append("{\n"); + AppendIndent(indent + 1, output); + output.Append("other.Handle = 0;\n"); AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); @@ -3415,20 +3479,22 @@ static int AppendCppMethodDefinitionBegin( output.Append("()\n"); AppendIndent(indent, output); output.Append("{\n"); - AppendIndent(indent, output); - output.Append("\tif (Handle)\n"); - AppendIndent(indent, output); - output.Append("\t{\n"); - AppendIndent(indent, output); - output.Append("\t\t"); + AppendIndent(indent + 1, output); + output.Append("if (Handle)\n"); + AppendIndent(indent + 1, output); + output.Append("{\n"); + AppendIndent(indent + 2, output); AppendDereferenceManagedHandleFunctionCall( enclosingType, enclosingTypeKind, enclosingTypeParams, + "Handle", output); output.Append(";\n"); - AppendIndent(indent, output); - output.Append("\t}\n"); + AppendIndent(indent + 2, output); + output.Append("Handle = 0;\n"); + AppendIndent(indent + 1, output); + output.Append("}\n"); AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); @@ -3459,8 +3525,14 @@ static int AppendCppMethodDefinitionBegin( output.Append("& other)\n"); AppendIndent(indent, output); output.Append("{\n"); - AppendIndent(indent, output); - output.Append("\tSetHandle(other.Handle);\n"); + AppendSetHandle( + enclosingType, + enclosingTypeKind, + enclosingTypeParams, + indent + 1, + "this", + "other.Handle", + output); AppendIndent(indent, output); output.Append("\treturn *this;\n"); AppendIndent(indent, output); @@ -3496,6 +3568,7 @@ static int AppendCppMethodDefinitionBegin( enclosingType, enclosingTypeKind, enclosingTypeParams, + "Handle", output); output.Append(";\n"); AppendIndent(indent, output); @@ -3544,6 +3617,7 @@ static int AppendCppMethodDefinitionBegin( enclosingType, enclosingTypeKind, enclosingTypeParams, + "Handle", output); output.Append(";\n"); AppendIndent(indent, output); @@ -3558,14 +3632,150 @@ static int AppendCppMethodDefinitionBegin( output.Append("}\n"); AppendIndent(indent, output); output.Append('\n'); + + // Equality operator with same type + AppendIndent(indent, output); + output.Append("bool "); + AppendWithoutGenericTypeCountSuffix( + enclosingType.Name, + output); + AppendCppTypeParameters( + enclosingTypeParams, + output); + output.Append("::operator==(const "); + AppendWithoutGenericTypeCountSuffix( + enclosingType.Name, + output); + AppendCppTypeParameters( + enclosingTypeParams, + output); + output.Append("& other) const\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent + 1, output); + output.Append("return Handle == other.Handle;\n"); + AppendIndent(indent, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append('\n'); + + // Inequality operator with same type + AppendIndent(indent, output); + output.Append("bool "); + AppendWithoutGenericTypeCountSuffix( + enclosingType.Name, + output); + AppendCppTypeParameters( + enclosingTypeParams, + output); + output.Append("::operator!=(const "); + AppendWithoutGenericTypeCountSuffix( + enclosingType.Name, + output); + AppendCppTypeParameters( + enclosingTypeParams, + output); + output.Append("& other) const\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent + 1, output); + output.Append("return Handle != other.Handle;\n"); + AppendIndent(indent, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append('\n'); } return cppMethodDefinitionsIndent; } + static void AppendSetHandle( + Type enclosingType, + TypeKind enclosingTypeKind, + Type[] enclosingTypeParams, + int indent, + string thisExpression, + string otherHandleExpression, + StringBuilder output) + { + string thisHandleExpression = thisExpression + "->Handle"; + AppendIndent(indent, output); + output.Append("if ("); + output.Append(thisHandleExpression); + output.Append(" != "); + output.Append(otherHandleExpression); + output.Append(")\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent + 1, output); + output.Append("if ("); + output.Append(thisHandleExpression); + output.Append(")\n"); + AppendIndent(indent + 1, output); + output.Append("{\n"); + AppendIndent(indent + 2, output); + AppendDereferenceManagedHandleFunctionCall( + enclosingType, + enclosingTypeKind, + enclosingTypeParams, + thisHandleExpression, + output); + output.Append(";\n"); + AppendIndent(indent + 1, output); + output.Append("}\n"); + AppendIndent(indent + 1, output); + output.Append(thisHandleExpression); + output.Append(" = "); + output.Append(otherHandleExpression); + output.Append(";\n"); + AppendIndent(indent + 1, output); + output.Append("if ("); + output.Append(thisHandleExpression); + output.Append(")\n"); + AppendIndent(indent + 1, output); + output.Append("{\n"); + AppendIndent(indent + 2, output); + AppendReferenceManagedHandleFunctionCall( + enclosingType, + enclosingTypeKind, + enclosingTypeParams, + thisHandleExpression, + output); + output.Append(";\n"); + AppendIndent(indent + 1, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("}\n"); + } + + static void AppendReferenceManagedHandleFunctionCall( + Type enclosingType, + TypeKind enclosingTypeKind, + Type[] enclosingTypeParams, + string handleVariable, + StringBuilder output) + { + if (enclosingTypeKind == TypeKind.ManagedStruct) + { + output.Append("Plugin::ReferenceManaged"); + AppendReleaseFunctionNameSuffix( + enclosingType, + enclosingTypeParams, + output); + output.Append("(Handle)"); + } + else + { + output.Append("Plugin::ReferenceManagedClass("); + output.Append(handleVariable); + output.Append(")"); + } + } + static void AppendDereferenceManagedHandleFunctionCall( Type enclosingType, TypeKind enclosingTypeKind, Type[] enclosingTypeParams, + string handleVariable, StringBuilder output) { if (enclosingTypeKind == TypeKind.ManagedStruct) @@ -3579,7 +3789,9 @@ static void AppendDereferenceManagedHandleFunctionCall( } else { - output.Append("Plugin::DereferenceManagedClass(Handle)"); + output.Append("Plugin::DereferenceManagedClass("); + output.Append(handleVariable); + output.Append(")"); } } @@ -4149,7 +4361,9 @@ static void AppendCppMethodReturn( static void AppendCppPluginFunctionCall( bool isStatic, + Type enclosingType, TypeKind enclosingTypeKind, + Type[] enclosingTypeParams, Type returnType, string funcName, ParameterInfo[] parameters, @@ -4234,11 +4448,14 @@ static void AppendCppPluginFunctionCall( || param.Kind == TypeKind.ManagedStruct) && (param.IsOut || param.IsRef)) { - AppendIndent(indent, output); - output.Append(param.Name); - output.Append("->SetHandle("); - output.Append(param.Name); - output.Append("Handle);\n"); + AppendSetHandle( + enclosingType, + enclosingTypeKind, + enclosingTypeParams, + indent, + param.Name, + param.Name + "Handle", + output); } } } diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index f54a654..ad5659d 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -21,9 +21,6 @@ // For malloc(), etc. #include -// For std::forward -#include - // Macro to put before functions that need to be exposed to C# #ifdef _WIN32 #define DLLEXPORT extern "C" __declspec(dllexport) @@ -181,44 +178,14 @@ namespace Plugin namespace System { - Object::Object(int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Object::Object(const Object& other) - { - Handle = other.Handle; - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - Object::Object(Object&& other) + Object::Object(std::nullptr_t n) + : Handle(0) { - Handle = other.Handle; - other.Handle = 0; } - void Object::SetHandle(int32_t handle) + Object::Object(int32_t handle) + : Handle(handle) { - if (Handle != handle) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } } Object::operator bool() const @@ -226,16 +193,6 @@ namespace System return Handle != 0; } - bool Object::operator==(const Object& other) const - { - return Handle == other.Handle; - } - - bool Object::operator!=(const Object& other) const - { - return Handle != other.Handle; - } - bool Object::operator==(std::nullptr_t other) const { return Handle == 0; @@ -256,50 +213,6 @@ namespace System { } - ValueType::ValueType(const ValueType& other) - : Object(other) - { - } - - ValueType::ValueType(ValueType&& other) - : Object(std::forward(other)) - { - } - - ValueType::~ValueType() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - } - - ValueType& ValueType::operator=(const ValueType& other) - { - SetHandle(other.Handle); - return *this; - } - ValueType& ValueType::operator=(std::nullptr_t other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ValueType& ValueType::operator=(ValueType&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - String::String(std::nullptr_t n) : Object(0) { @@ -308,16 +221,25 @@ namespace System String::String(int32_t handle) : Object(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } String::String(const String& other) - : Object(other) + : Object(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } String::String(String&& other) - : Object(std::forward(other)) + : Object(other.Handle) { + other.Handle = 0; } String::~String() @@ -325,14 +247,27 @@ namespace System if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } String& String::operator=(const String& other) { - SetHandle(other.Handle); + if (Handle != other.Handle) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } return *this; } + String& String::operator=(std::nullptr_t other) { if (Handle) @@ -373,16 +308,25 @@ namespace System Stopwatch::Stopwatch(int32_t handle) : System::Object(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } Stopwatch::Stopwatch(const Stopwatch& other) - : System::Object(other) + : System::Object(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } Stopwatch::Stopwatch(Stopwatch&& other) - : System::Object(std::forward(other)) + : System::Object(other.Handle) { + other.Handle = 0; } Stopwatch::~Stopwatch() @@ -390,12 +334,24 @@ namespace System if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } Stopwatch& Stopwatch::operator=(const Stopwatch& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -420,11 +376,25 @@ namespace System return *this; } + bool Stopwatch::operator==(const Stopwatch& other) const + { + return Handle == other.Handle; + } + + bool Stopwatch::operator!=(const Stopwatch& other) const + { + return Handle != other.Handle; + } + Stopwatch::Stopwatch() : System::Object(0) { auto returnValue = Plugin::SystemDiagnosticsStopwatchConstructor(); - SetHandle(returnValue); + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } } int64_t Stopwatch::GetElapsedMilliseconds() @@ -455,16 +425,25 @@ namespace UnityEngine Object::Object(int32_t handle) : System::Object(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } Object::Object(const Object& other) - : System::Object(other) + : System::Object(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } Object::Object(Object&& other) - : System::Object(std::forward(other)) + : System::Object(other.Handle) { + other.Handle = 0; } Object::~Object() @@ -472,12 +451,24 @@ namespace UnityEngine if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } Object& Object::operator=(const Object& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -502,6 +493,16 @@ namespace UnityEngine return *this; } + bool Object::operator==(const Object& other) const + { + return Handle == other.Handle; + } + + bool Object::operator!=(const Object& other) const + { + return Handle != other.Handle; + } + System::String Object::GetName() { auto returnValue = Plugin::UnityEngineObjectPropertyGetName(Handle); @@ -524,16 +525,25 @@ namespace UnityEngine GameObject::GameObject(int32_t handle) : UnityEngine::Object(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } GameObject::GameObject(const GameObject& other) - : UnityEngine::Object(other) + : UnityEngine::Object(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } GameObject::GameObject(GameObject&& other) - : UnityEngine::Object(std::forward(other)) + : UnityEngine::Object(other.Handle) { + other.Handle = 0; } GameObject::~GameObject() @@ -541,12 +551,24 @@ namespace UnityEngine if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } GameObject& GameObject::operator=(const GameObject& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -571,18 +593,36 @@ namespace UnityEngine return *this; } + bool GameObject::operator==(const GameObject& other) const + { + return Handle == other.Handle; + } + + bool GameObject::operator!=(const GameObject& other) const + { + return Handle != other.Handle; + } + GameObject::GameObject() : UnityEngine::Object(0) { auto returnValue = Plugin::UnityEngineGameObjectConstructor(); - SetHandle(returnValue); + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } } GameObject::GameObject(System::String name) : UnityEngine::Object(0) { auto returnValue = Plugin::UnityEngineGameObjectConstructorSystemString(name.Handle); - SetHandle(returnValue); + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } } UnityEngine::Transform GameObject::GetTransform() @@ -614,16 +654,25 @@ namespace UnityEngine Component::Component(int32_t handle) : UnityEngine::Object(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } Component::Component(const Component& other) - : UnityEngine::Object(other) + : UnityEngine::Object(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } Component::Component(Component&& other) - : UnityEngine::Object(std::forward(other)) + : UnityEngine::Object(other.Handle) { + other.Handle = 0; } Component::~Component() @@ -631,12 +680,24 @@ namespace UnityEngine if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } Component& Component::operator=(const Component& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -661,6 +722,16 @@ namespace UnityEngine return *this; } + bool Component::operator==(const Component& other) const + { + return Handle == other.Handle; + } + + bool Component::operator!=(const Component& other) const + { + return Handle != other.Handle; + } + UnityEngine::Transform Component::GetTransform() { auto returnValue = Plugin::UnityEngineComponentPropertyGetTransform(Handle); @@ -678,16 +749,25 @@ namespace UnityEngine Transform::Transform(int32_t handle) : UnityEngine::Component(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } Transform::Transform(const Transform& other) - : UnityEngine::Component(other) + : UnityEngine::Component(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } Transform::Transform(Transform&& other) - : UnityEngine::Component(std::forward(other)) + : UnityEngine::Component(other.Handle) { + other.Handle = 0; } Transform::~Transform() @@ -695,12 +775,24 @@ namespace UnityEngine if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } Transform& Transform::operator=(const Transform& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -725,6 +817,16 @@ namespace UnityEngine return *this; } + bool Transform::operator==(const Transform& other) const + { + return Handle == other.Handle; + } + + bool Transform::operator!=(const Transform& other) const + { + return Handle != other.Handle; + } + UnityEngine::Vector3 Transform::GetPosition() { auto returnValue = Plugin::UnityEngineTransformPropertyGetPosition(Handle); @@ -747,16 +849,25 @@ namespace UnityEngine Debug::Debug(int32_t handle) : System::Object(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } Debug::Debug(const Debug& other) - : System::Object(other) + : System::Object(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } Debug::Debug(Debug&& other) - : System::Object(std::forward(other)) + : System::Object(other.Handle) { + other.Handle = 0; } Debug::~Debug() @@ -764,12 +875,24 @@ namespace UnityEngine if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } Debug& Debug::operator=(const Debug& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -794,6 +917,16 @@ namespace UnityEngine return *this; } + bool Debug::operator==(const Debug& other) const + { + return Handle == other.Handle; + } + + bool Debug::operator!=(const Debug& other) const + { + return Handle != other.Handle; + } + void Debug::Log(System::Object message) { Plugin::UnityEngineDebugMethodLogSystemObject(message.Handle); @@ -837,16 +970,25 @@ namespace UnityEngine Collision::Collision(int32_t handle) : System::Object(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } Collision::Collision(const Collision& other) - : System::Object(other) + : System::Object(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } Collision::Collision(Collision&& other) - : System::Object(std::forward(other)) + : System::Object(other.Handle) { + other.Handle = 0; } Collision::~Collision() @@ -854,12 +996,24 @@ namespace UnityEngine if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } Collision& Collision::operator=(const Collision& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -883,6 +1037,16 @@ namespace UnityEngine other.Handle = 0; return *this; } + + bool Collision::operator==(const Collision& other) const + { + return Handle == other.Handle; + } + + bool Collision::operator!=(const Collision& other) const + { + return Handle != other.Handle; + } } namespace UnityEngine @@ -895,16 +1059,25 @@ namespace UnityEngine Behaviour::Behaviour(int32_t handle) : UnityEngine::Component(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } Behaviour::Behaviour(const Behaviour& other) - : UnityEngine::Component(other) + : UnityEngine::Component(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } Behaviour::Behaviour(Behaviour&& other) - : UnityEngine::Component(std::forward(other)) + : UnityEngine::Component(other.Handle) { + other.Handle = 0; } Behaviour::~Behaviour() @@ -912,12 +1085,24 @@ namespace UnityEngine if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } Behaviour& Behaviour::operator=(const Behaviour& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -941,6 +1126,16 @@ namespace UnityEngine other.Handle = 0; return *this; } + + bool Behaviour::operator==(const Behaviour& other) const + { + return Handle == other.Handle; + } + + bool Behaviour::operator!=(const Behaviour& other) const + { + return Handle != other.Handle; + } } namespace UnityEngine @@ -953,16 +1148,25 @@ namespace UnityEngine MonoBehaviour::MonoBehaviour(int32_t handle) : UnityEngine::Behaviour(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } MonoBehaviour::MonoBehaviour(const MonoBehaviour& other) - : UnityEngine::Behaviour(other) + : UnityEngine::Behaviour(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } MonoBehaviour::MonoBehaviour(MonoBehaviour&& other) - : UnityEngine::Behaviour(std::forward(other)) + : UnityEngine::Behaviour(other.Handle) { + other.Handle = 0; } MonoBehaviour::~MonoBehaviour() @@ -970,12 +1174,24 @@ namespace UnityEngine if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } MonoBehaviour& MonoBehaviour::operator=(const MonoBehaviour& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -999,6 +1215,16 @@ namespace UnityEngine other.Handle = 0; return *this; } + + bool MonoBehaviour::operator==(const MonoBehaviour& other) const + { + return Handle == other.Handle; + } + + bool MonoBehaviour::operator!=(const MonoBehaviour& other) const + { + return Handle != other.Handle; + } } namespace UnityEngine @@ -1011,16 +1237,25 @@ namespace UnityEngine AudioSettings::AudioSettings(int32_t handle) : System::Object(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } AudioSettings::AudioSettings(const AudioSettings& other) - : System::Object(other) + : System::Object(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } AudioSettings::AudioSettings(AudioSettings&& other) - : System::Object(std::forward(other)) + : System::Object(other.Handle) { + other.Handle = 0; } AudioSettings::~AudioSettings() @@ -1028,12 +1263,24 @@ namespace UnityEngine if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } AudioSettings& AudioSettings::operator=(const AudioSettings& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -1058,6 +1305,16 @@ namespace UnityEngine return *this; } + bool AudioSettings::operator==(const AudioSettings& other) const + { + return Handle == other.Handle; + } + + bool AudioSettings::operator!=(const AudioSettings& other) const + { + return Handle != other.Handle; + } + void AudioSettings::GetDSPBufferSize(int32_t* bufferLength, int32_t* numBuffers) { Plugin::UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(bufferLength, numBuffers); @@ -1076,16 +1333,25 @@ namespace UnityEngine NetworkTransport::NetworkTransport(int32_t handle) : System::Object(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } NetworkTransport::NetworkTransport(const NetworkTransport& other) - : System::Object(other) + : System::Object(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } NetworkTransport::NetworkTransport(NetworkTransport&& other) - : System::Object(std::forward(other)) + : System::Object(other.Handle) { + other.Handle = 0; } NetworkTransport::~NetworkTransport() @@ -1093,12 +1359,24 @@ namespace UnityEngine if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } NetworkTransport& NetworkTransport::operator=(const NetworkTransport& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -1123,11 +1401,32 @@ namespace UnityEngine return *this; } + bool NetworkTransport::operator==(const NetworkTransport& other) const + { + return Handle == other.Handle; + } + + bool NetworkTransport::operator!=(const NetworkTransport& other) const + { + return Handle != other.Handle; + } + void NetworkTransport::GetBroadcastConnectionInfo(int32_t hostId, System::String* address, int32_t* port, uint8_t* error) { int32_t addressHandle = address->Handle; Plugin::UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(hostId, &addressHandle, port, error); - address->SetHandle(addressHandle); + if (address->Handle != addressHandle) + { + if (address->Handle) + { + Plugin::DereferenceManagedClass(address->Handle); + } + address->Handle = addressHandle; + if (address->Handle) + { + Plugin::ReferenceManagedClass(address->Handle); + } + } } void NetworkTransport::Init() @@ -1171,16 +1470,25 @@ namespace UnityEngine RaycastHit::RaycastHit(int32_t handle) : System::ValueType(handle) { + if (handle) + { + Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); + } } RaycastHit::RaycastHit(const RaycastHit& other) - : System::ValueType(other) + : System::ValueType(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); + } } RaycastHit::RaycastHit(RaycastHit&& other) - : System::ValueType(std::forward(other)) + : System::ValueType(other.Handle) { + other.Handle = 0; } RaycastHit::~RaycastHit() @@ -1188,12 +1496,24 @@ namespace UnityEngine if (Handle) { Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); + Handle = 0; } } RaycastHit& RaycastHit::operator=(const RaycastHit& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); + } + } return *this; } @@ -1218,6 +1538,16 @@ namespace UnityEngine return *this; } + bool RaycastHit::operator==(const RaycastHit& other) const + { + return Handle == other.Handle; + } + + bool RaycastHit::operator!=(const RaycastHit& other) const + { + return Handle != other.Handle; + } + UnityEngine::Vector3 RaycastHit::GetPoint() { auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetPoint(Handle); @@ -1250,16 +1580,25 @@ namespace System KeyValuePair::KeyValuePair(int32_t handle) : System::ValueType(handle) { + if (handle) + { + Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + } } KeyValuePair::KeyValuePair(const KeyValuePair& other) - : System::ValueType(other) + : System::ValueType(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + } } KeyValuePair::KeyValuePair(KeyValuePair&& other) - : System::ValueType(std::forward>(other)) + : System::ValueType(other.Handle) { + other.Handle = 0; } KeyValuePair::~KeyValuePair() @@ -1267,12 +1606,24 @@ namespace System if (Handle) { Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + Handle = 0; } } KeyValuePair& KeyValuePair::operator=(const KeyValuePair& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + } + } return *this; } @@ -1297,11 +1648,25 @@ namespace System return *this; } + bool KeyValuePair::operator==(const KeyValuePair& other) const + { + return Handle == other.Handle; + } + + bool KeyValuePair::operator!=(const KeyValuePair& other) const + { + return Handle != other.Handle; + } + KeyValuePair::KeyValuePair(System::String key, double value) : System::ValueType(0) { auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(key.Handle, value); - SetHandle(returnValue); + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + } } System::String KeyValuePair::GetKey() @@ -1333,16 +1698,25 @@ namespace System List::List(int32_t handle) : System::Object(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } List::List(const List& other) - : System::Object(other) + : System::Object(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } List::List(List&& other) - : System::Object(std::forward>(other)) + : System::Object(other.Handle) { + other.Handle = 0; } List::~List() @@ -1350,12 +1724,24 @@ namespace System if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } List& List::operator=(const List& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -1380,11 +1766,25 @@ namespace System return *this; } + bool List::operator==(const List& other) const + { + return Handle == other.Handle; + } + + bool List::operator!=(const List& other) const + { + return Handle != other.Handle; + } + List::List() : System::Object(0) { auto returnValue = Plugin::SystemCollectionsGenericListSystemStringConstructor(); - SetHandle(returnValue); + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } } void List::Add(System::String item) @@ -1409,16 +1809,25 @@ namespace System LinkedListNode::LinkedListNode(int32_t handle) : System::Object(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } LinkedListNode::LinkedListNode(const LinkedListNode& other) - : System::Object(other) + : System::Object(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } LinkedListNode::LinkedListNode(LinkedListNode&& other) - : System::Object(std::forward>(other)) + : System::Object(other.Handle) { + other.Handle = 0; } LinkedListNode::~LinkedListNode() @@ -1426,12 +1835,24 @@ namespace System if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } LinkedListNode& LinkedListNode::operator=(const LinkedListNode& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -1456,11 +1877,25 @@ namespace System return *this; } + bool LinkedListNode::operator==(const LinkedListNode& other) const + { + return Handle == other.Handle; + } + + bool LinkedListNode::operator!=(const LinkedListNode& other) const + { + return Handle != other.Handle; + } + LinkedListNode::LinkedListNode(System::String value) : System::Object(0) { auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(value.Handle); - SetHandle(returnValue); + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } } System::String LinkedListNode::GetValue() @@ -1491,16 +1926,25 @@ namespace System StrongBox::StrongBox(int32_t handle) : System::Object(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } StrongBox::StrongBox(const StrongBox& other) - : System::Object(other) + : System::Object(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } StrongBox::StrongBox(StrongBox&& other) - : System::Object(std::forward>(other)) + : System::Object(other.Handle) { + other.Handle = 0; } StrongBox::~StrongBox() @@ -1508,12 +1952,24 @@ namespace System if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } StrongBox& StrongBox::operator=(const StrongBox& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -1538,11 +1994,25 @@ namespace System return *this; } + bool StrongBox::operator==(const StrongBox& other) const + { + return Handle == other.Handle; + } + + bool StrongBox::operator!=(const StrongBox& other) const + { + return Handle != other.Handle; + } + StrongBox::StrongBox(System::String value) : System::Object(0) { auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(value.Handle); - SetHandle(returnValue); + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } } System::String StrongBox::GetValue() @@ -1573,16 +2043,25 @@ namespace System Collection::Collection(int32_t handle) : System::Object(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } Collection::Collection(const Collection& other) - : System::Object(other) + : System::Object(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } Collection::Collection(Collection&& other) - : System::Object(std::forward>(other)) + : System::Object(other.Handle) { + other.Handle = 0; } Collection::~Collection() @@ -1590,12 +2069,24 @@ namespace System if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } Collection& Collection::operator=(const Collection& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -1619,6 +2110,16 @@ namespace System other.Handle = 0; return *this; } + + bool Collection::operator==(const Collection& other) const + { + return Handle == other.Handle; + } + + bool Collection::operator!=(const Collection& other) const + { + return Handle != other.Handle; + } } } } @@ -1637,16 +2138,25 @@ namespace System KeyedCollection::KeyedCollection(int32_t handle) : System::Collections::ObjectModel::Collection(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } KeyedCollection::KeyedCollection(const KeyedCollection& other) - : System::Collections::ObjectModel::Collection(other) + : System::Collections::ObjectModel::Collection(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } KeyedCollection::KeyedCollection(KeyedCollection&& other) - : System::Collections::ObjectModel::Collection(std::forward>(other)) + : System::Collections::ObjectModel::Collection(other.Handle) { + other.Handle = 0; } KeyedCollection::~KeyedCollection() @@ -1654,12 +2164,24 @@ namespace System if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } KeyedCollection& KeyedCollection::operator=(const KeyedCollection& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -1683,6 +2205,16 @@ namespace System other.Handle = 0; return *this; } + + bool KeyedCollection::operator==(const KeyedCollection& other) const + { + return Handle == other.Handle; + } + + bool KeyedCollection::operator!=(const KeyedCollection& other) const + { + return Handle != other.Handle; + } } } } @@ -1697,16 +2229,25 @@ namespace System Exception::Exception(int32_t handle) : System::Object(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } Exception::Exception(const Exception& other) - : System::Object(other) + : System::Object(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } Exception::Exception(Exception&& other) - : System::Object(std::forward(other)) + : System::Object(other.Handle) { + other.Handle = 0; } Exception::~Exception() @@ -1714,12 +2255,24 @@ namespace System if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } Exception& Exception::operator=(const Exception& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -1744,11 +2297,25 @@ namespace System return *this; } + bool Exception::operator==(const Exception& other) const + { + return Handle == other.Handle; + } + + bool Exception::operator!=(const Exception& other) const + { + return Handle != other.Handle; + } + Exception::Exception(System::String message) : System::Object(0) { auto returnValue = Plugin::SystemExceptionConstructorSystemString(message.Handle); - SetHandle(returnValue); + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } } } @@ -1764,16 +2331,25 @@ namespace MyGame TestScript::TestScript(int32_t handle) : UnityEngine::MonoBehaviour(handle) { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } TestScript::TestScript(const TestScript& other) - : UnityEngine::MonoBehaviour(other) + : UnityEngine::MonoBehaviour(other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } TestScript::TestScript(TestScript&& other) - : UnityEngine::MonoBehaviour(std::forward(other)) + : UnityEngine::MonoBehaviour(other.Handle) { + other.Handle = 0; } TestScript::~TestScript() @@ -1781,12 +2357,24 @@ namespace MyGame if (Handle) { Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } TestScript& TestScript::operator=(const TestScript& other) { - SetHandle(other.Handle); + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } return *this; } @@ -1810,6 +2398,16 @@ namespace MyGame other.Handle = 0; return *this; } + + bool TestScript::operator==(const TestScript& other) const + { + return Handle == other.Handle; + } + + bool TestScript::operator!=(const TestScript& other) const + { + return Handle != other.Handle; + } } } /*END METHOD DEFINITIONS*/ diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 03befe9..b585c84 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -141,13 +141,9 @@ namespace System struct Object { int32_t Handle; + Object(std::nullptr_t n); Object(int32_t handle); - Object(const Object& other); - Object(Object&& other); - void SetHandle(int32_t handle); operator bool() const; - bool operator==(const Object& other) const; - bool operator!=(const Object& other) const; bool operator==(std::nullptr_t other) const; bool operator!=(std::nullptr_t other) const; }; @@ -156,13 +152,6 @@ namespace System { ValueType(std::nullptr_t n); ValueType(int32_t handle); - ValueType(const ValueType& other); - ValueType(ValueType&& other); - ~ValueType(); - ValueType& operator=(const ValueType& other); - ValueType& operator=(std::nullptr_t other); - ValueType& operator=(ValueType&& other); - ValueType(const char* chars); }; struct String : Object @@ -432,6 +421,8 @@ namespace System Stopwatch& operator=(const Stopwatch& other); Stopwatch& operator=(std::nullptr_t other); Stopwatch& operator=(Stopwatch&& other); + bool operator==(const Stopwatch& other) const; + bool operator!=(const Stopwatch& other) const; Stopwatch(); int64_t GetElapsedMilliseconds(); void Start(); @@ -452,6 +443,8 @@ namespace UnityEngine Object& operator=(const Object& other); Object& operator=(std::nullptr_t other); Object& operator=(Object&& other); + bool operator==(const Object& other) const; + bool operator!=(const Object& other) const; System::String GetName(); void SetName(System::String value); }; @@ -469,6 +462,8 @@ namespace UnityEngine GameObject& operator=(const GameObject& other); GameObject& operator=(std::nullptr_t other); GameObject& operator=(GameObject&& other); + bool operator==(const GameObject& other) const; + bool operator!=(const GameObject& other) const; GameObject(); GameObject(System::String name); UnityEngine::Transform GetTransform(); @@ -489,6 +484,8 @@ namespace UnityEngine Component& operator=(const Component& other); Component& operator=(std::nullptr_t other); Component& operator=(Component&& other); + bool operator==(const Component& other) const; + bool operator!=(const Component& other) const; UnityEngine::Transform GetTransform(); }; } @@ -505,6 +502,8 @@ namespace UnityEngine Transform& operator=(const Transform& other); Transform& operator=(std::nullptr_t other); Transform& operator=(Transform&& other); + bool operator==(const Transform& other) const; + bool operator!=(const Transform& other) const; UnityEngine::Vector3 GetPosition(); void SetPosition(UnityEngine::Vector3& value); }; @@ -522,6 +521,8 @@ namespace UnityEngine Debug& operator=(const Debug& other); Debug& operator=(std::nullptr_t other); Debug& operator=(Debug&& other); + bool operator==(const Debug& other) const; + bool operator!=(const Debug& other) const; static void Log(System::Object message); }; } @@ -552,6 +553,8 @@ namespace UnityEngine Collision& operator=(const Collision& other); Collision& operator=(std::nullptr_t other); Collision& operator=(Collision&& other); + bool operator==(const Collision& other) const; + bool operator!=(const Collision& other) const; }; } @@ -567,6 +570,8 @@ namespace UnityEngine Behaviour& operator=(const Behaviour& other); Behaviour& operator=(std::nullptr_t other); Behaviour& operator=(Behaviour&& other); + bool operator==(const Behaviour& other) const; + bool operator!=(const Behaviour& other) const; }; } @@ -582,6 +587,8 @@ namespace UnityEngine MonoBehaviour& operator=(const MonoBehaviour& other); MonoBehaviour& operator=(std::nullptr_t other); MonoBehaviour& operator=(MonoBehaviour&& other); + bool operator==(const MonoBehaviour& other) const; + bool operator!=(const MonoBehaviour& other) const; }; } @@ -597,6 +604,8 @@ namespace UnityEngine AudioSettings& operator=(const AudioSettings& other); AudioSettings& operator=(std::nullptr_t other); AudioSettings& operator=(AudioSettings&& other); + bool operator==(const AudioSettings& other) const; + bool operator!=(const AudioSettings& other) const; static void GetDSPBufferSize(int32_t* bufferLength, int32_t* numBuffers); }; } @@ -615,6 +624,8 @@ namespace UnityEngine NetworkTransport& operator=(const NetworkTransport& other); NetworkTransport& operator=(std::nullptr_t other); NetworkTransport& operator=(NetworkTransport&& other); + bool operator==(const NetworkTransport& other) const; + bool operator!=(const NetworkTransport& other) const; static void GetBroadcastConnectionInfo(int32_t hostId, System::String* address, int32_t* port, uint8_t* error); static void Init(); }; @@ -647,6 +658,8 @@ namespace UnityEngine RaycastHit& operator=(const RaycastHit& other); RaycastHit& operator=(std::nullptr_t other); RaycastHit& operator=(RaycastHit&& other); + bool operator==(const RaycastHit& other) const; + bool operator!=(const RaycastHit& other) const; UnityEngine::Vector3 GetPoint(); void SetPoint(UnityEngine::Vector3& value); UnityEngine::Transform GetTransform(); @@ -669,6 +682,8 @@ namespace System KeyValuePair& operator=(const KeyValuePair& other); KeyValuePair& operator=(std::nullptr_t other); KeyValuePair& operator=(KeyValuePair&& other); + bool operator==(const KeyValuePair& other) const; + bool operator!=(const KeyValuePair& other) const; KeyValuePair(System::String key, double value); System::String GetKey(); double GetValue(); @@ -693,6 +708,8 @@ namespace System List& operator=(const List& other); List& operator=(std::nullptr_t other); List& operator=(List&& other); + bool operator==(const List& other) const; + bool operator!=(const List& other) const; List(); void Add(System::String item); }; @@ -716,6 +733,8 @@ namespace System LinkedListNode& operator=(const LinkedListNode& other); LinkedListNode& operator=(std::nullptr_t other); LinkedListNode& operator=(LinkedListNode&& other); + bool operator==(const LinkedListNode& other) const; + bool operator!=(const LinkedListNode& other) const; LinkedListNode(System::String value); System::String GetValue(); void SetValue(System::String value); @@ -740,6 +759,8 @@ namespace System StrongBox& operator=(const StrongBox& other); StrongBox& operator=(std::nullptr_t other); StrongBox& operator=(StrongBox&& other); + bool operator==(const StrongBox& other) const; + bool operator!=(const StrongBox& other) const; StrongBox(System::String value); System::String GetValue(); void SetValue(System::String value); @@ -764,6 +785,8 @@ namespace System Collection& operator=(const Collection& other); Collection& operator=(std::nullptr_t other); Collection& operator=(Collection&& other); + bool operator==(const Collection& other) const; + bool operator!=(const Collection& other) const; }; } } @@ -785,6 +808,8 @@ namespace System KeyedCollection& operator=(const KeyedCollection& other); KeyedCollection& operator=(std::nullptr_t other); KeyedCollection& operator=(KeyedCollection&& other); + bool operator==(const KeyedCollection& other) const; + bool operator!=(const KeyedCollection& other) const; }; } } @@ -802,6 +827,8 @@ namespace System Exception& operator=(const Exception& other); Exception& operator=(std::nullptr_t other); Exception& operator=(Exception&& other); + bool operator==(const Exception& other) const; + bool operator!=(const Exception& other) const; Exception(System::String message); }; } @@ -820,6 +847,8 @@ namespace MyGame TestScript& operator=(const TestScript& other); TestScript& operator=(std::nullptr_t other); TestScript& operator=(TestScript&& other); + bool operator==(const TestScript& other) const; + bool operator!=(const TestScript& other) const; void Awake(); void OnAnimatorIK(int32_t param0); void OnCollisionEnter(UnityEngine::Collision param0); From 5fcd3d449d7ee5ed5cd54e75541af7df7bd330dc Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 23 Sep 2017 16:22:57 -0700 Subject: [PATCH 07/95] Forward unhandled C# exceptions to C++ --- Unity/Assets/NativeScript/Bindings.cs | 539 ++++++++++++++---- .../NativeScript/Editor/GenerateBindings.cs | 62 +- Unity/CppSource/Game/Game.cpp | 2 +- Unity/CppSource/NativeScript/Bindings.cpp | 252 ++++++++ 4 files changed, 739 insertions(+), 116 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 8a83b91..3c90bfb 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -316,7 +316,9 @@ delegate void InitDelegate( IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue, IntPtr systemExceptionConstructorSystemString /*END INIT PARAMS*/); - + + public delegate void SetCsharpExceptionDelegate(int handle); + /*BEGIN MONOBEHAVIOUR DELEGATES*/ public delegate void TestScriptAwakeDelegate(int thisHandle); public static TestScriptAwakeDelegate TestScriptAwake; @@ -473,6 +475,9 @@ static extern void Init( IntPtr systemExceptionConstructorSystemString /*END INIT PARAMS*/); + [DllImport(PluginName)] + static extern void SetCsharpException(int handle); + /*BEGIN MONOBEHAVIOUR IMPORTS*/ [DllImport(Constants.PluginName)] public static extern void TestScriptAwake(int thisHandle); @@ -538,6 +543,7 @@ IntPtr systemExceptionConstructorSystemString /*END DELEGATE TYPES*/ public static Exception UnhandledCppException; + public static SetCsharpExceptionDelegate SetCsharpException; /// /// Open the C++ plugin and call its PluginMain() @@ -564,6 +570,9 @@ public static void Open( InitDelegate Init = GetDelegate( libraryHandle, "Init"); + SetCsharpException = GetDelegate( + libraryHandle, + "SetCsharpException"); /*BEGIN MONOBEHAVIOUR GETDELEGATE CALLS*/ TestScriptAwake = GetDelegate(libraryHandle, "TestScriptAwake"); TestScriptOnAnimatorIK = GetDelegate(libraryHandle, "TestScriptOnAnimatorIK"); @@ -677,322 +686,640 @@ static void SetException(int handle) [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchConstructorDelegate))] static int SystemDiagnosticsStopwatchConstructor() { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Diagnostics.Stopwatch()); - return returnValue; + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Diagnostics.Stopwatch()); + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate))] static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHandle) { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.ElapsedMilliseconds; - return returnValue; + try + { + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.ElapsedMilliseconds; + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(long); + } } [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodStartDelegate))] static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Start(); + try + { + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Start(); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodResetDelegate))] static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Reset(); + try + { + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Reset(); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(UnityEngineObjectPropertyGetNameDelegate))] static int UnityEngineObjectPropertyGetName(int thisHandle) { - var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.name; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + try + { + var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.name; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(UnityEngineObjectPropertySetNameDelegate))] static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) { - var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.name = value; + try + { + var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.name = value; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorDelegate))] static int UnityEngineGameObjectConstructor() { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject()); - return returnValue; + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject()); + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorSystemStringDelegate))] static int UnityEngineGameObjectConstructorSystemString(int nameHandle) { - var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject(name)); - return returnValue; + try + { + var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject(name)); + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(UnityEngineGameObjectPropertyGetTransformDelegate))] static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + try + { + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodFindSystemStringDelegate))] static int UnityEngineGameObjectMethodFindSystemString(int nameHandle) { - var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); - var returnValue = UnityEngine.GameObject.Find(name); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + try + { + var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); + var returnValue = UnityEngine.GameObject.Find(name); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate))] static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(int thisHandle) { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.AddComponent(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + try + { + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.AddComponent(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(UnityEngineComponentPropertyGetTransformDelegate))] static int UnityEngineComponentPropertyGetTransform(int thisHandle) { - var thiz = (UnityEngine.Component)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + try + { + var thiz = (UnityEngine.Component)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(UnityEngineTransformPropertyGetPositionDelegate))] static UnityEngine.Vector3 UnityEngineTransformPropertyGetPosition(int thisHandle) { - var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.position; - return returnValue; + try + { + var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.position; + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } } [MonoPInvokeCallback(typeof(UnityEngineTransformPropertySetPositionDelegate))] static void UnityEngineTransformPropertySetPosition(int thisHandle, ref UnityEngine.Vector3 value) { - var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.position = value; + try + { + var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.position = value; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(UnityEngineDebugMethodLogSystemObjectDelegate))] static void UnityEngineDebugMethodLogSystemObject(int messageHandle) { - var message = NativeScript.Bindings.ObjectStore.Get(messageHandle); - UnityEngine.Debug.Log(message); + try + { + var message = NativeScript.Bindings.ObjectStore.Get(messageHandle); + UnityEngine.Debug.Log(message); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldGetRaiseExceptionsDelegate))] static bool UnityEngineAssertionsAssertFieldGetRaiseExceptions() { - var returnValue = UnityEngine.Assertions.Assert.raiseExceptions; - return returnValue; + try + { + var returnValue = UnityEngine.Assertions.Assert.raiseExceptions; + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } } [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldSetRaiseExceptionsDelegate))] static void UnityEngineAssertionsAssertFieldSetRaiseExceptions(bool value) { - UnityEngine.Assertions.Assert.raiseExceptions = value; + try + { + UnityEngine.Assertions.Assert.raiseExceptions = value; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemStringDelegate))] static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(int expectedHandle, int actualHandle) { - var expected = (string)NativeScript.Bindings.ObjectStore.Get(expectedHandle); - var actual = (string)NativeScript.Bindings.ObjectStore.Get(actualHandle); - UnityEngine.Assertions.Assert.AreEqual(expected, actual); + try + { + var expected = (string)NativeScript.Bindings.ObjectStore.Get(expectedHandle); + var actual = (string)NativeScript.Bindings.ObjectStore.Get(actualHandle); + UnityEngine.Assertions.Assert.AreEqual(expected, actual); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObjectDelegate))] static void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(int expectedHandle, int actualHandle) { - var expected = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(expectedHandle); - var actual = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(actualHandle); - UnityEngine.Assertions.Assert.AreEqual(expected, actual); + try + { + var expected = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(expectedHandle); + var actual = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(actualHandle); + UnityEngine.Assertions.Assert.AreEqual(expected, actual); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate))] static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(ref int bufferLength, ref int numBuffers) { - UnityEngine.AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers); + try + { + UnityEngine.AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate))] static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(int hostId, ref int addressHandle, ref int port, ref byte error) { - var address = (string)NativeScript.Bindings.ObjectStore.Get(addressHandle); - UnityEngine.Networking.NetworkTransport.GetBroadcastConnectionInfo(hostId, out address, out port, out error); - int addressHandleNew = NativeScript.Bindings.ObjectStore.GetHandle(address); - addressHandle = addressHandleNew; + try + { + var address = (string)NativeScript.Bindings.ObjectStore.Get(addressHandle); + UnityEngine.Networking.NetworkTransport.GetBroadcastConnectionInfo(hostId, out address, out port, out error); + int addressHandleNew = NativeScript.Bindings.ObjectStore.GetHandle(address); + addressHandle = addressHandleNew; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodInitDelegate))] static void UnityEngineNetworkingNetworkTransportMethodInit() { - UnityEngine.Networking.NetworkTransport.Init(); + try + { + UnityEngine.Networking.NetworkTransport.Init(); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate))] static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(float x, float y, float z) { - var returnValue = new UnityEngine.Vector3(x, y, z); - return returnValue; + try + { + var returnValue = new UnityEngine.Vector3(x, y, z); + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } } [MonoPInvokeCallback(typeof(UnityEngineVector3PropertyGetMagnitudeDelegate))] static float UnityEngineVector3PropertyGetMagnitude(ref UnityEngine.Vector3 thiz) { - var returnValue = thiz.magnitude; - return returnValue; + try + { + var returnValue = thiz.magnitude; + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } } [MonoPInvokeCallback(typeof(UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingleDelegate))] static void UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(ref UnityEngine.Vector3 thiz, float newX, float newY, float newZ) { - thiz.Set(newX, newY, newZ); + try + { + thiz.Set(newX, newY, newZ); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(ReleaseUnityEngineRaycastHitDelegate))] static void ReleaseUnityEngineRaycastHit(int handle) { - if (handle != 0) + try + { + if (handle != 0) { NativeScript.Bindings.StructStore.Remove(handle); } + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertyGetPointDelegate))] static UnityEngine.Vector3 UnityEngineRaycastHitPropertyGetPoint(int thisHandle) { - var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.point; - return returnValue; + try + { + var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); + var returnValue = thiz.point; + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } } [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertySetPointDelegate))] static void UnityEngineRaycastHitPropertySetPoint(int thisHandle, ref UnityEngine.Vector3 value) { - var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); - thiz.point = value; - NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); + try + { + var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); + thiz.point = value; + NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertyGetTransformDelegate))] static int UnityEngineRaycastHitPropertyGetTransform(int thisHandle) { - var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + try + { + var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate))] static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int handle) { - if (handle != 0) + try + { + if (handle != 0) { NativeScript.Bindings.StructStore>.Remove(handle); } + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate))] static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(int keyHandle, double value) { - var key = (string)NativeScript.Bindings.ObjectStore.Get(keyHandle); - var returnValue = NativeScript.Bindings.StructStore>.Store(new System.Collections.Generic.KeyValuePair(key, value)); - return returnValue; + try + { + var key = (string)NativeScript.Bindings.ObjectStore.Get(keyHandle); + var returnValue = NativeScript.Bindings.StructStore>.Store(new System.Collections.Generic.KeyValuePair(key, value)); + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate))] static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(int thisHandle) { - var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); - var returnValue = thiz.Key; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + try + { + var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); + var returnValue = thiz.Key; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate))] static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(int thisHandle) { - var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); - var returnValue = thiz.Value; - return returnValue; + try + { + var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); + var returnValue = thiz.Value; + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(double); + } } [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringConstructorDelegate))] static int SystemCollectionsGenericListSystemStringConstructor() { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); - return returnValue; + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate))] static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int thisHandle, int itemHandle) { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); - thiz.Add(item); + try + { + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); + thiz.Add(item); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate))] static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(int valueHandle) { - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.LinkedListNode(value)); - return returnValue; + try + { + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.LinkedListNode(value)); + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate))] static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(int thisHandle) { - var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Value; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + try + { + var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Value; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate))] static void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(int thisHandle, int valueHandle) { - var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.Value = value; + try + { + var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.Value = value; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate))] static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(int valueHandle) { - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Runtime.CompilerServices.StrongBox(value)); - return returnValue; + try + { + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Runtime.CompilerServices.StrongBox(value)); + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate))] static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int thisHandle) { - var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Value; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + try + { + var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Value; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate))] static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int thisHandle, int valueHandle) { - var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.Value = value; + try + { + var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.Value = value; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } } [MonoPInvokeCallback(typeof(SystemExceptionConstructorSystemStringDelegate))] static int SystemExceptionConstructorSystemString(int messageHandle) { - var message = (string)NativeScript.Bindings.ObjectStore.Get(messageHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Exception(message)); - return returnValue; + try + { + var message = (string)NativeScript.Bindings.ObjectStore.Get(messageHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Exception(message)); + return returnValue; + } + catch (Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } /*END FUNCTIONS*/ } diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 7c4097e..3055716 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -1146,6 +1146,7 @@ static void AppendType( builders.CsharpFunctions.Append( ">.Remove(handle);\n\t\t\t}"); AppendCsharpFunctionEnd( + typeof(void), builders.CsharpFunctions); // C++ function pointer definition @@ -3989,6 +3990,9 @@ static void AppendCsharpFunctionBeginning( output); output.Append(")\n\t\t{\n\t\t\t"); + // Start try/catch block + output.Append("try\n\t\t\t{\n\t\t\t\t"); + // Get "this" if (!isStatic && enclosingTypeKind != TypeKind.FullStruct) @@ -4002,7 +4006,7 @@ static void AppendCsharpFunctionBeginning( enclosingType, output); output.Append( - ".Get(thisHandle);\n\t\t\t"); + ".Get(thisHandle);\n\t\t\t\t"); } // Get managed type params from ObjectStore @@ -4024,7 +4028,7 @@ static void AppendCsharpFunctionBeginning( AppendHandleStoreTypeName(paramType, output); output.Append(".Get("); output.Append(param.Name); - output.Append("Handle);\n\t\t\t"); + output.Append("Handle);\n\t\t\t\t"); } } @@ -4085,7 +4089,7 @@ static void AppendStructStoreReplace( string structVariable, StringBuilder output) { - output.Append("\n\t\t\t"); + output.Append("\n\t\t\t\t"); AppendHandleStoreTypeName( enclosingType, output); @@ -4108,7 +4112,7 @@ static void AppendCsharpFunctionReturn( || param.Kind == TypeKind.ManagedStruct) && (param.IsOut || param.IsRef)) { - output.Append("\n\t\t\tint "); + output.Append("\n\t\t\t\tint "); output.Append(param.Name); output.Append("HandleNew = "); AppendHandleStoreTypeName( @@ -4125,7 +4129,7 @@ static void AppendCsharpFunctionReturn( } output.Append('('); output.Append(param.Name); - output.Append(");\n\t\t\t"); + output.Append(");\n\t\t\t\t"); output.Append(param.Name); output.Append("Handle = "); output.Append(param.Name); @@ -4136,7 +4140,7 @@ static void AppendCsharpFunctionReturn( // Return if (!returnType.Equals(typeof(void))) { - output.Append("\n\t\t\treturn "); + output.Append("\n\t\t\t\treturn "); if (IsFullValueType(returnType)) { output.Append("returnValue"); @@ -4152,12 +4156,38 @@ static void AppendCsharpFunctionReturn( } // Returning ends the function - AppendCsharpFunctionEnd(output); + AppendCsharpFunctionEnd( + returnType, + output); } - static void AppendCsharpFunctionEnd(StringBuilder output) + static void AppendCsharpFunctionEnd( + Type returnType, + StringBuilder output) { - output.Append("\n\t\t}\n\t\t\n"); + output.Append('\n'); + output.Append("\t\t\t}\n"); + output.Append("\t\t\tcatch (Exception ex)\n"); + output.Append("\t\t\t{\n"); + output.Append("\t\t\t\tNativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex));\n"); + if (returnType != typeof(void)) + { + output.Append("\t\t\t\treturn default("); + if (IsFullValueType(returnType)) + { + AppendCsharpTypeName( + returnType, + output); + } + else + { + output.Append("int"); + } + output.Append(");\n"); + } + output.Append("\t\t\t}\n"); + output.Append("\t\t}\n"); + output.Append("\t\t\n"); } static void AppendCsharpParameterDeclaration( @@ -4441,6 +4471,20 @@ static void AppendCppPluginFunctionCall( } output.Append(");\n"); + // Handle uncaught exceptions from the C# side + AppendIndent(indent, output); + output.Append("if (Plugin::unhandledCsharpException)\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent + 1, output); + output.Append("System::Exception ex(Plugin::unhandledCsharpException);\n"); + AppendIndent(indent + 1, output); + output.Append("Plugin::unhandledCsharpException = nullptr;\n"); + AppendIndent(indent + 1, output); + output.Append("throw ex;\n"); + AppendIndent(indent, output); + output.Append("}\n"); + // Set out and ref parameters foreach (ParameterInfo param in parameters) { diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index e030b6d..6ed197a 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -21,7 +21,7 @@ void PluginMain() { PrintPlatformDefines(); Debug::Log(String("Game booted up")); - + if (!UnityEngine::Assertions::Assert::GetRaiseExceptions()) { UnityEngine::Assertions::Assert::SetRaiseExceptions(true); diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index ad5659d..9333792 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -171,6 +171,12 @@ namespace Plugin /*END REF COUNTS STATE AND FUNCTIONS*/ } +namespace Plugin +{ + // An unhandled exception caused by C++ calling into C# + System::Exception unhandledCsharpException(nullptr); +} + //////////////////////////////////////////////////////////////// // Mirrors of C# types. These wrap the C# functions to present // a similiar API as in C#. @@ -390,6 +396,12 @@ namespace System : System::Object(0) { auto returnValue = Plugin::SystemDiagnosticsStopwatchConstructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } Handle = returnValue; if (returnValue) { @@ -400,17 +412,35 @@ namespace System int64_t Stopwatch::GetElapsedMilliseconds() { auto returnValue = Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } void Stopwatch::Start() { Plugin::SystemDiagnosticsStopwatchMethodStart(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } void Stopwatch::Reset() { Plugin::SystemDiagnosticsStopwatchMethodReset(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } } } @@ -506,12 +536,24 @@ namespace UnityEngine System::String Object::GetName() { auto returnValue = Plugin::UnityEngineObjectPropertyGetName(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } void Object::SetName(System::String value) { Plugin::UnityEngineObjectPropertySetName(Handle, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } } @@ -607,6 +649,12 @@ namespace UnityEngine : UnityEngine::Object(0) { auto returnValue = Plugin::UnityEngineGameObjectConstructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } Handle = returnValue; if (returnValue) { @@ -618,6 +666,12 @@ namespace UnityEngine : UnityEngine::Object(0) { auto returnValue = Plugin::UnityEngineGameObjectConstructorSystemString(name.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } Handle = returnValue; if (returnValue) { @@ -628,18 +682,36 @@ namespace UnityEngine UnityEngine::Transform GameObject::GetTransform() { auto returnValue = Plugin::UnityEngineGameObjectPropertyGetTransform(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } UnityEngine::GameObject GameObject::Find(System::String name) { auto returnValue = Plugin::UnityEngineGameObjectMethodFindSystemString(name.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } template<> MyGame::MonoBehaviours::TestScript GameObject::AddComponent() { auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } } @@ -735,6 +807,12 @@ namespace UnityEngine UnityEngine::Transform Component::GetTransform() { auto returnValue = Plugin::UnityEngineComponentPropertyGetTransform(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } } @@ -830,12 +908,24 @@ namespace UnityEngine UnityEngine::Vector3 Transform::GetPosition() { auto returnValue = Plugin::UnityEngineTransformPropertyGetPosition(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } void Transform::SetPosition(UnityEngine::Vector3& value) { Plugin::UnityEngineTransformPropertySetPosition(Handle, value); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } } @@ -930,6 +1020,12 @@ namespace UnityEngine void Debug::Log(System::Object message) { Plugin::UnityEngineDebugMethodLogSystemObject(message.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } } @@ -940,22 +1036,46 @@ namespace UnityEngine System::Boolean Assert::GetRaiseExceptions() { auto returnValue = Plugin::UnityEngineAssertionsAssertFieldGetRaiseExceptions(); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } void Assert::SetRaiseExceptions(System::Boolean value) { Plugin::UnityEngineAssertionsAssertFieldSetRaiseExceptions(value); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } template<> void Assert::AreEqual(System::String expected, System::String actual) { Plugin::UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(expected.Handle, actual.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } template<> void Assert::AreEqual(UnityEngine::GameObject expected, UnityEngine::GameObject actual) { Plugin::UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(expected.Handle, actual.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } } } @@ -1318,6 +1438,12 @@ namespace UnityEngine void AudioSettings::GetDSPBufferSize(int32_t* bufferLength, int32_t* numBuffers) { Plugin::UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(bufferLength, numBuffers); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } } @@ -1415,6 +1541,12 @@ namespace UnityEngine { int32_t addressHandle = address->Handle; Plugin::UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(hostId, &addressHandle, port, error); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } if (address->Handle != addressHandle) { if (address->Handle) @@ -1432,6 +1564,12 @@ namespace UnityEngine void NetworkTransport::Init() { Plugin::UnityEngineNetworkingNetworkTransportMethodInit(); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } } } @@ -1445,18 +1583,36 @@ namespace UnityEngine Vector3::Vector3(float x, float y, float z) { auto returnValue = Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(x, y, z); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } *this = returnValue; } float Vector3::GetMagnitude() { auto returnValue = Plugin::UnityEngineVector3PropertyGetMagnitude(this); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } void Vector3::Set(float newX, float newY, float newZ) { Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(this, newX, newY, newZ); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } } @@ -1551,17 +1707,35 @@ namespace UnityEngine UnityEngine::Vector3 RaycastHit::GetPoint() { auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetPoint(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } void RaycastHit::SetPoint(UnityEngine::Vector3& value) { Plugin::UnityEngineRaycastHitPropertySetPoint(Handle, value); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } UnityEngine::Transform RaycastHit::GetTransform() { auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetTransform(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } } @@ -1662,6 +1836,12 @@ namespace System : System::ValueType(0) { auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(key.Handle, value); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } Handle = returnValue; if (returnValue) { @@ -1672,12 +1852,24 @@ namespace System System::String KeyValuePair::GetKey() { auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } double KeyValuePair::GetValue() { auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } } @@ -1780,6 +1972,12 @@ namespace System : System::Object(0) { auto returnValue = Plugin::SystemCollectionsGenericListSystemStringConstructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } Handle = returnValue; if (returnValue) { @@ -1790,6 +1988,12 @@ namespace System void List::Add(System::String item) { Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString(Handle, item.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } } } @@ -1891,6 +2095,12 @@ namespace System : System::Object(0) { auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } Handle = returnValue; if (returnValue) { @@ -1901,12 +2111,24 @@ namespace System System::String LinkedListNode::GetValue() { auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } void LinkedListNode::SetValue(System::String value) { Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(Handle, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } } } @@ -2008,6 +2230,12 @@ namespace System : System::Object(0) { auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } Handle = returnValue; if (returnValue) { @@ -2018,12 +2246,24 @@ namespace System System::String StrongBox::GetValue() { auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } return returnValue; } void StrongBox::SetValue(System::String value) { Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(Handle, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } } } } @@ -2311,6 +2551,12 @@ namespace System : System::Object(0) { auto returnValue = Plugin::SystemExceptionConstructorSystemString(message.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception ex(Plugin::unhandledCsharpException); + Plugin::unhandledCsharpException = nullptr; + throw ex; + } Handle = returnValue; if (returnValue) { @@ -2552,6 +2798,12 @@ DLLEXPORT void Init( } } +// Receive an unhandled exception from C# +DLLEXPORT void SetCsharpException(int32_t handle) +{ + Plugin::unhandledCsharpException = System::Exception(handle); +} + /*BEGIN MONOBEHAVIOUR MESSAGES*/ DLLEXPORT void TestScriptAwake(int32_t thisHandle) { From 460dddf93c0702b7a6205b911ea2828c57892cf4 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 24 Sep 2017 17:17:03 -0700 Subject: [PATCH 08/95] Support derived exception types in C++ (e.g. to catch NullReferenceException, not just Exception) --- Unity/Assets/NativeScript/Bindings.cs | 105 ++-- .../NativeScript/Editor/GenerateBindings.cs | 513 +++++++++++++++--- Unity/Assets/NativeScriptTypes.json | 19 +- Unity/CppSource/NativeScript/Bindings.cpp | 416 +++++++++++--- Unity/CppSource/NativeScript/Bindings.h | 46 ++ 5 files changed, 878 insertions(+), 221 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 3c90bfb..ae2c3bf 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -331,6 +331,9 @@ IntPtr systemExceptionConstructorSystemString public delegate void TestScriptUpdateDelegate(int thisHandle); public static TestScriptUpdateDelegate TestScriptUpdate; + + public delegate void SetCsharpExceptionSystemNullReferenceExceptionDelegate(int param0); + public static SetCsharpExceptionSystemNullReferenceExceptionDelegate SetCsharpExceptionSystemNullReferenceException; /*END MONOBEHAVIOUR DELEGATES*/ #endif @@ -490,6 +493,9 @@ IntPtr systemExceptionConstructorSystemString [DllImport(Constants.PluginName)] public static extern void TestScriptUpdate(int thisHandle); + + [DllImport(Constants.PluginName)] + public static extern void SetCsharpExceptionSystemNullReferenceException(int thisHandle, int param0); /*END MONOBEHAVIOUR IMPORTS*/ #endif @@ -578,6 +584,7 @@ public static void Open( TestScriptOnAnimatorIK = GetDelegate(libraryHandle, "TestScriptOnAnimatorIK"); TestScriptOnCollisionEnter = GetDelegate(libraryHandle, "TestScriptOnCollisionEnter"); TestScriptUpdate = GetDelegate(libraryHandle, "TestScriptUpdate"); + SetCsharpExceptionSystemNullReferenceException = GetDelegate(libraryHandle, "SetCsharpExceptionSystemNullReferenceException"); /*END MONOBEHAVIOUR GETDELEGATE CALLS*/ #endif @@ -691,7 +698,7 @@ static int SystemDiagnosticsStopwatchConstructor() var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Diagnostics.Stopwatch()); return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -707,7 +714,7 @@ static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHan var returnValue = thiz.ElapsedMilliseconds; return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(long); @@ -722,7 +729,7 @@ static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz.Start(); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -736,7 +743,7 @@ static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz.Reset(); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -751,7 +758,7 @@ static int UnityEngineObjectPropertyGetName(int thisHandle) var returnValue = thiz.name; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -767,7 +774,7 @@ static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); thiz.name = value; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -781,7 +788,7 @@ static int UnityEngineGameObjectConstructor() var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject()); return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -797,7 +804,7 @@ static int UnityEngineGameObjectConstructorSystemString(int nameHandle) var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject(name)); return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -813,7 +820,12 @@ static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) var returnValue = thiz.transform; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } - catch (Exception ex) + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -829,7 +841,7 @@ static int UnityEngineGameObjectMethodFindSystemString(int nameHandle) var returnValue = UnityEngine.GameObject.Find(name); return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -845,7 +857,12 @@ static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript var returnValue = thiz.AddComponent(); return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } - catch (Exception ex) + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -861,7 +878,7 @@ static int UnityEngineComponentPropertyGetTransform(int thisHandle) var returnValue = thiz.transform; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -877,7 +894,7 @@ static UnityEngine.Vector3 UnityEngineTransformPropertyGetPosition(int thisHandl var returnValue = thiz.position; return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(UnityEngine.Vector3); @@ -892,7 +909,11 @@ static void UnityEngineTransformPropertySetPosition(int thisHandle, ref UnityEng var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz.position = value; } - catch (Exception ex) + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -906,7 +927,7 @@ static void UnityEngineDebugMethodLogSystemObject(int messageHandle) var message = NativeScript.Bindings.ObjectStore.Get(messageHandle); UnityEngine.Debug.Log(message); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -920,7 +941,7 @@ static bool UnityEngineAssertionsAssertFieldGetRaiseExceptions() var returnValue = UnityEngine.Assertions.Assert.raiseExceptions; return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(bool); @@ -934,7 +955,7 @@ static void UnityEngineAssertionsAssertFieldSetRaiseExceptions(bool value) { UnityEngine.Assertions.Assert.raiseExceptions = value; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -949,7 +970,7 @@ static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_Sy var actual = (string)NativeScript.Bindings.ObjectStore.Get(actualHandle); UnityEngine.Assertions.Assert.AreEqual(expected, actual); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -964,7 +985,7 @@ static void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityE var actual = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(actualHandle); UnityEngine.Assertions.Assert.AreEqual(expected, actual); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -977,7 +998,7 @@ static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt3 { UnityEngine.AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -993,7 +1014,7 @@ static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInf int addressHandleNew = NativeScript.Bindings.ObjectStore.GetHandle(address); addressHandle = addressHandleNew; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -1006,7 +1027,7 @@ static void UnityEngineNetworkingNetworkTransportMethodInit() { UnityEngine.Networking.NetworkTransport.Init(); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -1020,7 +1041,7 @@ static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingl var returnValue = new UnityEngine.Vector3(x, y, z); return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(UnityEngine.Vector3); @@ -1035,7 +1056,7 @@ static float UnityEngineVector3PropertyGetMagnitude(ref UnityEngine.Vector3 thiz var returnValue = thiz.magnitude; return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(float); @@ -1049,7 +1070,7 @@ static void UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(re { thiz.Set(newX, newY, newZ); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -1065,7 +1086,7 @@ static void ReleaseUnityEngineRaycastHit(int handle) NativeScript.Bindings.StructStore.Remove(handle); } } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -1080,7 +1101,7 @@ static UnityEngine.Vector3 UnityEngineRaycastHitPropertyGetPoint(int thisHandle) var returnValue = thiz.point; return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(UnityEngine.Vector3); @@ -1096,7 +1117,7 @@ static void UnityEngineRaycastHitPropertySetPoint(int thisHandle, ref UnityEngin thiz.point = value; NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -1111,7 +1132,7 @@ static int UnityEngineRaycastHitPropertyGetTransform(int thisHandle) var returnValue = thiz.transform; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -1128,7 +1149,7 @@ static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble NativeScript.Bindings.StructStore>.Remove(handle); } } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -1143,7 +1164,7 @@ static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstruc var returnValue = NativeScript.Bindings.StructStore>.Store(new System.Collections.Generic.KeyValuePair(key, value)); return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -1159,7 +1180,7 @@ static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleProperty var returnValue = thiz.Key; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -1175,7 +1196,7 @@ static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePrope var returnValue = thiz.Value; return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(double); @@ -1190,7 +1211,7 @@ static int SystemCollectionsGenericListSystemStringConstructor() var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -1206,7 +1227,7 @@ static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int th var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); thiz.Add(item); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -1221,7 +1242,7 @@ static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemSt var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.LinkedListNode(value)); return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -1237,7 +1258,7 @@ static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(in var returnValue = thiz.Value; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -1253,7 +1274,7 @@ static void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(i var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); thiz.Value = value; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -1268,7 +1289,7 @@ static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemSt var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Runtime.CompilerServices.StrongBox(value)); return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -1284,7 +1305,7 @@ static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int t var returnValue = thiz.Value; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); @@ -1300,7 +1321,7 @@ static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); thiz.Value = value; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } @@ -1315,7 +1336,7 @@ static int SystemExceptionConstructorSystemString(int messageHandle) var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Exception(message)); return returnValue; } - catch (Exception ex) + catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 3055716..946662c 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -1,5 +1,6 @@ using System; using System.Collections; +using System.Collections.Generic; using System.IO; using System.Reflection; using System.Text; @@ -30,6 +31,7 @@ public static class GenerateBindings class JsonConstructor { public string[] ParamTypes; + public string[] Exceptions; } [Serializable] @@ -45,6 +47,7 @@ class JsonMethod public string[] ParamTypes; public JsonGenericParams[] GenericParams; public bool IsReadOnly; + public string[] Exceptions; } [Serializable] @@ -53,6 +56,8 @@ class JsonProperty public string Name; public bool GetIsReadOnly = true; public bool SetIsReadOnly; + public string[] GetExceptions; + public string[] SetExceptions; } [Serializable] @@ -481,6 +486,12 @@ static void DoPostCompileWork(bool canRefreshAssetDb) } } + // Generate exception setters + AppendExceptions( + doc, + assemblies, + builders); + RemoveTrailingChars(builders); if (dryRun) @@ -554,6 +565,10 @@ static Type[] GetTypes( string[] typeNames, Assembly[] assemblies) { + if (typeNames == null) + { + return new Type[0]; + } Type[] types = new Type[typeNames.Length]; for (int i = 0; i < typeNames.Length; ++i) { @@ -1147,6 +1162,7 @@ static void AppendType( ">.Remove(handle);\n\t\t\t}"); AppendCsharpFunctionEnd( typeof(void), + new Type[0], builders.CsharpFunctions); // C++ function pointer definition @@ -1197,9 +1213,9 @@ static void AppendType( builders.CppInitBody); builders.CppInitBody.Append("\tPlugin::RefCounts"); builders.CppInitBody.Append(funcNameSuffix); - builders.CppInitBody.Append(" = (int32_t*)calloc("); + builders.CppInitBody.Append(" = new int32_t["); builders.CppInitBody.Append(refCountsArrayLengthNameLower); - builders.CppInitBody.Append(", sizeof(int32_t));\n"); + builders.CppInitBody.Append("]();\n"); // C# init param for handle array length builders.CsharpInitParams.Append("\t\t\tint "); @@ -1329,6 +1345,7 @@ static void AppendType( typeParams, genericArgTypes, indent, + assemblies, builders); } } @@ -1536,6 +1553,10 @@ static void AppendConstructor( constructorParamTypeNames); } + Type[] exceptionTypes = GetTypes( + jsonCtor.Exceptions, + assemblies); + // Build uppercase function name builders.TempStrBuilder.Length = 0; AppendNamespace( @@ -1610,6 +1631,7 @@ static void AppendConstructor( AppendCsharpFunctionReturn( parameters, enclosingType, + exceptionTypes, builders.CsharpFunctions); } else @@ -1639,6 +1661,7 @@ static void AppendConstructor( AppendCsharpFunctionReturn( parameters, typeof(int), + exceptionTypes, builders.CsharpFunctions); } @@ -1775,6 +1798,7 @@ static void AppendProperty( Type[] typeParams, Type[] typeGenericArgumentTypes, int indent, + Assembly[] assemblies, StringBuilders builders) { PropertyInfo property = enclosingType.GetProperty( @@ -1783,6 +1807,12 @@ static void AppendProperty( property.PropertyType, typeGenericArgumentTypes, typeParams); + Type[] getExceptionTypes = GetTypes( + jsonProperty.GetExceptions, + assemblies); + Type[] setExceptionTypes = GetTypes( + jsonProperty.SetExceptions, + assemblies); MethodInfo getMethod = property.GetGetMethod(); if (getMethod != null && getMethod.IsPublic) { @@ -1804,6 +1834,7 @@ static void AppendProperty( typeParams, propertyType, indent, + getExceptionTypes, builders); } MethodInfo setMethod = property.GetSetMethod(); @@ -1827,6 +1858,7 @@ static void AppendProperty( typeParams, propertyType, indent, + setExceptionTypes, builders); } } @@ -1909,6 +1941,7 @@ StringBuilders builders field.FieldType, typeGenericArgumentTypes, typeTypeParams); + Type[] exceptionTypes = new Type[0]; AppendGetter( field.Name, "Field", @@ -1921,6 +1954,7 @@ StringBuilders builders typeTypeParams, fieldType, indent, + exceptionTypes, builders); ParameterInfo setParam = new ParameterInfo(); setParam.Name = "value"; @@ -1943,6 +1977,7 @@ StringBuilders builders typeTypeParams, fieldType, indent, + exceptionTypes, builders); } @@ -1982,6 +2017,10 @@ static void AppendMethod( jsonMethod.ParamTypes); } + Type[] exceptionTypes = GetTypes( + jsonMethod.Exceptions, + assemblies); + if (jsonMethod.GenericParams != null) { // Generate for each set of generic types @@ -2008,6 +2047,7 @@ static void AppendMethod( methodTypeParams, parameters, indent, + exceptionTypes, builders); } } @@ -2029,6 +2069,7 @@ static void AppendMethod( null, parameters, indent, + exceptionTypes, builders); } } @@ -2105,6 +2146,7 @@ static void AppendMethod( Type[] methodTypeParams, ParameterInfo[] parameters, int indent, + Type[] exceptionTypes, StringBuilders builders) { // Build uppercase function name @@ -2189,6 +2231,7 @@ static void AppendMethod( AppendCsharpFunctionReturn( parameters, returnType, + exceptionTypes, builders.CsharpFunctions); // C++ function pointer @@ -2519,92 +2562,25 @@ static void AppendMonoBehaviour( } // C# Delegate - builders.CsharpMonoBehaviourDelegates.Append( - "\t\tpublic delegate void "); - builders.CsharpMonoBehaviourDelegates.Append( - type.Name); - builders.CsharpMonoBehaviourDelegates.Append( - messageInfo.Name); - builders.CsharpMonoBehaviourDelegates.Append( - "Delegate(int thisHandle"); - if (numParams > 0) - { - builders.CsharpMonoBehaviourDelegates.Append(", "); - } - for (int i = 0; i < numParams; ++i) - { - ParameterInfo param = parameters[i]; - if (param.Kind == TypeKind.FullStruct) - { - AppendCsharpTypeName( - param.ParameterType, - builders.CsharpMonoBehaviourDelegates); - builders.CsharpMonoBehaviourDelegates.Append(" param"); - builders.CsharpMonoBehaviourDelegates.Append(i); - } - else - { - builders.CsharpMonoBehaviourDelegates.Append("int param"); - builders.CsharpMonoBehaviourDelegates.Append(i); - } - if (i != numParams-1) - { - builders.CsharpMonoBehaviourDelegates.Append(", "); - } - } - builders.CsharpMonoBehaviourDelegates.Append(");\n"); - builders.CsharpMonoBehaviourDelegates.Append("\t\tpublic static "); - builders.CsharpMonoBehaviourDelegates.Append(type.Name); - builders.CsharpMonoBehaviourDelegates.Append(messageInfo.Name); - builders.CsharpMonoBehaviourDelegates.Append("Delegate "); - builders.CsharpMonoBehaviourDelegates.Append(type.Name); - builders.CsharpMonoBehaviourDelegates.Append(messageInfo.Name); - builders.CsharpMonoBehaviourDelegates.Append(";\n\t\t\n"); + AppendCsharpDelegate( + false, + type.Name, + messageInfo.Name, + parameters, + builders.CsharpMonoBehaviourDelegates); // C# Import - builders.CsharpMonoBehaviourImports.Append("\t\t[DllImport(Constants.PluginName)]\n"); - builders.CsharpMonoBehaviourImports.Append("\t\tpublic static extern void "); - builders.CsharpMonoBehaviourImports.Append(type.Name); - builders.CsharpMonoBehaviourImports.Append(messageInfo.Name); - builders.CsharpMonoBehaviourImports.Append("(int thisHandle"); - if (numParams > 0) - { - builders.CsharpMonoBehaviourImports.Append(", "); - } - for (int i = 0; i < numParams; ++i) - { - ParameterInfo param = parameters[i]; - if (param.Kind == TypeKind.FullStruct) - { - AppendCsharpTypeName( - param.ParameterType, - builders.CsharpMonoBehaviourImports); - builders.CsharpMonoBehaviourImports.Append(" param"); - builders.CsharpMonoBehaviourImports.Append(i); - } - else - { - builders.CsharpMonoBehaviourImports.Append("int param"); - builders.CsharpMonoBehaviourImports.Append(i); - } - if (i != numParams-1) - { - builders.CsharpMonoBehaviourImports.Append(", "); - } - } - builders.CsharpMonoBehaviourImports.Append(");\n\t\t\n"); + AppendCsharpImport( + type.Name, + messageInfo.Name, + parameters, + builders.CsharpMonoBehaviourImports); // C# GetDelegate Call - builders.CsharpMonoBehaviourGetDelegateCalls.Append("\t\t\t"); - builders.CsharpMonoBehaviourGetDelegateCalls.Append(type.Name); - builders.CsharpMonoBehaviourGetDelegateCalls.Append(messageInfo.Name); - builders.CsharpMonoBehaviourGetDelegateCalls.Append(" = GetDelegate<"); - builders.CsharpMonoBehaviourGetDelegateCalls.Append(type.Name); - builders.CsharpMonoBehaviourGetDelegateCalls.Append(messageInfo.Name); - builders.CsharpMonoBehaviourGetDelegateCalls.Append("Delegate>(libraryHandle, \""); - builders.CsharpMonoBehaviourGetDelegateCalls.Append(type.Name); - builders.CsharpMonoBehaviourGetDelegateCalls.Append(messageInfo.Name); - builders.CsharpMonoBehaviourGetDelegateCalls.Append("\");\n"); + AppendCsharpGetDelegateCall( + type.Name, + messageInfo.Name, + builders.CsharpMonoBehaviourGetDelegateCalls); // C++ Message builders.CppMonoBehaviourMessages.Append("DLLEXPORT void "); @@ -2708,6 +2684,310 @@ static void AppendMonoBehaviour( builders.CppTypeDefinitions); } + static void AppendCsharpDelegate( + bool isStatic, + string typeName, + string funcName, + ParameterInfo[] parameters, + StringBuilder output) + { + output.Append("\t\tpublic delegate void "); + output.Append(typeName); + output.Append(funcName); + output.Append("Delegate("); + if (!isStatic) + { + output.Append("int thisHandle"); + if (parameters.Length > 0) + { + output.Append(", "); + } + } + for (int i = 0; i < parameters.Length; ++i) + { + ParameterInfo param = parameters[i]; + if (param.Kind == TypeKind.FullStruct) + { + AppendCsharpTypeName( + param.ParameterType, + output); + output.Append(" param"); + output.Append(i); + } + else + { + output.Append("int param"); + output.Append(i); + } + if (i != parameters.Length-1) + { + output.Append(", "); + } + } + output.Append(");\n"); + output.Append("\t\tpublic static "); + output.Append(typeName); + output.Append(funcName); + output.Append("Delegate "); + output.Append(typeName); + output.Append(funcName); + output.Append(";\n\t\t\n"); + } + + static void AppendCsharpGetDelegateCall( + string typeName, + string funcName, + StringBuilder output) + { + output.Append("\t\t\t"); + output.Append(typeName); + output.Append(funcName); + output.Append(" = GetDelegate<"); + output.Append(typeName); + output.Append(funcName); + output.Append("Delegate>(libraryHandle, \""); + output.Append(typeName); + output.Append(funcName); + output.Append("\");\n"); + } + + static void AppendCsharpImport( + string typeName, + string funcName, + ParameterInfo[] parameters, + StringBuilder output + ) + { + output.Append("\t\t[DllImport(Constants.PluginName)]\n"); + output.Append("\t\tpublic static extern void "); + output.Append(typeName); + output.Append(funcName); + output.Append("(int thisHandle"); + if (parameters.Length > 0) + { + output.Append(", "); + } + for (int i = 0; i < parameters.Length; ++i) + { + ParameterInfo param = parameters[i]; + if (param.Kind == TypeKind.FullStruct) + { + AppendCsharpTypeName( + param.ParameterType, + output); + output.Append(" param"); + output.Append(i); + } + else + { + output.Append("int param"); + output.Append(i); + } + if (i != parameters.Length-1) + { + output.Append(", "); + } + } + output.Append(");\n\t\t\n"); + } + + static void AppendExceptions( + JsonDocument doc, + Assembly[] assemblies, + StringBuilders builders) + { + // Gather all specific types of exceptions + Dictionary exceptionTypes = new Dictionary(); + if (doc.Types != null) + { + foreach (JsonType jsonType in doc.Types) + { + if (jsonType.Methods != null) + { + foreach (JsonMethod jsonMethod in jsonType.Methods) + { + if (jsonMethod.Exceptions != null) + { + AddUniqueTypes( + jsonMethod.Exceptions, + exceptionTypes, + assemblies); + } + } + } + if (jsonType.Constructors != null) + { + foreach (JsonConstructor jsonCtor in jsonType.Constructors) + { + if (jsonCtor.Exceptions != null) + { + AddUniqueTypes( + jsonCtor.Exceptions, + exceptionTypes, + assemblies); + } + } + } + if (jsonType.Properties != null) + { + foreach (JsonProperty jsonProperty in jsonType.Properties) + { + if (jsonProperty.GetExceptions != null) + { + AddUniqueTypes( + jsonProperty.GetExceptions, + exceptionTypes, + assemblies); + } + if (jsonProperty.SetExceptions != null) + { + AddUniqueTypes( + jsonProperty.SetExceptions, + exceptionTypes, + assemblies); + } + } + } + } + } + + foreach (Type exceptionType in exceptionTypes.Values) + { + // Build function name + builders.TempStrBuilder.Length = 0; + AppendCsharpSetCsharpExceptionFunctionName( + exceptionType, + builders.TempStrBuilder); + string funcName = builders.TempStrBuilder.ToString(); + + // C++ thrower type + int throwerIndent = AppendNamespaceBeginning( + exceptionType.Namespace, + builders.CppMethodDefinitions); + AppendIndent( + throwerIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("struct "); + builders.CppMethodDefinitions.Append(exceptionType.Name); + builders.CppMethodDefinitions.Append("Thrower : "); + AppendCppTypeName( + exceptionType, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + AppendIndent( + throwerIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + throwerIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(exceptionType.Name); + builders.CppMethodDefinitions.Append("Thrower(int32_t handle)\n"); + AppendIndent( + throwerIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(": "); + AppendCppTypeName( + exceptionType, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("(handle)\n"); + AppendIndent( + throwerIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + throwerIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + throwerIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + AppendIndent( + throwerIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("virtual void ThrowReferenceToThis()\n"); + AppendIndent( + throwerIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + throwerIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("throw *this;\n"); + AppendIndent( + throwerIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + throwerIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("};\n"); + AppendNamespaceEnding( + throwerIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + + // C++ function + builders.CppMethodDefinitions.Append("DLLEXPORT void "); + builders.CppMethodDefinitions.Append(funcName); + builders.CppMethodDefinitions.Append("(int32_t handle)\n"); + builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.Append("\tdelete Plugin::unhandledCsharpException;"); + builders.CppMethodDefinitions.Append("\tPlugin::unhandledCsharpException = new "); + AppendCppTypeName( + exceptionType, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Thrower(handle);\n"); + builders.CppMethodDefinitions.Append("}\n\n"); + + // Build parameters + ParameterInfo[] parameters = ConvertParameters( + new Type[]{ typeof(int) }); + + // C# imports + AppendCsharpImport( + string.Empty, + funcName, + parameters, + builders.CsharpMonoBehaviourImports); + + // C# delegate + AppendCsharpDelegate( + true, + string.Empty, + funcName, + parameters, + builders.CsharpMonoBehaviourDelegates + ); + + // C# GetDelegate call + AppendCsharpGetDelegateCall( + string.Empty, + funcName, + builders.CsharpMonoBehaviourGetDelegateCalls); + } + } + + static void AddUniqueTypes( + string[] typeNames, + Dictionary types, + Assembly[] assemblies) + { + foreach (string typeName in typeNames) + { + if (!types.ContainsKey(typeName)) + { + Type type = GetType( + typeName, + assemblies); + types.Add( + typeName, + type); + } + } + } + static void AppendGetter( string fieldName, string syntaxType, @@ -2720,6 +3000,7 @@ static void AppendGetter( Type[] enclosingTypeParams, Type fieldType, int indent, + Type[] exceptionTypes, StringBuilders builders) { // Build uppercase field name @@ -2807,6 +3088,7 @@ static void AppendGetter( AppendCsharpFunctionReturn( parameters, fieldType, + exceptionTypes, builders.CsharpFunctions); // C++ function pointer @@ -2890,6 +3172,7 @@ static void AppendSetter( Type[] enclosingTypeParams, Type fieldType, int indent, + Type[] exceptionTypes, StringBuilders builders) { // Build uppercased field name @@ -2978,6 +3261,7 @@ static void AppendSetter( AppendCsharpFunctionReturn( parameters, typeof(void), + exceptionTypes, builders.CsharpFunctions); // C++ function pointer @@ -4103,6 +4387,7 @@ static void AppendStructStoreReplace( static void AppendCsharpFunctionReturn( ParameterInfo[] parameters, Type returnType, + Type[] exceptionTypes, StringBuilder output) { // Store reference out and ref params and overwrite handles @@ -4158,18 +4443,48 @@ static void AppendCsharpFunctionReturn( // Returning ends the function AppendCsharpFunctionEnd( returnType, + exceptionTypes, output); } static void AppendCsharpFunctionEnd( Type returnType, + Type[] exceptionTypes, StringBuilder output) { output.Append('\n'); output.Append("\t\t\t}\n"); - output.Append("\t\t\tcatch (Exception ex)\n"); + foreach (Type exceptionType in exceptionTypes) + { + AppendCsharpCatchException( + exceptionType, + returnType, + output); + } + AppendCsharpCatchException( + typeof(Exception), + returnType, + output); + output.Append("\t\t}\n"); + output.Append("\t\t\n"); + } + + static void AppendCsharpCatchException( + Type exceptionType, + Type returnType, + StringBuilder output) + { + output.Append("\t\t\tcatch ("); + AppendCsharpTypeName( + exceptionType, + output); + output.Append(" ex)\n"); output.Append("\t\t\t{\n"); - output.Append("\t\t\t\tNativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex));\n"); + output.Append("\t\t\t\tNativeScript.Bindings."); + AppendCsharpSetCsharpExceptionFunctionName( + exceptionType, + output); + output.Append("(NativeScript.Bindings.ObjectStore.Store(ex));\n"); if (returnType != typeof(void)) { output.Append("\t\t\t\treturn default("); @@ -4186,8 +4501,24 @@ static void AppendCsharpFunctionEnd( output.Append(");\n"); } output.Append("\t\t\t}\n"); - output.Append("\t\t}\n"); - output.Append("\t\t\n"); + } + + static void AppendCsharpSetCsharpExceptionFunctionName( + Type exceptionType, + StringBuilder output + ) + { + output.Append("SetCsharpException"); + if (exceptionType != typeof(Exception)) + { + AppendNamespace( + exceptionType.Namespace, + string.Empty, + output); + AppendWithoutGenericTypeCountSuffix( + exceptionType.Name, + output); + } } static void AppendCsharpParameterDeclaration( @@ -4477,11 +4808,13 @@ static void AppendCppPluginFunctionCall( AppendIndent(indent, output); output.Append("{\n"); AppendIndent(indent + 1, output); - output.Append("System::Exception ex(Plugin::unhandledCsharpException);\n"); + output.Append("System::Exception* ex = Plugin::unhandledCsharpException;\n"); AppendIndent(indent + 1, output); output.Append("Plugin::unhandledCsharpException = nullptr;\n"); AppendIndent(indent + 1, output); - output.Append("throw ex;\n"); + output.Append("ex->ThrowReferenceToThis();\n"); + AppendIndent(indent + 1, output); + output.Append("delete ex;\n"); AppendIndent(indent, output); output.Append("}\n"); diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index b25e613..0e9b288 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -62,12 +62,18 @@ "MyGame.MonoBehaviours.TestScript" ] } + ], + "Exceptions": [ + "System.NullReferenceException" ] } ], "Properties": [ { - "Name": "transform" + "Name": "transform", + "GetExceptions": [ + "System.NullReferenceException" + ] } ] }, @@ -83,7 +89,10 @@ "Name": "UnityEngine.Transform", "Properties": [ { - "Name": "position" + "Name": "position", + "SetExceptions": [ + "System.NullReferenceException" + ] } ] }, @@ -328,6 +337,12 @@ ] } ] + }, + { + "Name": "System.SystemException" + }, + { + "Name": "System.NullReferenceException" } ], "MonoBehaviours": [ diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 9333792..fb5ec82 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -174,7 +174,7 @@ namespace Plugin namespace Plugin { // An unhandled exception caused by C++ calling into C# - System::Exception unhandledCsharpException(nullptr); + System::Exception* unhandledCsharpException = nullptr; } //////////////////////////////////////////////////////////////// @@ -209,6 +209,11 @@ namespace System return Handle != 0; } + void Object::ThrowReferenceToThis() + { + throw *this; + } + ValueType::ValueType(std::nullptr_t n) : Object(0) { @@ -398,9 +403,10 @@ namespace System auto returnValue = Plugin::SystemDiagnosticsStopwatchConstructor(); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } Handle = returnValue; if (returnValue) @@ -414,9 +420,10 @@ namespace System auto returnValue = Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -426,9 +433,10 @@ namespace System Plugin::SystemDiagnosticsStopwatchMethodStart(Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } @@ -437,9 +445,10 @@ namespace System Plugin::SystemDiagnosticsStopwatchMethodReset(Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } } @@ -538,9 +547,10 @@ namespace UnityEngine auto returnValue = Plugin::UnityEngineObjectPropertyGetName(Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -550,9 +560,10 @@ namespace UnityEngine Plugin::UnityEngineObjectPropertySetName(Handle, value.Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } } @@ -651,9 +662,10 @@ namespace UnityEngine auto returnValue = Plugin::UnityEngineGameObjectConstructor(); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } Handle = returnValue; if (returnValue) @@ -668,9 +680,10 @@ namespace UnityEngine auto returnValue = Plugin::UnityEngineGameObjectConstructorSystemString(name.Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } Handle = returnValue; if (returnValue) @@ -684,9 +697,10 @@ namespace UnityEngine auto returnValue = Plugin::UnityEngineGameObjectPropertyGetTransform(Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -696,9 +710,10 @@ namespace UnityEngine auto returnValue = Plugin::UnityEngineGameObjectMethodFindSystemString(name.Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -708,9 +723,10 @@ namespace UnityEngine auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -809,9 +825,10 @@ namespace UnityEngine auto returnValue = Plugin::UnityEngineComponentPropertyGetTransform(Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -910,9 +927,10 @@ namespace UnityEngine auto returnValue = Plugin::UnityEngineTransformPropertyGetPosition(Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -922,9 +940,10 @@ namespace UnityEngine Plugin::UnityEngineTransformPropertySetPosition(Handle, value); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } } @@ -1022,9 +1041,10 @@ namespace UnityEngine Plugin::UnityEngineDebugMethodLogSystemObject(message.Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } } @@ -1038,9 +1058,10 @@ namespace UnityEngine auto returnValue = Plugin::UnityEngineAssertionsAssertFieldGetRaiseExceptions(); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -1050,9 +1071,10 @@ namespace UnityEngine Plugin::UnityEngineAssertionsAssertFieldSetRaiseExceptions(value); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } @@ -1061,9 +1083,10 @@ namespace UnityEngine Plugin::UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(expected.Handle, actual.Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } @@ -1072,9 +1095,10 @@ namespace UnityEngine Plugin::UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(expected.Handle, actual.Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } } @@ -1440,9 +1464,10 @@ namespace UnityEngine Plugin::UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(bufferLength, numBuffers); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } } @@ -1543,9 +1568,10 @@ namespace UnityEngine Plugin::UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(hostId, &addressHandle, port, error); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } if (address->Handle != addressHandle) { @@ -1566,9 +1592,10 @@ namespace UnityEngine Plugin::UnityEngineNetworkingNetworkTransportMethodInit(); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } } @@ -1585,9 +1612,10 @@ namespace UnityEngine auto returnValue = Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(x, y, z); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } *this = returnValue; } @@ -1597,9 +1625,10 @@ namespace UnityEngine auto returnValue = Plugin::UnityEngineVector3PropertyGetMagnitude(this); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -1609,9 +1638,10 @@ namespace UnityEngine Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(this, newX, newY, newZ); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } } @@ -1709,9 +1739,10 @@ namespace UnityEngine auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetPoint(Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -1721,9 +1752,10 @@ namespace UnityEngine Plugin::UnityEngineRaycastHitPropertySetPoint(Handle, value); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } @@ -1732,9 +1764,10 @@ namespace UnityEngine auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetTransform(Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -1838,9 +1871,10 @@ namespace System auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(key.Handle, value); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } Handle = returnValue; if (returnValue) @@ -1854,9 +1888,10 @@ namespace System auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -1866,9 +1901,10 @@ namespace System auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -1974,9 +2010,10 @@ namespace System auto returnValue = Plugin::SystemCollectionsGenericListSystemStringConstructor(); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } Handle = returnValue; if (returnValue) @@ -1990,9 +2027,10 @@ namespace System Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString(Handle, item.Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } } @@ -2097,9 +2135,10 @@ namespace System auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(value.Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } Handle = returnValue; if (returnValue) @@ -2113,9 +2152,10 @@ namespace System auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -2125,9 +2165,10 @@ namespace System Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(Handle, value.Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } } @@ -2232,9 +2273,10 @@ namespace System auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(value.Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } Handle = returnValue; if (returnValue) @@ -2248,9 +2290,10 @@ namespace System auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } return returnValue; } @@ -2260,9 +2303,10 @@ namespace System Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(Handle, value.Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } } } @@ -2553,9 +2597,10 @@ namespace System auto returnValue = Plugin::SystemExceptionConstructorSystemString(message.Handle); if (Plugin::unhandledCsharpException) { - System::Exception ex(Plugin::unhandledCsharpException); + System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - throw ex; + ex->ThrowReferenceToThis(); + delete ex; } Handle = returnValue; if (returnValue) @@ -2565,6 +2610,184 @@ namespace System } } +namespace System +{ + SystemException::SystemException(std::nullptr_t n) + : System::Exception(0) + { + } + + SystemException::SystemException(int32_t handle) + : System::Exception(handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + SystemException::SystemException(const SystemException& other) + : System::Exception(other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + SystemException::SystemException(SystemException&& other) + : System::Exception(other.Handle) + { + other.Handle = 0; + } + + SystemException::~SystemException() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + SystemException& SystemException::operator=(const SystemException& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + SystemException& SystemException::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + SystemException& SystemException::operator=(SystemException&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool SystemException::operator==(const SystemException& other) const + { + return Handle == other.Handle; + } + + bool SystemException::operator!=(const SystemException& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + NullReferenceException::NullReferenceException(std::nullptr_t n) + : System::SystemException(0) + { + } + + NullReferenceException::NullReferenceException(int32_t handle) + : System::SystemException(handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + NullReferenceException::NullReferenceException(const NullReferenceException& other) + : System::SystemException(other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + NullReferenceException::NullReferenceException(NullReferenceException&& other) + : System::SystemException(other.Handle) + { + other.Handle = 0; + } + + NullReferenceException::~NullReferenceException() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + NullReferenceException& NullReferenceException::operator=(const NullReferenceException& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + NullReferenceException& NullReferenceException::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + NullReferenceException& NullReferenceException::operator=(NullReferenceException&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool NullReferenceException::operator==(const NullReferenceException& other) const + { + return Handle == other.Handle; + } + + bool NullReferenceException::operator!=(const NullReferenceException& other) const + { + return Handle != other.Handle; + } +} + namespace MyGame { namespace MonoBehaviours @@ -2656,6 +2879,27 @@ namespace MyGame } } } + +namespace System +{ + struct NullReferenceExceptionThrower : System::NullReferenceException + { + NullReferenceExceptionThrower(int32_t handle) + : System::NullReferenceException(handle) + { + } + + virtual void ThrowReferenceToThis() + { + throw *this; + } + }; +} + +DLLEXPORT void SetCsharpExceptionSystemNullReferenceException(int32_t handle) +{ + delete Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = new System::NullReferenceExceptionThrower(handle); +} /*END METHOD DEFINITIONS*/ //////////////////////////////////////////////////////////////// @@ -2726,9 +2970,7 @@ DLLEXPORT void Init( // Init managed object ref counting Plugin::RefCountsLenClass = maxManagedObjects; - Plugin::RefCountsClass = (int32_t*)calloc( - maxManagedObjects, - sizeof(int32_t)); + Plugin::RefCountsClass = new int32_t[maxManagedObjects]; // Init pointers to C# functions Plugin::StringNew = stringNew; @@ -2762,13 +3004,13 @@ DLLEXPORT void Init( Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle = unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle; Plugin::ReleaseUnityEngineRaycastHit = releaseUnityEngineRaycastHit; Plugin::RefCountsLenUnityEngineRaycastHit = refCountsLenUnityEngineRaycastHit; - Plugin::RefCountsUnityEngineRaycastHit = (int32_t*)calloc(refCountsLenUnityEngineRaycastHit, sizeof(int32_t)); + Plugin::RefCountsUnityEngineRaycastHit = new int32_t[refCountsLenUnityEngineRaycastHit](); Plugin::UnityEngineRaycastHitPropertyGetPoint = unityEngineRaycastHitPropertyGetPoint; Plugin::UnityEngineRaycastHitPropertySetPoint = unityEngineRaycastHitPropertySetPoint; Plugin::UnityEngineRaycastHitPropertyGetTransform = unityEngineRaycastHitPropertyGetTransform; Plugin::ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; Plugin::RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = refCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; - Plugin::RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = (int32_t*)calloc(refCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, sizeof(int32_t)); + Plugin::RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = new int32_t[refCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble](); Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble = systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble; Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey; Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue; @@ -2801,7 +3043,7 @@ DLLEXPORT void Init( // Receive an unhandled exception from C# DLLEXPORT void SetCsharpException(int32_t handle) { - Plugin::unhandledCsharpException = System::Exception(handle); + Plugin::unhandledCsharpException = new System::Exception(handle); } /*BEGIN MONOBEHAVIOUR MESSAGES*/ diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index b585c84..232e96a 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -143,9 +143,11 @@ namespace System int32_t Handle; Object(std::nullptr_t n); Object(int32_t handle); + virtual ~Object() = default; operator bool() const; bool operator==(std::nullptr_t other) const; bool operator!=(std::nullptr_t other) const; + virtual void ThrowReferenceToThis(); }; struct ValueType : Object @@ -397,6 +399,16 @@ namespace System struct Exception; } +namespace System +{ + struct SystemException; +} + +namespace System +{ + struct NullReferenceException; +} + namespace MyGame { namespace MonoBehaviours @@ -833,6 +845,40 @@ namespace System }; } +namespace System +{ + struct SystemException : System::Exception + { + SystemException(std::nullptr_t n); + SystemException(int32_t handle); + SystemException(const SystemException& other); + SystemException(SystemException&& other); + ~SystemException(); + SystemException& operator=(const SystemException& other); + SystemException& operator=(std::nullptr_t other); + SystemException& operator=(SystemException&& other); + bool operator==(const SystemException& other) const; + bool operator!=(const SystemException& other) const; + }; +} + +namespace System +{ + struct NullReferenceException : System::SystemException + { + NullReferenceException(std::nullptr_t n); + NullReferenceException(int32_t handle); + NullReferenceException(const NullReferenceException& other); + NullReferenceException(NullReferenceException&& other); + ~NullReferenceException(); + NullReferenceException& operator=(const NullReferenceException& other); + NullReferenceException& operator=(std::nullptr_t other); + NullReferenceException& operator=(NullReferenceException&& other); + bool operator==(const NullReferenceException& other) const; + bool operator!=(const NullReferenceException& other) const; + }; +} + namespace MyGame { namespace MonoBehaviours From 83f9c8bf7406e2a41dffa83cc9e60bc79c1fa922 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 24 Sep 2017 18:26:33 -0700 Subject: [PATCH 09/95] Handle NullReferenceException by default --- Unity/Assets/NativeScript/Bindings.cs | 178 ++++++++++++++++++ .../NativeScript/Editor/GenerateBindings.cs | 9 + 2 files changed, 187 insertions(+) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index ae2c3bf..178631e 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -698,6 +698,11 @@ static int SystemDiagnosticsStopwatchConstructor() var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Diagnostics.Stopwatch()); return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -714,6 +719,11 @@ static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHan var returnValue = thiz.ElapsedMilliseconds; return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(long); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -729,6 +739,10 @@ static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz.Start(); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -743,6 +757,10 @@ static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz.Reset(); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -758,6 +776,11 @@ static int UnityEngineObjectPropertyGetName(int thisHandle) var returnValue = thiz.name; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -774,6 +797,10 @@ static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); thiz.name = value; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -788,6 +815,11 @@ static int UnityEngineGameObjectConstructor() var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject()); return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -804,6 +836,11 @@ static int UnityEngineGameObjectConstructorSystemString(int nameHandle) var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject(name)); return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -841,6 +878,11 @@ static int UnityEngineGameObjectMethodFindSystemString(int nameHandle) var returnValue = UnityEngine.GameObject.Find(name); return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -878,6 +920,11 @@ static int UnityEngineComponentPropertyGetTransform(int thisHandle) var returnValue = thiz.transform; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -894,6 +941,11 @@ static UnityEngine.Vector3 UnityEngineTransformPropertyGetPosition(int thisHandl var returnValue = thiz.position; return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -927,6 +979,10 @@ static void UnityEngineDebugMethodLogSystemObject(int messageHandle) var message = NativeScript.Bindings.ObjectStore.Get(messageHandle); UnityEngine.Debug.Log(message); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -941,6 +997,11 @@ static bool UnityEngineAssertionsAssertFieldGetRaiseExceptions() var returnValue = UnityEngine.Assertions.Assert.raiseExceptions; return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -955,6 +1016,10 @@ static void UnityEngineAssertionsAssertFieldSetRaiseExceptions(bool value) { UnityEngine.Assertions.Assert.raiseExceptions = value; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -970,6 +1035,10 @@ static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_Sy var actual = (string)NativeScript.Bindings.ObjectStore.Get(actualHandle); UnityEngine.Assertions.Assert.AreEqual(expected, actual); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -985,6 +1054,10 @@ static void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityE var actual = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(actualHandle); UnityEngine.Assertions.Assert.AreEqual(expected, actual); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -998,6 +1071,10 @@ static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt3 { UnityEngine.AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1014,6 +1091,10 @@ static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInf int addressHandleNew = NativeScript.Bindings.ObjectStore.GetHandle(address); addressHandle = addressHandleNew; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1027,6 +1108,10 @@ static void UnityEngineNetworkingNetworkTransportMethodInit() { UnityEngine.Networking.NetworkTransport.Init(); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1041,6 +1126,11 @@ static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingl var returnValue = new UnityEngine.Vector3(x, y, z); return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1056,6 +1146,11 @@ static float UnityEngineVector3PropertyGetMagnitude(ref UnityEngine.Vector3 thiz var returnValue = thiz.magnitude; return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1070,6 +1165,10 @@ static void UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(re { thiz.Set(newX, newY, newZ); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1086,6 +1185,10 @@ static void ReleaseUnityEngineRaycastHit(int handle) NativeScript.Bindings.StructStore.Remove(handle); } } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1101,6 +1204,11 @@ static UnityEngine.Vector3 UnityEngineRaycastHitPropertyGetPoint(int thisHandle) var returnValue = thiz.point; return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1117,6 +1225,10 @@ static void UnityEngineRaycastHitPropertySetPoint(int thisHandle, ref UnityEngin thiz.point = value; NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1132,6 +1244,11 @@ static int UnityEngineRaycastHitPropertyGetTransform(int thisHandle) var returnValue = thiz.transform; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1149,6 +1266,10 @@ static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble NativeScript.Bindings.StructStore>.Remove(handle); } } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1164,6 +1285,11 @@ static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstruc var returnValue = NativeScript.Bindings.StructStore>.Store(new System.Collections.Generic.KeyValuePair(key, value)); return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1180,6 +1306,11 @@ static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleProperty var returnValue = thiz.Key; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1196,6 +1327,11 @@ static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePrope var returnValue = thiz.Value; return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(double); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1211,6 +1347,11 @@ static int SystemCollectionsGenericListSystemStringConstructor() var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1227,6 +1368,10 @@ static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int th var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); thiz.Add(item); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1242,6 +1387,11 @@ static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemSt var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.LinkedListNode(value)); return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1258,6 +1408,11 @@ static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(in var returnValue = thiz.Value; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1274,6 +1429,10 @@ static void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(i var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); thiz.Value = value; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1289,6 +1448,11 @@ static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemSt var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Runtime.CompilerServices.StrongBox(value)); return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1305,6 +1469,11 @@ static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int t var returnValue = thiz.Value; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1321,6 +1490,10 @@ static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); thiz.Value = value; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -1336,6 +1509,11 @@ static int SystemExceptionConstructorSystemString(int messageHandle) var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Exception(message)); return returnValue; } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 946662c..4e176f5 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -4454,6 +4454,15 @@ static void AppendCsharpFunctionEnd( { output.Append('\n'); output.Append("\t\t\t}\n"); + if (Array.IndexOf( + exceptionTypes, + typeof(NullReferenceException)) < 0) + { + AppendCsharpCatchException( + typeof(NullReferenceException), + returnType, + output); + } foreach (Type exceptionType in exceptionTypes) { AppendCsharpCatchException( From a48c00708a1738c3606a82aa356ced2abb84e5ba Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 24 Sep 2017 18:48:23 -0700 Subject: [PATCH 10/95] Fix whitespace formatting for specific exception type handlers in C++. --- Unity/Assets/NativeScript/Editor/GenerateBindings.cs | 2 +- Unity/CppSource/NativeScript/Bindings.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 4e176f5..71b5c72 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -2933,7 +2933,7 @@ static void AppendExceptions( builders.CppMethodDefinitions.Append(funcName); builders.CppMethodDefinitions.Append("(int32_t handle)\n"); builders.CppMethodDefinitions.Append("{\n"); - builders.CppMethodDefinitions.Append("\tdelete Plugin::unhandledCsharpException;"); + builders.CppMethodDefinitions.Append("\tdelete Plugin::unhandledCsharpException;\n"); builders.CppMethodDefinitions.Append("\tPlugin::unhandledCsharpException = new "); AppendCppTypeName( exceptionType, diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index fb5ec82..40719d1 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -2898,7 +2898,8 @@ namespace System DLLEXPORT void SetCsharpExceptionSystemNullReferenceException(int32_t handle) { - delete Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = new System::NullReferenceExceptionThrower(handle); + delete Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = new System::NullReferenceExceptionThrower(handle); } /*END METHOD DEFINITIONS*/ From 3fab181803f5c784c3350621a0dbb48c8f95fda3 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 24 Sep 2017 19:04:00 -0700 Subject: [PATCH 11/95] Clarify some variable names now that they're not just used for MonoBehaviours --- .../NativeScript/Editor/GenerateBindings.cs | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 71b5c72..c3db5d1 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -103,11 +103,11 @@ class StringBuilders new StringBuilder(InitialStringBuilderCapacity); public StringBuilder CsharpMonoBehaviours = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CsharpMonoBehaviourDelegates = + public StringBuilder CsharpDelegates = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CsharpMonoBehaviourImports = + public StringBuilder CsharpImports = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CsharpMonoBehaviourGetDelegateCalls = + public StringBuilder CsharpGetDelegateCalls = new StringBuilder(InitialStringBuilderCapacity); public StringBuilder CppFunctionPointers = new StringBuilder(InitialStringBuilderCapacity); @@ -2567,20 +2567,20 @@ static void AppendMonoBehaviour( type.Name, messageInfo.Name, parameters, - builders.CsharpMonoBehaviourDelegates); + builders.CsharpDelegates); // C# Import AppendCsharpImport( type.Name, messageInfo.Name, parameters, - builders.CsharpMonoBehaviourImports); + builders.CsharpImports); // C# GetDelegate Call AppendCsharpGetDelegateCall( type.Name, messageInfo.Name, - builders.CsharpMonoBehaviourGetDelegateCalls); + builders.CsharpGetDelegateCalls); // C++ Message builders.CppMonoBehaviourMessages.Append("DLLEXPORT void "); @@ -2950,7 +2950,7 @@ static void AppendExceptions( string.Empty, funcName, parameters, - builders.CsharpMonoBehaviourImports); + builders.CsharpImports); // C# delegate AppendCsharpDelegate( @@ -2958,14 +2958,14 @@ static void AppendExceptions( string.Empty, funcName, parameters, - builders.CsharpMonoBehaviourDelegates + builders.CsharpDelegates ); // C# GetDelegate call AppendCsharpGetDelegateCall( string.Empty, funcName, - builders.CsharpMonoBehaviourGetDelegateCalls); + builders.CsharpGetDelegateCalls); } } @@ -5233,13 +5233,13 @@ static void LogStringBuilders( builders.CsharpMonoBehaviours); LogStringBuilder( "C# MonoBehaviour Delegates", - builders.CsharpMonoBehaviourDelegates); + builders.CsharpDelegates); LogStringBuilder( "C# MonoBehaviour Imports", - builders.CsharpMonoBehaviourImports); + builders.CsharpImports); LogStringBuilder( "C# MonoBehaviour GetDelegate Calls", - builders.CsharpMonoBehaviourGetDelegateCalls); + builders.CsharpGetDelegateCalls); LogStringBuilder( "C++ function pointers", builders.CppFunctionPointers); @@ -5282,9 +5282,9 @@ static void RemoveTrailingChars( RemoveTrailingChars(builders.CsharpInitCall); RemoveTrailingChars(builders.CsharpFunctions); RemoveTrailingChars(builders.CsharpMonoBehaviours); - RemoveTrailingChars(builders.CsharpMonoBehaviourDelegates); - RemoveTrailingChars(builders.CsharpMonoBehaviourImports); - RemoveTrailingChars(builders.CsharpMonoBehaviourGetDelegateCalls); + RemoveTrailingChars(builders.CsharpDelegates); + RemoveTrailingChars(builders.CsharpImports); + RemoveTrailingChars(builders.CsharpGetDelegateCalls); RemoveTrailingChars(builders.CppFunctionPointers); RemoveTrailingChars(builders.CppTypeDeclarations); RemoveTrailingChars(builders.CppMethodDefinitions); @@ -5361,17 +5361,17 @@ static void InjectBuilders( csharpContents, "/*BEGIN MONOBEHAVIOUR DELEGATES*/\n", "\n\t\t/*END MONOBEHAVIOUR DELEGATES*/", - builders.CsharpMonoBehaviourDelegates.ToString()); + builders.CsharpDelegates.ToString()); csharpContents = InjectIntoString( csharpContents, "/*BEGIN MONOBEHAVIOUR IMPORTS*/\n", "\n\t\t/*END MONOBEHAVIOUR IMPORTS*/", - builders.CsharpMonoBehaviourImports.ToString()); + builders.CsharpImports.ToString()); csharpContents = InjectIntoString( csharpContents, "/*BEGIN MONOBEHAVIOUR GETDELEGATE CALLS*/\n", "\n\t\t\t/*END MONOBEHAVIOUR GETDELEGATE CALLS*/", - builders.CsharpMonoBehaviourGetDelegateCalls.ToString()); + builders.CsharpGetDelegateCalls.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, "/*BEGIN FUNCTION POINTERS*/\n", From e01df76398ac31adbad6e37f323d884e105071cf Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 24 Sep 2017 19:09:35 -0700 Subject: [PATCH 12/95] Update README for exceptions support --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 80cca56..b5aa3fd 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,7 @@ The code generator supports: * `MonoBehaviour` classes with "message" functions like `Update` (except `OnAudioFilterRead`) * `out` and `ref` parameters * Enumerations +* Exceptions The code generator does not support (yet): @@ -164,7 +165,6 @@ The code generator does not support (yet): * Delegates * `MonoBehaviour` contents (e.g. fields) except for "message" functions * Overloaded operators -* Exceptions * Default parameters * Interfaces * `decimal` From 749b2c7d0b61e2b4ed9049b49f94a1eb01b3775a Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Mon, 25 Sep 2017 14:53:18 -0700 Subject: [PATCH 13/95] Add Plugin::InternalUse type to C++ handle constructors to prevent accidental usage by game code and collision with C# constructors taking just an int Make generated destructors virtual --- .../NativeScript/Editor/GenerateBindings.cs | 32 ++- Unity/CppSource/NativeScript/Bindings.cpp | 236 +++++++++--------- Unity/CppSource/NativeScript/Bindings.h | 108 ++++---- 3 files changed, 201 insertions(+), 175 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index c3db5d1..3c0f213 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -2620,7 +2620,7 @@ static void AppendMonoBehaviour( AppendCppTypeName( type, builders.CppMonoBehaviourMessages); - builders.CppMonoBehaviourMessages.Append(" thiz(thisHandle);\n"); + builders.CppMonoBehaviourMessages.Append(" thiz(Plugin::InternalUse::Only, thisHandle);\n"); for (int i = 0; i < numParams; ++i) { ParameterInfo param = parameters[i]; @@ -2633,7 +2633,7 @@ static void AppendMonoBehaviour( builders.CppMonoBehaviourMessages); builders.CppMonoBehaviourMessages.Append(" param"); builders.CppMonoBehaviourMessages.Append(i); - builders.CppMonoBehaviourMessages.Append("(param"); + builders.CppMonoBehaviourMessages.Append("(Plugin::InternalUse::Only, param"); builders.CppMonoBehaviourMessages.Append(i); builders.CppMonoBehaviourMessages.Append("Handle);\n"); } @@ -2890,7 +2890,7 @@ static void AppendExceptions( AppendCppTypeName( exceptionType, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("(handle)\n"); + builders.CppMethodDefinitions.Append("(Plugin::InternalUse::Only, handle)\n"); AppendIndent( throwerIndent + 1, builders.CppMethodDefinitions); @@ -3442,7 +3442,7 @@ StringBuilder output AppendCppTypeParameters( typeParams, output); - output.Append("(int32_t handle);\n"); + output.Append("(Plugin::InternalUse iu, int32_t handle);\n"); // Copy constructor AppendIndent(indent + 1, output); @@ -3480,7 +3480,7 @@ StringBuilder output // Destructor AppendIndent(indent + 1, output); - output.Append('~'); + output.Append("virtual ~"); AppendWithoutGenericTypeCountSuffix( type.Name, output); @@ -3636,13 +3636,13 @@ static int AppendCppMethodDefinitionBegin( AppendWithoutGenericTypeCountSuffix( enclosingType.Name, output); - output.Append("(int32_t handle)\n"); + output.Append("(Plugin::InternalUse iu, int32_t handle)\n"); AppendIndent(indent, output); output.Append("\t: "); AppendCppTypeName( baseType, output); - output.Append("(handle)\n"); + output.Append("(iu, handle)\n"); AppendIndent(indent, output); output.Append("{\n"); AppendIndent(indent + 1, output); @@ -3689,7 +3689,7 @@ static int AppendCppMethodDefinitionBegin( AppendCppTypeName( baseType, output); - output.Append("(other.Handle)\n"); + output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent(indent, output); output.Append("{\n"); AppendIndent(indent + 1, output); @@ -3736,7 +3736,7 @@ static int AppendCppMethodDefinitionBegin( AppendCppTypeName( baseType, output); - output.Append("(other.Handle)\n"); + output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent(indent, output); output.Append("{\n"); AppendIndent(indent + 1, output); @@ -4725,7 +4725,19 @@ static void AppendCppMethodReturn( if (returnType != null && !returnType.Equals(typeof(void))) { AppendIndent(indent, output); - output.Append("return returnValue;\n"); + output.Append("return "); + if (IsFullValueType(returnType)) + { + output.Append("returnValue"); + } + else + { + AppendCppTypeName( + returnType, + output); + output.Append("(Plugin::InternalUse::Only, returnValue)"); + } + output.Append(";\n"); } } diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 40719d1..799d6a3 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -184,13 +184,13 @@ namespace Plugin namespace System { - Object::Object(std::nullptr_t n) - : Handle(0) + Object::Object(Plugin::InternalUse iu, int32_t handle) + : Handle(handle) { } - Object::Object(int32_t handle) - : Handle(handle) + Object::Object(std::nullptr_t n) + : Handle(0) { } @@ -214,13 +214,13 @@ namespace System throw *this; } - ValueType::ValueType(std::nullptr_t n) - : Object(0) + ValueType::ValueType(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) { } - ValueType::ValueType(int32_t handle) - : Object(handle) + ValueType::ValueType(std::nullptr_t n) + : Object(0) { } @@ -229,8 +229,8 @@ namespace System { } - String::String(int32_t handle) - : Object(handle) + String::String(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) { if (handle) { @@ -239,7 +239,7 @@ namespace System } String::String(const String& other) - : Object(other.Handle) + : Object(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -248,7 +248,7 @@ namespace System } String::String(String&& other) - : Object(other.Handle) + : Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -301,7 +301,7 @@ namespace System } String::String(const char* chars) - : String(Plugin::StringNew(chars)) + : Object(Plugin::InternalUse::Only, Plugin::StringNew(chars)) { } } @@ -316,8 +316,8 @@ namespace System { } - Stopwatch::Stopwatch(int32_t handle) - : System::Object(handle) + Stopwatch::Stopwatch(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { if (handle) { @@ -326,7 +326,7 @@ namespace System } Stopwatch::Stopwatch(const Stopwatch& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -335,7 +335,7 @@ namespace System } Stopwatch::Stopwatch(Stopwatch&& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -461,8 +461,8 @@ namespace UnityEngine { } - Object::Object(int32_t handle) - : System::Object(handle) + Object::Object(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { if (handle) { @@ -471,7 +471,7 @@ namespace UnityEngine } Object::Object(const Object& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -480,7 +480,7 @@ namespace UnityEngine } Object::Object(Object&& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -552,7 +552,7 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return returnValue; + return System::String(Plugin::InternalUse::Only, returnValue); } void Object::SetName(System::String value) @@ -575,8 +575,8 @@ namespace UnityEngine { } - GameObject::GameObject(int32_t handle) - : UnityEngine::Object(handle) + GameObject::GameObject(Plugin::InternalUse iu, int32_t handle) + : UnityEngine::Object(iu, handle) { if (handle) { @@ -585,7 +585,7 @@ namespace UnityEngine } GameObject::GameObject(const GameObject& other) - : UnityEngine::Object(other.Handle) + : UnityEngine::Object(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -594,7 +594,7 @@ namespace UnityEngine } GameObject::GameObject(GameObject&& other) - : UnityEngine::Object(other.Handle) + : UnityEngine::Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -702,7 +702,7 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return returnValue; + return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); } UnityEngine::GameObject GameObject::Find(System::String name) @@ -715,7 +715,7 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return returnValue; + return UnityEngine::GameObject(Plugin::InternalUse::Only, returnValue); } template<> MyGame::MonoBehaviours::TestScript GameObject::AddComponent() @@ -728,7 +728,7 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return returnValue; + return MyGame::MonoBehaviours::TestScript(Plugin::InternalUse::Only, returnValue); } } @@ -739,8 +739,8 @@ namespace UnityEngine { } - Component::Component(int32_t handle) - : UnityEngine::Object(handle) + Component::Component(Plugin::InternalUse iu, int32_t handle) + : UnityEngine::Object(iu, handle) { if (handle) { @@ -749,7 +749,7 @@ namespace UnityEngine } Component::Component(const Component& other) - : UnityEngine::Object(other.Handle) + : UnityEngine::Object(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -758,7 +758,7 @@ namespace UnityEngine } Component::Component(Component&& other) - : UnityEngine::Object(other.Handle) + : UnityEngine::Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -830,7 +830,7 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return returnValue; + return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); } } @@ -841,8 +841,8 @@ namespace UnityEngine { } - Transform::Transform(int32_t handle) - : UnityEngine::Component(handle) + Transform::Transform(Plugin::InternalUse iu, int32_t handle) + : UnityEngine::Component(iu, handle) { if (handle) { @@ -851,7 +851,7 @@ namespace UnityEngine } Transform::Transform(const Transform& other) - : UnityEngine::Component(other.Handle) + : UnityEngine::Component(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -860,7 +860,7 @@ namespace UnityEngine } Transform::Transform(Transform&& other) - : UnityEngine::Component(other.Handle) + : UnityEngine::Component(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -955,8 +955,8 @@ namespace UnityEngine { } - Debug::Debug(int32_t handle) - : System::Object(handle) + Debug::Debug(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { if (handle) { @@ -965,7 +965,7 @@ namespace UnityEngine } Debug::Debug(const Debug& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -974,7 +974,7 @@ namespace UnityEngine } Debug::Debug(Debug&& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1111,8 +1111,8 @@ namespace UnityEngine { } - Collision::Collision(int32_t handle) - : System::Object(handle) + Collision::Collision(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { if (handle) { @@ -1121,7 +1121,7 @@ namespace UnityEngine } Collision::Collision(const Collision& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -1130,7 +1130,7 @@ namespace UnityEngine } Collision::Collision(Collision&& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1200,8 +1200,8 @@ namespace UnityEngine { } - Behaviour::Behaviour(int32_t handle) - : UnityEngine::Component(handle) + Behaviour::Behaviour(Plugin::InternalUse iu, int32_t handle) + : UnityEngine::Component(iu, handle) { if (handle) { @@ -1210,7 +1210,7 @@ namespace UnityEngine } Behaviour::Behaviour(const Behaviour& other) - : UnityEngine::Component(other.Handle) + : UnityEngine::Component(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -1219,7 +1219,7 @@ namespace UnityEngine } Behaviour::Behaviour(Behaviour&& other) - : UnityEngine::Component(other.Handle) + : UnityEngine::Component(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1289,8 +1289,8 @@ namespace UnityEngine { } - MonoBehaviour::MonoBehaviour(int32_t handle) - : UnityEngine::Behaviour(handle) + MonoBehaviour::MonoBehaviour(Plugin::InternalUse iu, int32_t handle) + : UnityEngine::Behaviour(iu, handle) { if (handle) { @@ -1299,7 +1299,7 @@ namespace UnityEngine } MonoBehaviour::MonoBehaviour(const MonoBehaviour& other) - : UnityEngine::Behaviour(other.Handle) + : UnityEngine::Behaviour(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -1308,7 +1308,7 @@ namespace UnityEngine } MonoBehaviour::MonoBehaviour(MonoBehaviour&& other) - : UnityEngine::Behaviour(other.Handle) + : UnityEngine::Behaviour(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1378,8 +1378,8 @@ namespace UnityEngine { } - AudioSettings::AudioSettings(int32_t handle) - : System::Object(handle) + AudioSettings::AudioSettings(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { if (handle) { @@ -1388,7 +1388,7 @@ namespace UnityEngine } AudioSettings::AudioSettings(const AudioSettings& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -1397,7 +1397,7 @@ namespace UnityEngine } AudioSettings::AudioSettings(AudioSettings&& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1481,8 +1481,8 @@ namespace UnityEngine { } - NetworkTransport::NetworkTransport(int32_t handle) - : System::Object(handle) + NetworkTransport::NetworkTransport(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { if (handle) { @@ -1491,7 +1491,7 @@ namespace UnityEngine } NetworkTransport::NetworkTransport(const NetworkTransport& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -1500,7 +1500,7 @@ namespace UnityEngine } NetworkTransport::NetworkTransport(NetworkTransport&& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1653,8 +1653,8 @@ namespace UnityEngine { } - RaycastHit::RaycastHit(int32_t handle) - : System::ValueType(handle) + RaycastHit::RaycastHit(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(iu, handle) { if (handle) { @@ -1663,7 +1663,7 @@ namespace UnityEngine } RaycastHit::RaycastHit(const RaycastHit& other) - : System::ValueType(other.Handle) + : System::ValueType(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -1672,7 +1672,7 @@ namespace UnityEngine } RaycastHit::RaycastHit(RaycastHit&& other) - : System::ValueType(other.Handle) + : System::ValueType(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1769,7 +1769,7 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return returnValue; + return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); } } @@ -1784,8 +1784,8 @@ namespace System { } - KeyValuePair::KeyValuePair(int32_t handle) - : System::ValueType(handle) + KeyValuePair::KeyValuePair(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(iu, handle) { if (handle) { @@ -1794,7 +1794,7 @@ namespace System } KeyValuePair::KeyValuePair(const KeyValuePair& other) - : System::ValueType(other.Handle) + : System::ValueType(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -1803,7 +1803,7 @@ namespace System } KeyValuePair::KeyValuePair(KeyValuePair&& other) - : System::ValueType(other.Handle) + : System::ValueType(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1893,7 +1893,7 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return returnValue; + return System::String(Plugin::InternalUse::Only, returnValue); } double KeyValuePair::GetValue() @@ -1923,8 +1923,8 @@ namespace System { } - List::List(int32_t handle) - : System::Object(handle) + List::List(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { if (handle) { @@ -1933,7 +1933,7 @@ namespace System } List::List(const List& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -1942,7 +1942,7 @@ namespace System } List::List(List&& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2048,8 +2048,8 @@ namespace System { } - LinkedListNode::LinkedListNode(int32_t handle) - : System::Object(handle) + LinkedListNode::LinkedListNode(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { if (handle) { @@ -2058,7 +2058,7 @@ namespace System } LinkedListNode::LinkedListNode(const LinkedListNode& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -2067,7 +2067,7 @@ namespace System } LinkedListNode::LinkedListNode(LinkedListNode&& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2157,7 +2157,7 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return returnValue; + return System::String(Plugin::InternalUse::Only, returnValue); } void LinkedListNode::SetValue(System::String value) @@ -2186,8 +2186,8 @@ namespace System { } - StrongBox::StrongBox(int32_t handle) - : System::Object(handle) + StrongBox::StrongBox(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { if (handle) { @@ -2196,7 +2196,7 @@ namespace System } StrongBox::StrongBox(const StrongBox& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -2205,7 +2205,7 @@ namespace System } StrongBox::StrongBox(StrongBox&& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2295,7 +2295,7 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return returnValue; + return System::String(Plugin::InternalUse::Only, returnValue); } void StrongBox::SetValue(System::String value) @@ -2324,8 +2324,8 @@ namespace System { } - Collection::Collection(int32_t handle) - : System::Object(handle) + Collection::Collection(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { if (handle) { @@ -2334,7 +2334,7 @@ namespace System } Collection::Collection(const Collection& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -2343,7 +2343,7 @@ namespace System } Collection::Collection(Collection&& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2419,8 +2419,8 @@ namespace System { } - KeyedCollection::KeyedCollection(int32_t handle) - : System::Collections::ObjectModel::Collection(handle) + KeyedCollection::KeyedCollection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::ObjectModel::Collection(iu, handle) { if (handle) { @@ -2429,7 +2429,7 @@ namespace System } KeyedCollection::KeyedCollection(const KeyedCollection& other) - : System::Collections::ObjectModel::Collection(other.Handle) + : System::Collections::ObjectModel::Collection(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -2438,7 +2438,7 @@ namespace System } KeyedCollection::KeyedCollection(KeyedCollection&& other) - : System::Collections::ObjectModel::Collection(other.Handle) + : System::Collections::ObjectModel::Collection(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2510,8 +2510,8 @@ namespace System { } - Exception::Exception(int32_t handle) - : System::Object(handle) + Exception::Exception(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { if (handle) { @@ -2520,7 +2520,7 @@ namespace System } Exception::Exception(const Exception& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -2529,7 +2529,7 @@ namespace System } Exception::Exception(Exception&& other) - : System::Object(other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2617,8 +2617,8 @@ namespace System { } - SystemException::SystemException(int32_t handle) - : System::Exception(handle) + SystemException::SystemException(Plugin::InternalUse iu, int32_t handle) + : System::Exception(iu, handle) { if (handle) { @@ -2627,7 +2627,7 @@ namespace System } SystemException::SystemException(const SystemException& other) - : System::Exception(other.Handle) + : System::Exception(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -2636,7 +2636,7 @@ namespace System } SystemException::SystemException(SystemException&& other) - : System::Exception(other.Handle) + : System::Exception(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2706,8 +2706,8 @@ namespace System { } - NullReferenceException::NullReferenceException(int32_t handle) - : System::SystemException(handle) + NullReferenceException::NullReferenceException(Plugin::InternalUse iu, int32_t handle) + : System::SystemException(iu, handle) { if (handle) { @@ -2716,7 +2716,7 @@ namespace System } NullReferenceException::NullReferenceException(const NullReferenceException& other) - : System::SystemException(other.Handle) + : System::SystemException(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -2725,7 +2725,7 @@ namespace System } NullReferenceException::NullReferenceException(NullReferenceException&& other) - : System::SystemException(other.Handle) + : System::SystemException(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2797,8 +2797,8 @@ namespace MyGame { } - TestScript::TestScript(int32_t handle) - : UnityEngine::MonoBehaviour(handle) + TestScript::TestScript(Plugin::InternalUse iu, int32_t handle) + : UnityEngine::MonoBehaviour(iu, handle) { if (handle) { @@ -2807,7 +2807,7 @@ namespace MyGame } TestScript::TestScript(const TestScript& other) - : UnityEngine::MonoBehaviour(other.Handle) + : UnityEngine::MonoBehaviour(Plugin::InternalUse::Only, other.Handle) { if (Handle) { @@ -2816,7 +2816,7 @@ namespace MyGame } TestScript::TestScript(TestScript&& other) - : UnityEngine::MonoBehaviour(other.Handle) + : UnityEngine::MonoBehaviour(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2885,7 +2885,7 @@ namespace System struct NullReferenceExceptionThrower : System::NullReferenceException { NullReferenceExceptionThrower(int32_t handle) - : System::NullReferenceException(handle) + : System::NullReferenceException(Plugin::InternalUse::Only, handle) { } @@ -3044,13 +3044,15 @@ DLLEXPORT void Init( // Receive an unhandled exception from C# DLLEXPORT void SetCsharpException(int32_t handle) { - Plugin::unhandledCsharpException = new System::Exception(handle); + Plugin::unhandledCsharpException = new System::Exception( + Plugin::InternalUse::Only, + handle); } /*BEGIN MONOBEHAVIOUR MESSAGES*/ DLLEXPORT void TestScriptAwake(int32_t thisHandle) { - MyGame::MonoBehaviours::TestScript thiz(thisHandle); + MyGame::MonoBehaviours::TestScript thiz(Plugin::InternalUse::Only, thisHandle); try { thiz.Awake(); @@ -3069,7 +3071,7 @@ DLLEXPORT void TestScriptAwake(int32_t thisHandle) DLLEXPORT void TestScriptOnAnimatorIK(int32_t thisHandle, int32_t param0) { - MyGame::MonoBehaviours::TestScript thiz(thisHandle); + MyGame::MonoBehaviours::TestScript thiz(Plugin::InternalUse::Only, thisHandle); try { thiz.OnAnimatorIK(param0); @@ -3088,8 +3090,8 @@ DLLEXPORT void TestScriptOnAnimatorIK(int32_t thisHandle, int32_t param0) DLLEXPORT void TestScriptOnCollisionEnter(int32_t thisHandle, int32_t param0Handle) { - MyGame::MonoBehaviours::TestScript thiz(thisHandle); - UnityEngine::Collision param0(param0Handle); + MyGame::MonoBehaviours::TestScript thiz(Plugin::InternalUse::Only, thisHandle); + UnityEngine::Collision param0(Plugin::InternalUse::Only, param0Handle); try { thiz.OnCollisionEnter(param0); @@ -3108,7 +3110,7 @@ DLLEXPORT void TestScriptOnCollisionEnter(int32_t thisHandle, int32_t param0Hand DLLEXPORT void TestScriptUpdate(int32_t thisHandle) { - MyGame::MonoBehaviours::TestScript thiz(thisHandle); + MyGame::MonoBehaviours::TestScript thiz(Plugin::InternalUse::Only, thisHandle); try { thiz.Update(); diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 232e96a..7222caa 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -16,6 +16,18 @@ // For nullptr_t #include +//////////////////////////////////////////////////////////////// +// Plugin internals +//////////////////////////////////////////////////////////////// + +namespace Plugin +{ + enum class InternalUse + { + Only + }; +} + //////////////////////////////////////////////////////////////// // C# struct types //////////////////////////////////////////////////////////////// @@ -141,8 +153,8 @@ namespace System struct Object { int32_t Handle; + Object(Plugin::InternalUse iu, int32_t handle); Object(std::nullptr_t n); - Object(int32_t handle); virtual ~Object() = default; operator bool() const; bool operator==(std::nullptr_t other) const; @@ -152,17 +164,17 @@ namespace System struct ValueType : Object { + ValueType(Plugin::InternalUse iu, int32_t handle); ValueType(std::nullptr_t n); - ValueType(int32_t handle); }; struct String : Object { + String(Plugin::InternalUse iu, int32_t handle); String(std::nullptr_t n); - String(int32_t handle); String(const String& other); String(String&& other); - ~String(); + virtual ~String(); String& operator=(const String& other); String& operator=(std::nullptr_t other); String& operator=(String&& other); @@ -426,10 +438,10 @@ namespace System struct Stopwatch : System::Object { Stopwatch(std::nullptr_t n); - Stopwatch(int32_t handle); + Stopwatch(Plugin::InternalUse iu, int32_t handle); Stopwatch(const Stopwatch& other); Stopwatch(Stopwatch&& other); - ~Stopwatch(); + virtual ~Stopwatch(); Stopwatch& operator=(const Stopwatch& other); Stopwatch& operator=(std::nullptr_t other); Stopwatch& operator=(Stopwatch&& other); @@ -448,10 +460,10 @@ namespace UnityEngine struct Object : System::Object { Object(std::nullptr_t n); - Object(int32_t handle); + Object(Plugin::InternalUse iu, int32_t handle); Object(const Object& other); Object(Object&& other); - ~Object(); + virtual ~Object(); Object& operator=(const Object& other); Object& operator=(std::nullptr_t other); Object& operator=(Object&& other); @@ -467,10 +479,10 @@ namespace UnityEngine struct GameObject : UnityEngine::Object { GameObject(std::nullptr_t n); - GameObject(int32_t handle); + GameObject(Plugin::InternalUse iu, int32_t handle); GameObject(const GameObject& other); GameObject(GameObject&& other); - ~GameObject(); + virtual ~GameObject(); GameObject& operator=(const GameObject& other); GameObject& operator=(std::nullptr_t other); GameObject& operator=(GameObject&& other); @@ -489,10 +501,10 @@ namespace UnityEngine struct Component : UnityEngine::Object { Component(std::nullptr_t n); - Component(int32_t handle); + Component(Plugin::InternalUse iu, int32_t handle); Component(const Component& other); Component(Component&& other); - ~Component(); + virtual ~Component(); Component& operator=(const Component& other); Component& operator=(std::nullptr_t other); Component& operator=(Component&& other); @@ -507,10 +519,10 @@ namespace UnityEngine struct Transform : UnityEngine::Component { Transform(std::nullptr_t n); - Transform(int32_t handle); + Transform(Plugin::InternalUse iu, int32_t handle); Transform(const Transform& other); Transform(Transform&& other); - ~Transform(); + virtual ~Transform(); Transform& operator=(const Transform& other); Transform& operator=(std::nullptr_t other); Transform& operator=(Transform&& other); @@ -526,10 +538,10 @@ namespace UnityEngine struct Debug : System::Object { Debug(std::nullptr_t n); - Debug(int32_t handle); + Debug(Plugin::InternalUse iu, int32_t handle); Debug(const Debug& other); Debug(Debug&& other); - ~Debug(); + virtual ~Debug(); Debug& operator=(const Debug& other); Debug& operator=(std::nullptr_t other); Debug& operator=(Debug&& other); @@ -558,10 +570,10 @@ namespace UnityEngine struct Collision : System::Object { Collision(std::nullptr_t n); - Collision(int32_t handle); + Collision(Plugin::InternalUse iu, int32_t handle); Collision(const Collision& other); Collision(Collision&& other); - ~Collision(); + virtual ~Collision(); Collision& operator=(const Collision& other); Collision& operator=(std::nullptr_t other); Collision& operator=(Collision&& other); @@ -575,10 +587,10 @@ namespace UnityEngine struct Behaviour : UnityEngine::Component { Behaviour(std::nullptr_t n); - Behaviour(int32_t handle); + Behaviour(Plugin::InternalUse iu, int32_t handle); Behaviour(const Behaviour& other); Behaviour(Behaviour&& other); - ~Behaviour(); + virtual ~Behaviour(); Behaviour& operator=(const Behaviour& other); Behaviour& operator=(std::nullptr_t other); Behaviour& operator=(Behaviour&& other); @@ -592,10 +604,10 @@ namespace UnityEngine struct MonoBehaviour : UnityEngine::Behaviour { MonoBehaviour(std::nullptr_t n); - MonoBehaviour(int32_t handle); + MonoBehaviour(Plugin::InternalUse iu, int32_t handle); MonoBehaviour(const MonoBehaviour& other); MonoBehaviour(MonoBehaviour&& other); - ~MonoBehaviour(); + virtual ~MonoBehaviour(); MonoBehaviour& operator=(const MonoBehaviour& other); MonoBehaviour& operator=(std::nullptr_t other); MonoBehaviour& operator=(MonoBehaviour&& other); @@ -609,10 +621,10 @@ namespace UnityEngine struct AudioSettings : System::Object { AudioSettings(std::nullptr_t n); - AudioSettings(int32_t handle); + AudioSettings(Plugin::InternalUse iu, int32_t handle); AudioSettings(const AudioSettings& other); AudioSettings(AudioSettings&& other); - ~AudioSettings(); + virtual ~AudioSettings(); AudioSettings& operator=(const AudioSettings& other); AudioSettings& operator=(std::nullptr_t other); AudioSettings& operator=(AudioSettings&& other); @@ -629,10 +641,10 @@ namespace UnityEngine struct NetworkTransport : System::Object { NetworkTransport(std::nullptr_t n); - NetworkTransport(int32_t handle); + NetworkTransport(Plugin::InternalUse iu, int32_t handle); NetworkTransport(const NetworkTransport& other); NetworkTransport(NetworkTransport&& other); - ~NetworkTransport(); + virtual ~NetworkTransport(); NetworkTransport& operator=(const NetworkTransport& other); NetworkTransport& operator=(std::nullptr_t other); NetworkTransport& operator=(NetworkTransport&& other); @@ -663,10 +675,10 @@ namespace UnityEngine struct RaycastHit : System::ValueType { RaycastHit(std::nullptr_t n); - RaycastHit(int32_t handle); + RaycastHit(Plugin::InternalUse iu, int32_t handle); RaycastHit(const RaycastHit& other); RaycastHit(RaycastHit&& other); - ~RaycastHit(); + virtual ~RaycastHit(); RaycastHit& operator=(const RaycastHit& other); RaycastHit& operator=(std::nullptr_t other); RaycastHit& operator=(RaycastHit&& other); @@ -687,10 +699,10 @@ namespace System template<> struct KeyValuePair : System::ValueType { KeyValuePair(std::nullptr_t n); - KeyValuePair(int32_t handle); + KeyValuePair(Plugin::InternalUse iu, int32_t handle); KeyValuePair(const KeyValuePair& other); KeyValuePair(KeyValuePair&& other); - ~KeyValuePair(); + virtual ~KeyValuePair(); KeyValuePair& operator=(const KeyValuePair& other); KeyValuePair& operator=(std::nullptr_t other); KeyValuePair& operator=(KeyValuePair&& other); @@ -713,10 +725,10 @@ namespace System template<> struct List : System::Object { List(std::nullptr_t n); - List(int32_t handle); + List(Plugin::InternalUse iu, int32_t handle); List(const List& other); List(List&& other); - ~List(); + virtual ~List(); List& operator=(const List& other); List& operator=(std::nullptr_t other); List& operator=(List&& other); @@ -738,10 +750,10 @@ namespace System template<> struct LinkedListNode : System::Object { LinkedListNode(std::nullptr_t n); - LinkedListNode(int32_t handle); + LinkedListNode(Plugin::InternalUse iu, int32_t handle); LinkedListNode(const LinkedListNode& other); LinkedListNode(LinkedListNode&& other); - ~LinkedListNode(); + virtual ~LinkedListNode(); LinkedListNode& operator=(const LinkedListNode& other); LinkedListNode& operator=(std::nullptr_t other); LinkedListNode& operator=(LinkedListNode&& other); @@ -764,10 +776,10 @@ namespace System template<> struct StrongBox : System::Object { StrongBox(std::nullptr_t n); - StrongBox(int32_t handle); + StrongBox(Plugin::InternalUse iu, int32_t handle); StrongBox(const StrongBox& other); StrongBox(StrongBox&& other); - ~StrongBox(); + virtual ~StrongBox(); StrongBox& operator=(const StrongBox& other); StrongBox& operator=(std::nullptr_t other); StrongBox& operator=(StrongBox&& other); @@ -790,10 +802,10 @@ namespace System template<> struct Collection : System::Object { Collection(std::nullptr_t n); - Collection(int32_t handle); + Collection(Plugin::InternalUse iu, int32_t handle); Collection(const Collection& other); Collection(Collection&& other); - ~Collection(); + virtual ~Collection(); Collection& operator=(const Collection& other); Collection& operator=(std::nullptr_t other); Collection& operator=(Collection&& other); @@ -813,10 +825,10 @@ namespace System template<> struct KeyedCollection : System::Collections::ObjectModel::Collection { KeyedCollection(std::nullptr_t n); - KeyedCollection(int32_t handle); + KeyedCollection(Plugin::InternalUse iu, int32_t handle); KeyedCollection(const KeyedCollection& other); KeyedCollection(KeyedCollection&& other); - ~KeyedCollection(); + virtual ~KeyedCollection(); KeyedCollection& operator=(const KeyedCollection& other); KeyedCollection& operator=(std::nullptr_t other); KeyedCollection& operator=(KeyedCollection&& other); @@ -832,10 +844,10 @@ namespace System struct Exception : System::Object { Exception(std::nullptr_t n); - Exception(int32_t handle); + Exception(Plugin::InternalUse iu, int32_t handle); Exception(const Exception& other); Exception(Exception&& other); - ~Exception(); + virtual ~Exception(); Exception& operator=(const Exception& other); Exception& operator=(std::nullptr_t other); Exception& operator=(Exception&& other); @@ -850,10 +862,10 @@ namespace System struct SystemException : System::Exception { SystemException(std::nullptr_t n); - SystemException(int32_t handle); + SystemException(Plugin::InternalUse iu, int32_t handle); SystemException(const SystemException& other); SystemException(SystemException&& other); - ~SystemException(); + virtual ~SystemException(); SystemException& operator=(const SystemException& other); SystemException& operator=(std::nullptr_t other); SystemException& operator=(SystemException&& other); @@ -867,10 +879,10 @@ namespace System struct NullReferenceException : System::SystemException { NullReferenceException(std::nullptr_t n); - NullReferenceException(int32_t handle); + NullReferenceException(Plugin::InternalUse iu, int32_t handle); NullReferenceException(const NullReferenceException& other); NullReferenceException(NullReferenceException&& other); - ~NullReferenceException(); + virtual ~NullReferenceException(); NullReferenceException& operator=(const NullReferenceException& other); NullReferenceException& operator=(std::nullptr_t other); NullReferenceException& operator=(NullReferenceException&& other); @@ -886,10 +898,10 @@ namespace MyGame struct TestScript : UnityEngine::MonoBehaviour { TestScript(std::nullptr_t n); - TestScript(int32_t handle); + TestScript(Plugin::InternalUse iu, int32_t handle); TestScript(const TestScript& other); TestScript(TestScript&& other); - ~TestScript(); + virtual ~TestScript(); TestScript& operator=(const TestScript& other); TestScript& operator=(std::nullptr_t other); TestScript& operator=(TestScript&& other); From 6ee24289b9a03b837188757495b2448ef3abe37f Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Mon, 25 Sep 2017 16:44:00 -0700 Subject: [PATCH 14/95] Add support for indexer properties --- Unity/Assets/NativeScript/Bindings.cs | 48 +++++++++++++++++++ .../NativeScript/Editor/GenerateBindings.cs | 32 +++++++++++-- Unity/Assets/NativeScriptTypes.json | 5 ++ Unity/CppSource/Game/Game.cpp | 5 ++ Unity/CppSource/NativeScript/Bindings.cpp | 31 ++++++++++++ Unity/CppSource/NativeScript/Bindings.h | 2 + 6 files changed, 118 insertions(+), 5 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 178631e..1872458 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -307,6 +307,8 @@ delegate void InitDelegate( IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue, IntPtr systemCollectionsGenericListSystemStringConstructor, + IntPtr systemCollectionsGenericListSystemStringPropertyGetItem, + IntPtr systemCollectionsGenericListSystemStringPropertySetItem, IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString, IntPtr systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString, IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue, @@ -468,6 +470,8 @@ static extern void Init( IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue, IntPtr systemCollectionsGenericListSystemStringConstructor, + IntPtr systemCollectionsGenericListSystemStringPropertyGetItem, + IntPtr systemCollectionsGenericListSystemStringPropertySetItem, IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString, IntPtr systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString, IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue, @@ -538,6 +542,8 @@ IntPtr systemExceptionConstructorSystemString 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); @@ -632,6 +638,8 @@ public static void Open( 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)), @@ -1359,6 +1367,46 @@ static int SystemCollectionsGenericListSystemStringConstructor() } } + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertyGetItemDelegate))] + static int SystemCollectionsGenericListSystemStringPropertyGetItem(int thisHandle, int index) + { + try + { + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index]; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertySetItemDelegate))] + static void SystemCollectionsGenericListSystemStringPropertySetItem(int thisHandle, int index, int valueHandle) + { + try + { + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz[index] = value; + } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate))] static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int thisHandle, int itemHandle) { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 3c0f213..4eb4ce3 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -2210,6 +2210,7 @@ static void AppendMethod( enclosingType, methodIsStatic, builders.CsharpFunctions); + builders.CsharpFunctions.Append('.'); builders.CsharpFunctions.Append(methodName); AppendCSharpTypeParameters( methodTypeParams, @@ -3074,7 +3075,17 @@ static void AppendGetter( enclosingType, methodIsStatic, builders.CsharpFunctions); - builders.CsharpFunctions.Append(fieldName); + if (parameters.Length == 1) + { + builders.CsharpFunctions.Append('['); + builders.CsharpFunctions.Append(parameters[0].Name); + builders.CsharpFunctions.Append("]"); + } + else + { + builders.CsharpFunctions.Append('.'); + builders.CsharpFunctions.Append(fieldName); + } builders.CsharpFunctions.Append(';'); if (!isReadOnly && enclosingTypeKind == TypeKind.ManagedStruct) @@ -3246,9 +3257,21 @@ static void AppendSetter( enclosingType, methodIsStatic, builders.CsharpFunctions); - builders.CsharpFunctions.Append(fieldName); - builders.CsharpFunctions.Append(" = "); - builders.CsharpFunctions.Append("value;"); + if (parameters.Length == 2) + { + builders.CsharpFunctions.Append('['); + builders.CsharpFunctions.Append(parameters[0].Name); + builders.CsharpFunctions.Append("] = "); + builders.CsharpFunctions.Append(parameters[1].Name); + } + else + { + builders.CsharpFunctions.Append('.'); + builders.CsharpFunctions.Append(fieldName); + builders.CsharpFunctions.Append(" = "); + builders.CsharpFunctions.Append("value"); + } + builders.CsharpFunctions.Append(';'); if (!isReadOnly && enclosingTypeKind == TypeKind.ManagedStruct) { @@ -4338,7 +4361,6 @@ static void AppendCsharpFunctionCallSubject( { output.Append("thiz"); } - output.Append('.'); } static void AppendCsharpFunctionCallParameters( diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 0e9b288..e86e5d0 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -256,6 +256,11 @@ "ParamTypes": [] } ], + "Properties": [ + { + "Name": "Item" + } + ], "Methods": [ { "Name": "Add", diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index 6ed197a..1cd6b8b 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -32,6 +32,11 @@ void PluginMain() strings.Add("two"); strings.Add("three"); Debug::Log(strings); + String first = strings.GetItem(0); + Debug::Log(first); + strings.SetItem(0, "new one"); + first = strings.GetItem(0); + Debug::Log(first); System::Runtime::CompilerServices::StrongBox strongbox("secret"); Debug::Log(strongbox.GetValue()); diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 799d6a3..d78a944 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -74,6 +74,8 @@ namespace Plugin int32_t (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)(int32_t thisHandle); double (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle); int32_t (*SystemCollectionsGenericListSystemStringConstructor)(); + int32_t (*SystemCollectionsGenericListSystemStringPropertyGetItem)(int32_t thisHandle, int32_t index); + void (*SystemCollectionsGenericListSystemStringPropertySetItem)(int32_t thisHandle, int32_t index, int32_t valueHandle); void (*SystemCollectionsGenericListSystemStringMethodAddSystemString)(int32_t thisHandle, int32_t itemHandle); int32_t (*SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)(int32_t valueHandle); int32_t (*SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue)(int32_t thisHandle); @@ -2022,6 +2024,31 @@ namespace System } } + System::String List::GetItem(int32_t index) + { + auto returnValue = Plugin::SystemCollectionsGenericListSystemStringPropertyGetItem(Handle, index); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::String(Plugin::InternalUse::Only, returnValue); + } + + void List::SetItem(int32_t index, System::String value) + { + Plugin::SystemCollectionsGenericListSystemStringPropertySetItem(Handle, index, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + void List::Add(System::String item) { Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString(Handle, item.Handle); @@ -2957,6 +2984,8 @@ DLLEXPORT void Init( int32_t (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)(int32_t thisHandle), double (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle), int32_t (*systemCollectionsGenericListSystemStringConstructor)(), + int32_t (*systemCollectionsGenericListSystemStringPropertyGetItem)(int32_t thisHandle, int32_t index), + void (*systemCollectionsGenericListSystemStringPropertySetItem)(int32_t thisHandle, int32_t index, int32_t valueHandle), void (*systemCollectionsGenericListSystemStringMethodAddSystemString)(int32_t thisHandle, int32_t itemHandle), int32_t (*systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)(int32_t valueHandle), int32_t (*systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue)(int32_t thisHandle), @@ -3016,6 +3045,8 @@ DLLEXPORT void Init( Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey; Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue; Plugin::SystemCollectionsGenericListSystemStringConstructor = systemCollectionsGenericListSystemStringConstructor; + Plugin::SystemCollectionsGenericListSystemStringPropertyGetItem = systemCollectionsGenericListSystemStringPropertyGetItem; + Plugin::SystemCollectionsGenericListSystemStringPropertySetItem = systemCollectionsGenericListSystemStringPropertySetItem; Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString = systemCollectionsGenericListSystemStringMethodAddSystemString; Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString = systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString; Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue = systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue; diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 7222caa..ca9ff50 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -735,6 +735,8 @@ namespace System bool operator==(const List& other) const; bool operator!=(const List& other) const; List(); + System::String GetItem(int32_t index); + void SetItem(int32_t index, System::String value); void Add(System::String item); }; } From 6d2ea60fff8b606dcdaa61cf9f6da3c397ed295f Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Mon, 25 Sep 2017 16:58:21 -0700 Subject: [PATCH 15/95] Make generating property "getters" and "setters" optional --- .../NativeScript/Editor/GenerateBindings.cs | 142 ++++++++++-------- Unity/Assets/NativeScriptTypes.json | 52 +++++-- 2 files changed, 119 insertions(+), 75 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 4eb4ce3..f2aad6c 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -50,14 +50,26 @@ class JsonMethod public string[] Exceptions; } + [Serializable] + class JsonPropertyGet + { + public bool IsReadOnly = true; + public string[] Exceptions; + } + + [Serializable] + class JsonPropertySet + { + public bool IsReadOnly; + public string[] Exceptions; + } + [Serializable] class JsonProperty { public string Name; - public bool GetIsReadOnly = true; - public bool SetIsReadOnly; - public string[] GetExceptions; - public string[] SetExceptions; + public JsonPropertyGet Get; + public JsonPropertySet Set; } [Serializable] @@ -1807,59 +1819,67 @@ static void AppendProperty( property.PropertyType, typeGenericArgumentTypes, typeParams); - Type[] getExceptionTypes = GetTypes( - jsonProperty.GetExceptions, - assemblies); - Type[] setExceptionTypes = GetTypes( - jsonProperty.SetExceptions, - assemblies); - MethodInfo getMethod = property.GetGetMethod(); - if (getMethod != null && getMethod.IsPublic) - { - ParameterInfo[] parameters = ConvertParameters( - getMethod.GetParameters()); - OverrideGenericParameterTypes( - parameters, - typeGenericArgumentTypes, - typeParams); - AppendGetter( - property.Name, - "Property", - parameters, - enclosingTypeIsStatic, - enclosingTypeKind, - getMethod.IsStatic, - jsonProperty.GetIsReadOnly, - enclosingType, - typeParams, - propertyType, - indent, - getExceptionTypes, - builders); + JsonPropertyGet jsonPropertyGet = jsonProperty.Get; + if (jsonPropertyGet != null) + { + Type[] exceptionTypes = GetTypes( + jsonPropertyGet.Exceptions, + assemblies); + MethodInfo getMethod = property.GetGetMethod(); + if (getMethod != null) + { + ParameterInfo[] parameters = ConvertParameters( + getMethod.GetParameters()); + OverrideGenericParameterTypes( + parameters, + typeGenericArgumentTypes, + typeParams); + AppendGetter( + property.Name, + "Property", + parameters, + enclosingTypeIsStatic, + enclosingTypeKind, + getMethod.IsStatic, + jsonPropertyGet.IsReadOnly, + enclosingType, + typeParams, + propertyType, + indent, + exceptionTypes, + builders); + } } - MethodInfo setMethod = property.GetSetMethod(); - if (setMethod != null && setMethod.IsPublic) + JsonPropertySet jsonPropertySet = jsonProperty.Set; + if (jsonPropertySet != null) { - ParameterInfo[] parameters = ConvertParameters( - setMethod.GetParameters()); - OverrideGenericParameterTypes( - parameters, - typeGenericArgumentTypes, - typeParams); - AppendSetter( - property.Name, - "Property", - parameters, - enclosingTypeIsStatic, - enclosingTypeKind, - setMethod.IsStatic, - jsonProperty.SetIsReadOnly, - enclosingType, - typeParams, - propertyType, - indent, - setExceptionTypes, - builders); + Type[] exceptionTypes = GetTypes( + jsonPropertySet.Exceptions, + assemblies); + MethodInfo method = property.GetSetMethod(); + if (method != null) + { + ParameterInfo[] parameters = ConvertParameters( + method.GetParameters()); + OverrideGenericParameterTypes( + parameters, + typeGenericArgumentTypes, + typeParams); + AppendSetter( + property.Name, + "Property", + parameters, + enclosingTypeIsStatic, + enclosingTypeKind, + method.IsStatic, + jsonPropertySet.IsReadOnly, + enclosingType, + typeParams, + propertyType, + indent, + exceptionTypes, + builders); + } } } @@ -2833,17 +2853,21 @@ static void AppendExceptions( { foreach (JsonProperty jsonProperty in jsonType.Properties) { - if (jsonProperty.GetExceptions != null) + JsonPropertyGet jsonPropertyGet = jsonProperty.Get; + if (jsonPropertyGet != null + && jsonPropertyGet.Exceptions != null) { AddUniqueTypes( - jsonProperty.GetExceptions, + jsonPropertyGet.Exceptions, exceptionTypes, assemblies); } - if (jsonProperty.SetExceptions != null) + JsonPropertySet jsonPropertySet = jsonProperty.Set; + if (jsonPropertySet != null + && jsonPropertySet.Exceptions != null) { AddUniqueTypes( - jsonProperty.SetExceptions, + jsonPropertySet.Exceptions, exceptionTypes, assemblies); } diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index e86e5d0..2b7a78f 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -22,7 +22,8 @@ ], "Properties": [ { - "Name": "ElapsedMilliseconds" + "Name": "ElapsedMilliseconds", + "Get": {} } ] }, @@ -30,7 +31,9 @@ "Name": "UnityEngine.Object", "Properties": [ { - "Name": "name" + "Name": "name", + "Get": {}, + "Set": {} } ] }, @@ -71,9 +74,11 @@ "Properties": [ { "Name": "transform", - "GetExceptions": [ - "System.NullReferenceException" - ] + "Get": { + "Exceptions": [ + "System.NullReferenceException" + ] + } } ] }, @@ -81,7 +86,8 @@ "Name": "UnityEngine.Component", "Properties": [ { - "Name": "transform" + "Name": "transform", + "Get": {} } ] }, @@ -90,9 +96,12 @@ "Properties": [ { "Name": "position", - "SetExceptions": [ - "System.NullReferenceException" - ] + "Get": {}, + "Set": { + "Exceptions": [ + "System.NullReferenceException" + ] + } } ] }, @@ -196,7 +205,8 @@ ], "Properties": [ { - "Name": "magnitude" + "Name": "magnitude", + "Get": {} } ] }, @@ -205,10 +215,12 @@ "MaxSimultaneous": 1000, "Properties": [ { - "Name": "point" + "Name": "point", + "Get": {} }, { - "Name": "transform" + "Name": "transform", + "Get": {} } ] }, @@ -235,10 +247,14 @@ ], "Properties": [ { - "Name": "Key" + "Name": "Key", + "Get": {}, + "Set": {} }, { - "Name": "Value" + "Name": "Value", + "Get": {}, + "Set": {} } ] }, @@ -258,7 +274,9 @@ ], "Properties": [ { - "Name": "Item" + "Name": "Item", + "Get": {}, + "Set": {} } ], "Methods": [ @@ -288,7 +306,9 @@ ], "Properties": [ { - "Name": "Value" + "Name": "Value", + "Get": {}, + "Set": {} } ] }, From 53c822a2960e91914aa1d844e38fb2083a4b62f4 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 30 Sep 2017 18:45:19 -0700 Subject: [PATCH 16/95] Support overloaded operator --- README.md | 23 +- Unity/Assets/NativeScript/Bindings.cs | 118 +++++- .../NativeScript/Editor/GenerateBindings.cs | 379 +++++++++++++++++- Unity/Assets/NativeScriptTypes.json | 34 +- Unity/CppSource/NativeScript/Bindings.cpp | 85 +++- Unity/CppSource/NativeScript/Bindings.h | 6 +- 6 files changed, 551 insertions(+), 94 deletions(-) diff --git a/README.md b/README.md index b5aa3fd..90c2a66 100644 --- a/README.md +++ b/README.md @@ -158,39 +158,18 @@ The code generator supports: * `out` and `ref` parameters * Enumerations * Exceptions +* Overloaded operators (except `operator true` and `operator false`) The code generator does not support (yet): * Arrays (single- or multi-dimensional) * Delegates * `MonoBehaviour` contents (e.g. fields) except for "message" functions -* Overloaded operators * Default parameters * Interfaces * `decimal` * Pointers -The JSON file is laid out as follows: - -* **Assemblies** - Paths to custom DLLs. Unity, .NET, and your project are already included. `UNITY_PROJECT`, `UNITY_ASSETS`, `DOTNET_DLLS`, and `UNITY_DLLS` be be replaced by the appropriate path. -* **Types** - Array of types in the DLL to generate - * **Name** - Name of the type including namespace (e.g. `UnityEngine.GameObject`) - * **Constructors** - Array of constructors to generate - * **Types** - Parameter types of the constructor including namespace - * **Methods** - Array of methods to generate - * **Name** - Name of the method - * **ParamTypes** - Parameter types to the method including namespace - * **GenericTypes** - Sets of type parameters to generate (for the method) - * **Types** - Type names in the set - * **Properties** - Array of property names to generate - * **Fields** - Array of field names to generate - * **GenericTypes** - Sets of type parameters to generate (for the type) - * **Types** - Type names in the set -* **MonoBehaviours** - * **Name** - Name of the `MonoBehaviour` class to generate - * **Namespace** - Namespace to put the `MonoBehaviour` class in - * **Messages** - Array of message names to generate (e.g. `Update`) - # Updating To A New Version To update to a new version of this project, overwrite your Unity project's `Assets/NativeScript` directory with this project's `Unity/Assets/NativeScript` directory and re-run the code generator. diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 1872458..3aa4200 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -277,10 +277,11 @@ delegate void InitDelegate( IntPtr systemDiagnosticsStopwatchMethodReset, IntPtr unityEngineObjectPropertyGetName, IntPtr unityEngineObjectPropertySetName, + IntPtr unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject, + IntPtr unityEngineObjectMethodop_ImplicitUnityEngineObject, IntPtr unityEngineGameObjectConstructor, IntPtr unityEngineGameObjectConstructorSystemString, IntPtr unityEngineGameObjectPropertyGetTransform, - IntPtr unityEngineGameObjectMethodFindSystemString, IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript, IntPtr unityEngineComponentPropertyGetTransform, IntPtr unityEngineTransformPropertyGetPosition, @@ -296,6 +297,8 @@ delegate void InitDelegate( IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3PropertyGetMagnitude, IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, + IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, + IntPtr unityEngineVector3Methodop_UnaryNegationUnityEngineVector3, IntPtr releaseUnityEngineRaycastHit, int ReleaseUnityEngineRaycastHit, IntPtr unityEngineRaycastHitPropertyGetPoint, @@ -440,10 +443,11 @@ static extern void Init( IntPtr systemDiagnosticsStopwatchMethodReset, IntPtr unityEngineObjectPropertyGetName, IntPtr unityEngineObjectPropertySetName, + IntPtr unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject, + IntPtr unityEngineObjectMethodop_ImplicitUnityEngineObject, IntPtr unityEngineGameObjectConstructor, IntPtr unityEngineGameObjectConstructorSystemString, IntPtr unityEngineGameObjectPropertyGetTransform, - IntPtr unityEngineGameObjectMethodFindSystemString, IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript, IntPtr unityEngineComponentPropertyGetTransform, IntPtr unityEngineTransformPropertyGetPosition, @@ -459,6 +463,8 @@ static extern void Init( IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3PropertyGetMagnitude, IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, + IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, + IntPtr unityEngineVector3Methodop_UnaryNegationUnityEngineVector3, IntPtr releaseUnityEngineRaycastHit, int ReleaseUnityEngineRaycastHit, IntPtr unityEngineRaycastHitPropertyGetPoint, @@ -514,10 +520,11 @@ IntPtr systemExceptionConstructorSystemString 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 UnityEngineGameObjectMethodFindSystemStringDelegate(int nameHandle); delegate int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate(int thisHandle); delegate int UnityEngineComponentPropertyGetTransformDelegate(int thisHandle); delegate UnityEngine.Vector3 UnityEngineTransformPropertyGetPositionDelegate(int thisHandle); @@ -533,6 +540,8 @@ IntPtr systemExceptionConstructorSystemString 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 void ReleaseUnityEngineRaycastHitDelegate(int handle); delegate UnityEngine.Vector3 UnityEngineRaycastHitPropertyGetPointDelegate(int thisHandle); delegate void UnityEngineRaycastHitPropertySetPointDelegate(int thisHandle, ref UnityEngine.Vector3 value); @@ -608,10 +617,11 @@ public static void Open( 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 UnityEngineGameObjectMethodFindSystemStringDelegate(UnityEngineGameObjectMethodFindSystemString)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)), Marshal.GetFunctionPointerForDelegate(new UnityEngineComponentPropertyGetTransformDelegate(UnityEngineComponentPropertyGetTransform)), Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformPropertyGetPositionDelegate(UnityEngineTransformPropertyGetPosition)), @@ -627,6 +637,8 @@ public static void Open( 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 ReleaseUnityEngineRaycastHitDelegate(ReleaseUnityEngineRaycastHit)), 1000, Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetPointDelegate(UnityEngineRaycastHitPropertyGetPoint)), @@ -815,33 +827,55 @@ static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorDelegate))] - static int UnityEngineGameObjectConstructor() + [MonoPInvokeCallback(typeof(UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObjectDelegate))] + static bool UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject(int xHandle, int yHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject()); + var x = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(xHandle); + var y = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(yHandle); + var returnValue = x == y; return returnValue; } catch (System.NullReferenceException ex) { NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(bool); } catch (System.Exception ex) { NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(bool); } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorSystemStringDelegate))] - static int UnityEngineGameObjectConstructorSystemString(int nameHandle) + [MonoPInvokeCallback(typeof(UnityEngineObjectMethodop_ImplicitUnityEngineObjectDelegate))] + static bool UnityEngineObjectMethodop_ImplicitUnityEngineObject(int existsHandle) { try { - var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject(name)); + var exists = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(existsHandle); + var returnValue = exists; + return returnValue; + } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } + catch (System.Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorDelegate))] + static int UnityEngineGameObjectConstructor() + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject()); return returnValue; } catch (System.NullReferenceException ex) @@ -856,14 +890,14 @@ static int UnityEngineGameObjectConstructorSystemString(int nameHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectPropertyGetTransformDelegate))] - static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorSystemStringDelegate))] + static int UnityEngineGameObjectConstructorSystemString(int nameHandle) { try { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject(name)); + return returnValue; } catch (System.NullReferenceException ex) { @@ -877,13 +911,13 @@ static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodFindSystemStringDelegate))] - static int UnityEngineGameObjectMethodFindSystemString(int nameHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectPropertyGetTransformDelegate))] + static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) { try { - var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); - var returnValue = UnityEngine.GameObject.Find(name); + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.transform; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) @@ -1183,6 +1217,46 @@ static void UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(re } } + [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate))] + static UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 a, ref UnityEngine.Vector3 b) + { + try + { + var returnValue = a + b; + return returnValue; + } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } + catch (System.Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3Delegate))] + static UnityEngine.Vector3 UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3(ref UnityEngine.Vector3 a) + { + try + { + var returnValue = -a; + return returnValue; + } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } + catch (System.Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } + } + [MonoPInvokeCallback(typeof(ReleaseUnityEngineRaycastHitDelegate))] static void ReleaseUnityEngineRaycastHit(int handle) { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index f2aad6c..f44ed8e 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -2014,6 +2014,83 @@ static void AppendMethod( int indent, StringBuilders builders) { + // Map convenience method names to actual method names + switch (jsonMethod.Name) + { + case "+x": + jsonMethod.Name = "op_UnaryPlus"; + break; + case "-x": + jsonMethod.Name = "op_UnaryNegation"; + break; + case "!x": + jsonMethod.Name = "op_LogicalNot"; + break; + case "~x": + jsonMethod.Name = "op_OnesComplement"; + break; + case "x++": + jsonMethod.Name = "op_Increment"; + break; + case "x--": + jsonMethod.Name = "op_Decrement"; + break; + case "implicit": + jsonMethod.Name = "op_Implicit"; + break; + case "explicit": + jsonMethod.Name = "op_Explicit"; + break; + case "x+y": + jsonMethod.Name = "op_Addition"; + break; + case "x-y": + jsonMethod.Name = "op_Subtraction"; + break; + case "x*y": + jsonMethod.Name = "op_Multiply"; + break; + case "x/y": + jsonMethod.Name = "op_Division"; + break; + case "x%y": + jsonMethod.Name = "op_Modulus"; + break; + case "x&y": + jsonMethod.Name = "op_BitwiseAnd"; + break; + case "x|y": + jsonMethod.Name = "op_BitwiseOr"; + break; + case "x^y": + jsonMethod.Name = "op_ExclusiveOr"; + break; + case "x<>y": + jsonMethod.Name = "op_RightShift"; + break; + case "x==y": + jsonMethod.Name = "op_Equality"; + break; + case "x!=y": + jsonMethod.Name = "op_Inequality"; + break; + case "xy": + jsonMethod.Name = "op_GreaterThan"; + break; + case "x<=y": + jsonMethod.Name = "op_LessThanOrEqual"; + break; + case "x>=y": + jsonMethod.Name = "op_GreaterThanOrEqual"; + break; + } + // Get the method MethodInfo method; if (enclosingType.IsGenericType) @@ -2226,19 +2303,128 @@ static void AppendMethod( methodTypeParams, parameters, builders.CsharpFunctions); - AppendCsharpFunctionCallSubject( - enclosingType, - methodIsStatic, - builders.CsharpFunctions); - builders.CsharpFunctions.Append('.'); - builders.CsharpFunctions.Append(methodName); - AppendCSharpTypeParameters( - methodTypeParams, - builders.CsharpFunctions); - AppendCsharpFunctionCallParameters( - methodIsStatic, - parameters, - builders.CsharpFunctions); + if (methodName.StartsWith("op_")) + { + string op; + switch (methodName) + { + case "op_UnaryPlus": + op = "+"; + break; + case "op_UnaryNegation": + op = "-"; + break; + case "op_LogicalNot": + op = "!"; + break; + case "op_OnesComplement": + op = "~"; + break; + case "op_Increment": + op = "++"; + break; + case "op_Decrement": + op = "--"; + break; + case "op_Implicit": + op = string.Empty; + break; + case "op_Explicit": + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append('('); + AppendWithoutGenericTypeCountSuffix( + returnType.Name, + builders.TempStrBuilder); + builders.TempStrBuilder.Append(')'); + op = builders.TempStrBuilder.ToString(); + break; + case "op_Addition": + op = "+"; + break; + case "op_Subtraction": + op = "-"; + break; + case "op_Multiply": + op = "*"; + break; + case "op_Division": + op = "/"; + break; + case "op_Modulus": + op = "%"; + break; + case "op_BitwiseAnd": + op = "&"; + break; + case "op_BitwiseOr": + op = "|"; + break; + case "op_ExclusiveOr": + op = "^"; + break; + case "op_LeftShift": + op = "<<"; + break; + case "op_RightShift": + op = ">>"; + break; + case "op_Equality": + op = "=="; + break; + case "op_Inequality": + op = "!="; + break; + case "op_LessThan": + op = "<"; + break; + case "op_GreaterThan": + op = ">"; + break; + case "op_LessThanOrEqual": + op = "<="; + break; + case "op_GreaterThanOrEqual": + op = ">="; + break; + default: + throw new Exception( + "Unsupported overloaded operator: " + methodName); + } + switch (parameters.Length) + { + case 1: + builders.CsharpFunctions.Append(op); + builders.CsharpFunctions.Append(parameters[0].Name); + break; + case 2: + builders.CsharpFunctions.Append(parameters[0].Name); + builders.CsharpFunctions.Append(' '); + builders.CsharpFunctions.Append(op); + builders.CsharpFunctions.Append(' '); + builders.CsharpFunctions.Append(parameters[1].Name); + break; + default: + throw new Exception( + "Unsupported number of overloaded operator params: " + + parameters.Length); + } + } + else + { + AppendCsharpFunctionCallSubject( + enclosingType, + methodIsStatic, + builders.CsharpFunctions); + builders.CsharpFunctions.Append('.'); + builders.CsharpFunctions.Append(methodName); + AppendCSharpTypeParameters( + methodTypeParams, + builders.CsharpFunctions); + AppendCsharpFunctionCallParameters( + methodIsStatic, + parameters, + builders.CsharpFunctions); + } builders.CsharpFunctions.Append(';'); if (!isReadOnly && enclosingTypeKind == TypeKind.ManagedStruct) @@ -2266,26 +2452,177 @@ static void AppendMethod( builders.CppFunctionPointers); // C++ method declaration + string cppMethodName; + bool cppMethodIsStatic; + ParameterInfo[] cppParameters; + ParameterInfo[] cppCallParameters; + Type cppReturnType = returnType; + if (methodName.StartsWith("op_")) + { + switch (methodName) + { + case "op_UnaryPlus": + cppMethodName = "operator+"; + break; + case "op_UnaryNegation": + cppMethodName = "operator-"; + break; + case "op_LogicalNot": + cppMethodName = "operator!"; + break; + case "op_OnesComplement": + cppMethodName = "operator~"; + break; + case "op_Increment": + cppMethodName = "operator++"; + break; + case "op_Decrement": + cppMethodName = "operator--"; + break; + case "op_Implicit": + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("operator "); + AppendCppTypeName( + returnType, + builders.TempStrBuilder); + cppMethodName = builders.TempStrBuilder.ToString(); + cppReturnType = null; + break; + case "op_Explicit": + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("explicit operator "); + AppendCppTypeName( + returnType, + builders.TempStrBuilder); + cppMethodName = builders.TempStrBuilder.ToString(); + cppReturnType = null; + break; + case "op_Addition": + cppMethodName = "operator+"; + break; + case "op_Subtraction": + cppMethodName = "operator-"; + break; + case "op_Multiply": + cppMethodName = "operator*"; + break; + case "op_Division": + cppMethodName = "operator/"; + break; + case "op_Modulus": + cppMethodName = "operator%"; + break; + case "op_BitwiseAnd": + cppMethodName = "operator&"; + break; + case "op_BitwiseOr": + cppMethodName = "operator|"; + break; + case "op_ExclusiveOr": + cppMethodName = "operator^"; + break; + case "op_LeftShift": + cppMethodName = "operator<<"; + break; + case "op_RightShift": + cppMethodName = "operator>>"; + break; + case "op_Equality": + cppMethodName = "operator=="; + break; + case "op_Inequality": + cppMethodName = "operator!="; + break; + case "op_LessThan": + cppMethodName = "operator<"; + break; + case "op_GreaterThan": + cppMethodName = "operator>"; + break; + case "op_LessThanOrEqual": + cppMethodName = "operator<="; + break; + case "op_GreaterThanOrEqual": + cppMethodName = "operator>="; + break; + default: + throw new Exception( + "Unsupported overloaded operator: " + methodName); + } + cppMethodIsStatic = false; + ParameterInfo thisParam; + switch (enclosingTypeKind) + { + case TypeKind.Class: + case TypeKind.ManagedStruct: + thisParam = new ParameterInfo{ + Name = "Handle", + ParameterType = typeof(int), + DereferencedParameterType = typeof(int), + IsOut = false, + IsRef = false, + Kind = TypeKind.Primitive + }; + break; + default: + thisParam = new ParameterInfo{ + Name = "*this", + ParameterType = enclosingType, + DereferencedParameterType = enclosingType, + IsOut = false, + IsRef = false, + Kind = TypeKind.Primitive + }; + break; + } + switch (parameters.Length) + { + case 1: + cppParameters = new ParameterInfo[0]; + cppCallParameters = new [] { + thisParam }; + break; + case 2: + cppParameters = new [] { + parameters[0] }; + cppCallParameters = new [] { + thisParam, + parameters[0] + }; + break; + default: + throw new Exception( + "Unsupported number of overloaded operator parameters: " + + parameters.Length); + } + } + else + { + cppMethodName = methodName; + cppMethodIsStatic = methodIsStatic; + cppParameters = parameters; + cppCallParameters = parameters; + } AppendIndent( indent + 1, builders.CppTypeDefinitions); AppendCppMethodDeclaration( - methodName, + cppMethodName, enclosingTypeIsStatic, - methodIsStatic, - returnType, + cppMethodIsStatic, + cppReturnType, methodTypeParams, - parameters, + cppParameters, builders.CppTypeDefinitions); // C++ method definition AppendCppMethodDefinition( enclosingType, - returnType, - methodName, + cppReturnType, + cppMethodName, enclosingTypeParams, methodTypeParams, - parameters, + cppParameters, indent, builders.CppMethodDefinitions); AppendIndent( @@ -2299,7 +2636,7 @@ static void AppendMethod( enclosingTypeParams, returnType, funcName, - parameters, + cppCallParameters, indent + 1, builders.CppMethodDefinitions); AppendCppMethodReturn( diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 2b7a78f..5273351 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -35,6 +35,21 @@ "Get": {}, "Set": {} } + ], + "Methods": [ + { + "Name": "x==y", + "ParamTypes": [ + "UnityEngine.Object", + "UnityEngine.Object" + ] + }, + { + "Name": "implicit", + "ParamTypes": [ + "UnityEngine.Object" + ] + } ] }, { @@ -50,12 +65,6 @@ } ], "Methods": [ - { - "Name": "Find", - "ParamTypes": [ - "System.String" - ] - }, { "Name": "AddComponent", "ParamTypes": [], @@ -201,6 +210,19 @@ "System.Single", "System.Single" ] + }, + { + "Name": "x+y", + "ParamTypes": [ + "UnityEngine.Vector3", + "UnityEngine.Vector3" + ] + }, + { + "Name": "-x", + "ParamTypes": [ + "UnityEngine.Vector3" + ] } ], "Properties": [ diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index d78a944..b541300 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -46,10 +46,11 @@ namespace Plugin void (*SystemDiagnosticsStopwatchMethodReset)(int32_t thisHandle); int32_t (*UnityEngineObjectPropertyGetName)(int32_t thisHandle); void (*UnityEngineObjectPropertySetName)(int32_t thisHandle, int32_t valueHandle); + System::Boolean (*UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject)(int32_t xHandle, int32_t yHandle); + System::Boolean (*UnityEngineObjectMethodop_ImplicitUnityEngineObject)(int32_t existsHandle); int32_t (*UnityEngineGameObjectConstructor)(); int32_t (*UnityEngineGameObjectConstructorSystemString)(int32_t nameHandle); int32_t (*UnityEngineGameObjectPropertyGetTransform)(int32_t thisHandle); - int32_t (*UnityEngineGameObjectMethodFindSystemString)(int32_t nameHandle); int32_t (*UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle); int32_t (*UnityEngineComponentPropertyGetTransform)(int32_t thisHandle); UnityEngine::Vector3 (*UnityEngineTransformPropertyGetPosition)(int32_t thisHandle); @@ -65,6 +66,8 @@ namespace Plugin UnityEngine::Vector3 (*UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z); float (*UnityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz); void (*UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ); + UnityEngine::Vector3 (*UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b); + UnityEngine::Vector3 (*UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a); void (*ReleaseUnityEngineRaycastHit)(int32_t handle); UnityEngine::Vector3 (*UnityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle); void (*UnityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value); @@ -196,11 +199,6 @@ namespace System { } - Object::operator bool() const - { - return Handle != 0; - } - bool Object::operator==(std::nullptr_t other) const { return Handle == 0; @@ -568,6 +566,32 @@ namespace UnityEngine delete ex; } } + + System::Boolean Object::operator==(UnityEngine::Object x) + { + auto returnValue = Plugin::UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject(Handle, x.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + Object::operator System::Boolean() + { + auto returnValue = Plugin::UnityEngineObjectMethodop_ImplicitUnityEngineObject(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } } namespace UnityEngine @@ -707,19 +731,6 @@ namespace UnityEngine return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); } - UnityEngine::GameObject GameObject::Find(System::String name) - { - auto returnValue = Plugin::UnityEngineGameObjectMethodFindSystemString(name.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::GameObject(Plugin::InternalUse::Only, returnValue); - } - template<> MyGame::MonoBehaviours::TestScript GameObject::AddComponent() { auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(Handle); @@ -1646,6 +1657,32 @@ namespace UnityEngine delete ex; } } + + UnityEngine::Vector3 Vector3::operator+(UnityEngine::Vector3& a) + { + auto returnValue = Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(*this, a); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + UnityEngine::Vector3 Vector3::operator-() + { + auto returnValue = Plugin::UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } } namespace UnityEngine @@ -2954,10 +2991,11 @@ DLLEXPORT void Init( void (*systemDiagnosticsStopwatchMethodReset)(int32_t thisHandle), int32_t (*unityEngineObjectPropertyGetName)(int32_t thisHandle), void (*unityEngineObjectPropertySetName)(int32_t thisHandle, int32_t valueHandle), + System::Boolean (*unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject)(int32_t xHandle, int32_t yHandle), + System::Boolean (*unityEngineObjectMethodop_ImplicitUnityEngineObject)(int32_t existsHandle), int32_t (*unityEngineGameObjectConstructor)(), int32_t (*unityEngineGameObjectConstructorSystemString)(int32_t nameHandle), int32_t (*unityEngineGameObjectPropertyGetTransform)(int32_t thisHandle), - int32_t (*unityEngineGameObjectMethodFindSystemString)(int32_t nameHandle), int32_t (*unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle), int32_t (*unityEngineComponentPropertyGetTransform)(int32_t thisHandle), UnityEngine::Vector3 (*unityEngineTransformPropertyGetPosition)(int32_t thisHandle), @@ -2973,6 +3011,8 @@ DLLEXPORT void Init( UnityEngine::Vector3 (*unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z), float (*unityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz), void (*unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ), + UnityEngine::Vector3 (*unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b), + UnityEngine::Vector3 (*unityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a), void (*releaseUnityEngineRaycastHit)(int32_t handle), int32_t refCountsLenUnityEngineRaycastHit, UnityEngine::Vector3 (*unityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle), @@ -3013,10 +3053,11 @@ DLLEXPORT void Init( Plugin::SystemDiagnosticsStopwatchMethodReset = systemDiagnosticsStopwatchMethodReset; Plugin::UnityEngineObjectPropertyGetName = unityEngineObjectPropertyGetName; Plugin::UnityEngineObjectPropertySetName = unityEngineObjectPropertySetName; + Plugin::UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject = unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject; + Plugin::UnityEngineObjectMethodop_ImplicitUnityEngineObject = unityEngineObjectMethodop_ImplicitUnityEngineObject; Plugin::UnityEngineGameObjectConstructor = unityEngineGameObjectConstructor; Plugin::UnityEngineGameObjectConstructorSystemString = unityEngineGameObjectConstructorSystemString; Plugin::UnityEngineGameObjectPropertyGetTransform = unityEngineGameObjectPropertyGetTransform; - Plugin::UnityEngineGameObjectMethodFindSystemString = unityEngineGameObjectMethodFindSystemString; Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript = unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript; Plugin::UnityEngineComponentPropertyGetTransform = unityEngineComponentPropertyGetTransform; Plugin::UnityEngineTransformPropertyGetPosition = unityEngineTransformPropertyGetPosition; @@ -3032,6 +3073,8 @@ DLLEXPORT void Init( Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle = unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle; Plugin::UnityEngineVector3PropertyGetMagnitude = unityEngineVector3PropertyGetMagnitude; Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle = unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle; + Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3 = unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3; + Plugin::UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3 = unityEngineVector3Methodop_UnaryNegationUnityEngineVector3; Plugin::ReleaseUnityEngineRaycastHit = releaseUnityEngineRaycastHit; Plugin::RefCountsLenUnityEngineRaycastHit = refCountsLenUnityEngineRaycastHit; Plugin::RefCountsUnityEngineRaycastHit = new int32_t[refCountsLenUnityEngineRaycastHit](); diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index ca9ff50..04435ec 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -156,7 +156,6 @@ namespace System Object(Plugin::InternalUse iu, int32_t handle); Object(std::nullptr_t n); virtual ~Object() = default; - operator bool() const; bool operator==(std::nullptr_t other) const; bool operator!=(std::nullptr_t other) const; virtual void ThrowReferenceToThis(); @@ -471,6 +470,8 @@ namespace UnityEngine bool operator!=(const Object& other) const; System::String GetName(); void SetName(System::String value); + System::Boolean operator==(UnityEngine::Object x); + operator System::Boolean(); }; } @@ -491,7 +492,6 @@ namespace UnityEngine GameObject(); GameObject(System::String name); UnityEngine::Transform GetTransform(); - static UnityEngine::GameObject Find(System::String name); template MyGame::MonoBehaviours::TestScript AddComponent(); }; } @@ -667,6 +667,8 @@ namespace UnityEngine float y; float z; void Set(float newX, float newY, float newZ); + UnityEngine::Vector3 operator+(UnityEngine::Vector3& a); + UnityEngine::Vector3 operator-(); }; } From c7d128c8c1cef4ed2353d937cd715759054e736e Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 30 Sep 2017 21:18:25 -0700 Subject: [PATCH 17/95] Support "operator true" and "operator false". --- README.md | 2 +- .../NativeScript/Editor/GenerateBindings.cs | 18 ++++++++++++++++++ Unity/Assets/NativeScriptTypes.json | 3 ++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 90c2a66..f716fde 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ The code generator supports: * `out` and `ref` parameters * Enumerations * Exceptions -* Overloaded operators (except `operator true` and `operator false`) +* Overloaded operators The code generator does not support (yet): diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index f44ed8e..81919a2 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -2035,6 +2035,12 @@ static void AppendMethod( case "x--": jsonMethod.Name = "op_Decrement"; break; + case "(true)x": + jsonMethod.Name = "op_True"; + break; + case "(false)x": + jsonMethod.Name = "op_False"; + break; case "implicit": jsonMethod.Name = "op_Implicit"; break; @@ -2338,6 +2344,12 @@ static void AppendMethod( builders.TempStrBuilder.Append(')'); op = builders.TempStrBuilder.ToString(); break; + case "op_True": + op = "(true)"; + break; + case "op_False": + op = "(false)"; + break; case "op_Addition": op = "+"; break; @@ -2497,6 +2509,12 @@ static void AppendMethod( cppMethodName = builders.TempStrBuilder.ToString(); cppReturnType = null; break; + case "op_True": + cppMethodName = "TrueOperator"; + break; + case "op_False": + cppMethodName = "FalseOperator"; + break; case "op_Addition": cppMethodName = "operator+"; break; diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 5273351..417f342 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -1,6 +1,7 @@ { "Assemblies": [ - "DOTNET_DLLS/System.Xml.dll" + "DOTNET_DLLS/System.Xml.dll", + "DOTNET_DLLS/System.Data.dll" ], "Types": [ { From d4292954484279045c1d3b722f8953e79301155a Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 1 Oct 2017 23:42:07 -0700 Subject: [PATCH 18/95] Remove unused System.Data.dll from bindings JSON --- Unity/Assets/NativeScriptTypes.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 417f342..5273351 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -1,7 +1,6 @@ { "Assemblies": [ - "DOTNET_DLLS/System.Xml.dll", - "DOTNET_DLLS/System.Data.dll" + "DOTNET_DLLS/System.Xml.dll" ], "Types": [ { From e77581c53c219c372e143b8af1f5228008bac5f4 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Wed, 4 Oct 2017 20:40:30 -0700 Subject: [PATCH 19/95] Support indexers with multiple parameters --- Unity/Assets/NativeScript/Bindings.cs | 45 +++++++ .../NativeScript/Editor/GenerateBindings.cs | 120 +++++++++++++++--- Unity/Assets/NativeScriptTypes.json | 21 +++ Unity/CppSource/NativeScript/Bindings.cpp | 38 ++++++ Unity/CppSource/NativeScript/Bindings.h | 31 +++++ 5 files changed, 236 insertions(+), 19 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 3aa4200..9aa6d0c 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -299,6 +299,8 @@ delegate void InitDelegate( IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, IntPtr unityEngineVector3Methodop_UnaryNegationUnityEngineVector3, + IntPtr unityEngineMatrix4x4PropertyGetItem, + IntPtr unityEngineMatrix4x4PropertySetItem, IntPtr releaseUnityEngineRaycastHit, int ReleaseUnityEngineRaycastHit, IntPtr unityEngineRaycastHitPropertyGetPoint, @@ -465,6 +467,8 @@ static extern void Init( IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, IntPtr unityEngineVector3Methodop_UnaryNegationUnityEngineVector3, + IntPtr unityEngineMatrix4x4PropertyGetItem, + IntPtr unityEngineMatrix4x4PropertySetItem, IntPtr releaseUnityEngineRaycastHit, int ReleaseUnityEngineRaycastHit, IntPtr unityEngineRaycastHitPropertyGetPoint, @@ -542,6 +546,8 @@ IntPtr systemExceptionConstructorSystemString 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); @@ -639,6 +645,8 @@ public static void Open( 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)), 1000, Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetPointDelegate(UnityEngineRaycastHitPropertyGetPoint)), @@ -1257,6 +1265,43 @@ static UnityEngine.Vector3 UnityEngineVector3Methodop_UnaryNegationUnityEngineVe } } + [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertyGetItemDelegate))] + static float UnityEngineMatrix4x4PropertyGetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column) + { + try + { + var returnValue = thiz[row, row]; + return returnValue; + } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + catch (System.Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertySetItemDelegate))] + static void UnityEngineMatrix4x4PropertySetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column, float value) + { + try + { + thiz[row, column] = column; + } + catch (System.NullReferenceException ex) + { + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + [MonoPInvokeCallback(typeof(ReleaseUnityEngineRaycastHitDelegate))] static void ReleaseUnityEngineRaycastHit(int handle) { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 81919a2..0b1cc4a 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -54,6 +54,7 @@ class JsonMethod class JsonPropertyGet { public bool IsReadOnly = true; + public string[] ParamTypes; public string[] Exceptions; } @@ -61,6 +62,7 @@ class JsonPropertyGet class JsonPropertySet { public bool IsReadOnly; + public string[] ParamTypes; public string[] Exceptions; } @@ -1813,21 +1815,50 @@ static void AppendProperty( Assembly[] assemblies, StringBuilders builders) { - PropertyInfo property = enclosingType.GetProperty( - jsonProperty.Name); - Type propertyType = OverrideGenericType( - property.PropertyType, - typeGenericArgumentTypes, - typeParams); JsonPropertyGet jsonPropertyGet = jsonProperty.Get; if (jsonPropertyGet != null) { - Type[] exceptionTypes = GetTypes( - jsonPropertyGet.Exceptions, - assemblies); - MethodInfo getMethod = property.GetGetMethod(); + PropertyInfo property = null; + MethodInfo getMethod = null; + if (jsonPropertyGet.ParamTypes != null) + { + PropertyInfo[] properties = enclosingType.GetProperties(); + foreach (PropertyInfo curProperty in properties) + { + // Name must match + if (curProperty.Name != jsonProperty.Name) + { + continue; + } + + // Must have a get method + getMethod = curProperty.GetGetMethod(); + if (getMethod == null) + { + continue; + } + + // All parameters must match + if (CheckParametersMatch( + jsonPropertyGet.ParamTypes, + getMethod.GetParameters())) + { + property = curProperty; + break; + } + } + } + else + { + property = enclosingType.GetProperty(jsonProperty.Name); + getMethod = property.GetGetMethod(); + } + if (getMethod != null) { + Type[] exceptionTypes = GetTypes( + jsonPropertyGet.Exceptions, + assemblies); ParameterInfo[] parameters = ConvertParameters( getMethod.GetParameters()); OverrideGenericParameterTypes( @@ -1844,21 +1875,58 @@ static void AppendProperty( jsonPropertyGet.IsReadOnly, enclosingType, typeParams, - propertyType, + property.PropertyType, indent, exceptionTypes, builders); } } + JsonPropertySet jsonPropertySet = jsonProperty.Set; if (jsonPropertySet != null) { - Type[] exceptionTypes = GetTypes( - jsonPropertySet.Exceptions, - assemblies); + PropertyInfo property = null; + MethodInfo setMethod = null; + if (jsonPropertySet.ParamTypes != null) + { + PropertyInfo[] properties = enclosingType.GetProperties(); + foreach (PropertyInfo curProperty in properties) + { + // Name must match + if (curProperty.Name != jsonProperty.Name) + { + continue; + } + + // Must have a set method + setMethod = curProperty.GetSetMethod(); + if (setMethod == null) + { + continue; + } + + // All parameters must match + if (CheckParametersMatch( + jsonPropertySet.ParamTypes, + setMethod.GetParameters())) + { + property = curProperty; + break; + } + } + } + else + { + property = enclosingType.GetProperty(jsonProperty.Name); + setMethod = property.GetSetMethod(); + } + MethodInfo method = property.GetSetMethod(); if (method != null) { + Type[] exceptionTypes = GetTypes( + jsonPropertySet.Exceptions, + assemblies); ParameterInfo[] parameters = ConvertParameters( method.GetParameters()); OverrideGenericParameterTypes( @@ -1875,7 +1943,7 @@ static void AppendProperty( jsonPropertySet.IsReadOnly, enclosingType, typeParams, - propertyType, + property.PropertyType, indent, exceptionTypes, builders); @@ -3454,10 +3522,17 @@ static void AppendGetter( enclosingType, methodIsStatic, builders.CsharpFunctions); - if (parameters.Length == 1) + if (parameters.Length > 0) { builders.CsharpFunctions.Append('['); - builders.CsharpFunctions.Append(parameters[0].Name); + for (int i = 0; i < parameters.Length; ++i) + { + builders.CsharpFunctions.Append(parameters[0].Name); + if (i != parameters.Length-1) + { + builders.CsharpFunctions.Append(", "); + } + } builders.CsharpFunctions.Append("]"); } else @@ -3636,10 +3711,17 @@ static void AppendSetter( enclosingType, methodIsStatic, builders.CsharpFunctions); - if (parameters.Length == 2) + if (parameters.Length > 1) { builders.CsharpFunctions.Append('['); - builders.CsharpFunctions.Append(parameters[0].Name); + for (int i = 0, end = parameters.Length-1; i < end; ++i) + { + builders.CsharpFunctions.Append(parameters[i].Name); + if (i != end-1) + { + builders.CsharpFunctions.Append(", "); + } + } builders.CsharpFunctions.Append("] = "); builders.CsharpFunctions.Append(parameters[1].Name); } diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 5273351..12a7a5d 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -232,6 +232,27 @@ } ] }, + { + "Name": "UnityEngine.Matrix4x4", + "Properties": [ + { + "Name": "Item", + "Get": { + "ParamTypes": [ + "System.Int32", + "System.Int32" + ] + }, + "Set": { + "ParamTypes": [ + "System.Int32", + "System.Int32", + "System.Single" + ] + } + } + ] + }, { "Name": "UnityEngine.RaycastHit", "MaxSimultaneous": 1000, diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index b541300..22aafa2 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -68,6 +68,8 @@ namespace Plugin void (*UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ); UnityEngine::Vector3 (*UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b); UnityEngine::Vector3 (*UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a); + float (*UnityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column); + void (*UnityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value); void (*ReleaseUnityEngineRaycastHit)(int32_t handle); UnityEngine::Vector3 (*UnityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle); void (*UnityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value); @@ -1685,6 +1687,38 @@ namespace UnityEngine } } +namespace UnityEngine +{ + Matrix4x4::Matrix4x4() + { + } + + float Matrix4x4::GetItem(int32_t row, int32_t column) + { + auto returnValue = Plugin::UnityEngineMatrix4x4PropertyGetItem(this, row, column); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + void Matrix4x4::SetItem(int32_t row, int32_t column, float value) + { + Plugin::UnityEngineMatrix4x4PropertySetItem(this, row, column, value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + namespace UnityEngine { RaycastHit::RaycastHit(std::nullptr_t n) @@ -3013,6 +3047,8 @@ DLLEXPORT void Init( void (*unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ), UnityEngine::Vector3 (*unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b), UnityEngine::Vector3 (*unityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a), + float (*unityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column), + void (*unityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value), void (*releaseUnityEngineRaycastHit)(int32_t handle), int32_t refCountsLenUnityEngineRaycastHit, UnityEngine::Vector3 (*unityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle), @@ -3075,6 +3111,8 @@ DLLEXPORT void Init( Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle = unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle; Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3 = unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3; Plugin::UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3 = unityEngineVector3Methodop_UnaryNegationUnityEngineVector3; + Plugin::UnityEngineMatrix4x4PropertyGetItem = unityEngineMatrix4x4PropertyGetItem; + Plugin::UnityEngineMatrix4x4PropertySetItem = unityEngineMatrix4x4PropertySetItem; Plugin::ReleaseUnityEngineRaycastHit = releaseUnityEngineRaycastHit; Plugin::RefCountsLenUnityEngineRaycastHit = refCountsLenUnityEngineRaycastHit; Plugin::RefCountsUnityEngineRaycastHit = new int32_t[refCountsLenUnityEngineRaycastHit](); diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 04435ec..63679b4 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -258,6 +258,11 @@ namespace UnityEngine struct Vector3; } +namespace UnityEngine +{ + struct Matrix4x4; +} + namespace UnityEngine { struct RaycastHit; @@ -672,6 +677,32 @@ namespace UnityEngine }; } +namespace UnityEngine +{ + struct Matrix4x4 + { + Matrix4x4(); + float GetItem(int32_t row, int32_t column); + void SetItem(int32_t row, int32_t column, float value); + float m00; + float m10; + float m20; + float m30; + float m01; + float m11; + float m21; + float m31; + float m02; + float m12; + float m22; + float m32; + float m03; + float m13; + float m23; + float m33; + }; +} + namespace UnityEngine { struct RaycastHit : System::ValueType From 836012ca53fe044074fa0b7c9135f6900134ef80 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 7 Oct 2017 10:51:26 -0700 Subject: [PATCH 20/95] Force text assets --- Unity/Assets/NativeScript/BootScene.unity | Bin 12816 -> 6354 bytes Unity/ProjectSettings/AudioManager.asset | Bin 4125 -> 357 bytes .../ProjectSettings/ClusterInputManager.asset | Bin 4104 -> 114 bytes Unity/ProjectSettings/DynamicsManager.asset | Bin 4280 -> 737 bytes .../ProjectSettings/EditorBuildSettings.asset | Bin 4136 -> 226 bytes Unity/ProjectSettings/EditorSettings.asset | Bin 4184 -> 456 bytes Unity/ProjectSettings/GraphicsSettings.asset | Bin 4430 -> 2290 bytes Unity/ProjectSettings/InputManager.asset | Bin 5252 -> 5791 bytes Unity/ProjectSettings/NavMeshAreas.asset | Bin 9100 -> 1280 bytes Unity/ProjectSettings/NetworkManager.asset | Bin 4112 -> 151 bytes Unity/ProjectSettings/Physics2DSettings.asset | Bin 4300 -> 1374 bytes Unity/ProjectSettings/ProjectSettings.asset | Bin 52711 -> 18265 bytes Unity/ProjectSettings/QualitySettings.asset | Bin 4804 -> 4695 bytes Unity/ProjectSettings/TagManager.asset | Bin 5676 -> 378 bytes Unity/ProjectSettings/TimeManager.asset | Bin 4112 -> 202 bytes .../UnityConnectSettings.asset | Bin 4116 -> 775 bytes 16 files changed, 0 insertions(+), 0 deletions(-) diff --git a/Unity/Assets/NativeScript/BootScene.unity b/Unity/Assets/NativeScript/BootScene.unity index 3f7e5df7b6dbb4c552975aef829dbee6cc2a46cc..49ab8b769d7d41ff1aecaabccc9ac1091ea753e1 100644 GIT binary patch literal 6354 zcmdT|S#RSw5`Oou&^%0@l0b*=H^)gFFXBmHCmAdj3xk$un;S{=>PV-1F#mnN;$caS zlQaf<^cd*4O%};w9bbLLpZ`9Z-8$a6*ZTQkG;w|^e{u@88J4Liz6Q~GD3ep)^}J#0 z?CgwY{eg4hweG?&E^{H%aT&)V-7I)f;42@t94A@ct^UQs;zmULI%XJjTny(t6D$_r zc=W_GS~_%mEp7L@V9&h15!NIuj(J|F<0767oeq{%<2N$q*!|qs!z&g(uUW_+wi(a2 zGLD9h=hE59auM>BPadb25dY-URLWfNk`-*|{I(V`S9|VX44aYLu)5Pm9I#*M<(h=Nm12zi0IDJA+fF(!{L1`gh3+nKf2> zUfZnpe0vKo2#&0tWU@@7#$vaP1C;^XHkK$8xB<3#bM!PV?A`UnjY`@;CKAe3k+HB4 zFMP3Ok^Is)t8H)D?)A-4UAk{|6b!SHuQOJtc&^2S=LRm_vJ|l9VT`R022P#g>yBbq zJMo6aa#3VF-4t8$8^tr?AZ8h_hV_-y;5Cc*V#hi8O^MP55B#+#Gi+K9Qx*I>S&XH8 z7WFw~hU>kjF8^5FOTK1hT+I18MxrB^>jr)^Ip?{IOA`idey`m zXO7FfkVz$Q zGDy2y1KhKWB^>wy+ckr^E|rs+wfQR_DgYpLPyls}wR6`ZW$}a+@NT6-ZSY#eglMGC zktK76YEaVM{7!doc$@u=1Fa8c;+030j&_(vE>NdYFDpInpXLje?1)KJ$74{NOigif zeqcAUYwScv)i1ITX7->`ldj#+h65z`qfJv{##H`>LVM{6EAxELB2nhnuhwk!O>1H{ zB`t?hdLG-40`8dFqXMNdSLn46n}jNo@kISZE%l4cK%G7nyO$sez~!2t2}5{-D9}3W5R!`yg+21j)2vjRY9Mw1Y00Y?uS@(c) zs+gIwi5k-GL6oU->Nsl9X1KPn8d}7XN^x70NHsK$MWQNz#)p_k8-AI|on37Lh`s); zMCyl`%n=3_7R;nb=X?X>jxr8k8IQ8G1jh0hzWIhTwP;xVKKHun)6=e1;twF5b@5{V z+a@Cm!!iRSxsSnq37+-N$2=+HYXa2K)cpe*kFd>9{Z{}foMXh_ z1c;WQ3Z4OW4g=^&FlfR&Q&Eo=;NrD%EYdY3Z4h>#mBPA?yA%2 zby(M3^+LBD_E^8SUbnf|1#t?(F6fjdzkxng`=oZ_IA(c1jSydAEy#D6L*bpV6v-Ls zm?K_6<=Y@nWmwN`J!CA+*MPtu!l<_r+-xo>PE=66A~{bTYR^ucZ|d(C+{MHy$y!uK z03OQLqztJe5zu&Shrig)Y&6~iKartB=O6!6mc2Hm|1hTKNQJvh_0|MNfPYfqs*HIy zN;hb}Zv?@~5lt-S<2|4sbb^x&_7Ay(hE3c%wavX}A6=AXzYqkke}I=u#X=*VB} zh;l3A|8Mcg4=Ue*B2&$tt9K0KoKolLL(YGq0=xr9*64wO?gKm;v%Jtfd#zmz`M#6i zkIp3J+7p^SNhDgMnWESCnOyP595`Z!tA6tBobB?}yVh9+o7C##CE`!D`nq6Tup-<} z)3qc+JI-2UxLUa)7wFmzzN3E{-m8y&kQr=PH%j)Z8eECp6?J z_Aflk@Jjb~8wD=Y)OIA+Rw(PJ-7oy{X>Zl(CY2f2d^5ksv(FYUOqb|h)VqMb3yL8% zm*|>`$84Qm6X>OX4^%^n2U|s^dhci+m@}@Y~H$g z%k*~h!-a(fZxyh&^TxtLY379;joOJ*PhMF*{++wNapwgF3G{q>Az z?q6YAr##bI3B+qx&-^^vSE0TcRi1C*evdf`9z(!LzXBEAHvT^Jh_j~gz+vaLanJl6 z2#%u9xxK;S9KXlPb36Lv@x}~(m&4D`;CDOxO&R>-4yTG(IN$ql{SqqY^;4)U9QR)! z&snrNF7Jshddz0%2loue{Aq{pD;BHGMkTEGH>=f3eP%p}V_X`heWTAm6tvOWWOuw# z^Q+aM5!<_^ATkQ<39Esb@{5P2{bDdtj)F!xtd>k|a=aMSgQ5My1E%E1{;zJiNv>Pn zb(_0xzsZb_#?iam!#X(!@K7(wIV>9Cw?;6RQ$@m&4OmMfy>PCsySd z&TA4l=S8bBDfx5gab99oi|57No0ebaCHhO~bzU4p=f!akqfZQ;10|u)p~rDAK~3{l zef~@a*KvO~gX_3lxAeHj(C4_TQM--%7NFh6eQO5Sap{TD^g8Y@v~gLNPoU3vU5d)W zb>y!8EZW51Mldfp_463Il+!xTF8W!6d+BjiKfjp4RnA-nS2@?VanB6)nASg{Pg@{A z7WFeR z<>5YH$;z|QVuGjTxuT7GhJ3DZe6A!Dlq{c37F*2coo!s!Yrx65nM_c09pCS8MkN-- zZ*lk*fh~R#>-)P7-P>HfR^tg`iLhWXU*JW_p2kCz$gR33B+u>tD9l<6Qopy&a z^#0*Ye^?D86PXz^Wqg4~!criufuP=~#PjIvt<(cQ0{wXGM{yb$tTRd#YEzY<9*-ZI z7lv(Q@NmhEkLr^cZz`M{@#7$> z_*Dv>iD$LRJ$^MDkE5VI6PHO)^`ju$-|d%z@!25YOh`Ww%*D-!N*JFFFUeD^n}f|@_eh~3|8#9=LY zTH^cO%1k-t?eQj=57$eT2*N=6ViQvn#e5RWjwpWcvCrh6f7kZwPu+3V|2{DE>2GmY zd>x@yqZOn036iq3#5$LX;`FMFDzvs9RC?7O*eE?3cQZY|jp8lx5o@NklAe`C@jYl0 zliV=Df6d`QC#p9Hfny((Q_^FdVspZ=EA3e zQ^yj;MIQ2h!qGE|D}T=GdEof7?-ObKdk$w5PvZ*?w^7{bf&5p)&{l%dMsX{TS#@XTafWQvAth!r_eKIxg`khvzc*ti#u4@M8{Nm%%^ca7OVo|37m0`V9VO4won{ z@>6e*1E=0>6i?~l8AmTsJelt~hf5Ss@YUFe)ElF?%5xHpZ4PG?PvbW@T%x$}A^l;8 zZ)($f=5AmQqtbr3@0AbrsrJJtF7_kuQffbp;(~j2pPmLE&R3(j^=$>d}A0L zny!XNt*;##?zorgh;JP)`gn~>+~U4wJll*FEmWt1QrH)U4Mwnupf(#ueziX=2M72tpYC&>GTZ5$v!eC0^C2w>D z5029TxX^TCrDVgI>+T5{79d7ppZyu}=LRZ`*vG8U?+y>`02Y|`N6|ak6gZnl4o|WW&-@3lS5e8Ex@A#)o`*G} z&X|RuX>q;_UVskgDrX7CT<;$l!D&_7wYh#@vr;X!!P;bJ-=BdenwX#E;gfC4rjWMt zW)>f>hO>dd{nbis%2b2WOfV3Iv+DEwx%V{T--=P#z@}2CSE-K$Gce;q6ks3t^(GvB zP=(#!5}2Yk1fRe=gT-TQ_{Cx~!b`wnL6pMU6! zzrFFbkA3KEuif*?s{dI7^fpvl-Dj|hw0<1vE})ARwcOqMiL;zV0Oe}Y`ibajF=yjy z(fSqVYBA^GYVn@np7|ZTxqrp+p&Uw2t5QC+e#O&#X#L9PEci3`p!^)8(Bi!w5APW* zR^qh&LY}zfn3v)i%0lZepc3b9z8UnK7p-6Lm1aHU>_eY8tKjF^Tvg?y^(&s1lh!Y| z=yNan99OKL<9cQfWO*2Rpq$qFTZ`ql)}LQ2zgj=#zX7sSeh>WV-FQ|06KIpa&B0rX z`7;Oi^29s!BRRO>Y5tOf6PFX1U&r&*jpX3O#T%-AqT^fpjPk~27G-{ZqN6Nc=zkZeQ}5yoxX8ucrYDQXW-?e*tv zLNMXuz`Vxm4l=+RA+fVZT+kyRY#O-6d|LnXv*Wd0xho{#+*?*onf%U%$ ze5e!dKd(Uj$i8{6TYuUZ?-MU$+;6*aCHfHW9GCk~=;a+i{Sfz`^2zQ$uVwjk_>UiV z|80kyy8paZi*k1Gm;Fb)+x`=L@%|&;`6WU3-*Wc>GV~F@ju2PcH+3@(a2j^^!BtGX z`ruR7K7Ib9?_E>4w|e~kNBJ`NVW+eh3-$j7i?js>$iPFVE$LE@3u`~&@JN*oiw0{< zf^*Xo7lTc39+484bSc4m9WDWbIL3wk^T5el(xrr6$ECq`8_*!+;^UXZe)T=X{wMdA4>s5;_jW(|mGmTsGoi^tp~}E#AU2vR=P|KKZY+ z_z9q$c5+z;SADL};HuAeIDEMq9l?b?z8;T-VZ1NmS7Z0^V6z%Th58J>DDSBtOSNmgu<$3N-#l{Vv4bz)^UXC^eDL?a z@a3%#`648YR3pplaUt9;OXZwY9aX*pHN8Ze&}Tg2J;8r;&Z&H|Ij8bT=bS$(<|&_S z%u_z;n77wtVxE;%V&ThW!lNWGPB!OE<4-s|$vI_4Ir4BFoZ35Yiq_~e=v=m5SJ z)`ERUf+(ukZ?85A4A=D-)jk?Dg6K%F{{ZJQJW~&&K#uYnyYYFojIXi-IHk3pB}u@u zZJhtcL&NBe2mD|el;r(PR88rqgpo?UQft;M2YU*FL*!;0?my6ZhTO(%xRF&-@sh*f zC69>5Aq`Ft?OU7uf1@-&3FW>-w_~siIKtP<3Xp=X9% z1;#P6nQ+t5XEWiW4o@;+$W0A@yYmv%lxfZE>vKFa)(iXWLGWMd<0&{KMVhriir{1OYCjdC*}v7%_X$KM(aGhdlyp7JaV4*ZwW2;ldzj4}tmY8HYUp z?8E4DO`ddE9t7maHGj%s$AQttxE5b`*k1wDF+{J%yg2_^P`G)0ZvTxpKk|6~19!f< zZ_VoF-%RUdEk*lGls$Z!3!4%COXaF&9sl|>IfY|ZrFOh?O$?xe&<(nTXt@I|AoL?;KORn&Q;I$-u%ULy_ejcvly1k zx?yMNug`r$vf@+7xa7QKR(Fw4VI z`V5VP)s}>Ya;A%{JAU!UdwQRE4)vVF(X_G>XQizQt@7qIDWu61-p|7d`<^^=26Jf_ zVEE^NhprH;%Y$voB^oNT?j4fp-eQ|-z~}pz`(b}Q_TjTj#It2NL+d_PT3&U}wE4C5 z-bNNRluzf4P92I}sD3*sUr$fP(S6Tn)i1EEeuHiGD{RyENc0q6^5g1`Jk^(Zwumip z{dOgLhh)nrtzFbT_mrC-?CVtDG9K(oqH=ZIltu2a>yG3 diff --git a/Unity/ProjectSettings/AudioManager.asset b/Unity/ProjectSettings/AudioManager.asset index 47d3cd35b626ae5e100f72e37580e29caebf1e2e..da6112576a5ca4290108f6d4c731bd4c391e91d4 100644 GIT binary patch literal 357 zcmY+AF;BxV5QX>ritA7&Qq`?kyahsGAfif8B&O=(T%rRzjvRY{Uyn%wQpfw=(|b?1 zeb0&)5Id1<-?AszgbjG?Wf<6h9owC<=Jv1`LMCaN{;ER2jYzW4vMq4Ho}5eo%;mND zAmyLArIW^flCYm~ZFMjtLBy-HTHCIJN}*m+ZpTrRgA*!m-D1nB!=OD>BjIP%3fo5a zVUDZNM1P4slBFQ8&iA3~$W{FP4{LTlpsp<|daz;e67Iy3P|`I&uE8UEMjbQUS%;nn m33Fj)8lLRHDkl|pT#GqR*l3!c@waEKjzN!cmGbcuBKZNQ%x_o# literal 4125 zcmeH~O-{ow5QV4wBQ{(BDJQ4|f;FN<6`QJvNZm$GY)1wsj*@u8su$uWoQW_KWB!jY zPa2IQKfg>quL3Z81votefMe{~050cO^9y|rZ{s-5@c9Jm#!KT?q7jwqU?F-1bR>#g zq$4cf^rmW*OiVLCov({WRStJXs-+cG4|`~dcIt7htrO(mIO}UQ*>-T7G+8Jb6>JaA zTBmiAmBI$^ZrJ{e`|{R#)+!~}I&;2}Q!vdyitna%2u@wwTGb^>Q4X$~%=@&9`fjFA zOO+Ph4hg1ZwlBBT<9|221FXePcmMzZ diff --git a/Unity/ProjectSettings/ClusterInputManager.asset b/Unity/ProjectSettings/ClusterInputManager.asset index aaa577040bd1f72b86663181e50d839f867cf893..e7886b266a005f4d9d80f2fef8d1649dcfd3ed2b 100644 GIT binary patch delta 104 zcmeBBC^A=#boBL6Fw`^TQVnr*S5PcfR47SIw<^ucEU7e3(M!(H)iE+KG_>N<)zt;b z8X21@s2OriR%8;^u;Nls$c^_;%1TWx@yJX`b<0UiFSb%J01JEO6_l0$dC{?40FvPw A`v3p{ literal 4104 zcmeH_yGjE=6o$|2=HmTsCBA?~P*iLKvCu+6B(@S{6eS6=xzqz%+xiBku=8C+2x6mU zp27A1cb1jK)K+KUaOQk-=AYSrRwU?)EKG>VJTj8VZe_c&dATFsaU2^1FhUGIR|jXo z+wgsO|KRFhk1Jp`1lKwCL>&6#q;TX$oi-eB6AP4Au#<|ofWxSZvFN2#Z`%5`}I^pkGk`pLWpY>$M zz5WJj>Q5p2bMyMs?63aSpCL~ouRoh{uMa;H{W;`u`gpCe`h3E1`imJaB;R|NzRMCg z2YsW@<-q&A?6K6Ey-wFghwa;5_o&fsT-iuk=SkVgErRab{`G}DZnP|lQycYdRF9hJ qby7VfTFhT+gb)0sI#UPK0d+tfPzTfjbwC|Z2h;&|KpprG2Yvu3zI&7a diff --git a/Unity/ProjectSettings/DynamicsManager.asset b/Unity/ProjectSettings/DynamicsManager.asset index 22d9747e2005df41d3d913fd787981115617a41a..19319464b1bfb6c43363dc47d225547cca1fd9a0 100644 GIT binary patch literal 737 zcmd^6%WlFj5WMFr%z>Urlz^y;Zvo0fB7zEp)Dv2qO>pbP$aYYn>c4jheMIUf)F*pq zc4l|nevXp`i-O2&Z{jIyRW0Tq=T#})xt9h)7oBbxMcng!|BCke>@MBPh?_};^YIU1sH;-o=3vksv`RVa)_rS*cx+U|APoCW#gQ%@2)E2K zi;mQSFlxeUtxjm>!|NPWh#g)@*SyZb2 HxocpbdVK*g literal 4280 zcmeHKy>1jS5S|bqA^apE6%xfsR5X$J6HRow{OCv|POM0j3MrcG`Sy$)8`-|oZK}Km zJP4viJVaVvf|g^(-W9jWHB>Yn$!m}2`@G|C?7{$xUjf#>0l*#VsRMYq`D*j|;2Hd$ zPNxgxzowQAODA*JLyd*7u!Bwjg{O>XV;o!n+@)@$oh-EIx1{!PcJl7@qsaZf?2E3# z!of{~1bEfg<6}Y@`(i+pHx|dzmvE0DH>j}%*m4UNX*^H{Jxsz;hY;`}?d z>+$mtzZJucc$Rs)6}Q|&FRVn>rnL6N07uH#Q?N|b+YNe5H}1PDl{nZ7|5%y~O3RKO9L~2mn$l1w`8R=Xc4XtoPqxxY{s#maDKXz*Tp%UWLu}~&w8Cimrfc>ld zHT1SFMhb0%#MNY*_lq7*=25t0Y;!46XF>~a(MzMd#*&AsO7MQ=r1-C diff --git a/Unity/ProjectSettings/EditorBuildSettings.asset b/Unity/ProjectSettings/EditorBuildSettings.asset index 343a10c8818c0533760a91afd22d136742978084..990bcc22a9ad875ce290cee01e8b5d820660a967 100644 GIT binary patch literal 226 zcmaiuy$*sf6ovOb#dW|*util2f>JF_2HB|sF!w(IG_sD)(q37sk O@mUnwK$9&0M0^1;azG#e literal 4136 zcmeH~Jx;?w5QX2yiTNu431|=%4HC!%p^!EpAyLqv(4&BtU=$3(n}Q0rxk3&=MFV%C z;PD0WB@uzCu!dv;@5j`42AV3U*6m4$M9#_ z9d#$u^nLFYOH|wR23@QRlx*=KDFMUhEkgNeP|5@uRk^_z^)=>FANoUm!yIsixabkj z5%dV({MuxX%n=teh_J#5upVnaaMHj$WmoamFrFsh<B8 zi5}1FT@XEZj0<+kUdb10{WQ(oM~gT$T?DJY4l}Y;FsL0Gki4M>fUNz}?le z*j$_Z1T`g~1eAahPy$Lo2`B+2pahhF5>NvFMWDLV0vlX#Tol$7`f Ee+N2L>Hq)$ diff --git a/Unity/ProjectSettings/EditorSettings.asset b/Unity/ProjectSettings/EditorSettings.asset index 9ad0db5e1210c8df53cca9e02a181ab48b1681c2..f33b6fb4329f58ad7e9cc2de71ad1d81943e06ec 100644 GIT binary patch literal 456 zcmZ`#O;f@!5WV+TEC)OZLr@Qf6C$89q8+Qucw&}ji_tXcBwMZideYjPdVOE}-VR^p zn>!F=kqn>aYZ%l6U_8j$YW_M?m!$5Kyadtt zQt#S9YqI3Kd$%?>wIbD4x9yg=ksF>hrI{6$XSw>@_vjqoV@aXHJQnUm&+##RGO7Mj eRu_eCdcndOgZtlq2GBO@51v9;T8uwZZQ&#J;+sJL literal 4184 zcmeH~%}(1u5XUFVv6XMgs^09y|LAASPB4rfjPU$TSj)Ac_5ozLeTzP{(9uMPQ- zBav~V3Jz6;z_;h3mv|wkJAiFYwX4j?q3#+-P+t8Q{=$MzjK+ag?0v}+X)7UlSyvRe zHyiqY2!m7h0z+lIJMxZ#w|PC8_(1WgThY9*-ZlAq2x?y}!lr^`Cc)(Myn~tv=dDJh;_{j3=5{Ee!bucvR zm$i+yzEeYsI?f{4B$h0sUh&vuKJgWu2ODX;5j96NKQ{Sa8vJrs+t^6st#sgM@AWy2 z-A3?C(a<=?YgJo1#Id?DKCF1WYdIF>f=51K6nLhJ-?)~)-yoNz_DJ%f%J(QoibNn0 zNCXmrL?97J1QLNnAQ4Ce5`q6C@R8;Gd#=%SPmxr2U@TUx7JFQei6&orz3FtCl{4*2 WWn5PHvRBSVs>G~z{Ac@FuT4*crl9r! diff --git a/Unity/ProjectSettings/GraphicsSettings.asset b/Unity/ProjectSettings/GraphicsSettings.asset index 5403e07072886e8ef20121a3451f0501136e1e83..a847871e12745af102c71f5b39128eb81cb0242f 100644 GIT binary patch literal 2290 zcmb_eQE%EX5Ps)ZxDVYER0*tP%Nv5VMS~4BtkN`1$RtPN&9N=p8Kl+z`z{GE3QWt= z@qm;&=lkx?_V?xT^I$q5?v>lRoDXivMRq|fjr~k8oA;utP^Rs!TP`2L3bcl( zc)56eDkH$;_9;kc1llK0E5>0w@=5<~o5UH55ccS|I(lvsn=6EJem>*5hZV>Au!OSS z8kFAahLl050Yso^2t^-qU6--nlyL$v4fB5;X|G{_BTzQ^AazQ4?asOlxu&w%vIpEb zsq2z?*A2-gEKckl<+A3Xbe+abAPim;4Yiq?4sgKNG&f@r@+^X=x>w~OJHIcN*Jxe` z0PeNxG&{RTAkF4^1k!(TJC5f${{iGpvrRi}r;qCP;z|&tStaRWrh!Y;;{C}XU%r;Q z8Ys;y7}Ok^aXY29RQdzOb{+4!{+TFs|Cw+PGh=0X4+4!~#uRWSP}TQ_u$A|@rot$^ zNFvMwscmH=h4rM1m;aAwIeVWd8maiu)n?Qtl^>;xU6XQ&Zgh6V zoPplk;ci5woTO9*Rx_m#6DiBWZe)BC8w+Ep2yxX(YKQY4K+QO1g^89phlvr>Lzymd zNa&Gg(z&213;+CjmH!J$WoJ`rzMta=vZd7&J@&`e$LNr#Y*DNZBJg=wfSVALLCc>Vu~LuyXo%pL&>F{L#jYio1xa?_28tT|h-a{1;GuR1{@d76n9HW`BTP*};KbR>hySW~O$hp{IN7?s0cD z#?ga`i5|QeqX}F*7*8g6(u7109=w=nj0g3kC%qd@T;I2z{eo! z9KVJTM*b+CCs3%xKAM9O9RDQhWPO?$-VfcU(O!?THswZFqD|d(D73sT=g{)H*BD&T zy;hGc>Ry*}qq~4Mb(47Ib+1PsEw6in!3EuodTddb8Yb38_Z_s!7;{=)ceB9--J4S0 z9p{_1kD~4^DL1+wp-tUeQD}MH+YBz~-k$Pq-8;08qVAn3H@csqP2DXhw7l+CgA2Ob zQr@l0^f&QbBeHpQcgl_K7id#=I|?nYyTjmu?#`5V>+aG%iu=7MW*ZrCqo{j&$l$-VZfi`sq@LX*@Sl6oS;roWh_3-7DtmlBH#q~U_ z#}?P~NXi{?yhn7lA!)d;gQ*|$eoNk0cwa)3rKc;e4yW7^)9`c9`eCeS$@wOJj%Zf& z^H|Cq9nUiSF#bnTXna5ahBK*K|Bq|BUHiX`2)=5^59Ro4mLJRU*DWul+~~ex`LO0j zm+$TOEg#8n=G7H&p5rKaNAIgEug1u)lAHUIFoist-;rKos&kf+cKu?gv628;&QwFDe!1Bo)KWuq9!!f3F z3LNr+-)9>AlV7x)=TA%cTb5T0PWii*pULq{mY>b>&n=(I@oz1k&hZ~DKSy5TdV2Lb z|FL`~Pe_LK9FPZ%^|JNfp%>NpBhrFjN|Lf#e$-DDk zk;BNh!Uyx8e&z@}{!5m(z-insb<38& zL|7tsbbg)(cYs22Si;+uM+S?Np=>qWS~R8N*!AZlG17KD)TSD;uELZyXUEi>3PV*F z&DnBLSE5ph!=q-@5SXcDi0#26|S88>t#nR!;td8!t>fgf=~EmX>%YRQ`7++cxl zQq9ZSQZfNxOts?1=^$)MkNxF<(`Vo%2=#b(z7da0FVJ)S=!7Rjh5E3!AeW*Ezvi{; zs&3ZC@s&_{0XCMR%r0hR=t@5x4LrL_y{%U0#wx;!WZR3&GFBMm!P96vii74^df-Tn?&;XufmW%^Xfw zqdChHtWV2uUd3DyMhgDPpY-v%izs45ddN{M{kjZoaL%-)=f+C{d%+%)bv5dt-czU~ z(xj3ZhG%d$l@ zDx+F*X2AkrBw8V}@xb7S8=K_ORQa;%smV%ZMtgGOh6>9vx_BZ8hrL!qj!@2=y-By> zHqKDSZVgeGWGXdfYbp-iR*Q>5E(i13=7i4()zFuv$;4AiwJM%;{fslRF*h6ynpNZn z?@o5~*pe@sZf(^`rtAObCfklK=A2Hot8plC&0c0cVh3EqB-AC(+P04`wz?XFXbpQ+ zRS%{XWL#@Z_;W!d@{O4I@mX%mWhQ58}&U4OETKZpzTe; zah%VR{FqAGD?f5ff5}cs`pu6)(?@20G_JH)eheALj|nZAuRl^~ueWUFKj#4aB@5GI rGxeTKee<4`F?VI^9lH?DeKT2<_0?m?nVGBo?Ho(im+y5FOFRApb1Tm? diff --git a/Unity/ProjectSettings/InputManager.asset b/Unity/ProjectSettings/InputManager.asset index 8af48d36e67d91da913697a5121a6bb297fec51f..9e606dcdb39ee7c141ddb44b119c8c72deb37104 100644 GIT binary patch literal 5791 zcmd^@!E)0u5Qgu0itVACNXBkX_!c@-3PS=jWq_U-#a>($TlPqD+Vts>wXtcG6yhc- zp7y%CvgJ?zu6BKVIhlTha1;)Xzf9i2QFR2GrBNlgUXGJdT;#7$f-sB*!{M;@hGTdY z4&IBh(o-f_iZU7i9a$QjEqg7ZT1yFzG|S#yFamb}z_f#lz?V#*w^Sef2dTGxBX@Ta!R%0lrvwsAn1hTI9zHs*3m<1XIvs3 z$|1D26;~}lh_xh1Z_(OA(DI^ExDrN-E(`*a%3n3tMv?4jg%{b?0P8dd@C(pzYdE>N z+Spyu5kETJUh`{;$o|F7qHyz-1ejCh>a0IH+}`s0P~}vPyva|MEXGD-yK2wI_ZHgJ zR+jH}lis-Phit9L*+;Eis)6ZY>Z0?n`bJTET&slY@`a%yY#logLUj?#BFnyAAs()W zv-I7vW{n-nnT>B#(u2OJQg(#qq2u*UYZSh*uUJdS-O`Z|?U9ZL?{a$vi!jnia39vA z67mU}TcdVm#*SYwx8qhb#%zuTmb1xLw@I`1HY?k{_2qQ8EBGuQ!{JR@OL;Ij^X$W z{@%r%u3BO-Yw;B3ndE?rLqby{6l?<=Leq_J-jtIdGilR~-_+sB0cXCW=LBd4IC5I}TO4Zj91((;@Ney5&LSx<2gB z*KNn4O4prHx*86NU)Nm^Vl7ITf>z3ULiP1NbI(CR_WT%B$XTc%_bVZi<&V6b*nQ_XQ0kNoq;+7bq4AT)EW4H8KC1A9U_}aDh5fc zSd?p_*T9IcDLNphqP4Ej(z_kYY={REd)g{fB+nzsO2>ILVu{Be!L%L2p9!V_tAB|Q0#X(nJ&RcztEN8h6eVoO( XqdCj9=;JKLt>*OAqmQo`vzqT8?ry24 diff --git a/Unity/ProjectSettings/NavMeshAreas.asset b/Unity/ProjectSettings/NavMeshAreas.asset index a2aa7286a46e70862fac140d734bdac9a9c8d142..6dd520f63abdb6a5a948a6cde5a008e5564e29f6 100644 GIT binary patch literal 1280 zcmeH{K~KU!5QXpk70Urnme2}?^wvNW4WI#{@kEC0q^$0Co9@<#zusA((8L&Tp6IFj z=FLp{ns3{$$!yAkPT;jy$sKD|EoLE$t6bRKP1@mFU5DKuh&|u;T{Q?Jb`^MY_?V&D zK9%|nxm}{QBF{|hF{aj!8>dY~inkI-WL=UCmI9>s!t@zSBXl0KkYp$k_H91PL1D~Z zK)%C9BGnk<+Sr%{^j??e+WuvEs8rGDc3bN1hTI%_k$(n#$>e`BQR^ufn`D^V)vmz% zam@VTaM0_8QGY-`L9Lr``M+^QBsE7k;*Qb+Qc*bwJN>gbL6L0Y{ExtWogkm`ix6jTsALA?GydSQPmJGvYlV((8o^@(Sb#rCidD zP+R%=+zF!n;}W0@_V$&K*tFZzIqXM=@8G;D!Qztyj*1dJOg=?8ryJ&Y*-R=LszvI3 E1Lqk~ZU6uP literal 9100 zcmeI&cXw1p7{~Dos8~?J-c7`=L=qB;Eg?okq*y@gc#~|Bh0O+cH)yc1_J+MH_TGE% zy?4dl-hr>c_)NL_+h?8`<{ba^o)dO<^POjJK5RI5_mCv@tCM8>$|OnFOOpCO={9L@ zXlZEbX-xha9v&V+_s^oQx#_YwxpLp^bSPIUC+%rDm(X{IRjv+|B~=AonTTa%ZMCbN4TjMiyq?I&jAIujj6Y|A6{iJmh^%IVy zUFyi5a1^b}l~TUgn-tT2b5iOtb*N@+)!a@mmC~Wa{HabnI}6o}YfBO}SDkM;zdWZ; zacz1)9Xc?}q^mD2CEe=W)T8UzN3rNB45XE$YoJ`wLq<&X@ zh&_aYLF@^MUAho^K@njpkv7$QSV5efz|6%xC2A*MkT1JR-(_Jv(Oi2Yb2LF`XW5aIwB zB10S~6bzyj61#LE+8~O7n5-eD!!930J8L9}gQy8Ybifc9;$Wd*5HldLOBdo0h+-h7 zXo#7x%Lj2NYb1zS)C3_8gCR1+Y@uKfb0D!x7h*0%F%VNV#5~yLgE*Wu62uYI1R;)u zAu_~KLct*BLt>XM!~%$7Af{=EqhXg1Vj*iJh-0V;LL3W2WQgO0f^GTFhBS}=K2}%sY5LsfGP%w#8A+bwW;xve&B+TXI5Nz{FEN6`*aXK|Yi8Ek` zEODk#FbVbfmO8QlYVCY5u|hpchl-*k%=Kke?V&@@uF4U-jw z@pEB_elogW`)2$+pY%#03yVNtg@F3t^k@HE|JZB#Dcu(F*FeP54;i5*Q*& zTq+byVkIPY=}KG%QIv$a!n_=|`6RAjjU;g;H9?81V2CVnwNNmLYap>pSK?ZTq9n{E z=5?^mCviP%B#9fS2};}uLu84Ygn~)j42fO361PAUC1I{HSHU))#I3B6ByOW7C~-Rs zktOaB3MO$UBzEaa+yzmLM3cG3yc@RpB<^92Byle_L5cfdh%9lxP%w!HAhAnV;z5X_ zB+NDDL$J*!@i1#7iASgjN<0cfWQoUwf=N6MiCwx9Pe2qUVXiTsgl#^Fr&uFNJWWkd z;u#nsOFSzSOyW66?9!EZ9-=4-bB*}|Z1YLH$QnuFC2E2aFT)U7;uWD_60bsHm#)NX z5JgFtYs}YSn@{2m)<_a>QWKPT3x>!NZwm#Jcn1=@bS2(}C`!UyW4;I5d=l@oMw0k| znxMpoFhrL4NGO=Z$B@{iEAa_LQ4;1F^HbR7llY7^lEmlK1SP(JA+p4mLct`yg2XOe ziLW7wk}%hp-@rDX#J8-GBvw-sl=u#Y$P(WR1(Wyz61#LIeuOAW!dzqi1lxQPKeI-X z_=TFF#IG z^ye7*nmbUbTbLG>q@4x&=&IUE59$BKFl(@1eQeUEI&)N8M`cUu{$DGM|L*WNJHC82 diff --git a/Unity/ProjectSettings/NetworkManager.asset b/Unity/ProjectSettings/NetworkManager.asset index 735131df1ebb84a2b48fbab5db2d838eb501b3a2..5dc6a831d9f2a11f08ed96571e0f602e3c3908b5 100644 GIT binary patch literal 151 zcmY$5boBL6Fw`^TQVnr*S5PcfR47SIw<^ucEU7e3(M!(H)iE+KG_>N<)zt;b8k$%t zs2OtkrIwWE7iIe<<|U@57FlsADCEZbCuOB3mw05Rq`KuKrWac&7=VRcQj<#4eNxL( nb6_IDsd*_yi6yC43Wla&C62|#sU;!#0Y#~4iAh!p)wNszrV1>) literal 4112 zcmeH_$xg#C5I~2r?>%zl3o2URhLDP?79^HPzzLzsZ6+a*rLtWR{0G0qClO}s8cNB5 z5AaBix2Lh^#Q?PrfO;JOR;i~B;Gl8XXhlu+5ldbejCh!Ux^k-cJoALNfdPIk9>TM27ZfAA`bSk%z$bZO-t{WY+H{DUuE@ zdTR#aseKTE&<_)6y8_~+X(9ZC`N4AY;SG2L-hemY4R{0IfH&X`cmv*mH&9_<)aJ!6 Dh;4Td diff --git a/Unity/ProjectSettings/Physics2DSettings.asset b/Unity/ProjectSettings/Physics2DSettings.asset index 055659b9481f05f5ff68108962498a2149bac151..e3b2d0b3a6fb20d0ffd2a5b793df4ad228f3d8fa 100644 GIT binary patch literal 1374 zcmd^8O^@0z5WVv&yoc=xP!c`@xdl*nkw9#lXr-Qz36tQi6C>LxORN6(j_r`9^ww*U zkm7msX6C)IAHT%g4e^J5?=g*^$V2@=G%cdKV){Bd4l_~q1JC!P-e52=s6Qtk{NBsy zs#vCiRRUVGs!&mnkaE8}e1%Luvm<=u6obUWumZ^_XW!xY3Q{pqMPy{NpCtW;T_W=1 z9W(m`zXtQ+%>QZ8738$$dP}wCV^+>MtXG)o5?+Ce4EbwJpc?C9znP`J2*pgGi@26I zPI{7{PJ$mJ;#-sKJiu4TBpPS4GYLL|rc=rjk~Q+Yyp8fT`&j;pHB| z&q8;R(bOReT9*Zt8j_51Kut}nHlDH)cKNzI(@eKH;l!3TSSk_@a5hXAbmQA#DmYqF zWwx&81U3ThaVN0xdMPT6?RI&tK%2@pZmmVaN;JUv;wpZsaWSBtnNB4u3f%3@%mzs` z3S3u9!8zWD-|+H8s{#@&&T2_HKhW&0xhmzp4eY8FQ}kfGX$0^Ky{hCSE}eqT%xyMq1` zY~5jDL~5$79=BHHnSmxV91t-h3K>D+9N-alliY|b=lzPvEsRbMPe1U~?u$O(lMJ~V z2yyVT594D*DP0{P<-KNS!WM7~Ay=`Hd055y1F4vWsoUzBU;edDu3sVJV zR&SSC9WcwaV6xiU!N@H>U=wM>q&vZNqM(I?(usU(dqVPd%Z0h&ARZKe9@J%aSb}c; z6?Dv{N-^a&9)?+=a<3B!Ko)kSak;B9f^bU&yhmsA1h2;EB*aLDnwz1LeRuH9HH-r` z?TDN+y{ojw>%n-Ab7wuLk!KV62kGv5QleRIq|3cG=G-6d-g?fFvP*>fYY0s?8D&gc z-b*oiT~{*R;0{WvoCC-MV4`G9PFuQcuL(nXRa8L)L{k3>z7g( zynU<-EvByWpUtr-7`2AhtSEo!>F~Uq59^_FjQHqte6h3%xeJevKC{e8_;Ll3roz@V zrUx12A2gu3Xi{+t}CX{kwvVUibf}{RD{ub<_X= diff --git a/Unity/ProjectSettings/ProjectSettings.asset b/Unity/ProjectSettings/ProjectSettings.asset index 5893f9d713995da35d969c82e3e9f59dca31c160..52eead66e042e6de6a5b2d73b9c2ffe0d70d7e6f 100644 GIT binary patch literal 18265 zcmcIsTX*9&l77#x;5^Je#XgqgOWSX<#17I`q6R%afiuJUv!lddGu< z;{ou8agZfpFwc^wFjAQi57d)aMuqEVO2xNXsN%vac#T6$DZFf@im`eQeRby0qGhgb zW@;z{@a;zOlJTSQZIhH@iw3{mNiE*2BxeO4I`d7FAZ&fA7DjKht-3r*RYPGsHUEdo1tf#b}3nI!>W#QQED zRP_ImB%3xew8n=>HBYCIiQM;6HOx~;aT~=Nd7flN=7q&)a4W+1&#Wh{DnY{OICT5` z0|@~C@Dc{aTK3{NYZb26pWNC1<6^{EXw5(W_0H{7hu#+WuIn@$-Nk^7bzUVu%XIeVnDP#3btpTaF* z{^L(!V)bE~PU2eC&ehs`4$0in8G|r~8F?e)9hGG1$8atQ_C#Bv$x)QNTrU>$aq<#J z*swr68dkxu#6c3c2(?IRf#cJ3BiyGsJQ~sKq*Y1#U9F%kOIB!8^`zC99FkjYOS~ga zg5g2`JS@g?-1GA3iCiA-6ddrDks7PCSi>i}1^iSP35ND%S_&umWf?_A_Ia+ju1S6a z%lxcrE(+(BJpcbPp=RgZnGQ2s!q-N=p~!CuW5q3fe5?za&e2O|Q%3bw2sFP_M+` zk?>hIL!gV8wm5wD5XNke{u;*Yqlj>gE2AV$#`tZ|y9|q1<$C>Ra11N#UO9^{$xhC3 zmHQGFzIH;^DJ&Q5`8Bo-lRpav!RhumOW`2s_1XY*5=eyd*W>f;onI?2Xaso8qhFOO zhe|aE!Ccqdq)~MT@gT^dQp8v24J>i)Cu!(Egh~qmAqd~yH3T@AhIw(DYF({?5AIv+ z%WB~&hPVu)bnT5IW#80o+)yyHH4M*^IDz=Cu&=3lR#Clg0Gj~f7qJBZz441Y^APV4 zxo6m=WTrL{MyM3R>q5OY3_+Tw{W%O@R^Js34gEjLFjMDOGtr=zFuY$p*w%ok)94kX zdF}->cQ~w3-7-xP|KvAi?61r3vKPWOfDvNWJoHCNTx3v86Rg`P=Uznmc%FC}Ote|f z5SS%o+UHTJCDopZ1fY#D8-6iQl_nAMXlji=LQJm31c8X018#vMzB^KP9ibhb4dlFz zb98oSe(W8e^$x6GPR-A32C-LKaEYitQgyDgPlro0Mb3zp%2feO37!=AGl|o(5bG(7 zXhbn{k32+d^qGPgS*9rzqWM>8iAz)&Oa^-rT3O?XP@fd*5u{a1Pa}InDuSz6@_k?$ z{R_y&K(G+T%M2P+Y?ZK|I1g!+T6ZwPdkZoJ>3oj>&f}J_#;{<)TxBrQ$i{r=gbDZ& z=OT)WRIKk}Ya_&CWLyR8-<3pqxu}5b5#+DOciL~tkfee0@Kr@)Q007uSOYhpg9z7$ zxsO-%9$?a8*_n-#07+%|6heymSn#|c z+tJWj7`wsuS`m(G(1H_l8){KS@PJ?k#+RLT6ipMk2$6d)A%hITgC2ljUSwf<5yO-s z1|SKd4TSSG*zFQ1ZQ583@c}7DaC1azgIJ)}7s$I0mk93=s{-=531P~pXhAzwQakM7{MU)WnaF%sDy3jrA$rDtGeoV3#stQ@zK4>*}kc9Z}SO%$AJgXZzx4><$$Z_>_xR#G^PEIgZ-w%H9dBgZ3%YE+@GAjFThW zzHhi*PBifxOwZww!H%!tWhhi@D1{UzKqWCKC(ym3%+I|HH7TgENJlxjcnyo&7*;67 zT82u6tLqZPZOtUBaIu|33dS|Uepuf3a#KNEKt4W=e0Ty4`f%-|qcAqP%;&JHG~|7B zFZdi;FVH9YEc&O{*K|LHPZnD(9^N|=i|z(DK%zCJ@+Gu^9Wg9dpyAC20x*=l9PF4_*S^dEo3Ge^toJ6WV zYuk|s_cyl{%T(Mw1F60}Azo#bg5YmKx*C0xHK>2#&MY_PQg{hQZucVmjOA(NtUe6mrOr zsj~KXtg-aDhx!A@AiCykZP(-g5cKw4YhKT}XvC|5|Ag!ue39Cy88qUj)yHPa!=3%o zwTBZ}TR1ZkqY254>%f9eD^jb|nLX#$FOk^-d4~?PJWD>JA}(uZ?#*EA{@~QPOZr4R z?c93DqH~w3$+ z_YnbxzjybX@_j_5g9CVDxSIa>+=g!ar!4%60?Q9B{SAe!0l%BPD?uHHrr9Wq{ova0 zsXsWAoZIK7!hgnBQp zzIikl5_K&2x&1GC-=%`rA}sV9^TELp8M&T*|IzR(yiKS41`QCw^*9{cCW&3|8D(>d z?hX%5DQhQ^L*J*`Sq72KN*_{i|{Ec&`2u7nx<`O7Y5u{*KXo?0Y3%p{to-Ek%_wb(Eo7;ZCI}55vdGL>~vvy!#x<(^%zP zdf^2zDbl5#R^TS|vm~WTPAfR)R|y;jTwu8aJsEQo|GO%rC^%0NgsUXW$Gt=HRW`~H zkAA2vC0UInS7{@mih(8#R3-ekDQZRZ7GTlg2NI zBXZO}eB3^K(mwp9eHhjCwk4?o-#Tueb51XFcnQpQIkN?NXO_*Otywmgwm>$gwm>$w zwm>$=wm>%5wm>%Lwm>%bwm=OIZo_PTaHLOS)wE(Fk^%&JHxLZ$27-m%Krpcz2sU;D z!N_hPSlJB(GrNIcXE%@-`VO>%N3JPFvF5hTw=h1Y(ZOtsMhC|&j1IP27#+N~Fgh;4 z!sxgK3!~#IER2r(urRtV#YXAis+2CS7qh8lY9zv;2XoYIatkn3D=(VF{E#KCv@%bv zp+*mZ)6ogVRia3!dFL?eN`f+S^WA;`kHg6|xo*yeDFzZ6cj#U8^7_@WhUk~D`Wa^b zfNSkCPe&neQJD^;#Age1k(8!z$u8K2Rgb4ANv=xx_FRW=)t+dtb&*dfS|0Br%aV)& z#8K5xQBAe>LjmU)Ef96oCzM)HenATgnnkuTtu==Q-ZGZxTd_|aMC)^Vt3>o}CMbsVbL zIt~SF9f#Vrj+3&r0~#l$r#yPK+TbD7ysonKdspP!=74N<9qm+Y@7<08=6*oK_T}v~ zY?t1SVSDy=jD~|p*9m%Wgk=%-7T{T*rr`A=DdyX-^>@)Wr_fH&SWq z4V4M0@fH@0iay#5aKy}$SB2`6=l!0H2(cwPW zyP1FccGMdj_a6@q_U!bRe%6yJJE;d?fACCQS@wh8zCne_>lm&LvTV-VxKFS4h99V> z=(a4lT>=jdRr3e%4NMDzDdL`T$=ZUS!xd33`Vk%y#Vnyu29OVe%dpBlLkj6qjAyfu zCHdQIYHzUtb0=3etbRY?CnOuBeckT3_AtAE;5)UsXW)prX0%K-NK%s+9*&UEQzNh3 z6L*g3{`ei5^DKP!{I{zTPG<*rGcTxc17)`9-J!v&;HF2Ux#%Cl;|o0`={8)jy@4?E zxaVOUW@bNBQCcMU5CZ9tRF|wSC``YgW{2~#D3aKwu0_@Io{(j4qwP87Z9}vVYk_Dl z)&hZn)xvE0b(_8(Q?9%WtvGeDMc17GfgJ1rkGPyjK(wIwkij$OXnxcGWApWo^XRwJ zm*0LrJ&p6<{)~c$$7Dz8C`7`?JNuDArD7R3^~Lz& z2wXId`s-EtvGB!?4UzYYIk+UQz?N4!oLll3nAcCy`@*w=_Rx7l1a6wHi5XqNw-FN3uM-MaESo%scF^GWNK_T>>fW@l9KL`tAl2O7EL`rgKOGdmc7 zY@iT|tuzN`DhNF^)auW?M7`4fcsi13v2n7+8qI>S7dClOyW|EkT3+LzF(R@@;y^D1 znjy77Vs8y}&8qrCz6R9fjlY%n-UCJ%)qAt~)|d?EU!!Wxq1~BtlN1hgOz*)8*Cr1X zknIi6N8?_9aCpSw8vk^B^5v9Ms}=HCL#&Qyx>N7&J~& zjy^kd)yca?O-MuZCyV9|I=zk{Y~C?cIi5OpKZ%qM>dyYC_a=4qUgc>Pl99k`0$vCZ zguJm-;*suZDyk((kmM~qT)m1kd26EKFqJNf79E;FbW(-p6+oV4#=olmMiyd zvrHl#9>^LSc|=k1Fr$xb4Z61ci2M*y^Y^`4u0o2!IHNSJ*j{Y~4{qoqZkFG?G$b}aPoz(XqbfA8A_V6n!vD(WxYCS; z1Bv~jZEYUq6TdbPwTNibC!I;V{p0BTs&J}2kjT>b2%m|dogE5Xo6}u@aX&4y+>$@@ zX2IK@ILY&p+MHUZ!K4nKV0>_kTmKBQl~6Pu3U?3ql6#yyLHdP>bg%`Ki*2~D#ZV=G zf{N)B0!J4|Dp>DN&v}t4Bq@9%@_OZ_1IUe{9Wd(u>;UPP;Qw|wSpecnwJ#d^ZV;;Z=o)nsV?&V07eT8Jq!VDaWh$@(rX z7sKW)V1PJJ!38c&VpG~Fa=0S#lciM}Hj`!Foc_Z5)eRK74+YpJU_IgJrrw0Sd zsxY*dQL=g1{Caqi)cyA0bEp zbZe2OuA@;sc%KF^ou=bJ54x~0Xh&*dny^uVS&hj7W)sgHHGd}--sVQ|tEkp&iZcYb zi!KDP7kN+kgbce2Mf;Bnc)vH@{$U@RS5R_L^jF4Zc10UBP|6rr^ZN(vO>7XzTBnfGE@a3i zX&c7v1XvU1KpCH=iH(_1smI!&k^myHr@NDBGSl7kk_8tUl|>X4 z5fu~xQCS5<6a|3@3b>#mf++5yfT+0R&i#JR`<{2|)Km%gcmKKf^SK2*-Tl;CPn~n> zY_-fJitd?+qKBW3qG;PFy63%kkLJypd-&|Rv*)awAN}XW7hmk?06T{(UVQPYe;tp3lcO@{I)}z9Z_7 zqW01F&UDNq&+&6d^keW7@s;tL;KjxBB0iIEN{GdK&UBxnXfwjxWc+#f%J|Lk@_Z5U zbp^h%d|Y|889%K9#nDdL_(6be}drgl{LhKoM@jJ`UmnZ$#<2yYp z)2PjLp?_Q8H2-$w?iKpCH{KE5Gc9U=7T=lnSK!5k<;-%sAD@}d9UK!r8|nE5zOyV} zX}lx)A^2m;cf@-X&2pZr;rRu=(X$hAjQDRwp7p3B z#%C&jb%JlIeAfiuT={OsrT%OQj{l?G@#5m^!#>Jq5$1$njdUIj&h+m=j>Xrjla=o& z*mzC(UI~7I^1aD(lm07}?-Pr^8vFf<@_iHhm&*4`@GYlFI`>yT4JrBqj{70tEa%r) z{IrOEf4mMzaDTkmF1fItF#Z(vA0*iL3grhY_xoL``<NpQbkv@^H( z^!WYGGu{zBhWdFS_RDs}{v&F;^at(q5b_P=VLLsP91HnJ;b1#uxgAE>CZ7>qg7Ult z>)4LaU%I6OJy*OP9RZ3%gx5wooIts5S$9QR{cdMWM9G7G}J;pKN zasRQ##q$&O97hS3r000Yrh0P5#e?E-`RxSflJs;rHr3N@Ts*s~r-u?ONl&k1Q#}ie zOFw@sJS?|`cyaOVaY*?h!N!Zq`x5*tH@-}(c&kvF3$iw=HvBNE%vwpH1mKc}v`JJY7IKj6;FyluO{4nK9 z6Z}-==&Rl0%b}%wd5p6hE&^vcoSfhvQ+`T<-=qB01b<5T>k@q9jl_Rig72sN^$C8Y z^3xN1Q27e-9Gx;QOelW?ITp{)QJxoU{KLve6Z}Tyg#^D>c`?BsQ(j8&=asKa@NGAi za#)q%dng}E@Y%}C3Erg~^~fzgzsr=bPVkk=$H{Y2KAg9l4bJ`+b5Ya+@~}QvfID*J zVSTQWyH_}GsTr5!a*6KuOmHqfomVQa3pRd}@#xlFY*E9Zxn2Nh4MEgcwPCM$#df2Jp4T6Z;8dT zon8XYazC3qC-LN;Qr=GRyOp1l;EyVQD>)W_T%K3{Ho?YcVlv77zCFQrRDLdbPCP7! z{lQs2=aFOa<#Uws^937UqWppwXTDZ~bHDE(&rN#H()bI>v3UOnl)qE3>Mxf$!HiNY&7o6$2nH&rK^jxl><3k-`k9b>G=#f7Uq|p zN7QpWVQ!K?t^Bhw&i4Bk^?!~Wi|-#c*>gN}XhxO-9 zaxBd6?plB7xr?w(J|klNM|)_Kf6@3xf&XrBss9_h`sS}c+(YhO8wb}P?lms{&9D#p zH-O82L;sf;pQ9`E-$(9Vq5pp4I1h#K5G|iCgKK>Y(*G6mHeF%)JV1^mSw0UEw#mct zdB}K}{;z_krT=T>?iHs0>&C?{99?1ge3RV0LjSjnOMB00z4|sd7hm5_ zQT~Wv;}zxKN$~TOKN{n#Kc58W@%=7&oBnW~_873FKP>;p$=xgLKfh;O+SjMyXWSEb z`S!(j^d(Kt_sOyNd_AuG2Z9}EJN=V-o=ot~w-Emi6MPTlKT7bq%8>@Q_U`A-u3 zROLS<&+)ouM|2F*(*&OZ^fPiS?8i92x>)(o9m`q1KBW8?E?V--^1mLO<^L3U+j)Ze z|4ZPs^8XdNdxhoyv~j6F_vwD00q5fL`v^F0rV$w zER5&%&o(%+9R1l*^6>iSUtFy4__+L6HL+>$IG-b;|<9(tx37f%N!6)flJ8J-yyA9^-2 zE}lKqvvG!p*Mqr=>5Lz*O^l1@DE06UN;Gd$Z^e3+hXjZ3~RRnK-Ap6x9@^t{5j%zLkghyBtH^t4_11pU%0$#dl4xUeHR z7IL<)Gq5#}`%cEgdGF5PT*dJ^e!N~~T+(y5re_xhw;3PyORpx+$$r`1{XAz^axBU8 z>}EVn&+gz{l}yhp_v_xnV!9khw0e|oU4-Q+1I$F z=UGk9ehh9iK1|R4tp zVYczGzkRKF!umPKxOnEOXKsdPp2dfr`N}ztFGES4py@m$=HWPAR(_~?I^6a7it@uO zUii7n507z&+ATPd6_0Lq*Lw> z`f;jA?mQa> z8UAL5zh$1#zs9)q!|#Ki$7L=3Sa@7G&fctiU4q}Ie0_{_zVswG`|Y!ghyC^&!MO_M zAIz8DWL)z5JUl#JZ)R}Y#Rv89EsW2RhsWz|^Mv_r8yEld?ZkghhX1V@{ zoG0!GKh@{*2Nqw?XDdH1!H-dXK6y^!d0%x%(|G}Tn>?(y@38o=94<8f^e7Jp+x07; zc&Blh7y0K9-j(3~IfRR1oX58c7mx3|jfc+(ya$}ClFtde*SOTHHSn;$U2Gni7hSCW z_ZbiC&n4yw>(Bd*OMiGBJgh&L($k(=ZXY1uKpvLc2g$LJ-vx*74?koc88^S7{>zMq z?dgj>qw8<1%jE560v2F>tQxz|&Ik^O|dn&vgC6U*Tc=$IT=BKgvI0T#n1k?d7<9 zlDtiSSf8&Y-#{K7m+Qe_-KxL_cD?l;1+0BbWS+Xnt=cZtufKFfR4*JWc=S8Qf-k=>GzFPCW7RvOCGK`1;B6WIegdxRl#P zT5ex7kCfYGy5GCW+w_Fxb`SXm^03_QHUISJ)3I{fV4kqtzGOVi*L~n=<#sMrm?u0xeGy!adw6~tP4mY+JU{I)F6sZirhghZ7hezmpnQ6QZ@z<+!;Bc` z{AxFF&aXCdocRjpu^WR+Jq+iuGmXo9c%FJT$?$Ay@u6oka@+Ei;@>&L|EdiCF6IgS zuQo3Jebv8fhJUvVKgPJ!^v^Ob{!aDp;r#6><+G>rlZWHQUd|&tK3?o?T-wn|@bmcY zLq86HZ%5C-X;%^`+?wT_4y!j zm(K9G9Bf?5?RoXj&hWoB!#~G7p?|J%@o%)Fq<^0CGfiRo=Q}@ncwG4V5NY-HP~+m? zN&Saq_z%zUA7P#_{YM%X|AFd1D#L$thW{Azg#KfVi~l(FAD7`jKEt0gPw4M7F8-6$ z-<9F-&hYn`C-nCk7k^Rx3o`r*GyIFp6Z-p%i+`>9Pss3}nBng?Pv{>oF8&MEzc|A` znBgBXPv}3%xcIM7|B?*hBug&nUGf(JWZ(RH>^`DjDe`ALKP38&xZ#FLecd7p^8UC{~ z{B84u{&S3r{~GnbHN*e54FB8B6Z+3JF8({!e_n?F{0#pE<_Z1pFfRT_)PG@y|D75B zcbO;jUu0bT&#M338UFWV_}^=u(0{RUIp68nS=@$9Oe4`p~Rv-r?+xpDCvsGbjJcs^qBq2~(Y;yF@1AIiJZL=Vpr!J+~Ma&qeCFHN*31iw`}w85hq-)bp7P&+Qf;dOmAhJU6Q6a~YmH zEI#yn-ne+~QO_4LJa<}r=()?dcpg#D7c)F}TYTub$GCW&QqR2^o(&csdcI^_JTIu{ zz6{U(79V=PY+O8>y-NDAuVi>0u=vpPpmFi+s-A~3JYTi=(DOCp;+dnKuV;9^Vez5o zVdLWIR?jyxJm0eT(DQBM;#sDiM>0I$vG~yQsB!U>)$`p9&tn!JdLB0}o;R!Kdl{Z5 zEI#yn-?)sA7sJEr4?mzM<@&>ujL)?(u7&6CKXe}9@#`u-GA{m)ssG0r{-0#{e`=m^ z{Qa46@!z5TpJ(`gk>P*JJfZ)W#^t)uH{qXwqWKm5I05k2A)nFxK24rdZqLw@Qf|+h zKiu!Hjmv)jqx*f1e%&vxLvFi^q~|v=&g)3~g7Y~3mOLdrzoS1TJVE%D ze=Pk^DE~)-|6BP#6MUyvOZopR!4Fja?*u6cr>fahX&A$!fQ~cYSC-iS;T>K67 zZx5d4e+A=H{5zN@^uN-$_%Bxfj^Jtjofx0u-`PB&|5e7te~bF@ykx5X)r?Q^^Y4qK zmH%$W#s9GScLz^P|18F*`1deRnEpMDi~l+G?**Rb-<$C%{(a07`u8<1{!Mq2`nex? znty-Br}$rEp3r}Qak;OwAN(xG1Hrii_5-|+aIEr!5`0AY!Q?rK|1sjL;4^^mOjO`` zhsM7)5r2)w&xys;bD#3L3I3Gwc?mv!ciHd!1m8#bAqjr0@^F`g$0o^s<7ngJzf}FlfT#KScX2vW{KuImJnqLE zm;V2H%~uYbi_h1cy5COnHhGw@E_!n0VZOS_ohRIHk8#=WgSy{da4vqokLrFGkhjUh z{Vt>@M;`7MeR%4A`;1F@KBfK>z|;IEGCsxMZ=Nt;1I8s^f7E;}2Iu1Q^>5wpAbFcS z%oqQTQAdtE%-2ce&J*r;iE-KQmb0Y(4}){ze%X%po+W%F!H-eCG{H|(zAVN$KCT02 zJzq}Vraw&o$>1G1@-Y3UkYf|_`1p9LaXBvUohAO)fv5RTV|3^Mw9Up3uM2xcDDc|0?h_{}|&_{AKfm{xgh= z{~7hK22b;kGd{&XVV=-mF)scW)L#Wp^Vb-k;y=?op}%fi{L}W3`qKbU^EVlv;%}KJ z^sg~4{_WMj7Cg^IIMcb;&+=Np&(UZnfI z0Gx~O_pVd^js*Xb@(UCEapmt!@aL4jE5V~ZCBGLX_zue7o#3xg{+FeGCHeX&c~0`had0ni*3TTboBsmU#!nm~4x9lbUPlBiUuVs9S z|2py%|MkYj|Ngzie*<`$|3=2A_-`Ul@qfy=)SnyolDM0}x%hf@r}A48{5#5TP4K6c ze>%bcq5QT4-)3*w?`INxALX|v_;JcVo8YG@{~UQv($9Lb9()GS9WnkG>cdCCSsy-6 zzJc*!efWa$us+;Lj)nDs^~(Rg#$DuX^63qmMVLHERTN{f|GVI6e$?Sq|KsKf z{ogY#{-f0YM27$S8U7!bC-gsQT>L}o|6zvzM;ZPfnduc`m34F4}P{J%0!=zrR{_|I1VGa3G8GyK0cPw0QnxcJ|%{@-Nyf1Ba|oq0n4 z^Tx%0v-*FZ;r~O1|BvPg{eLnp{(IH`=M4W}GW>rvPw0QaxcDDa|KBqFf6ws$!#tt? zpT@=iTlN1d!~gFL|9{LA`d>6I{*CvQ{>^oMZT4AV|JH#{u_LAbnMRH-B{`p&Ze0AY zQvVF_D8;`K<5T<_n8& zZ$aLsKP;au!PC;e6}d}KnEtJeOZmJ_{ro%4QHpk?$CvHQ6Z*F|F8)i^{|fLZ z#lHjNQ~a+qPw3y#xcIMA|4!ghihpOur}$rGp3uLGaq)jn{jUa(QvACzKE=PAc|!m0 z#>M}j`e%VhDgHeepW@%sJfVLtSAs|TOM1G=bCc=c7M!Rj7LR9>+6RO4e4*Fk!}Em&;8OnK`NBfu9q!*{I7U5- z%pZFCEI#y{U|c+->NzpP({J&iXTZ4Blk?$W`&vv-n|TQ9;UMF4&XUimg7i*e^2?+1b;^PGV+}G*>C&CdqjM|D6HhQf^zlM*Ob>k5c@nF+L|Ao{#T>G%@t`h8?_l9 zrvD9$&xt4Q&zmPaE~CcfymB7=Oh*Bn3y%xSf06QHf{!XMk>@0y`>lc#t&GM00sK60 zmj5d9c6&PI&z1et}ueX4w zJov)He4RtTi^k{( zC*EOP{_X^i7vnCZAB&$q{6O>dPVzQ+*gw3Bo*a3YuZzf?C+r{IZCv{8=ivv6-oqbQ zxL>yGnFmO_elK~OJlyZa#>4%-&pcsyUSjcKdA{FxSe}=HrfITey#Fv#`rSud%^Li8l!JHJ_~7(e_wASB!=kQ_|Xwf z@|nsXN$^dTe<#5=SN^DR`TMs|=zhNo9>x5AzmHkGq{r{~@dWq#{a%9m{XSt_=DmN% zevzc;`{2IZINt4gkhGT{kZ)j2Sg)QWZWAc5lI`V379WmxKQkFa@#_C$hW}6G8(0>h|Ig%D$WMa9_qTsBkJO)0_5am)SbtssPpdzFBX|C={`}pz z_$%uFM~45O8UBBnC-nc@xRn1|_5a8GVfnvk{;+)bkNimb!}9MiF8%5|;HP>TxNp~- zzg?sIolf4SE8Oo4dUE99em63IxL^P8{`qnIF7?mM@Nbgg-!#L&nQWDrhhBr(jWc;ewOdn^kebk(F@AAAlu+>U-1AC~9#De(BPrgd|PO*5V|IOg+$95)f zbK5ZeuL4g?|1RX%B$@tK8<%umqUqd~eiz>nU4{K#t?Ah86Z-wXN9ya(@#;S+!+&&!|CkK_vBo9+OVxi|hX42sf6hE%`a6wF zyDP%aexr+iEIwarb-&%@ZSt^P^w5(d59@8O`NRD#FfRGJK>Z6d{EIUDedY=MCm0w1 zW$HgM!{49bA23hoUu<0bH>iIw!#|YaKgm3ye~EGN-=+TH4F5=mf2nyw|1#s^|C;)j zXZTOf@SkFy(0{6N@jtHq*Jb!m%kaP6JfZ(|jL0!?Sr z{9(V;BHu7IoomRkB-6RpJYhQ5fv2T&J-PFQ={(E0Tt~WG)A>g8hv|Hi@v#4VGr9AJ z*OA_0@!@&#*~Y{3nl`wkKRjLFmX?I(}&;I9w^kd<3$b9~JXWj3I$lK&$zAhurP0iQk=8^oeAE5uk z#wA~Ss{bPy{wu)K%I%}%@UcAO*Ke;hF8P|P`MQdJ7ccqh)%{*gzJZ=FUmqjSiJ#|9 z{&-zuo-kh@H!jahkHEhL6rV6p_}s!L!6p6S^9I)%m;P-`(|H{|ZEh2`m+Q$lkcaK% z268OP{_RHdg#Fu1;8M9C&3Dv;X9VwEPh(_Q*iz}#auoU3!3@zRgo z55{`^KzY{z>ue^(%4KBYy|L{ffwxmB^ z-|i;IlI-{HvG}mxyVrQw?`;5=;~Vz>Um|z@u;07Scz9p+e)?U!%!>}ze0`a`O;=by zzd}!rJglD&m_M9{JZN0%PY!+_uZQS&9@+0Q-S1b)+f(=ZHF{ipxZkgvKiuy(jEldd z{)aRC-^}oT%RHg~+s4IzrurYr@P8-6|EPIF|96ec_}hk`$MrG#vG{TMBIS=K_+84s zr+jEUzrIu-E;XCw%Bn_Gt5=JyLUZBLzMiOt<1N^o5O{AsZ<%PmrIpqzFDqTqGrCns?_W$ttl5uQL9lJtn`#7@|EI} zQlr|c7fOvNUnrEIs7{ocrTT(;>C9HCQdl1qsuQ(*W&Ps(M9HVjebzm7x9W{*J(^gt z0Q*ORCsqvQn`8J;a4Qy7n~hqv8Lf-fW7TkNJl`0T#C7Eht5?;ltxB=GIu1iUS{02( zc}9&@*DkG;o9pA@Q+a=NRW;!pTvMu}EC*}(0ya;q?5vb0q%6XO&@6%8g zwp?tEMPsG%s12e@5dxN#>&;evd`T%k zKJ~aSLj71(&)3Gvg^@aH4H`**wb77j6xR6VF2g}1SR}a*mewIaG-zj`Szc3e^>r9^j8$V`#De&(I*Mixvf(Du%!HRl*4NO^%GCyIxN{-1 zeU)OlkZ)G&gO&bjzKESgs1a<`FA>!&pH-^7L=5)TS*!I`CJVi*G?rgeMtduk8)%K| z+5X2{>>_%~d6YAg*Ev33UAt&xWT>aQwla=HMR}4^v9pDAR?(xBMyhu7{>!?hwMMyE zq9x5>HDrmapD7-T=r65ox?XG8lE6+4{n-3@UFBwv+wZ%4e}4 zmX|BV>RL($@�fVI0KLGPE=dE-b}~N!pD=yQ*4WAFZmjhSAU}td83D8Yfgo8_~Ma z>bjx6lSfMHSPtD%9FF!@xU>ZG^M7basIDb6n*ITg*Fn_x^K4oImm*3%VB(V|km7#~O{ zGqSK%YQ!^!Vj0d))W%t6mHEX6Y9&iVx{^krS}PZpl}l^gIw^|bG1QP^f4R{dtTkhN z+3@;GAu6w`;6Qbb*T(YQ<0UQB!AiV(GBF?n)k+mrV-@z?Us_WdcgY7&W16boMm;}) zVlI}d1EmQZa@5LYrFyfp&Nq}=qc(2{t-kIGk>5HCXST}qQrE%(j4b7)Bg; zih(Mt?9h0NgWF_0=06EjCwnYupuUoFgUP6FOg);BjHXN25Zve|DMnA{24m%i95p{W z^r%CkxrZHvQ(XK!GIH&`5shN{GG0Qtu`ObHRAO(*tsA8#d?nQ^v=vdUV1bO4QqZ87h^19M^54Pca z4Lz2QMZ*PjPnA_ppRb`wVT44Q`ihv(mRFWhTSi;u@#5mv#3(+aljnHZ6+al=Oqs42 zC|8DytNl?@IN~P6Q#tx=3?gWjt|J{E@2|?fqkNUE6sc%Ljb^=E>#d-@p(nvAeWRXkK(h5qx$dRHOb9p4Rg1RYf zy?ZQQsg%aaQTT2^$v0M`o?=kNOhvLaS#;&WVJWu3VJ%JW0Nq`4&ERmXDEV~>P9V@( z^sdA3i)68Hm~4D*gLGA^4@aQxCSEuO1(ZpvPhAZZNduiFGO)b7pd4Glu3SgsRv#u@ z%~qo;Utd%%qQW4ocU`$TSV0A@!He$}A@hFCXYAxev%Uxu6STef3|QBU;8+oI zxT(5B4=q>xv?*h?&3F>)^Tmt}^F>WY=K5@*?n7No-+<_Tn-$EBYqtqpf1 z``MNfY@}Kn9xIKn?3>81D#c<0j)}Nmhq~3D=RhIHk#prJ!F(2z+%k|{F*)tkbIetv z`D6^*&-f4~D2aUyV|JZn-RJ?U6DOBP-RVGLgEB_Gv_zA;GDzCEBALJxXGZ$Cby^z9 zr=(K`0&PVTuKi#W9#=HrA5~c*4L{|0lO1V728vHWC+#Y0z z#^e0iLQ;A)E>sFtyN zMhb9h$x%{qUxQt$-+`pHi@iB7#%PRuZ}?4g^{7PUWz?jlhPos(ADKR4EC@~t&D+IM zS8~qg-iW3E3>}j(NQs2;=kjuM%+*+dSSM%em=yU76tPXa@|fInXh~x{Kj$H_potYd z>nr(*fW$WR6A{#~Ajttosc|*l{1M0Jm?SpGN~cJKyS&zjP%SG9`~3(wJb&&~(%Cx{ ztu2iXVJgHbjMD~;@YtdMC~X++PA0k|<)*v5=BC-WYF0yym-+0(M71)UUxTwhbXY{4 zg#xFx0UI1&1B?+KmCgl?lq+uL!VONSmMg3UeKOVdU)hQWI2)MUPZuw{B=!@sVsWs7 zYj?PI*w-T|AHbY(WDFA+oQUH>h;8m>EA_NB!)OdwPXsEju2*ZEXiizxaHqmZEHcLK#h1I2|OumPzRdkG~ zA@Nn6I7f1qo>JF#S1Y)NiRCKIh$}Rl=i%xMh6{;w^_;z5W5t}QXzo-rZz`HU6&*4a9Xb^qHWeK{6&*1Z9XS=@ zL~%-v=KAyxwMKFI23L&2oF;Haw9j!O+UGifea;iu=RSdb2_&#Dg#`8`k-)w*64**4 z$$dWEP+^B%zJ=?2)@7Z~v3&Cxm2WSM@fA%=WDV#sGEhJ21<$Y(2teBNTnG8kt*{W4ElG&0byRau4*UYEnn zuc5HNv?@Q|S6S(+Cf z)XN9{WL}_-0qA?`I{K+%q}uW)6t2@$tdkvFddpWxZ zZuH-)eQ9Argu92ajPU9e2*xRER59d_at!%e8biL8#*nY2G30A$4Eb6bL%x>AkgugN ziIoO*YH)wf}uvUkvHn`VvWB>kB7+tuLqawZ6#G*ZR^M z!X;ze)J2xvl~X zRenw++l&-&F9}x%QFSqJ%OopSEhkswW=9FvpVA^YyAHP=$gk7nLcrBiww{bwTC9Z| z>z3eCw$fFS9Z5>>%9UlzHh5pV);MJGQ0JY~WpM-!9 z_bv2%@+99~)9_e3;E-uo7{cOe-lVT1hul4GC76QuLU=JV0D4D1a17PUYx0Hl3tQ+I zgB6R1nmkQHrT2~{xV6!A_s%da##MP-8sOy*?mAdCkarhud&+fJC^$73sp4@7%+TZn zO>P!ot6pBR?P@if)k>&~b>QxB&ZQ^`=cU2$q@(+RSLx2 zl>+JlHMPpHT-(Kkd4BT)uzXvM%*;V7C8_Y<#sUImPJrJG7dp~qOSpAWZYZ*g z#HH<$Ty5eCcN-7=pWI+xfSU!lH`_p(TzM9xhZ@E$#KKr|r6jX=J?`k^2WD69=CR&Q zlHK-IkP2MFN8i%oD1i$O)!xb)?6@{h(op6#UiW?R&`7e&tj$|Iq&ZvIHBhZDJYh&f zHkad~FP;*ghd{Q(UxjJ4#OT6mUwrzRd0C5t>5?wj z2`jE|bU@DN?FJCLe8+p14Csi0l5UpVY!*CC-o>V3C(GTrqKV z!v(|#+}ga@h|7Z-4!O8x9UpU%yk%Y0YST(At2bw$UOeiZXt}+*3DyX%v!MUiCuNx5 zr8PVqQRHoY7lnR#yg9Z!Uw02qxPV3p7iBo5bC-^YSQT)03OA(W(v{m%q1>lnRCaea z5pQ%2^wCovsgwK7llMjbTa?{ZY1Hav)_z?(~)HgTJbKmX4mhZ0| z<)sV`-;K`3BBTiYgu@(1y7O`=S3qgBwQ6|%#AtO~LwYCV>Q|}KS?A?Ww@>M7Fd$>T z!Us|u^%qCwn|nUyEKD+SO?onQ==FMWR~UExCaasoW6kn>V?w^5&eqUJx;v;c!;(bc zjH#!z5;t~z5>dWQp4@h#^F;9!*tJF$%ND|6t6afw#jYRc!sGJ_wVF#+lrQ2o2WD1| zcGqeygSIg)JK~nGo#5tcWu^)hMXvO_;SIMuF$Hlcz|~>7BZ4%#2IQYNOHe*_pe>FE zMIJ*?;3uH&(S&Y1?}5ANsG8DLr$X(9k}HN=qnt;IIcDi=G+Mm>z!b#r;%c*VCEAUw zh)s&(*FD!Z@@_Jxk4=oAD!GO~nFV$;xI)m6gTr!UWfP;uuAK~Jch{Pj%H561shGDR zr&81dK1=IX@Z8&Fi{CIMFUg~;d<<%mPj;8mjNJy(Sclzg<|PAAMUyeU{;~6R^@0~m zoq54X=VXrYg$2S6zYz`a0K^C$;&mq}Za7$}VIslou~{ut$0tp!gJo1XR9in)$6a0& z049#^!Q}W+i*sBQlDNq`aNL(OySRlz!>G>ssDnBO?5g&ZRk%DnUR}>dC3l=eo}?~M zPLIbt?70N@FcrIkbxl9SIOLl>x?bErLeC~oT}?*mBPD!(3o&}Xg5M+!))tADlvbgT zoWYH+t`p)4UP6*b3*44GDREI+fbPx<*Tk9v#?MA`jod)$EaIUXJPibpQsk2q6G04( zu`mI>6Bxr|6b%L!iOgjq=E?H#nC=1zP_VRCM32Dx2nvSL>JU2_;fG+`#Es6A>xa81 zKl7Agu;FWx>$m)l-NXl-S=vez4W?-2m6(#Jt=8_W7v1i9xhWG!OOglN->bC7aSI!_ zO?7>|@+$Hd0ey(IG~0-I(CY-cO&>3*@Vs9W;95Z?v#Z$CH>GR?R15n(a9}Fcgo@KKI#^JpXfgP^uX`fO=a*Hm$c?S zocn1oTA)5&<1Rtz9MaY5by8Q*jqzzF*F&H`U$#VV*lSD|jnqgYtw_T&8}_Z*x&2<%%s)5McxBzbXZtvu1^Zc_SZjR(i^xEP-ElT$!@ ztU-R+M}8@UKbLPk`8n&;A(w8l_+Nh?yy5dZE-t@2Km9Pq@t1O@=?2H(eJi|lbmFnV zuV>(op@6yHnn0r0%jl$Agl`wUYm4Ll{G=IDyiWF+17aFB)_0$#_&a~G%P$CX@g1^6k{ACLMfmsCqZ;qE z6=vsawSzg);nU5tSD`&OxUnui-%N(zmtSY^K1gGX$G%&LesIacdSo%0I~%_xr;EjT zfcG@U-w&FJSEoFx!G9-FmLzL+;Wd-Jm6dD!_B&dc?)T>L)xnWf10ZSdma%gw(F zm7l-E8~?ErZhu&;{Q3Pz_g!m@g#SPIlWp{&uIz+!UH1C4+_P-57Sv}~-Z>QZ?O8#} z{qgYcKD><&d~xBrE%DO&&7KRRig5k`N-o>t6>kG%+>U+3V4=k)!6VjNH|NE>Us%r; z<4T+V&U_6G&-Y(lofsNE#C`YaU;^CC5RX4E!5Z0Sz_y_ibJ%$vY>E$fcQFU%9$ zt6%70d-UJ=zCB)@Lqq+2-JK(SgNu*SUc-g3-OZUZ=TN-n%$>`hbLQ|^;mv(>4HJO* z^=&o&uG_oq{0}GgKlmHKNL1T@e~EYQ$L%Z`hu>6ggK?~!rt7xD`L_(?~uJ?V@ikE}FKI%~YRtnbiMTMJJf z?d3ekJ6JAklm916yxjhGJhKq|Qfd9)@wwRj<$j}rNM7cWvdw?%(;4nx2jTP5#lxKodRKIv zGSb_%bisn&B}Y$wT(Nj?Mc3fc#XZ9-x)=3!pUCavV+!jv%fioDxjtemi;RJS)B=zsovqo3=dt^wTf8b@;)unX}GS1bmtnO`91_ zXH()e26u9b&l0m>!TbfTih%sj7eDrK|2#G&{5H`4+%~x-`!T*Ie@hi#cu?iaw@lD* z9dtZDDt}GfJw3Ikg>N!>XNFhck^?WUyI)uZ=Rs!(E6fo7EWud5f$Kw(@TGXZ71-_6 bowuy$#H9rpm+@>dmo{?X=Ko|NAa+63oWd zWgjX`%M0@Pa@@x+r?U^=_Rhzi-|%aP)83hPkQ{i1%)5zTW_3&(p^T4OP2ca<>h*fM z+wOSJ{Mze;a8wAu7$)YrTl2j5=3@2%Li2)A7;%C^uZdy}ilOcU&?``yNzwIAGVMX4 z6bO@BvdZzz7Q^*zHd<)I^8|^Z>y3yupiL%OuqE&@o8Ov&OoXv!(TiI`<$dl_vAhH= zd15l3QdbN4M9DOeOzu1K0ns6$fL2`TkZD6ih<^BKV1TCRk~~)c@ODtI~RX;-j9j?crGdWWn-Ih5cC?- z)RYkzSeisZSpypv5ll;?Nfche91L;u ztAKFBVz`8e+YDo_XY03SjPsc!is}&wVSv?DWFj?lZQKPb5pEQhOWH@5(nQ!K$7IRk zBpzQ3$8ZO{@M)1dc}Z3wBGXSO`q%Yr(uqd1Zx&nr0k;9{G2j-~YJmHv895HcyGVGz;suB8jJy37KN)xVrvJvtfU-M?6Ml)t&_cI;(Z`EP)7;hPPsb+V;^_4(AO1Ko|wZb*b N&c?+yo80DGUjXj@w>E@P_?)}W9BzA zr`aW%I!$!o1`$0#w4WbD3v&x|$LtFI+3)uY1qQEz_WK{*`F5uK&Av--9KNz~tunuV zf$82N(FD3#UMGs#q^}z>QGx$`QKI--f#NblxJpWaer8=n17{anp#KBwALSPOlt5$H z6br9$4Fw!F2`_0sN7x1|9Y>K$RN?kHqd%GHm+39mt#KQErZPT}^FPhJP(|Fyod0{k zb(y47>>K{k-jngN)?ec`#D;+^5nTJ3 z&Yg>wGG3rN9O$+g=gXP@{JDN5Xr`E)JIq)AEX5d4a;`sRCGcaJpL`zp z_rr`opNDyH?LU96@f(uxWZ&-LT$h<0=YsK^iiD%Wou&*!EbpDbJlAF5IZ>!Q*MNraos;b$uq=YMuw-hmqJmJk zZE4ismcnm1!j&g&JCLb&V>93E@(hfoVaF5JqaC_HEl0Z6ro`X^3S}>he3{NpxGL~M z-|MROM$!|Ia6`4^C=qZ%DDdpCA^cFa9gL1!XXKU)g&w;vg%hfdT$i?!Oou1dV!f7f zoR%kiD_9k6xy%{zMZ*h}wmRS3aob6n9M7t8AnJ&o>O`IT$(6c1FCFTdi0fjfErPHX zSsar@z=o&0jwh@Qj@on-XJ`o4BHNaJQ(cfGdu=DOq_rV@w&dJ}w&!=SybXy|>gI~H zMdV~F%{v==Wgs_-gZj8O&cHYW;|z>5FwVd@1LF+*A2Wb=WV{cr@|8&jVQz@H*CcnF z?h?OvRKL7>b@79X7f;;WtuNlbb!&0ZpEILRE?-^*!JQe`Av_^?B93mDKLa11-!;ZR zU8ipD?&=tL=N*oL`7~9h>&Rs6@DKU7aZ>%nil|blyoq|1%WxdbWzF*}FqG6k>O`|O zw)k7VlD;&jFk;dAv5o;J&`I-!?+!I7_$9!O9IoTL2>MZAm-xF>qr1dPePsGstm{cE zRzP2>hghq8i|6H0ZNoF$Oz+V0e~U#`Hq{>{hGQWn_S}+d`JS?%p}(ax`TfNbj_2~) WLGWE?Q?}OlU0n;-RyDS>{=Wby8|PX8 diff --git a/Unity/ProjectSettings/TagManager.asset b/Unity/ProjectSettings/TagManager.asset index f73f2400606d5c459772463f93fc8f4e3a1f5164..1c92a7840ec11895c76785f65d949a3d20d53355 100644 GIT binary patch literal 378 zcmc&wyAHxI4BYz_W`K!S1O`wxBm}C|E>K=V2wAO(BH9F!bSPg>8W#S5#XjFzmhXn= zWu5^`STrn_8yK_$a42}Ir0Zr?QtDw)|9@f}-rQeNVMR#m#7jR)v*(VxOZhZ<&DwH+^TkJ}--=)AG(UA#g opN97D(%g31IH^ST<4s{h{Kp}H5AxMgy5cbLANwS9`Jk$wKKn^k?f?J) literal 5676 zcmd6rX?xUE7=}+3#T`(K;#xt)wbG5nbtsFXpd#R|7}_ulv>D0Fpv8qj1yS68fxp!H zE(t!FdCugk=ep7?=bq=ibFTJnCLxSp4PoOmA%vSl82?-LVRmwEa{A;{_-A!>bxh9R zlx%i3(eqZ;4V~8cG^~-6>t)knz)gPK>E^Ah85WanVuh5`QHJP#u+R;~yv~ii7Q#@W z8)ZU=0Y#yOQ%UY+^y*rhuM&mIe6O|CZDkV&la(}|*k)Emh6S$g`^N^YWZk`>>^C%s z)h#liL+fv_qY$cAw-#5CpjK06bsOL@tJ{UKWsp6!x&uPE)jC2@t7)@Z4|vQ<3yrk8 z6GFJvU4)=kGiG%+;4!Q5I;)Kk!maKh1htwqt9t>DS#7Gbx(`CQ)%}E^R&!?c0N^pJ z2kWdJf)H-?Fd?YbcC(rQJZANXFe87jw72O{h+A#3`6@xJc9_+pfXA#JD+*fC2I&ls zLkPFpN{GVhSV!8FH>;hd^aQZl&$aAevwBjll?yf2AWBaOpreHJxZ13q)=M&w7*^V4 zO8S3Ehq5uHXN!5uYY?SL{jdxySXFw?feJCKH03>g8^AHADJVymX&OT8=H$HUG(!mD z2cNRExjZI z3F72!{B36qjyWBMFxm^=fe@{#qv~|TFV;DEA3q9k%;}ggYsW2m*PC^KGY7&Atc^^LoaLlPy=X4rExYHRz5GU{BO9025mg}4{ z2;oj`LJ%kKJWlBc^~fr9CPZ`Ih}(L?(_vAh?Dp6F9D7@t<*W4 zhY;@c6(NX|_wla*jyZi(=kzUvaHk7|72w)FxYLh>DBi#=A3xI0<#klkzTx@HxGR9itbPJ3Wrm(Kf5wpF7)$NT zy7|g~@8zx{E_rL@yjZp@S@su+zYH*Xvx84|zsj|dtMwa%@YVXA5WTF^YG&!;guZa> z$v5Hydrk2VV2i_0WwX}VURuz968c2Dy%d((3un?r6aNdDM!yWbc2jym7eb!~%O^s= KWu5syjDG=deEz`z diff --git a/Unity/ProjectSettings/TimeManager.asset b/Unity/ProjectSettings/TimeManager.asset index 0bb43e7fcf4c1057021897b1e86ea22562f1a03d..558a017e1f50b2db73414a1abad3c033922774f8 100644 GIT binary patch literal 202 zcmZ9Eu?~VT6h-%b#bdxp2nAibbwLLkO=NL0&+9Ra)v?PFk?M^s&qb>bD7wiS>3_F(q literal 4112 zcmeH@O$x$53`RfyKwWtR!F@r|ohZ5xH{wF~Wwg^WGE>D?bm?8()dP7O>!h_H;st~R zLMHGs2@fcBfL04Y!&X~>zB6!oeizR)O-r_~*<33l7a|maJYp&$`9=u`2%@OkJcW@8 zLg}?t7{j>B%}#FPx$@*piy+F70;gKMeZ3bkX6j-mX;&1>Lk5@WV;dP*&)+$`5Eo@m zrajSmfBqh;o66Wk%197cydCrK%6$|BwI&x{CAVKObh7EB z`}So!FY)Y&gnsCCR`G;f6;}l5E-IwJ!+`rtWjFm^7)D;V+jXylut%;#Z|&a4N=jh3 z1VkZsCh`c$Ugw)Pi#-Ys4=J@E>6LII=_Un!ELUJ~rZ}|gj%P$_^s z9uL{Ox7io(YvyCI`Fa1eG!1@>;5x^qNPzw@DgtsPk7)^>l>`|;_Qj!O9yueGgalkm z$pJJ@(a*j#f}_Kiqg;eqQXp5dg_Oa42Qc^386?N(=oF(|WGJG)yrVx%UWoY~&Tpfn z{s?(Mo>r^K801-CRUpsEJJTT^*{GN_| z2s&2Xxv`6GNn4(7H6?y;_u6)K*{dfdHmy1});tGBGDSHr8n07cC08Y)=3yK#4j2cF a1I7X4fN{V$U>qo?PudR#r+2^r From ea643d08b6a777f7e2015984aca740b6bf39e6b4 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 8 Oct 2017 17:44:39 -0700 Subject: [PATCH 21/95] Support arrays Update README --- README.md | 60 +- Unity/Assets/NativeScript/Bindings.cs | 1126 +++++++++- .../NativeScript/Editor/GenerateBindings.cs | 1956 ++++++++++++---- Unity/Assets/NativeScriptTypes.json | 100 + Unity/CppSource/Game/Game.cpp | 29 - Unity/CppSource/NativeScript/Bindings.cpp | 1967 ++++++++++++++++- Unity/CppSource/NativeScript/Bindings.h | 377 +++- 7 files changed, 5053 insertions(+), 562 deletions(-) diff --git a/README.md b/README.md index f716fde..ade0a69 100644 --- a/README.md +++ b/README.md @@ -2,31 +2,58 @@ A library to allow writing Unity scripts in native code: C, C++, assembly. +## Purpose + +This project aims to give you a viable alternative to C#. Scripting in C++ isn't right for all parts of every project, but now it's an option. + +## Goals + +* Make scripting in C++ as easy as C# +* Low performance overhead +* Easy integration with any Unity project +* Fast compile, build, and code generation times + # Reasons to Prefer C++ Over C# # -By using C++ directly, you gain complete control over the code the CPU will execute. It's much easier to generate optimal code with a C++ compiler than with a C# compiler, IL2CPP, and finally a C++ compiler. You can even code with compiler intrinsics or assembly to directly write machine code and take advantage of CPU features like [SIMD](http://jacksondunstan.com/articles/3890) and hardware AES encryption for massive performance gains. +## Fast Compile Times + +C++ compiles much more quickly than C#. Moderate size projects typically take 10+ seconds to compile in C# but only about 1 second to compile in C++. Faster compilation adds up over time to productivity gains. Quicker iteration times make it easier to stay in the "flow" of programming. + +## Fast Device Build Times + +Changing one line of C# code requires you to make a new build of the game. Typical iOS build times tend to be at least 10 minutes because IL2CPP has to run and then Xcode has to compile a huge amount of C++. + +By using C++, we can compile the game as a C++ plugin in about 1 second, swap the plugin into the Xcode project, and then immediately run the game. That's a huge productivity boost! + +## No Garbage Collector + +Unity's garbage collector is mandatory and has a lot of problems. It's slow, runs on the main thread, collects all garbage at once, fragments the heap, and never shrinks the heap. So your game will experience "frame hitches" and eventually you'll run out of memory and crash. -C++ is also a much larger language than C# and some developers will prefer having more tools at their disposal. Here are a few differences: +A significant amount of effort is required to work around the GC and the resulting code is difficult to maintain and slow. This includes techniques like [object pools](http://jacksondunstan.com/articles/3829), which essentially make memory management manual. You've also got to avoid boxing value types like `int` to to managed types like `object`, not use `foreach` loops in some situations, and various other [gotchas](http://jacksondunstan.com/articles/3850). + +C++ has no required garbage collector and features optional automatic memory management via "smart pointer" types like [shared_ptr](http://en.cppreference.com/w/cpp/memory/shared_ptr). It offers excellent alternatives to Unity's primitive garbage collector. + +## Total Control + +By using C++ directly, you gain complete control over the code the CPU will execute. It's much easier to generate optimal code with a C++ compiler than with a C# compiler, IL2CPP, and finally a C++ compiler. Cut out the middle-man and you can take advantage of compiler intrinsics or assembly to directly write machine code using powerful CPU features like [SIMD](http://jacksondunstan.com/articles/3890) and hardware AES encryption for massive performance gains. + +## More Features + +C++ is a much larger language than C# and some developers will prefer having more tools at their disposal. Here are a few differences: * Its template system is much more powerful than C# generics * There are macros for extreme flexibility by generating code -* Function pointers instead of just delegates +* Cheap function pointers instead of heavyweight delegates * No-overhead [algorithms](http://en.cppreference.com/w/cpp/algorithm) instead of LINQ * Bit fields for easy memory savings -* Pointers and never-null references instead of just managed referneces +* Pointers and never-null references instead of just managed references * Much more. C++ is huge. -There are also some problems with C# code running under Unity that you'll automatically avoid. For one, Unity's garbage collector is very slow. It runs on the main thread, which blocks rendering and input handling. It collects all objects at once, which causes frame hitches. And it fragments memory, so eventually you may run out and crash. - -A significant amount of effort is required to work around the GC and the resulting code is difficult to maintain and slow. This includes techniques like [object pools](http://jacksondunstan.com/articles/3829), which essentially make memory management manual. You've also got to avoid boxing value types to managed types, `foreach` loops in some situations, and various other [gotchas](http://jacksondunstan.com/articles/3850). - -C++ has no required garbage collector and features optional automatic memory management via "smart pointer" types like [shared_ptr](http://en.cppreference.com/w/cpp/memory/shared_ptr). It offers an excellent alternative to Unity's primitive garbage collector. +## No IL2CPP Surprises While IL2CPP transforms C# into C++ already, it generates a lot of overhead. There are many [surprises](http://jacksondunstan.com/articles/3916) if you read through the generated C++. For example, there's overhead for any function using a static variable and an extra two pointers are stored at the beginning of every class. The same goes for all sorts of features such as `sizeof()`, mandatory null checks, and so forth. Instead, you could write C++ directly and not need to work around IL2CPP. -This project aims to give you a viable alternative to C#. Scripting in C++ isn't right for all parts of every project, but now it's an option. - -# Features +# UnityNativeScripting Features * Supports Windows, macOS, iOS, and Android (editor and standalone) * Plays nice with other C# scripts- no need to use 100% C++ @@ -55,7 +82,7 @@ This project aims to give you a viable alternative to C#. Scripting in C++ isn't [Article](http://jacksondunstan.com/articles/3952). -tl;dr - Most projects will not be noticeably impacted by C++ overhead and many projects will benefit from reducing garbage collection and IL2CPP overhead. +tl;dr - Most projects will not be noticeably impacted by C++ overhead and many projects will benefit from reducing garbage collection, eliminating IL2CPP overhead, and access to compiler intrinsics and assembly. # Project Structure @@ -77,14 +104,12 @@ With C++, the workflow looks like this: 3. Switch to the Unity editor window. Nothing to compile. 4. Run the game -One of the project's goals is to make it just as easy to work with C++ as it is to work with C#, if not easier. - # Getting Started 1. Download or clone this repo 2. Copy everything in `Unity/Assets` directory to your Unity project's `Assets` directory 3. Copy the `Unity/CppSource` directory to your Unity project directory -4. Edit `NativeScriptTypes.json` and specify what parts of the Unity API you want access to from C++. Some examples are provided, but feel free to delete them if you're not using those features. +4. Edit `NativeScriptTypes.json` and specify what parts of the Unity, .NET, and custom DLL APIs you want access to from C++. 5. Edit `Unity/CppSource/Game/Game.cpp` to create your game. Some example code is provided, but feel free to delete it. You can add more C++ source (`.cpp`) and header (`.h`) files here as your game grows. # Building the C++ Plugin @@ -159,12 +184,13 @@ The code generator supports: * Enumerations * Exceptions * Overloaded operators +* Arrays (single- and multi-dimensional) The code generator does not support (yet): -* Arrays (single- or multi-dimensional) * Delegates * `MonoBehaviour` contents (e.g. fields) except for "message" functions +* `Array` methods (e.g. `IndexOf`) * Default parameters * Interfaces * `decimal` diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 9aa6d0c..70ca699 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -270,6 +270,8 @@ delegate void InitDelegate( IntPtr releaseObject, IntPtr stringNew, IntPtr setException, + IntPtr arrayGetLength, + IntPtr arrayGetRank, /*BEGIN INIT PARAMS*/ IntPtr systemDiagnosticsStopwatchConstructor, IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds, @@ -321,7 +323,46 @@ delegate void InitDelegate( IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString, IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue, IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue, - IntPtr systemExceptionConstructorSystemString + 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 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 /*END INIT PARAMS*/); public delegate void SetCsharpExceptionDelegate(int handle); @@ -438,6 +479,8 @@ static extern void Init( IntPtr releaseObject, IntPtr stringNew, IntPtr setException, + IntPtr arrayGetLength, + IntPtr arrayGetRank, /*BEGIN INIT PARAMS*/ IntPtr systemDiagnosticsStopwatchConstructor, IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds, @@ -489,7 +532,46 @@ static extern void Init( IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString, IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue, IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue, - IntPtr systemExceptionConstructorSystemString + 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 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 /*END INIT PARAMS*/); [DllImport(PluginName)] @@ -516,6 +598,8 @@ IntPtr systemExceptionConstructorSystemString 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(); @@ -567,6 +651,45 @@ IntPtr systemExceptionConstructorSystemString 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 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); /*END DELEGATE TYPES*/ public static Exception UnhandledCppException; @@ -616,6 +739,8 @@ public static void Open( 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)), @@ -667,7 +792,46 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate(SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString)), Marshal.GetFunctionPointerForDelegate(new SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)), Marshal.GetFunctionPointerForDelegate(new SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)), - Marshal.GetFunctionPointerForDelegate(new SystemExceptionConstructorSystemStringDelegate(SystemExceptionConstructorSystemString)) + 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 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)) /*END INIT CALL*/ ); if (UnhandledCppException != null) @@ -717,6 +881,18 @@ static void SetException(int handle) UnhandledCppException = ObjectStore.Get(handle) as Exception; } + [MonoPInvokeCallback(typeof(ArrayGetLengthDelegate))] + static int ArrayGetLength(int handle) + { + return ((Array)ObjectStore.Get(handle)).Length; + } + + [MonoPInvokeCallback(typeof(ArrayGetRankDelegate))] + static int ArrayGetRank(int handle) + { + return ((Array)ObjectStore.Get(handle)).Rank; + } + /*BEGIN FUNCTIONS*/ [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchConstructorDelegate))] static int SystemDiagnosticsStopwatchConstructor() @@ -728,11 +904,13 @@ static int SystemDiagnosticsStopwatchConstructor() } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -749,11 +927,13 @@ static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHan } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(long); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(long); } @@ -769,10 +949,12 @@ static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -787,10 +969,12 @@ static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -806,11 +990,13 @@ static int UnityEngineObjectPropertyGetName(int thisHandle) } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -827,10 +1013,12 @@ static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -847,11 +1035,13 @@ static bool UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObjec } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(bool); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(bool); } @@ -868,11 +1058,13 @@ static bool UnityEngineObjectMethodop_ImplicitUnityEngineObject(int existsHandle } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(bool); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(bool); } @@ -888,11 +1080,13 @@ static int UnityEngineGameObjectConstructor() } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -909,11 +1103,13 @@ static int UnityEngineGameObjectConstructorSystemString(int nameHandle) } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -930,11 +1126,13 @@ static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -951,11 +1149,13 @@ static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -972,11 +1172,13 @@ static int UnityEngineComponentPropertyGetTransform(int thisHandle) } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -993,11 +1195,13 @@ static UnityEngine.Vector3 UnityEngineTransformPropertyGetPosition(int thisHandl } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(UnityEngine.Vector3); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(UnityEngine.Vector3); } @@ -1013,10 +1217,12 @@ static void UnityEngineTransformPropertySetPosition(int thisHandle, ref UnityEng } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1031,10 +1237,12 @@ static void UnityEngineDebugMethodLogSystemObject(int messageHandle) } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1049,11 +1257,13 @@ static bool UnityEngineAssertionsAssertFieldGetRaiseExceptions() } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(bool); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(bool); } @@ -1068,10 +1278,12 @@ static void UnityEngineAssertionsAssertFieldSetRaiseExceptions(bool value) } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1087,10 +1299,12 @@ static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_Sy } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1106,10 +1320,12 @@ static void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityE } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1123,10 +1339,12 @@ static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt3 } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1143,10 +1361,12 @@ static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInf } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1160,10 +1380,12 @@ static void UnityEngineNetworkingNetworkTransportMethodInit() } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1178,11 +1400,13 @@ static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingl } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(UnityEngine.Vector3); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(UnityEngine.Vector3); } @@ -1198,11 +1422,13 @@ static float UnityEngineVector3PropertyGetMagnitude(ref UnityEngine.Vector3 thiz } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(float); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(float); } @@ -1217,10 +1443,12 @@ static void UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(re } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1235,11 +1463,13 @@ static UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3 } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(UnityEngine.Vector3); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(UnityEngine.Vector3); } @@ -1255,11 +1485,13 @@ static UnityEngine.Vector3 UnityEngineVector3Methodop_UnaryNegationUnityEngineVe } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(UnityEngine.Vector3); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(UnityEngine.Vector3); } @@ -1275,11 +1507,13 @@ static float UnityEngineMatrix4x4PropertyGetItem(ref UnityEngine.Matrix4x4 thiz, } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(float); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(float); } @@ -1294,10 +1528,12 @@ static void UnityEngineMatrix4x4PropertySetItem(ref UnityEngine.Matrix4x4 thiz, } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1314,10 +1550,12 @@ static void ReleaseUnityEngineRaycastHit(int handle) } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1333,11 +1571,13 @@ static UnityEngine.Vector3 UnityEngineRaycastHitPropertyGetPoint(int thisHandle) } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(UnityEngine.Vector3); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(UnityEngine.Vector3); } @@ -1354,10 +1594,12 @@ static void UnityEngineRaycastHitPropertySetPoint(int thisHandle, ref UnityEngin } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1373,11 +1615,13 @@ static int UnityEngineRaycastHitPropertyGetTransform(int thisHandle) } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -1395,10 +1639,12 @@ static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1414,11 +1660,13 @@ static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstruc } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -1435,11 +1683,13 @@ static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleProperty } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -1456,11 +1706,13 @@ static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePrope } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(double); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(double); } @@ -1476,11 +1728,13 @@ static int SystemCollectionsGenericListSystemStringConstructor() } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -1497,11 +1751,13 @@ static int SystemCollectionsGenericListSystemStringPropertyGetItem(int thisHandl } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -1518,10 +1774,12 @@ static void SystemCollectionsGenericListSystemStringPropertySetItem(int thisHand } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1537,10 +1795,12 @@ static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int th } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1556,11 +1816,13 @@ static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemSt } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -1577,11 +1839,13 @@ static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(in } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -1598,10 +1862,12 @@ static void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(i } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1617,11 +1883,13 @@ static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemSt } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -1638,11 +1906,13 @@ static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int t } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } @@ -1659,10 +1929,12 @@ static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -1678,15 +1950,863 @@ static int SystemExceptionConstructorSystemString(int messageHandle) } catch (System.NullReferenceException ex) { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetWidthDelegate))] + static int UnityEngineResolutionPropertyGetWidth(ref UnityEngine.Resolution thiz) + { + try + { + var returnValue = thiz.width; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetWidthDelegate))] + static void UnityEngineResolutionPropertySetWidth(ref UnityEngine.Resolution thiz, int value) + { + try + { + thiz.width = value; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetHeightDelegate))] + static int UnityEngineResolutionPropertyGetHeight(ref UnityEngine.Resolution thiz) + { + try + { + var returnValue = thiz.height; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetHeightDelegate))] + static void UnityEngineResolutionPropertySetHeight(ref UnityEngine.Resolution thiz, int value) + { + try + { + thiz.height = value; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetRefreshRateDelegate))] + static int UnityEngineResolutionPropertyGetRefreshRate(ref UnityEngine.Resolution thiz) + { + try + { + var returnValue = thiz.refreshRate; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetRefreshRateDelegate))] + static void UnityEngineResolutionPropertySetRefreshRate(ref UnityEngine.Resolution thiz, int value) + { + try + { + thiz.refreshRate = value; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineScreenPropertyGetResolutionsDelegate))] + static int UnityEngineScreenPropertyGetResolutions() + { + try + { + var returnValue = UnityEngine.Screen.resolutions; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate))] + static UnityEngine.Ray UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction) + { + try + { + var returnValue = new UnityEngine.Ray(origin, direction); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Ray); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Ray); + } + } + + [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitDelegate))] + static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit(ref UnityEngine.Ray ray, int resultsHandle) + { + try + { + var results = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(resultsHandle); + var returnValue = UnityEngine.Physics.RaycastNonAlloc(ray, results); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate))] + static int UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ref UnityEngine.Ray ray) + { + try + { + var returnValue = UnityEngine.Physics.RaycastAll(ray); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGradientConstructorDelegate))] + static int UnityEngineGradientConstructor() + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.Gradient()); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGradientPropertyGetColorKeysDelegate))] + static int UnityEngineGradientPropertyGetColorKeys(int thisHandle) + { + try + { + var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.colorKeys; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGradientPropertySetColorKeysDelegate))] + static void UnityEngineGradientPropertySetColorKeys(int thisHandle, int valueHandle) + { + try + { + var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.colorKeys = value; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemInt32Array1Constructor1Delegate))] + static int SystemInt32Array1Constructor1(int length0) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new int[length0]); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemInt32Array1GetItem1Delegate))] + static int SystemInt32Array1GetItem1(int thisHandle, int index0) + { + try + { + var thiz = (System.Int32[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index0]; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } catch (System.Exception ex) { + UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } } + + [MonoPInvokeCallback(typeof(SystemInt32Array1SetItem1Delegate))] + static void SystemInt32Array1SetItem1(int thisHandle, int index0, int item) + { + try + { + var thiz = (System.Int32[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz[index0] = item; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemSingleArray1Constructor1Delegate))] + static int SystemSingleArray1Constructor1(int length0) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new float[length0]); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemSingleArray1GetItem1Delegate))] + static float SystemSingleArray1GetItem1(int thisHandle, int index0) + { + try + { + var thiz = (System.Single[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index0]; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + } + + [MonoPInvokeCallback(typeof(SystemSingleArray1SetItem1Delegate))] + static void SystemSingleArray1SetItem1(int thisHandle, int index0, float item) + { + try + { + var thiz = (System.Single[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz[index0] = item; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemSingleArray2Constructor2Delegate))] + static int SystemSingleArray2Constructor2(int length0, int length1) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new float[length0, length1]); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemSingleArray2GetLength2Delegate))] + static int SystemSingleArray2GetLength2(int thisHandle, int dimension) + { + try + { + var thiz = (System.Single[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetLength(dimension); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemSingleArray2GetItem2Delegate))] + static float SystemSingleArray2GetItem2(int thisHandle, int index0, int index1) + { + try + { + var thiz = (System.Single[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index0, index1]; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + } + + [MonoPInvokeCallback(typeof(SystemSingleArray2SetItem2Delegate))] + static void SystemSingleArray2SetItem2(int thisHandle, int index0, int index1, float item) + { + try + { + var thiz = (System.Single[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz[index0, index1] = item; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemSingleArray3Constructor3Delegate))] + static int SystemSingleArray3Constructor3(int length0, int length1, int length2) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new float[length0, length1, length2]); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemSingleArray3GetLength3Delegate))] + static int SystemSingleArray3GetLength3(int thisHandle, int dimension) + { + try + { + var thiz = (System.Single[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetLength(dimension); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemSingleArray3GetItem3Delegate))] + static float SystemSingleArray3GetItem3(int thisHandle, int index0, int index1, int index2) + { + try + { + var thiz = (System.Single[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index0, index1, index2]; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + } + + [MonoPInvokeCallback(typeof(SystemSingleArray3SetItem3Delegate))] + static void SystemSingleArray3SetItem3(int thisHandle, int index0, int index1, int index2, float item) + { + try + { + var thiz = (System.Single[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz[index0, index1, index2] = item; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemStringArray1Constructor1Delegate))] + static int SystemStringArray1Constructor1(int length0) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new string[length0]); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemStringArray1GetItem1Delegate))] + static int SystemStringArray1GetItem1(int thisHandle, int index0) + { + try + { + var thiz = (System.String[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index0]; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemStringArray1SetItem1Delegate))] + static void SystemStringArray1SetItem1(int thisHandle, int index0, int itemHandle) + { + try + { + var thiz = (System.String[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); + thiz[index0] = item; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineResolutionArray1Constructor1Delegate))] + static int UnityEngineResolutionArray1Constructor1(int length0) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.Resolution[length0]); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineResolutionArray1GetItem1Delegate))] + static UnityEngine.Resolution UnityEngineResolutionArray1GetItem1(int thisHandle, int index0) + { + try + { + var thiz = (UnityEngine.Resolution[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index0]; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Resolution); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Resolution); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineResolutionArray1SetItem1Delegate))] + static void UnityEngineResolutionArray1SetItem1(int thisHandle, int index0, ref UnityEngine.Resolution item) + { + try + { + var thiz = (UnityEngine.Resolution[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz[index0] = item; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineRaycastHitArray1Constructor1Delegate))] + static int UnityEngineRaycastHitArray1Constructor1(int length0) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.RaycastHit[length0]); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineRaycastHitArray1GetItem1Delegate))] + static int UnityEngineRaycastHitArray1GetItem1(int thisHandle, int index0) + { + try + { + var thiz = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index0]; + return NativeScript.Bindings.StructStore.Store(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineRaycastHitArray1SetItem1Delegate))] + static void UnityEngineRaycastHitArray1SetItem1(int thisHandle, int index0, int itemHandle) + { + try + { + var thiz = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var item = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(itemHandle); + thiz[index0] = item; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGradientColorKeyArray1Constructor1Delegate))] + static int UnityEngineGradientColorKeyArray1Constructor1(int length0) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GradientColorKey[length0]); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGradientColorKeyArray1GetItem1Delegate))] + static UnityEngine.GradientColorKey UnityEngineGradientColorKeyArray1GetItem1(int thisHandle, int index0) + { + try + { + var thiz = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index0]; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.GradientColorKey); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.GradientColorKey); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGradientColorKeyArray1SetItem1Delegate))] + static void UnityEngineGradientColorKeyArray1SetItem1(int thisHandle, int index0, ref UnityEngine.GradientColorKey item) + { + try + { + var thiz = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz[index0] = item; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } /*END FUNCTIONS*/ } } diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 0b1cc4a..28f163a 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -93,12 +93,20 @@ class JsonMonoBehaviour public string[] Messages; } + [Serializable] + class JsonArray + { + public string Type; + public int[] Ranks; + } + [Serializable] class JsonDocument { public string[] Assemblies; public JsonType[] Types; public JsonMonoBehaviour[] MonoBehaviours; + public JsonArray[] Arrays; } const int InitialStringBuilderCapacity = 1024 * 10; @@ -500,6 +508,18 @@ static void DoPostCompileWork(bool canRefreshAssetDb) } } + // Generate arrays + if (doc.Arrays != null) + { + foreach (JsonArray array in doc.Arrays) + { + AppendArray( + array, + assemblies, + builders); + } + } + // Generate exception setters AppendExceptions( doc, @@ -814,7 +834,9 @@ static void AppendParameterTypeNames( { Type type = parameters[i].DereferencedParameterType; AppendNamespace(type.Namespace, string.Empty, output); - output.Append(type.Name); + AppendTypeNameWithoutSuffixes( + type.Name, + output); if (i != len - 1) { output.Append('_'); @@ -835,7 +857,9 @@ static void AppendTypeNames( curType.Namespace, string.Empty, output); - output.Append(curType.Name); + AppendTypeNameWithoutSuffixes( + curType.Name, + output); if (i != len - 1) { output.Append('_'); @@ -972,18 +996,65 @@ static bool IsFullValueType(Type type) return true; } - static void AppendWithoutGenericTypeCountSuffix( + static void AppendTypeNameWithoutGenericSuffix( string typeName, StringBuilder output) { - // Names are like "List`1" or "Dictionary`2" - // Remove the backtick (`) and everything after it + // Names are like "List`1" + // Remove the ` and everything after it int backtickIndex = typeName.IndexOf('`'); if (backtickIndex < 0) { output.Append(typeName); } else + { + // Append up to (but not including) the ` + output.Append( + typeName, + 0, + backtickIndex); + + // Find the first non-number after the ` + int endIndex = backtickIndex + 1; + while ( + endIndex < typeName.Length + && char.IsNumber(typeName[endIndex])) + { + endIndex++; + } + + // Append everything after the numbers + if (endIndex < typeName.Length) + { + output.Append( + typeName, + endIndex, + typeName.Length - endIndex); + } + } + } + + static void AppendTypeNameWithoutSuffixes( + string typeName, + StringBuilder output) + { + // Names are like "List`1" or "int[]" or "List`1[]" + // Remove the first of ` or [ and everything after it + int backtickIndex = typeName.IndexOf('`'); + if (backtickIndex < 0) + { + int bracketIndex = typeName.IndexOf('['); + if (bracketIndex < 0) + { + output.Append(typeName); + } + else + { + output.Append(typeName, 0, bracketIndex); + } + } + else { output.Append(typeName, 0, backtickIndex); } @@ -1020,7 +1091,7 @@ static void AppendType( genericArgTypes.Length, builders.CppTypeDeclarations); builders.CppTypeDeclarations.Append("struct "); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( type.Name, builders.CppTypeDeclarations); builders.CppTypeDeclarations.Append(";"); @@ -1068,9 +1139,8 @@ static void AppendType( Assembly[] assemblies, StringBuilders builders) { - // Build type name starting with a lowercase letter builders.TempStrBuilder.Length = 0; - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( type.Name, builders.TempStrBuilder); builders.TempStrBuilder[0] = char.ToLower( @@ -1105,7 +1175,8 @@ static void AppendType( // Build function name suffix builders.TempStrBuilder.Length = 0; AppendReleaseFunctionNameSuffix( - type, + type.Name, + type.Namespace, typeParams, builders.TempStrBuilder); string funcNameSuffix = builders.TempStrBuilder.ToString(); @@ -1114,7 +1185,8 @@ static void AppendType( builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("Release"); AppendReleaseFunctionNameSuffix( - type, + type.Name, + type.Namespace, typeParams, builders.TempStrBuilder); string funcName = builders.TempStrBuilder.ToString(); @@ -1184,6 +1256,7 @@ static void AppendType( funcName, true, null, + null, TypeKind.None, parameters, typeof(void), @@ -1194,6 +1267,7 @@ static void AppendType( funcNameLower, true, null, + null, TypeKind.None, parameters, typeof(void), @@ -1303,19 +1377,26 @@ static void AppendType( // C++ type definition (beginning) AppendCppTypeDefinitionBegin( - type, + type.Name, + type.Namespace, + typeKind, typeParams, - type.BaseType, + type.BaseType.Name, + type.BaseType.Namespace, + type.BaseType.GetGenericArguments(), isStatic, indent, builders.CppTypeDefinitions); // C++ method definition int cppMethodDefinitionsIndent = AppendCppMethodDefinitionBegin( - type, + type.Name, + type.Namespace, typeKind, typeParams, - type.BaseType, + type.BaseType.Name, + type.BaseType.Namespace, + type.BaseType.GetGenericArguments(), isStatic, indent, builders.CppMethodDefinitions); @@ -1333,7 +1414,8 @@ static void AppendType( foreach (JsonConstructor jsonCtor in jsonType.Constructors) { AppendConstructor( - jsonCtor, + jsonCtor.ParamTypes, + jsonCtor.Exceptions, type, isStatic, typeKind, @@ -1426,16 +1508,17 @@ static void AppendType( } static void AppendReleaseFunctionNameSuffix( - Type type, + string typeName, + string typeNamespace, Type[] typeParams, StringBuilder output) { AppendNamespace( - type.Namespace, + typeNamespace, string.Empty, output); - AppendWithoutGenericTypeCountSuffix( - type.Name, + AppendTypeNameWithoutSuffixes( + typeName, output); if (typeParams != null) { @@ -1446,7 +1529,7 @@ static void AppendReleaseFunctionNameSuffix( typeParam.Namespace, string.Empty, output); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutSuffixes( typeParam.Name, output); if (i != len - 1) @@ -1527,7 +1610,8 @@ static void AppendHandleStoreTypeName( } static void AppendConstructor( - JsonConstructor jsonCtor, + string[] paramTypeNames, + string[] exceptionNames, Type enclosingType, bool enclosingTypeIsStatic, TypeKind enclosingTypeKind, @@ -1543,7 +1627,7 @@ static void AppendConstructor( if (enclosingType.IsValueType && !enclosingType.IsPrimitive && !enclosingType.IsEnum - && jsonCtor.ParamTypes.Length == 0) + && paramTypeNames.Length == 0) { // Allow parameterless constructor for structs parameters = new ParameterInfo[0]; @@ -1554,13 +1638,13 @@ static void AppendConstructor( if (enclosingType.IsGenericType) { constructorParamTypeNames = OverrideGenericTypeNames( - jsonCtor.ParamTypes, + paramTypeNames, genericArgTypes, enclosingTypeParams); } else { - constructorParamTypeNames = jsonCtor.ParamTypes; + constructorParamTypeNames = paramTypeNames; } parameters = GetConstructorParameters( enclosingType, @@ -1568,7 +1652,7 @@ static void AppendConstructor( } Type[] exceptionTypes = GetTypes( - jsonCtor.Exceptions, + exceptionNames, assemblies); // Build uppercase function name @@ -1577,7 +1661,7 @@ static void AppendConstructor( enclosingType.Namespace, string.Empty, builders.TempStrBuilder); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( enclosingType.Name, builders.TempStrBuilder); AppendTypeNames( @@ -1645,7 +1729,9 @@ static void AppendConstructor( AppendCsharpFunctionReturn( parameters, enclosingType, + enclosingTypeKind, exceptionTypes, + true, builders.CsharpFunctions); } else @@ -1675,7 +1761,9 @@ static void AppendConstructor( AppendCsharpFunctionReturn( parameters, typeof(int), + TypeKind.Primitive, exceptionTypes, + true, builders.CsharpFunctions); } @@ -1683,7 +1771,8 @@ static void AppendConstructor( AppendCppFunctionPointerDefinition( funcName, true, - enclosingType, + enclosingType.Name, + enclosingType.Namespace, enclosingTypeKind, parameters, enclosingType, @@ -1704,7 +1793,7 @@ static void AppendConstructor( // C++ method definition AppendCppMethodDefinition( - enclosingType, + enclosingType.Name, null, enclosingType.Name, enclosingTypeParams, @@ -1721,7 +1810,7 @@ static void AppendConstructor( AppendCppTypeName( enclosingType.BaseType, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("(0)\n"); + builders.CppMethodDefinitions.Append("(nullptr)\n"); } AppendIndent( indent, @@ -1729,7 +1818,8 @@ static void AppendConstructor( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( true, - enclosingType, + enclosingType.Name, + enclosingType.Namespace, enclosingTypeKind, enclosingTypeParams, enclosingType, @@ -1766,7 +1856,8 @@ static void AppendConstructor( indent + 2, builders.CppMethodDefinitions); AppendReferenceManagedHandleFunctionCall( - enclosingType, + enclosingType.Name, + enclosingType.Namespace, enclosingTypeKind, enclosingTypeParams, "returnValue", @@ -1791,7 +1882,8 @@ static void AppendConstructor( AppendCppInitParam( funcNameLower, true, - enclosingType, + enclosingType.Name, + enclosingType.Namespace, enclosingTypeKind, parameters, enclosingType, @@ -1856,6 +1948,8 @@ static void AppendProperty( if (getMethod != null) { + Type propertyType = property.PropertyType; + TypeKind propertyTypeKind = GetTypeKind(propertyType); Type[] exceptionTypes = GetTypes( jsonPropertyGet.Exceptions, assemblies); @@ -1875,7 +1969,8 @@ static void AppendProperty( jsonPropertyGet.IsReadOnly, enclosingType, typeParams, - property.PropertyType, + propertyType, + propertyTypeKind, indent, exceptionTypes, builders); @@ -1959,7 +2054,7 @@ static void AppendFullValueTypeDefaultConstructor( AppendIndent( indent + 1, builders.CppTypeDefinitions); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( enclosingType.Name, builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append("();\n"); @@ -1967,11 +2062,11 @@ static void AppendFullValueTypeDefaultConstructor( AppendIndent( indent, builders.CppMethodDefinitions); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( enclosingType.Name, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("::"); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( enclosingType.Name, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("()\n"); @@ -2029,6 +2124,7 @@ StringBuilders builders field.FieldType, typeGenericArgumentTypes, typeTypeParams); + TypeKind fieldTypeKind = GetTypeKind(fieldType); Type[] exceptionTypes = new Type[0]; AppendGetter( field.Name, @@ -2041,6 +2137,7 @@ StringBuilders builders enclosingType, typeTypeParams, fieldType, + fieldTypeKind, indent, exceptionTypes, builders); @@ -2204,6 +2301,8 @@ static void AppendMethod( method = method.MakeGenericMethod(methodTypeParams); ParameterInfo[] parameters = ConvertParameters( method.GetParameters()); + Type returnType = method.ReturnType; + TypeKind returnTypeKind = GetTypeKind(returnType); AppendMethod( enclosingType, assemblies, @@ -2213,7 +2312,8 @@ static void AppendMethod( enclosingTypeKind, method.IsStatic, jsonMethod.IsReadOnly, - method.ReturnType, + returnType, + returnTypeKind, typeTypeParams, methodTypeParams, parameters, @@ -2226,6 +2326,8 @@ static void AppendMethod( { ParameterInfo[] parameters = ConvertParameters( method.GetParameters()); + Type returnType = method.ReturnType; + TypeKind returnTypeKind = GetTypeKind(returnType); AppendMethod( enclosingType, assemblies, @@ -2235,7 +2337,8 @@ static void AppendMethod( enclosingTypeKind, method.IsStatic, jsonMethod.IsReadOnly, - method.ReturnType, + returnType, + returnTypeKind, typeTypeParams, null, parameters, @@ -2313,6 +2416,7 @@ static void AppendMethod( bool methodIsStatic, bool isReadOnly, Type returnType, + TypeKind returnTypeKind, Type[] enclosingTypeParams, Type[] methodTypeParams, ParameterInfo[] parameters, @@ -2326,7 +2430,7 @@ static void AppendMethod( enclosingType.Namespace, string.Empty, builders.TempStrBuilder); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( enclosingType.Name, builders.TempStrBuilder); AppendTypeNames( @@ -2406,7 +2510,7 @@ static void AppendMethod( case "op_Explicit": builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append('('); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( returnType.Name, builders.TempStrBuilder); builders.TempStrBuilder.Append(')'); @@ -2518,14 +2622,17 @@ static void AppendMethod( AppendCsharpFunctionReturn( parameters, returnType, + returnTypeKind, exceptionTypes, + false, builders.CsharpFunctions); // C++ function pointer AppendCppFunctionPointerDefinition( funcName, methodIsStatic, - enclosingType, + enclosingType.Name, + enclosingType.Namespace, enclosingTypeKind, parameters, returnType, @@ -2703,7 +2810,7 @@ static void AppendMethod( // C++ method definition AppendCppMethodDefinition( - enclosingType, + enclosingType.Name, cppReturnType, cppMethodName, enclosingTypeParams, @@ -2717,7 +2824,8 @@ static void AppendMethod( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( methodIsStatic, - enclosingType, + enclosingType.Name, + enclosingType.Namespace, enclosingTypeKind, enclosingTypeParams, returnType, @@ -2727,6 +2835,7 @@ static void AppendMethod( builders.CppMethodDefinitions); AppendCppMethodReturn( returnType, + returnTypeKind, indent + 1, builders.CppMethodDefinitions); AppendIndent( @@ -2738,7 +2847,8 @@ static void AppendMethod( AppendCppInitParam( funcNameLower, methodIsStatic, - enclosingType, + enclosingType.Name, + enclosingType.Namespace, enclosingTypeKind, parameters, returnType, @@ -2811,20 +2921,26 @@ static void AppendMonoBehaviour( // C++ Type Definition (begin) AppendCppTypeDefinitionBegin( - type, + type.Name, + type.Namespace, + TypeKind.Class, + null, + "MonoBehaviour", + "UnityEngine", null, - typeof(MonoBehaviour), false, cppIndent, - builders.CppTypeDefinitions - ); + builders.CppTypeDefinitions); // C++ method definition int cppMethodDefinitionsIndent = AppendCppMethodDefinitionBegin( - type, + type.Name, + type.Namespace, TypeKind.Class, null, - typeof(MonoBehaviour), + "MonoBehaviour", + "UnityEngine", + null, false, cppIndent, builders.CppMethodDefinitions); @@ -3128,127 +3244,1027 @@ static void AppendMonoBehaviour( builders.CppTypeDefinitions); } - static void AppendCsharpDelegate( - bool isStatic, - string typeName, - string funcName, - ParameterInfo[] parameters, - StringBuilder output) + static void AppendArray( + JsonArray jsonArray, + Assembly[] assemblies, + StringBuilders builders) { - output.Append("\t\tpublic delegate void "); - output.Append(typeName); - output.Append(funcName); - output.Append("Delegate("); - if (!isStatic) - { - output.Append("int thisHandle"); - if (parameters.Length > 0) - { - output.Append(", "); - } - } - for (int i = 0; i < parameters.Length; ++i) + // Get element type + Type elementType = GetType( + jsonArray.Type, + assemblies); + TypeKind elementTypeKind = GetTypeKind(elementType); + + // Default ranks to just 1 + int[] ranks; + if (jsonArray.Ranks == null + || jsonArray.Ranks.Length == 0) { - ParameterInfo param = parameters[i]; - if (param.Kind == TypeKind.FullStruct) - { - AppendCsharpTypeName( - param.ParameterType, - output); - output.Append(" param"); - output.Append(i); - } - else - { - output.Append("int param"); - output.Append(i); - } - if (i != parameters.Length-1) - { - output.Append(", "); - } + ranks = new int[]{ 1 }; } - output.Append(");\n"); - output.Append("\t\tpublic static "); - output.Append(typeName); - output.Append(funcName); - output.Append("Delegate "); - output.Append(typeName); - output.Append(funcName); - output.Append(";\n\t\t\n"); - } - - static void AppendCsharpGetDelegateCall( - string typeName, - string funcName, - StringBuilder output) - { - output.Append("\t\t\t"); - output.Append(typeName); - output.Append(funcName); - output.Append(" = GetDelegate<"); - output.Append(typeName); - output.Append(funcName); - output.Append("Delegate>(libraryHandle, \""); - output.Append(typeName); - output.Append(funcName); - output.Append("\");\n"); - } - - static void AppendCsharpImport( - string typeName, - string funcName, - ParameterInfo[] parameters, - StringBuilder output - ) - { - output.Append("\t\t[DllImport(Constants.PluginName)]\n"); - output.Append("\t\tpublic static extern void "); - output.Append(typeName); - output.Append(funcName); - output.Append("(int thisHandle"); - if (parameters.Length > 0) + else { - output.Append(", "); + ranks = jsonArray.Ranks; } - for (int i = 0; i < parameters.Length; ++i) + + foreach (int rank in ranks) { - ParameterInfo param = parameters[i]; - if (param.Kind == TypeKind.FullStruct) + // Build array name + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("Array"); + builders.TempStrBuilder.Append(rank); + string cppArrayTypeName = builders.TempStrBuilder.ToString(); + + // Build "TypeArray" name + builders.TempStrBuilder.Length = 0; + AppendTypeNameWithoutGenericSuffix( + elementType.Name, + builders.TempStrBuilder); + builders.TempStrBuilder.Append(cppArrayTypeName); + string bindingArrayTypeName = builders.TempStrBuilder.ToString(); + + // MakeArrayType() creates a Type for a "vector" + // MakeArrayType(int) creates a Type for a multi-dimensional array + // Use MakeArrayType() instead of MakeArrayType(1) to create a vector + // instead of a multi-dimensional array with one dimension. + // This avoids problems like the name being "float[*]", which is + // invalid C# code. + Type arrayType; + if (rank == 1) { - AppendCsharpTypeName( - param.ParameterType, - output); - output.Append(" param"); - output.Append(i); + arrayType = elementType.MakeArrayType(); } else { - output.Append("int param"); - output.Append(i); + arrayType = elementType.MakeArrayType(rank); } - if (i != parameters.Length-1) + + // C++ type declaration + Type[] cppTypeParams = new Type[]{ elementType }; + int indent = AppendCppTypeDeclaration( + "System", + cppArrayTypeName, + false, + cppTypeParams, + builders.CppTypeDeclarations); + + // C++ type definition (beginning) + AppendCppTypeDefinitionBegin( + cppArrayTypeName, + "System", + TypeKind.Class, + cppTypeParams, + "Array", + "System", + null, + false, + indent, + builders.CppTypeDefinitions); + + // C++ method definitions (beginning) + int cppMethodDefinitionsIndent = AppendCppMethodDefinitionBegin( + cppArrayTypeName, + "System", + TypeKind.Class, + cppTypeParams, + "Array", + "System", + null, + false, + indent, + builders.CppMethodDefinitions); + + AppendArrayConstructor( + elementType, + arrayType, + cppArrayTypeName, + rank, + bindingArrayTypeName, + indent, + builders); + + // Base GetLength + AppendArrayCppCallBaseGetIntFunction( + indent, + cppArrayTypeName, + "GetLength", + cppTypeParams, + builders); + + // GetLength for multi-dimensional arrays + if (rank > 1) { - output.Append(", "); + AppendArrayGetLength( + elementType, + arrayType, + cppArrayTypeName, + rank, + bindingArrayTypeName, + indent, + builders); } + + AppendArrayCppCallBaseGetIntFunction( + indent, + cppArrayTypeName, + "GetRank", + cppTypeParams, + builders); + + AppendArrayGetItem( + elementType, + elementTypeKind, + arrayType, + cppArrayTypeName, + rank, + bindingArrayTypeName, + indent, + builders); + + AppendArraySetItem( + elementType, + arrayType, + cppArrayTypeName, + rank, + bindingArrayTypeName, + indent, + builders); + + AppendCppTypeDefinitionEnd( + false, + indent, + builders.CppTypeDefinitions); + + // C++ method definitions (ending) + AppendCppMethodDefinitionEnd( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); } - output.Append(");\n\t\t\n"); } - static void AppendExceptions( - JsonDocument doc, - Assembly[] assemblies, + static void AppendArrayConstructor( + Type elementType, + Type arrayType, + string cppArrayTypeName, + int rank, + string csharpTypeName, + int indent, StringBuilders builders) { - // Gather all specific types of exceptions - Dictionary exceptionTypes = new Dictionary(); - if (doc.Types != null) - { - foreach (JsonType jsonType in doc.Types) - { - if (jsonType.Methods != null) - { - foreach (JsonMethod jsonMethod in jsonType.Methods) + builders.TempStrBuilder.Length = 0; + AppendNamespace( + elementType.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendTypeNameWithoutGenericSuffix( + csharpTypeName, + builders.TempStrBuilder); + builders.TempStrBuilder.Append("Constructor"); + builders.TempStrBuilder.Append(rank); + string funcName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string funcNameLower = builders.TempStrBuilder.ToString(); + + ParameterInfo[] parameters = new ParameterInfo[rank]; + for (int i = 0; i < rank; ++i) + { + ParameterInfo info = new ParameterInfo(); + info.Name = "length" + i; + info.ParameterType = typeof(int); + info.IsOut = false; + info.IsRef = false; + info.DereferencedParameterType = info.ParameterType; + info.Kind = TypeKind.Primitive; + parameters[i] = info; + } + + // C# Delegate Type + AppendCsharpDelegateType( + funcName, + true, + arrayType, + TypeKind.Class, + arrayType, + parameters, + builders.CsharpDelegateTypes); + + // C# Init Call + AppendCsharpInitCallArg( + funcName, + builders.CsharpInitCall); + + // C# Init Param + AppendCsharpInitParam( + funcNameLower, + builders.CsharpInitParams); + + // C# function + AppendCsharpFunctionBeginning( + arrayType, + funcName, + true, + TypeKind.Class, + arrayType, + null, + parameters, + builders.CsharpFunctions); + AppendHandleStoreTypeName( + arrayType, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(".Store(new "); + AppendCsharpTypeName( + elementType, + builders.CsharpFunctions); + builders.CsharpFunctions.Append('['); + for (int i = 0; i < rank; ++i) + { + builders.CsharpFunctions.Append("length"); + builders.CsharpFunctions.Append(i); + if (i != rank-1) + { + builders.CsharpFunctions.Append(", "); + } + } + builders.CsharpFunctions.Append("]);"); + AppendCsharpFunctionReturn( + parameters, + arrayType, + TypeKind.Class, + null, + true, + builders.CsharpFunctions); + + // C++ function pointer definition + AppendCppFunctionPointerDefinition( + funcName, + true, + cppArrayTypeName, + "System", + TypeKind.Class, + parameters, + arrayType, + builders.CppFunctionPointers); + + // C++ init param + AppendCppInitParam( + funcNameLower, + true, + cppArrayTypeName, + "System", + TypeKind.Class, + parameters, + arrayType, + builders.CppInitParams); + + // C++ init body + AppendCppInitBody( + funcName, + funcNameLower, + builders.CppInitBody); + + // C++ method declaration + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + cppArrayTypeName, + false, + false, + null, + null, + parameters, + builders.CppTypeDefinitions); + + // C++ method definition + Type[] cppTypeParams = new Type[] { elementType }; + AppendCppMethodDefinition( + cppArrayTypeName, + null, + cppArrayTypeName, + cppTypeParams, + null, + parameters, + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(" : "); + AppendCppTypeName( + "System", + "Array", + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("(nullptr)\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendCppPluginFunctionCall( + true, + cppArrayTypeName, + "System", + TypeKind.Class, + cppTypeParams, + arrayType, + funcName, + parameters, + indent + 1, + builders.CppMethodDefinitions); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "Handle = returnValue;\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "if (returnValue)\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "{\n"); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + AppendReferenceManagedHandleFunctionCall( + cppArrayTypeName, + "System", + TypeKind.Class, + cppTypeParams, + "returnValue", + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(";\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + } + + static void AppendArrayCppCallBaseGetIntFunction( + int indent, + string cppArrayTypeName, + string baseFunctionName, + Type[] cppTypeParams, + StringBuilders builders + ) + { + ParameterInfo[] parameters = new ParameterInfo[0]; + + // C++ method declaration + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + baseFunctionName, + false, + false, + typeof(int), + null, + parameters, + builders.CppTypeDefinitions); + + // C++ method definition + AppendCppMethodDefinition( + cppArrayTypeName, + typeof(int), + baseFunctionName, + cppTypeParams, + null, + parameters, + indent, + builders.CppMethodDefinitions); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent(indent + 1, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("return Array::"); + builders.CppMethodDefinitions.Append(baseFunctionName); + builders.CppMethodDefinitions.Append("();\n"); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + } + + static void AppendArrayGetLength( + Type elementType, + Type arrayType, + string cppArrayTypeName, + int rank, + string csharpTypeName, + int indent, + StringBuilders builders) + { + builders.TempStrBuilder.Length = 0; + AppendNamespace( + elementType.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendTypeNameWithoutGenericSuffix( + csharpTypeName, + builders.TempStrBuilder); + builders.TempStrBuilder.Append("GetLength"); + builders.TempStrBuilder.Append(rank); + string funcName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string funcNameLower = builders.TempStrBuilder.ToString(); + + ParameterInfo[] parameters = new ParameterInfo[] { + new ParameterInfo { + Name = "dimension", + ParameterType = typeof(int), + IsOut = false, + IsRef = false, + DereferencedParameterType = typeof(int), + Kind = TypeKind.Primitive, + } + }; + + // C# Delegate Type + AppendCsharpDelegateType( + funcName, + false, + arrayType, + TypeKind.Class, + typeof(int), + parameters, + builders.CsharpDelegateTypes); + + // C# Init Call + AppendCsharpInitCallArg( + funcName, + builders.CsharpInitCall); + + // C# Init Param + AppendCsharpInitParam( + funcNameLower, + builders.CsharpInitParams); + + // C# function + AppendCsharpFunctionBeginning( + arrayType, + funcName, + false, + TypeKind.Class, + typeof(int), + null, + parameters, + builders.CsharpFunctions); + builders.CsharpFunctions.Append( + "thiz.GetLength(dimension);"); + AppendCsharpFunctionReturn( + parameters, + typeof(int), + TypeKind.Primitive, + null, + false, + builders.CsharpFunctions); + + // C++ function pointer definition + AppendCppFunctionPointerDefinition( + funcName, + false, + cppArrayTypeName, + "System", + TypeKind.Class, + parameters, + arrayType, + builders.CppFunctionPointers); + + // C++ init param + AppendCppInitParam( + funcNameLower, + false, + cppArrayTypeName, + "System", + TypeKind.Class, + parameters, + arrayType, + builders.CppInitParams); + + // C++ init body + AppendCppInitBody( + funcName, + funcNameLower, + builders.CppInitBody); + + // C++ method declaration + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + "GetLength", + false, + false, + typeof(int), + null, + parameters, + builders.CppTypeDefinitions); + + // C++ method definition + Type[] cppTypeParams = new Type[] { elementType }; + AppendCppMethodDefinition( + cppArrayTypeName, + typeof(int), + "GetLength", + cppTypeParams, + null, + parameters, + indent, + builders.CppMethodDefinitions); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendCppPluginFunctionCall( + false, + cppArrayTypeName, + "System", + TypeKind.Class, + cppTypeParams, + typeof(int), + funcName, + parameters, + indent + 1, + builders.CppMethodDefinitions); + AppendCppMethodReturn( + typeof(int), + TypeKind.Primitive, + indent + 1, + builders.CppMethodDefinitions); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + } + + static void AppendArrayGetItem( + Type elementType, + TypeKind elementTypeKind, + Type arrayType, + string cppArrayTypeName, + int rank, + string csharpTypeName, + int indent, + StringBuilders builders) + { + builders.TempStrBuilder.Length = 0; + AppendNamespace( + elementType.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendTypeNameWithoutGenericSuffix( + csharpTypeName, + builders.TempStrBuilder); + builders.TempStrBuilder.Append("GetItem"); + builders.TempStrBuilder.Append(rank); + string funcName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string funcNameLower = builders.TempStrBuilder.ToString(); + + ParameterInfo[] parameters = new ParameterInfo[rank]; + for (int i = 0; i < rank; ++i) + { + ParameterInfo info = new ParameterInfo(); + info.Name = "index" + i; + info.ParameterType = typeof(int); + info.IsOut = false; + info.IsRef = false; + info.DereferencedParameterType = info.ParameterType; + info.Kind = GetTypeKind( + info.DereferencedParameterType); + parameters[i] = info; + } + + // C# Delegate Type + AppendCsharpDelegateType( + funcName, + false, + arrayType, + TypeKind.Class, + elementType, + parameters, + builders.CsharpDelegateTypes); + + // C# Init Call + AppendCsharpInitCallArg( + funcName, + builders.CsharpInitCall); + + // C# Init Param + AppendCsharpInitParam( + funcNameLower, + builders.CsharpInitParams); + + // C# function + AppendCsharpFunctionBeginning( + arrayType, + funcName, + false, + TypeKind.Class, + elementType, + null, + parameters, + builders.CsharpFunctions); + builders.CsharpFunctions.Append("thiz["); + for (int i = 0; i < rank; ++i) + { + builders.CsharpFunctions.Append("index"); + builders.CsharpFunctions.Append(i); + if (i != rank-1) + { + builders.CsharpFunctions.Append(", "); + } + } + builders.CsharpFunctions.Append("];"); + AppendCsharpFunctionReturn( + parameters, + elementType, + elementTypeKind, + null, + false, + builders.CsharpFunctions); + + // C++ function pointer definition + AppendCppFunctionPointerDefinition( + funcName, + false, + cppArrayTypeName, + "System", + TypeKind.Class, + parameters, + elementType, + builders.CppFunctionPointers); + + // C++ init param + AppendCppInitParam( + funcNameLower, + false, + cppArrayTypeName, + "System", + TypeKind.Class, + parameters, + elementType, + builders.CppInitParams); + + // C++ init body + AppendCppInitBody( + funcName, + funcNameLower, + builders.CppInitBody); + + // C++ method declaration + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + "GetItem", + false, + false, + elementType, + null, + parameters, + builders.CppTypeDefinitions); + + // C++ method definition + Type[] cppTypeParams = new Type[] { elementType }; + AppendCppMethodDefinition( + cppArrayTypeName, + elementType, + "GetItem", + cppTypeParams, + null, + parameters, + indent, + builders.CppMethodDefinitions); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendCppPluginFunctionCall( + false, + cppArrayTypeName, + "System", + TypeKind.Class, + cppTypeParams, + elementType, + funcName, + parameters, + indent + 1, + builders.CppMethodDefinitions); + AppendCppMethodReturn( + elementType, + elementTypeKind, + indent + 1, + builders.CppMethodDefinitions); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + } + + static void AppendArraySetItem( + Type elementType, + Type arrayType, + string cppArrayTypeName, + int rank, + string csharpTypeName, + int indent, + StringBuilders builders) + { + builders.TempStrBuilder.Length = 0; + AppendNamespace( + elementType.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendTypeNameWithoutGenericSuffix( + csharpTypeName, + builders.TempStrBuilder); + builders.TempStrBuilder.Append("SetItem"); + builders.TempStrBuilder.Append(rank); + string funcName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string funcNameLower = builders.TempStrBuilder.ToString(); + + // Build parameters as indexes then element + ParameterInfo[] parameters = new ParameterInfo[rank+1]; + for (int i = 0; i < rank; ++i) + { + ParameterInfo info = new ParameterInfo(); + info.Name = "index" + i; + info.ParameterType = typeof(int); + info.IsOut = false; + info.IsRef = false; + info.DereferencedParameterType = info.ParameterType; + info.Kind = GetTypeKind( + info.DereferencedParameterType); + parameters[i] = info; + } + ParameterInfo lastParamInfo = new ParameterInfo(); + lastParamInfo.Name = "item"; + lastParamInfo.ParameterType = elementType; + lastParamInfo.IsOut = false; + lastParamInfo.IsRef = false; + lastParamInfo.DereferencedParameterType = lastParamInfo.ParameterType; + lastParamInfo.Kind = GetTypeKind( + lastParamInfo.DereferencedParameterType); + parameters[rank] = lastParamInfo; + + // C# Delegate Type + AppendCsharpDelegateType( + funcName, + false, + arrayType, + TypeKind.Class, + typeof(void), + parameters, + builders.CsharpDelegateTypes); + + // C# Init Call + AppendCsharpInitCallArg( + funcName, + builders.CsharpInitCall); + + // C# Init Param + AppendCsharpInitParam( + funcNameLower, + builders.CsharpInitParams); + + // C# function + AppendCsharpFunctionBeginning( + arrayType, + funcName, + false, + TypeKind.Class, + typeof(void), + null, + parameters, + builders.CsharpFunctions); + builders.CsharpFunctions.Append("thiz["); + for (int i = 0; i < rank; ++i) + { + builders.CsharpFunctions.Append("index"); + builders.CsharpFunctions.Append(i); + if (i != rank-1) + { + builders.CsharpFunctions.Append(", "); + } + } + builders.CsharpFunctions.Append("] = item;"); + AppendCsharpFunctionReturn( + parameters, + typeof(void), + TypeKind.None, + null, + false, + builders.CsharpFunctions); + + // C++ function pointer definition + AppendCppFunctionPointerDefinition( + funcName, + false, + cppArrayTypeName, + "System", + TypeKind.Class, + parameters, + arrayType, + builders.CppFunctionPointers); + + // C++ init param + AppendCppInitParam( + funcNameLower, + false, + cppArrayTypeName, + "System", + TypeKind.Class, + parameters, + arrayType, + builders.CppInitParams); + + // C++ init body + AppendCppInitBody( + funcName, + funcNameLower, + builders.CppInitBody); + + // C++ method declaration + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + "SetItem", + false, + false, + typeof(void), + null, + parameters, + builders.CppTypeDefinitions); + + // C++ method definition + Type[] cppTypeParams = new Type[] { elementType }; + AppendCppMethodDefinition( + cppArrayTypeName, + typeof(void), + "SetItem", + cppTypeParams, + null, + parameters, + indent, + builders.CppMethodDefinitions); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendCppPluginFunctionCall( + false, + cppArrayTypeName, + "System", + TypeKind.Class, + cppTypeParams, + typeof(void), + funcName, + parameters, + indent + 1, + builders.CppMethodDefinitions); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent(indent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + } + + static void AppendCsharpDelegate( + bool isStatic, + string typeName, + string funcName, + ParameterInfo[] parameters, + StringBuilder output) + { + output.Append("\t\tpublic delegate void "); + output.Append(typeName); + output.Append(funcName); + output.Append("Delegate("); + if (!isStatic) + { + output.Append("int thisHandle"); + if (parameters.Length > 0) + { + output.Append(", "); + } + } + for (int i = 0; i < parameters.Length; ++i) + { + ParameterInfo param = parameters[i]; + if (param.Kind == TypeKind.FullStruct) + { + AppendCsharpTypeName( + param.ParameterType, + output); + output.Append(" param"); + output.Append(i); + } + else + { + output.Append("int param"); + output.Append(i); + } + if (i != parameters.Length-1) + { + output.Append(", "); + } + } + output.Append(");\n"); + output.Append("\t\tpublic static "); + output.Append(typeName); + output.Append(funcName); + output.Append("Delegate "); + output.Append(typeName); + output.Append(funcName); + output.Append(";\n\t\t\n"); + } + + static void AppendCsharpGetDelegateCall( + string typeName, + string funcName, + StringBuilder output) + { + output.Append("\t\t\t"); + output.Append(typeName); + output.Append(funcName); + output.Append(" = GetDelegate<"); + output.Append(typeName); + output.Append(funcName); + output.Append("Delegate>(libraryHandle, \""); + output.Append(typeName); + output.Append(funcName); + output.Append("\");\n"); + } + + static void AppendCsharpImport( + string typeName, + string funcName, + ParameterInfo[] parameters, + StringBuilder output + ) + { + output.Append("\t\t[DllImport(Constants.PluginName)]\n"); + output.Append("\t\tpublic static extern void "); + output.Append(typeName); + output.Append(funcName); + output.Append("(int thisHandle"); + if (parameters.Length > 0) + { + output.Append(", "); + } + for (int i = 0; i < parameters.Length; ++i) + { + ParameterInfo param = parameters[i]; + if (param.Kind == TypeKind.FullStruct) + { + AppendCsharpTypeName( + param.ParameterType, + output); + output.Append(" param"); + output.Append(i); + } + else + { + output.Append("int param"); + output.Append(i); + } + if (i != parameters.Length-1) + { + output.Append(", "); + } + } + output.Append(");\n\t\t\n"); + } + + static void AppendExceptions( + JsonDocument doc, + Assembly[] assemblies, + StringBuilders builders) + { + // Gather all specific types of exceptions + Dictionary exceptionTypes = new Dictionary(); + if (doc.Types != null) + { + foreach (JsonType jsonType in doc.Types) + { + if (jsonType.Methods != null) + { + foreach (JsonMethod jsonMethod in jsonType.Methods) { if (jsonMethod.Exceptions != null) { @@ -3447,6 +4463,7 @@ static void AppendGetter( Type enclosingType, Type[] enclosingTypeParams, Type fieldType, + TypeKind fieldTypeKind, int indent, Type[] exceptionTypes, StringBuilders builders) @@ -3466,7 +4483,7 @@ static void AppendGetter( enclosingType.Namespace, string.Empty, builders.TempStrBuilder); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( enclosingType.Name, builders.TempStrBuilder); AppendTypeNames( @@ -3553,14 +4570,17 @@ static void AppendGetter( AppendCsharpFunctionReturn( parameters, fieldType, + fieldTypeKind, exceptionTypes, + false, builders.CsharpFunctions); // C++ function pointer AppendCppFunctionPointerDefinition( funcName, methodIsStatic, - enclosingType, + enclosingType.Name, + enclosingType.Namespace, enclosingTypeKind, parameters, fieldType, @@ -3579,7 +4599,7 @@ static void AppendGetter( // C++ method definition AppendCppMethodDefinition( - enclosingType, + enclosingType.Name, fieldType, methodName, enclosingTypeParams, @@ -3591,7 +4611,8 @@ static void AppendGetter( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( methodIsStatic, - enclosingType, + enclosingType.Name, + enclosingType.Namespace, enclosingTypeKind, enclosingTypeParams, fieldType, @@ -3601,6 +4622,7 @@ static void AppendGetter( builders.CppMethodDefinitions); AppendCppMethodReturn( fieldType, + fieldTypeKind, indent + 1, builders.CppMethodDefinitions); AppendIndent(indent, builders.CppMethodDefinitions); @@ -3612,7 +4634,8 @@ static void AppendGetter( AppendCppInitParam( funcNameLower, methodIsStatic, - enclosingType, + enclosingType.Name, + enclosingType.Namespace, enclosingTypeKind, parameters, fieldType, @@ -3655,7 +4678,7 @@ static void AppendSetter( enclosingType.Namespace, string.Empty, builders.TempStrBuilder); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( enclosingType.Name, builders.TempStrBuilder); AppendTypeNames( @@ -3745,14 +4768,17 @@ static void AppendSetter( AppendCsharpFunctionReturn( parameters, typeof(void), + TypeKind.None, exceptionTypes, + false, builders.CsharpFunctions); // C++ function pointer AppendCppFunctionPointerDefinition( funcName, methodIsStatic, - enclosingType, + enclosingType.Name, + enclosingType.Namespace, enclosingTypeKind, parameters, typeof(void), @@ -3771,7 +4797,7 @@ static void AppendSetter( // C++ method definition AppendCppMethodDefinition( - enclosingType, + enclosingType.Name, typeof(void), methodName, enclosingTypeParams, @@ -3783,7 +4809,8 @@ static void AppendSetter( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( methodIsStatic, - enclosingType, + enclosingType.Name, + enclosingType.Namespace, enclosingTypeKind, enclosingTypeParams, null, @@ -3800,7 +4827,8 @@ static void AppendSetter( AppendCppInitParam( funcNameLower, methodIsStatic, - enclosingType, + enclosingType.Name, + enclosingType.Namespace, enclosingTypeKind, parameters, typeof(void), @@ -3827,7 +4855,7 @@ static int AppendCppTypeDeclaration( if (isStatic) { output.Append("namespace "); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( typeName, output); output.Append('\n'); @@ -3843,7 +4871,7 @@ static int AppendCppTypeDeclaration( output.Append("template<> "); } output.Append("struct "); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( typeName, output); AppendCppTypeParameters( @@ -3860,16 +4888,20 @@ static int AppendCppTypeDeclaration( } static void AppendCppTypeDefinitionBegin( - Type type, + string typeName, + string typeNamespace, + TypeKind typeKind, Type[] typeParams, - Type baseType, + string baseTypeName, + string baseTypeNamespace, + Type[] baseTypeTypeParams, bool isStatic, int indent, StringBuilder output ) { AppendNamespaceBeginning( - type.Namespace, + typeNamespace, output); AppendIndent( indent, @@ -3877,8 +4909,8 @@ StringBuilder output if (isStatic) { output.Append("namespace "); - AppendWithoutGenericTypeCountSuffix( - type.Name, + AppendTypeNameWithoutGenericSuffix( + typeName, output); } else @@ -3888,17 +4920,26 @@ StringBuilder output output.Append("template<> "); } output.Append("struct "); - AppendWithoutGenericTypeCountSuffix( - type.Name, + AppendTypeNameWithoutGenericSuffix( + typeName, output); AppendCppTypeParameters(typeParams, output); - if (baseType != null - && !IsFullValueType(type)) + if (baseTypeName != null) { - output.Append(" : "); - AppendCppTypeName( - baseType, - output); + switch (typeKind) + { + case TypeKind.Class: + case TypeKind.ManagedStruct: + output.Append(" : "); + AppendCppTypeName( + baseTypeNamespace, + baseTypeName, + output); + AppendCppTypeParameters( + baseTypeTypeParams, + output); + break; + } } } output.Append('\n'); @@ -3906,138 +4947,144 @@ StringBuilder output indent, output); output.Append("{\n"); - if (!isStatic && !IsFullValueType(type)) + if (!isStatic) { - // Constructor from nullptr_t - AppendIndent(indent + 1, output); - AppendWithoutGenericTypeCountSuffix( - type.Name, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append("(std::nullptr_t n);\n"); - - // Constructor from handle - AppendIndent(indent + 1, output); - AppendWithoutGenericTypeCountSuffix( - type.Name, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append("(Plugin::InternalUse iu, int32_t handle);\n"); - - // Copy constructor - AppendIndent(indent + 1, output); - AppendWithoutGenericTypeCountSuffix( - type.Name, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append("(const "); - AppendWithoutGenericTypeCountSuffix( - type.Name, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append("& other);\n"); - - // Move constructor - AppendIndent(indent + 1, output); - AppendWithoutGenericTypeCountSuffix( - type.Name, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append('('); - AppendWithoutGenericTypeCountSuffix( - type.Name, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append("&& other);\n"); - - // Destructor - AppendIndent(indent + 1, output); - output.Append("virtual ~"); - AppendWithoutGenericTypeCountSuffix( - type.Name, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append("();\n"); - - // Assignment operator to same type - AppendIndent(indent + 1, output); - AppendWithoutGenericTypeCountSuffix( - type.Name, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append("& operator=(const "); - AppendWithoutGenericTypeCountSuffix( - type.Name, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append("& other);\n"); - - // Assignment operator to nullptr_t - AppendIndent(indent + 1, output); - AppendWithoutGenericTypeCountSuffix( - type.Name, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append("& operator=(std::nullptr_t other);\n"); - - // Move assignment operator to same type - AppendIndent(indent + 1, output); - AppendWithoutGenericTypeCountSuffix( - type.Name, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append("& operator=("); - AppendWithoutGenericTypeCountSuffix( - type.Name, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append("&& other);\n"); - - // Equality operator with same type - AppendIndent(indent + 1, output); - output.Append("bool operator==(const "); - AppendWithoutGenericTypeCountSuffix( - type.Name, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append("& other) const;\n"); - - // Inequality operator with same type - AppendIndent(indent + 1, output); - output.Append("bool operator!=(const "); - AppendWithoutGenericTypeCountSuffix( - type.Name, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append("& other) const;\n"); + switch (typeKind) + { + case TypeKind.Class: + case TypeKind.ManagedStruct: + // Constructor from nullptr_t + AppendIndent(indent + 1, output); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("(std::nullptr_t n);\n"); + + // Constructor from handle + AppendIndent(indent + 1, output); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("(Plugin::InternalUse iu, int32_t handle);\n"); + + // Copy constructor + AppendIndent(indent + 1, output); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("(const "); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& other);\n"); + + // Move constructor + AppendIndent(indent + 1, output); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append('('); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("&& other);\n"); + + // Destructor + AppendIndent(indent + 1, output); + output.Append("virtual ~"); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("();\n"); + + // Assignment operator to same type + AppendIndent(indent + 1, output); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& operator=(const "); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& other);\n"); + + // Assignment operator to nullptr_t + AppendIndent(indent + 1, output); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& operator=(std::nullptr_t other);\n"); + + // Move assignment operator to same type + AppendIndent(indent + 1, output); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& operator=("); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("&& other);\n"); + + // Equality operator with same type + AppendIndent(indent + 1, output); + output.Append("bool operator==(const "); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& other) const;\n"); + + // Inequality operator with same type + AppendIndent(indent + 1, output); + output.Append("bool operator!=(const "); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& other) const;\n"); + break; + } } } @@ -4062,45 +5109,53 @@ static void AppendCppTypeDefinitionEnd( } static int AppendCppMethodDefinitionBegin( - Type enclosingType, + string enclosingTypeName, + string enclosingTypeNamespace, TypeKind enclosingTypeKind, Type[] enclosingTypeParams, - Type baseType, + string baseTypeName, + string baseTypeNamespace, + Type[] baseTypeTypeParams, bool isStatic, int indent, StringBuilder output) { int cppMethodDefinitionsIndent = AppendNamespaceBeginning( - enclosingType.Namespace, + enclosingTypeNamespace, output); if (!isStatic && ( enclosingTypeKind == TypeKind.Class || enclosingTypeKind == TypeKind.ManagedStruct)) { - if (baseType == null) + if (baseTypeName == null) { - baseType = typeof(object); + baseTypeName = "Object"; + baseTypeNamespace = "System"; } // Construct with nullptr_t AppendIndent(indent, output); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::"); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); output.Append("(std::nullptr_t n)\n"); AppendIndent(indent, output); output.Append("\t: "); AppendCppTypeName( - baseType, + baseTypeNamespace, + baseTypeName, output); - output.Append("(0)\n"); + AppendCppTypeParameters( + baseTypeTypeParams, + output); + output.Append("(nullptr)\n"); AppendIndent(indent, output); output.Append("{\n"); AppendIndent(indent, output); @@ -4110,21 +5165,25 @@ static int AppendCppMethodDefinitionBegin( // Construct with handle AppendIndent(indent, output); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::"); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); output.Append("(Plugin::InternalUse iu, int32_t handle)\n"); AppendIndent(indent, output); output.Append("\t: "); AppendCppTypeName( - baseType, + baseTypeNamespace, + baseTypeName, + output); + AppendCppTypeParameters( + baseTypeTypeParams, output); output.Append("(iu, handle)\n"); AppendIndent(indent, output); @@ -4135,7 +5194,8 @@ static int AppendCppMethodDefinitionBegin( output.Append("{\n"); AppendIndent(indent + 2, output); AppendReferenceManagedHandleFunctionCall( - enclosingType, + enclosingTypeName, + enclosingTypeNamespace, enclosingTypeKind, enclosingTypeParams, "handle", @@ -4150,19 +5210,19 @@ static int AppendCppMethodDefinitionBegin( // Copy constructor AppendIndent(indent, output); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::"); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); output.Append("(const "); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -4171,7 +5231,11 @@ static int AppendCppMethodDefinitionBegin( AppendIndent(indent, output); output.Append("\t: "); AppendCppTypeName( - baseType, + baseTypeNamespace, + baseTypeName, + output); + AppendCppTypeParameters( + baseTypeTypeParams, output); output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent(indent, output); @@ -4182,7 +5246,8 @@ static int AppendCppMethodDefinitionBegin( output.Append("{\n"); AppendIndent(indent + 2, output); AppendReferenceManagedHandleFunctionCall( - enclosingType, + enclosingTypeName, + enclosingTypeNamespace, enclosingTypeKind, enclosingTypeParams, "Handle", @@ -4197,19 +5262,19 @@ static int AppendCppMethodDefinitionBegin( // Move constructor AppendIndent(indent, output); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::"); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); output.Append("("); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -4218,7 +5283,11 @@ static int AppendCppMethodDefinitionBegin( AppendIndent(indent, output); output.Append("\t: "); AppendCppTypeName( - baseType, + baseTypeNamespace, + baseTypeName, + output); + AppendCppTypeParameters( + baseTypeTypeParams, output); output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent(indent, output); @@ -4232,15 +5301,15 @@ static int AppendCppMethodDefinitionBegin( // Destructor AppendIndent(indent, output); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::~"); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -4254,7 +5323,8 @@ static int AppendCppMethodDefinitionBegin( output.Append("{\n"); AppendIndent(indent + 2, output); AppendDereferenceManagedHandleFunctionCall( - enclosingType, + enclosingTypeName, + enclosingTypeNamespace, enclosingTypeKind, enclosingTypeParams, "Handle", @@ -4271,22 +5341,22 @@ static int AppendCppMethodDefinitionBegin( // Assignment operator to same type AppendIndent(indent, output); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("& "); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::operator=(const "); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -4295,7 +5365,8 @@ static int AppendCppMethodDefinitionBegin( AppendIndent(indent, output); output.Append("{\n"); AppendSetHandle( - enclosingType, + enclosingTypeName, + enclosingTypeNamespace, enclosingTypeKind, enclosingTypeParams, indent + 1, @@ -4311,15 +5382,15 @@ static int AppendCppMethodDefinitionBegin( // Assignment operator to nullptr_t AppendIndent(indent, output); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("& "); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -4334,7 +5405,8 @@ static int AppendCppMethodDefinitionBegin( AppendIndent(indent, output); output.Append("\t\t"); AppendDereferenceManagedHandleFunctionCall( - enclosingType, + enclosingTypeName, + enclosingTypeNamespace, enclosingTypeKind, enclosingTypeParams, "Handle", @@ -4353,22 +5425,22 @@ static int AppendCppMethodDefinitionBegin( // Move assignment operator to same type AppendIndent(indent, output); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("& "); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::operator=("); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -4383,7 +5455,8 @@ static int AppendCppMethodDefinitionBegin( AppendIndent(indent, output); output.Append("\t\t"); AppendDereferenceManagedHandleFunctionCall( - enclosingType, + enclosingTypeName, + enclosingTypeNamespace, enclosingTypeKind, enclosingTypeParams, "Handle", @@ -4405,15 +5478,15 @@ static int AppendCppMethodDefinitionBegin( // Equality operator with same type AppendIndent(indent, output); output.Append("bool "); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::operator==(const "); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -4431,15 +5504,15 @@ static int AppendCppMethodDefinitionBegin( // Inequality operator with same type AppendIndent(indent, output); output.Append("bool "); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::operator!=(const "); - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -4458,7 +5531,8 @@ static int AppendCppMethodDefinitionBegin( } static void AppendSetHandle( - Type enclosingType, + string enclosingTypeName, + string enclosingTypeNamespace, TypeKind enclosingTypeKind, Type[] enclosingTypeParams, int indent, @@ -4483,7 +5557,8 @@ static void AppendSetHandle( output.Append("{\n"); AppendIndent(indent + 2, output); AppendDereferenceManagedHandleFunctionCall( - enclosingType, + enclosingTypeName, + enclosingTypeNamespace, enclosingTypeKind, enclosingTypeParams, thisHandleExpression, @@ -4504,7 +5579,8 @@ static void AppendSetHandle( output.Append("{\n"); AppendIndent(indent + 2, output); AppendReferenceManagedHandleFunctionCall( - enclosingType, + enclosingTypeName, + enclosingTypeNamespace, enclosingTypeKind, enclosingTypeParams, thisHandleExpression, @@ -4517,7 +5593,8 @@ static void AppendSetHandle( } static void AppendReferenceManagedHandleFunctionCall( - Type enclosingType, + string enclosingTypeName, + string enclosingTypeNamespace, TypeKind enclosingTypeKind, Type[] enclosingTypeParams, string handleVariable, @@ -4527,7 +5604,8 @@ static void AppendReferenceManagedHandleFunctionCall( { output.Append("Plugin::ReferenceManaged"); AppendReleaseFunctionNameSuffix( - enclosingType, + enclosingTypeName, + enclosingTypeNamespace, enclosingTypeParams, output); output.Append("(Handle)"); @@ -4541,7 +5619,8 @@ static void AppendReferenceManagedHandleFunctionCall( } static void AppendDereferenceManagedHandleFunctionCall( - Type enclosingType, + string enclosingTypeName, + string enclosingTypeNamespace, TypeKind enclosingTypeKind, Type[] enclosingTypeParams, string handleVariable, @@ -4551,7 +5630,8 @@ static void AppendDereferenceManagedHandleFunctionCall( { output.Append("Plugin::DereferenceManaged"); AppendReleaseFunctionNameSuffix( - enclosingType, + enclosingTypeName, + enclosingTypeNamespace, enclosingTypeParams, output); output.Append("(Handle)"); @@ -4870,7 +5950,9 @@ static void AppendStructStoreReplace( static void AppendCsharpFunctionReturn( ParameterInfo[] parameters, Type returnType, + TypeKind returnTypeKind, Type[] exceptionTypes, + bool forceReturnReturnValue, StringBuilder output) { // Store reference out and ref params and overwrite handles @@ -4909,7 +5991,11 @@ static void AppendCsharpFunctionReturn( if (!returnType.Equals(typeof(void))) { output.Append("\n\t\t\t\treturn "); - if (IsFullValueType(returnType)) + if ( + forceReturnReturnValue + || returnTypeKind == TypeKind.Enum + || returnTypeKind == TypeKind.FullStruct + || returnTypeKind == TypeKind.Primitive) { output.Append("returnValue"); } @@ -4918,7 +6004,16 @@ static void AppendCsharpFunctionReturn( AppendHandleStoreTypeName( returnType, output); - output.Append(".GetHandle(returnValue)"); + output.Append('.'); + if (returnTypeKind == TypeKind.Class) + { + output.Append("GetHandle"); + } + else + { + output.Append("Store"); + } + output.Append("(returnValue)"); } output.Append(';'); } @@ -4937,7 +6032,8 @@ static void AppendCsharpFunctionEnd( { output.Append('\n'); output.Append("\t\t\t}\n"); - if (Array.IndexOf( + if (exceptionTypes == null + || Array.IndexOf( exceptionTypes, typeof(NullReferenceException)) < 0) { @@ -4946,12 +6042,15 @@ static void AppendCsharpFunctionEnd( returnType, output); } - foreach (Type exceptionType in exceptionTypes) + if (exceptionTypes != null) { - AppendCsharpCatchException( - exceptionType, - returnType, - output); + foreach (Type exceptionType in exceptionTypes) + { + AppendCsharpCatchException( + exceptionType, + returnType, + output); + } } AppendCsharpCatchException( typeof(Exception), @@ -4972,6 +6071,7 @@ static void AppendCsharpCatchException( output); output.Append(" ex)\n"); output.Append("\t\t\t{\n"); + output.Append("\t\t\t\tUnityEngine.Debug.LogException(ex);\n"); output.Append("\t\t\t\tNativeScript.Bindings."); AppendCsharpSetCsharpExceptionFunctionName( exceptionType, @@ -5007,7 +6107,7 @@ StringBuilder output exceptionType.Namespace, string.Empty, output); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( exceptionType.Name, output); } @@ -5144,7 +6244,7 @@ static void AppendCppInitBody( } static void AppendCppMethodDefinition( - Type enclosingType, + string enclosingTypeName, Type returnType, string methodName, Type[] typeTypeParams, @@ -5174,8 +6274,8 @@ static void AppendCppMethodDefinition( } // Type name - AppendWithoutGenericTypeCountSuffix( - enclosingType.Name, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); AppendCppTypeParameters( typeTypeParams, @@ -5183,7 +6283,7 @@ static void AppendCppMethodDefinition( output.Append("::"); // Method name - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( methodName, output); @@ -5202,6 +6302,7 @@ static void AppendCppMethodDefinition( static void AppendCppMethodReturn( Type returnType, + TypeKind returnTypeKind, int indent, StringBuilder output) { @@ -5209,16 +6310,19 @@ static void AppendCppMethodReturn( { AppendIndent(indent, output); output.Append("return "); - if (IsFullValueType(returnType)) + switch (returnTypeKind) { - output.Append("returnValue"); - } - else - { - AppendCppTypeName( - returnType, - output); - output.Append("(Plugin::InternalUse::Only, returnValue)"); + case TypeKind.Enum: + case TypeKind.FullStruct: + case TypeKind.Primitive: + output.Append("returnValue"); + break; + default: + AppendCppTypeName( + returnType, + output); + output.Append("(Plugin::InternalUse::Only, returnValue)"); + break; } output.Append(";\n"); } @@ -5226,7 +6330,8 @@ static void AppendCppMethodReturn( static void AppendCppPluginFunctionCall( bool isStatic, - Type enclosingType, + string enclosingTypeName, + string enclosingTypeNamespace, TypeKind enclosingTypeKind, Type[] enclosingTypeParams, Type returnType, @@ -5330,7 +6435,8 @@ static void AppendCppPluginFunctionCall( && (param.IsOut || param.IsRef)) { AppendSetHandle( - enclosingType, + enclosingTypeName, + enclosingTypeNamespace, enclosingTypeKind, enclosingTypeParams, indent, @@ -5344,7 +6450,8 @@ static void AppendCppPluginFunctionCall( static void AppendCppInitParam( string funcName, bool isStatic, - Type enclosingType, + string enclosingTypeName, + string enclosingTypeNamespace, TypeKind enclosingTypeKind, ParameterInfo[] parameters, Type returnType, @@ -5355,7 +6462,8 @@ StringBuilder output AppendCppFunctionPointer( funcName, isStatic, - enclosingType, + enclosingTypeName, + enclosingTypeNamespace, enclosingTypeKind, parameters, returnType, @@ -5368,7 +6476,8 @@ StringBuilder output static void AppendCppFunctionPointerDefinition( string funcName, bool isStatic, - Type enclosingType, + string enclosingTypeName, + string enclosingTypeNamespace, TypeKind enclosingTypeKind, ParameterInfo[] parameters, Type returnType, @@ -5379,7 +6488,8 @@ StringBuilder output AppendCppFunctionPointer( funcName, isStatic, - enclosingType, + enclosingTypeName, + enclosingTypeNamespace, enclosingTypeKind, parameters, returnType, @@ -5392,7 +6502,8 @@ StringBuilder output static void AppendCppFunctionPointer( string funcName, bool isStatic, - Type enclosingType, + string enclosingTypeName, + string enclosingTypeNamespace, TypeKind enclosingTypeKind, ParameterInfo[] parameters, Type returnType, @@ -5419,7 +6530,8 @@ static void AppendCppFunctionPointer( case TypeKind.FullStruct: case TypeKind.Primitive: AppendCppTypeName( - enclosingType, + enclosingTypeNamespace, + enclosingTypeName, output); output.Append("* thiz"); break; @@ -5534,7 +6646,7 @@ static void AppendCppMethodDeclaration( // Method name might be a constructor/type name, so remove suffix // just in case - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( methodName, output); @@ -5610,7 +6722,7 @@ static void AppendCsharpTypeName( { output.Append(type.Namespace); output.Append('.'); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( type.Name, output); Type[] genTypes = type.GetGenericArguments(); @@ -5680,6 +6792,24 @@ static void AppendCppTypeName( { output.Append("System::String"); } + else if (type.IsArray) + { + output.Append("System::Array"); + output.Append(type.GetArrayRank()); + output.Append('<'); + int rank = type.GetArrayRank(); + for (int i = 0; i < rank; ++i) + { + AppendTypeNameWithoutSuffixes( + type.Name, + output); + if (i != rank -1) + { + output.Append(", "); + } + } + output.Append('>'); + } else { AppendCppTypeName( @@ -5700,7 +6830,7 @@ static void AppendCppTypeName( { AppendNamespace(namespaceName, "::", output); output.Append("::"); - AppendWithoutGenericTypeCountSuffix( + AppendTypeNameWithoutGenericSuffix( name, output); } diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 12a7a5d..38df5bf 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -411,6 +411,85 @@ }, { "Name": "System.NullReferenceException" + }, + { + "Name": "UnityEngine.Resolution", + "Properties": [ + { + "Name": "width", + "Get": {}, + "Set": {} + }, + { + "Name": "height", + "Get": {}, + "Set": {} + }, + { + "Name": "refreshRate", + "Get": {}, + "Set": {} + } + ] + }, + { + "Name": "UnityEngine.Screen", + "Properties": [ + { + "Name": "resolutions", + "Get": {} + } + ] + }, + { + "Name": "UnityEngine.Ray", + "Constructors": [ + { + "ParamTypes": [ + "UnityEngine.Vector3", + "UnityEngine.Vector3" + ] + } + ] + }, + { + "Name": "UnityEngine.Physics", + "Methods": [ + { + "Name": "RaycastNonAlloc", + "ParamTypes": [ + "UnityEngine.Ray", + "UnityEngine.RaycastHit[]" + ] + }, + { + "Name": "RaycastAll", + "ParamTypes": [ + "UnityEngine.Ray" + ] + } + ] + }, + { + "Name": "UnityEngine.Color" + }, + { + "Name": "UnityEngine.GradientColorKey" + }, + { + "Name": "UnityEngine.Gradient", + "Constructors": [ + { + "ParamTypes": [] + } + ], + "Properties": [ + { + "Name": "colorKeys", + "Get": {}, + "Set": {} + } + ] } ], "MonoBehaviours": [ @@ -423,5 +502,26 @@ "Update" ] } + ], + "Arrays": [ + { + "Type": "System.Int32" + }, + { + "Type": "System.Single", + "Ranks": [ 1, 2, 3 ] + }, + { + "Type": "System.String" + }, + { + "Type": "UnityEngine.Resolution" + }, + { + "Type": "UnityEngine.RaycastHit" + }, + { + "Type": "UnityEngine.GradientColorKey" + } ] } \ No newline at end of file diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index 1cd6b8b..bd75de3 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -22,35 +22,6 @@ void PluginMain() PrintPlatformDefines(); Debug::Log(String("Game booted up")); - if (!UnityEngine::Assertions::Assert::GetRaiseExceptions()) - { - UnityEngine::Assertions::Assert::SetRaiseExceptions(true); - } - - System::Collections::Generic::List strings; - strings.Add("one"); - strings.Add("two"); - strings.Add("three"); - Debug::Log(strings); - String first = strings.GetItem(0); - Debug::Log(first); - strings.SetItem(0, "new one"); - first = strings.GetItem(0); - Debug::Log(first); - - System::Runtime::CompilerServices::StrongBox strongbox("secret"); - Debug::Log(strongbox.GetValue()); - strongbox.SetValue("new secret"); - Debug::Log(strongbox.GetValue()); - - System::Collections::Generic::LinkedListNode node("node val"); - Debug::Log(node.GetValue()); - node.SetValue("new node val"); - Debug::Log(node.GetValue()); - - Collections::Generic::KeyValuePair kvp("C++ key", 3.14); - Debug::Log(kvp.GetKey()); - GameObject go("GameObject with a TestScript"); go.AddComponent(); } diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 22aafa2..2af3465 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -35,9 +35,10 @@ namespace Plugin { void (*ReleaseObject)(int32_t handle); - void (*SetException)(int32_t handle); - int32_t (*StringNew)(const char* chars); + void (*SetException)(int32_t handle); + int32_t (*ArrayGetLength)(int32_t handle); + int32_t (*ArrayGetRank)(int32_t handle); /*BEGIN FUNCTION POINTERS*/ int32_t (*SystemDiagnosticsStopwatchConstructor)(); @@ -89,6 +90,45 @@ namespace Plugin int32_t (*SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)(int32_t thisHandle); void (*SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)(int32_t thisHandle, int32_t valueHandle); int32_t (*SystemExceptionConstructorSystemString)(int32_t messageHandle); + int32_t (*UnityEngineResolutionPropertyGetWidth)(UnityEngine::Resolution* thiz); + void (*UnityEngineResolutionPropertySetWidth)(UnityEngine::Resolution* thiz, int32_t value); + int32_t (*UnityEngineResolutionPropertyGetHeight)(UnityEngine::Resolution* thiz); + void (*UnityEngineResolutionPropertySetHeight)(UnityEngine::Resolution* thiz, int32_t value); + int32_t (*UnityEngineResolutionPropertyGetRefreshRate)(UnityEngine::Resolution* thiz); + void (*UnityEngineResolutionPropertySetRefreshRate)(UnityEngine::Resolution* thiz, int32_t value); + int32_t (*UnityEngineScreenPropertyGetResolutions)(); + UnityEngine::Ray (*UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); + int32_t (*UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)(UnityEngine::Ray& ray, int32_t resultsHandle); + int32_t (*UnityEnginePhysicsMethodRaycastAllUnityEngineRay)(UnityEngine::Ray& ray); + int32_t (*UnityEngineGradientConstructor)(); + int32_t (*UnityEngineGradientPropertyGetColorKeys)(int32_t thisHandle); + void (*UnityEngineGradientPropertySetColorKeys)(int32_t thisHandle, int32_t valueHandle); + int32_t (*SystemInt32Array1Constructor1)(int32_t length0); + int32_t (*SystemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0); + int32_t (*SystemInt32Array1SetItem1)(int32_t thisHandle, int32_t index0, int32_t item); + int32_t (*SystemSingleArray1Constructor1)(int32_t length0); + float (*SystemSingleArray1GetItem1)(int32_t thisHandle, int32_t index0); + int32_t (*SystemSingleArray1SetItem1)(int32_t thisHandle, int32_t index0, float item); + int32_t (*SystemSingleArray2Constructor2)(int32_t length0, int32_t length1); + int32_t (*SystemSingleArray2GetLength2)(int32_t thisHandle, int32_t dimension); + float (*SystemSingleArray2GetItem2)(int32_t thisHandle, int32_t index0, int32_t index1); + int32_t (*SystemSingleArray2SetItem2)(int32_t thisHandle, int32_t index0, int32_t index1, float item); + int32_t (*SystemSingleArray3Constructor3)(int32_t length0, int32_t length1, int32_t length2); + int32_t (*SystemSingleArray3GetLength3)(int32_t thisHandle, int32_t dimension); + float (*SystemSingleArray3GetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2); + int32_t (*SystemSingleArray3SetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2, float item); + int32_t (*SystemStringArray1Constructor1)(int32_t length0); + int32_t (*SystemStringArray1GetItem1)(int32_t thisHandle, int32_t index0); + int32_t (*SystemStringArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle); + int32_t (*UnityEngineResolutionArray1Constructor1)(int32_t length0); + UnityEngine::Resolution (*UnityEngineResolutionArray1GetItem1)(int32_t thisHandle, int32_t index0); + int32_t (*UnityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::Resolution& item); + int32_t (*UnityEngineRaycastHitArray1Constructor1)(int32_t length0); + int32_t (*UnityEngineRaycastHitArray1GetItem1)(int32_t thisHandle, int32_t index0); + int32_t (*UnityEngineRaycastHitArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle); + int32_t (*UnityEngineGradientColorKeyArray1Constructor1)(int32_t length0); + UnityEngine::GradientColorKey (*UnityEngineGradientColorKeyArray1GetItem1)(int32_t thisHandle, int32_t index0); + int32_t (*UnityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item); /*END FUNCTION POINTERS*/ } @@ -217,13 +257,13 @@ namespace System } ValueType::ValueType(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) { + Handle = handle; } ValueType::ValueType(std::nullptr_t n) - : Object(0) { + Handle = 0; } String::String(std::nullptr_t n) @@ -306,6 +346,26 @@ namespace System : Object(Plugin::InternalUse::Only, Plugin::StringNew(chars)) { } + + Array::Array(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) + { + } + + Array::Array(std::nullptr_t n) + : Object(0) + { + } + + int32_t Array::GetLength() + { + return Plugin::ArrayGetLength(Handle); + } + + int32_t Array::GetRank() + { + return Plugin::ArrayGetRank(Handle); + } } /*BEGIN METHOD DEFINITIONS*/ @@ -314,7 +374,7 @@ namespace System namespace Diagnostics { Stopwatch::Stopwatch(std::nullptr_t n) - : System::Object(0) + : System::Object(nullptr) { } @@ -400,7 +460,7 @@ namespace System } Stopwatch::Stopwatch() - : System::Object(0) + : System::Object(nullptr) { auto returnValue = Plugin::SystemDiagnosticsStopwatchConstructor(); if (Plugin::unhandledCsharpException) @@ -459,7 +519,7 @@ namespace System namespace UnityEngine { Object::Object(std::nullptr_t n) - : System::Object(0) + : System::Object(nullptr) { } @@ -599,7 +659,7 @@ namespace UnityEngine namespace UnityEngine { GameObject::GameObject(std::nullptr_t n) - : UnityEngine::Object(0) + : UnityEngine::Object(nullptr) { } @@ -685,7 +745,7 @@ namespace UnityEngine } GameObject::GameObject() - : UnityEngine::Object(0) + : UnityEngine::Object(nullptr) { auto returnValue = Plugin::UnityEngineGameObjectConstructor(); if (Plugin::unhandledCsharpException) @@ -703,7 +763,7 @@ namespace UnityEngine } GameObject::GameObject(System::String name) - : UnityEngine::Object(0) + : UnityEngine::Object(nullptr) { auto returnValue = Plugin::UnityEngineGameObjectConstructorSystemString(name.Handle); if (Plugin::unhandledCsharpException) @@ -750,7 +810,7 @@ namespace UnityEngine namespace UnityEngine { Component::Component(std::nullptr_t n) - : UnityEngine::Object(0) + : UnityEngine::Object(nullptr) { } @@ -852,7 +912,7 @@ namespace UnityEngine namespace UnityEngine { Transform::Transform(std::nullptr_t n) - : UnityEngine::Component(0) + : UnityEngine::Component(nullptr) { } @@ -966,7 +1026,7 @@ namespace UnityEngine namespace UnityEngine { Debug::Debug(std::nullptr_t n) - : System::Object(0) + : System::Object(nullptr) { } @@ -1122,7 +1182,7 @@ namespace UnityEngine namespace UnityEngine { Collision::Collision(std::nullptr_t n) - : System::Object(0) + : System::Object(nullptr) { } @@ -1211,7 +1271,7 @@ namespace UnityEngine namespace UnityEngine { Behaviour::Behaviour(std::nullptr_t n) - : UnityEngine::Component(0) + : UnityEngine::Component(nullptr) { } @@ -1300,7 +1360,7 @@ namespace UnityEngine namespace UnityEngine { MonoBehaviour::MonoBehaviour(std::nullptr_t n) - : UnityEngine::Behaviour(0) + : UnityEngine::Behaviour(nullptr) { } @@ -1389,7 +1449,7 @@ namespace UnityEngine namespace UnityEngine { AudioSettings::AudioSettings(std::nullptr_t n) - : System::Object(0) + : System::Object(nullptr) { } @@ -1492,7 +1552,7 @@ namespace UnityEngine namespace Networking { NetworkTransport::NetworkTransport(std::nullptr_t n) - : System::Object(0) + : System::Object(nullptr) { } @@ -1722,7 +1782,7 @@ namespace UnityEngine namespace UnityEngine { RaycastHit::RaycastHit(std::nullptr_t n) - : System::ValueType(0) + : System::ValueType(nullptr) { } @@ -1853,7 +1913,7 @@ namespace System namespace Generic { KeyValuePair::KeyValuePair(std::nullptr_t n) - : System::ValueType(0) + : System::ValueType(nullptr) { } @@ -1939,7 +1999,7 @@ namespace System } KeyValuePair::KeyValuePair(System::String key, double value) - : System::ValueType(0) + : System::ValueType(nullptr) { auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(key.Handle, value); if (Plugin::unhandledCsharpException) @@ -1992,7 +2052,7 @@ namespace System namespace Generic { List::List(std::nullptr_t n) - : System::Object(0) + : System::Object(nullptr) { } @@ -2078,7 +2138,7 @@ namespace System } List::List() - : System::Object(0) + : System::Object(nullptr) { auto returnValue = Plugin::SystemCollectionsGenericListSystemStringConstructor(); if (Plugin::unhandledCsharpException) @@ -2142,7 +2202,7 @@ namespace System namespace Generic { LinkedListNode::LinkedListNode(std::nullptr_t n) - : System::Object(0) + : System::Object(nullptr) { } @@ -2228,7 +2288,7 @@ namespace System } LinkedListNode::LinkedListNode(System::String value) - : System::Object(0) + : System::Object(nullptr) { auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(value.Handle); if (Plugin::unhandledCsharpException) @@ -2280,7 +2340,7 @@ namespace System namespace CompilerServices { StrongBox::StrongBox(std::nullptr_t n) - : System::Object(0) + : System::Object(nullptr) { } @@ -2366,7 +2426,7 @@ namespace System } StrongBox::StrongBox(System::String value) - : System::Object(0) + : System::Object(nullptr) { auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(value.Handle); if (Plugin::unhandledCsharpException) @@ -2418,7 +2478,7 @@ namespace System namespace ObjectModel { Collection::Collection(std::nullptr_t n) - : System::Object(0) + : System::Object(nullptr) { } @@ -2513,7 +2573,7 @@ namespace System namespace ObjectModel { KeyedCollection::KeyedCollection(std::nullptr_t n) - : System::Collections::ObjectModel::Collection(0) + : System::Collections::ObjectModel::Collection(nullptr) { } @@ -2604,7 +2664,7 @@ namespace System namespace System { Exception::Exception(std::nullptr_t n) - : System::Object(0) + : System::Object(nullptr) { } @@ -2690,7 +2750,7 @@ namespace System } Exception::Exception(System::String message) - : System::Object(0) + : System::Object(nullptr) { auto returnValue = Plugin::SystemExceptionConstructorSystemString(message.Handle); if (Plugin::unhandledCsharpException) @@ -2711,7 +2771,7 @@ namespace System namespace System { SystemException::SystemException(std::nullptr_t n) - : System::Exception(0) + : System::Exception(nullptr) { } @@ -2800,7 +2860,7 @@ namespace System namespace System { NullReferenceException::NullReferenceException(std::nullptr_t n) - : System::SystemException(0) + : System::SystemException(nullptr) { } @@ -2886,94 +2946,1721 @@ namespace System } } -namespace MyGame +namespace UnityEngine { - namespace MonoBehaviours + Resolution::Resolution() { - TestScript::TestScript(std::nullptr_t n) - : UnityEngine::MonoBehaviour(0) + } + + int32_t Resolution::GetWidth() + { + auto returnValue = Plugin::UnityEngineResolutionPropertyGetWidth(this); + if (Plugin::unhandledCsharpException) { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - TestScript::TestScript(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::MonoBehaviour(iu, handle) + return returnValue; + } + + void Resolution::SetWidth(int32_t value) + { + Plugin::UnityEngineResolutionPropertySetWidth(this, value); + if (Plugin::unhandledCsharpException) { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - TestScript::TestScript(const TestScript& other) - : UnityEngine::MonoBehaviour(Plugin::InternalUse::Only, other.Handle) + } + + int32_t Resolution::GetHeight() + { + auto returnValue = Plugin::UnityEngineResolutionPropertyGetHeight(this); + if (Plugin::unhandledCsharpException) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - TestScript::TestScript(TestScript&& other) - : UnityEngine::MonoBehaviour(Plugin::InternalUse::Only, other.Handle) + return returnValue; + } + + void Resolution::SetHeight(int32_t value) + { + Plugin::UnityEngineResolutionPropertySetHeight(this, value); + if (Plugin::unhandledCsharpException) { - other.Handle = 0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - TestScript::~TestScript() + } + + int32_t Resolution::GetRefreshRate() + { + auto returnValue = Plugin::UnityEngineResolutionPropertyGetRefreshRate(this); + if (Plugin::unhandledCsharpException) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - TestScript& TestScript::operator=(const TestScript& other) + return returnValue; + } + + void Resolution::SetRefreshRate(int32_t value) + { + Plugin::UnityEngineResolutionPropertySetRefreshRate(this, value); + if (Plugin::unhandledCsharpException) { - if (this->Handle != other.Handle) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - } - return *this; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - TestScript& TestScript::operator=(std::nullptr_t other) + } +} + +namespace UnityEngine +{ + Screen::Screen(std::nullptr_t n) + : System::Object(nullptr) + { + } + + Screen::Screen(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; + Plugin::ReferenceManagedClass(handle); } - - TestScript& TestScript::operator=(TestScript&& other) + } + + Screen::Screen(const Screen& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) { - if (Handle) + Plugin::ReferenceManagedClass(Handle); + } + } + + Screen::Screen(Screen&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Screen::~Screen() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Screen& Screen::operator=(const Screen& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } - Handle = other.Handle; - other.Handle = 0; - return *this; } - - bool TestScript::operator==(const TestScript& other) const + return *this; + } + + Screen& Screen::operator=(std::nullptr_t other) + { + if (Handle) { - return Handle == other.Handle; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - bool TestScript::operator!=(const TestScript& other) const + return *this; + } + + Screen& Screen::operator=(Screen&& other) + { + if (Handle) { - return Handle != other.Handle; + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Screen::operator==(const Screen& other) const + { + return Handle == other.Handle; + } + + bool Screen::operator!=(const Screen& other) const + { + return Handle != other.Handle; + } + + System::Array1 Screen::GetResolutions() + { + auto returnValue = Plugin::UnityEngineScreenPropertyGetResolutions(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Array1(Plugin::InternalUse::Only, returnValue); + } +} + +namespace UnityEngine +{ + Ray::Ray() + { + } + + Ray::Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction) + { + auto returnValue = Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(origin, direction); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + *this = returnValue; + } +} + +namespace UnityEngine +{ + Physics::Physics(std::nullptr_t n) + : System::Object(nullptr) + { + } + + Physics::Physics(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Physics::Physics(const Physics& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Physics::Physics(Physics&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Physics::~Physics() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Physics& Physics::operator=(const Physics& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Physics& Physics::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Physics& Physics::operator=(Physics&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Physics::operator==(const Physics& other) const + { + return Handle == other.Handle; + } + + bool Physics::operator!=(const Physics& other) const + { + return Handle != other.Handle; + } + + int32_t Physics::RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1 results) + { + auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit(ray, results.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + System::Array1 Physics::RaycastAll(UnityEngine::Ray& ray) + { + auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ray); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Array1(Plugin::InternalUse::Only, returnValue); + } +} + +namespace UnityEngine +{ + Color::Color() + { + } +} + +namespace UnityEngine +{ + GradientColorKey::GradientColorKey() + { + } +} + +namespace UnityEngine +{ + Gradient::Gradient(std::nullptr_t n) + : System::Object(nullptr) + { + } + + Gradient::Gradient(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Gradient::Gradient(const Gradient& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Gradient::Gradient(Gradient&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Gradient::~Gradient() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Gradient& Gradient::operator=(const Gradient& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Gradient& Gradient::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Gradient& Gradient::operator=(Gradient&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Gradient::operator==(const Gradient& other) const + { + return Handle == other.Handle; + } + + bool Gradient::operator!=(const Gradient& other) const + { + return Handle != other.Handle; + } + + Gradient::Gradient() + : System::Object(nullptr) + { + auto returnValue = Plugin::UnityEngineGradientConstructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + System::Array1 Gradient::GetColorKeys() + { + auto returnValue = Plugin::UnityEngineGradientPropertyGetColorKeys(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Array1(Plugin::InternalUse::Only, returnValue); + } + + void Gradient::SetColorKeys(System::Array1 value) + { + Plugin::UnityEngineGradientPropertySetColorKeys(Handle, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace MyGame +{ + namespace MonoBehaviours + { + TestScript::TestScript(std::nullptr_t n) + : UnityEngine::MonoBehaviour(nullptr) + { + } + + TestScript::TestScript(Plugin::InternalUse iu, int32_t handle) + : UnityEngine::MonoBehaviour(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + TestScript::TestScript(const TestScript& other) + : UnityEngine::MonoBehaviour(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + TestScript::TestScript(TestScript&& other) + : UnityEngine::MonoBehaviour(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + TestScript::~TestScript() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + TestScript& TestScript::operator=(const TestScript& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + TestScript& TestScript::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + TestScript& TestScript::operator=(TestScript&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool TestScript::operator==(const TestScript& other) const + { + return Handle == other.Handle; + } + + bool TestScript::operator!=(const TestScript& other) const + { + return Handle != other.Handle; + } + } +} + +namespace System +{ + Array1::Array1(std::nullptr_t n) + : System::Array(nullptr) + { + } + + Array1::Array1(Plugin::InternalUse iu, int32_t handle) + : System::Array(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Array1::Array1(const Array1& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Array1::Array1(Array1&& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Array1::~Array1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Array1& Array1::operator=(const Array1& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Array1& Array1::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Array1& Array1::operator=(Array1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Array1::operator==(const Array1& other) const + { + return Handle == other.Handle; + } + + bool Array1::operator!=(const Array1& other) const + { + return Handle != other.Handle; + } + + Array1::Array1(int32_t length0) + : System::Array(nullptr) + { + auto returnValue = Plugin::SystemInt32Array1Constructor1(length0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + int32_t Array1::GetLength() + { + return Array::GetLength(); + } + + int32_t Array1::GetRank() + { + return Array::GetRank(); + } + + int32_t Array1::GetItem(int32_t index0) + { + auto returnValue = Plugin::SystemInt32Array1GetItem1(Handle, index0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + void Array1::SetItem(int32_t index0, int32_t item) + { + Plugin::SystemInt32Array1SetItem1(Handle, index0, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace System +{ + Array1::Array1(std::nullptr_t n) + : System::Array(nullptr) + { + } + + Array1::Array1(Plugin::InternalUse iu, int32_t handle) + : System::Array(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Array1::Array1(const Array1& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Array1::Array1(Array1&& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Array1::~Array1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Array1& Array1::operator=(const Array1& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Array1& Array1::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Array1& Array1::operator=(Array1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Array1::operator==(const Array1& other) const + { + return Handle == other.Handle; + } + + bool Array1::operator!=(const Array1& other) const + { + return Handle != other.Handle; + } + + Array1::Array1(int32_t length0) + : System::Array(nullptr) + { + auto returnValue = Plugin::SystemSingleArray1Constructor1(length0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + int32_t Array1::GetLength() + { + return Array::GetLength(); + } + + int32_t Array1::GetRank() + { + return Array::GetRank(); + } + + float Array1::GetItem(int32_t index0) + { + auto returnValue = Plugin::SystemSingleArray1GetItem1(Handle, index0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + void Array1::SetItem(int32_t index0, float item) + { + Plugin::SystemSingleArray1SetItem1(Handle, index0, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace System +{ + Array2::Array2(std::nullptr_t n) + : System::Array(nullptr) + { + } + + Array2::Array2(Plugin::InternalUse iu, int32_t handle) + : System::Array(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Array2::Array2(const Array2& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Array2::Array2(Array2&& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Array2::~Array2() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Array2& Array2::operator=(const Array2& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Array2& Array2::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Array2& Array2::operator=(Array2&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Array2::operator==(const Array2& other) const + { + return Handle == other.Handle; + } + + bool Array2::operator!=(const Array2& other) const + { + return Handle != other.Handle; + } + + Array2::Array2(int32_t length0, int32_t length1) + : System::Array(nullptr) + { + auto returnValue = Plugin::SystemSingleArray2Constructor2(length0, length1); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + int32_t Array2::GetLength() + { + return Array::GetLength(); + } + + int32_t Array2::GetLength(int32_t dimension) + { + auto returnValue = Plugin::SystemSingleArray2GetLength2(Handle, dimension); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + int32_t Array2::GetRank() + { + return Array::GetRank(); + } + + float Array2::GetItem(int32_t index0, int32_t index1) + { + auto returnValue = Plugin::SystemSingleArray2GetItem2(Handle, index0, index1); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + void Array2::SetItem(int32_t index0, int32_t index1, float item) + { + Plugin::SystemSingleArray2SetItem2(Handle, index0, index1, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace System +{ + Array3::Array3(std::nullptr_t n) + : System::Array(nullptr) + { + } + + Array3::Array3(Plugin::InternalUse iu, int32_t handle) + : System::Array(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Array3::Array3(const Array3& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Array3::Array3(Array3&& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Array3::~Array3() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Array3& Array3::operator=(const Array3& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Array3& Array3::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Array3& Array3::operator=(Array3&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Array3::operator==(const Array3& other) const + { + return Handle == other.Handle; + } + + bool Array3::operator!=(const Array3& other) const + { + return Handle != other.Handle; + } + + Array3::Array3(int32_t length0, int32_t length1, int32_t length2) + : System::Array(nullptr) + { + auto returnValue = Plugin::SystemSingleArray3Constructor3(length0, length1, length2); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + int32_t Array3::GetLength() + { + return Array::GetLength(); + } + + int32_t Array3::GetLength(int32_t dimension) + { + auto returnValue = Plugin::SystemSingleArray3GetLength3(Handle, dimension); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + int32_t Array3::GetRank() + { + return Array::GetRank(); + } + + float Array3::GetItem(int32_t index0, int32_t index1, int32_t index2) + { + auto returnValue = Plugin::SystemSingleArray3GetItem3(Handle, index0, index1, index2); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + void Array3::SetItem(int32_t index0, int32_t index1, int32_t index2, float item) + { + Plugin::SystemSingleArray3SetItem3(Handle, index0, index1, index2, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace System +{ + Array1::Array1(std::nullptr_t n) + : System::Array(nullptr) + { + } + + Array1::Array1(Plugin::InternalUse iu, int32_t handle) + : System::Array(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Array1::Array1(const Array1& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Array1::Array1(Array1&& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Array1::~Array1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Array1& Array1::operator=(const Array1& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Array1& Array1::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Array1& Array1::operator=(Array1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Array1::operator==(const Array1& other) const + { + return Handle == other.Handle; + } + + bool Array1::operator!=(const Array1& other) const + { + return Handle != other.Handle; + } + + Array1::Array1(int32_t length0) + : System::Array(nullptr) + { + auto returnValue = Plugin::SystemStringArray1Constructor1(length0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + int32_t Array1::GetLength() + { + return Array::GetLength(); + } + + int32_t Array1::GetRank() + { + return Array::GetRank(); + } + + System::String Array1::GetItem(int32_t index0) + { + auto returnValue = Plugin::SystemStringArray1GetItem1(Handle, index0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::String(Plugin::InternalUse::Only, returnValue); + } + + void Array1::SetItem(int32_t index0, System::String item) + { + Plugin::SystemStringArray1SetItem1(Handle, index0, item.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace System +{ + Array1::Array1(std::nullptr_t n) + : System::Array(nullptr) + { + } + + Array1::Array1(Plugin::InternalUse iu, int32_t handle) + : System::Array(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Array1::Array1(const Array1& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Array1::Array1(Array1&& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Array1::~Array1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Array1& Array1::operator=(const Array1& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Array1& Array1::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Array1& Array1::operator=(Array1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Array1::operator==(const Array1& other) const + { + return Handle == other.Handle; + } + + bool Array1::operator!=(const Array1& other) const + { + return Handle != other.Handle; + } + + Array1::Array1(int32_t length0) + : System::Array(nullptr) + { + auto returnValue = Plugin::UnityEngineResolutionArray1Constructor1(length0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + int32_t Array1::GetLength() + { + return Array::GetLength(); + } + + int32_t Array1::GetRank() + { + return Array::GetRank(); + } + + UnityEngine::Resolution Array1::GetItem(int32_t index0) + { + auto returnValue = Plugin::UnityEngineResolutionArray1GetItem1(Handle, index0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + void Array1::SetItem(int32_t index0, UnityEngine::Resolution& item) + { + Plugin::UnityEngineResolutionArray1SetItem1(Handle, index0, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace System +{ + Array1::Array1(std::nullptr_t n) + : System::Array(nullptr) + { + } + + Array1::Array1(Plugin::InternalUse iu, int32_t handle) + : System::Array(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Array1::Array1(const Array1& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Array1::Array1(Array1&& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Array1::~Array1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Array1& Array1::operator=(const Array1& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Array1& Array1::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Array1& Array1::operator=(Array1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Array1::operator==(const Array1& other) const + { + return Handle == other.Handle; + } + + bool Array1::operator!=(const Array1& other) const + { + return Handle != other.Handle; + } + + Array1::Array1(int32_t length0) + : System::Array(nullptr) + { + auto returnValue = Plugin::UnityEngineRaycastHitArray1Constructor1(length0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + int32_t Array1::GetLength() + { + return Array::GetLength(); + } + + int32_t Array1::GetRank() + { + return Array::GetRank(); + } + + UnityEngine::RaycastHit Array1::GetItem(int32_t index0) + { + auto returnValue = Plugin::UnityEngineRaycastHitArray1GetItem1(Handle, index0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::RaycastHit(Plugin::InternalUse::Only, returnValue); + } + + void Array1::SetItem(int32_t index0, UnityEngine::RaycastHit item) + { + Plugin::UnityEngineRaycastHitArray1SetItem1(Handle, index0, item.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace System +{ + Array1::Array1(std::nullptr_t n) + : System::Array(nullptr) + { + } + + Array1::Array1(Plugin::InternalUse iu, int32_t handle) + : System::Array(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Array1::Array1(const Array1& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Array1::Array1(Array1&& other) + : System::Array(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Array1::~Array1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Array1& Array1::operator=(const Array1& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Array1& Array1::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Array1& Array1::operator=(Array1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Array1::operator==(const Array1& other) const + { + return Handle == other.Handle; + } + + bool Array1::operator!=(const Array1& other) const + { + return Handle != other.Handle; + } + + Array1::Array1(int32_t length0) + : System::Array(nullptr) + { + auto returnValue = Plugin::UnityEngineGradientColorKeyArray1Constructor1(length0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + int32_t Array1::GetLength() + { + return Array::GetLength(); + } + + int32_t Array1::GetRank() + { + return Array::GetRank(); + } + + UnityEngine::GradientColorKey Array1::GetItem(int32_t index0) + { + auto returnValue = Plugin::UnityEngineGradientColorKeyArray1GetItem1(Handle, index0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + void Array1::SetItem(int32_t index0, UnityEngine::GradientColorKey& item) + { + Plugin::UnityEngineGradientColorKeyArray1SetItem1(Handle, index0, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } } } @@ -3018,6 +4705,8 @@ DLLEXPORT void Init( void (*releaseObject)(int32_t handle), int32_t (*stringNew)(const char* chars), void (*setException)(int32_t handle), + int32_t (*arrayGetLength)(int32_t handle), + int32_t (*arrayGetRank)(int32_t handle), /*BEGIN INIT PARAMS*/ int32_t (*systemDiagnosticsStopwatchConstructor)(), int64_t (*systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle), @@ -3069,7 +4758,46 @@ DLLEXPORT void Init( int32_t (*systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString)(int32_t valueHandle), int32_t (*systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)(int32_t thisHandle), void (*systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)(int32_t thisHandle, int32_t valueHandle), - int32_t (*systemExceptionConstructorSystemString)(int32_t messageHandle) + int32_t (*systemExceptionConstructorSystemString)(int32_t messageHandle), + int32_t (*unityEngineResolutionPropertyGetWidth)(UnityEngine::Resolution* thiz), + void (*unityEngineResolutionPropertySetWidth)(UnityEngine::Resolution* thiz, int32_t value), + int32_t (*unityEngineResolutionPropertyGetHeight)(UnityEngine::Resolution* thiz), + void (*unityEngineResolutionPropertySetHeight)(UnityEngine::Resolution* thiz, int32_t value), + int32_t (*unityEngineResolutionPropertyGetRefreshRate)(UnityEngine::Resolution* thiz), + void (*unityEngineResolutionPropertySetRefreshRate)(UnityEngine::Resolution* thiz, int32_t value), + int32_t (*unityEngineScreenPropertyGetResolutions)(), + UnityEngine::Ray (*unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction), + int32_t (*unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)(UnityEngine::Ray& ray, int32_t resultsHandle), + int32_t (*unityEnginePhysicsMethodRaycastAllUnityEngineRay)(UnityEngine::Ray& ray), + int32_t (*unityEngineGradientConstructor)(), + int32_t (*unityEngineGradientPropertyGetColorKeys)(int32_t thisHandle), + void (*unityEngineGradientPropertySetColorKeys)(int32_t thisHandle, int32_t valueHandle), + int32_t (*systemInt32Array1Constructor1)(int32_t length0), + int32_t (*systemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0), + int32_t (*systemInt32Array1SetItem1)(int32_t thisHandle, int32_t index0, int32_t item), + int32_t (*systemSingleArray1Constructor1)(int32_t length0), + float (*systemSingleArray1GetItem1)(int32_t thisHandle, int32_t index0), + int32_t (*systemSingleArray1SetItem1)(int32_t thisHandle, int32_t index0, float item), + int32_t (*systemSingleArray2Constructor2)(int32_t length0, int32_t length1), + int32_t (*systemSingleArray2GetLength2)(int32_t thisHandle, int32_t dimension), + float (*systemSingleArray2GetItem2)(int32_t thisHandle, int32_t index0, int32_t index1), + int32_t (*systemSingleArray2SetItem2)(int32_t thisHandle, int32_t index0, int32_t index1, float item), + int32_t (*systemSingleArray3Constructor3)(int32_t length0, int32_t length1, int32_t length2), + int32_t (*systemSingleArray3GetLength3)(int32_t thisHandle, int32_t dimension), + float (*systemSingleArray3GetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2), + int32_t (*systemSingleArray3SetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2, float item), + int32_t (*systemStringArray1Constructor1)(int32_t length0), + int32_t (*systemStringArray1GetItem1)(int32_t thisHandle, int32_t index0), + int32_t (*systemStringArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), + int32_t (*unityEngineResolutionArray1Constructor1)(int32_t length0), + UnityEngine::Resolution (*unityEngineResolutionArray1GetItem1)(int32_t thisHandle, int32_t index0), + int32_t (*unityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::Resolution& item), + int32_t (*unityEngineRaycastHitArray1Constructor1)(int32_t length0), + int32_t (*unityEngineRaycastHitArray1GetItem1)(int32_t thisHandle, int32_t index0), + int32_t (*unityEngineRaycastHitArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), + int32_t (*unityEngineGradientColorKeyArray1Constructor1)(int32_t length0), + UnityEngine::GradientColorKey (*unityEngineGradientColorKeyArray1GetItem1)(int32_t thisHandle, int32_t index0), + int32_t (*unityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item) /*END INIT PARAMS*/) { using namespace Plugin; @@ -3082,6 +4810,8 @@ DLLEXPORT void Init( Plugin::StringNew = stringNew; Plugin::ReleaseObject = releaseObject; Plugin::SetException = setException; + Plugin::ArrayGetLength = arrayGetLength; + Plugin::ArrayGetRank = arrayGetRank; /*BEGIN INIT BODY*/ Plugin::SystemDiagnosticsStopwatchConstructor = systemDiagnosticsStopwatchConstructor; Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds = systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds; @@ -3136,6 +4866,45 @@ DLLEXPORT void Init( Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue; Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue; Plugin::SystemExceptionConstructorSystemString = systemExceptionConstructorSystemString; + Plugin::UnityEngineResolutionPropertyGetWidth = unityEngineResolutionPropertyGetWidth; + Plugin::UnityEngineResolutionPropertySetWidth = unityEngineResolutionPropertySetWidth; + Plugin::UnityEngineResolutionPropertyGetHeight = unityEngineResolutionPropertyGetHeight; + Plugin::UnityEngineResolutionPropertySetHeight = unityEngineResolutionPropertySetHeight; + Plugin::UnityEngineResolutionPropertyGetRefreshRate = unityEngineResolutionPropertyGetRefreshRate; + Plugin::UnityEngineResolutionPropertySetRefreshRate = unityEngineResolutionPropertySetRefreshRate; + Plugin::UnityEngineScreenPropertyGetResolutions = unityEngineScreenPropertyGetResolutions; + Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3 = unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3; + Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit = unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit; + Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay = unityEnginePhysicsMethodRaycastAllUnityEngineRay; + Plugin::UnityEngineGradientConstructor = unityEngineGradientConstructor; + Plugin::UnityEngineGradientPropertyGetColorKeys = unityEngineGradientPropertyGetColorKeys; + Plugin::UnityEngineGradientPropertySetColorKeys = unityEngineGradientPropertySetColorKeys; + Plugin::SystemInt32Array1Constructor1 = systemInt32Array1Constructor1; + Plugin::SystemInt32Array1GetItem1 = systemInt32Array1GetItem1; + Plugin::SystemInt32Array1SetItem1 = systemInt32Array1SetItem1; + Plugin::SystemSingleArray1Constructor1 = systemSingleArray1Constructor1; + Plugin::SystemSingleArray1GetItem1 = systemSingleArray1GetItem1; + Plugin::SystemSingleArray1SetItem1 = systemSingleArray1SetItem1; + Plugin::SystemSingleArray2Constructor2 = systemSingleArray2Constructor2; + Plugin::SystemSingleArray2GetLength2 = systemSingleArray2GetLength2; + Plugin::SystemSingleArray2GetItem2 = systemSingleArray2GetItem2; + Plugin::SystemSingleArray2SetItem2 = systemSingleArray2SetItem2; + Plugin::SystemSingleArray3Constructor3 = systemSingleArray3Constructor3; + Plugin::SystemSingleArray3GetLength3 = systemSingleArray3GetLength3; + Plugin::SystemSingleArray3GetItem3 = systemSingleArray3GetItem3; + Plugin::SystemSingleArray3SetItem3 = systemSingleArray3SetItem3; + Plugin::SystemStringArray1Constructor1 = systemStringArray1Constructor1; + Plugin::SystemStringArray1GetItem1 = systemStringArray1GetItem1; + Plugin::SystemStringArray1SetItem1 = systemStringArray1SetItem1; + Plugin::UnityEngineResolutionArray1Constructor1 = unityEngineResolutionArray1Constructor1; + Plugin::UnityEngineResolutionArray1GetItem1 = unityEngineResolutionArray1GetItem1; + Plugin::UnityEngineResolutionArray1SetItem1 = unityEngineResolutionArray1SetItem1; + Plugin::UnityEngineRaycastHitArray1Constructor1 = unityEngineRaycastHitArray1Constructor1; + Plugin::UnityEngineRaycastHitArray1GetItem1 = unityEngineRaycastHitArray1GetItem1; + Plugin::UnityEngineRaycastHitArray1SetItem1 = unityEngineRaycastHitArray1SetItem1; + Plugin::UnityEngineGradientColorKeyArray1Constructor1 = unityEngineGradientColorKeyArray1Constructor1; + Plugin::UnityEngineGradientColorKeyArray1GetItem1 = unityEngineGradientColorKeyArray1GetItem1; + Plugin::UnityEngineGradientColorKeyArray1SetItem1 = unityEngineGradientColorKeyArray1SetItem1; /*END INIT BODY*/ try diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 63679b4..1aa7d46 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -161,8 +161,9 @@ namespace System virtual void ThrowReferenceToThis(); }; - struct ValueType : Object + struct ValueType { + int32_t Handle; ValueType(Plugin::InternalUse iu, int32_t handle); ValueType(std::nullptr_t n); }; @@ -179,6 +180,20 @@ namespace System String& operator=(String&& other); String(const char* chars); }; + + struct Array : Object + { + Array(Plugin::InternalUse iu, int32_t handle); + Array(std::nullptr_t n); + int32_t GetLength(); + int32_t GetRank(); + }; + + template struct Array1; + template struct Array2; + template struct Array3; + template struct Array4; + template struct Array5; } /*BEGIN TYPE DECLARATIONS*/ @@ -425,6 +440,41 @@ namespace System struct NullReferenceException; } +namespace UnityEngine +{ + struct Resolution; +} + +namespace UnityEngine +{ + struct Screen; +} + +namespace UnityEngine +{ + struct Ray; +} + +namespace UnityEngine +{ + struct Physics; +} + +namespace UnityEngine +{ + struct Color; +} + +namespace UnityEngine +{ + struct GradientColorKey; +} + +namespace UnityEngine +{ + struct Gradient; +} + namespace MyGame { namespace MonoBehaviours @@ -432,6 +482,46 @@ namespace MyGame struct TestScript; } } + +namespace System +{ + template<> struct Array1; +} + +namespace System +{ + template<> struct Array1; +} + +namespace System +{ + template<> struct Array2; +} + +namespace System +{ + template<> struct Array3; +} + +namespace System +{ + template<> struct Array1; +} + +namespace System +{ + template<> struct Array1; +} + +namespace System +{ + template<> struct Array1; +} + +namespace System +{ + template<> struct Array1; +} /*END TYPE DECLARATIONS*/ /*BEGIN TYPE DEFINITIONS*/ @@ -926,6 +1016,113 @@ namespace System }; } +namespace UnityEngine +{ + struct Resolution + { + Resolution(); + int32_t GetWidth(); + void SetWidth(int32_t value); + int32_t GetHeight(); + void SetHeight(int32_t value); + int32_t GetRefreshRate(); + void SetRefreshRate(int32_t value); + int32_t m_Width; + int32_t m_Height; + int32_t m_RefreshRate; + }; +} + +namespace UnityEngine +{ + struct Screen : System::Object + { + Screen(std::nullptr_t n); + Screen(Plugin::InternalUse iu, int32_t handle); + Screen(const Screen& other); + Screen(Screen&& other); + virtual ~Screen(); + Screen& operator=(const Screen& other); + Screen& operator=(std::nullptr_t other); + Screen& operator=(Screen&& other); + bool operator==(const Screen& other) const; + bool operator!=(const Screen& other) const; + static System::Array1 GetResolutions(); + }; +} + +namespace UnityEngine +{ + struct Ray + { + Ray(); + Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); + UnityEngine::Vector3 m_Origin; + UnityEngine::Vector3 m_Direction; + }; +} + +namespace UnityEngine +{ + struct Physics : System::Object + { + Physics(std::nullptr_t n); + Physics(Plugin::InternalUse iu, int32_t handle); + Physics(const Physics& other); + Physics(Physics&& other); + virtual ~Physics(); + Physics& operator=(const Physics& other); + Physics& operator=(std::nullptr_t other); + Physics& operator=(Physics&& other); + bool operator==(const Physics& other) const; + bool operator!=(const Physics& other) const; + static int32_t RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1 results); + static System::Array1 RaycastAll(UnityEngine::Ray& ray); + }; +} + +namespace UnityEngine +{ + struct Color + { + Color(); + float r; + float g; + float b; + float a; + }; +} + +namespace UnityEngine +{ + struct GradientColorKey + { + GradientColorKey(); + UnityEngine::Color color; + float time; + }; +} + +namespace UnityEngine +{ + struct Gradient : System::Object + { + Gradient(std::nullptr_t n); + Gradient(Plugin::InternalUse iu, int32_t handle); + Gradient(const Gradient& other); + Gradient(Gradient&& other); + virtual ~Gradient(); + Gradient& operator=(const Gradient& other); + Gradient& operator=(std::nullptr_t other); + Gradient& operator=(Gradient&& other); + bool operator==(const Gradient& other) const; + bool operator!=(const Gradient& other) const; + Gradient(); + System::Array1 GetColorKeys(); + void SetColorKeys(System::Array1 value); + }; +} + namespace MyGame { namespace MonoBehaviours @@ -949,4 +1146,182 @@ namespace MyGame }; } } + +namespace System +{ + template<> struct Array1 : System::Array + { + Array1(std::nullptr_t n); + Array1(Plugin::InternalUse iu, int32_t handle); + Array1(const Array1& other); + Array1(Array1&& other); + virtual ~Array1(); + Array1& operator=(const Array1& other); + Array1& operator=(std::nullptr_t other); + Array1& operator=(Array1&& other); + bool operator==(const Array1& other) const; + bool operator!=(const Array1& other) const; + Array1(int32_t length0); + int32_t GetLength(); + int32_t GetRank(); + int32_t GetItem(int32_t index0); + void SetItem(int32_t index0, int32_t item); + }; +} + +namespace System +{ + template<> struct Array1 : System::Array + { + Array1(std::nullptr_t n); + Array1(Plugin::InternalUse iu, int32_t handle); + Array1(const Array1& other); + Array1(Array1&& other); + virtual ~Array1(); + Array1& operator=(const Array1& other); + Array1& operator=(std::nullptr_t other); + Array1& operator=(Array1&& other); + bool operator==(const Array1& other) const; + bool operator!=(const Array1& other) const; + Array1(int32_t length0); + int32_t GetLength(); + int32_t GetRank(); + float GetItem(int32_t index0); + void SetItem(int32_t index0, float item); + }; +} + +namespace System +{ + template<> struct Array2 : System::Array + { + Array2(std::nullptr_t n); + Array2(Plugin::InternalUse iu, int32_t handle); + Array2(const Array2& other); + Array2(Array2&& other); + virtual ~Array2(); + Array2& operator=(const Array2& other); + Array2& operator=(std::nullptr_t other); + Array2& operator=(Array2&& other); + bool operator==(const Array2& other) const; + bool operator!=(const Array2& other) const; + Array2(int32_t length0, int32_t length1); + int32_t GetLength(); + int32_t GetLength(int32_t dimension); + int32_t GetRank(); + float GetItem(int32_t index0, int32_t index1); + void SetItem(int32_t index0, int32_t index1, float item); + }; +} + +namespace System +{ + template<> struct Array3 : System::Array + { + Array3(std::nullptr_t n); + Array3(Plugin::InternalUse iu, int32_t handle); + Array3(const Array3& other); + Array3(Array3&& other); + virtual ~Array3(); + Array3& operator=(const Array3& other); + Array3& operator=(std::nullptr_t other); + Array3& operator=(Array3&& other); + bool operator==(const Array3& other) const; + bool operator!=(const Array3& other) const; + Array3(int32_t length0, int32_t length1, int32_t length2); + int32_t GetLength(); + int32_t GetLength(int32_t dimension); + int32_t GetRank(); + float GetItem(int32_t index0, int32_t index1, int32_t index2); + void SetItem(int32_t index0, int32_t index1, int32_t index2, float item); + }; +} + +namespace System +{ + template<> struct Array1 : System::Array + { + Array1(std::nullptr_t n); + Array1(Plugin::InternalUse iu, int32_t handle); + Array1(const Array1& other); + Array1(Array1&& other); + virtual ~Array1(); + Array1& operator=(const Array1& other); + Array1& operator=(std::nullptr_t other); + Array1& operator=(Array1&& other); + bool operator==(const Array1& other) const; + bool operator!=(const Array1& other) const; + Array1(int32_t length0); + int32_t GetLength(); + int32_t GetRank(); + System::String GetItem(int32_t index0); + void SetItem(int32_t index0, System::String item); + }; +} + +namespace System +{ + template<> struct Array1 : System::Array + { + Array1(std::nullptr_t n); + Array1(Plugin::InternalUse iu, int32_t handle); + Array1(const Array1& other); + Array1(Array1&& other); + virtual ~Array1(); + Array1& operator=(const Array1& other); + Array1& operator=(std::nullptr_t other); + Array1& operator=(Array1&& other); + bool operator==(const Array1& other) const; + bool operator!=(const Array1& other) const; + Array1(int32_t length0); + int32_t GetLength(); + int32_t GetRank(); + UnityEngine::Resolution GetItem(int32_t index0); + void SetItem(int32_t index0, UnityEngine::Resolution& item); + }; +} + +namespace System +{ + template<> struct Array1 : System::Array + { + Array1(std::nullptr_t n); + Array1(Plugin::InternalUse iu, int32_t handle); + Array1(const Array1& other); + Array1(Array1&& other); + virtual ~Array1(); + Array1& operator=(const Array1& other); + Array1& operator=(std::nullptr_t other); + Array1& operator=(Array1&& other); + bool operator==(const Array1& other) const; + bool operator!=(const Array1& other) const; + Array1(int32_t length0); + int32_t GetLength(); + int32_t GetRank(); + UnityEngine::RaycastHit GetItem(int32_t index0); + void SetItem(int32_t index0, UnityEngine::RaycastHit item); + }; +} + +namespace System +{ + template<> struct Array1 : System::Array + { + Array1(std::nullptr_t n); + Array1(Plugin::InternalUse iu, int32_t handle); + Array1(const Array1& other); + Array1(Array1&& other); + virtual ~Array1(); + Array1& operator=(const Array1& other); + Array1& operator=(std::nullptr_t other); + Array1& operator=(Array1&& other); + bool operator==(const Array1& other) const; + bool operator!=(const Array1& other) const; + Array1(int32_t length0); + int32_t GetLength(); + int32_t GetRank(); + UnityEngine::GradientColorKey GetItem(int32_t index0); + void SetItem(int32_t index0, UnityEngine::GradientColorKey& item); + }; +} /*END TYPE DEFINITIONS*/ From 36c601fd9d73cde7d269d61e49bea7026ccdd51a Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Wed, 11 Oct 2017 08:59:03 -0700 Subject: [PATCH 22/95] Support the last MonoBehaviour message: OnAudioFilterRead --- README.md | 2 +- Unity/Assets/NativeScript/Bindings.cs | 24 +++++++++---------- .../NativeScript/Editor/GenerateBindings.cs | 21 +++++++++++----- Unity/CppSource/NativeScript/Bindings.cpp | 16 ++++++------- Unity/CppSource/NativeScript/Bindings.h | 10 ++++---- 5 files changed, 41 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index ade0a69..39691c8 100644 --- a/README.md +++ b/README.md @@ -179,7 +179,7 @@ The code generator supports: * Methods (including generic parameters and return types) * Fields (including generic types) * Properties (getters and setters) (including generic types) -* `MonoBehaviour` classes with "message" functions like `Update` (except `OnAudioFilterRead`) +* `MonoBehaviour` classes with "message" functions like `Update` * `out` and `ref` parameters * Enumerations * Exceptions diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 70ca699..486fd42 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -2267,7 +2267,7 @@ static int SystemInt32Array1GetItem1(int thisHandle, int index0) { try { - var thiz = (System.Int32[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (int[])NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz[index0]; return returnValue; } @@ -2290,7 +2290,7 @@ static void SystemInt32Array1SetItem1(int thisHandle, int index0, int item) { try { - var thiz = (System.Int32[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (int[])NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz[index0] = item; } catch (System.NullReferenceException ex) @@ -2332,7 +2332,7 @@ static float SystemSingleArray1GetItem1(int thisHandle, int index0) { try { - var thiz = (System.Single[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (float[])NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz[index0]; return returnValue; } @@ -2355,7 +2355,7 @@ static void SystemSingleArray1SetItem1(int thisHandle, int index0, float item) { try { - var thiz = (System.Single[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (float[])NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz[index0] = item; } catch (System.NullReferenceException ex) @@ -2397,7 +2397,7 @@ static int SystemSingleArray2GetLength2(int thisHandle, int dimension) { try { - var thiz = (System.Single[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (float[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz.GetLength(dimension); return returnValue; } @@ -2420,7 +2420,7 @@ static float SystemSingleArray2GetItem2(int thisHandle, int index0, int index1) { try { - var thiz = (System.Single[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (float[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz[index0, index1]; return returnValue; } @@ -2443,7 +2443,7 @@ static void SystemSingleArray2SetItem2(int thisHandle, int index0, int index1, f { try { - var thiz = (System.Single[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (float[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz[index0, index1] = item; } catch (System.NullReferenceException ex) @@ -2485,7 +2485,7 @@ static int SystemSingleArray3GetLength3(int thisHandle, int dimension) { try { - var thiz = (System.Single[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (float[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz.GetLength(dimension); return returnValue; } @@ -2508,7 +2508,7 @@ static float SystemSingleArray3GetItem3(int thisHandle, int index0, int index1, { try { - var thiz = (System.Single[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (float[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz[index0, index1, index2]; return returnValue; } @@ -2531,7 +2531,7 @@ static void SystemSingleArray3SetItem3(int thisHandle, int index0, int index1, i { try { - var thiz = (System.Single[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (float[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz[index0, index1, index2] = item; } catch (System.NullReferenceException ex) @@ -2573,7 +2573,7 @@ static int SystemStringArray1GetItem1(int thisHandle, int index0) { try { - var thiz = (System.String[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (string[])NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz[index0]; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } @@ -2596,7 +2596,7 @@ static void SystemStringArray1SetItem1(int thisHandle, int index0, int itemHandl { try { - var thiz = (System.String[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (string[])NativeScript.Bindings.ObjectStore.Get(thisHandle); var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); thiz[index0] = item; } diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 28f163a..4d7b1ec 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -235,8 +235,7 @@ public MessageInfo( new MessageInfo("OnApplicationFocus", typeof(bool)), new MessageInfo("OnApplicationPause", typeof(bool)), new MessageInfo("OnApplicationQuit"), - // TODO re-enable when arrays are supported - // new MessageInfo("OnAudioFilterRead", typeof(float[]), typeof(int)), + new MessageInfo("OnAudioFilterRead", typeof(float[]), typeof(int)), new MessageInfo("OnBecameInvisible"), new MessageInfo("OnBecameVisible"), new MessageInfo("OnCollisionEnter", typeof(Collision)), @@ -6718,6 +6717,15 @@ static void AppendCsharpTypeName( { output.Append("string"); } + else if (type.IsArray) + { + AppendCsharpTypeName( + type.GetElementType(), + output); + output.Append('['); + output.Append(',', type.GetArrayRank()-1); + output.Append(']'); + } else { output.Append(type.Namespace); @@ -6794,14 +6802,15 @@ static void AppendCppTypeName( } else if (type.IsArray) { + int rank = type.GetArrayRank(); output.Append("System::Array"); - output.Append(type.GetArrayRank()); + output.Append(rank); output.Append('<'); - int rank = type.GetArrayRank(); + Type elementType = type.GetElementType(); for (int i = 0; i < rank; ++i) { - AppendTypeNameWithoutSuffixes( - type.Name, + AppendCppTypeName( + elementType, output); if (i != rank -1) { diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 2af3465..81ce27e 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -3116,7 +3116,7 @@ namespace UnityEngine return Handle != other.Handle; } - System::Array1 Screen::GetResolutions() + System::Array1 Screen::GetResolutions() { auto returnValue = Plugin::UnityEngineScreenPropertyGetResolutions(); if (Plugin::unhandledCsharpException) @@ -3126,7 +3126,7 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return System::Array1(Plugin::InternalUse::Only, returnValue); + return System::Array1(Plugin::InternalUse::Only, returnValue); } } @@ -3238,7 +3238,7 @@ namespace UnityEngine return Handle != other.Handle; } - int32_t Physics::RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1 results) + int32_t Physics::RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1 results) { auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit(ray, results.Handle); if (Plugin::unhandledCsharpException) @@ -3251,7 +3251,7 @@ namespace UnityEngine return returnValue; } - System::Array1 Physics::RaycastAll(UnityEngine::Ray& ray) + System::Array1 Physics::RaycastAll(UnityEngine::Ray& ray) { auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ray); if (Plugin::unhandledCsharpException) @@ -3261,7 +3261,7 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return System::Array1(Plugin::InternalUse::Only, returnValue); + return System::Array1(Plugin::InternalUse::Only, returnValue); } } @@ -3385,7 +3385,7 @@ namespace UnityEngine } } - System::Array1 Gradient::GetColorKeys() + System::Array1 Gradient::GetColorKeys() { auto returnValue = Plugin::UnityEngineGradientPropertyGetColorKeys(Handle); if (Plugin::unhandledCsharpException) @@ -3395,10 +3395,10 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return System::Array1(Plugin::InternalUse::Only, returnValue); + return System::Array1(Plugin::InternalUse::Only, returnValue); } - void Gradient::SetColorKeys(System::Array1 value) + void Gradient::SetColorKeys(System::Array1 value) { Plugin::UnityEngineGradientPropertySetColorKeys(Handle, value.Handle); if (Plugin::unhandledCsharpException) diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 1aa7d46..7733c13 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -1047,7 +1047,7 @@ namespace UnityEngine Screen& operator=(Screen&& other); bool operator==(const Screen& other) const; bool operator!=(const Screen& other) const; - static System::Array1 GetResolutions(); + static System::Array1 GetResolutions(); }; } @@ -1076,8 +1076,8 @@ namespace UnityEngine Physics& operator=(Physics&& other); bool operator==(const Physics& other) const; bool operator!=(const Physics& other) const; - static int32_t RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1 results); - static System::Array1 RaycastAll(UnityEngine::Ray& ray); + static int32_t RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1 results); + static System::Array1 RaycastAll(UnityEngine::Ray& ray); }; } @@ -1118,8 +1118,8 @@ namespace UnityEngine bool operator==(const Gradient& other) const; bool operator!=(const Gradient& other) const; Gradient(); - System::Array1 GetColorKeys(); - void SetColorKeys(System::Array1 value); + System::Array1 GetColorKeys(); + void SetColorKeys(System::Array1 value); }; } From 94280fb9644282d3173bd1004ccd9ab430c1475e Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 14 Oct 2017 21:34:30 -0700 Subject: [PATCH 23/95] Support delegates and Unity 2017.2. --- Unity/Assets/NativeScript/Bindings.cs | 822 ++++++- .../NativeScript/Editor/GenerateBindings.cs | 2097 ++++++++++++++--- Unity/Assets/NativeScriptTypes.json | 48 + Unity/CppSource/Game/Game.cpp | 71 +- Unity/CppSource/NativeScript/Bindings.cpp | 1079 ++++++++- Unity/CppSource/NativeScript/Bindings.h | 165 ++ Unity/ProjectSettings/DynamicsManager.asset | 1 + Unity/ProjectSettings/Physics2DSettings.asset | 1 + Unity/ProjectSettings/ProjectVersion.txt | 2 +- Unity/UnityPackageManager/manifest.json | 4 + 10 files changed, 3932 insertions(+), 358 deletions(-) create mode 100644 Unity/UnityPackageManager/manifest.json diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 486fd42..c72d570 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -135,12 +135,12 @@ public static int GetHandle(object obj) return Store(obj); } - public static void Remove(int handle) + public static object Remove(int handle) { // Null is never stored, so there's nothing to remove if (handle == 0) { - return; + return null; } lock (objects) @@ -172,6 +172,8 @@ public static void Remove(int handle) index = (index + 1) % maxObjects; } while (index != initialIndex); + + return obj; } } } @@ -304,12 +306,10 @@ delegate void InitDelegate( IntPtr unityEngineMatrix4x4PropertyGetItem, IntPtr unityEngineMatrix4x4PropertySetItem, IntPtr releaseUnityEngineRaycastHit, - int ReleaseUnityEngineRaycastHit, IntPtr unityEngineRaycastHitPropertyGetPoint, IntPtr unityEngineRaycastHitPropertySetPoint, IntPtr unityEngineRaycastHitPropertyGetTransform, IntPtr releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, - int ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue, @@ -362,23 +362,63 @@ delegate void InitDelegate( IntPtr unityEngineRaycastHitArray1SetItem1, IntPtr unityEngineGradientColorKeyArray1Constructor1, IntPtr unityEngineGradientColorKeyArray1GetItem1, - IntPtr unityEngineGradientColorKeyArray1SetItem1 + 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 /*END INIT PARAMS*/); public delegate void SetCsharpExceptionDelegate(int handle); /*BEGIN MONOBEHAVIOUR DELEGATES*/ - public delegate void TestScriptAwakeDelegate(int thisHandle); - public static TestScriptAwakeDelegate TestScriptAwake; + 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 TestScriptOnAnimatorIKDelegate(int thisHandle, int param0); - public static TestScriptOnAnimatorIKDelegate TestScriptOnAnimatorIK; + public delegate void MyGameMonoBehavioursTestScriptUpdateDelegate(int thisHandle); + public static MyGameMonoBehavioursTestScriptUpdateDelegate MyGameMonoBehavioursTestScriptUpdate; - public delegate void TestScriptOnCollisionEnterDelegate(int thisHandle, int param0); - public static TestScriptOnCollisionEnterDelegate TestScriptOnCollisionEnter; + public delegate void SystemActionCppInvokeDelegate(int thisHandle); + public static SystemActionCppInvokeDelegate SystemActionCppInvoke; - public delegate void TestScriptUpdateDelegate(int thisHandle); - public static TestScriptUpdateDelegate TestScriptUpdate; + 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 SetCsharpExceptionSystemNullReferenceExceptionDelegate(int param0); public static SetCsharpExceptionSystemNullReferenceExceptionDelegate SetCsharpExceptionSystemNullReferenceException; @@ -513,12 +553,10 @@ static extern void Init( IntPtr unityEngineMatrix4x4PropertyGetItem, IntPtr unityEngineMatrix4x4PropertySetItem, IntPtr releaseUnityEngineRaycastHit, - int ReleaseUnityEngineRaycastHit, IntPtr unityEngineRaycastHitPropertyGetPoint, IntPtr unityEngineRaycastHitPropertySetPoint, IntPtr unityEngineRaycastHitPropertyGetTransform, IntPtr releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, - int ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue, @@ -571,7 +609,32 @@ static extern void Init( IntPtr unityEngineRaycastHitArray1SetItem1, IntPtr unityEngineGradientColorKeyArray1Constructor1, IntPtr unityEngineGradientColorKeyArray1GetItem1, - IntPtr unityEngineGradientColorKeyArray1SetItem1 + 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 /*END INIT PARAMS*/); [DllImport(PluginName)] @@ -579,16 +642,31 @@ IntPtr unityEngineGradientColorKeyArray1SetItem1 /*BEGIN MONOBEHAVIOUR IMPORTS*/ [DllImport(Constants.PluginName)] - public static extern void TestScriptAwake(int thisHandle); + 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 TestScriptOnAnimatorIK(int thisHandle, int param0); + public static extern void SystemActionSystemSingleCppInvoke(int thisHandle, int param0); [DllImport(Constants.PluginName)] - public static extern void TestScriptOnCollisionEnter(int thisHandle, int param0); + public static extern void SystemActionSystemSingle_SystemSingleCppInvoke(int thisHandle, int param0, int param1); [DllImport(Constants.PluginName)] - public static extern void TestScriptUpdate(int thisHandle); + 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 SetCsharpExceptionSystemNullReferenceException(int thisHandle, int param0); @@ -690,6 +768,31 @@ IntPtr unityEngineGradientColorKeyArray1SetItem1 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 delegateHandle); + delegate void ReleaseSystemActionDelegate(int handle, int delegateHandle); + 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 delegateHandle); + delegate void ReleaseSystemActionSystemSingleDelegate(int handle, int delegateHandle); + 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 delegateHandle); + delegate void ReleaseSystemActionSystemSingle_SystemSingleDelegate(int handle, int delegateHandle); + 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 delegateHandle); + delegate void ReleaseSystemFuncSystemInt32_SystemSingle_SystemDoubleDelegate(int handle, int delegateHandle); + 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 delegateHandle); + delegate void ReleaseSystemFuncSystemInt16_SystemInt32_SystemStringDelegate(int handle, int delegateHandle); + 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); /*END DELEGATE TYPES*/ public static Exception UnhandledCppException; @@ -724,10 +827,15 @@ public static void Open( libraryHandle, "SetCsharpException"); /*BEGIN MONOBEHAVIOUR GETDELEGATE CALLS*/ - TestScriptAwake = GetDelegate(libraryHandle, "TestScriptAwake"); - TestScriptOnAnimatorIK = GetDelegate(libraryHandle, "TestScriptOnAnimatorIK"); - TestScriptOnCollisionEnter = GetDelegate(libraryHandle, "TestScriptOnCollisionEnter"); - TestScriptUpdate = GetDelegate(libraryHandle, "TestScriptUpdate"); + MyGameMonoBehavioursTestScriptAwake = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptAwake"); + MyGameMonoBehavioursTestScriptOnAnimatorIK = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptOnAnimatorIK"); + MyGameMonoBehavioursTestScriptOnCollisionEnter = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptOnCollisionEnter"); + MyGameMonoBehavioursTestScriptUpdate = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptUpdate"); + SystemActionCppInvoke = GetDelegate(libraryHandle, "SystemActionCppInvoke"); + SystemActionSystemSingleCppInvoke = GetDelegate(libraryHandle, "SystemActionSystemSingleCppInvoke"); + SystemActionSystemSingle_SystemSingleCppInvoke = GetDelegate(libraryHandle, "SystemActionSystemSingle_SystemSingleCppInvoke"); + SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke = GetDelegate(libraryHandle, "SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke"); + SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke = GetDelegate(libraryHandle, "SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke"); SetCsharpExceptionSystemNullReferenceException = GetDelegate(libraryHandle, "SetCsharpExceptionSystemNullReferenceException"); /*END MONOBEHAVIOUR GETDELEGATE CALLS*/ @@ -773,12 +881,10 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnityEngineMatrix4x4PropertyGetItemDelegate(UnityEngineMatrix4x4PropertyGetItem)), Marshal.GetFunctionPointerForDelegate(new UnityEngineMatrix4x4PropertySetItemDelegate(UnityEngineMatrix4x4PropertySetItem)), Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineRaycastHitDelegate(ReleaseUnityEngineRaycastHit)), - 1000, Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetPointDelegate(UnityEngineRaycastHitPropertyGetPoint)), Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertySetPointDelegate(UnityEngineRaycastHitPropertySetPoint)), Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetTransformDelegate(UnityEngineRaycastHitPropertyGetTransform)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate(ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)), - maxManagedObjects, Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate(SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)), @@ -831,7 +937,32 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitArray1SetItem1Delegate(UnityEngineRaycastHitArray1SetItem1)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientColorKeyArray1Constructor1Delegate(UnityEngineGradientColorKeyArray1Constructor1)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientColorKeyArray1GetItem1Delegate(UnityEngineGradientColorKeyArray1GetItem1)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientColorKeyArray1SetItem1Delegate(UnityEngineGradientColorKeyArray1SetItem1)) + 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)) /*END INIT CALL*/ ); if (UnhandledCppException != null) @@ -2807,6 +2938,635 @@ static void UnityEngineGradientColorKeyArray1SetItem1(int thisHandle, int index0 NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } + + class SystemAction + { + public int CppHandle; + public System.Action Delegate; + + public SystemAction(int cppHandle) + { + CppHandle = cppHandle; + Delegate = Invoke; + } + public void Invoke() + { + if (CppHandle != 0) + { + SystemActionCppInvoke(CppHandle); + } + } + } + + [MonoPInvokeCallback(typeof(SystemActionConstructorDelegate))] + static void SystemActionConstructor(int cppHandle, ref int handle, ref int delegateHandle) + { + try + { + var thiz = new SystemAction(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); + delegateHandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(ReleaseSystemActionDelegate))] + static void ReleaseSystemAction(int handle, int delegateHandle) + { + try + { + var thiz = (SystemAction)NativeScript.Bindings.ObjectStore.Remove(handle); + thiz.CppHandle = 0; + NativeScript.Bindings.ObjectStore.Remove(delegateHandle); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemActionInvokeDelegate))] + static void SystemActionInvoke(int thisHandle) + { + try + { + ((SystemAction)NativeScript.Bindings.ObjectStore.Get(thisHandle)).Delegate(); + + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemActionAddDelegate))] + static void SystemActionAdd(int thisHandle, int delHandle) + { + try + { + var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (SystemAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Delegate += del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemActionRemoveDelegate))] + static void SystemActionRemove(int thisHandle, int delHandle) + { + try + { + var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (SystemAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Delegate -= del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + class SystemActionSystemSingle + { + public int CppHandle; + public System.Action Delegate; + + public SystemActionSystemSingle(int cppHandle) + { + CppHandle = cppHandle; + Delegate = Invoke; + } + public void Invoke(float obj) + { + if (CppHandle != 0) + { + SystemActionSystemSingleCppInvoke(CppHandle, obj); + } + } + } + + [MonoPInvokeCallback(typeof(SystemActionSystemSingleConstructorDelegate))] + static void SystemActionSystemSingleConstructor(int cppHandle, ref int handle, ref int delegateHandle) + { + try + { + var thiz = new SystemActionSystemSingle(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); + delegateHandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(ReleaseSystemActionSystemSingleDelegate))] + static void ReleaseSystemActionSystemSingle(int handle, int delegateHandle) + { + try + { + var thiz = (SystemActionSystemSingle)NativeScript.Bindings.ObjectStore.Remove(handle); + thiz.CppHandle = 0; + NativeScript.Bindings.ObjectStore.Remove(delegateHandle); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemActionSystemSingleInvokeDelegate))] + static void SystemActionSystemSingleInvoke(int thisHandle, float obj) + { + try + { + ((SystemActionSystemSingle)NativeScript.Bindings.ObjectStore.Get(thisHandle)).Delegate(obj); + + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemActionSystemSingleAddDelegate))] + static void SystemActionSystemSingleAdd(int thisHandle, int delHandle) + { + try + { + var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (SystemActionSystemSingle)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Delegate += del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemActionSystemSingleRemoveDelegate))] + static void SystemActionSystemSingleRemove(int thisHandle, int delHandle) + { + try + { + var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (SystemActionSystemSingle)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Delegate -= del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + class SystemActionSystemSingle_SystemSingle + { + public int CppHandle; + public System.Action Delegate; + + public SystemActionSystemSingle_SystemSingle(int cppHandle) + { + CppHandle = cppHandle; + Delegate = Invoke; + } + public void Invoke(float arg1, float arg2) + { + if (CppHandle != 0) + { + SystemActionSystemSingle_SystemSingleCppInvoke(CppHandle, arg1, arg2); + } + } + } + + [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleConstructorDelegate))] + static void SystemActionSystemSingle_SystemSingleConstructor(int cppHandle, ref int handle, ref int delegateHandle) + { + try + { + var thiz = new SystemActionSystemSingle_SystemSingle(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); + delegateHandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(ReleaseSystemActionSystemSingle_SystemSingleDelegate))] + static void ReleaseSystemActionSystemSingle_SystemSingle(int handle, int delegateHandle) + { + try + { + var thiz = (SystemActionSystemSingle_SystemSingle)NativeScript.Bindings.ObjectStore.Remove(handle); + thiz.CppHandle = 0; + NativeScript.Bindings.ObjectStore.Remove(delegateHandle); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleInvokeDelegate))] + static void SystemActionSystemSingle_SystemSingleInvoke(int thisHandle, float arg1, float arg2) + { + try + { + ((SystemActionSystemSingle_SystemSingle)NativeScript.Bindings.ObjectStore.Get(thisHandle)).Delegate(arg1, arg2); + + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleAddDelegate))] + static void SystemActionSystemSingle_SystemSingleAdd(int thisHandle, int delHandle) + { + try + { + var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (SystemActionSystemSingle_SystemSingle)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Delegate += del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleRemoveDelegate))] + static void SystemActionSystemSingle_SystemSingleRemove(int thisHandle, int delHandle) + { + try + { + var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (SystemActionSystemSingle_SystemSingle)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Delegate -= del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + class SystemFuncSystemInt32_SystemSingle_SystemDouble + { + public int CppHandle; + public System.Func Delegate; + + public SystemFuncSystemInt32_SystemSingle_SystemDouble(int cppHandle) + { + CppHandle = cppHandle; + Delegate = Invoke; + } + public double Invoke(int arg1, float arg2) + { + if (CppHandle != 0) + { + return SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke(CppHandle, arg1, arg2); + } + else + { + return default(double); + } + } + } + + [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructorDelegate))] + static void SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(int cppHandle, ref int handle, ref int delegateHandle) + { + try + { + var thiz = new SystemFuncSystemInt32_SystemSingle_SystemDouble(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); + delegateHandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(ReleaseSystemFuncSystemInt32_SystemSingle_SystemDoubleDelegate))] + static void ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(int handle, int delegateHandle) + { + try + { + var thiz = (SystemFuncSystemInt32_SystemSingle_SystemDouble)NativeScript.Bindings.ObjectStore.Remove(handle); + thiz.CppHandle = 0; + NativeScript.Bindings.ObjectStore.Remove(delegateHandle); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleInvokeDelegate))] + static double SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(int thisHandle, int arg1, float arg2) + { + try + { + var returnValue = ((SystemFuncSystemInt32_SystemSingle_SystemDouble)NativeScript.Bindings.ObjectStore.Get(thisHandle)).Delegate(arg1, arg2); + + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(double); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(double); + } + } + + [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleAddDelegate))] + static void SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(int thisHandle, int delHandle) + { + try + { + var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (SystemFuncSystemInt32_SystemSingle_SystemDouble)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Delegate += del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleRemoveDelegate))] + static void SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(int thisHandle, int delHandle) + { + try + { + var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (SystemFuncSystemInt32_SystemSingle_SystemDouble)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Delegate -= del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + class SystemFuncSystemInt16_SystemInt32_SystemString + { + public int CppHandle; + public System.Func Delegate; + + public SystemFuncSystemInt16_SystemInt32_SystemString(int cppHandle) + { + CppHandle = cppHandle; + Delegate = Invoke; + } + public string Invoke(short arg1, int arg2) + { + if (CppHandle != 0) + { + return (string)NativeScript.Bindings.ObjectStore.Get(SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke(CppHandle, arg1, arg2)); + } + else + { + return default(string); + } + } + } + + [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringConstructorDelegate))] + static void SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(int cppHandle, ref int handle, ref int delegateHandle) + { + try + { + var thiz = new SystemFuncSystemInt16_SystemInt32_SystemString(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); + delegateHandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(ReleaseSystemFuncSystemInt16_SystemInt32_SystemStringDelegate))] + static void ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(int handle, int delegateHandle) + { + try + { + var thiz = (SystemFuncSystemInt16_SystemInt32_SystemString)NativeScript.Bindings.ObjectStore.Remove(handle); + thiz.CppHandle = 0; + NativeScript.Bindings.ObjectStore.Remove(delegateHandle); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringInvokeDelegate))] + static int SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(int thisHandle, short arg1, int arg2) + { + try + { + var returnValue = ((SystemFuncSystemInt16_SystemInt32_SystemString)NativeScript.Bindings.ObjectStore.Get(thisHandle)).Delegate(arg1, arg2); + + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringAddDelegate))] + static void SystemFuncSystemInt16_SystemInt32_SystemStringAdd(int thisHandle, int delHandle) + { + try + { + var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (SystemFuncSystemInt16_SystemInt32_SystemString)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Delegate += del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringRemoveDelegate))] + static void SystemFuncSystemInt16_SystemInt32_SystemStringRemove(int thisHandle, int delHandle) + { + try + { + var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (SystemFuncSystemInt16_SystemInt32_SystemString)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Delegate -= del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } /*END FUNCTIONS*/ } } @@ -2821,7 +3581,7 @@ public class TestScript : UnityEngine.MonoBehaviour public void Awake() { int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); - NativeScript.Bindings.TestScriptAwake(thisHandle); + NativeScript.Bindings.MyGameMonoBehavioursTestScriptAwake(thisHandle); if (NativeScript.Bindings.UnhandledCppException != null) { Exception ex = NativeScript.Bindings.UnhandledCppException; @@ -2833,7 +3593,7 @@ public void Awake() public void OnAnimatorIK(int param0) { int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); - NativeScript.Bindings.TestScriptOnAnimatorIK(thisHandle, param0); + NativeScript.Bindings.MyGameMonoBehavioursTestScriptOnAnimatorIK(thisHandle, param0); if (NativeScript.Bindings.UnhandledCppException != null) { Exception ex = NativeScript.Bindings.UnhandledCppException; @@ -2846,7 +3606,7 @@ public void OnCollisionEnter(UnityEngine.Collision param0) { int param0Handle = NativeScript.Bindings.ObjectStore.Store(param0); int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); - NativeScript.Bindings.TestScriptOnCollisionEnter(thisHandle, param0Handle); + NativeScript.Bindings.MyGameMonoBehavioursTestScriptOnCollisionEnter(thisHandle, param0Handle); if (NativeScript.Bindings.UnhandledCppException != null) { Exception ex = NativeScript.Bindings.UnhandledCppException; @@ -2858,7 +3618,7 @@ public void OnCollisionEnter(UnityEngine.Collision param0) public void Update() { int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); - NativeScript.Bindings.TestScriptUpdate(thisHandle); + NativeScript.Bindings.MyGameMonoBehavioursTestScriptUpdate(thisHandle); if (NativeScript.Bindings.UnhandledCppException != null) { Exception ex = NativeScript.Bindings.UnhandledCppException; diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 4d7b1ec..1377c72 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -38,6 +38,7 @@ class JsonConstructor class JsonGenericParams { public string[] Types; + public int MaxSimultaneous; } [Serializable] @@ -100,6 +101,14 @@ class JsonArray public int[] Ranks; } + [Serializable] + class JsonDelegate + { + public string Type; + public JsonGenericParams[] GenericParams; + public int MaxSimultaneous; + } + [Serializable] class JsonDocument { @@ -107,9 +116,10 @@ class JsonDocument public JsonType[] Types; public JsonMonoBehaviour[] MonoBehaviours; public JsonArray[] Arrays; + public JsonDelegate[] Delegates; } - const int InitialStringBuilderCapacity = 1024 * 10; + const int InitialStringBuilderCapacity = 1024 * 100; class StringBuilders { @@ -145,9 +155,7 @@ class StringBuilders new StringBuilder(InitialStringBuilderCapacity); public StringBuilder CppMonoBehaviourMessages = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CppRefCountsStateAndFunctions = - new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CppRefCountsInit = + public StringBuilder CppGlobalStateAndFunctions = new StringBuilder(InitialStringBuilderCapacity); public StringBuilder TempStrBuilder = new StringBuilder(InitialStringBuilderCapacity); @@ -161,6 +169,7 @@ class ParameterInfo public bool IsOut; public bool IsRef; public TypeKind Kind; + public bool IsVirtual; } enum TypeKind @@ -519,6 +528,17 @@ static void DoPostCompileWork(bool canRefreshAssetDb) } } + if (doc.Delegates != null) + { + foreach (JsonDelegate del in doc.Delegates) + { + AppendDelegate( + del, + assemblies, + builders); + } + } + // Generate exception setters AppendExceptions( doc, @@ -560,7 +580,13 @@ static JsonDocument LoadJson() static Assembly[] GetAssemblies(string[] assemblyNames) { - const int numDefaultAssemblies = 7; + const int numDefaultAssemblies = +#if UNITY_2017_2_OR_NEWER + 43; +#else + 7; +#endif + int numAssemblies; Assembly[] assemblies; if (assemblyNames == null) @@ -587,10 +613,48 @@ static Assembly[] GetAssemblies(string[] assemblyNames) assemblies[0] = typeof(string).Assembly; // .NET: mscorlib assemblies[1] = typeof(Uri).Assembly; // .NET: System assemblies[2] = typeof(Action).Assembly; // .NET: System.Core - assemblies[3] = typeof(Vector3).Assembly; // UnityEngine + assemblies[3] = typeof(Vector3).Assembly; // UnityEngine (core module for 2017.2+) assemblies[4] = typeof(Bindings).Assembly; // Runtime scripts assemblies[5] = typeof(GenerateBindings).Assembly; // Editor scripts assemblies[6] = typeof(EditorPrefs).Assembly; // UnityEditor +#if UNITY_2017_2_OR_NEWER + assemblies[7] = typeof(UnityEngine.Accessibility.VisionUtility).Assembly; // Unity accessibility module + assemblies[8] = typeof(UnityEngine.AI.NavMesh).Assembly; // Unity AI module + assemblies[9] = typeof(UnityEngine.Animations.AnimationClipPlayable).Assembly; // Unity animation module + assemblies[10] = typeof(UnityEngine.XR.ARRenderMode).Assembly; // Unity AR module + assemblies[11] = typeof(UnityEngine.AudioSettings).Assembly; // Unity audio module + assemblies[12] = typeof(UnityEngine.Cloth).Assembly; // Unity cloth module + assemblies[13] = typeof(UnityEngine.ClusterInput).Assembly; // Unity cluster input module + assemblies[14] = typeof(UnityEngine.ClusterNetwork).Assembly; // Unity custer renderer module + assemblies[15] = typeof(UnityEngine.CrashReportHandler.CrashReportHandler).Assembly; // Unity crash reporting module + assemblies[16] = typeof(UnityEngine.Playables.PlayableDirector).Assembly; // Unity director module + assemblies[17] = typeof(UnityEngine.SocialPlatforms.IAchievement).Assembly; // Unity game center module + assemblies[18] = typeof(UnityEngine.ImageConversion).Assembly; // Unity image conversion module + assemblies[19] = typeof(UnityEngine.GUI).Assembly; // Unity IMGUI module + assemblies[20] = typeof(UnityEngine.JsonUtility).Assembly; // Unity JSON serialize module + assemblies[21] = typeof(UnityEngine.ParticleSystem).Assembly; // Unity particle system module + assemblies[22] = typeof(UnityEngine.Analytics.PerformanceReporting).Assembly; // Unity performance reporting module + assemblies[23] = typeof(UnityEngine.Physics2D).Assembly; // Unity physics 2D module + assemblies[24] = typeof(UnityEngine.Physics).Assembly; // Unity physics module + assemblies[25] = typeof(UnityEngine.ScreenCapture).Assembly; // Unity screen capture module + assemblies[26] = typeof(UnityEngine.Terrain).Assembly; // Unity terrain module + assemblies[27] = typeof(UnityEngine.TerrainCollider).Assembly; // Unity terrain physics module + assemblies[28] = typeof(UnityEngine.Font).Assembly; // Unity text rendering module + assemblies[29] = typeof(UnityEngine.Tilemaps.Tile).Assembly; // Unity tilemap module + assemblies[30] = typeof(UnityEngine.Experimental.UIElements.Button).Assembly; // Unity UI elements module + assemblies[31] = typeof(UnityEngine.Canvas).Assembly; // Unity UI module + assemblies[32] = typeof(UnityEngine.Networking.NetworkTransport).Assembly; // Unity cloth module + assemblies[33] = typeof(UnityEngine.Analytics.Analytics).Assembly; // Unity analytics module + assemblies[34] = typeof(UnityEngine.RemoteSettings).Assembly; // Unity Unity connect module + assemblies[35] = typeof(UnityEngine.Networking.DownloadHandlerAudioClip).Assembly; // Unity web request audio module + assemblies[36] = typeof(UnityEngine.WWWForm).Assembly; // Unity web request module + assemblies[37] = typeof(UnityEngine.Networking.DownloadHandlerTexture).Assembly; // Unity web request texture module + assemblies[38] = typeof(UnityEngine.WWW).Assembly; // Unity web request WWW module + assemblies[39] = typeof(UnityEngine.WheelCollider).Assembly; // Unity vehicles module + assemblies[40] = typeof(UnityEngine.Video.VideoClip).Assembly; // Unity video module + assemblies[41] = typeof(UnityEngine.XR.InputTracking).Assembly; // Unity VR module + assemblies[42] = typeof(UnityEngine.WindZone).Assembly; // Unity wind module +#endif return assemblies; } @@ -648,6 +712,11 @@ static Type TryGetType( static TypeKind GetTypeKind(Type type) { + if (type == typeof(void)) + { + return TypeKind.None; + } + if (type.IsPointer) { return TypeKind.Pointer; @@ -1077,28 +1146,13 @@ static void AppendType( Type[] genericArgTypes = type.GetGenericArguments(); if (jsonType.GenericParams != null) { - // Template declaration for the type if (!IsStatic(type)) { - int indent = AppendNamespaceBeginning( + AppendCppTemplateDeclaration( + type.Name, type.Namespace, - builders.CppTypeDeclarations); - AppendIndent( - indent, - builders.CppTypeDeclarations); - AppendCppTemplateTypenames( genericArgTypes.Length, builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append("struct "); - AppendTypeNameWithoutGenericSuffix( - type.Name, - builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append(";"); - builders.CppTypeDeclarations.Append('\n'); - AppendNamespaceEnding( - indent, - builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append('\n'); } foreach (JsonGenericParams jsonGenericParams @@ -1107,23 +1161,33 @@ static void AppendType( Type[] typeParams = GetTypes( jsonGenericParams.Types, assemblies); - type = type.MakeGenericType(typeParams); + Type genericType = type.MakeGenericType(typeParams); + int? maxSimultaneous = jsonGenericParams.MaxSimultaneous != 0 + ? jsonGenericParams.MaxSimultaneous + : jsonType.MaxSimultaneous != 0 + ? jsonType.MaxSimultaneous + : default(int?); AppendType( jsonType, genericArgTypes, - type, + genericType, typeParams, + maxSimultaneous, assemblies, builders); } } else { + int? maxSimultaneous = jsonType.MaxSimultaneous != 0 + ? jsonType.MaxSimultaneous + : default(int?); AppendType( jsonType, genericArgTypes, type, null, + maxSimultaneous, assemblies, builders); } @@ -1135,6 +1199,7 @@ static void AppendType( Type[] genericArgTypes, Type type, Type[] typeParams, + int? maxSimultaneous, Assembly[] assemblies, StringBuilders builders) { @@ -1158,10 +1223,10 @@ static void AppendType( builders.CsharpStructStoreInitCalls); builders.CsharpStructStoreInitCalls.Append( ">.Init("); - if (jsonType.MaxSimultaneous > 0) + if (maxSimultaneous.HasValue) { builders.CsharpStructStoreInitCalls.Append( - jsonType.MaxSimultaneous); + maxSimultaneous.Value); } else { @@ -1195,17 +1260,6 @@ static void AppendType( builders.TempStrBuilder[0]); string funcNameLower = builders.TempStrBuilder.ToString(); - // Ref counts array length name - builders.TempStrBuilder.Length = 0; - builders.TempStrBuilder.Append("RefCountsLen"); - builders.TempStrBuilder.Append(funcNameSuffix); - string refCountsArrayLengthName = builders.TempStrBuilder.ToString(); - - // Ref counts array length name (lowercase) - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string refCountsArrayLengthNameLower = builders.TempStrBuilder.ToString(); - // Build ReleaseX parameters ParameterInfo paramInfo = new ParameterInfo(); paramInfo.Name = "handle"; @@ -1288,82 +1342,60 @@ static void AppendType( funcName, builders.CsharpInitCall); - // C++ init param for handle array length - builders.CppInitParams.Append("\tint32_t "); - builders.CppInitParams.Append(refCountsArrayLengthNameLower); - builders.CppInitParams.Append(",\n"); - // C++ init body for handle array length - AppendCppInitBody( - refCountsArrayLengthName, - refCountsArrayLengthNameLower, - builders.CppInitBody); builders.CppInitBody.Append("\tPlugin::RefCounts"); builders.CppInitBody.Append(funcNameSuffix); builders.CppInitBody.Append(" = new int32_t["); - builders.CppInitBody.Append(refCountsArrayLengthNameLower); - builders.CppInitBody.Append("]();\n"); - - // C# init param for handle array length - builders.CsharpInitParams.Append("\t\t\tint "); - builders.CsharpInitParams.Append(funcName); - builders.CsharpInitParams.Append(",\n"); - - // C# init call arg for handle array length - builders.CsharpInitCall.Append( - "\t\t\t\t"); - if (jsonType.MaxSimultaneous > 0) + if (maxSimultaneous.HasValue) { - builders.CsharpInitCall.Append( - jsonType.MaxSimultaneous); + builders.CppInitBody.Append(maxSimultaneous.Value); } else { - builders.CsharpInitCall.Append( - "maxManagedObjects"); + builders.CppInitBody.Append("maxManagedObjects"); } - builders.CsharpInitCall.Append(",\n"); + builders.CppInitBody.Append("]();\n"); // C++ ref count state and functions - builders.CppRefCountsStateAndFunctions.Append("\tint32_t RefCountsLen"); - builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); - builders.CppRefCountsStateAndFunctions.Append(";\n\tint32_t* RefCounts"); - builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); - builders.CppRefCountsStateAndFunctions.Append(";\n\t\n\tvoid ReferenceManaged"); - builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); - builders.CppRefCountsStateAndFunctions.Append("(int32_t handle)\n"); - builders.CppRefCountsStateAndFunctions.Append("\t{\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\tassert(handle >= 0 && handle < RefCountsLen"); - builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); - builders.CppRefCountsStateAndFunctions.Append(");\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\tif (handle != 0)\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\t{\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\t\tRefCounts"); - builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); - builders.CppRefCountsStateAndFunctions.Append("[handle]++;\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\t}\n"); - builders.CppRefCountsStateAndFunctions.Append("\t}\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\n"); - builders.CppRefCountsStateAndFunctions.Append("\tvoid DereferenceManaged"); - builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); - builders.CppRefCountsStateAndFunctions.Append("(int32_t handle)\n"); - builders.CppRefCountsStateAndFunctions.Append("\t{\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\tassert(handle >= 0 && handle < RefCountsLen"); - builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); - builders.CppRefCountsStateAndFunctions.Append(");\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\tif (handle != 0)\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\t{\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\t\tint32_t numRemain = --RefCounts"); - builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); - builders.CppRefCountsStateAndFunctions.Append("[handle];\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\t\tif (numRemain == 0)\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\t\t{\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\t\t\tRelease"); - builders.CppRefCountsStateAndFunctions.Append(funcNameSuffix); - builders.CppRefCountsStateAndFunctions.Append("(handle);\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\t\t}\n"); - builders.CppRefCountsStateAndFunctions.Append("\t\t}\n"); - builders.CppRefCountsStateAndFunctions.Append("\t}\n\t\n"); + builders.CppGlobalStateAndFunctions.Append("\tint32_t RefCountsLen"); + builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); + builders.CppGlobalStateAndFunctions.Append(";\n\tint32_t* RefCounts"); + builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); + builders.CppGlobalStateAndFunctions.Append(";\n\t\n\tvoid ReferenceManaged"); + builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); + builders.CppGlobalStateAndFunctions.Append("(int32_t handle)\n"); + builders.CppGlobalStateAndFunctions.Append("\t{\n"); + builders.CppGlobalStateAndFunctions.Append("\t\tassert(handle >= 0 && handle < RefCountsLen"); + builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); + builders.CppGlobalStateAndFunctions.Append(");\n"); + builders.CppGlobalStateAndFunctions.Append("\t\tif (handle != 0)\n"); + builders.CppGlobalStateAndFunctions.Append("\t\t{\n"); + builders.CppGlobalStateAndFunctions.Append("\t\t\tRefCounts"); + builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); + builders.CppGlobalStateAndFunctions.Append("[handle]++;\n"); + builders.CppGlobalStateAndFunctions.Append("\t\t}\n"); + builders.CppGlobalStateAndFunctions.Append("\t}\n"); + builders.CppGlobalStateAndFunctions.Append("\t\n"); + builders.CppGlobalStateAndFunctions.Append("\tvoid DereferenceManaged"); + builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); + builders.CppGlobalStateAndFunctions.Append("(int32_t handle)\n"); + builders.CppGlobalStateAndFunctions.Append("\t{\n"); + builders.CppGlobalStateAndFunctions.Append("\t\tassert(handle >= 0 && handle < RefCountsLen"); + builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); + builders.CppGlobalStateAndFunctions.Append(");\n"); + builders.CppGlobalStateAndFunctions.Append("\t\tif (handle != 0)\n"); + builders.CppGlobalStateAndFunctions.Append("\t\t{\n"); + builders.CppGlobalStateAndFunctions.Append("\t\t\tint32_t numRemain = --RefCounts"); + builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); + builders.CppGlobalStateAndFunctions.Append("[handle];\n"); + builders.CppGlobalStateAndFunctions.Append("\t\t\tif (numRemain == 0)\n"); + builders.CppGlobalStateAndFunctions.Append("\t\t\t{\n"); + builders.CppGlobalStateAndFunctions.Append("\t\t\t\tRelease"); + builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); + builders.CppGlobalStateAndFunctions.Append("(handle);\n"); + builders.CppGlobalStateAndFunctions.Append("\t\t\t}\n"); + builders.CppGlobalStateAndFunctions.Append("\t\t}\n"); + builders.CppGlobalStateAndFunctions.Append("\t}\n\t\n"); } // C++ type declaration @@ -1388,7 +1420,7 @@ static void AppendType( builders.CppTypeDefinitions); // C++ method definition - int cppMethodDefinitionsIndent = AppendCppMethodDefinitionBegin( + int cppMethodDefinitionsIndent = AppendCppMethodDefinitionsBegin( type.Name, type.Namespace, typeKind, @@ -1398,6 +1430,7 @@ static void AppendType( type.BaseType.GetGenericArguments(), isStatic, indent, + true, builders.CppMethodDefinitions); // Constructors @@ -1501,7 +1534,7 @@ static void AppendType( builders.CppTypeDefinitions); // C++ method definition (ending) - AppendCppMethodDefinitionEnd( + AppendCppMethodDefinitionsEnd( cppMethodDefinitionsIndent, builders.CppMethodDefinitions); } @@ -1785,13 +1818,15 @@ static void AppendConstructor( enclosingType.Name, enclosingTypeIsStatic, false, + false, + false, null, null, parameters, builders.CppTypeDefinitions); // C++ method definition - AppendCppMethodDefinition( + AppendCppMethodDefinitionBegin( enclosingType.Name, null, enclosingType.Name, @@ -2801,14 +2836,16 @@ static void AppendMethod( AppendCppMethodDeclaration( cppMethodName, enclosingTypeIsStatic, + false, cppMethodIsStatic, + false, cppReturnType, methodTypeParams, cppParameters, builders.CppTypeDefinitions); // C++ method definition - AppendCppMethodDefinition( + AppendCppMethodDefinitionBegin( enclosingType.Name, cppReturnType, cppMethodName, @@ -2932,7 +2969,7 @@ static void AppendMonoBehaviour( builders.CppTypeDefinitions); // C++ method definition - int cppMethodDefinitionsIndent = AppendCppMethodDefinitionBegin( + int cppMethodDefinitionsIndent = AppendCppMethodDefinitionsBegin( type.Name, type.Namespace, TypeKind.Class, @@ -2942,8 +2979,9 @@ static void AppendMonoBehaviour( null, false, cppIndent, + true, builders.CppMethodDefinitions); - AppendCppMethodDefinitionEnd( + AppendCppMethodDefinitionsEnd( cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -2987,6 +3025,8 @@ static void AppendMonoBehaviour( messageInfo.Name, false, false, + false, + false, typeof(void), null, parameters, @@ -3061,6 +3101,10 @@ static void AppendMonoBehaviour( csharpIndent + 2, builders.CsharpMonoBehaviours); builders.CsharpMonoBehaviours.Append("NativeScript.Bindings."); + AppendNamespace( + type.Namespace, + string.Empty, + builders.CsharpMonoBehaviours); builders.CsharpMonoBehaviours.Append(type.Name); builders.CsharpMonoBehaviours.Append(messageInfo.Name); builders.CsharpMonoBehaviours.Append("(thisHandle"); @@ -3124,13 +3168,19 @@ static void AppendMonoBehaviour( AppendCsharpDelegate( false, type.Name, + type.Namespace, + null, messageInfo.Name, parameters, + typeof(void), + TypeKind.None, builders.CsharpDelegates); // C# Import AppendCsharpImport( type.Name, + type.Namespace, + null, messageInfo.Name, parameters, builders.CsharpImports); @@ -3138,13 +3188,19 @@ static void AppendMonoBehaviour( // C# GetDelegate Call AppendCsharpGetDelegateCall( type.Name, + type.Namespace, + null, messageInfo.Name, builders.CsharpGetDelegateCalls); // C++ Message builders.CppMonoBehaviourMessages.Append("DLLEXPORT void "); - builders.CppMonoBehaviourMessages.Append(type.Name); - builders.CppMonoBehaviourMessages.Append(messageInfo.Name); + AppendCsharpDelegateName( + type.Name, + type.Namespace, + null, + messageInfo.Name, + builders.CppMonoBehaviourMessages); builders.CppMonoBehaviourMessages.Append("(int32_t thisHandle"); if (numParams > 0) { @@ -3219,13 +3275,14 @@ static void AppendMonoBehaviour( builders.CppMonoBehaviourMessages.Append("\t}\n"); builders.CppMonoBehaviourMessages.Append("\tcatch (...)\n"); builders.CppMonoBehaviourMessages.Append("\t{\n"); - builders.CppMonoBehaviourMessages.Append("\t\tSystem::Exception ex(System::String(\"Unhandled exception in "); + builders.CppMonoBehaviourMessages.Append("\t\tSystem::String msg = \"Unhandled exception in "); AppendCppTypeName( type, builders.CppMonoBehaviourMessages); builders.CppMonoBehaviourMessages.Append("::"); builders.CppMonoBehaviourMessages.Append(messageInfo.Name); - builders.CppMonoBehaviourMessages.Append("\"));\n"); + builders.CppMonoBehaviourMessages.Append("\";\n"); + builders.CppMonoBehaviourMessages.Append("\t\tSystem::Exception ex(msg);\n"); builders.CppMonoBehaviourMessages.Append("\t\tPlugin::SetException(ex.Handle);\n"); builders.CppMonoBehaviourMessages.Append("\t}\n"); builders.CppMonoBehaviourMessages.Append("}\n\n\n"); @@ -3321,7 +3378,7 @@ static void AppendArray( builders.CppTypeDefinitions); // C++ method definitions (beginning) - int cppMethodDefinitionsIndent = AppendCppMethodDefinitionBegin( + int cppMethodDefinitionsIndent = AppendCppMethodDefinitionsBegin( cppArrayTypeName, "System", TypeKind.Class, @@ -3331,6 +3388,7 @@ static void AppendArray( null, false, indent, + true, builders.CppMethodDefinitions); AppendArrayConstructor( @@ -3395,7 +3453,7 @@ static void AppendArray( builders.CppTypeDefinitions); // C++ method definitions (ending) - AppendCppMethodDefinitionEnd( + AppendCppMethodDefinitionsEnd( cppMethodDefinitionsIndent, builders.CppMethodDefinitions); } @@ -3531,6 +3589,8 @@ static void AppendArrayConstructor( cppArrayTypeName, false, false, + false, + false, null, null, parameters, @@ -3538,7 +3598,7 @@ static void AppendArrayConstructor( // C++ method definition Type[] cppTypeParams = new Type[] { elementType }; - AppendCppMethodDefinition( + AppendCppMethodDefinitionBegin( cppArrayTypeName, null, cppArrayTypeName, @@ -3630,13 +3690,15 @@ StringBuilders builders baseFunctionName, false, false, + false, + false, typeof(int), null, parameters, builders.CppTypeDefinitions); // C++ method definition - AppendCppMethodDefinition( + AppendCppMethodDefinitionBegin( cppArrayTypeName, typeof(int), baseFunctionName, @@ -3769,6 +3831,8 @@ static void AppendArrayGetLength( "GetLength", false, false, + false, + false, typeof(int), null, parameters, @@ -3776,7 +3840,7 @@ static void AppendArrayGetLength( // C++ method definition Type[] cppTypeParams = new Type[] { elementType }; - AppendCppMethodDefinition( + AppendCppMethodDefinitionBegin( cppArrayTypeName, typeof(int), "GetLength", @@ -3934,6 +3998,8 @@ static void AppendArrayGetItem( "GetItem", false, false, + false, + false, elementType, null, parameters, @@ -3941,7 +4007,7 @@ static void AppendArrayGetItem( // C++ method definition Type[] cppTypeParams = new Type[] { elementType }; - AppendCppMethodDefinition( + AppendCppMethodDefinitionBegin( cppArrayTypeName, elementType, "GetItem", @@ -4108,6 +4174,8 @@ static void AppendArraySetItem( "SetItem", false, false, + false, + false, typeof(void), null, parameters, @@ -4115,7 +4183,7 @@ static void AppendArraySetItem( // C++ method definition Type[] cppTypeParams = new Type[] { elementType }; - AppendCppMethodDefinition( + AppendCppMethodDefinitionBegin( cppArrayTypeName, typeof(void), "SetItem", @@ -4143,136 +4211,1452 @@ static void AppendArraySetItem( builders.CppMethodDefinitions.Append('\n'); } - static void AppendCsharpDelegate( - bool isStatic, - string typeName, - string funcName, - ParameterInfo[] parameters, - StringBuilder output) + static void AppendDelegate( + JsonDelegate jsonDelegate, + Assembly[] assemblies, + StringBuilders builders) { - output.Append("\t\tpublic delegate void "); - output.Append(typeName); - output.Append(funcName); - output.Append("Delegate("); - if (!isStatic) - { - output.Append("int thisHandle"); - if (parameters.Length > 0) - { - output.Append(", "); - } - } - for (int i = 0; i < parameters.Length; ++i) + Type type = GetType( + jsonDelegate.Type, + assemblies); + Type[] genericArgTypes = type.GetGenericArguments(); + if (jsonDelegate.GenericParams != null) { - ParameterInfo param = parameters[i]; - if (param.Kind == TypeKind.FullStruct) - { - AppendCsharpTypeName( - param.ParameterType, - output); - output.Append(" param"); - output.Append(i); - } - else + foreach (JsonGenericParams jsonGenericParams + in jsonDelegate.GenericParams) { - output.Append("int param"); - output.Append(i); + // Build numbered C++ class name (e.g. Action2) + builders.TempStrBuilder.Length = 0; + AppendTypeNameWithoutSuffixes( + type.Name, + builders.TempStrBuilder); + builders.TempStrBuilder.Append( + jsonGenericParams.Types.Length); + string numberedTypeName = builders.TempStrBuilder.ToString(); + + // C++ template declaration + AppendCppTemplateDeclaration( + numberedTypeName, + type.Namespace, + genericArgTypes.Length, + builders.CppTypeDeclarations); } - if (i != parameters.Length-1) + + foreach (JsonGenericParams jsonGenericParams + in jsonDelegate.GenericParams) { - output.Append(", "); + Type[] typeParams = GetTypes( + jsonGenericParams.Types, + assemblies); + Type genericType = type.MakeGenericType(typeParams); + + // Build numbered C++ class name (e.g. Action2) + builders.TempStrBuilder.Length = 0; + AppendTypeNameWithoutSuffixes( + type.Name, + builders.TempStrBuilder); + builders.TempStrBuilder.Append( + jsonGenericParams.Types.Length); + string numberedTypeName = builders.TempStrBuilder.ToString(); + + // Max simultaneous handles of this type + int? maxSimultaneous = jsonGenericParams.MaxSimultaneous != 0 + ? jsonGenericParams.MaxSimultaneous + : jsonDelegate.MaxSimultaneous != 0 + ? jsonDelegate.MaxSimultaneous + : default(int?); + + AppendDelegate( + genericType, + numberedTypeName, + jsonDelegate, + genericArgTypes, + typeParams, + maxSimultaneous, + assemblies, + builders); } } - output.Append(");\n"); - output.Append("\t\tpublic static "); - output.Append(typeName); - output.Append(funcName); - output.Append("Delegate "); - output.Append(typeName); - output.Append(funcName); - output.Append(";\n\t\t\n"); - } - - static void AppendCsharpGetDelegateCall( - string typeName, - string funcName, - StringBuilder output) - { - output.Append("\t\t\t"); - output.Append(typeName); - output.Append(funcName); - output.Append(" = GetDelegate<"); - output.Append(typeName); - output.Append(funcName); - output.Append("Delegate>(libraryHandle, \""); - output.Append(typeName); - output.Append(funcName); - output.Append("\");\n"); - } - - static void AppendCsharpImport( - string typeName, - string funcName, - ParameterInfo[] parameters, - StringBuilder output - ) - { - output.Append("\t\t[DllImport(Constants.PluginName)]\n"); - output.Append("\t\tpublic static extern void "); - output.Append(typeName); - output.Append(funcName); - output.Append("(int thisHandle"); - if (parameters.Length > 0) - { - output.Append(", "); - } - for (int i = 0; i < parameters.Length; ++i) + else { - ParameterInfo param = parameters[i]; - if (param.Kind == TypeKind.FullStruct) - { - AppendCsharpTypeName( - param.ParameterType, - output); - output.Append(" param"); - output.Append(i); - } - else - { - output.Append("int param"); - output.Append(i); - } - if (i != parameters.Length-1) - { - output.Append(", "); - } + int? maxSimultaneous = jsonDelegate.MaxSimultaneous != 0 + ? jsonDelegate.MaxSimultaneous + : default(int?); + AppendDelegate( + type, + type.Name, + jsonDelegate, + genericArgTypes, + null, + maxSimultaneous, + assemblies, + builders); } - output.Append(");\n\t\t\n"); } - static void AppendExceptions( - JsonDocument doc, + static void AppendDelegate( + Type type, + string numberedTypeName, + JsonDelegate jsonDelegate, + Type[] genericArgTypes, + Type[] typeParams, + int? maxSimultaneous, Assembly[] assemblies, StringBuilders builders) { - // Gather all specific types of exceptions - Dictionary exceptionTypes = new Dictionary(); - if (doc.Types != null) - { - foreach (JsonType jsonType in doc.Types) + builders.TempStrBuilder.Length = 0; + AppendNamespace( + type.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendTypeNameWithoutSuffixes( + type.Name, + builders.TempStrBuilder); + AppendTypeNames( + typeParams, + builders.TempStrBuilder); + string typeName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("Release"); + builders.TempStrBuilder.Append(typeName); + string releaseFuncName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string releaseFuncNameLower = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append(typeName); + builders.TempStrBuilder.Append("Constructor"); + string constructorFuncName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string constructorFuncNameLower = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append(typeName); + builders.TempStrBuilder.Append("Invoke"); + string invokeFuncName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string invokeFuncNameLower = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append(typeName); + builders.TempStrBuilder.Append("Add"); + string addFuncName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string addFuncNameLower = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append(typeName); + builders.TempStrBuilder.Append("Remove"); + string removeFuncName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string removeFuncNameLower = builders.TempStrBuilder.ToString(); + + MethodInfo invokeMethod = type.GetMethod("Invoke"); + TypeKind invokeReturnTypeKind = GetTypeKind( + invokeMethod.ReturnType); + ParameterInfo[] invokeParams = ConvertParameters( + invokeMethod.GetParameters()); + ParameterInfo[] invokeParamsWithThis = new ParameterInfo[ + invokeParams.Length + 1]; + for (int i = 0; i < invokeParams.Length; ++i) + { + invokeParamsWithThis[i+1] = invokeParams[i]; + } + invokeParamsWithThis[0] = new ParameterInfo { + Name = "thisHandle", + ParameterType = typeof(int), + DereferencedParameterType = typeof(int), + IsOut = false, + IsRef = false, + Kind = TypeKind.Primitive + }; + + ParameterInfo[] addRemoveCppParams = new ParameterInfo[] { + new ParameterInfo { - if (jsonType.Methods != null) - { - foreach (JsonMethod jsonMethod in jsonType.Methods) - { - if (jsonMethod.Exceptions != null) - { - AddUniqueTypes( - jsonMethod.Exceptions, - exceptionTypes, - assemblies); - } - } + Name = "del", + ParameterType = type, + DereferencedParameterType = type, + IsOut = false, + IsRef = false, + Kind = TypeKind.Class, + IsVirtual = true + }}; + + ParameterInfo[] addRemoveCsharpParams = new ParameterInfo[] { + new ParameterInfo + { + Name = "thisHandle", + ParameterType = typeof(int), + DereferencedParameterType = typeof(int), + IsOut = false, + IsRef = false, + Kind = TypeKind.Primitive + }, + new ParameterInfo + { + Name = "del", + ParameterType = type, + DereferencedParameterType = type, + IsOut = false, + IsRef = false, + Kind = TypeKind.Class + }}; + + ParameterInfo[] releaseParams = new ParameterInfo[] { + new ParameterInfo + { + Name = "handle", + ParameterType = typeof(int), + DereferencedParameterType = typeof(int), + IsOut = false, + IsRef = false, + Kind = TypeKind.Primitive + }, + new ParameterInfo + { + Name = "delegateHandle", + ParameterType = typeof(int), + DereferencedParameterType = typeof(int), + IsOut = false, + IsRef = false, + Kind = TypeKind.Primitive + }}; + + ParameterInfo[] constructorParams = new ParameterInfo[] { + new ParameterInfo + { + Name = "cppHandle", + ParameterType = typeof(int), + DereferencedParameterType = typeof(int), + IsOut = false, + IsRef = false, + Kind = TypeKind.Primitive + }, + new ParameterInfo + { + Name = "handle", + ParameterType = typeof(int), + DereferencedParameterType = typeof(int), + IsOut = true, + IsRef = false, + Kind = TypeKind.Primitive + }, + new ParameterInfo + { + Name = "delegateHandle", + ParameterType = typeof(int), + DereferencedParameterType = typeof(int), + IsOut = true, + IsRef = false, + Kind = TypeKind.Primitive + }}; + + // Free list state and functions + builders.CppGlobalStateAndFunctions.Append("\tint32_t "); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append("FreeListSize;\n"); + builders.CppGlobalStateAndFunctions.Append('\t'); + AppendCppTypeName( + type, + builders.CppGlobalStateAndFunctions); + builders.CppGlobalStateAndFunctions.Append("** "); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append("FreeList;\n"); + builders.CppGlobalStateAndFunctions.Append('\t'); + AppendCppTypeName( + type, + builders.CppGlobalStateAndFunctions); + builders.CppGlobalStateAndFunctions.Append("** NextFree"); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append(";\n"); + builders.CppGlobalStateAndFunctions.Append("\t\n"); + builders.CppGlobalStateAndFunctions.Append("\tint32_t Store"); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append('('); + AppendCppTypeName( + type, + builders.CppGlobalStateAndFunctions); + builders.CppGlobalStateAndFunctions.Append("* del)\n"); + builders.CppGlobalStateAndFunctions.Append("\t{\n"); + builders.CppGlobalStateAndFunctions.Append("\t\tassert(NextFree"); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append(" != nullptr);\n"); + builders.CppGlobalStateAndFunctions.Append("\t\t"); + AppendCppTypeName( + type, + builders.CppGlobalStateAndFunctions); + builders.CppGlobalStateAndFunctions.Append("** pNext = NextFree"); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append(";\n"); + builders.CppGlobalStateAndFunctions.Append("\t\tNextFree"); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append(" = ("); + AppendCppTypeName( + type, + builders.CppGlobalStateAndFunctions); + builders.CppGlobalStateAndFunctions.Append("**)*pNext;\n"); + builders.CppGlobalStateAndFunctions.Append("\t\t*pNext = del;\n"); + builders.CppGlobalStateAndFunctions.Append("\t\treturn (int32_t)(pNext - "); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append("FreeList);\n"); + builders.CppGlobalStateAndFunctions.Append("\t}\n"); + builders.CppGlobalStateAndFunctions.Append("\t\n"); + builders.CppGlobalStateAndFunctions.Append('\t'); + AppendCppTypeName( + type, + builders.CppGlobalStateAndFunctions); + builders.CppGlobalStateAndFunctions.Append("* Get"); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append("(int32_t handle)\n"); + builders.CppGlobalStateAndFunctions.Append("\t{\n"); + builders.CppGlobalStateAndFunctions.Append("\t\tassert(handle >= 0 && handle < "); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append("FreeListSize);\n"); + builders.CppGlobalStateAndFunctions.Append("\t\treturn "); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append("FreeList[handle];\n"); + builders.CppGlobalStateAndFunctions.Append("\t}\n"); + builders.CppGlobalStateAndFunctions.Append("\t\n"); + builders.CppGlobalStateAndFunctions.Append("\tvoid Remove"); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append("(int32_t handle)\n"); + builders.CppGlobalStateAndFunctions.Append("\t{\n"); + builders.CppGlobalStateAndFunctions.Append("\t\t"); + AppendCppTypeName( + type, + builders.CppGlobalStateAndFunctions); + builders.CppGlobalStateAndFunctions.Append("** pRelease = "); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append("FreeList + handle;\n"); + builders.CppGlobalStateAndFunctions.Append("\t\t*pRelease = ("); + AppendCppTypeName( + type, + builders.CppGlobalStateAndFunctions); + builders.CppGlobalStateAndFunctions.Append("*)NextFree"); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append(";\n"); + builders.CppGlobalStateAndFunctions.Append("\t\tNextFree"); + builders.CppGlobalStateAndFunctions.Append(typeName); + builders.CppGlobalStateAndFunctions.Append(" = pRelease;\n"); + builders.CppGlobalStateAndFunctions.Append("\t}\n"); + + // Free list init + builders.CppInitBody.Append('\t'); + builders.CppInitBody.Append(typeName); + builders.CppInitBody.Append("FreeListSize = "); + if (maxSimultaneous.HasValue) + { + builders.CppInitBody.Append(maxSimultaneous); + } + else + { + builders.CppInitBody.Append("maxManagedObjects"); + } + builders.CppInitBody.Append(";\n"); + builders.CppInitBody.Append("\t"); + builders.CppInitBody.Append(typeName); + builders.CppInitBody.Append("FreeList = new "); + AppendCppTypeName( + type, + builders.CppInitBody); + builders.CppInitBody.Append("*["); + builders.CppInitBody.Append(typeName); + builders.CppInitBody.Append("FreeListSize];\n"); + builders.CppInitBody.Append("\tfor (int32_t i = 0, end = "); + builders.CppInitBody.Append(typeName); + builders.CppInitBody.Append("FreeListSize - 1; i < end; ++i)\n"); + builders.CppInitBody.Append("\t{\n"); + builders.CppInitBody.Append("\t "); + builders.CppInitBody.Append(typeName); + builders.CppInitBody.Append("FreeList[i] = ("); + AppendCppTypeName( + type, + builders.CppInitBody); + builders.CppInitBody.Append("*)("); + builders.CppInitBody.Append(typeName); + builders.CppInitBody.Append("FreeList + i + 1);\n"); + builders.CppInitBody.Append("\t}\n"); + builders.CppInitBody.Append('\t'); + builders.CppInitBody.Append(typeName); + builders.CppInitBody.Append("FreeList["); + builders.CppInitBody.Append(typeName); + builders.CppInitBody.Append("FreeListSize - 1] = nullptr;\n"); + builders.CppInitBody.Append("\tNextFree"); + builders.CppInitBody.Append(typeName); + builders.CppInitBody.Append(" = "); + builders.CppInitBody.Append(typeName); + builders.CppInitBody.Append("FreeList + 1;\n"); + + // C++ type declaration + int indent = AppendCppTypeDeclaration( + type.Namespace, + numberedTypeName, + false, + typeParams, + builders.CppTypeDeclarations); + + // C++ type definition (begin) + AppendCppTypeDefinitionBegin( + numberedTypeName, + type.Namespace, + TypeKind.Class, + typeParams, + "Object", + "System", + null, + false, + indent, + builders.CppTypeDefinitions); + + // C++ type fields + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("int32_t CppHandle;\n"); + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("int32_t DelegateHandle;\n"); + + // C++ method declarations + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + numberedTypeName, + false, + false, + false, + false, + null, + null, + new ParameterInfo[0], + builders.CppTypeDefinitions); + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + "Invoke", + false, + false, + false, + false, + invokeMethod.ReturnType, + null, + invokeParams, + builders.CppTypeDefinitions); + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + "operator()", + false, + true, + false, + true, + invokeMethod.ReturnType, + null, + invokeParams, + builders.CppTypeDefinitions); + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + "operator+=", + false, + false, + false, + false, + typeof(void), + null, + addRemoveCppParams, + builders.CppTypeDefinitions); + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + "operator-=", + false, + false, + false, + false, + typeof(void), + null, + addRemoveCppParams, + builders.CppTypeDefinitions); + + // C++ function pointers + AppendCppFunctionPointerDefinition( + releaseFuncName, + true, + null, + null, + TypeKind.None, + releaseParams, + typeof(void), + builders.CppFunctionPointers); + AppendCppFunctionPointerDefinition( + constructorFuncName, + true, + null, + null, + TypeKind.None, + constructorParams, + typeof(void), + builders.CppFunctionPointers); + AppendCppFunctionPointerDefinition( + invokeFuncName, + false, + null, + null, + TypeKind.None, + invokeParams, + invokeMethod.ReturnType, + builders.CppFunctionPointers); + AppendCppFunctionPointerDefinition( + addFuncName, + false, + null, + null, + TypeKind.None, + addRemoveCppParams, + typeof(void), + builders.CppFunctionPointers); + AppendCppFunctionPointerDefinition( + removeFuncName, + false, + null, + null, + TypeKind.None, + addRemoveCppParams, + typeof(void), + builders.CppFunctionPointers); + + // C++ init params + AppendCppInitParam( + releaseFuncNameLower, + true, + null, + null, + TypeKind.None, + releaseParams, + typeof(void), + builders.CppInitParams); + AppendCppInitParam( + constructorFuncNameLower, + true, + null, + null, + TypeKind.None, + constructorParams, + typeof(void), + builders.CppInitParams); + AppendCppInitParam( + invokeFuncNameLower, + false, + null, + null, + TypeKind.None, + invokeParams, + invokeMethod.ReturnType, + builders.CppInitParams); + AppendCppInitParam( + addFuncNameLower, + false, + null, + null, + TypeKind.None, + addRemoveCppParams, + typeof(void), + builders.CppInitParams); + AppendCppInitParam( + removeFuncNameLower, + false, + null, + null, + TypeKind.None, + addRemoveCppParams, + typeof(void), + builders.CppInitParams); + + // C++ init body + AppendCppInitBody( + releaseFuncName, + releaseFuncNameLower, + builders.CppInitBody); + AppendCppInitBody( + constructorFuncName, + constructorFuncNameLower, + builders.CppInitBody); + AppendCppInitBody( + invokeFuncName, + invokeFuncNameLower, + builders.CppInitBody); + AppendCppInitBody( + addFuncName, + addFuncNameLower, + builders.CppInitBody); + AppendCppInitBody( + removeFuncName, + removeFuncNameLower, + builders.CppInitBody); + + // C++ method definitions (begin) + AppendCppMethodDefinitionsBegin( + numberedTypeName, + type.Namespace, + TypeKind.Class, + typeParams, + "Object", + "System", + null, + false, + indent, + false, + builders.CppMethodDefinitions); + + // C++ constructor + AppendCppMethodDefinitionBegin( + numberedTypeName, + null, + numberedTypeName, + typeParams, + null, + new ParameterInfo[0], + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(" : System::Object(nullptr)\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("CppHandle = Plugin::Store"); + builders.CppMethodDefinitions.Append(typeName); + builders.CppMethodDefinitions.Append("(this);\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Plugin::"); + builders.CppMethodDefinitions.Append(constructorFuncName); + builders.CppMethodDefinitions.Append("(CppHandle, &Handle, &DelegateHandle);\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("if (Handle)\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Plugin::ReferenceManagedClass(Handle);\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("else\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Plugin::Remove"); + builders.CppMethodDefinitions.Append(typeName); + builders.CppMethodDefinitions.Append("(CppHandle);\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendCppUnhandledExceptionHandling( + indent + 1, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + + // C++ Invoke + AppendCppMethodDefinitionBegin( + numberedTypeName, + invokeMethod.ReturnType, + "Invoke", + typeParams, + null, + invokeParams, + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendCppPluginFunctionCall( + false, + type.Name, + type.Namespace, + TypeKind.Class, + typeParams, + invokeMethod.ReturnType, + invokeFuncName, + invokeParams, + indent + 1, + builders.CppMethodDefinitions); + AppendCppMethodReturn( + invokeMethod.ReturnType, + invokeReturnTypeKind, + indent + 1, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + + // C++ destructor + AppendCppDestructorDefinitionBegin( + numberedTypeName, + type.Namespace, + TypeKind.Class, + typeParams, + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Plugin::Release"); + builders.CppMethodDefinitions.Append(typeName); + builders.CppMethodDefinitions.Append("(Handle, DelegateHandle);\n"); + AppendCppUnhandledExceptionHandling( + indent + 2, + builders.CppMethodDefinitions); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Plugin::Remove"); + builders.CppMethodDefinitions.Append(typeName); + builders.CppMethodDefinitions.Append("(CppHandle);\n"); + AppendCppDestructorDefinitionEnd( + indent, + builders.CppMethodDefinitions); + + // C++ add + AppendCppMethodDefinitionBegin( + numberedTypeName, + typeof(void), + "operator+=", + typeParams, + null, + addRemoveCppParams, + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Plugin::"); + builders.CppMethodDefinitions.Append(addFuncName); + builders.CppMethodDefinitions.Append("(Handle, del.DelegateHandle);\n"); + AppendCppUnhandledExceptionHandling( + indent + 1, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + + // C++ remove + AppendCppMethodDefinitionBegin( + numberedTypeName, + typeof(void), + "operator-=", + typeParams, + null, + addRemoveCppParams, + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Plugin::"); + builders.CppMethodDefinitions.Append(removeFuncName); + builders.CppMethodDefinitions.Append("(Handle, del.DelegateHandle);\n"); + AppendCppUnhandledExceptionHandling( + indent + 1, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + + // C++ CppInvoke function + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("DLLEXPORT "); + if (invokeMethod.ReturnType == typeof(void)) + { + builders.CppMethodDefinitions.Append("void"); + } + else + { + switch (invokeReturnTypeKind) + { + case TypeKind.Class: + case TypeKind.ManagedStruct: + builders.CppMethodDefinitions.Append("int32_t"); + break; + default: + AppendCppTypeName( + invokeMethod.ReturnType, + builders.CppMethodDefinitions); + break; + } + } + builders.CppMethodDefinitions.Append(' '); + AppendCsharpDelegateName( + type.Name, + type.Namespace, + typeParams, + "CppInvoke", + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("(int32_t cppHandle"); + if (invokeParams.Length > 0) + { + builders.CppMethodDefinitions.Append(", "); + } + AppendCppParameterDeclaration( + invokeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(")\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + if (invokeMethod.ReturnType != typeof(void)) + { + builders.CppMethodDefinitions.Append("return "); + } + builders.CppMethodDefinitions.Append("(*Plugin::Get"); + builders.CppMethodDefinitions.Append(typeName); + builders.CppMethodDefinitions.Append("(cppHandle))("); + AppendParameterCall( + invokeParams, + " ", + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(")"); + if ( + invokeMethod.ReturnType != typeof(void) && + (invokeReturnTypeKind == TypeKind.Class || + invokeReturnTypeKind == TypeKind.ManagedStruct)) + { + builders.CppMethodDefinitions.Append(".Handle"); + } + builders.CppMethodDefinitions.Append(";\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + + // C++ method definitions (end) + AppendCppMethodDefinitionsEnd( + indent, + builders.CppMethodDefinitions); + + // C++ type definition (end) + AppendCppTypeDefinitionEnd( + false, + indent, + builders.CppTypeDefinitions); + + // C# delegate + AppendCsharpDelegate( + false, + type.Name, + type.Namespace, + typeParams, + "CppInvoke", + invokeParams, + invokeMethod.ReturnType, + invokeReturnTypeKind, + builders.CsharpDelegates); + + // C# GetDelegate call + AppendCsharpGetDelegateCall( + type.Name, + type.Namespace, + typeParams, + "CppInvoke", + builders.CsharpGetDelegateCalls); + + // C# import + AppendCsharpImport( + type.Name, + type.Namespace, + typeParams, + "CppInvoke", + invokeParams, + builders.CsharpImports); + + // C# class + builders.CsharpFunctions.Append("\t\tclass "); + builders.CsharpFunctions.Append(typeName); + builders.CsharpFunctions.Append("\n"); + builders.CsharpFunctions.Append("\t\t{\n"); + builders.CsharpFunctions.Append("\t\t\tpublic int CppHandle;\n"); + builders.CsharpFunctions.Append("\t\t\tpublic "); + AppendCsharpTypeName( + type, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(" Delegate;\n"); + builders.CsharpFunctions.Append("\t\t\t\n"); + builders.CsharpFunctions.Append("\t\t\tpublic "); + builders.CsharpFunctions.Append(typeName); + builders.CsharpFunctions.Append("(int cppHandle)\n"); + builders.CsharpFunctions.Append("\t\t\t{\n"); + builders.CsharpFunctions.Append("\t\t\t\tCppHandle = cppHandle;\n"); + builders.CsharpFunctions.Append("\t\t\t\tDelegate = Invoke;\n"); + builders.CsharpFunctions.Append("\t\t\t}"); + builders.CsharpFunctions.Append("\t\t\t\n"); + builders.CsharpFunctions.Append("\t\t\tpublic "); + AppendCsharpTypeName( + invokeMethod.ReturnType, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(" Invoke("); + AppendCsharpParameterDeclaration( + invokeParams, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(")\n"); + builders.CsharpFunctions.Append("\t\t\t{\n"); + builders.CsharpFunctions.Append("\t\t\t\tif (CppHandle != 0)\n"); + builders.CsharpFunctions.Append("\t\t\t\t{\n"); + builders.CsharpFunctions.Append("\t\t\t\t\t"); + if (invokeMethod.ReturnType != typeof(void)) + { + builders.CsharpFunctions.Append("return "); + if (invokeReturnTypeKind == TypeKind.Class) + { + if (invokeMethod.ReturnType != typeof(object)) + { + builders.CsharpFunctions.Append('('); + AppendCsharpTypeName( + invokeMethod.ReturnType, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(')'); + } + AppendHandleStoreTypeName( + invokeMethod.ReturnType, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(".Get("); + } + else if (invokeReturnTypeKind == TypeKind.ManagedStruct) + { + AppendHandleStoreTypeName( + invokeMethod.ReturnType, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(".Get("); + } + } + AppendCsharpDelegateName( + type.Name, + type.Namespace, + typeParams, + "CppInvoke", + builders.CsharpFunctions); + builders.CsharpFunctions.Append("(CppHandle"); + if (invokeParams.Length > 0) + { + builders.CsharpFunctions.Append(", "); + } + AppendParameterCall( + invokeParams, + " ", + builders.CsharpFunctions); + builders.CsharpFunctions.Append(")"); + if (invokeMethod.ReturnType != typeof(void) && + (invokeReturnTypeKind == TypeKind.Class || + invokeReturnTypeKind == TypeKind.ManagedStruct)) + { + builders.CsharpFunctions.Append(')'); + } + builders.CsharpFunctions.Append(";\n"); + builders.CsharpFunctions.Append("\t\t\t\t}\n"); + if (invokeMethod.ReturnType != typeof(void)) + { + builders.CsharpFunctions.Append("\t\t\t\telse\n"); + builders.CsharpFunctions.Append("\t\t\t\t{\n"); + builders.CsharpFunctions.Append("\t\t\t\t\treturn default("); + AppendCsharpTypeName( + invokeMethod.ReturnType, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(");\n"); + builders.CsharpFunctions.Append("\t\t\t\t}\n"); + } + builders.CsharpFunctions.Append("\t\t\t}\n"); + builders.CsharpFunctions.Append("\t\t}\n"); + builders.CsharpFunctions.Append("\t\t\n"); + + // C# constructor delegate type + AppendCsharpDelegateType( + constructorFuncName, + true, + type, + TypeKind.Class, + typeof(void), + constructorParams, + builders.CsharpDelegateTypes); + + // C# constructor function + AppendCsharpFunctionBeginning( + type, + constructorFuncName, + true, + TypeKind.Class, + typeof(void), + typeParams, + constructorParams, + builders.CsharpFunctions); + builders.CsharpFunctions.Append("var thiz = new "); + builders.CsharpFunctions.Append(typeName); + builders.CsharpFunctions.Append("(cppHandle);\n"); + builders.CsharpFunctions.Append("\t\t\t\thandle = NativeScript.Bindings.ObjectStore.Store(thiz);\n"); + builders.CsharpFunctions.Append("\t\t\t\tdelegateHandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate);"); + AppendCsharpFunctionReturn( + constructorParams, + typeof(void), + TypeKind.Class, + null, + true, + builders.CsharpFunctions); + + // C# release delegate type + AppendCsharpDelegateType( + releaseFuncName, + true, + type, + TypeKind.Class, + typeof(void), + releaseParams, + builders.CsharpDelegateTypes); + + // C# release function + AppendCsharpFunctionBeginning( + type, + releaseFuncName, + true, + TypeKind.Class, + typeof(void), + typeParams, + releaseParams, + builders.CsharpFunctions); + builders.CsharpFunctions.Append("var thiz = ("); + builders.CsharpFunctions.Append(typeName); + builders.CsharpFunctions.Append(")NativeScript.Bindings.ObjectStore.Remove(handle);\n"); + builders.CsharpFunctions.Append("\t\t\t\tthiz.CppHandle = 0;\n"); + builders.CsharpFunctions.Append("\t\t\t\tNativeScript.Bindings.ObjectStore.Remove(delegateHandle);"); + AppendCsharpFunctionReturn( + releaseParams, + typeof(void), + TypeKind.Class, + null, + true, + builders.CsharpFunctions); + + // C# invoke delegate type + AppendCsharpDelegateType( + invokeFuncName, + true, + type, + TypeKind.Class, + invokeMethod.ReturnType, + invokeParamsWithThis, + builders.CsharpDelegateTypes); + + // C# invoke function + AppendCsharpFunctionBeginning( + type, + invokeFuncName, + true, + TypeKind.Class, + invokeMethod.ReturnType, + typeParams, + invokeParamsWithThis, + builders.CsharpFunctions); + builders.CsharpFunctions.Append("(("); + builders.CsharpFunctions.Append(typeName); + builders.CsharpFunctions.Append(")NativeScript.Bindings.ObjectStore.Get(thisHandle)).Delegate"); + AppendCsharpFunctionCallParameters( + true, + invokeParams, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(";\n"); + AppendCsharpFunctionReturn( + invokeParams, + invokeMethod.ReturnType, + invokeReturnTypeKind, + null, + false, + builders.CsharpFunctions); + + // C# add delegate type + AppendCsharpDelegateType( + addFuncName, + true, + type, + TypeKind.Class, + typeof(void), + addRemoveCsharpParams, + builders.CsharpDelegateTypes); + + // C# add function + AppendCsharpFunctionBeginning( + type, + addFuncName, + true, + TypeKind.Class, + typeof(void), + typeParams, + addRemoveCsharpParams, + builders.CsharpFunctions); + builders.CsharpFunctions.Append("var thiz = ("); + builders.CsharpFunctions.Append(typeName); + builders.CsharpFunctions.Append(")NativeScript.Bindings.ObjectStore.Get(thisHandle);\n"); + builders.CsharpFunctions.Append("\t\t\t\tthiz.Delegate += del;"); + AppendCsharpFunctionReturn( + addRemoveCsharpParams, + typeof(void), + TypeKind.Class, + null, + true, + builders.CsharpFunctions); + + // C# remove delegate type + AppendCsharpDelegateType( + removeFuncName, + true, + type, + TypeKind.Class, + typeof(void), + addRemoveCsharpParams, + builders.CsharpDelegateTypes); + + // C# remove function + AppendCsharpFunctionBeginning( + type, + removeFuncName, + true, + TypeKind.Class, + typeof(void), + typeParams, + addRemoveCsharpParams, + builders.CsharpFunctions); + builders.CsharpFunctions.Append("var thiz = ("); + builders.CsharpFunctions.Append(typeName); + builders.CsharpFunctions.Append(")NativeScript.Bindings.ObjectStore.Get(thisHandle);\n"); + builders.CsharpFunctions.Append("\t\t\t\tthiz.Delegate -= del;"); + AppendCsharpFunctionReturn( + addRemoveCsharpParams, + typeof(void), + TypeKind.Class, + null, + true, + builders.CsharpFunctions); + + // C# init params + AppendCsharpInitParam( + releaseFuncName, + builders.CsharpInitParams); + AppendCsharpInitParam( + constructorFuncName, + builders.CsharpInitParams); + AppendCsharpInitParam( + invokeFuncName, + builders.CsharpInitParams); + AppendCsharpInitParam( + addFuncName, + builders.CsharpInitParams); + AppendCsharpInitParam( + removeFuncName, + builders.CsharpInitParams); + + // C# init call args + AppendCsharpInitCallArg( + releaseFuncName, + builders.CsharpInitCall); + AppendCsharpInitCallArg( + constructorFuncName, + builders.CsharpInitCall); + AppendCsharpInitCallArg( + invokeFuncName, + builders.CsharpInitCall); + AppendCsharpInitCallArg( + addFuncName, + builders.CsharpInitCall); + AppendCsharpInitCallArg( + removeFuncName, + builders.CsharpInitCall); + } + + static void AppendCsharpDelegate( + bool isStatic, + string typeName, + string typeNamespace, + Type[] typeParams, + string funcName, + ParameterInfo[] parameters, + Type returnType, + TypeKind returnTypeKind, + StringBuilder output) + { + output.Append("\t\tpublic delegate "); + if (returnType == typeof(void)) + { + output.Append("void"); + } + else + { + switch (returnTypeKind) + { + case TypeKind.Class: + case TypeKind.ManagedStruct: + output.Append("int"); + break; + default: + AppendCsharpTypeName( + returnType, + output); + break; + } + } + output.Append(' '); + AppendCsharpDelegateName( + typeName, + typeNamespace, + typeParams, + funcName, + output); + output.Append("Delegate("); + if (!isStatic) + { + output.Append("int thisHandle"); + if (parameters.Length > 0) + { + output.Append(", "); + } + } + for (int i = 0; i < parameters.Length; ++i) + { + ParameterInfo param = parameters[i]; + switch (param.Kind) + { + case TypeKind.FullStruct: + case TypeKind.Primitive: + case TypeKind.Enum: + AppendCsharpTypeName( + param.ParameterType, + output); + output.Append(" param"); + output.Append(i); + break; + default: + output.Append("int param"); + output.Append(i); + break; + } + if (i != parameters.Length-1) + { + output.Append(", "); + } + } + output.Append(");\n"); + output.Append("\t\tpublic static "); + AppendCsharpDelegateName( + typeName, + typeNamespace, + typeParams, + funcName, + output); + output.Append("Delegate "); + AppendCsharpDelegateName( + typeName, + typeNamespace, + typeParams, + funcName, + output); + output.Append(";\n\t\t\n"); + } + + static void AppendCsharpDelegateName( + string typeName, + string typeNamespace, + Type[] typeParams, + string funcName, + StringBuilder output) + { + AppendNamespace( + typeNamespace, + string.Empty, + output); + AppendTypeNameWithoutSuffixes( + typeName, + output); + AppendTypeNames( + typeParams, + output); + output.Append(funcName); + } + + static void AppendCsharpGetDelegateCall( + string typeName, + string typeNamespace, + Type[] typeParams, + string funcName, + StringBuilder output) + { + output.Append("\t\t\t"); + AppendCsharpDelegateName( + typeName, + typeNamespace, + typeParams, + funcName, + output); + output.Append(" = GetDelegate<"); + AppendCsharpDelegateName( + typeName, + typeNamespace, + typeParams, + funcName, + output); + output.Append("Delegate>(libraryHandle, \""); + AppendCsharpDelegateName( + typeName, + typeNamespace, + typeParams, + funcName, + output); + output.Append("\");\n"); + } + + static void AppendCsharpImport( + string typeName, + string typeNamespace, + Type[] typeParams, + string funcName, + ParameterInfo[] parameters, + StringBuilder output + ) + { + output.Append("\t\t[DllImport(Constants.PluginName)]\n"); + output.Append("\t\tpublic static extern void "); + AppendCsharpDelegateName( + typeName, + typeNamespace, + typeParams, + funcName, + output); + output.Append("(int thisHandle"); + if (parameters.Length > 0) + { + output.Append(", "); + } + for (int i = 0; i < parameters.Length; ++i) + { + ParameterInfo param = parameters[i]; + if (param.Kind == TypeKind.FullStruct) + { + AppendCsharpTypeName( + param.ParameterType, + output); + output.Append(" param"); + output.Append(i); + } + else + { + output.Append("int param"); + output.Append(i); + } + if (i != parameters.Length-1) + { + output.Append(", "); + } + } + output.Append(");\n\t\t\n"); + } + + static void AppendExceptions( + JsonDocument doc, + Assembly[] assemblies, + StringBuilders builders) + { + // Gather all specific types of exceptions + Dictionary exceptionTypes = new Dictionary(); + if (doc.Types != null) + { + foreach (JsonType jsonType in doc.Types) + { + if (jsonType.Methods != null) + { + foreach (JsonMethod jsonMethod in jsonType.Methods) + { + if (jsonMethod.Exceptions != null) + { + AddUniqueTypes( + jsonMethod.Exceptions, + exceptionTypes, + assemblies); + } + } } if (jsonType.Constructors != null) { @@ -4411,6 +5795,8 @@ static void AppendExceptions( // C# imports AppendCsharpImport( string.Empty, + string.Empty, + null, funcName, parameters, builders.CsharpImports); @@ -4419,14 +5805,20 @@ static void AppendExceptions( AppendCsharpDelegate( true, string.Empty, + string.Empty, + null, funcName, parameters, + typeof(void), + TypeKind.None, builders.CsharpDelegates ); // C# GetDelegate call AppendCsharpGetDelegateCall( string.Empty, + string.Empty, + null, funcName, builders.CsharpGetDelegateCalls); } @@ -4590,14 +5982,16 @@ static void AppendGetter( AppendCppMethodDeclaration( methodName, enclosingTypeIsStatic, + false, methodIsStatic, + false, fieldType, null, parameters, builders.CppTypeDefinitions); // C++ method definition - AppendCppMethodDefinition( + AppendCppMethodDefinitionBegin( enclosingType.Name, fieldType, methodName, @@ -4788,14 +6182,16 @@ static void AppendSetter( AppendCppMethodDeclaration( methodName, enclosingTypeIsStatic, + false, methodIsStatic, + false, typeof(void), null, parameters, builders.CppTypeDefinitions); // C++ method definition - AppendCppMethodDefinition( + AppendCppMethodDefinitionBegin( enclosingType.Name, typeof(void), methodName, @@ -4840,6 +6236,33 @@ static void AppendSetter( builders.CppInitBody); } + static void AppendCppTemplateDeclaration( + string typeName, + string typeNamespace, + int numTypeParameters, + StringBuilder output) + { + int indent = AppendNamespaceBeginning( + typeNamespace, + output); + AppendIndent( + indent, + output); + AppendCppTemplateTypenames( + numTypeParameters, + output); + output.Append("struct "); + AppendTypeNameWithoutGenericSuffix( + typeName, + output); + output.Append(";"); + output.Append('\n'); + AppendNamespaceEnding( + indent, + output); + output.Append('\n'); + } + static int AppendCppTypeDeclaration( string typeNamespace, string typeName, @@ -4896,8 +6319,7 @@ static void AppendCppTypeDefinitionBegin( Type[] baseTypeTypeParams, bool isStatic, int indent, - StringBuilder output - ) + StringBuilder output) { AppendNamespaceBeginning( typeNamespace, @@ -5107,7 +6529,7 @@ static void AppendCppTypeDefinitionEnd( output.Append('\n'); } - static int AppendCppMethodDefinitionBegin( + static int AppendCppMethodDefinitionsBegin( string enclosingTypeName, string enclosingTypeNamespace, TypeKind enclosingTypeKind, @@ -5117,6 +6539,7 @@ static int AppendCppMethodDefinitionBegin( Type[] baseTypeTypeParams, bool isStatic, int indent, + bool includeDestructor, StringBuilder output) { int cppMethodDefinitionsIndent = AppendNamespaceBeginning( @@ -5298,45 +6721,28 @@ static int AppendCppMethodDefinitionBegin( AppendIndent(indent, output); output.Append("\n"); - // Destructor - AppendIndent(indent, output); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, - output); - AppendCppTypeParameters( - enclosingTypeParams, - output); - output.Append("::~"); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, - output); - AppendCppTypeParameters( - enclosingTypeParams, - output); - output.Append("()\n"); - AppendIndent(indent, output); - output.Append("{\n"); - AppendIndent(indent + 1, output); - output.Append("if (Handle)\n"); - AppendIndent(indent + 1, output); - output.Append("{\n"); - AppendIndent(indent + 2, output); - AppendDereferenceManagedHandleFunctionCall( - enclosingTypeName, - enclosingTypeNamespace, - enclosingTypeKind, - enclosingTypeParams, - "Handle", - output); - output.Append(";\n"); - AppendIndent(indent + 2, output); - output.Append("Handle = 0;\n"); - AppendIndent(indent + 1, output); - output.Append("}\n"); - AppendIndent(indent, output); - output.Append("}\n"); - AppendIndent(indent, output); - output.Append("\n"); + if (includeDestructor) + { + AppendCppDestructorDefinitionBegin( + enclosingTypeName, + enclosingTypeNamespace, + enclosingTypeKind, + enclosingTypeParams, + indent, + output); + AppendIndent(indent + 2, output); + AppendDereferenceManagedHandleFunctionCall( + enclosingTypeName, + enclosingTypeNamespace, + enclosingTypeKind, + enclosingTypeParams, + "Handle", + output); + output.Append(";\n"); + AppendCppDestructorDefinitionEnd( + indent, + output); + } // Assignment operator to same type AppendIndent(indent, output); @@ -5529,6 +6935,51 @@ static int AppendCppMethodDefinitionBegin( return cppMethodDefinitionsIndent; } + static void AppendCppDestructorDefinitionBegin( + string enclosingTypeName, + string enclosingTypeNamespace, + TypeKind enclosingTypeKind, + Type[] enclosingTypeParams, + int indent, + StringBuilder output) + { + AppendIndent(indent, output); + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, + output); + AppendCppTypeParameters( + enclosingTypeParams, + output); + output.Append("::~"); + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, + output); + AppendCppTypeParameters( + enclosingTypeParams, + output); + output.Append("()\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent + 1, output); + output.Append("if (Handle)\n"); + AppendIndent(indent + 1, output); + output.Append("{\n"); + } + + static void AppendCppDestructorDefinitionEnd( + int indent, + StringBuilder output) + { + AppendIndent(indent + 2, output); + output.Append("Handle = 0;\n"); + AppendIndent(indent + 1, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("\n"); + } + static void AppendSetHandle( string enclosingTypeName, string enclosingTypeNamespace, @@ -5643,7 +7094,7 @@ static void AppendDereferenceManagedHandleFunctionCall( } } - static void AppendCppMethodDefinitionEnd( + static void AppendCppMethodDefinitionsEnd( int indent, StringBuilder output) { @@ -6192,7 +7643,9 @@ static void AppendCppParameterDeclaration( { output.Append('*'); } - else if (param.Kind == TypeKind.FullStruct) + else if ( + param.Kind == TypeKind.FullStruct || + param.IsVirtual) { output.Append('&'); } @@ -6242,7 +7695,7 @@ static void AppendCppInitBody( output.Append(";\n"); } - static void AppendCppMethodDefinition( + static void AppendCppMethodDefinitionBegin( string enclosingTypeName, Type returnType, string methodName, @@ -6410,21 +7863,9 @@ static void AppendCppPluginFunctionCall( } output.Append(");\n"); - // Handle uncaught exceptions from the C# side - AppendIndent(indent, output); - output.Append("if (Plugin::unhandledCsharpException)\n"); - AppendIndent(indent, output); - output.Append("{\n"); - AppendIndent(indent + 1, output); - output.Append("System::Exception* ex = Plugin::unhandledCsharpException;\n"); - AppendIndent(indent + 1, output); - output.Append("Plugin::unhandledCsharpException = nullptr;\n"); - AppendIndent(indent + 1, output); - output.Append("ex->ThrowReferenceToThis();\n"); - AppendIndent(indent + 1, output); - output.Append("delete ex;\n"); - AppendIndent(indent, output); - output.Append("}\n"); + AppendCppUnhandledExceptionHandling( + indent, + output); // Set out and ref parameters foreach (ParameterInfo param in parameters) @@ -6446,6 +7887,26 @@ static void AppendCppPluginFunctionCall( } } + static void AppendCppUnhandledExceptionHandling( + int indent, + StringBuilder output) + { + AppendIndent(indent, output); + output.Append("if (Plugin::unhandledCsharpException)\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent + 1, output); + output.Append("System::Exception* ex = Plugin::unhandledCsharpException;\n"); + AppendIndent(indent + 1, output); + output.Append("Plugin::unhandledCsharpException = nullptr;\n"); + AppendIndent(indent + 1, output); + output.Append("ex->ThrowReferenceToThis();\n"); + AppendIndent(indent + 1, output); + output.Append("delete ex;\n"); + AppendIndent(indent, output); + output.Append("}\n"); + } + static void AppendCppInitParam( string funcName, bool isStatic, @@ -6619,7 +8080,9 @@ static void AppendCppTemplateTypenames( static void AppendCppMethodDeclaration( string methodName, bool enclosingTypeIsStatic, + bool methodIsVirtual, bool methodIsStatic, + bool methodIsPure, Type returnType, Type[] typeParameters, ParameterInfo[] parameters, @@ -6634,6 +8097,11 @@ static void AppendCppMethodDeclaration( output.Append("static "); } + if (methodIsVirtual) + { + output.Append("virtual "); + } + // Return type if (returnType != null) { @@ -6654,7 +8122,14 @@ static void AppendCppMethodDeclaration( AppendCppParameterDeclaration( parameters, output); - output.Append(");\n"); + output.Append(')'); + + if (methodIsPure) + { + output.Append(" = 0"); + } + + output.Append(";\n"); } static void AppendCsharpTypeName( @@ -6819,6 +8294,21 @@ static void AppendCppTypeName( } output.Append('>'); } + else if (typeof(Delegate).IsAssignableFrom(type)) + { + AppendCppTypeName( + type.Namespace, + type.Name, + output); + Type[] genTypes = type.GetGenericArguments(); + if (genTypes != null && genTypes.Length > 0) + { + output.Append(genTypes.Length); + } + AppendCppTypeParameters( + genTypes, + output); + } else { AppendCppTypeName( @@ -7043,14 +8533,9 @@ static void InjectBuilders( builders.CppMonoBehaviourMessages.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN REF COUNTS STATE AND FUNCTIONS*/\n", - "\n\t/*END REF COUNTS STATE AND FUNCTIONS*/", - builders.CppRefCountsStateAndFunctions.ToString()); - cppSourceContents = InjectIntoString( - cppSourceContents, - "/*BEGIN REF COUNTS INIT*/\n", - "\n\t/*END REF COUNTS INIT*/", - builders.CppRefCountsInit.ToString()); + "/*BEGIN GLOBAL STATE AND FUNCTIONS*/\n", + "\n\t/*END GLOBAL STATE AND FUNCTIONS*/", + builders.CppGlobalStateAndFunctions.ToString()); File.WriteAllText(CsharpPath, csharpContents); File.WriteAllText(CppHeaderPath, cppHeaderContents); diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 38df5bf..820fa53 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -523,5 +523,53 @@ { "Type": "UnityEngine.GradientColorKey" } + ], + "Delegates": [ + { + "Type": "System.Action" + }, + { + "Type": "System.Action`1", + "GenericParams": [ + { + "Types": [ + "System.Single" + ] + } + ] + }, + { + "Type": "System.Action`2", + "GenericParams": [ + { + "Types": [ + "System.Single", + "System.Single" + ], + "MaxSimultaneous": 100 + } + ] + }, + { + "Type": "System.Func`3", + "GenericParams": [ + { + "Types": [ + "System.Int32", + "System.Single", + "System.Double" + ], + "MaxSimultaneous": 50 + }, + { + "Types": [ + "System.Int16", + "System.Int32", + "System.String" + ], + "MaxSimultaneous": 25 + } + ] + } ] } \ No newline at end of file diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index bd75de3..bbd9f9b 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -9,20 +9,87 @@ /// #include "Bindings.h" +#include using namespace System; using namespace UnityEngine; void PrintPlatformDefines(); +struct PlainAction : System::Action +{ + void operator()() override + { + Debug::Log(String("PlainAction invoked")); + } +}; + +struct FloatAction : System::Action1 +{ + void operator()(float param) override + { + Debug::Log(String("FloatAction invoked")); + } +}; + +struct MyClickHandler : System::Action2 +{ + void operator()(float x, float y) override + { + Debug::Log(String("clicked")); + } +}; + +struct MyIntFloatDoubleFunc : System::Func3 +{ + double operator()(int32_t i, float f) override + { + Debug::Log(String("int float double Func invoked")); + return 2.34; + } +}; + +struct FuncReturningString : System::Func3 +{ + String operator()(int16_t s, int32_t i) override + { + Debug::Log(String("returning a string")); + return String("returned from Func"); + } +}; + // Called when the plugin is initialized // This is mostly full of test code. Feel free to remove it all. void PluginMain() { PrintPlatformDefines(); Debug::Log(String("Game booted up")); - - GameObject go("GameObject with a TestScript"); + + MyClickHandler mch1; + MyClickHandler mch2; + mch1 += mch2; + mch1.Invoke(123, 456); + Debug::Log(String("Removed")); + mch1 -= mch2; + mch1.Invoke(123, 456); + + MyIntFloatDoubleFunc mifdf; + double d = mifdf.Invoke(123, 3.14f); + char buf[1024]; + sprintf(buf, "%lf", d); + Debug::Log(String(buf)); + + FuncReturningString frs; + String str = frs.Invoke(11, 22); + Debug::Log(str); + + FloatAction fa; + fa.Invoke(3.14f); + + PlainAction pa; + pa.Invoke(); + + GameObject go(String("GameObject with a TestScript")); go.AddComponent(); } diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 81ce27e..cd3b93f 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -129,6 +129,31 @@ namespace Plugin int32_t (*UnityEngineGradientColorKeyArray1Constructor1)(int32_t length0); UnityEngine::GradientColorKey (*UnityEngineGradientColorKeyArray1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*UnityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item); + void (*ReleaseSystemAction)(int32_t handle, int32_t delegateHandle); + void (*SystemActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle); + void (*SystemActionInvoke)(int32_t thisHandle); + void (*SystemActionAdd)(int32_t thisHandle, int32_t delHandle); + void (*SystemActionRemove)(int32_t thisHandle, int32_t delHandle); + void (*ReleaseSystemActionSystemSingle)(int32_t handle, int32_t delegateHandle); + void (*SystemActionSystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle); + void (*SystemActionSystemSingleInvoke)(int32_t thisHandle, float obj); + void (*SystemActionSystemSingleAdd)(int32_t thisHandle, int32_t delHandle); + void (*SystemActionSystemSingleRemove)(int32_t thisHandle, int32_t delHandle); + void (*ReleaseSystemActionSystemSingle_SystemSingle)(int32_t handle, int32_t delegateHandle); + void (*SystemActionSystemSingle_SystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle); + void (*SystemActionSystemSingle_SystemSingleInvoke)(int32_t thisHandle, float arg1, float arg2); + void (*SystemActionSystemSingle_SystemSingleAdd)(int32_t thisHandle, int32_t delHandle); + void (*SystemActionSystemSingle_SystemSingleRemove)(int32_t thisHandle, int32_t delHandle); + void (*ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble)(int32_t handle, int32_t delegateHandle); + void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle); + double (*SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)(int32_t thisHandle, int32_t arg1, float arg2); + void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd)(int32_t thisHandle, int32_t delHandle); + void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove)(int32_t thisHandle, int32_t delHandle); + void (*ReleaseSystemFuncSystemInt16_SystemInt32_SystemString)(int32_t handle, int32_t delegateHandle); + void (*SystemFuncSystemInt16_SystemInt32_SystemStringConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle); + int32_t (*SystemFuncSystemInt16_SystemInt32_SystemStringInvoke)(int32_t thisHandle, int16_t arg1, int32_t arg2); + void (*SystemFuncSystemInt16_SystemInt32_SystemStringAdd)(int32_t thisHandle, int32_t delHandle); + void (*SystemFuncSystemInt16_SystemInt32_SystemStringRemove)(int32_t thisHandle, int32_t delHandle); /*END FUNCTION POINTERS*/ } @@ -163,7 +188,7 @@ namespace Plugin } } - /*BEGIN REF COUNTS STATE AND FUNCTIONS*/ + /*BEGIN GLOBAL STATE AND FUNCTIONS*/ int32_t RefCountsLenUnityEngineRaycastHit; int32_t* RefCountsUnityEngineRaycastHit; @@ -214,8 +239,133 @@ namespace Plugin } } + int32_t SystemActionFreeListSize; + System::Action** SystemActionFreeList; + System::Action** NextFreeSystemAction; + + int32_t StoreSystemAction(System::Action* del) + { + assert(NextFreeSystemAction != nullptr); + System::Action** pNext = NextFreeSystemAction; + NextFreeSystemAction = (System::Action**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemActionFreeList); + } + + System::Action* GetSystemAction(int32_t handle) + { + assert(handle >= 0 && handle < SystemActionFreeListSize); + return SystemActionFreeList[handle]; + } + + void RemoveSystemAction(int32_t handle) + { + System::Action** pRelease = SystemActionFreeList + handle; + *pRelease = (System::Action*)NextFreeSystemAction; + NextFreeSystemAction = pRelease; + } + int32_t SystemActionSystemSingleFreeListSize; + System::Action1** SystemActionSystemSingleFreeList; + System::Action1** NextFreeSystemActionSystemSingle; + + int32_t StoreSystemActionSystemSingle(System::Action1* del) + { + assert(NextFreeSystemActionSystemSingle != nullptr); + System::Action1** pNext = NextFreeSystemActionSystemSingle; + NextFreeSystemActionSystemSingle = (System::Action1**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemActionSystemSingleFreeList); + } + + System::Action1* GetSystemActionSystemSingle(int32_t handle) + { + assert(handle >= 0 && handle < SystemActionSystemSingleFreeListSize); + return SystemActionSystemSingleFreeList[handle]; + } + + void RemoveSystemActionSystemSingle(int32_t handle) + { + System::Action1** pRelease = SystemActionSystemSingleFreeList + handle; + *pRelease = (System::Action1*)NextFreeSystemActionSystemSingle; + NextFreeSystemActionSystemSingle = pRelease; + } + int32_t SystemActionSystemSingle_SystemSingleFreeListSize; + System::Action2** SystemActionSystemSingle_SystemSingleFreeList; + System::Action2** NextFreeSystemActionSystemSingle_SystemSingle; + + int32_t StoreSystemActionSystemSingle_SystemSingle(System::Action2* del) + { + assert(NextFreeSystemActionSystemSingle_SystemSingle != nullptr); + System::Action2** pNext = NextFreeSystemActionSystemSingle_SystemSingle; + NextFreeSystemActionSystemSingle_SystemSingle = (System::Action2**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemActionSystemSingle_SystemSingleFreeList); + } + + System::Action2* GetSystemActionSystemSingle_SystemSingle(int32_t handle) + { + assert(handle >= 0 && handle < SystemActionSystemSingle_SystemSingleFreeListSize); + return SystemActionSystemSingle_SystemSingleFreeList[handle]; + } + + void RemoveSystemActionSystemSingle_SystemSingle(int32_t handle) + { + System::Action2** pRelease = SystemActionSystemSingle_SystemSingleFreeList + handle; + *pRelease = (System::Action2*)NextFreeSystemActionSystemSingle_SystemSingle; + NextFreeSystemActionSystemSingle_SystemSingle = pRelease; + } + int32_t SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize; + System::Func3** SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList; + System::Func3** NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble; + + int32_t StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(System::Func3* del) + { + assert(NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble != nullptr); + System::Func3** pNext = NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble; + NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble = (System::Func3**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList); + } + + System::Func3* GetSystemFuncSystemInt32_SystemSingle_SystemDouble(int32_t handle) + { + assert(handle >= 0 && handle < SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize); + return SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[handle]; + } + + void RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(int32_t handle) + { + System::Func3** pRelease = SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + handle; + *pRelease = (System::Func3*)NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble; + NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble = pRelease; + } + int32_t SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize; + System::Func3** SystemFuncSystemInt16_SystemInt32_SystemStringFreeList; + System::Func3** NextFreeSystemFuncSystemInt16_SystemInt32_SystemString; + + int32_t StoreSystemFuncSystemInt16_SystemInt32_SystemString(System::Func3* del) + { + assert(NextFreeSystemFuncSystemInt16_SystemInt32_SystemString != nullptr); + System::Func3** pNext = NextFreeSystemFuncSystemInt16_SystemInt32_SystemString; + NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = (System::Func3**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemFuncSystemInt16_SystemInt32_SystemStringFreeList); + } + + System::Func3* GetSystemFuncSystemInt16_SystemInt32_SystemString(int32_t handle) + { + assert(handle >= 0 && handle < SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize); + return SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[handle]; + } + + void RemoveSystemFuncSystemInt16_SystemInt32_SystemString(int32_t handle) + { + System::Func3** pRelease = SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + handle; + *pRelease = (System::Func3*)NextFreeSystemFuncSystemInt16_SystemInt32_SystemString; + NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = pRelease; + } - /*END REF COUNTS STATE AND FUNCTIONS*/ + /*END GLOBAL STATE AND FUNCTIONS*/ } namespace Plugin @@ -4665,6 +4815,808 @@ namespace System } } +namespace System +{ + Action::Action(std::nullptr_t n) + : System::Object(nullptr) + { + } + + Action::Action(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Action::Action(const Action& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Action::Action(Action&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Action& Action::operator=(const Action& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Action& Action::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Action& Action::operator=(Action&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Action::operator==(const Action& other) const + { + return Handle == other.Handle; + } + + bool Action::operator!=(const Action& other) const + { + return Handle != other.Handle; + } + + Action::Action() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemAction(this); + Plugin::SystemActionConstructor(CppHandle, &Handle, &DelegateHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemAction(CppHandle); + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void Action::Invoke() + { + Plugin::SystemActionInvoke(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + Action::~Action() + { + if (Handle) + { + Plugin::ReleaseSystemAction(Handle, DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Plugin::RemoveSystemAction(CppHandle); + Handle = 0; + } + } + + void Action::operator+=(System::Action& del) + { + Plugin::SystemActionAdd(Handle, del.DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void Action::operator-=(System::Action& del) + { + Plugin::SystemActionRemove(Handle, del.DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + DLLEXPORT void SystemActionCppInvoke(int32_t cppHandle) + { + (*Plugin::GetSystemAction(cppHandle))(); + } +} + +namespace System +{ + Action1::Action1(std::nullptr_t n) + : System::Object(nullptr) + { + } + + Action1::Action1(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Action1::Action1(const Action1& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Action1::Action1(Action1&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Action1& Action1::operator=(const Action1& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Action1& Action1::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Action1& Action1::operator=(Action1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Action1::operator==(const Action1& other) const + { + return Handle == other.Handle; + } + + bool Action1::operator!=(const Action1& other) const + { + return Handle != other.Handle; + } + + Action1::Action1() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemActionSystemSingle(this); + Plugin::SystemActionSystemSingleConstructor(CppHandle, &Handle, &DelegateHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemActionSystemSingle(CppHandle); + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void Action1::Invoke(float obj) + { + Plugin::SystemActionSystemSingleInvoke(Handle, obj); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + Action1::~Action1() + { + if (Handle) + { + Plugin::ReleaseSystemActionSystemSingle(Handle, DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Plugin::RemoveSystemActionSystemSingle(CppHandle); + Handle = 0; + } + } + + void Action1::operator+=(System::Action1& del) + { + Plugin::SystemActionSystemSingleAdd(Handle, del.DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void Action1::operator-=(System::Action1& del) + { + Plugin::SystemActionSystemSingleRemove(Handle, del.DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + DLLEXPORT void SystemActionSystemSingleCppInvoke(int32_t cppHandle, float obj) + { + (*Plugin::GetSystemActionSystemSingle(cppHandle))(obj); + } +} + +namespace System +{ + Action2::Action2(std::nullptr_t n) + : System::Object(nullptr) + { + } + + Action2::Action2(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Action2::Action2(const Action2& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Action2::Action2(Action2&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Action2& Action2::operator=(const Action2& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Action2& Action2::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Action2& Action2::operator=(Action2&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Action2::operator==(const Action2& other) const + { + return Handle == other.Handle; + } + + bool Action2::operator!=(const Action2& other) const + { + return Handle != other.Handle; + } + + Action2::Action2() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); + Plugin::SystemActionSystemSingle_SystemSingleConstructor(CppHandle, &Handle, &DelegateHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void Action2::Invoke(float arg1, float arg2) + { + Plugin::SystemActionSystemSingle_SystemSingleInvoke(Handle, arg1, arg2); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + Action2::~Action2() + { + if (Handle) + { + Plugin::ReleaseSystemActionSystemSingle_SystemSingle(Handle, DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); + Handle = 0; + } + } + + void Action2::operator+=(System::Action2& del) + { + Plugin::SystemActionSystemSingle_SystemSingleAdd(Handle, del.DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void Action2::operator-=(System::Action2& del) + { + Plugin::SystemActionSystemSingle_SystemSingleRemove(Handle, del.DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + DLLEXPORT void SystemActionSystemSingle_SystemSingleCppInvoke(int32_t cppHandle, float arg1, float arg2) + { + (*Plugin::GetSystemActionSystemSingle_SystemSingle(cppHandle))(arg1, arg2); + } +} + +namespace System +{ + Func3::Func3(std::nullptr_t n) + : System::Object(nullptr) + { + } + + Func3::Func3(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Func3::Func3(const Func3& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Func3::Func3(Func3&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Func3& Func3::operator=(const Func3& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Func3& Func3::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Func3& Func3::operator=(Func3&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Func3::operator==(const Func3& other) const + { + return Handle == other.Handle; + } + + bool Func3::operator!=(const Func3& other) const + { + return Handle != other.Handle; + } + + Func3::Func3() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(CppHandle, &Handle, &DelegateHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + double Func3::Invoke(int32_t arg1, float arg2) + { + auto returnValue = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(Handle, arg1, arg2); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + Func3::~Func3() + { + if (Handle) + { + Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(Handle, DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); + Handle = 0; + } + } + + void Func3::operator+=(System::Func3& del) + { + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(Handle, del.DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void Func3::operator-=(System::Func3& del) + { + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(Handle, del.DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + DLLEXPORT double SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke(int32_t cppHandle, int32_t arg1, float arg2) + { + return (*Plugin::GetSystemFuncSystemInt32_SystemSingle_SystemDouble(cppHandle))(arg1, arg2); + } +} + +namespace System +{ + Func3::Func3(std::nullptr_t n) + : System::Object(nullptr) + { + } + + Func3::Func3(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Func3::Func3(const Func3& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Func3::Func3(Func3&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Func3& Func3::operator=(const Func3& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + Func3& Func3::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Func3& Func3::operator=(Func3&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Func3::operator==(const Func3& other) const + { + return Handle == other.Handle; + } + + bool Func3::operator!=(const Func3& other) const + { + return Handle != other.Handle; + } + + Func3::Func3() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(CppHandle, &Handle, &DelegateHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + System::String Func3::Invoke(int16_t arg1, int32_t arg2) + { + auto returnValue = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(Handle, arg1, arg2); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::String(Plugin::InternalUse::Only, returnValue); + } + + Func3::~Func3() + { + if (Handle) + { + Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(Handle, DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); + Handle = 0; + } + } + + void Func3::operator+=(System::Func3& del) + { + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd(Handle, del.DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void Func3::operator-=(System::Func3& del) + { + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove(Handle, del.DelegateHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + DLLEXPORT int32_t SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke(int32_t cppHandle, int16_t arg1, int32_t arg2) + { + return (*Plugin::GetSystemFuncSystemInt16_SystemInt32_SystemString(cppHandle))(arg1, arg2).Handle; + } +} + namespace System { struct NullReferenceExceptionThrower : System::NullReferenceException @@ -4739,12 +5691,10 @@ DLLEXPORT void Init( float (*unityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column), void (*unityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value), void (*releaseUnityEngineRaycastHit)(int32_t handle), - int32_t refCountsLenUnityEngineRaycastHit, UnityEngine::Vector3 (*unityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle), void (*unityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value), int32_t (*unityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle), void (*releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)(int32_t handle), - int32_t refCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, int32_t (*systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble)(int32_t keyHandle, double value), int32_t (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)(int32_t thisHandle), double (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle), @@ -4797,7 +5747,32 @@ DLLEXPORT void Init( int32_t (*unityEngineRaycastHitArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), int32_t (*unityEngineGradientColorKeyArray1Constructor1)(int32_t length0), UnityEngine::GradientColorKey (*unityEngineGradientColorKeyArray1GetItem1)(int32_t thisHandle, int32_t index0), - int32_t (*unityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item) + int32_t (*unityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item), + void (*releaseSystemAction)(int32_t handle, int32_t delegateHandle), + void (*systemActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle), + void (*systemActionInvoke)(int32_t thisHandle), + void (*systemActionAdd)(int32_t thisHandle, int32_t delHandle), + void (*systemActionRemove)(int32_t thisHandle, int32_t delHandle), + void (*releaseSystemActionSystemSingle)(int32_t handle, int32_t delegateHandle), + void (*systemActionSystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle), + void (*systemActionSystemSingleInvoke)(int32_t thisHandle, float obj), + void (*systemActionSystemSingleAdd)(int32_t thisHandle, int32_t delHandle), + void (*systemActionSystemSingleRemove)(int32_t thisHandle, int32_t delHandle), + void (*releaseSystemActionSystemSingle_SystemSingle)(int32_t handle, int32_t delegateHandle), + void (*systemActionSystemSingle_SystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle), + void (*systemActionSystemSingle_SystemSingleInvoke)(int32_t thisHandle, float arg1, float arg2), + void (*systemActionSystemSingle_SystemSingleAdd)(int32_t thisHandle, int32_t delHandle), + void (*systemActionSystemSingle_SystemSingleRemove)(int32_t thisHandle, int32_t delHandle), + void (*releaseSystemFuncSystemInt32_SystemSingle_SystemDouble)(int32_t handle, int32_t delegateHandle), + void (*systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle), + double (*systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)(int32_t thisHandle, int32_t arg1, float arg2), + void (*systemFuncSystemInt32_SystemSingle_SystemDoubleAdd)(int32_t thisHandle, int32_t delHandle), + void (*systemFuncSystemInt32_SystemSingle_SystemDoubleRemove)(int32_t thisHandle, int32_t delHandle), + void (*releaseSystemFuncSystemInt16_SystemInt32_SystemString)(int32_t handle, int32_t delegateHandle), + void (*systemFuncSystemInt16_SystemInt32_SystemStringConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle), + int32_t (*systemFuncSystemInt16_SystemInt32_SystemStringInvoke)(int32_t thisHandle, int16_t arg1, int32_t arg2), + void (*systemFuncSystemInt16_SystemInt32_SystemStringAdd)(int32_t thisHandle, int32_t delHandle), + void (*systemFuncSystemInt16_SystemInt32_SystemStringRemove)(int32_t thisHandle, int32_t delHandle) /*END INIT PARAMS*/) { using namespace Plugin; @@ -4844,14 +5819,12 @@ DLLEXPORT void Init( Plugin::UnityEngineMatrix4x4PropertyGetItem = unityEngineMatrix4x4PropertyGetItem; Plugin::UnityEngineMatrix4x4PropertySetItem = unityEngineMatrix4x4PropertySetItem; Plugin::ReleaseUnityEngineRaycastHit = releaseUnityEngineRaycastHit; - Plugin::RefCountsLenUnityEngineRaycastHit = refCountsLenUnityEngineRaycastHit; - Plugin::RefCountsUnityEngineRaycastHit = new int32_t[refCountsLenUnityEngineRaycastHit](); + Plugin::RefCountsUnityEngineRaycastHit = new int32_t[1000](); Plugin::UnityEngineRaycastHitPropertyGetPoint = unityEngineRaycastHitPropertyGetPoint; Plugin::UnityEngineRaycastHitPropertySetPoint = unityEngineRaycastHitPropertySetPoint; Plugin::UnityEngineRaycastHitPropertyGetTransform = unityEngineRaycastHitPropertyGetTransform; Plugin::ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; - Plugin::RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = refCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; - Plugin::RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = new int32_t[refCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble](); + Plugin::RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = new int32_t[maxManagedObjects](); Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble = systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble; Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey; Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue; @@ -4905,6 +5878,71 @@ DLLEXPORT void Init( Plugin::UnityEngineGradientColorKeyArray1Constructor1 = unityEngineGradientColorKeyArray1Constructor1; Plugin::UnityEngineGradientColorKeyArray1GetItem1 = unityEngineGradientColorKeyArray1GetItem1; Plugin::UnityEngineGradientColorKeyArray1SetItem1 = unityEngineGradientColorKeyArray1SetItem1; + SystemActionFreeListSize = maxManagedObjects; + SystemActionFreeList = new System::Action*[SystemActionFreeListSize]; + for (int32_t i = 0, end = SystemActionFreeListSize - 1; i < end; ++i) + { + SystemActionFreeList[i] = (System::Action*)(SystemActionFreeList + i + 1); + } + SystemActionFreeList[SystemActionFreeListSize - 1] = nullptr; + NextFreeSystemAction = SystemActionFreeList + 1; + Plugin::ReleaseSystemAction = releaseSystemAction; + Plugin::SystemActionConstructor = systemActionConstructor; + Plugin::SystemActionInvoke = systemActionInvoke; + Plugin::SystemActionAdd = systemActionAdd; + Plugin::SystemActionRemove = systemActionRemove; + SystemActionSystemSingleFreeListSize = maxManagedObjects; + SystemActionSystemSingleFreeList = new System::Action1*[SystemActionSystemSingleFreeListSize]; + for (int32_t i = 0, end = SystemActionSystemSingleFreeListSize - 1; i < end; ++i) + { + SystemActionSystemSingleFreeList[i] = (System::Action1*)(SystemActionSystemSingleFreeList + i + 1); + } + SystemActionSystemSingleFreeList[SystemActionSystemSingleFreeListSize - 1] = nullptr; + NextFreeSystemActionSystemSingle = SystemActionSystemSingleFreeList + 1; + Plugin::ReleaseSystemActionSystemSingle = releaseSystemActionSystemSingle; + Plugin::SystemActionSystemSingleConstructor = systemActionSystemSingleConstructor; + Plugin::SystemActionSystemSingleInvoke = systemActionSystemSingleInvoke; + Plugin::SystemActionSystemSingleAdd = systemActionSystemSingleAdd; + Plugin::SystemActionSystemSingleRemove = systemActionSystemSingleRemove; + SystemActionSystemSingle_SystemSingleFreeListSize = 100; + SystemActionSystemSingle_SystemSingleFreeList = new System::Action2*[SystemActionSystemSingle_SystemSingleFreeListSize]; + for (int32_t i = 0, end = SystemActionSystemSingle_SystemSingleFreeListSize - 1; i < end; ++i) + { + SystemActionSystemSingle_SystemSingleFreeList[i] = (System::Action2*)(SystemActionSystemSingle_SystemSingleFreeList + i + 1); + } + SystemActionSystemSingle_SystemSingleFreeList[SystemActionSystemSingle_SystemSingleFreeListSize - 1] = nullptr; + NextFreeSystemActionSystemSingle_SystemSingle = SystemActionSystemSingle_SystemSingleFreeList + 1; + Plugin::ReleaseSystemActionSystemSingle_SystemSingle = releaseSystemActionSystemSingle_SystemSingle; + Plugin::SystemActionSystemSingle_SystemSingleConstructor = systemActionSystemSingle_SystemSingleConstructor; + Plugin::SystemActionSystemSingle_SystemSingleInvoke = systemActionSystemSingle_SystemSingleInvoke; + Plugin::SystemActionSystemSingle_SystemSingleAdd = systemActionSystemSingle_SystemSingleAdd; + Plugin::SystemActionSystemSingle_SystemSingleRemove = systemActionSystemSingle_SystemSingleRemove; + SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize = 50; + SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList = new System::Func3*[SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize]; + for (int32_t i = 0, end = SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize - 1; i < end; ++i) + { + SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[i] = (System::Func3*)(SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + i + 1); + } + SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize - 1] = nullptr; + NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble = SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + 1; + Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble = releaseSystemFuncSystemInt32_SystemSingle_SystemDouble; + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor = systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor; + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke = systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke; + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd = systemFuncSystemInt32_SystemSingle_SystemDoubleAdd; + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove = systemFuncSystemInt32_SystemSingle_SystemDoubleRemove; + SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize = 25; + SystemFuncSystemInt16_SystemInt32_SystemStringFreeList = new System::Func3*[SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize]; + for (int32_t i = 0, end = SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize - 1; i < end; ++i) + { + SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[i] = (System::Func3*)(SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + i + 1); + } + SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize - 1] = nullptr; + NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + 1; + Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString = releaseSystemFuncSystemInt16_SystemInt32_SystemString; + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor = systemFuncSystemInt16_SystemInt32_SystemStringConstructor; + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke = systemFuncSystemInt16_SystemInt32_SystemStringInvoke; + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd = systemFuncSystemInt16_SystemInt32_SystemStringAdd; + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove = systemFuncSystemInt16_SystemInt32_SystemStringRemove; /*END INIT BODY*/ try @@ -4917,7 +5955,8 @@ DLLEXPORT void Init( } catch (...) { - System::Exception ex(System::String("Unhandled exception in PluginMain")); + System::String msg = "Unhandled exception in PluginMain"; + System::Exception ex(msg); Plugin::SetException(ex.Handle); } } @@ -4931,7 +5970,7 @@ DLLEXPORT void SetCsharpException(int32_t handle) } /*BEGIN MONOBEHAVIOUR MESSAGES*/ -DLLEXPORT void TestScriptAwake(int32_t thisHandle) +DLLEXPORT void MyGameMonoBehavioursTestScriptAwake(int32_t thisHandle) { MyGame::MonoBehaviours::TestScript thiz(Plugin::InternalUse::Only, thisHandle); try @@ -4944,13 +5983,14 @@ DLLEXPORT void TestScriptAwake(int32_t thisHandle) } catch (...) { - System::Exception ex(System::String("Unhandled exception in MyGame::MonoBehaviours::TestScript::Awake")); + System::String msg = "Unhandled exception in MyGame::MonoBehaviours::TestScript::Awake"; + System::Exception ex(msg); Plugin::SetException(ex.Handle); } } -DLLEXPORT void TestScriptOnAnimatorIK(int32_t thisHandle, int32_t param0) +DLLEXPORT void MyGameMonoBehavioursTestScriptOnAnimatorIK(int32_t thisHandle, int32_t param0) { MyGame::MonoBehaviours::TestScript thiz(Plugin::InternalUse::Only, thisHandle); try @@ -4963,13 +6003,14 @@ DLLEXPORT void TestScriptOnAnimatorIK(int32_t thisHandle, int32_t param0) } catch (...) { - System::Exception ex(System::String("Unhandled exception in MyGame::MonoBehaviours::TestScript::OnAnimatorIK")); + System::String msg = "Unhandled exception in MyGame::MonoBehaviours::TestScript::OnAnimatorIK"; + System::Exception ex(msg); Plugin::SetException(ex.Handle); } } -DLLEXPORT void TestScriptOnCollisionEnter(int32_t thisHandle, int32_t param0Handle) +DLLEXPORT void MyGameMonoBehavioursTestScriptOnCollisionEnter(int32_t thisHandle, int32_t param0Handle) { MyGame::MonoBehaviours::TestScript thiz(Plugin::InternalUse::Only, thisHandle); UnityEngine::Collision param0(Plugin::InternalUse::Only, param0Handle); @@ -4983,13 +6024,14 @@ DLLEXPORT void TestScriptOnCollisionEnter(int32_t thisHandle, int32_t param0Hand } catch (...) { - System::Exception ex(System::String("Unhandled exception in MyGame::MonoBehaviours::TestScript::OnCollisionEnter")); + System::String msg = "Unhandled exception in MyGame::MonoBehaviours::TestScript::OnCollisionEnter"; + System::Exception ex(msg); Plugin::SetException(ex.Handle); } } -DLLEXPORT void TestScriptUpdate(int32_t thisHandle) +DLLEXPORT void MyGameMonoBehavioursTestScriptUpdate(int32_t thisHandle) { MyGame::MonoBehaviours::TestScript thiz(Plugin::InternalUse::Only, thisHandle); try @@ -5002,7 +6044,8 @@ DLLEXPORT void TestScriptUpdate(int32_t thisHandle) } catch (...) { - System::Exception ex(System::String("Unhandled exception in MyGame::MonoBehaviours::TestScript::Update")); + System::String msg = "Unhandled exception in MyGame::MonoBehaviours::TestScript::Update"; + System::Exception ex(msg); Plugin::SetException(ex.Handle); } } diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 7733c13..5f86e24 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -522,6 +522,51 @@ namespace System { template<> struct Array1; } + +namespace System +{ + struct Action; +} + +namespace System +{ + template struct Action1; +} + +namespace System +{ + template<> struct Action1; +} + +namespace System +{ + template struct Action2; +} + +namespace System +{ + template<> struct Action2; +} + +namespace System +{ + template struct Func3; +} + +namespace System +{ + template struct Func3; +} + +namespace System +{ + template<> struct Func3; +} + +namespace System +{ + template<> struct Func3; +} /*END TYPE DECLARATIONS*/ /*BEGIN TYPE DEFINITIONS*/ @@ -1324,4 +1369,124 @@ namespace System void SetItem(int32_t index0, UnityEngine::GradientColorKey& item); }; } + +namespace System +{ + struct Action : System::Object + { + Action(std::nullptr_t n); + Action(Plugin::InternalUse iu, int32_t handle); + Action(const Action& other); + Action(Action&& other); + virtual ~Action(); + Action& operator=(const Action& other); + Action& operator=(std::nullptr_t other); + Action& operator=(Action&& other); + bool operator==(const Action& other) const; + bool operator!=(const Action& other) const; + int32_t CppHandle; + int32_t DelegateHandle; + Action(); + void Invoke(); + virtual void operator()() = 0; + void operator+=(System::Action& del); + void operator-=(System::Action& del); + }; +} + +namespace System +{ + template<> struct Action1 : System::Object + { + Action1(std::nullptr_t n); + Action1(Plugin::InternalUse iu, int32_t handle); + Action1(const Action1& other); + Action1(Action1&& other); + virtual ~Action1(); + Action1& operator=(const Action1& other); + Action1& operator=(std::nullptr_t other); + Action1& operator=(Action1&& other); + bool operator==(const Action1& other) const; + bool operator!=(const Action1& other) const; + int32_t CppHandle; + int32_t DelegateHandle; + Action1(); + void Invoke(float obj); + virtual void operator()(float obj) = 0; + void operator+=(System::Action1& del); + void operator-=(System::Action1& del); + }; +} + +namespace System +{ + template<> struct Action2 : System::Object + { + Action2(std::nullptr_t n); + Action2(Plugin::InternalUse iu, int32_t handle); + Action2(const Action2& other); + Action2(Action2&& other); + virtual ~Action2(); + Action2& operator=(const Action2& other); + Action2& operator=(std::nullptr_t other); + Action2& operator=(Action2&& other); + bool operator==(const Action2& other) const; + bool operator!=(const Action2& other) const; + int32_t CppHandle; + int32_t DelegateHandle; + Action2(); + void Invoke(float arg1, float arg2); + virtual void operator()(float arg1, float arg2) = 0; + void operator+=(System::Action2& del); + void operator-=(System::Action2& del); + }; +} + +namespace System +{ + template<> struct Func3 : System::Object + { + Func3(std::nullptr_t n); + Func3(Plugin::InternalUse iu, int32_t handle); + Func3(const Func3& other); + Func3(Func3&& other); + virtual ~Func3(); + Func3& operator=(const Func3& other); + Func3& operator=(std::nullptr_t other); + Func3& operator=(Func3&& other); + bool operator==(const Func3& other) const; + bool operator!=(const Func3& other) const; + int32_t CppHandle; + int32_t DelegateHandle; + Func3(); + double Invoke(int32_t arg1, float arg2); + virtual double operator()(int32_t arg1, float arg2) = 0; + void operator+=(System::Func3& del); + void operator-=(System::Func3& del); + }; +} + +namespace System +{ + template<> struct Func3 : System::Object + { + Func3(std::nullptr_t n); + Func3(Plugin::InternalUse iu, int32_t handle); + Func3(const Func3& other); + Func3(Func3&& other); + virtual ~Func3(); + Func3& operator=(const Func3& other); + Func3& operator=(std::nullptr_t other); + Func3& operator=(Func3&& other); + bool operator==(const Func3& other) const; + bool operator!=(const Func3& other) const; + int32_t CppHandle; + int32_t DelegateHandle; + Func3(); + System::String Invoke(int16_t arg1, int32_t arg2); + virtual System::String operator()(int16_t arg1, int32_t arg2) = 0; + void operator+=(System::Func3& del); + void operator-=(System::Func3& del); + }; +} /*END TYPE DEFINITIONS*/ diff --git a/Unity/ProjectSettings/DynamicsManager.asset b/Unity/ProjectSettings/DynamicsManager.asset index 1931946..0be3d78 100644 --- a/Unity/ProjectSettings/DynamicsManager.asset +++ b/Unity/ProjectSettings/DynamicsManager.asset @@ -17,3 +17,4 @@ PhysicsManager: m_EnablePCM: 1 m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff m_AutoSimulation: 1 + m_AutoSyncTransforms: 1 diff --git a/Unity/ProjectSettings/Physics2DSettings.asset b/Unity/ProjectSettings/Physics2DSettings.asset index e3b2d0b..132ee6b 100644 --- a/Unity/ProjectSettings/Physics2DSettings.asset +++ b/Unity/ProjectSettings/Physics2DSettings.asset @@ -24,6 +24,7 @@ Physics2DSettings: m_QueriesStartInColliders: 1 m_ChangeStopsCallbacks: 0 m_CallbacksOnDisable: 1 + m_AutoSyncTransforms: 1 m_AlwaysShowColliders: 0 m_ShowColliderSleep: 1 m_ShowColliderContacts: 0 diff --git a/Unity/ProjectSettings/ProjectVersion.txt b/Unity/ProjectSettings/ProjectVersion.txt index ca1aa05..7a6fffb 100644 --- a/Unity/ProjectSettings/ProjectVersion.txt +++ b/Unity/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2017.1.0f3 +m_EditorVersion: 2017.2.0f3 diff --git a/Unity/UnityPackageManager/manifest.json b/Unity/UnityPackageManager/manifest.json new file mode 100644 index 0000000..526aca6 --- /dev/null +++ b/Unity/UnityPackageManager/manifest.json @@ -0,0 +1,4 @@ +{ + "dependencies": { + } +} From 6d9dfb97e1c0afff0cf7ee3ef4f718bb4544e54f Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 15 Oct 2017 12:26:51 -0700 Subject: [PATCH 24/95] Allow delegates as properties, parameters, etc. --- Unity/Assets/NativeScript/Bindings.cs | 560 ++++++--- .../NativeScript/Editor/GenerateBindings.cs | 829 ++++++++------ Unity/Assets/NativeScriptTypes.json | 18 + Unity/CppSource/Game/Game.cpp | 18 + Unity/CppSource/NativeScript/Bindings.cpp | 1010 +++++++++++------ Unity/CppSource/NativeScript/Bindings.h | 75 +- 6 files changed, 1659 insertions(+), 851 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index c72d570..bb6a747 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -337,6 +337,9 @@ delegate void InitDelegate( IntPtr unityEngineGradientConstructor, IntPtr unityEngineGradientPropertyGetColorKeys, IntPtr unityEngineGradientPropertySetColorKeys, + IntPtr systemAppDomainSetupConstructor, + IntPtr systemAppDomainSetupPropertyGetAppDomainInitializer, + IntPtr systemAppDomainSetupPropertySetAppDomainInitializer, IntPtr systemInt32Array1Constructor1, IntPtr systemInt32Array1GetItem1, IntPtr systemInt32Array1SetItem1, @@ -363,31 +366,36 @@ delegate void InitDelegate( 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 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); @@ -420,6 +428,9 @@ IntPtr SystemFuncSystemInt16_SystemInt32_SystemStringRemove 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*/ @@ -584,6 +595,9 @@ static extern void Init( IntPtr unityEngineGradientConstructor, IntPtr unityEngineGradientPropertyGetColorKeys, IntPtr unityEngineGradientPropertySetColorKeys, + IntPtr systemAppDomainSetupConstructor, + IntPtr systemAppDomainSetupPropertyGetAppDomainInitializer, + IntPtr systemAppDomainSetupPropertySetAppDomainInitializer, IntPtr systemInt32Array1Constructor1, IntPtr systemInt32Array1GetItem1, IntPtr systemInt32Array1SetItem1, @@ -610,31 +624,36 @@ static extern void Init( 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 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)] @@ -668,6 +687,9 @@ IntPtr SystemFuncSystemInt16_SystemInt32_SystemStringRemove [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*/ @@ -742,6 +764,9 @@ IntPtr SystemFuncSystemInt16_SystemInt32_SystemStringRemove 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); @@ -768,31 +793,36 @@ IntPtr SystemFuncSystemInt16_SystemInt32_SystemStringRemove 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 delegateHandle); - delegate void ReleaseSystemActionDelegate(int handle, int delegateHandle); + 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 delegateHandle); - delegate void ReleaseSystemActionSystemSingleDelegate(int handle, int delegateHandle); + 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 delegateHandle); - delegate void ReleaseSystemActionSystemSingle_SystemSingleDelegate(int handle, int delegateHandle); + 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 delegateHandle); - delegate void ReleaseSystemFuncSystemInt32_SystemSingle_SystemDoubleDelegate(int handle, int delegateHandle); + 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 delegateHandle); - delegate void ReleaseSystemFuncSystemInt16_SystemInt32_SystemStringDelegate(int handle, int delegateHandle); + 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; @@ -836,6 +866,7 @@ public static void Open( SystemActionSystemSingle_SystemSingleCppInvoke = GetDelegate(libraryHandle, "SystemActionSystemSingle_SystemSingleCppInvoke"); SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke = GetDelegate(libraryHandle, "SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke"); SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke = GetDelegate(libraryHandle, "SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke"); + SystemAppDomainInitializerCppInvoke = GetDelegate(libraryHandle, "SystemAppDomainInitializerCppInvoke"); SetCsharpExceptionSystemNullReferenceException = GetDelegate(libraryHandle, "SetCsharpExceptionSystemNullReferenceException"); /*END MONOBEHAVIOUR GETDELEGATE CALLS*/ @@ -912,6 +943,9 @@ public static void Open( 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)), @@ -962,7 +996,12 @@ public static void Open( 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 SystemFuncSystemInt16_SystemInt32_SystemStringRemoveDelegate(SystemFuncSystemInt16_SystemInt32_SystemStringRemove)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemAppDomainInitializerDelegate(ReleaseSystemAppDomainInitializer)), + Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerConstructorDelegate(SystemAppDomainInitializerConstructor)), + Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerInvokeDelegate(SystemAppDomainInitializerInvoke)), + Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerAddDelegate(SystemAppDomainInitializerAdd)), + Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerRemoveDelegate(SystemAppDomainInitializerRemove)) /*END INIT CALL*/ ); if (UnhandledCppException != null) @@ -2371,6 +2410,72 @@ static void UnityEngineGradientPropertySetColorKeys(int thisHandle, int valueHan } } + [MonoPInvokeCallback(typeof(SystemAppDomainSetupConstructorDelegate))] + static int SystemAppDomainSetupConstructor() + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.AppDomainSetup()); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertyGetAppDomainInitializerDelegate))] + static int SystemAppDomainSetupPropertyGetAppDomainInitializer(int thisHandle) + { + try + { + var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.AppDomainInitializer; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertySetAppDomainInitializerDelegate))] + static void SystemAppDomainSetupPropertySetAppDomainInitializer(int thisHandle, int valueHandle) + { + try + { + var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.AppDomainInitializer = value; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + [MonoPInvokeCallback(typeof(SystemInt32Array1Constructor1Delegate))] static int SystemInt32Array1Constructor1(int length0) { @@ -2953,19 +3058,26 @@ public void Invoke() { if (CppHandle != 0) { - SystemActionCppInvoke(CppHandle); + int thisHandle = CppHandle; + NativeScript.Bindings.SystemActionCppInvoke(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } } } } [MonoPInvokeCallback(typeof(SystemActionConstructorDelegate))] - static void SystemActionConstructor(int cppHandle, ref int handle, ref int delegateHandle) + static void SystemActionConstructor(int cppHandle, ref int handle, ref int classHandle) { try { var thiz = new SystemAction(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - delegateHandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); + handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); } catch (System.NullReferenceException ex) { @@ -2980,13 +3092,16 @@ static void SystemActionConstructor(int cppHandle, ref int handle, ref int deleg } [MonoPInvokeCallback(typeof(ReleaseSystemActionDelegate))] - static void ReleaseSystemAction(int handle, int delegateHandle) + static void ReleaseSystemAction(int handle, int classHandle) { try { - var thiz = (SystemAction)NativeScript.Bindings.ObjectStore.Remove(handle); - thiz.CppHandle = 0; - NativeScript.Bindings.ObjectStore.Remove(delegateHandle); + if (classHandle != 0) + { + var thiz = (SystemAction)NativeScript.Bindings.ObjectStore.Remove(classHandle); + thiz.CppHandle = 0; + } + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -3005,8 +3120,7 @@ static void SystemActionInvoke(int thisHandle) { try { - ((SystemAction)NativeScript.Bindings.ObjectStore.Get(thisHandle)).Delegate(); - + ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(); } catch (System.NullReferenceException ex) { @@ -3025,9 +3139,9 @@ static void SystemActionAdd(int thisHandle, int delHandle) { try { + var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); - var thiz = (SystemAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Delegate += del; + thiz += del; } catch (System.NullReferenceException ex) { @@ -3046,9 +3160,9 @@ static void SystemActionRemove(int thisHandle, int delHandle) { try { + var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); - var thiz = (SystemAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Delegate -= del; + thiz -= del; } catch (System.NullReferenceException ex) { @@ -3076,19 +3190,26 @@ public void Invoke(float obj) { if (CppHandle != 0) { - SystemActionSystemSingleCppInvoke(CppHandle, obj); + int thisHandle = CppHandle; + NativeScript.Bindings.SystemActionSystemSingleCppInvoke(thisHandle, obj); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } } } } [MonoPInvokeCallback(typeof(SystemActionSystemSingleConstructorDelegate))] - static void SystemActionSystemSingleConstructor(int cppHandle, ref int handle, ref int delegateHandle) + static void SystemActionSystemSingleConstructor(int cppHandle, ref int handle, ref int classHandle) { try { var thiz = new SystemActionSystemSingle(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - delegateHandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); + handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); } catch (System.NullReferenceException ex) { @@ -3103,13 +3224,16 @@ static void SystemActionSystemSingleConstructor(int cppHandle, ref int handle, r } [MonoPInvokeCallback(typeof(ReleaseSystemActionSystemSingleDelegate))] - static void ReleaseSystemActionSystemSingle(int handle, int delegateHandle) + static void ReleaseSystemActionSystemSingle(int handle, int classHandle) { try { - var thiz = (SystemActionSystemSingle)NativeScript.Bindings.ObjectStore.Remove(handle); - thiz.CppHandle = 0; - NativeScript.Bindings.ObjectStore.Remove(delegateHandle); + if (classHandle != 0) + { + var thiz = (SystemActionSystemSingle)NativeScript.Bindings.ObjectStore.Remove(classHandle); + thiz.CppHandle = 0; + } + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -3128,8 +3252,7 @@ static void SystemActionSystemSingleInvoke(int thisHandle, float obj) { try { - ((SystemActionSystemSingle)NativeScript.Bindings.ObjectStore.Get(thisHandle)).Delegate(obj); - + ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(obj); } catch (System.NullReferenceException ex) { @@ -3148,9 +3271,9 @@ static void SystemActionSystemSingleAdd(int thisHandle, int delHandle) { try { + var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); - var thiz = (SystemActionSystemSingle)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Delegate += del; + thiz += del; } catch (System.NullReferenceException ex) { @@ -3169,9 +3292,9 @@ static void SystemActionSystemSingleRemove(int thisHandle, int delHandle) { try { + var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); - var thiz = (SystemActionSystemSingle)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Delegate -= del; + thiz -= del; } catch (System.NullReferenceException ex) { @@ -3199,19 +3322,26 @@ public void Invoke(float arg1, float arg2) { if (CppHandle != 0) { - SystemActionSystemSingle_SystemSingleCppInvoke(CppHandle, arg1, arg2); + int thisHandle = CppHandle; + NativeScript.Bindings.SystemActionSystemSingle_SystemSingleCppInvoke(thisHandle, arg1, arg2); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } } } } [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleConstructorDelegate))] - static void SystemActionSystemSingle_SystemSingleConstructor(int cppHandle, ref int handle, ref int delegateHandle) + static void SystemActionSystemSingle_SystemSingleConstructor(int cppHandle, ref int handle, ref int classHandle) { try { var thiz = new SystemActionSystemSingle_SystemSingle(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - delegateHandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); + handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); } catch (System.NullReferenceException ex) { @@ -3226,13 +3356,16 @@ static void SystemActionSystemSingle_SystemSingleConstructor(int cppHandle, ref } [MonoPInvokeCallback(typeof(ReleaseSystemActionSystemSingle_SystemSingleDelegate))] - static void ReleaseSystemActionSystemSingle_SystemSingle(int handle, int delegateHandle) + static void ReleaseSystemActionSystemSingle_SystemSingle(int handle, int classHandle) { try { - var thiz = (SystemActionSystemSingle_SystemSingle)NativeScript.Bindings.ObjectStore.Remove(handle); - thiz.CppHandle = 0; - NativeScript.Bindings.ObjectStore.Remove(delegateHandle); + if (classHandle != 0) + { + var thiz = (SystemActionSystemSingle_SystemSingle)NativeScript.Bindings.ObjectStore.Remove(classHandle); + thiz.CppHandle = 0; + } + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -3251,8 +3384,7 @@ static void SystemActionSystemSingle_SystemSingleInvoke(int thisHandle, float ar { try { - ((SystemActionSystemSingle_SystemSingle)NativeScript.Bindings.ObjectStore.Get(thisHandle)).Delegate(arg1, arg2); - + ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); } catch (System.NullReferenceException ex) { @@ -3271,9 +3403,9 @@ static void SystemActionSystemSingle_SystemSingleAdd(int thisHandle, int delHand { try { + var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); - var thiz = (SystemActionSystemSingle_SystemSingle)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Delegate += del; + thiz += del; } catch (System.NullReferenceException ex) { @@ -3292,9 +3424,9 @@ static void SystemActionSystemSingle_SystemSingleRemove(int thisHandle, int delH { try { + var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); - var thiz = (SystemActionSystemSingle_SystemSingle)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Delegate -= del; + thiz -= del; } catch (System.NullReferenceException ex) { @@ -3322,23 +3454,28 @@ public double Invoke(int arg1, float arg2) { if (CppHandle != 0) { - return SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke(CppHandle, arg1, arg2); - } - else - { - return default(double); + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke(thisHandle, arg1, arg2); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; } + return default(double); } } [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructorDelegate))] - static void SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(int cppHandle, ref int handle, ref int delegateHandle) + static void SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(int cppHandle, ref int handle, ref int classHandle) { try { var thiz = new SystemFuncSystemInt32_SystemSingle_SystemDouble(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - delegateHandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); + handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); } catch (System.NullReferenceException ex) { @@ -3353,13 +3490,16 @@ static void SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(int cppHa } [MonoPInvokeCallback(typeof(ReleaseSystemFuncSystemInt32_SystemSingle_SystemDoubleDelegate))] - static void ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(int handle, int delegateHandle) + static void ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(int handle, int classHandle) { try { - var thiz = (SystemFuncSystemInt32_SystemSingle_SystemDouble)NativeScript.Bindings.ObjectStore.Remove(handle); - thiz.CppHandle = 0; - NativeScript.Bindings.ObjectStore.Remove(delegateHandle); + if (classHandle != 0) + { + var thiz = (SystemFuncSystemInt32_SystemSingle_SystemDouble)NativeScript.Bindings.ObjectStore.Remove(classHandle); + thiz.CppHandle = 0; + } + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -3378,8 +3518,7 @@ static double SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(int thisHand { try { - var returnValue = ((SystemFuncSystemInt32_SystemSingle_SystemDouble)NativeScript.Bindings.ObjectStore.Get(thisHandle)).Delegate(arg1, arg2); - + var returnValue = ((System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); return returnValue; } catch (System.NullReferenceException ex) @@ -3401,9 +3540,9 @@ static void SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(int thisHandle, i { try { + var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); - var thiz = (SystemFuncSystemInt32_SystemSingle_SystemDouble)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Delegate += del; + thiz += del; } catch (System.NullReferenceException ex) { @@ -3422,9 +3561,9 @@ static void SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(int thisHandle { try { + var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); - var thiz = (SystemFuncSystemInt32_SystemSingle_SystemDouble)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Delegate -= del; + thiz -= del; } catch (System.NullReferenceException ex) { @@ -3452,23 +3591,28 @@ public string Invoke(short arg1, int arg2) { if (CppHandle != 0) { - return (string)NativeScript.Bindings.ObjectStore.Get(SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke(CppHandle, arg1, arg2)); - } - else - { - return default(string); + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke(thisHandle, arg1, arg2); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return (string)NativeScript.Bindings.ObjectStore.Get(returnVal); } + return default(string); } } [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringConstructorDelegate))] - static void SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(int cppHandle, ref int handle, ref int delegateHandle) + static void SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(int cppHandle, ref int handle, ref int classHandle) { try { var thiz = new SystemFuncSystemInt16_SystemInt32_SystemString(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - delegateHandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); + handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); } catch (System.NullReferenceException ex) { @@ -3483,13 +3627,16 @@ static void SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(int cppHan } [MonoPInvokeCallback(typeof(ReleaseSystemFuncSystemInt16_SystemInt32_SystemStringDelegate))] - static void ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(int handle, int delegateHandle) + static void ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(int handle, int classHandle) { try { - var thiz = (SystemFuncSystemInt16_SystemInt32_SystemString)NativeScript.Bindings.ObjectStore.Remove(handle); - thiz.CppHandle = 0; - NativeScript.Bindings.ObjectStore.Remove(delegateHandle); + if (classHandle != 0) + { + var thiz = (SystemFuncSystemInt16_SystemInt32_SystemString)NativeScript.Bindings.ObjectStore.Remove(classHandle); + thiz.CppHandle = 0; + } + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -3508,8 +3655,7 @@ static int SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(int thisHandle, { try { - var returnValue = ((SystemFuncSystemInt16_SystemInt32_SystemString)NativeScript.Bindings.ObjectStore.Get(thisHandle)).Delegate(arg1, arg2); - + var returnValue = ((System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) @@ -3531,9 +3677,9 @@ static void SystemFuncSystemInt16_SystemInt32_SystemStringAdd(int thisHandle, in { try { + var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); - var thiz = (SystemFuncSystemInt16_SystemInt32_SystemString)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Delegate += del; + thiz += del; } catch (System.NullReferenceException ex) { @@ -3552,9 +3698,143 @@ static void SystemFuncSystemInt16_SystemInt32_SystemStringRemove(int thisHandle, { try { + var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); - var thiz = (SystemFuncSystemInt16_SystemInt32_SystemString)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Delegate -= del; + thiz -= del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + class SystemAppDomainInitializer + { + public int CppHandle; + public System.AppDomainInitializer Delegate; + + public SystemAppDomainInitializer(int cppHandle) + { + CppHandle = cppHandle; + Delegate = Invoke; + } + public void Invoke(string[] args) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int argsHandle = NativeScript.Bindings.ObjectStore.GetHandle(args); + NativeScript.Bindings.SystemAppDomainInitializerCppInvoke(thisHandle, argsHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } + + [MonoPInvokeCallback(typeof(SystemAppDomainInitializerConstructorDelegate))] + static void SystemAppDomainInitializerConstructor(int cppHandle, ref int handle, ref int classHandle) + { + try + { + var thiz = new SystemAppDomainInitializer(cppHandle); + classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); + handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(ReleaseSystemAppDomainInitializerDelegate))] + static void ReleaseSystemAppDomainInitializer(int handle, int classHandle) + { + try + { + if (classHandle != 0) + { + var thiz = (SystemAppDomainInitializer)NativeScript.Bindings.ObjectStore.Remove(classHandle); + thiz.CppHandle = 0; + } + NativeScript.Bindings.ObjectStore.Remove(handle); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemAppDomainInitializerInvokeDelegate))] + static void SystemAppDomainInitializerInvoke(int thisHandle, int argsHandle) + { + try + { + var args = (string[])NativeScript.Bindings.ObjectStore.Get(argsHandle); + ((System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle))(args); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemAppDomainInitializerAddDelegate))] + static void SystemAppDomainInitializerAdd(int thisHandle, int delHandle) + { + try + { + var thiz = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz += del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemAppDomainInitializerRemoveDelegate))] + static void SystemAppDomainInitializerRemove(int thisHandle, int delHandle) + { + try + { + var thiz = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz -= del; } catch (System.NullReferenceException ex) { @@ -3604,7 +3884,7 @@ public void OnAnimatorIK(int param0) public void OnCollisionEnter(UnityEngine.Collision param0) { - int param0Handle = NativeScript.Bindings.ObjectStore.Store(param0); + int param0Handle = NativeScript.Bindings.ObjectStore.GetHandle(param0); int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); NativeScript.Bindings.MyGameMonoBehavioursTestScriptOnCollisionEnter(thisHandle, param0Handle); if (NativeScript.Bindings.UnhandledCppException != null) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 1377c72..b6fc5a7 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -1431,6 +1431,7 @@ static void AppendType( isStatic, indent, true, + true, builders.CppMethodDefinitions); // Constructors @@ -1819,7 +1820,6 @@ static void AppendConstructor( enclosingTypeIsStatic, false, false, - false, null, null, parameters, @@ -2838,7 +2838,6 @@ static void AppendMethod( enclosingTypeIsStatic, false, cppMethodIsStatic, - false, cppReturnType, methodTypeParams, cppParameters, @@ -2980,6 +2979,7 @@ static void AppendMonoBehaviour( false, cppIndent, true, + true, builders.CppMethodDefinitions); AppendCppMethodDefinitionsEnd( cppMethodDefinitionsIndent, @@ -3012,6 +3012,16 @@ static void AppendMonoBehaviour( } } + // Build the C++ function name + builders.TempStrBuilder.Length = 0; + AppendNamespace( + type.Namespace, + string.Empty, + builders.TempStrBuilder); + builders.TempStrBuilder.Append(type.Name); + builders.TempStrBuilder.Append(messageInfo.Name); + string cppFunctionName = builders.TempStrBuilder.ToString(); + // Build ParameterInfos ParameterInfo[] parameters = ConvertParameters( messageInfo.ParameterTypes); @@ -3026,7 +3036,6 @@ static void AppendMonoBehaviour( false, false, false, - false, typeof(void), null, parameters, @@ -3062,96 +3071,15 @@ static void AppendMonoBehaviour( csharpIndent + 1, builders.CsharpMonoBehaviours); builders.CsharpMonoBehaviours.Append("{\n"); - for (int i = 0; i < numParams; ++i) - { - ParameterInfo param = parameters[i]; - if (param.Kind == TypeKind.Class - || param.Kind == TypeKind.ManagedStruct) - { - AppendIndent( - csharpIndent + 2, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("int param"); - builders.CsharpMonoBehaviours.Append(i); - builders.CsharpMonoBehaviours.Append("Handle = "); - AppendHandleStoreTypeName( - param.DereferencedParameterType, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append('.'); - if (param.Kind == TypeKind.ManagedStruct) - { - builders.CsharpMonoBehaviours.Append("GetHandle"); - } - else - { - builders.CsharpMonoBehaviours.Append("Store"); - } - builders.CsharpMonoBehaviours.Append('('); - builders.CsharpMonoBehaviours.Append("param"); - builders.CsharpMonoBehaviours.Append(i); - builders.CsharpMonoBehaviours.Append(");\n"); - } - } - AppendIndent( - csharpIndent + 2, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append( - "int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this);\n"); - AppendIndent( - csharpIndent + 2, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("NativeScript.Bindings."); - AppendNamespace( + AppendCppFunctionCall( + cppFunctionName, + parameters, + typeof(void), + type.Name, type.Namespace, - string.Empty, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append(type.Name); - builders.CsharpMonoBehaviours.Append(messageInfo.Name); - builders.CsharpMonoBehaviours.Append("(thisHandle"); - if (numParams > 0) - { - builders.CsharpMonoBehaviours.Append(", "); - } - for (int i = 0; i < numParams; ++i) - { - builders.CsharpMonoBehaviours.Append("param"); - builders.CsharpMonoBehaviours.Append(i); - ParameterInfo param = parameters[i]; - if (param.Kind == TypeKind.Class - || param.Kind == TypeKind.ManagedStruct) - { - builders.CsharpMonoBehaviours.Append("Handle"); - } - if (i != numParams - 1) - { - builders.CsharpMonoBehaviours.Append(", "); - } - } - builders.CsharpMonoBehaviours.Append(");\n"); - AppendIndent( - csharpIndent + 2, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("if (NativeScript.Bindings.UnhandledCppException != null)\n"); - AppendIndent( - csharpIndent + 2, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("{\n"); - AppendIndent( - csharpIndent + 3, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("Exception ex = NativeScript.Bindings.UnhandledCppException;\n"); - AppendIndent( - csharpIndent + 3, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("NativeScript.Bindings.UnhandledCppException = null;\n"); - AppendIndent( - csharpIndent + 3, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("throw ex;\n"); - AppendIndent( + false, csharpIndent + 2, builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("}\n"); AppendIndent( csharpIndent + 1, builders.CsharpMonoBehaviours); @@ -3300,6 +3228,112 @@ static void AppendMonoBehaviour( builders.CppTypeDefinitions); } + static void AppendCppFunctionCall( + string funcName, + ParameterInfo[] parameters, + Type returnType, + string enclosingTypeName, + string enclosingTypeNamespace, + bool enclosingTypeIsStatic, + int indent, + StringBuilder output) + { + for (int i = 0; i < parameters.Length; ++i) + { + ParameterInfo param = parameters[i]; + if (param.Kind == TypeKind.Class + || param.Kind == TypeKind.ManagedStruct) + { + AppendIndent( + indent, + output); + output.Append("int "); + output.Append(param.Name); + output.Append("Handle = "); + AppendHandleStoreTypeName( + param.DereferencedParameterType, + output); + output.Append('.'); + if (param.Kind == TypeKind.Class) + { + output.Append("GetHandle"); + } + else + { + output.Append("Store"); + } + output.Append('('); + output.Append(param.Name); + output.Append(");\n"); + } + } + if (!enclosingTypeIsStatic) + { + AppendIndent( + indent, + output); + output.Append( + "int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this);\n"); + } + AppendIndent( + indent, + output); + if (returnType != typeof(void)) + { + output.Append("var returnVal = "); + } + output.Append("NativeScript.Bindings."); + output.Append(funcName); + output.Append('('); + if (!enclosingTypeIsStatic) + { + output.Append("thisHandle"); + if (parameters.Length > 0) + { + output.Append(", "); + } + } + for (int i = 0; i < parameters.Length; ++i) + { + ParameterInfo param = parameters[i]; + output.Append(param.Name); + if (param.Kind == TypeKind.Class + || param.Kind == TypeKind.ManagedStruct) + { + output.Append("Handle"); + } + if (i != parameters.Length - 1) + { + output.Append(", "); + } + } + output.Append(");\n"); + AppendIndent( + indent, + output); + output.Append("if (NativeScript.Bindings.UnhandledCppException != null)\n"); + AppendIndent( + indent, + output); + output.Append("{\n"); + AppendIndent( + indent + 1, + output); + output.Append("Exception ex = NativeScript.Bindings.UnhandledCppException;\n"); + AppendIndent( + indent + 1, + output); + output.Append("NativeScript.Bindings.UnhandledCppException = null;\n"); + AppendIndent( + indent + 1, + output); + output.Append("throw ex;\n"); + AppendIndent( + indent, + output); + output.Append("}\n"); + } + static void AppendArray( JsonArray jsonArray, Assembly[] assemblies, @@ -3388,7 +3422,8 @@ static void AppendArray( null, false, indent, - true, + true, + true, builders.CppMethodDefinitions); AppendArrayConstructor( @@ -3590,7 +3625,6 @@ static void AppendArrayConstructor( false, false, false, - false, null, null, parameters, @@ -3691,7 +3725,6 @@ StringBuilders builders false, false, false, - false, typeof(int), null, parameters, @@ -3832,7 +3865,6 @@ static void AppendArrayGetLength( false, false, false, - false, typeof(int), null, parameters, @@ -3999,7 +4031,6 @@ static void AppendArrayGetItem( false, false, false, - false, elementType, null, parameters, @@ -4175,7 +4206,6 @@ static void AppendArraySetItem( false, false, false, - false, typeof(void), null, parameters, @@ -4362,6 +4392,15 @@ static void AppendDelegate( builders.TempStrBuilder[0]); string removeFuncNameLower = builders.TempStrBuilder.ToString(); + builders.TempStrBuilder.Length = 0; + AppendCsharpDelegateName( + type.Name, + type.Namespace, + typeParams, + "CppInvoke", + builders.TempStrBuilder); + string cppInvokeFuncName = builders.TempStrBuilder.ToString(); + MethodInfo invokeMethod = type.GetMethod("Invoke"); TypeKind invokeReturnTypeKind = GetTypeKind( invokeMethod.ReturnType); @@ -4382,7 +4421,7 @@ static void AppendDelegate( Kind = TypeKind.Primitive }; - ParameterInfo[] addRemoveCppParams = new ParameterInfo[] { + ParameterInfo[] addRemoveParams = new ParameterInfo[] { new ParameterInfo { Name = "del", @@ -4394,26 +4433,6 @@ static void AppendDelegate( IsVirtual = true }}; - ParameterInfo[] addRemoveCsharpParams = new ParameterInfo[] { - new ParameterInfo - { - Name = "thisHandle", - ParameterType = typeof(int), - DereferencedParameterType = typeof(int), - IsOut = false, - IsRef = false, - Kind = TypeKind.Primitive - }, - new ParameterInfo - { - Name = "del", - ParameterType = type, - DereferencedParameterType = type, - IsOut = false, - IsRef = false, - Kind = TypeKind.Class - }}; - ParameterInfo[] releaseParams = new ParameterInfo[] { new ParameterInfo { @@ -4426,7 +4445,7 @@ static void AppendDelegate( }, new ParameterInfo { - Name = "delegateHandle", + Name = "classHandle", ParameterType = typeof(int), DereferencedParameterType = typeof(int), IsOut = false, @@ -4455,7 +4474,7 @@ static void AppendDelegate( }, new ParameterInfo { - Name = "delegateHandle", + Name = "classHandle", ParameterType = typeof(int), DereferencedParameterType = typeof(int), IsOut = true, @@ -4628,7 +4647,7 @@ static void AppendDelegate( AppendIndent( indent + 1, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append("int32_t DelegateHandle;\n"); + builders.CppTypeDefinitions.Append("int32_t ClassHandle;\n"); // C++ method declarations AppendIndent( @@ -4639,7 +4658,6 @@ static void AppendDelegate( false, false, false, - false, null, null, new ParameterInfo[0], @@ -4652,7 +4670,6 @@ static void AppendDelegate( false, false, false, - false, invokeMethod.ReturnType, null, invokeParams, @@ -4665,7 +4682,6 @@ static void AppendDelegate( false, true, false, - true, invokeMethod.ReturnType, null, invokeParams, @@ -4678,10 +4694,9 @@ static void AppendDelegate( false, false, false, - false, typeof(void), null, - addRemoveCppParams, + addRemoveParams, builders.CppTypeDefinitions); AppendIndent( indent + 1, @@ -4691,10 +4706,9 @@ static void AppendDelegate( false, false, false, - false, typeof(void), null, - addRemoveCppParams, + addRemoveParams, builders.CppTypeDefinitions); // C++ function pointers @@ -4731,7 +4745,7 @@ static void AppendDelegate( null, null, TypeKind.None, - addRemoveCppParams, + addRemoveParams, typeof(void), builders.CppFunctionPointers); AppendCppFunctionPointerDefinition( @@ -4740,7 +4754,7 @@ static void AppendDelegate( null, null, TypeKind.None, - addRemoveCppParams, + addRemoveParams, typeof(void), builders.CppFunctionPointers); @@ -4778,7 +4792,7 @@ static void AppendDelegate( null, null, TypeKind.None, - addRemoveCppParams, + addRemoveParams, typeof(void), builders.CppInitParams); AppendCppInitParam( @@ -4787,7 +4801,7 @@ static void AppendDelegate( null, null, TypeKind.None, - addRemoveCppParams, + addRemoveParams, typeof(void), builders.CppInitParams); @@ -4825,9 +4839,10 @@ static void AppendDelegate( false, indent, false, + false, builders.CppMethodDefinitions); - // C++ constructor + // C++ default constructor AppendCppMethodDefinitionBegin( numberedTypeName, null, @@ -4856,7 +4871,7 @@ static void AppendDelegate( builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("Plugin::"); builders.CppMethodDefinitions.Append(constructorFuncName); - builders.CppMethodDefinitions.Append("(CppHandle, &Handle, &DelegateHandle);\n"); + builders.CppMethodDefinitions.Append("(CppHandle, &Handle, &ClassHandle);\n"); AppendIndent( indent + 1, builders.CppMethodDefinitions); @@ -4903,59 +4918,147 @@ static void AppendDelegate( builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append('\n'); - // C++ Invoke - AppendCppMethodDefinitionBegin( + // C++ handle constructor + AppendCppHandleConstructorDefintionBegin( numberedTypeName, - invokeMethod.ReturnType, - "Invoke", typeParams, + "Object", + "System", null, - invokeParams, indent, builders.CppMethodDefinitions); + AppendIndent(indent + 1, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendCppPluginFunctionCall( - false, - type.Name, - type.Namespace, - TypeKind.Class, - typeParams, - invokeMethod.ReturnType, - invokeFuncName, - invokeParams, indent + 1, builders.CppMethodDefinitions); - AppendCppMethodReturn( - invokeMethod.ReturnType, - invokeReturnTypeKind, + builders.CppMethodDefinitions.Append("CppHandle = Plugin::Store"); + builders.CppMethodDefinitions.Append(typeName); + builders.CppMethodDefinitions.Append("(this);\n"); + AppendIndent( indent + 1, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("if (Handle)\n"); AppendIndent( - indent, + indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.Append("{\n"); AppendIndent( - indent, + indent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); - - // C++ destructor - AppendCppDestructorDefinitionBegin( - numberedTypeName, - type.Namespace, - TypeKind.Class, - typeParams, - indent, + builders.CppMethodDefinitions.Append("Plugin::ReferenceManagedClass(Handle);\n"); + AppendIndent( + indent + 1, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); AppendIndent( - indent + 2, + indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Plugin::Release"); + builders.CppMethodDefinitions.Append("else\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Plugin::Remove"); + builders.CppMethodDefinitions.Append(typeName); + builders.CppMethodDefinitions.Append("(CppHandle);\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendCppUnhandledExceptionHandling( + indent + 1, + builders.CppMethodDefinitions); + AppendCppHandleConstructorDefintionEnd( + indent, + builders.CppMethodDefinitions); + + // C++ operator() + AppendCppMethodDefinitionBegin( + numberedTypeName, + invokeMethod.ReturnType, + "operator()", + typeParams, + null, + invokeParams, + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + if (invokeMethod.ReturnType != typeof(void)) + { + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("return {};\n"); + } + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + + // C++ Invoke + AppendCppMethodDefinitionBegin( + numberedTypeName, + invokeMethod.ReturnType, + "Invoke", + typeParams, + null, + invokeParams, + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendCppPluginFunctionCall( + false, + type.Name, + type.Namespace, + TypeKind.Class, + typeParams, + invokeMethod.ReturnType, + invokeFuncName, + invokeParams, + indent + 1, + builders.CppMethodDefinitions); + AppendCppMethodReturn( + invokeMethod.ReturnType, + invokeReturnTypeKind, + indent + 1, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + + // C++ destructor + AppendCppDestructorDefinitionBegin( + numberedTypeName, + type.Namespace, + TypeKind.Class, + typeParams, + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Plugin::Release"); builders.CppMethodDefinitions.Append(typeName); - builders.CppMethodDefinitions.Append("(Handle, DelegateHandle);\n"); + builders.CppMethodDefinitions.Append("(Handle, ClassHandle);\n"); AppendCppUnhandledExceptionHandling( indent + 2, builders.CppMethodDefinitions); @@ -4965,6 +5068,10 @@ static void AppendDelegate( builders.CppMethodDefinitions.Append("Plugin::Remove"); builders.CppMethodDefinitions.Append(typeName); builders.CppMethodDefinitions.Append("(CppHandle);\n"); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); AppendCppDestructorDefinitionEnd( indent, builders.CppMethodDefinitions); @@ -4976,7 +5083,7 @@ static void AppendDelegate( "operator+=", typeParams, null, - addRemoveCppParams, + addRemoveParams, indent, builders.CppMethodDefinitions); AppendIndent( @@ -4988,7 +5095,7 @@ static void AppendDelegate( builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("Plugin::"); builders.CppMethodDefinitions.Append(addFuncName); - builders.CppMethodDefinitions.Append("(Handle, del.DelegateHandle);\n"); + builders.CppMethodDefinitions.Append("(Handle, del.Handle);\n"); AppendCppUnhandledExceptionHandling( indent + 1, builders.CppMethodDefinitions); @@ -5008,7 +5115,7 @@ static void AppendDelegate( "operator-=", typeParams, null, - addRemoveCppParams, + addRemoveParams, indent, builders.CppMethodDefinitions); AppendIndent( @@ -5020,7 +5127,7 @@ static void AppendDelegate( builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("Plugin::"); builders.CppMethodDefinitions.Append(removeFuncName); - builders.CppMethodDefinitions.Append("(Handle, del.DelegateHandle);\n"); + builders.CppMethodDefinitions.Append("(Handle, del.Handle);\n"); AppendCppUnhandledExceptionHandling( indent + 1, builders.CppMethodDefinitions); @@ -5069,9 +5176,30 @@ static void AppendDelegate( { builders.CppMethodDefinitions.Append(", "); } - AppendCppParameterDeclaration( - invokeParams, - builders.CppMethodDefinitions); + for (int i = 0; i < invokeParams.Length; ++i) + { + ParameterInfo param = invokeParams[i]; + switch (param.Kind) + { + case TypeKind.Class: + case TypeKind.ManagedStruct: + builders.CppMethodDefinitions.Append("int32_t "); + builders.CppMethodDefinitions.Append(param.Name); + builders.CppMethodDefinitions.Append("Handle"); + break; + default: + AppendCppTypeName( + param.ParameterType, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(' '); + builders.CppMethodDefinitions.Append(param.Name); + break; + } + if (i != invokeParams.Length - 1) + { + builders.CppMethodDefinitions.Append(", "); + } + } builders.CppMethodDefinitions.Append(")\n"); AppendIndent( indent, @@ -5087,10 +5215,28 @@ static void AppendDelegate( builders.CppMethodDefinitions.Append("(*Plugin::Get"); builders.CppMethodDefinitions.Append(typeName); builders.CppMethodDefinitions.Append("(cppHandle))("); - AppendParameterCall( - invokeParams, - " ", - builders.CppMethodDefinitions); + for (int i = 0; i < invokeParams.Length; ++i) + { + ParameterInfo parameter = invokeParams[i]; + if (parameter.Kind == TypeKind.Class + || parameter.Kind == TypeKind.ManagedStruct) + { + AppendCppTypeName( + parameter.ParameterType, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("(Plugin::InternalUse::Only, "); + builders.CppMethodDefinitions.Append(parameter.Name); + builders.CppMethodDefinitions.Append("Handle)"); + } + else + { + builders.CppMethodDefinitions.Append(parameter.Name); + } + if (i != invokeParams.Length - 1) + { + builders.CppMethodDefinitions.Append(", "); + } + } builders.CppMethodDefinitions.Append(")"); if ( invokeMethod.ReturnType != typeof(void) && @@ -5174,74 +5320,66 @@ static void AppendDelegate( invokeMethod.ReturnType, builders.CsharpFunctions); builders.CsharpFunctions.Append(" Invoke("); - AppendCsharpParameterDeclaration( - invokeParams, - builders.CsharpFunctions); + for (int i = 0; i < invokeParams.Length; ++i) + { + ParameterInfo param = invokeParams[i]; + AppendCsharpTypeName( + param.ParameterType, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(' '); + builders.CsharpFunctions.Append(param.Name); + if (i != invokeParams.Length - 1) + { + builders.CsharpFunctions.Append(", "); + } + } builders.CsharpFunctions.Append(")\n"); builders.CsharpFunctions.Append("\t\t\t{\n"); builders.CsharpFunctions.Append("\t\t\t\tif (CppHandle != 0)\n"); builders.CsharpFunctions.Append("\t\t\t\t{\n"); - builders.CsharpFunctions.Append("\t\t\t\t\t"); + builders.CsharpFunctions.Append("\t\t\t\t\tint thisHandle = CppHandle;\n"); + AppendCppFunctionCall( + cppInvokeFuncName, + invokeParamsWithThis, + invokeMethod.ReturnType, + type.Name, + type.Namespace, + true, + 5, + builders.CsharpFunctions); if (invokeMethod.ReturnType != typeof(void)) { - builders.CsharpFunctions.Append("return "); - if (invokeReturnTypeKind == TypeKind.Class) + builders.CsharpFunctions.Append("\t\t\t\t\treturn "); + switch (invokeReturnTypeKind) { - if (invokeMethod.ReturnType != typeof(object)) - { - builders.CsharpFunctions.Append('('); - AppendCsharpTypeName( + case TypeKind.Class: + case TypeKind.ManagedStruct: + if (invokeMethod.ReturnType != typeof(object)) + { + builders.CsharpFunctions.Append('('); + AppendCsharpTypeName( + invokeMethod.ReturnType, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(')'); + } + AppendHandleStoreTypeName( invokeMethod.ReturnType, builders.CsharpFunctions); - builders.CsharpFunctions.Append(')'); - } - AppendHandleStoreTypeName( - invokeMethod.ReturnType, - builders.CsharpFunctions); - builders.CsharpFunctions.Append(".Get("); - } - else if (invokeReturnTypeKind == TypeKind.ManagedStruct) - { - AppendHandleStoreTypeName( - invokeMethod.ReturnType, - builders.CsharpFunctions); - builders.CsharpFunctions.Append(".Get("); + builders.CsharpFunctions.Append(".Get(returnVal);\n"); + break; + default: + builders.CsharpFunctions.Append("returnVal;\n"); + break; } } - AppendCsharpDelegateName( - type.Name, - type.Namespace, - typeParams, - "CppInvoke", - builders.CsharpFunctions); - builders.CsharpFunctions.Append("(CppHandle"); - if (invokeParams.Length > 0) - { - builders.CsharpFunctions.Append(", "); - } - AppendParameterCall( - invokeParams, - " ", - builders.CsharpFunctions); - builders.CsharpFunctions.Append(")"); - if (invokeMethod.ReturnType != typeof(void) && - (invokeReturnTypeKind == TypeKind.Class || - invokeReturnTypeKind == TypeKind.ManagedStruct)) - { - builders.CsharpFunctions.Append(')'); - } - builders.CsharpFunctions.Append(";\n"); builders.CsharpFunctions.Append("\t\t\t\t}\n"); if (invokeMethod.ReturnType != typeof(void)) { - builders.CsharpFunctions.Append("\t\t\t\telse\n"); - builders.CsharpFunctions.Append("\t\t\t\t{\n"); - builders.CsharpFunctions.Append("\t\t\t\t\treturn default("); + builders.CsharpFunctions.Append("\t\t\t\treturn default("); AppendCsharpTypeName( invokeMethod.ReturnType, builders.CsharpFunctions); builders.CsharpFunctions.Append(");\n"); - builders.CsharpFunctions.Append("\t\t\t\t}\n"); } builders.CsharpFunctions.Append("\t\t\t}\n"); builders.CsharpFunctions.Append("\t\t}\n"); @@ -5270,8 +5408,8 @@ static void AppendDelegate( builders.CsharpFunctions.Append("var thiz = new "); builders.CsharpFunctions.Append(typeName); builders.CsharpFunctions.Append("(cppHandle);\n"); - builders.CsharpFunctions.Append("\t\t\t\thandle = NativeScript.Bindings.ObjectStore.Store(thiz);\n"); - builders.CsharpFunctions.Append("\t\t\t\tdelegateHandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate);"); + builders.CsharpFunctions.Append("\t\t\t\tclassHandle = NativeScript.Bindings.ObjectStore.Store(thiz);\n"); + builders.CsharpFunctions.Append("\t\t\t\thandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate);"); AppendCsharpFunctionReturn( constructorParams, typeof(void), @@ -5300,11 +5438,14 @@ static void AppendDelegate( typeParams, releaseParams, builders.CsharpFunctions); - builders.CsharpFunctions.Append("var thiz = ("); + builders.CsharpFunctions.Append("if (classHandle != 0)\n"); + builders.CsharpFunctions.Append("\t\t\t\t{\n"); + builders.CsharpFunctions.Append("\t\t\t\t\tvar thiz = ("); builders.CsharpFunctions.Append(typeName); - builders.CsharpFunctions.Append(")NativeScript.Bindings.ObjectStore.Remove(handle);\n"); - builders.CsharpFunctions.Append("\t\t\t\tthiz.CppHandle = 0;\n"); - builders.CsharpFunctions.Append("\t\t\t\tNativeScript.Bindings.ObjectStore.Remove(delegateHandle);"); + builders.CsharpFunctions.Append(")NativeScript.Bindings.ObjectStore.Remove(classHandle);\n"); + builders.CsharpFunctions.Append("\t\t\t\t\tthiz.CppHandle = 0;\n"); + builders.CsharpFunctions.Append("\t\t\t\t}\n"); + builders.CsharpFunctions.Append("\t\t\t\tNativeScript.Bindings.ObjectStore.Remove(handle);"); AppendCsharpFunctionReturn( releaseParams, typeof(void), @@ -5334,13 +5475,15 @@ static void AppendDelegate( invokeParamsWithThis, builders.CsharpFunctions); builders.CsharpFunctions.Append("(("); - builders.CsharpFunctions.Append(typeName); - builders.CsharpFunctions.Append(")NativeScript.Bindings.ObjectStore.Get(thisHandle)).Delegate"); + AppendCsharpTypeName( + type, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(")NativeScript.Bindings.ObjectStore.Get(thisHandle))"); AppendCsharpFunctionCallParameters( true, invokeParams, builders.CsharpFunctions); - builders.CsharpFunctions.Append(";\n"); + builders.CsharpFunctions.Append(';'); AppendCsharpFunctionReturn( invokeParams, invokeMethod.ReturnType, @@ -5352,82 +5495,76 @@ static void AppendDelegate( // C# add delegate type AppendCsharpDelegateType( addFuncName, - true, + false, type, TypeKind.Class, typeof(void), - addRemoveCsharpParams, + addRemoveParams, builders.CsharpDelegateTypes); // C# add function AppendCsharpFunctionBeginning( type, addFuncName, - true, + false, TypeKind.Class, typeof(void), typeParams, - addRemoveCsharpParams, + addRemoveParams, builders.CsharpFunctions); - builders.CsharpFunctions.Append("var thiz = ("); - builders.CsharpFunctions.Append(typeName); - builders.CsharpFunctions.Append(")NativeScript.Bindings.ObjectStore.Get(thisHandle);\n"); - builders.CsharpFunctions.Append("\t\t\t\tthiz.Delegate += del;"); + builders.CsharpFunctions.Append("thiz += del;"); AppendCsharpFunctionReturn( - addRemoveCsharpParams, + addRemoveParams, typeof(void), TypeKind.Class, null, - true, + false, builders.CsharpFunctions); // C# remove delegate type AppendCsharpDelegateType( removeFuncName, - true, + false, type, TypeKind.Class, typeof(void), - addRemoveCsharpParams, + addRemoveParams, builders.CsharpDelegateTypes); // C# remove function AppendCsharpFunctionBeginning( type, removeFuncName, - true, + false, TypeKind.Class, typeof(void), typeParams, - addRemoveCsharpParams, + addRemoveParams, builders.CsharpFunctions); - builders.CsharpFunctions.Append("var thiz = ("); - builders.CsharpFunctions.Append(typeName); - builders.CsharpFunctions.Append(")NativeScript.Bindings.ObjectStore.Get(thisHandle);\n"); - builders.CsharpFunctions.Append("\t\t\t\tthiz.Delegate -= del;"); + builders.CsharpFunctions.Append("thiz -= del;"); AppendCsharpFunctionReturn( - addRemoveCsharpParams, + addRemoveParams, typeof(void), TypeKind.Class, null, - true, + false, builders.CsharpFunctions); // C# init params AppendCsharpInitParam( - releaseFuncName, + releaseFuncNameLower, builders.CsharpInitParams); AppendCsharpInitParam( - constructorFuncName, + constructorFuncNameLower, builders.CsharpInitParams); AppendCsharpInitParam( - invokeFuncName, + invokeFuncNameLower, builders.CsharpInitParams); AppendCsharpInitParam( - addFuncName, + addFuncNameLower, builders.CsharpInitParams); AppendCsharpInitParam( - removeFuncName, + removeFuncNameLower, builders.CsharpInitParams); // C# init call args @@ -5984,7 +6121,6 @@ static void AppendGetter( enclosingTypeIsStatic, false, methodIsStatic, - false, fieldType, null, parameters, @@ -6184,7 +6320,6 @@ static void AppendSetter( enclosingTypeIsStatic, false, methodIsStatic, - false, typeof(void), null, parameters, @@ -6540,6 +6675,7 @@ static int AppendCppMethodDefinitionsBegin( bool isStatic, int indent, bool includeDestructor, + bool includeHandleConstructor, StringBuilder output) { int cppMethodDefinitionsIndent = AppendNamespaceBeginning( @@ -6570,66 +6706,47 @@ static int AppendCppMethodDefinitionsBegin( output.Append("(std::nullptr_t n)\n"); AppendIndent(indent, output); output.Append("\t: "); - AppendCppTypeName( - baseTypeNamespace, - baseTypeName, - output); - AppendCppTypeParameters( - baseTypeTypeParams, - output); - output.Append("(nullptr)\n"); - AppendIndent(indent, output); - output.Append("{\n"); - AppendIndent(indent, output); - output.Append("}\n"); - AppendIndent(indent, output); - output.Append("\n"); - - // Construct with handle - AppendIndent(indent, output); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, - output); - AppendCppTypeParameters( - enclosingTypeParams, - output); - output.Append("::"); AppendTypeNameWithoutGenericSuffix( enclosingTypeName, output); - output.Append("(Plugin::InternalUse iu, int32_t handle)\n"); - AppendIndent(indent, output); - output.Append("\t: "); - AppendCppTypeName( - baseTypeNamespace, - baseTypeName, - output); - AppendCppTypeParameters( - baseTypeTypeParams, - output); - output.Append("(iu, handle)\n"); + output.Append("(Plugin::InternalUse::Only, 0)\n"); AppendIndent(indent, output); output.Append("{\n"); - AppendIndent(indent + 1, output); - output.Append("if (handle)\n"); - AppendIndent(indent + 1, output); - output.Append("{\n"); - AppendIndent(indent + 2, output); - AppendReferenceManagedHandleFunctionCall( - enclosingTypeName, - enclosingTypeNamespace, - enclosingTypeKind, - enclosingTypeParams, - "handle", - output); - output.Append(";\n"); - AppendIndent(indent + 1, output); - output.Append("}\n"); AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); output.Append("\n"); + if (includeHandleConstructor) + { + AppendCppHandleConstructorDefintionBegin( + enclosingTypeName, + enclosingTypeParams, + baseTypeName, + baseTypeNamespace, + baseTypeTypeParams, + indent, + output); + AppendIndent(indent + 1, output); + output.Append("if (handle)\n"); + AppendIndent(indent + 1, output); + output.Append("{\n"); + AppendIndent(indent + 2, output); + AppendReferenceManagedHandleFunctionCall( + enclosingTypeName, + enclosingTypeNamespace, + enclosingTypeKind, + enclosingTypeParams, + "handle", + output); + output.Append(";\n"); + AppendIndent(indent + 1, output); + output.Append("}\n"); + AppendCppHandleConstructorDefintionEnd( + indent, + output); + } + // Copy constructor AppendIndent(indent, output); AppendTypeNameWithoutGenericSuffix( @@ -6652,31 +6769,12 @@ static int AppendCppMethodDefinitionsBegin( output.Append("& other)\n"); AppendIndent(indent, output); output.Append("\t: "); - AppendCppTypeName( - baseTypeNamespace, - baseTypeName, - output); - AppendCppTypeParameters( - baseTypeTypeParams, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent(indent, output); output.Append("{\n"); - AppendIndent(indent + 1, output); - output.Append("if (Handle)\n"); - AppendIndent(indent + 1, output); - output.Append("{\n"); - AppendIndent(indent + 2, output); - AppendReferenceManagedHandleFunctionCall( - enclosingTypeName, - enclosingTypeNamespace, - enclosingTypeKind, - enclosingTypeParams, - "Handle", - output); - output.Append(";\n"); - AppendIndent(indent + 1, output); - output.Append("}\n"); AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); @@ -6704,12 +6802,8 @@ static int AppendCppMethodDefinitionsBegin( output.Append("&& other)\n"); AppendIndent(indent, output); output.Append("\t: "); - AppendCppTypeName( - baseTypeNamespace, - baseTypeName, - output); - AppendCppTypeParameters( - baseTypeTypeParams, + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, output); output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent(indent, output); @@ -6935,6 +7029,51 @@ static int AppendCppMethodDefinitionsBegin( return cppMethodDefinitionsIndent; } + static void AppendCppHandleConstructorDefintionBegin( + string enclosingTypeName, + Type[] enclosingTypeParams, + string baseTypeName, + string baseTypeNamespace, + Type[] baseTypeTypeParams, + int indent, + StringBuilder output) + { + AppendIndent(indent, output); + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, + output); + AppendCppTypeParameters( + enclosingTypeParams, + output); + output.Append("::"); + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, + output); + output.Append("(Plugin::InternalUse iu, int32_t handle)\n"); + AppendIndent(indent, output); + output.Append("\t: "); + AppendCppTypeName( + baseTypeNamespace, + baseTypeName, + output); + AppendCppTypeParameters( + baseTypeTypeParams, + output); + output.Append("(iu, handle)\n"); + AppendIndent(indent, output); + output.Append("{\n"); + } + + static void AppendCppHandleConstructorDefintionEnd( + int indent, + StringBuilder output) + { + AppendIndent(indent, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("\n"); + } + static void AppendCppDestructorDefinitionBegin( string enclosingTypeName, string enclosingTypeNamespace, @@ -8082,7 +8221,6 @@ static void AppendCppMethodDeclaration( bool enclosingTypeIsStatic, bool methodIsVirtual, bool methodIsStatic, - bool methodIsPure, Type returnType, Type[] typeParameters, ParameterInfo[] parameters, @@ -8124,11 +8262,6 @@ static void AppendCppMethodDeclaration( output); output.Append(')'); - if (methodIsPure) - { - output.Append(" = 0"); - } - output.Append(";\n"); } diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 820fa53..a3a4f79 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -490,6 +490,21 @@ "Set": {} } ] + }, + { + "Name": "System.AppDomainSetup", + "Constructors": [ + { + "ParamTypes": [] + } + ], + "Properties": [ + { + "Name": "AppDomainInitializer", + "Get": {}, + "Set": {} + } + ] } ], "MonoBehaviours": [ @@ -570,6 +585,9 @@ "MaxSimultaneous": 25 } ] + }, + { + "Type": "System.AppDomainInitializer" } ] } \ No newline at end of file diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index bbd9f9b..f6b3dd4 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -58,6 +58,17 @@ struct FuncReturningString : System::Func3 } }; +struct MyAppDomainInitializer : AppDomainInitializer +{ + void operator()(System::Array1 args) override + { + for (int i = 0, len = args.GetLength(); i < len; ++i) + { + Debug::Log(args.GetItem(i)); + } + } +}; + // Called when the plugin is initialized // This is mostly full of test code. Feel free to remove it all. void PluginMain() @@ -89,6 +100,13 @@ void PluginMain() PlainAction pa; pa.Invoke(); + MyAppDomainInitializer madi; + AppDomainSetup ads; + ads.SetAppDomainInitializer(madi); + Array1 invokeParams(1); + invokeParams.SetItem(0, "Hello"); + ads.GetAppDomainInitializer().Invoke(invokeParams); + GameObject go(String("GameObject with a TestScript")); go.AddComponent(); } diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index cd3b93f..8da9a20 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -103,6 +103,9 @@ namespace Plugin int32_t (*UnityEngineGradientConstructor)(); int32_t (*UnityEngineGradientPropertyGetColorKeys)(int32_t thisHandle); void (*UnityEngineGradientPropertySetColorKeys)(int32_t thisHandle, int32_t valueHandle); + int32_t (*SystemAppDomainSetupConstructor)(); + int32_t (*SystemAppDomainSetupPropertyGetAppDomainInitializer)(int32_t thisHandle); + void (*SystemAppDomainSetupPropertySetAppDomainInitializer)(int32_t thisHandle, int32_t valueHandle); int32_t (*SystemInt32Array1Constructor1)(int32_t length0); int32_t (*SystemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*SystemInt32Array1SetItem1)(int32_t thisHandle, int32_t index0, int32_t item); @@ -129,31 +132,36 @@ namespace Plugin int32_t (*UnityEngineGradientColorKeyArray1Constructor1)(int32_t length0); UnityEngine::GradientColorKey (*UnityEngineGradientColorKeyArray1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*UnityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item); - void (*ReleaseSystemAction)(int32_t handle, int32_t delegateHandle); - void (*SystemActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle); + void (*ReleaseSystemAction)(int32_t handle, int32_t classHandle); + void (*SystemActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); void (*SystemActionInvoke)(int32_t thisHandle); void (*SystemActionAdd)(int32_t thisHandle, int32_t delHandle); void (*SystemActionRemove)(int32_t thisHandle, int32_t delHandle); - void (*ReleaseSystemActionSystemSingle)(int32_t handle, int32_t delegateHandle); - void (*SystemActionSystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle); + void (*ReleaseSystemActionSystemSingle)(int32_t handle, int32_t classHandle); + void (*SystemActionSystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); void (*SystemActionSystemSingleInvoke)(int32_t thisHandle, float obj); void (*SystemActionSystemSingleAdd)(int32_t thisHandle, int32_t delHandle); void (*SystemActionSystemSingleRemove)(int32_t thisHandle, int32_t delHandle); - void (*ReleaseSystemActionSystemSingle_SystemSingle)(int32_t handle, int32_t delegateHandle); - void (*SystemActionSystemSingle_SystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle); + void (*ReleaseSystemActionSystemSingle_SystemSingle)(int32_t handle, int32_t classHandle); + void (*SystemActionSystemSingle_SystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); void (*SystemActionSystemSingle_SystemSingleInvoke)(int32_t thisHandle, float arg1, float arg2); void (*SystemActionSystemSingle_SystemSingleAdd)(int32_t thisHandle, int32_t delHandle); void (*SystemActionSystemSingle_SystemSingleRemove)(int32_t thisHandle, int32_t delHandle); - void (*ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble)(int32_t handle, int32_t delegateHandle); - void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle); + void (*ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble)(int32_t handle, int32_t classHandle); + void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); double (*SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)(int32_t thisHandle, int32_t arg1, float arg2); void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd)(int32_t thisHandle, int32_t delHandle); void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove)(int32_t thisHandle, int32_t delHandle); - void (*ReleaseSystemFuncSystemInt16_SystemInt32_SystemString)(int32_t handle, int32_t delegateHandle); - void (*SystemFuncSystemInt16_SystemInt32_SystemStringConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle); + void (*ReleaseSystemFuncSystemInt16_SystemInt32_SystemString)(int32_t handle, int32_t classHandle); + void (*SystemFuncSystemInt16_SystemInt32_SystemStringConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); int32_t (*SystemFuncSystemInt16_SystemInt32_SystemStringInvoke)(int32_t thisHandle, int16_t arg1, int32_t arg2); void (*SystemFuncSystemInt16_SystemInt32_SystemStringAdd)(int32_t thisHandle, int32_t delHandle); void (*SystemFuncSystemInt16_SystemInt32_SystemStringRemove)(int32_t thisHandle, int32_t delHandle); + void (*ReleaseSystemAppDomainInitializer)(int32_t handle, int32_t classHandle); + void (*SystemAppDomainInitializerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); + void (*SystemAppDomainInitializerInvoke)(int32_t thisHandle, int32_t argsHandle); + void (*SystemAppDomainInitializerAdd)(int32_t thisHandle, int32_t delHandle); + void (*SystemAppDomainInitializerRemove)(int32_t thisHandle, int32_t delHandle); /*END FUNCTION POINTERS*/ } @@ -364,6 +372,31 @@ namespace Plugin *pRelease = (System::Func3*)NextFreeSystemFuncSystemInt16_SystemInt32_SystemString; NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = pRelease; } + int32_t SystemAppDomainInitializerFreeListSize; + System::AppDomainInitializer** SystemAppDomainInitializerFreeList; + System::AppDomainInitializer** NextFreeSystemAppDomainInitializer; + + int32_t StoreSystemAppDomainInitializer(System::AppDomainInitializer* del) + { + assert(NextFreeSystemAppDomainInitializer != nullptr); + System::AppDomainInitializer** pNext = NextFreeSystemAppDomainInitializer; + NextFreeSystemAppDomainInitializer = (System::AppDomainInitializer**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemAppDomainInitializerFreeList); + } + + System::AppDomainInitializer* GetSystemAppDomainInitializer(int32_t handle) + { + assert(handle >= 0 && handle < SystemAppDomainInitializerFreeListSize); + return SystemAppDomainInitializerFreeList[handle]; + } + + void RemoveSystemAppDomainInitializer(int32_t handle) + { + System::AppDomainInitializer** pRelease = SystemAppDomainInitializerFreeList + handle; + *pRelease = (System::AppDomainInitializer*)NextFreeSystemAppDomainInitializer; + NextFreeSystemAppDomainInitializer = pRelease; + } /*END GLOBAL STATE AND FUNCTIONS*/ } @@ -492,6 +525,11 @@ namespace System return *this; } + String::String() + : Object(nullptr) + { + } + String::String(const char* chars) : Object(Plugin::InternalUse::Only, Plugin::StringNew(chars)) { @@ -524,7 +562,7 @@ namespace System namespace Diagnostics { Stopwatch::Stopwatch(std::nullptr_t n) - : System::Object(nullptr) + : Stopwatch(Plugin::InternalUse::Only, 0) { } @@ -538,16 +576,12 @@ namespace System } Stopwatch::Stopwatch(const Stopwatch& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Stopwatch(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Stopwatch::Stopwatch(Stopwatch&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Stopwatch(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -669,7 +703,7 @@ namespace System namespace UnityEngine { Object::Object(std::nullptr_t n) - : System::Object(nullptr) + : Object(Plugin::InternalUse::Only, 0) { } @@ -683,16 +717,12 @@ namespace UnityEngine } Object::Object(const Object& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Object(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Object::Object(Object&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -809,7 +839,7 @@ namespace UnityEngine namespace UnityEngine { GameObject::GameObject(std::nullptr_t n) - : UnityEngine::Object(nullptr) + : GameObject(Plugin::InternalUse::Only, 0) { } @@ -823,16 +853,12 @@ namespace UnityEngine } GameObject::GameObject(const GameObject& other) - : UnityEngine::Object(Plugin::InternalUse::Only, other.Handle) + : GameObject(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } GameObject::GameObject(GameObject&& other) - : UnityEngine::Object(Plugin::InternalUse::Only, other.Handle) + : GameObject(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -960,7 +986,7 @@ namespace UnityEngine namespace UnityEngine { Component::Component(std::nullptr_t n) - : UnityEngine::Object(nullptr) + : Component(Plugin::InternalUse::Only, 0) { } @@ -974,16 +1000,12 @@ namespace UnityEngine } Component::Component(const Component& other) - : UnityEngine::Object(Plugin::InternalUse::Only, other.Handle) + : Component(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Component::Component(Component&& other) - : UnityEngine::Object(Plugin::InternalUse::Only, other.Handle) + : Component(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1062,7 +1084,7 @@ namespace UnityEngine namespace UnityEngine { Transform::Transform(std::nullptr_t n) - : UnityEngine::Component(nullptr) + : Transform(Plugin::InternalUse::Only, 0) { } @@ -1076,16 +1098,12 @@ namespace UnityEngine } Transform::Transform(const Transform& other) - : UnityEngine::Component(Plugin::InternalUse::Only, other.Handle) + : Transform(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Transform::Transform(Transform&& other) - : UnityEngine::Component(Plugin::InternalUse::Only, other.Handle) + : Transform(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1176,7 +1194,7 @@ namespace UnityEngine namespace UnityEngine { Debug::Debug(std::nullptr_t n) - : System::Object(nullptr) + : Debug(Plugin::InternalUse::Only, 0) { } @@ -1190,16 +1208,12 @@ namespace UnityEngine } Debug::Debug(const Debug& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Debug(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Debug::Debug(Debug&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Debug(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1332,7 +1346,7 @@ namespace UnityEngine namespace UnityEngine { Collision::Collision(std::nullptr_t n) - : System::Object(nullptr) + : Collision(Plugin::InternalUse::Only, 0) { } @@ -1346,16 +1360,12 @@ namespace UnityEngine } Collision::Collision(const Collision& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Collision(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Collision::Collision(Collision&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Collision(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1421,7 +1431,7 @@ namespace UnityEngine namespace UnityEngine { Behaviour::Behaviour(std::nullptr_t n) - : UnityEngine::Component(nullptr) + : Behaviour(Plugin::InternalUse::Only, 0) { } @@ -1435,16 +1445,12 @@ namespace UnityEngine } Behaviour::Behaviour(const Behaviour& other) - : UnityEngine::Component(Plugin::InternalUse::Only, other.Handle) + : Behaviour(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Behaviour::Behaviour(Behaviour&& other) - : UnityEngine::Component(Plugin::InternalUse::Only, other.Handle) + : Behaviour(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1510,7 +1516,7 @@ namespace UnityEngine namespace UnityEngine { MonoBehaviour::MonoBehaviour(std::nullptr_t n) - : UnityEngine::Behaviour(nullptr) + : MonoBehaviour(Plugin::InternalUse::Only, 0) { } @@ -1524,16 +1530,12 @@ namespace UnityEngine } MonoBehaviour::MonoBehaviour(const MonoBehaviour& other) - : UnityEngine::Behaviour(Plugin::InternalUse::Only, other.Handle) + : MonoBehaviour(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } MonoBehaviour::MonoBehaviour(MonoBehaviour&& other) - : UnityEngine::Behaviour(Plugin::InternalUse::Only, other.Handle) + : MonoBehaviour(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1599,7 +1601,7 @@ namespace UnityEngine namespace UnityEngine { AudioSettings::AudioSettings(std::nullptr_t n) - : System::Object(nullptr) + : AudioSettings(Plugin::InternalUse::Only, 0) { } @@ -1613,16 +1615,12 @@ namespace UnityEngine } AudioSettings::AudioSettings(const AudioSettings& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : AudioSettings(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } AudioSettings::AudioSettings(AudioSettings&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : AudioSettings(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1702,7 +1700,7 @@ namespace UnityEngine namespace Networking { NetworkTransport::NetworkTransport(std::nullptr_t n) - : System::Object(nullptr) + : NetworkTransport(Plugin::InternalUse::Only, 0) { } @@ -1716,16 +1714,12 @@ namespace UnityEngine } NetworkTransport::NetworkTransport(const NetworkTransport& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : NetworkTransport(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } NetworkTransport::NetworkTransport(NetworkTransport&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : NetworkTransport(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -1932,7 +1926,7 @@ namespace UnityEngine namespace UnityEngine { RaycastHit::RaycastHit(std::nullptr_t n) - : System::ValueType(nullptr) + : RaycastHit(Plugin::InternalUse::Only, 0) { } @@ -1946,16 +1940,12 @@ namespace UnityEngine } RaycastHit::RaycastHit(const RaycastHit& other) - : System::ValueType(Plugin::InternalUse::Only, other.Handle) + : RaycastHit(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); - } } RaycastHit::RaycastHit(RaycastHit&& other) - : System::ValueType(Plugin::InternalUse::Only, other.Handle) + : RaycastHit(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2063,7 +2053,7 @@ namespace System namespace Generic { KeyValuePair::KeyValuePair(std::nullptr_t n) - : System::ValueType(nullptr) + : KeyValuePair(Plugin::InternalUse::Only, 0) { } @@ -2077,16 +2067,12 @@ namespace System } KeyValuePair::KeyValuePair(const KeyValuePair& other) - : System::ValueType(Plugin::InternalUse::Only, other.Handle) + : KeyValuePair(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); - } } KeyValuePair::KeyValuePair(KeyValuePair&& other) - : System::ValueType(Plugin::InternalUse::Only, other.Handle) + : KeyValuePair(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2202,7 +2188,7 @@ namespace System namespace Generic { List::List(std::nullptr_t n) - : System::Object(nullptr) + : List(Plugin::InternalUse::Only, 0) { } @@ -2216,16 +2202,12 @@ namespace System } List::List(const List& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : List(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } List::List(List&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : List(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2352,7 +2334,7 @@ namespace System namespace Generic { LinkedListNode::LinkedListNode(std::nullptr_t n) - : System::Object(nullptr) + : LinkedListNode(Plugin::InternalUse::Only, 0) { } @@ -2366,16 +2348,12 @@ namespace System } LinkedListNode::LinkedListNode(const LinkedListNode& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : LinkedListNode(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } LinkedListNode::LinkedListNode(LinkedListNode&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : LinkedListNode(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2490,7 +2468,7 @@ namespace System namespace CompilerServices { StrongBox::StrongBox(std::nullptr_t n) - : System::Object(nullptr) + : StrongBox(Plugin::InternalUse::Only, 0) { } @@ -2504,16 +2482,12 @@ namespace System } StrongBox::StrongBox(const StrongBox& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : StrongBox(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } StrongBox::StrongBox(StrongBox&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : StrongBox(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2628,7 +2602,7 @@ namespace System namespace ObjectModel { Collection::Collection(std::nullptr_t n) - : System::Object(nullptr) + : Collection(Plugin::InternalUse::Only, 0) { } @@ -2642,16 +2616,12 @@ namespace System } Collection::Collection(const Collection& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Collection(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Collection::Collection(Collection&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Collection(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2723,7 +2693,7 @@ namespace System namespace ObjectModel { KeyedCollection::KeyedCollection(std::nullptr_t n) - : System::Collections::ObjectModel::Collection(nullptr) + : KeyedCollection(Plugin::InternalUse::Only, 0) { } @@ -2737,16 +2707,12 @@ namespace System } KeyedCollection::KeyedCollection(const KeyedCollection& other) - : System::Collections::ObjectModel::Collection(Plugin::InternalUse::Only, other.Handle) + : KeyedCollection(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } KeyedCollection::KeyedCollection(KeyedCollection&& other) - : System::Collections::ObjectModel::Collection(Plugin::InternalUse::Only, other.Handle) + : KeyedCollection(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2814,7 +2780,7 @@ namespace System namespace System { Exception::Exception(std::nullptr_t n) - : System::Object(nullptr) + : Exception(Plugin::InternalUse::Only, 0) { } @@ -2828,16 +2794,12 @@ namespace System } Exception::Exception(const Exception& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Exception(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Exception::Exception(Exception&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Exception(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -2921,7 +2883,7 @@ namespace System namespace System { SystemException::SystemException(std::nullptr_t n) - : System::Exception(nullptr) + : SystemException(Plugin::InternalUse::Only, 0) { } @@ -2935,16 +2897,12 @@ namespace System } SystemException::SystemException(const SystemException& other) - : System::Exception(Plugin::InternalUse::Only, other.Handle) + : SystemException(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } SystemException::SystemException(SystemException&& other) - : System::Exception(Plugin::InternalUse::Only, other.Handle) + : SystemException(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -3010,7 +2968,7 @@ namespace System namespace System { NullReferenceException::NullReferenceException(std::nullptr_t n) - : System::SystemException(nullptr) + : NullReferenceException(Plugin::InternalUse::Only, 0) { } @@ -3024,16 +2982,12 @@ namespace System } NullReferenceException::NullReferenceException(const NullReferenceException& other) - : System::SystemException(Plugin::InternalUse::Only, other.Handle) + : NullReferenceException(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } NullReferenceException::NullReferenceException(NullReferenceException&& other) - : System::SystemException(Plugin::InternalUse::Only, other.Handle) + : NullReferenceException(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -3181,7 +3135,7 @@ namespace UnityEngine namespace UnityEngine { Screen::Screen(std::nullptr_t n) - : System::Object(nullptr) + : Screen(Plugin::InternalUse::Only, 0) { } @@ -3195,16 +3149,12 @@ namespace UnityEngine } Screen::Screen(const Screen& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Screen(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Screen::Screen(Screen&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Screen(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -3303,7 +3253,7 @@ namespace UnityEngine namespace UnityEngine { Physics::Physics(std::nullptr_t n) - : System::Object(nullptr) + : Physics(Plugin::InternalUse::Only, 0) { } @@ -3317,16 +3267,12 @@ namespace UnityEngine } Physics::Physics(const Physics& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Physics(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Physics::Physics(Physics&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Physics(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -3432,7 +3378,7 @@ namespace UnityEngine namespace UnityEngine { Gradient::Gradient(std::nullptr_t n) - : System::Object(nullptr) + : Gradient(Plugin::InternalUse::Only, 0) { } @@ -3446,16 +3392,12 @@ namespace UnityEngine } Gradient::Gradient(const Gradient& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Gradient(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Gradient::Gradient(Gradient&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Gradient(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -3561,12 +3503,140 @@ namespace UnityEngine } } +namespace System +{ + AppDomainSetup::AppDomainSetup(std::nullptr_t n) + : AppDomainSetup(Plugin::InternalUse::Only, 0) + { + } + + AppDomainSetup::AppDomainSetup(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + AppDomainSetup::AppDomainSetup(const AppDomainSetup& other) + : AppDomainSetup(Plugin::InternalUse::Only, other.Handle) + { + } + + AppDomainSetup::AppDomainSetup(AppDomainSetup&& other) + : AppDomainSetup(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + AppDomainSetup::~AppDomainSetup() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + AppDomainSetup& AppDomainSetup::operator=(const AppDomainSetup& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + AppDomainSetup& AppDomainSetup::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + AppDomainSetup& AppDomainSetup::operator=(AppDomainSetup&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool AppDomainSetup::operator==(const AppDomainSetup& other) const + { + return Handle == other.Handle; + } + + bool AppDomainSetup::operator!=(const AppDomainSetup& other) const + { + return Handle != other.Handle; + } + + AppDomainSetup::AppDomainSetup() + : System::Object(nullptr) + { + auto returnValue = Plugin::SystemAppDomainSetupConstructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + System::AppDomainInitializer AppDomainSetup::GetAppDomainInitializer() + { + auto returnValue = Plugin::SystemAppDomainSetupPropertyGetAppDomainInitializer(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::AppDomainInitializer(Plugin::InternalUse::Only, returnValue); + } + + void AppDomainSetup::SetAppDomainInitializer(System::AppDomainInitializer value) + { + Plugin::SystemAppDomainSetupPropertySetAppDomainInitializer(Handle, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + namespace MyGame { namespace MonoBehaviours { TestScript::TestScript(std::nullptr_t n) - : UnityEngine::MonoBehaviour(nullptr) + : TestScript(Plugin::InternalUse::Only, 0) { } @@ -3580,16 +3650,12 @@ namespace MyGame } TestScript::TestScript(const TestScript& other) - : UnityEngine::MonoBehaviour(Plugin::InternalUse::Only, other.Handle) + : TestScript(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } TestScript::TestScript(TestScript&& other) - : UnityEngine::MonoBehaviour(Plugin::InternalUse::Only, other.Handle) + : TestScript(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -3656,7 +3722,7 @@ namespace MyGame namespace System { Array1::Array1(std::nullptr_t n) - : System::Array(nullptr) + : Array1(Plugin::InternalUse::Only, 0) { } @@ -3670,16 +3736,12 @@ namespace System } Array1::Array1(const Array1& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array1(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Array1::Array1(Array1&& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -3798,7 +3860,7 @@ namespace System namespace System { Array1::Array1(std::nullptr_t n) - : System::Array(nullptr) + : Array1(Plugin::InternalUse::Only, 0) { } @@ -3812,16 +3874,12 @@ namespace System } Array1::Array1(const Array1& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array1(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Array1::Array1(Array1&& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -3940,7 +3998,7 @@ namespace System namespace System { Array2::Array2(std::nullptr_t n) - : System::Array(nullptr) + : Array2(Plugin::InternalUse::Only, 0) { } @@ -3954,16 +4012,12 @@ namespace System } Array2::Array2(const Array2& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array2(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Array2::Array2(Array2&& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array2(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -4095,7 +4149,7 @@ namespace System namespace System { Array3::Array3(std::nullptr_t n) - : System::Array(nullptr) + : Array3(Plugin::InternalUse::Only, 0) { } @@ -4109,16 +4163,12 @@ namespace System } Array3::Array3(const Array3& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array3(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Array3::Array3(Array3&& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array3(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -4250,7 +4300,7 @@ namespace System namespace System { Array1::Array1(std::nullptr_t n) - : System::Array(nullptr) + : Array1(Plugin::InternalUse::Only, 0) { } @@ -4264,16 +4314,12 @@ namespace System } Array1::Array1(const Array1& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array1(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Array1::Array1(Array1&& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -4392,7 +4438,7 @@ namespace System namespace System { Array1::Array1(std::nullptr_t n) - : System::Array(nullptr) + : Array1(Plugin::InternalUse::Only, 0) { } @@ -4406,16 +4452,12 @@ namespace System } Array1::Array1(const Array1& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array1(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Array1::Array1(Array1&& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -4534,7 +4576,7 @@ namespace System namespace System { Array1::Array1(std::nullptr_t n) - : System::Array(nullptr) + : Array1(Plugin::InternalUse::Only, 0) { } @@ -4548,16 +4590,12 @@ namespace System } Array1::Array1(const Array1& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array1(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Array1::Array1(Array1&& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -4676,7 +4714,7 @@ namespace System namespace System { Array1::Array1(std::nullptr_t n) - : System::Array(nullptr) + : Array1(Plugin::InternalUse::Only, 0) { } @@ -4690,16 +4728,12 @@ namespace System } Array1::Array1(const Array1& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array1(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Array1::Array1(Array1&& other) - : System::Array(Plugin::InternalUse::Only, other.Handle) + : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -4818,30 +4852,17 @@ namespace System namespace System { Action::Action(std::nullptr_t n) - : System::Object(nullptr) + : Action(Plugin::InternalUse::Only, 0) { } - Action::Action(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + Action::Action(const Action& other) + : Action(Plugin::InternalUse::Only, other.Handle) { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Action::Action(const Action& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Action::Action(Action&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Action(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -4898,7 +4919,7 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemAction(this); - Plugin::SystemActionConstructor(CppHandle, &Handle, &DelegateHandle); + Plugin::SystemActionConstructor(CppHandle, &Handle, &ClassHandle); if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -4916,6 +4937,32 @@ namespace System } } + Action::Action(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + ClassHandle = 0; + CppHandle = Plugin::StoreSystemAction(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemAction(CppHandle); + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void Action::operator()() + { + } + void Action::Invoke() { Plugin::SystemActionInvoke(Handle); @@ -4932,7 +4979,7 @@ namespace System { if (Handle) { - Plugin::ReleaseSystemAction(Handle, DelegateHandle); + Plugin::ReleaseSystemAction(Handle, ClassHandle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4941,13 +4988,14 @@ namespace System delete ex; } Plugin::RemoveSystemAction(CppHandle); + ClassHandle = 0; Handle = 0; } } void Action::operator+=(System::Action& del) { - Plugin::SystemActionAdd(Handle, del.DelegateHandle); + Plugin::SystemActionAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4959,7 +5007,7 @@ namespace System void Action::operator-=(System::Action& del) { - Plugin::SystemActionRemove(Handle, del.DelegateHandle); + Plugin::SystemActionRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4978,30 +5026,17 @@ namespace System namespace System { Action1::Action1(std::nullptr_t n) - : System::Object(nullptr) + : Action1(Plugin::InternalUse::Only, 0) { } - Action1::Action1(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - Action1::Action1(const Action1& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Action1(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Action1::Action1(Action1&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Action1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -5058,7 +5093,29 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemActionSystemSingle(this); - Plugin::SystemActionSystemSingleConstructor(CppHandle, &Handle, &DelegateHandle); + Plugin::SystemActionSystemSingleConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemActionSystemSingle(CppHandle); + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + Action1::Action1(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + ClassHandle = 0; + CppHandle = Plugin::StoreSystemActionSystemSingle(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -5076,6 +5133,10 @@ namespace System } } + void Action1::operator()(float obj) + { + } + void Action1::Invoke(float obj) { Plugin::SystemActionSystemSingleInvoke(Handle, obj); @@ -5092,7 +5153,7 @@ namespace System { if (Handle) { - Plugin::ReleaseSystemActionSystemSingle(Handle, DelegateHandle); + Plugin::ReleaseSystemActionSystemSingle(Handle, ClassHandle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5101,13 +5162,14 @@ namespace System delete ex; } Plugin::RemoveSystemActionSystemSingle(CppHandle); + ClassHandle = 0; Handle = 0; } } void Action1::operator+=(System::Action1& del) { - Plugin::SystemActionSystemSingleAdd(Handle, del.DelegateHandle); + Plugin::SystemActionSystemSingleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5119,7 +5181,7 @@ namespace System void Action1::operator-=(System::Action1& del) { - Plugin::SystemActionSystemSingleRemove(Handle, del.DelegateHandle); + Plugin::SystemActionSystemSingleRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5138,30 +5200,17 @@ namespace System namespace System { Action2::Action2(std::nullptr_t n) - : System::Object(nullptr) - { - } - - Action2::Action2(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + : Action2(Plugin::InternalUse::Only, 0) { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } } Action2::Action2(const Action2& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Action2(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Action2::Action2(Action2&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Action2(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -5218,7 +5267,7 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); - Plugin::SystemActionSystemSingle_SystemSingleConstructor(CppHandle, &Handle, &DelegateHandle); + Plugin::SystemActionSystemSingle_SystemSingleConstructor(CppHandle, &Handle, &ClassHandle); if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -5236,6 +5285,32 @@ namespace System } } + Action2::Action2(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + ClassHandle = 0; + CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void Action2::operator()(float arg1, float arg2) + { + } + void Action2::Invoke(float arg1, float arg2) { Plugin::SystemActionSystemSingle_SystemSingleInvoke(Handle, arg1, arg2); @@ -5252,7 +5327,7 @@ namespace System { if (Handle) { - Plugin::ReleaseSystemActionSystemSingle_SystemSingle(Handle, DelegateHandle); + Plugin::ReleaseSystemActionSystemSingle_SystemSingle(Handle, ClassHandle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5261,13 +5336,14 @@ namespace System delete ex; } Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); + ClassHandle = 0; Handle = 0; } } void Action2::operator+=(System::Action2& del) { - Plugin::SystemActionSystemSingle_SystemSingleAdd(Handle, del.DelegateHandle); + Plugin::SystemActionSystemSingle_SystemSingleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5279,7 +5355,7 @@ namespace System void Action2::operator-=(System::Action2& del) { - Plugin::SystemActionSystemSingle_SystemSingleRemove(Handle, del.DelegateHandle); + Plugin::SystemActionSystemSingle_SystemSingleRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5298,30 +5374,17 @@ namespace System namespace System { Func3::Func3(std::nullptr_t n) - : System::Object(nullptr) - { - } - - Func3::Func3(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + : Func3(Plugin::InternalUse::Only, 0) { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } } Func3::Func3(const Func3& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Func3(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Func3::Func3(Func3&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Func3(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -5378,7 +5441,7 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(CppHandle, &Handle, &DelegateHandle); + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(CppHandle, &Handle, &ClassHandle); if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -5396,6 +5459,33 @@ namespace System } } + Func3::Func3(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + ClassHandle = 0; + CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + double Func3::operator()(int32_t arg1, float arg2) + { + return {}; + } + double Func3::Invoke(int32_t arg1, float arg2) { auto returnValue = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(Handle, arg1, arg2); @@ -5413,7 +5503,7 @@ namespace System { if (Handle) { - Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(Handle, DelegateHandle); + Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(Handle, ClassHandle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5422,13 +5512,14 @@ namespace System delete ex; } Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); + ClassHandle = 0; Handle = 0; } } void Func3::operator+=(System::Func3& del) { - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(Handle, del.DelegateHandle); + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5440,7 +5531,7 @@ namespace System void Func3::operator-=(System::Func3& del) { - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(Handle, del.DelegateHandle); + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5459,30 +5550,17 @@ namespace System namespace System { Func3::Func3(std::nullptr_t n) - : System::Object(nullptr) - { - } - - Func3::Func3(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + : Func3(Plugin::InternalUse::Only, 0) { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } } Func3::Func3(const Func3& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Func3(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } Func3::Func3(Func3&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + : Func3(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } @@ -5539,7 +5617,7 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(CppHandle, &Handle, &DelegateHandle); + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(CppHandle, &Handle, &ClassHandle); if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -5557,6 +5635,33 @@ namespace System } } + Func3::Func3(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + ClassHandle = 0; + CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + System::String Func3::operator()(int16_t arg1, int32_t arg2) + { + return {}; + } + System::String Func3::Invoke(int16_t arg1, int32_t arg2) { auto returnValue = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(Handle, arg1, arg2); @@ -5574,7 +5679,7 @@ namespace System { if (Handle) { - Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(Handle, DelegateHandle); + Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(Handle, ClassHandle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5583,13 +5688,14 @@ namespace System delete ex; } Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); + ClassHandle = 0; Handle = 0; } } void Func3::operator+=(System::Func3& del) { - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd(Handle, del.DelegateHandle); + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5601,7 +5707,7 @@ namespace System void Func3::operator-=(System::Func3& del) { - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove(Handle, del.DelegateHandle); + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5617,6 +5723,180 @@ namespace System } } +namespace System +{ + AppDomainInitializer::AppDomainInitializer(std::nullptr_t n) + : AppDomainInitializer(Plugin::InternalUse::Only, 0) + { + } + + AppDomainInitializer::AppDomainInitializer(const AppDomainInitializer& other) + : AppDomainInitializer(Plugin::InternalUse::Only, other.Handle) + { + } + + AppDomainInitializer::AppDomainInitializer(AppDomainInitializer&& other) + : AppDomainInitializer(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + AppDomainInitializer& AppDomainInitializer::operator=(const AppDomainInitializer& other) + { + if (this->Handle != other.Handle) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + } + return *this; + } + + AppDomainInitializer& AppDomainInitializer::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + AppDomainInitializer& AppDomainInitializer::operator=(AppDomainInitializer&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool AppDomainInitializer::operator==(const AppDomainInitializer& other) const + { + return Handle == other.Handle; + } + + bool AppDomainInitializer::operator!=(const AppDomainInitializer& other) const + { + return Handle != other.Handle; + } + + AppDomainInitializer::AppDomainInitializer() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemAppDomainInitializer(this); + Plugin::SystemAppDomainInitializerConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemAppDomainInitializer(CppHandle); + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + AppDomainInitializer::AppDomainInitializer(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + ClassHandle = 0; + CppHandle = Plugin::StoreSystemAppDomainInitializer(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemAppDomainInitializer(CppHandle); + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void AppDomainInitializer::operator()(System::Array1 args) + { + } + + void AppDomainInitializer::Invoke(System::Array1 args) + { + Plugin::SystemAppDomainInitializerInvoke(Handle, args.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + AppDomainInitializer::~AppDomainInitializer() + { + if (Handle) + { + Plugin::ReleaseSystemAppDomainInitializer(Handle, ClassHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Plugin::RemoveSystemAppDomainInitializer(CppHandle); + ClassHandle = 0; + Handle = 0; + } + } + + void AppDomainInitializer::operator+=(System::AppDomainInitializer& del) + { + Plugin::SystemAppDomainInitializerAdd(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void AppDomainInitializer::operator-=(System::AppDomainInitializer& del) + { + Plugin::SystemAppDomainInitializerRemove(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + DLLEXPORT void SystemAppDomainInitializerCppInvoke(int32_t cppHandle, int32_t argsHandle) + { + (*Plugin::GetSystemAppDomainInitializer(cppHandle))(System::Array1(Plugin::InternalUse::Only, argsHandle)); + } +} + namespace System { struct NullReferenceExceptionThrower : System::NullReferenceException @@ -5722,6 +6002,9 @@ DLLEXPORT void Init( int32_t (*unityEngineGradientConstructor)(), int32_t (*unityEngineGradientPropertyGetColorKeys)(int32_t thisHandle), void (*unityEngineGradientPropertySetColorKeys)(int32_t thisHandle, int32_t valueHandle), + int32_t (*systemAppDomainSetupConstructor)(), + int32_t (*systemAppDomainSetupPropertyGetAppDomainInitializer)(int32_t thisHandle), + void (*systemAppDomainSetupPropertySetAppDomainInitializer)(int32_t thisHandle, int32_t valueHandle), int32_t (*systemInt32Array1Constructor1)(int32_t length0), int32_t (*systemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*systemInt32Array1SetItem1)(int32_t thisHandle, int32_t index0, int32_t item), @@ -5748,31 +6031,36 @@ DLLEXPORT void Init( int32_t (*unityEngineGradientColorKeyArray1Constructor1)(int32_t length0), UnityEngine::GradientColorKey (*unityEngineGradientColorKeyArray1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*unityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item), - void (*releaseSystemAction)(int32_t handle, int32_t delegateHandle), - void (*systemActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle), + void (*releaseSystemAction)(int32_t handle, int32_t classHandle), + void (*systemActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), void (*systemActionInvoke)(int32_t thisHandle), void (*systemActionAdd)(int32_t thisHandle, int32_t delHandle), void (*systemActionRemove)(int32_t thisHandle, int32_t delHandle), - void (*releaseSystemActionSystemSingle)(int32_t handle, int32_t delegateHandle), - void (*systemActionSystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle), + void (*releaseSystemActionSystemSingle)(int32_t handle, int32_t classHandle), + void (*systemActionSystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), void (*systemActionSystemSingleInvoke)(int32_t thisHandle, float obj), void (*systemActionSystemSingleAdd)(int32_t thisHandle, int32_t delHandle), void (*systemActionSystemSingleRemove)(int32_t thisHandle, int32_t delHandle), - void (*releaseSystemActionSystemSingle_SystemSingle)(int32_t handle, int32_t delegateHandle), - void (*systemActionSystemSingle_SystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle), + void (*releaseSystemActionSystemSingle_SystemSingle)(int32_t handle, int32_t classHandle), + void (*systemActionSystemSingle_SystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), void (*systemActionSystemSingle_SystemSingleInvoke)(int32_t thisHandle, float arg1, float arg2), void (*systemActionSystemSingle_SystemSingleAdd)(int32_t thisHandle, int32_t delHandle), void (*systemActionSystemSingle_SystemSingleRemove)(int32_t thisHandle, int32_t delHandle), - void (*releaseSystemFuncSystemInt32_SystemSingle_SystemDouble)(int32_t handle, int32_t delegateHandle), - void (*systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle), + void (*releaseSystemFuncSystemInt32_SystemSingle_SystemDouble)(int32_t handle, int32_t classHandle), + void (*systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), double (*systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)(int32_t thisHandle, int32_t arg1, float arg2), void (*systemFuncSystemInt32_SystemSingle_SystemDoubleAdd)(int32_t thisHandle, int32_t delHandle), void (*systemFuncSystemInt32_SystemSingle_SystemDoubleRemove)(int32_t thisHandle, int32_t delHandle), - void (*releaseSystemFuncSystemInt16_SystemInt32_SystemString)(int32_t handle, int32_t delegateHandle), - void (*systemFuncSystemInt16_SystemInt32_SystemStringConstructor)(int32_t cppHandle, int32_t* handle, int32_t* delegateHandle), + void (*releaseSystemFuncSystemInt16_SystemInt32_SystemString)(int32_t handle, int32_t classHandle), + void (*systemFuncSystemInt16_SystemInt32_SystemStringConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), int32_t (*systemFuncSystemInt16_SystemInt32_SystemStringInvoke)(int32_t thisHandle, int16_t arg1, int32_t arg2), void (*systemFuncSystemInt16_SystemInt32_SystemStringAdd)(int32_t thisHandle, int32_t delHandle), - void (*systemFuncSystemInt16_SystemInt32_SystemStringRemove)(int32_t thisHandle, int32_t delHandle) + void (*systemFuncSystemInt16_SystemInt32_SystemStringRemove)(int32_t thisHandle, int32_t delHandle), + void (*releaseSystemAppDomainInitializer)(int32_t handle, int32_t classHandle), + void (*systemAppDomainInitializerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), + void (*systemAppDomainInitializerInvoke)(int32_t thisHandle, int32_t argsHandle), + void (*systemAppDomainInitializerAdd)(int32_t thisHandle, int32_t delHandle), + void (*systemAppDomainInitializerRemove)(int32_t thisHandle, int32_t delHandle) /*END INIT PARAMS*/) { using namespace Plugin; @@ -5852,6 +6140,9 @@ DLLEXPORT void Init( Plugin::UnityEngineGradientConstructor = unityEngineGradientConstructor; Plugin::UnityEngineGradientPropertyGetColorKeys = unityEngineGradientPropertyGetColorKeys; Plugin::UnityEngineGradientPropertySetColorKeys = unityEngineGradientPropertySetColorKeys; + Plugin::SystemAppDomainSetupConstructor = systemAppDomainSetupConstructor; + Plugin::SystemAppDomainSetupPropertyGetAppDomainInitializer = systemAppDomainSetupPropertyGetAppDomainInitializer; + Plugin::SystemAppDomainSetupPropertySetAppDomainInitializer = systemAppDomainSetupPropertySetAppDomainInitializer; Plugin::SystemInt32Array1Constructor1 = systemInt32Array1Constructor1; Plugin::SystemInt32Array1GetItem1 = systemInt32Array1GetItem1; Plugin::SystemInt32Array1SetItem1 = systemInt32Array1SetItem1; @@ -5943,6 +6234,19 @@ DLLEXPORT void Init( Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke = systemFuncSystemInt16_SystemInt32_SystemStringInvoke; Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd = systemFuncSystemInt16_SystemInt32_SystemStringAdd; Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove = systemFuncSystemInt16_SystemInt32_SystemStringRemove; + SystemAppDomainInitializerFreeListSize = maxManagedObjects; + SystemAppDomainInitializerFreeList = new System::AppDomainInitializer*[SystemAppDomainInitializerFreeListSize]; + for (int32_t i = 0, end = SystemAppDomainInitializerFreeListSize - 1; i < end; ++i) + { + SystemAppDomainInitializerFreeList[i] = (System::AppDomainInitializer*)(SystemAppDomainInitializerFreeList + i + 1); + } + SystemAppDomainInitializerFreeList[SystemAppDomainInitializerFreeListSize - 1] = nullptr; + NextFreeSystemAppDomainInitializer = SystemAppDomainInitializerFreeList + 1; + Plugin::ReleaseSystemAppDomainInitializer = releaseSystemAppDomainInitializer; + Plugin::SystemAppDomainInitializerConstructor = systemAppDomainInitializerConstructor; + Plugin::SystemAppDomainInitializerInvoke = systemAppDomainInitializerInvoke; + Plugin::SystemAppDomainInitializerAdd = systemAppDomainInitializerAdd; + Plugin::SystemAppDomainInitializerRemove = systemAppDomainInitializerRemove; /*END INIT BODY*/ try diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 5f86e24..00a35e9 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -178,6 +178,7 @@ namespace System String& operator=(const String& other); String& operator=(std::nullptr_t other); String& operator=(String&& other); + String(); String(const char* chars); }; @@ -475,6 +476,11 @@ namespace UnityEngine struct Gradient; } +namespace System +{ + struct AppDomainSetup; +} + namespace MyGame { namespace MonoBehaviours @@ -567,6 +573,11 @@ namespace System { template<> struct Func3; } + +namespace System +{ + struct AppDomainInitializer; +} /*END TYPE DECLARATIONS*/ /*BEGIN TYPE DEFINITIONS*/ @@ -1168,6 +1179,26 @@ namespace UnityEngine }; } +namespace System +{ + struct AppDomainSetup : System::Object + { + AppDomainSetup(std::nullptr_t n); + AppDomainSetup(Plugin::InternalUse iu, int32_t handle); + AppDomainSetup(const AppDomainSetup& other); + AppDomainSetup(AppDomainSetup&& other); + virtual ~AppDomainSetup(); + AppDomainSetup& operator=(const AppDomainSetup& other); + AppDomainSetup& operator=(std::nullptr_t other); + AppDomainSetup& operator=(AppDomainSetup&& other); + bool operator==(const AppDomainSetup& other) const; + bool operator!=(const AppDomainSetup& other) const; + AppDomainSetup(); + System::AppDomainInitializer GetAppDomainInitializer(); + void SetAppDomainInitializer(System::AppDomainInitializer value); + }; +} + namespace MyGame { namespace MonoBehaviours @@ -1385,10 +1416,10 @@ namespace System bool operator==(const Action& other) const; bool operator!=(const Action& other) const; int32_t CppHandle; - int32_t DelegateHandle; + int32_t ClassHandle; Action(); void Invoke(); - virtual void operator()() = 0; + virtual void operator()(); void operator+=(System::Action& del); void operator-=(System::Action& del); }; @@ -1409,10 +1440,10 @@ namespace System bool operator==(const Action1& other) const; bool operator!=(const Action1& other) const; int32_t CppHandle; - int32_t DelegateHandle; + int32_t ClassHandle; Action1(); void Invoke(float obj); - virtual void operator()(float obj) = 0; + virtual void operator()(float obj); void operator+=(System::Action1& del); void operator-=(System::Action1& del); }; @@ -1433,10 +1464,10 @@ namespace System bool operator==(const Action2& other) const; bool operator!=(const Action2& other) const; int32_t CppHandle; - int32_t DelegateHandle; + int32_t ClassHandle; Action2(); void Invoke(float arg1, float arg2); - virtual void operator()(float arg1, float arg2) = 0; + virtual void operator()(float arg1, float arg2); void operator+=(System::Action2& del); void operator-=(System::Action2& del); }; @@ -1457,10 +1488,10 @@ namespace System bool operator==(const Func3& other) const; bool operator!=(const Func3& other) const; int32_t CppHandle; - int32_t DelegateHandle; + int32_t ClassHandle; Func3(); double Invoke(int32_t arg1, float arg2); - virtual double operator()(int32_t arg1, float arg2) = 0; + virtual double operator()(int32_t arg1, float arg2); void operator+=(System::Func3& del); void operator-=(System::Func3& del); }; @@ -1481,12 +1512,36 @@ namespace System bool operator==(const Func3& other) const; bool operator!=(const Func3& other) const; int32_t CppHandle; - int32_t DelegateHandle; + int32_t ClassHandle; Func3(); System::String Invoke(int16_t arg1, int32_t arg2); - virtual System::String operator()(int16_t arg1, int32_t arg2) = 0; + virtual System::String operator()(int16_t arg1, int32_t arg2); void operator+=(System::Func3& del); void operator-=(System::Func3& del); }; } + +namespace System +{ + struct AppDomainInitializer : System::Object + { + AppDomainInitializer(std::nullptr_t n); + AppDomainInitializer(Plugin::InternalUse iu, int32_t handle); + AppDomainInitializer(const AppDomainInitializer& other); + AppDomainInitializer(AppDomainInitializer&& other); + virtual ~AppDomainInitializer(); + AppDomainInitializer& operator=(const AppDomainInitializer& other); + AppDomainInitializer& operator=(std::nullptr_t other); + AppDomainInitializer& operator=(AppDomainInitializer&& other); + bool operator==(const AppDomainInitializer& other) const; + bool operator!=(const AppDomainInitializer& other) const; + int32_t CppHandle; + int32_t ClassHandle; + AppDomainInitializer(); + void Invoke(System::Array1 args); + virtual void operator()(System::Array1 args); + void operator+=(System::AppDomainInitializer& del); + void operator-=(System::AppDomainInitializer& del); + }; +} /*END TYPE DEFINITIONS*/ From 2d10f5dac0373db3690803022f749bd71d22d4ff Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 15 Oct 2017 12:28:14 -0700 Subject: [PATCH 25/95] Remove delegate test code --- Unity/CppSource/Game/Game.cpp | 84 ----------------------------------- 1 file changed, 84 deletions(-) diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index f6b3dd4..b656670 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -16,59 +16,6 @@ using namespace UnityEngine; void PrintPlatformDefines(); -struct PlainAction : System::Action -{ - void operator()() override - { - Debug::Log(String("PlainAction invoked")); - } -}; - -struct FloatAction : System::Action1 -{ - void operator()(float param) override - { - Debug::Log(String("FloatAction invoked")); - } -}; - -struct MyClickHandler : System::Action2 -{ - void operator()(float x, float y) override - { - Debug::Log(String("clicked")); - } -}; - -struct MyIntFloatDoubleFunc : System::Func3 -{ - double operator()(int32_t i, float f) override - { - Debug::Log(String("int float double Func invoked")); - return 2.34; - } -}; - -struct FuncReturningString : System::Func3 -{ - String operator()(int16_t s, int32_t i) override - { - Debug::Log(String("returning a string")); - return String("returned from Func"); - } -}; - -struct MyAppDomainInitializer : AppDomainInitializer -{ - void operator()(System::Array1 args) override - { - for (int i = 0, len = args.GetLength(); i < len; ++i) - { - Debug::Log(args.GetItem(i)); - } - } -}; - // Called when the plugin is initialized // This is mostly full of test code. Feel free to remove it all. void PluginMain() @@ -76,37 +23,6 @@ void PluginMain() PrintPlatformDefines(); Debug::Log(String("Game booted up")); - MyClickHandler mch1; - MyClickHandler mch2; - mch1 += mch2; - mch1.Invoke(123, 456); - Debug::Log(String("Removed")); - mch1 -= mch2; - mch1.Invoke(123, 456); - - MyIntFloatDoubleFunc mifdf; - double d = mifdf.Invoke(123, 3.14f); - char buf[1024]; - sprintf(buf, "%lf", d); - Debug::Log(String(buf)); - - FuncReturningString frs; - String str = frs.Invoke(11, 22); - Debug::Log(str); - - FloatAction fa; - fa.Invoke(3.14f); - - PlainAction pa; - pa.Invoke(); - - MyAppDomainInitializer madi; - AppDomainSetup ads; - ads.SetAppDomainInitializer(madi); - Array1 invokeParams(1); - invokeParams.SetItem(0, "Hello"); - ads.GetAppDomainInitializer().Invoke(invokeParams); - GameObject go(String("GameObject with a TestScript")); go.AddComponent(); } From 14cb33a625e97bcf114df1906405cecb61ac54cb Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 15 Oct 2017 14:33:09 -0700 Subject: [PATCH 26/95] Fix whitespace. Remove unused #include. --- Unity/Assets/NativeScript/Bindings.cs | 18 ++++++++++++------ .../NativeScript/Editor/GenerateBindings.cs | 2 +- Unity/CppSource/Game/Game.cpp | 1 - 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index bb6a747..d186243 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -3053,7 +3053,8 @@ public SystemAction(int cppHandle) { CppHandle = cppHandle; Delegate = Invoke; - } + } + public void Invoke() { if (CppHandle != 0) @@ -3185,7 +3186,8 @@ public SystemActionSystemSingle(int cppHandle) { CppHandle = cppHandle; Delegate = Invoke; - } + } + public void Invoke(float obj) { if (CppHandle != 0) @@ -3317,7 +3319,8 @@ public SystemActionSystemSingle_SystemSingle(int cppHandle) { CppHandle = cppHandle; Delegate = Invoke; - } + } + public void Invoke(float arg1, float arg2) { if (CppHandle != 0) @@ -3449,7 +3452,8 @@ public SystemFuncSystemInt32_SystemSingle_SystemDouble(int cppHandle) { CppHandle = cppHandle; Delegate = Invoke; - } + } + public double Invoke(int arg1, float arg2) { if (CppHandle != 0) @@ -3586,7 +3590,8 @@ public SystemFuncSystemInt16_SystemInt32_SystemString(int cppHandle) { CppHandle = cppHandle; Delegate = Invoke; - } + } + public string Invoke(short arg1, int arg2) { if (CppHandle != 0) @@ -3723,7 +3728,8 @@ public SystemAppDomainInitializer(int cppHandle) { CppHandle = cppHandle; Delegate = Invoke; - } + } + public void Invoke(string[] args) { if (CppHandle != 0) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index b6fc5a7..579bfc3 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -5313,7 +5313,7 @@ static void AppendDelegate( builders.CsharpFunctions.Append("\t\t\t{\n"); builders.CsharpFunctions.Append("\t\t\t\tCppHandle = cppHandle;\n"); builders.CsharpFunctions.Append("\t\t\t\tDelegate = Invoke;\n"); - builders.CsharpFunctions.Append("\t\t\t}"); + builders.CsharpFunctions.Append("\t\t\t}\n"); builders.CsharpFunctions.Append("\t\t\t\n"); builders.CsharpFunctions.Append("\t\t\tpublic "); AppendCsharpTypeName( diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index b656670..4d3c5c5 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -9,7 +9,6 @@ /// #include "Bindings.h" -#include using namespace System; using namespace UnityEngine; From 6ab4155e7a83c067ca93b4397dffea100843621a Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Mon, 16 Oct 2017 09:31:21 -0700 Subject: [PATCH 27/95] Update README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 39691c8..fc2cddf 100644 --- a/README.md +++ b/README.md @@ -185,10 +185,12 @@ The code generator supports: * Exceptions * Overloaded operators * Arrays (single- and multi-dimensional) +* Delegates The code generator does not support (yet): -* Delegates +* Events +* Boxing and unboxing (e.g. boxing `int` to `object`, casting `object` to `int`) * `MonoBehaviour` contents (e.g. fields) except for "message" functions * `Array` methods (e.g. `IndexOf`) * Default parameters From 93a63dab641d16eca5c137775d1bca6f9063082b Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Tue, 17 Oct 2017 20:58:33 -0700 Subject: [PATCH 28/95] Update README's compile time section --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fc2cddf..6e63fbc 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ This project aims to give you a viable alternative to C#. Scripting in C++ isn't ## Fast Compile Times -C++ compiles much more quickly than C#. Moderate size projects typically take 10+ seconds to compile in C# but only about 1 second to compile in C++. Faster compilation adds up over time to productivity gains. Quicker iteration times make it easier to stay in the "flow" of programming. +C++ [compiles much more quickly](https://github.com/jacksondunstan/cscppcompiletimes) than C#. Incremental builds when just one file changes-- the most common builds-- can be 15x faster than with C#. Faster compilation adds up over time to productivity gains. Quicker iteration times make it easier to stay in the "flow" of programming. ## Fast Device Build Times From 2ca36546b8ae0c1fd0fab124ffe4fa7c0fba34dc Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Tue, 17 Oct 2017 21:23:49 -0700 Subject: [PATCH 29/95] Update README --- README.md | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 6e63fbc..cbfe8e3 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ A significant amount of effort is required to work around the GC and the resulti C++ has no required garbage collector and features optional automatic memory management via "smart pointer" types like [shared_ptr](http://en.cppreference.com/w/cpp/memory/shared_ptr). It offers excellent alternatives to Unity's primitive garbage collector. +While using some .NET APIs will still involve garbage creation, the problem is contained to only those APIs rather than being a pervasive issue for all your code. + ## Total Control By using C++ directly, you gain complete control over the code the CPU will execute. It's much easier to generate optimal code with a C++ compiler than with a C# compiler, IL2CPP, and finally a C++ compiler. Cut out the middle-man and you can take advantage of compiler intrinsics or assembly to directly write machine code using powerful CPU features like [SIMD](http://jacksondunstan.com/articles/3890) and hardware AES encryption for massive performance gains. @@ -66,7 +68,6 @@ While IL2CPP transforms C# into C++ already, it generates a lot of overhead. The transform.SetPosition(position); * No need to reload the Unity editor when changing C++ -* Code generator exposes any C# API (Unity, .NET, custom DLLs) with a simple JSON config file * Handle `MonoBehaviour` messages in C++ > @@ -77,12 +78,27 @@ While IL2CPP transforms C# into C++ already, it generates a lot of overhead. The * Platform-dependent compilation via the [usual flags](https://docs.unity3d.com/Manual/PlatformDependentCompilation.html) (e.g. `#if UNITY_EDITOR`) * [CMake](https://cmake.org/) build system sets up any IDE project or command-line build +* Code generator exposes any C# API (Unity, .NET, custom DLLs) with a simple JSON config file and runs from a menu in the Unity editor. It supports a wide range of features: + * Class types + * Struct types + * Enumeration types + * Base classes + * Constructors + * Methods + * Fields + * Properties (getters and setters) + * `MonoBehaviour` classes with "message" functions like `Update` + * `out` and `ref` parameters + * Exceptions + * Overloaded operators + * Arrays (single- and multi-dimensional) + * Delegates # Performance -[Article](http://jacksondunstan.com/articles/3952). +Most projects will see a net performance win by reducing garbage collection, eliminating IL2CPP overhead, and access to compiler intrinsics and assembly. Calls from C++ into C# incur a minor performance penalty, so if most of your code is calls to .NET APIs then you may experience a net performance loss. -tl;dr - Most projects will not be noticeably impacted by C++ overhead and many projects will benefit from reducing garbage collection, eliminating IL2CPP overhead, and access to compiler intrinsics and assembly. +For testing and benchmarks, see this [article](http://jacksondunstan.com/articles/3952). # Project Structure @@ -170,24 +186,7 @@ To run the code generator, choose `NativeScript > Generate Bindings` from the Un To configure the code generator, open `NativeScriptTypes.json` and notice the existing examples. Add on to this file to expose more C# APIs from Unity, .NET, or custom DLLs to your C++ code. -The code generator supports: - -* Class types (including generics) -* Struct types (including generics) -* Base classes (including generics) -* Constructors (including generic parameters) -* Methods (including generic parameters and return types) -* Fields (including generic types) -* Properties (getters and setters) (including generic types) -* `MonoBehaviour` classes with "message" functions like `Update` -* `out` and `ref` parameters -* Enumerations -* Exceptions -* Overloaded operators -* Arrays (single- and multi-dimensional) -* Delegates - -The code generator does not support (yet): +Note that the code generator does not support (yet): * Events * Boxing and unboxing (e.g. boxing `int` to `object`, casting `object` to `int`) @@ -196,7 +195,7 @@ The code generator does not support (yet): * Default parameters * Interfaces * `decimal` -* Pointers +* C# pointers # Updating To A New Version From d1e9db078c1118d4ba66c5b5e8bb063d486da4b5 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Tue, 17 Oct 2017 21:26:39 -0700 Subject: [PATCH 30/95] Fix README formatting --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index cbfe8e3..5713381 100644 --- a/README.md +++ b/README.md @@ -79,20 +79,20 @@ While IL2CPP transforms C# into C++ already, it generates a lot of overhead. The * Platform-dependent compilation via the [usual flags](https://docs.unity3d.com/Manual/PlatformDependentCompilation.html) (e.g. `#if UNITY_EDITOR`) * [CMake](https://cmake.org/) build system sets up any IDE project or command-line build * Code generator exposes any C# API (Unity, .NET, custom DLLs) with a simple JSON config file and runs from a menu in the Unity editor. It supports a wide range of features: - * Class types - * Struct types - * Enumeration types - * Base classes - * Constructors - * Methods - * Fields - * Properties (getters and setters) - * `MonoBehaviour` classes with "message" functions like `Update` - * `out` and `ref` parameters - * Exceptions - * Overloaded operators - * Arrays (single- and multi-dimensional) - * Delegates + * Class types + * Struct types + * Enumeration types + * Base classes + * Constructors + * Methods + * Fields + * Properties (getters and setters) + * `MonoBehaviour` classes with "message" functions like `Update` + * `out` and `ref` parameters + * Exceptions + * Overloaded operators + * Arrays (single- and multi-dimensional) + * Delegates # Performance From 765108e900bb54e89e85b734e325bbd42ade9567 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 21 Oct 2017 17:29:43 -0700 Subject: [PATCH 31/95] Add support for events Fix class ref counting not starting at zero Fix boilerplate functions (e.g. constructors) for delegates not dealing with handles Add try/catch around delegate invoke calls --- Unity/Assets/NativeScript/Bindings.cs | 422 ++- .../NativeScript/Editor/GenerateBindings.cs | 1336 ++++++-- Unity/Assets/NativeScriptTypes.json | 37 + Unity/CppSource/NativeScript/Bindings.cpp | 3046 +++++++++++------ Unity/CppSource/NativeScript/Bindings.h | 164 + 5 files changed, 3734 insertions(+), 1271 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index d186243..be02899 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -340,6 +340,10 @@ delegate void InitDelegate( IntPtr systemAppDomainSetupConstructor, IntPtr systemAppDomainSetupPropertyGetAppDomainInitializer, IntPtr systemAppDomainSetupPropertySetAppDomainInitializer, + IntPtr unityEngineApplicationAddEventOnBeforeRender, + IntPtr unityEngineApplicationRemoveEventOnBeforeRender, + IntPtr unityEngineSceneManagementSceneManagerAddEventSceneLoaded, + IntPtr unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded, IntPtr systemInt32Array1Constructor1, IntPtr systemInt32Array1GetItem1, IntPtr systemInt32Array1SetItem1, @@ -395,7 +399,17 @@ delegate void InitDelegate( IntPtr systemAppDomainInitializerConstructor, IntPtr systemAppDomainInitializerInvoke, IntPtr systemAppDomainInitializerAdd, - IntPtr systemAppDomainInitializerRemove + IntPtr systemAppDomainInitializerRemove, + IntPtr releaseUnityEngineEventsUnityAction, + IntPtr unityEngineEventsUnityActionConstructor, + IntPtr unityEngineEventsUnityActionInvoke, + IntPtr unityEngineEventsUnityActionAdd, + IntPtr unityEngineEventsUnityActionRemove, + IntPtr releaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode, + IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor, + IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke, + IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd, + IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove /*END INIT PARAMS*/); public delegate void SetCsharpExceptionDelegate(int handle); @@ -431,6 +445,12 @@ IntPtr systemAppDomainInitializerRemove public delegate void SystemAppDomainInitializerCppInvokeDelegate(int thisHandle, int param0); public static SystemAppDomainInitializerCppInvokeDelegate SystemAppDomainInitializerCppInvoke; + public delegate void UnityEngineEventsUnityActionCppInvokeDelegate(int thisHandle); + public static UnityEngineEventsUnityActionCppInvokeDelegate UnityEngineEventsUnityActionCppInvoke; + + public delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvokeDelegate(int thisHandle, UnityEngine.SceneManagement.Scene param0, UnityEngine.SceneManagement.LoadSceneMode param1); + public static UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvokeDelegate UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvoke; + public delegate void SetCsharpExceptionSystemNullReferenceExceptionDelegate(int param0); public static SetCsharpExceptionSystemNullReferenceExceptionDelegate SetCsharpExceptionSystemNullReferenceException; /*END MONOBEHAVIOUR DELEGATES*/ @@ -598,6 +618,10 @@ static extern void Init( IntPtr systemAppDomainSetupConstructor, IntPtr systemAppDomainSetupPropertyGetAppDomainInitializer, IntPtr systemAppDomainSetupPropertySetAppDomainInitializer, + IntPtr unityEngineApplicationAddEventOnBeforeRender, + IntPtr unityEngineApplicationRemoveEventOnBeforeRender, + IntPtr unityEngineSceneManagementSceneManagerAddEventSceneLoaded, + IntPtr unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded, IntPtr systemInt32Array1Constructor1, IntPtr systemInt32Array1GetItem1, IntPtr systemInt32Array1SetItem1, @@ -653,7 +677,17 @@ static extern void Init( IntPtr systemAppDomainInitializerConstructor, IntPtr systemAppDomainInitializerInvoke, IntPtr systemAppDomainInitializerAdd, - IntPtr systemAppDomainInitializerRemove + IntPtr systemAppDomainInitializerRemove, + IntPtr releaseUnityEngineEventsUnityAction, + IntPtr unityEngineEventsUnityActionConstructor, + IntPtr unityEngineEventsUnityActionInvoke, + IntPtr unityEngineEventsUnityActionAdd, + IntPtr unityEngineEventsUnityActionRemove, + IntPtr releaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode, + IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor, + IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke, + IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd, + IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove /*END INIT PARAMS*/); [DllImport(PluginName)] @@ -690,6 +724,12 @@ IntPtr systemAppDomainInitializerRemove [DllImport(Constants.PluginName)] public static extern void SystemAppDomainInitializerCppInvoke(int thisHandle, int param0); + [DllImport(Constants.PluginName)] + public static extern void UnityEngineEventsUnityActionCppInvoke(int thisHandle); + + [DllImport(Constants.PluginName)] + public static extern void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvoke(int thisHandle, UnityEngine.SceneManagement.Scene param0, int param1); + [DllImport(Constants.PluginName)] public static extern void SetCsharpExceptionSystemNullReferenceException(int thisHandle, int param0); /*END MONOBEHAVIOUR IMPORTS*/ @@ -767,6 +807,10 @@ IntPtr systemAppDomainInitializerRemove delegate int SystemAppDomainSetupConstructorDelegate(); delegate int SystemAppDomainSetupPropertyGetAppDomainInitializerDelegate(int thisHandle); delegate void SystemAppDomainSetupPropertySetAppDomainInitializerDelegate(int thisHandle, int valueHandle); + delegate void UnityEngineApplicationAddEventOnBeforeRenderDelegate(int delHandle); + delegate void UnityEngineApplicationRemoveEventOnBeforeRenderDelegate(int delHandle); + delegate void UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate(int delHandle); + delegate void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate(int delHandle); delegate int SystemInt32Array1Constructor1Delegate(int length0); delegate int SystemInt32Array1GetItem1Delegate(int thisHandle, int index0); delegate void SystemInt32Array1SetItem1Delegate(int thisHandle, int index0, int item); @@ -823,6 +867,16 @@ IntPtr systemAppDomainInitializerRemove delegate void SystemAppDomainInitializerInvokeDelegate(int thisHandle, int argsHandle); delegate void SystemAppDomainInitializerAddDelegate(int thisHandle, int delHandle); delegate void SystemAppDomainInitializerRemoveDelegate(int thisHandle, int delHandle); + delegate void UnityEngineEventsUnityActionConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); + delegate void ReleaseUnityEngineEventsUnityActionDelegate(int handle, int classHandle); + delegate void UnityEngineEventsUnityActionInvokeDelegate(int thisHandle); + delegate void UnityEngineEventsUnityActionAddDelegate(int thisHandle, int delHandle); + delegate void UnityEngineEventsUnityActionRemoveDelegate(int thisHandle, int delHandle); + delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); + delegate void ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeDelegate(int handle, int classHandle); + delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate(int thisHandle, ref UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1); + delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAddDelegate(int thisHandle, int delHandle); + delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemoveDelegate(int thisHandle, int delHandle); /*END DELEGATE TYPES*/ public static Exception UnhandledCppException; @@ -867,6 +921,8 @@ public static void Open( SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke = GetDelegate(libraryHandle, "SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke"); SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke = GetDelegate(libraryHandle, "SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke"); SystemAppDomainInitializerCppInvoke = GetDelegate(libraryHandle, "SystemAppDomainInitializerCppInvoke"); + UnityEngineEventsUnityActionCppInvoke = GetDelegate(libraryHandle, "UnityEngineEventsUnityActionCppInvoke"); + UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvoke = GetDelegate(libraryHandle, "UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvoke"); SetCsharpExceptionSystemNullReferenceException = GetDelegate(libraryHandle, "SetCsharpExceptionSystemNullReferenceException"); /*END MONOBEHAVIOUR GETDELEGATE CALLS*/ @@ -946,6 +1002,10 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new SystemAppDomainSetupConstructorDelegate(SystemAppDomainSetupConstructor)), Marshal.GetFunctionPointerForDelegate(new SystemAppDomainSetupPropertyGetAppDomainInitializerDelegate(SystemAppDomainSetupPropertyGetAppDomainInitializer)), Marshal.GetFunctionPointerForDelegate(new SystemAppDomainSetupPropertySetAppDomainInitializerDelegate(SystemAppDomainSetupPropertySetAppDomainInitializer)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineApplicationAddEventOnBeforeRenderDelegate(UnityEngineApplicationAddEventOnBeforeRender)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineApplicationRemoveEventOnBeforeRenderDelegate(UnityEngineApplicationRemoveEventOnBeforeRender)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate(UnityEngineSceneManagementSceneManagerAddEventSceneLoaded)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate(UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)), Marshal.GetFunctionPointerForDelegate(new SystemInt32Array1Constructor1Delegate(SystemInt32Array1Constructor1)), Marshal.GetFunctionPointerForDelegate(new SystemInt32Array1GetItem1Delegate(SystemInt32Array1GetItem1)), Marshal.GetFunctionPointerForDelegate(new SystemInt32Array1SetItem1Delegate(SystemInt32Array1SetItem1)), @@ -1001,7 +1061,17 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerConstructorDelegate(SystemAppDomainInitializerConstructor)), Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerInvokeDelegate(SystemAppDomainInitializerInvoke)), Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerAddDelegate(SystemAppDomainInitializerAdd)), - Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerRemoveDelegate(SystemAppDomainInitializerRemove)) + Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerRemoveDelegate(SystemAppDomainInitializerRemove)), + Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineEventsUnityActionDelegate(ReleaseUnityEngineEventsUnityAction)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionConstructorDelegate(UnityEngineEventsUnityActionConstructor)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionInvokeDelegate(UnityEngineEventsUnityActionInvoke)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionAddDelegate(UnityEngineEventsUnityActionAdd)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionRemoveDelegate(UnityEngineEventsUnityActionRemove)), + Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeDelegate(ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructorDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAddDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemoveDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)) /*END INIT CALL*/ ); if (UnhandledCppException != null) @@ -2476,6 +2546,86 @@ static void SystemAppDomainSetupPropertySetAppDomainInitializer(int thisHandle, } } + [MonoPInvokeCallback(typeof(UnityEngineApplicationAddEventOnBeforeRenderDelegate))] + static void UnityEngineApplicationAddEventOnBeforeRender(int delHandle) + { + try + { + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.Application.onBeforeRender += del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineApplicationRemoveEventOnBeforeRenderDelegate))] + static void UnityEngineApplicationRemoveEventOnBeforeRender(int delHandle) + { + try + { + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.Application.onBeforeRender += del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate))] + static void UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(int delHandle) + { + try + { + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate))] + static void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(int delHandle) + { + try + { + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + [MonoPInvokeCallback(typeof(SystemInt32Array1Constructor1Delegate))] static int SystemInt32Array1Constructor1(int length0) { @@ -3853,6 +4003,272 @@ static void SystemAppDomainInitializerRemove(int thisHandle, int delHandle) NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } + + class UnityEngineEventsUnityAction + { + public int CppHandle; + public UnityEngine.Events.UnityAction Delegate; + + public UnityEngineEventsUnityAction(int cppHandle) + { + CppHandle = cppHandle; + Delegate = Invoke; + } + + public void Invoke() + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.UnityEngineEventsUnityActionCppInvoke(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } + + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionConstructorDelegate))] + static void UnityEngineEventsUnityActionConstructor(int cppHandle, ref int handle, ref int classHandle) + { + try + { + var thiz = new UnityEngineEventsUnityAction(cppHandle); + classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); + handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(ReleaseUnityEngineEventsUnityActionDelegate))] + static void ReleaseUnityEngineEventsUnityAction(int handle, int classHandle) + { + try + { + if (classHandle != 0) + { + var thiz = (UnityEngineEventsUnityAction)NativeScript.Bindings.ObjectStore.Remove(classHandle); + thiz.CppHandle = 0; + } + NativeScript.Bindings.ObjectStore.Remove(handle); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionInvokeDelegate))] + static void UnityEngineEventsUnityActionInvoke(int thisHandle) + { + try + { + ((UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle))(); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionAddDelegate))] + static void UnityEngineEventsUnityActionAdd(int thisHandle, int delHandle) + { + try + { + var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz += del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionRemoveDelegate))] + static void UnityEngineEventsUnityActionRemove(int thisHandle, int delHandle) + { + try + { + var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz -= del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + class UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode + { + public int CppHandle; + public UnityEngine.Events.UnityAction Delegate; + + public UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int cppHandle) + { + CppHandle = cppHandle; + Delegate = Invoke; + } + + public void Invoke(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvoke(thisHandle, arg0, arg1); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } + + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructorDelegate))] + static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor(int cppHandle, ref int handle, ref int classHandle) + { + try + { + var thiz = new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(cppHandle); + classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); + handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeDelegate))] + static void ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int handle, int classHandle) + { + try + { + if (classHandle != 0) + { + var thiz = (UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode)NativeScript.Bindings.ObjectStore.Remove(classHandle); + thiz.CppHandle = 0; + } + NativeScript.Bindings.ObjectStore.Remove(handle); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate))] + static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(int thisHandle, ref UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1) + { + try + { + ((UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg0, arg1); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAddDelegate))] + static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd(int thisHandle, int delHandle) + { + try + { + var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz += del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemoveDelegate))] + static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove(int thisHandle, int delHandle) + { + try + { + var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz -= del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } /*END FUNCTIONS*/ } } diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 579bfc3..531b981 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -75,6 +75,12 @@ class JsonProperty public JsonPropertySet Set; } + [Serializable] + class JsonEvent + { + public string Name; + } + [Serializable] class JsonType { @@ -83,6 +89,7 @@ class JsonType public JsonMethod[] Methods; public JsonProperty[] Properties; public string[] Fields; + public JsonEvent[] Events; public JsonGenericParams[] GenericParams; public int MaxSimultaneous; } @@ -491,6 +498,8 @@ static void DoPostCompileWork(bool canRefreshAssetDb) bool dryRun = EditorPrefs.GetBool(DryRunPref); EditorPrefs.DeleteKey(DryRunPref); + DateTime beforeTime = DateTime.Now; + JsonDocument doc = LoadJson(); Assembly[] assemblies = GetAssemblies(doc.Assemblies); StringBuilders builders = new StringBuilders(); @@ -557,7 +566,11 @@ static void DoPostCompileWork(bool canRefreshAssetDb) if (canRefreshAssetDb) { AssetDatabase.Refresh(); - Debug.Log("Done generating bindings."); + DateTime afterTime = DateTime.Now; + TimeSpan duration = afterTime - beforeTime; + Debug.LogFormat( + "Done generating bindings in {0} seconds.", + duration.TotalSeconds); } else { @@ -1430,8 +1443,6 @@ static void AppendType( type.BaseType.GetGenericArguments(), isStatic, indent, - true, - true, builders.CppMethodDefinitions); // Constructors @@ -1507,6 +1518,23 @@ static void AppendType( } } + if (jsonType.Events != null) + { + foreach (JsonEvent jsonEvent in jsonType.Events) + { + AppendEvent( + jsonEvent, + type, + isStatic, + typeKind, + typeParams, + genericArgTypes, + indent, + builders + ); + } + } + // Methods if (jsonType.Methods != null) { @@ -2150,8 +2178,7 @@ static void AppendField( Type[] typeTypeParams, Type[] typeGenericArgumentTypes, int indent, - StringBuilders builders - ) + StringBuilders builders) { FieldInfo field = enclosingType.GetField(jsonFieldName); Type fieldType = OverrideGenericType( @@ -2200,6 +2227,223 @@ StringBuilders builders builders); } + static void AppendEvent( + JsonEvent jsonEvent, + Type enclosingType, + bool enclosingTypeIsStatic, + TypeKind enclosingTypeKind, + Type[] typeTypeParams, + Type[] typeGenericArgumentTypes, + int indent, + StringBuilders builders) + { + EventInfo eventInfo = enclosingType.GetEvent(jsonEvent.Name); + MethodInfo addMethod = eventInfo.GetAddMethod(); + MethodInfo removeMethod = eventInfo.GetRemoveMethod(); + Type eventType = eventInfo.EventHandlerType; + string uppercaseEventName = char.ToUpper(jsonEvent.Name[0]) + + jsonEvent.Name.Substring(1); + + ParameterInfo[] addRemoveParams = new ParameterInfo[] { + new ParameterInfo { + Name = "del", + ParameterType = eventType, + DereferencedParameterType = eventType, + IsOut = false, + IsRef = false, + Kind = TypeKind.Class, + IsVirtual = false + } + }; + + AppendEventAddRemoveMethod( + jsonEvent.Name, + uppercaseEventName, + "Add", + addMethod.IsStatic, + enclosingType, + enclosingTypeKind, + enclosingTypeIsStatic, + typeTypeParams, + addRemoveParams, + indent, + builders); + AppendEventAddRemoveMethod( + jsonEvent.Name, + uppercaseEventName, + "Remove", + removeMethod.IsStatic, + enclosingType, + enclosingTypeKind, + enclosingTypeIsStatic, + typeTypeParams, + addRemoveParams, + indent, + builders); + } + + static void AppendEventAddRemoveMethod( + string eventName, + string uppercaseEventName, + string operation, + bool methodIsStatic, + Type enclosingType, + TypeKind enclosingTypeKind, + bool enclosingTypeIsStatic, + Type[] typeTypeParams, + ParameterInfo[] methodParams, + int indent, + StringBuilders builders) + { + builders.TempStrBuilder.Length = 0; + AppendNamespace( + enclosingType.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendTypeNameWithoutGenericSuffix( + enclosingType.Name, + builders.TempStrBuilder); + AppendTypeNames( + typeTypeParams, + builders.TempStrBuilder); + builders.TempStrBuilder.Append(operation); + builders.TempStrBuilder.Append("Event"); + builders.TempStrBuilder.Append(uppercaseEventName); + string funcName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string funcNameLower = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append(operation); + builders.TempStrBuilder.Append(uppercaseEventName); + string methodName = builders.TempStrBuilder.ToString(); + + // C# init param + AppendCsharpInitParam( + funcNameLower, + builders.CsharpInitParams); + + // C# delegate type + AppendCsharpDelegateType( + funcName, + methodIsStatic, + enclosingType, + enclosingTypeKind, + typeof(void), + methodParams, + builders.CsharpDelegateTypes); + + // C# init call arg + AppendCsharpInitCallArg( + funcName, + builders.CsharpInitCall); + + // C# function + AppendCsharpFunctionBeginning( + enclosingType, + funcName, + methodIsStatic, + enclosingTypeKind, + typeof(void), + typeTypeParams, + methodParams, + builders.CsharpFunctions); + AppendCsharpFunctionCallSubject( + enclosingType, + methodIsStatic, + builders.CsharpFunctions); + builders.CsharpFunctions.Append('.'); + builders.CsharpFunctions.Append(eventName); + builders.CsharpFunctions.Append(" += del;"); + AppendCsharpFunctionEnd( + typeof(void), + null, + builders.CsharpFunctions); + + // C++ function pointer + AppendCppFunctionPointerDefinition( + funcName, + methodIsStatic, + enclosingType.Name, + enclosingType.Namespace, + enclosingTypeKind, + methodParams, + typeof(void), + builders.CppFunctionPointers); + + // C++ method declaration + string cppMethodName; + bool cppMethodIsStatic; + ParameterInfo[] cppParameters; + ParameterInfo[] cppCallParameters; + Type cppReturnType = typeof(void); + cppMethodName = methodName; + cppMethodIsStatic = methodIsStatic; + cppParameters = methodParams; + cppCallParameters = methodParams; + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + cppMethodName, + enclosingTypeIsStatic, + false, + cppMethodIsStatic, + cppReturnType, + null, + cppParameters, + builders.CppTypeDefinitions); + + // C++ method definition + AppendCppMethodDefinitionBegin( + enclosingType.Name, + cppReturnType, + cppMethodName, + typeTypeParams, + null, + cppParameters, + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendCppPluginFunctionCall( + methodIsStatic, + enclosingType.Name, + enclosingType.Namespace, + enclosingTypeKind, + typeTypeParams, + typeof(void), + funcName, + cppCallParameters, + indent + 1, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n\t\n"); + + // C++ init params + AppendCppInitParam( + funcNameLower, + methodIsStatic, + enclosingType.Name, + enclosingType.Namespace, + enclosingTypeKind, + methodParams, + typeof(void), + builders.CppInitParams); + + // C++ init body + AppendCppInitBody( + funcName, + funcNameLower, + builders.CppInitBody); + } + static void AppendMethod( JsonMethod jsonMethod, Assembly[] assemblies, @@ -2978,8 +3222,6 @@ static void AppendMonoBehaviour( null, false, cppIndent, - true, - true, builders.CppMethodDefinitions); AppendCppMethodDefinitionsEnd( cppMethodDefinitionsIndent, @@ -3422,8 +3664,6 @@ static void AppendArray( null, false, indent, - true, - true, builders.CppMethodDefinitions); AppendArrayConstructor( @@ -4827,19 +5067,9 @@ static void AppendDelegate( removeFuncNameLower, builders.CppInitBody); - // C++ method definitions (begin) - AppendCppMethodDefinitionsBegin( - numberedTypeName, + // C++ method definitions (end) + int cppMethodDefinitionsIndent = AppendNamespaceBeginning( type.Namespace, - TypeKind.Class, - typeParams, - "Object", - "System", - null, - false, - indent, - false, - false, builders.CppMethodDefinitions); // C++ default constructor @@ -4850,131 +5080,748 @@ static void AppendDelegate( typeParams, null, new ParameterInfo[0], - indent, + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append(" : System::Object(nullptr)\n"); AppendIndent( - indent, + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("{\n"); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("CppHandle = Plugin::Store"); builders.CppMethodDefinitions.Append(typeName); builders.CppMethodDefinitions.Append("(this);\n"); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("Plugin::"); builders.CppMethodDefinitions.Append(constructorFuncName); builders.CppMethodDefinitions.Append("(CppHandle, &Handle, &ClassHandle);\n"); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("if (Handle)\n"); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("{\n"); AppendIndent( - indent + 2, + cppMethodDefinitionsIndent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Plugin::ReferenceManagedClass(Handle);\n"); + builders.CppMethodDefinitions.Append( + "Plugin::ReferenceManagedClass(Handle);\n"); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("}\n"); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("else\n"); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("{\n"); AppendIndent( - indent + 2, + cppMethodDefinitionsIndent + 2, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("Plugin::Remove"); builders.CppMethodDefinitions.Append(typeName); builders.CppMethodDefinitions.Append("(CppHandle);\n"); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("CppHandle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("}\n"); AppendCppUnhandledExceptionHandling( - indent + 1, + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); AppendIndent( - indent, + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("}\n"); AppendIndent( - indent, + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append('\n'); - // C++ handle constructor - AppendCppHandleConstructorDefintionBegin( + // Construct with nullptr_t + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + AppendTypeNameWithoutGenericSuffix( numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( typeParams, - "Object", - "System", - null, - indent, builders.CppMethodDefinitions); - AppendIndent(indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); - AppendIndent( - indent + 1, + builders.CppMethodDefinitions.Append("::"); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("CppHandle = Plugin::Store"); - builders.CppMethodDefinitions.Append(typeName); - builders.CppMethodDefinitions.Append("(this);\n"); + builders.CppMethodDefinitions.Append("(std::nullptr_t n)\n"); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "\t: System::Object(Plugin::InternalUse::Only, 0)\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("CppHandle = Plugin::Store"); + builders.CppMethodDefinitions.Append(typeName); + builders.CppMethodDefinitions.Append("(this);\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + + // Copy constructor + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("::"); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("(const "); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("& other)\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "\t: System::Object(Plugin::InternalUse::Only, other.Handle)\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("CppHandle = Plugin::Store"); + builders.CppMethodDefinitions.Append(typeName); + builders.CppMethodDefinitions.Append("(this);\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("if (Handle)\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "Plugin::ReferenceManagedClass(Handle);\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "ClassHandle = other.ClassHandle;\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + + // Move constructor + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("::"); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("("); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("&& other)\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "\t: System::Object(Plugin::InternalUse::Only, other.Handle)\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "CppHandle = other.CppHandle;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "ClassHandle = other.ClassHandle;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("other.Handle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("other.CppHandle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("other.ClassHandle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + + // Handle constructor + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("::"); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "(Plugin::InternalUse iu, int32_t handle)\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "\t: System::Object(iu, handle)\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("CppHandle = Plugin::Store"); + builders.CppMethodDefinitions.Append(typeName); + builders.CppMethodDefinitions.Append("(this);\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("if (Handle)\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "Plugin::ReferenceManagedClass(Handle);\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "ClassHandle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + + // Destructor + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("::~"); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("()\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Plugin::Remove"); + builders.CppMethodDefinitions.Append(typeName); + builders.CppMethodDefinitions.Append("(CppHandle);\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("CppHandle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("if (Handle)\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("int32_t handle = Handle;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("int32_t classHandle = ClassHandle;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Handle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "if (Plugin::DereferenceManagedClassNoRelease(handle))\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 3, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Plugin::"); + builders.CppMethodDefinitions.Append(releaseFuncName); + builders.CppMethodDefinitions.Append("(handle, classHandle);\n"); + AppendCppUnhandledExceptionHandling( + cppMethodDefinitionsIndent + 3, + builders.CppMethodDefinitions); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + + // Assignment operator to same type + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("& "); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("::operator=(const "); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("& other)\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendSetHandle( + numberedTypeName, + type.Namespace, + TypeKind.Class, + typeParams, + cppMethodDefinitionsIndent + 1, + "this", + "other.Handle", + builders.CppMethodDefinitions); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "ClassHandle = other.ClassHandle;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("return *this;\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + + // Assignment operator to nullptr_t + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("& "); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "::operator=(std::nullptr_t other)\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("if (Handle)\n"); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("{\n"); AppendIndent( - indent + 2, + cppMethodDefinitionsIndent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Plugin::ReferenceManagedClass(Handle);\n"); + builders.CppMethodDefinitions.Append("int32_t handle = Handle;\n"); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("int32_t classHandle = ClassHandle;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Handle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "if (Plugin::DereferenceManagedClassNoRelease(handle))\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 3, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Plugin::"); + builders.CppMethodDefinitions.Append(releaseFuncName); + builders.CppMethodDefinitions.Append("(handle, classHandle);\n"); + AppendCppUnhandledExceptionHandling( + cppMethodDefinitionsIndent + 3, + builders.CppMethodDefinitions); + AppendIndent( + cppMethodDefinitionsIndent + 2, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("}\n"); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("else\n"); + builders.CppMethodDefinitions.Append("}\n"); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Handle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("return *this;\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + + // Move assignment operator to same type + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("& "); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("::operator=("); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("&& other)\n"); + AppendIndent( + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("{\n"); AppendIndent( - indent + 2, + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("Plugin::Remove"); builders.CppMethodDefinitions.Append(typeName); builders.CppMethodDefinitions.Append("(CppHandle);\n"); AppendIndent( - indent + 1, + cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.Append("CppHandle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("if (Handle)\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("int32_t handle = Handle;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("int32_t classHandle = ClassHandle;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Handle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "if (Plugin::DereferenceManagedClassNoRelease(handle))\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 3, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Plugin::"); + builders.CppMethodDefinitions.Append(releaseFuncName); + builders.CppMethodDefinitions.Append("(handle, classHandle);\n"); AppendCppUnhandledExceptionHandling( - indent + 1, + cppMethodDefinitionsIndent + 3, builders.CppMethodDefinitions); - AppendCppHandleConstructorDefintionEnd( - indent, + AppendIndent( + cppMethodDefinitionsIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "ClassHandle = other.ClassHandle;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("other.ClassHandle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Handle = other.Handle;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("other.Handle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("return *this;\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + + // Equality operator with same type + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("bool "); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("::operator==(const "); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("& other) const\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "return Handle == other.Handle;\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + + // Inequality operator with same type + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("bool "); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("::operator!=(const "); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + builders.CppMethodDefinitions); + AppendCppTypeParameters( + typeParams, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("& other) const\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "return Handle != other.Handle;\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); // C++ operator() AppendCppMethodDefinitionBegin( @@ -5045,37 +5892,6 @@ static void AppendDelegate( builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append('\n'); - // C++ destructor - AppendCppDestructorDefinitionBegin( - numberedTypeName, - type.Namespace, - TypeKind.Class, - typeParams, - indent, - builders.CppMethodDefinitions); - AppendIndent( - indent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Plugin::Release"); - builders.CppMethodDefinitions.Append(typeName); - builders.CppMethodDefinitions.Append("(Handle, ClassHandle);\n"); - AppendCppUnhandledExceptionHandling( - indent + 2, - builders.CppMethodDefinitions); - AppendIndent( - indent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Plugin::Remove"); - builders.CppMethodDefinitions.Append(typeName); - builders.CppMethodDefinitions.Append("(CppHandle);\n"); - AppendIndent( - indent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); - AppendCppDestructorDefinitionEnd( - indent, - builders.CppMethodDefinitions); - // C++ add AppendCppMethodDefinitionBegin( numberedTypeName, @@ -5202,11 +6018,19 @@ static void AppendDelegate( } builders.CppMethodDefinitions.Append(")\n"); AppendIndent( - indent, + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("try\n"); + AppendIndent( + indent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("{\n"); AppendIndent( - indent + 1, + indent + 2, builders.CppMethodDefinitions); if (invokeMethod.ReturnType != typeof(void)) { @@ -5246,6 +6070,75 @@ static void AppendDelegate( builders.CppMethodDefinitions.Append(".Handle"); } builders.CppMethodDefinitions.Append(";\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "catch (System::Exception ex)\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "Plugin::SetException(ex.Handle);\n"); + if (invokeMethod.ReturnType != typeof(void)) + { + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "return {};\n"); + } + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("catch (...)\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "System::String msg = \"Unhandled exception invoking "); + AppendCppTypeName( + type, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\";\n"); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "System::Exception ex(msg);\n"); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "Plugin::SetException(ex.Handle);\n"); + if (invokeMethod.ReturnType != typeof(void)) + { + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "return {};\n"); + } + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); AppendIndent( indent, builders.CppMethodDefinitions); @@ -6527,7 +7420,8 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeParameters( typeParams, output); - output.Append("(Plugin::InternalUse iu, int32_t handle);\n"); + output.Append( + "(Plugin::InternalUse iu, int32_t handle);\n"); // Copy constructor AppendIndent(indent + 1, output); @@ -6674,8 +7568,6 @@ static int AppendCppMethodDefinitionsBegin( Type[] baseTypeTypeParams, bool isStatic, int indent, - bool includeDestructor, - bool includeHandleConstructor, StringBuilder output) { int cppMethodDefinitionsIndent = AppendNamespaceBeginning( @@ -6717,35 +7609,49 @@ static int AppendCppMethodDefinitionsBegin( AppendIndent(indent, output); output.Append("\n"); - if (includeHandleConstructor) - { - AppendCppHandleConstructorDefintionBegin( - enclosingTypeName, - enclosingTypeParams, - baseTypeName, - baseTypeNamespace, - baseTypeTypeParams, - indent, - output); - AppendIndent(indent + 1, output); - output.Append("if (handle)\n"); - AppendIndent(indent + 1, output); - output.Append("{\n"); - AppendIndent(indent + 2, output); - AppendReferenceManagedHandleFunctionCall( - enclosingTypeName, - enclosingTypeNamespace, - enclosingTypeKind, - enclosingTypeParams, - "handle", - output); - output.Append(";\n"); - AppendIndent(indent + 1, output); - output.Append("}\n"); - AppendCppHandleConstructorDefintionEnd( - indent, - output); - } + AppendIndent(indent, output); + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, + output); + AppendCppTypeParameters( + enclosingTypeParams, + output); + output.Append("::"); + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, + output); + output.Append("(Plugin::InternalUse iu, int32_t handle)\n"); + AppendIndent(indent, output); + output.Append("\t: "); + AppendCppTypeName( + baseTypeNamespace, + baseTypeName, + output); + AppendCppTypeParameters( + baseTypeTypeParams, + output); + output.Append("(iu, handle)\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent + 1, output); + output.Append("if (handle)\n"); + AppendIndent(indent + 1, output); + output.Append("{\n"); + AppendIndent(indent + 2, output); + AppendReferenceManagedHandleFunctionCall( + enclosingTypeName, + enclosingTypeNamespace, + enclosingTypeKind, + enclosingTypeParams, + "handle", + output); + output.Append(";\n"); + AppendIndent(indent + 1, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("\n"); // Copy constructor AppendIndent(indent, output); @@ -6815,28 +7721,44 @@ static int AppendCppMethodDefinitionsBegin( AppendIndent(indent, output); output.Append("\n"); - if (includeDestructor) - { - AppendCppDestructorDefinitionBegin( - enclosingTypeName, - enclosingTypeNamespace, - enclosingTypeKind, - enclosingTypeParams, - indent, - output); - AppendIndent(indent + 2, output); - AppendDereferenceManagedHandleFunctionCall( - enclosingTypeName, - enclosingTypeNamespace, - enclosingTypeKind, - enclosingTypeParams, - "Handle", - output); - output.Append(";\n"); - AppendCppDestructorDefinitionEnd( - indent, - output); - } + AppendIndent(indent, output); + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, + output); + AppendCppTypeParameters( + enclosingTypeParams, + output); + output.Append("::~"); + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, + output); + AppendCppTypeParameters( + enclosingTypeParams, + output); + output.Append("()\n"); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent + 1, output); + output.Append("if (Handle)\n"); + AppendIndent(indent + 1, output); + output.Append("{\n"); + AppendIndent(indent + 2, output); + AppendDereferenceManagedHandleFunctionCall( + enclosingTypeName, + enclosingTypeNamespace, + enclosingTypeKind, + enclosingTypeParams, + "Handle", + output); + output.Append(";\n"); + AppendIndent(indent + 2, output); + output.Append("Handle = 0;\n"); + AppendIndent(indent + 1, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("}\n"); + AppendIndent(indent, output); + output.Append("\n"); // Assignment operator to same type AppendIndent(indent, output); @@ -7029,96 +7951,6 @@ static int AppendCppMethodDefinitionsBegin( return cppMethodDefinitionsIndent; } - static void AppendCppHandleConstructorDefintionBegin( - string enclosingTypeName, - Type[] enclosingTypeParams, - string baseTypeName, - string baseTypeNamespace, - Type[] baseTypeTypeParams, - int indent, - StringBuilder output) - { - AppendIndent(indent, output); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, - output); - AppendCppTypeParameters( - enclosingTypeParams, - output); - output.Append("::"); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, - output); - output.Append("(Plugin::InternalUse iu, int32_t handle)\n"); - AppendIndent(indent, output); - output.Append("\t: "); - AppendCppTypeName( - baseTypeNamespace, - baseTypeName, - output); - AppendCppTypeParameters( - baseTypeTypeParams, - output); - output.Append("(iu, handle)\n"); - AppendIndent(indent, output); - output.Append("{\n"); - } - - static void AppendCppHandleConstructorDefintionEnd( - int indent, - StringBuilder output) - { - AppendIndent(indent, output); - output.Append("}\n"); - AppendIndent(indent, output); - output.Append("\n"); - } - - static void AppendCppDestructorDefinitionBegin( - string enclosingTypeName, - string enclosingTypeNamespace, - TypeKind enclosingTypeKind, - Type[] enclosingTypeParams, - int indent, - StringBuilder output) - { - AppendIndent(indent, output); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, - output); - AppendCppTypeParameters( - enclosingTypeParams, - output); - output.Append("::~"); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, - output); - AppendCppTypeParameters( - enclosingTypeParams, - output); - output.Append("()\n"); - AppendIndent(indent, output); - output.Append("{\n"); - AppendIndent(indent + 1, output); - output.Append("if (Handle)\n"); - AppendIndent(indent + 1, output); - output.Append("{\n"); - } - - static void AppendCppDestructorDefinitionEnd( - int indent, - StringBuilder output) - { - AppendIndent(indent + 2, output); - output.Append("Handle = 0;\n"); - AppendIndent(indent + 1, output); - output.Append("}\n"); - AppendIndent(indent, output); - output.Append("}\n"); - AppendIndent(indent, output); - output.Append("\n"); - } - static void AppendSetHandle( string enclosingTypeName, string enclosingTypeNamespace, @@ -7133,18 +7965,10 @@ static void AppendSetHandle( AppendIndent(indent, output); output.Append("if ("); output.Append(thisHandleExpression); - output.Append(" != "); - output.Append(otherHandleExpression); output.Append(")\n"); AppendIndent(indent, output); output.Append("{\n"); AppendIndent(indent + 1, output); - output.Append("if ("); - output.Append(thisHandleExpression); - output.Append(")\n"); - AppendIndent(indent + 1, output); - output.Append("{\n"); - AppendIndent(indent + 2, output); AppendDereferenceManagedHandleFunctionCall( enclosingTypeName, enclosingTypeNamespace, @@ -7153,20 +7977,20 @@ static void AppendSetHandle( thisHandleExpression, output); output.Append(";\n"); - AppendIndent(indent + 1, output); + AppendIndent(indent, output); output.Append("}\n"); - AppendIndent(indent + 1, output); + AppendIndent(indent, output); output.Append(thisHandleExpression); output.Append(" = "); output.Append(otherHandleExpression); output.Append(";\n"); - AppendIndent(indent + 1, output); + AppendIndent(indent, output); output.Append("if ("); output.Append(thisHandleExpression); output.Append(")\n"); - AppendIndent(indent + 1, output); + AppendIndent(indent, output); output.Append("{\n"); - AppendIndent(indent + 2, output); + AppendIndent(indent + 1, output); AppendReferenceManagedHandleFunctionCall( enclosingTypeName, enclosingTypeNamespace, @@ -7175,8 +7999,6 @@ static void AppendSetHandle( thisHandleExpression, output); output.Append(";\n"); - AppendIndent(indent + 1, output); - output.Append("}\n"); AppendIndent(indent, output); output.Append("}\n"); } diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index a3a4f79..be0f906 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -505,6 +505,28 @@ "Set": {} } ] + }, + { + "Name": "UnityEngine.Application", + "Events": [ + { + "Name": "onBeforeRender" + } + ] + }, + { + "Name": "UnityEngine.SceneManagement.SceneManager", + "Events": [ + { + "Name": "sceneLoaded" + } + ] + }, + { + "Name": "UnityEngine.SceneManagement.Scene" + }, + { + "Name": "UnityEngine.SceneManagement.LoadSceneMode" } ], "MonoBehaviours": [ @@ -588,6 +610,21 @@ }, { "Type": "System.AppDomainInitializer" + }, + { + "Type": "UnityEngine.Events.UnityAction" + }, + { + "Type": "UnityEngine.Events.UnityAction`2", + "GenericParams": [ + { + "Types": [ + "UnityEngine.SceneManagement.Scene", + "UnityEngine.SceneManagement.LoadSceneMode" + ], + "MaxSimultaneous": 10 + } + ] } ] } \ No newline at end of file diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 8da9a20..53e97e8 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -106,6 +106,10 @@ namespace Plugin int32_t (*SystemAppDomainSetupConstructor)(); int32_t (*SystemAppDomainSetupPropertyGetAppDomainInitializer)(int32_t thisHandle); void (*SystemAppDomainSetupPropertySetAppDomainInitializer)(int32_t thisHandle, int32_t valueHandle); + void (*UnityEngineApplicationAddEventOnBeforeRender)(int32_t delHandle); + void (*UnityEngineApplicationRemoveEventOnBeforeRender)(int32_t delHandle); + void (*UnityEngineSceneManagementSceneManagerAddEventSceneLoaded)(int32_t delHandle); + void (*UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)(int32_t delHandle); int32_t (*SystemInt32Array1Constructor1)(int32_t length0); int32_t (*SystemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*SystemInt32Array1SetItem1)(int32_t thisHandle, int32_t index0, int32_t item); @@ -162,6 +166,16 @@ namespace Plugin void (*SystemAppDomainInitializerInvoke)(int32_t thisHandle, int32_t argsHandle); void (*SystemAppDomainInitializerAdd)(int32_t thisHandle, int32_t delHandle); void (*SystemAppDomainInitializerRemove)(int32_t thisHandle, int32_t delHandle); + void (*ReleaseUnityEngineEventsUnityAction)(int32_t handle, int32_t classHandle); + void (*UnityEngineEventsUnityActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); + void (*UnityEngineEventsUnityActionInvoke)(int32_t thisHandle); + void (*UnityEngineEventsUnityActionAdd)(int32_t thisHandle, int32_t delHandle); + void (*UnityEngineEventsUnityActionRemove)(int32_t thisHandle, int32_t delHandle); + void (*ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode)(int32_t handle, int32_t classHandle); + void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); + void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); + void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)(int32_t thisHandle, int32_t delHandle); + void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle); /*END FUNCTION POINTERS*/ } @@ -196,6 +210,20 @@ namespace Plugin } } + bool DereferenceManagedClassNoRelease(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenClass); + if (handle != 0) + { + int32_t numRemain = --RefCountsClass[handle]; + if (numRemain == 0) + { + return true; + } + } + return false; + } + /*BEGIN GLOBAL STATE AND FUNCTIONS*/ int32_t RefCountsLenUnityEngineRaycastHit; int32_t* RefCountsUnityEngineRaycastHit; @@ -397,6 +425,56 @@ namespace Plugin *pRelease = (System::AppDomainInitializer*)NextFreeSystemAppDomainInitializer; NextFreeSystemAppDomainInitializer = pRelease; } + int32_t UnityEngineEventsUnityActionFreeListSize; + UnityEngine::Events::UnityAction** UnityEngineEventsUnityActionFreeList; + UnityEngine::Events::UnityAction** NextFreeUnityEngineEventsUnityAction; + + int32_t StoreUnityEngineEventsUnityAction(UnityEngine::Events::UnityAction* del) + { + assert(NextFreeUnityEngineEventsUnityAction != nullptr); + UnityEngine::Events::UnityAction** pNext = NextFreeUnityEngineEventsUnityAction; + NextFreeUnityEngineEventsUnityAction = (UnityEngine::Events::UnityAction**)*pNext; + *pNext = del; + return (int32_t)(pNext - UnityEngineEventsUnityActionFreeList); + } + + UnityEngine::Events::UnityAction* GetUnityEngineEventsUnityAction(int32_t handle) + { + assert(handle >= 0 && handle < UnityEngineEventsUnityActionFreeListSize); + return UnityEngineEventsUnityActionFreeList[handle]; + } + + void RemoveUnityEngineEventsUnityAction(int32_t handle) + { + UnityEngine::Events::UnityAction** pRelease = UnityEngineEventsUnityActionFreeList + handle; + *pRelease = (UnityEngine::Events::UnityAction*)NextFreeUnityEngineEventsUnityAction; + NextFreeUnityEngineEventsUnityAction = pRelease; + } + int32_t UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize; + UnityEngine::Events::UnityAction2** UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList; + UnityEngine::Events::UnityAction2** NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; + + int32_t StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(UnityEngine::Events::UnityAction2* del) + { + assert(NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode != nullptr); + UnityEngine::Events::UnityAction2** pNext = NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; + NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = (UnityEngine::Events::UnityAction2**)*pNext; + *pNext = del; + return (int32_t)(pNext - UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList); + } + + UnityEngine::Events::UnityAction2* GetUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int32_t handle) + { + assert(handle >= 0 && handle < UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize); + return UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList[handle]; + } + + void RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int32_t handle) + { + UnityEngine::Events::UnityAction2** pRelease = UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList + handle; + *pRelease = (UnityEngine::Events::UnityAction2*)NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; + NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = pRelease; + } /*END GLOBAL STATE AND FUNCTIONS*/ } @@ -597,17 +675,14 @@ namespace System Stopwatch& Stopwatch::operator=(const Stopwatch& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -738,17 +813,14 @@ namespace UnityEngine Object& Object::operator=(const Object& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -874,17 +946,14 @@ namespace UnityEngine GameObject& GameObject::operator=(const GameObject& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -1021,17 +1090,14 @@ namespace UnityEngine Component& Component::operator=(const Component& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -1119,17 +1185,14 @@ namespace UnityEngine Transform& Transform::operator=(const Transform& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -1229,17 +1292,14 @@ namespace UnityEngine Debug& Debug::operator=(const Debug& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -1381,17 +1441,14 @@ namespace UnityEngine Collision& Collision::operator=(const Collision& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -1466,17 +1523,14 @@ namespace UnityEngine Behaviour& Behaviour::operator=(const Behaviour& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -1551,17 +1605,14 @@ namespace UnityEngine MonoBehaviour& MonoBehaviour::operator=(const MonoBehaviour& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -1636,17 +1687,14 @@ namespace UnityEngine AudioSettings& AudioSettings::operator=(const AudioSettings& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -1735,17 +1783,14 @@ namespace UnityEngine NetworkTransport& NetworkTransport::operator=(const NetworkTransport& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -1792,17 +1837,14 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - if (address->Handle != addressHandle) + if (address->Handle) { - if (address->Handle) - { - Plugin::DereferenceManagedClass(address->Handle); - } - address->Handle = addressHandle; - if (address->Handle) - { - Plugin::ReferenceManagedClass(address->Handle); - } + Plugin::DereferenceManagedClass(address->Handle); + } + address->Handle = addressHandle; + if (address->Handle) + { + Plugin::ReferenceManagedClass(address->Handle); } } @@ -1961,17 +2003,14 @@ namespace UnityEngine RaycastHit& RaycastHit::operator=(const RaycastHit& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); - } + Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); } return *this; } @@ -2088,17 +2127,14 @@ namespace System KeyValuePair& KeyValuePair::operator=(const KeyValuePair& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); - } + Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); } return *this; } @@ -2223,17 +2259,14 @@ namespace System List& List::operator=(const List& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -2369,17 +2402,14 @@ namespace System LinkedListNode& LinkedListNode::operator=(const LinkedListNode& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -2503,17 +2533,14 @@ namespace System StrongBox& StrongBox::operator=(const StrongBox& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -2637,17 +2664,14 @@ namespace System Collection& Collection::operator=(const Collection& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -2728,17 +2752,14 @@ namespace System KeyedCollection& KeyedCollection::operator=(const KeyedCollection& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -2815,17 +2836,14 @@ namespace System Exception& Exception::operator=(const Exception& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -2918,17 +2936,14 @@ namespace System SystemException& SystemException::operator=(const SystemException& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -3003,17 +3018,14 @@ namespace System NullReferenceException& NullReferenceException::operator=(const NullReferenceException& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -3170,17 +3182,14 @@ namespace UnityEngine Screen& Screen::operator=(const Screen& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -3288,17 +3297,14 @@ namespace UnityEngine Physics& Physics::operator=(const Physics& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -3413,17 +3419,14 @@ namespace UnityEngine Gradient& Gradient::operator=(const Gradient& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -3541,17 +3544,14 @@ namespace System AppDomainSetup& AppDomainSetup::operator=(const AppDomainSetup& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -3631,103 +3631,15 @@ namespace System } } -namespace MyGame -{ - namespace MonoBehaviours - { - TestScript::TestScript(std::nullptr_t n) - : TestScript(Plugin::InternalUse::Only, 0) - { - } - - TestScript::TestScript(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::MonoBehaviour(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - TestScript::TestScript(const TestScript& other) - : TestScript(Plugin::InternalUse::Only, other.Handle) - { - } - - TestScript::TestScript(TestScript&& other) - : TestScript(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - TestScript::~TestScript() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - TestScript& TestScript::operator=(const TestScript& other) - { - if (this->Handle != other.Handle) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - } - return *this; - } - - TestScript& TestScript::operator=(std::nullptr_t other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - TestScript& TestScript::operator=(TestScript&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool TestScript::operator==(const TestScript& other) const - { - return Handle == other.Handle; - } - - bool TestScript::operator!=(const TestScript& other) const - { - return Handle != other.Handle; - } - } -} - -namespace System +namespace UnityEngine { - Array1::Array1(std::nullptr_t n) - : Array1(Plugin::InternalUse::Only, 0) + Application::Application(std::nullptr_t n) + : Application(Plugin::InternalUse::Only, 0) { } - Array1::Array1(Plugin::InternalUse iu, int32_t handle) - : System::Array(iu, handle) + Application::Application(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { if (handle) { @@ -3735,18 +3647,18 @@ namespace System } } - Array1::Array1(const Array1& other) - : Array1(Plugin::InternalUse::Only, other.Handle) + Application::Application(const Application& other) + : Application(Plugin::InternalUse::Only, other.Handle) { } - Array1::Array1(Array1&& other) - : Array1(Plugin::InternalUse::Only, other.Handle) + Application::Application(Application&& other) + : Application(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - Array1::~Array1() + Application::~Application() { if (Handle) { @@ -3755,24 +3667,21 @@ namespace System } } - Array1& Array1::operator=(const Array1& other) + Application& Application::operator=(const Application& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } - Array1& Array1::operator=(std::nullptr_t other) + Application& Application::operator=(std::nullptr_t other) { if (Handle) { @@ -3782,7 +3691,7 @@ namespace System return *this; } - Array1& Array1::operator=(Array1&& other) + Application& Application::operator=(Application&& other) { if (Handle) { @@ -3793,47 +3702,19 @@ namespace System return *this; } - bool Array1::operator==(const Array1& other) const + bool Application::operator==(const Application& other) const { return Handle == other.Handle; } - bool Array1::operator!=(const Array1& other) const + bool Application::operator!=(const Application& other) const { return Handle != other.Handle; } - Array1::Array1(int32_t length0) - : System::Array(nullptr) - { - auto returnValue = Plugin::SystemInt32Array1Constructor1(length0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - int32_t Array1::GetLength() - { - return Array::GetLength(); - } - - int32_t Array1::GetRank() - { - return Array::GetRank(); - } - - int32_t Array1::GetItem(int32_t index0) + void Application::AddOnBeforeRender(UnityEngine::Events::UnityAction del) { - auto returnValue = Plugin::SystemInt32Array1GetItem1(Handle, index0); + Plugin::UnityEngineApplicationAddEventOnBeforeRender(del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3841,12 +3722,11 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return returnValue; } - void Array1::SetItem(int32_t index0, int32_t item) + void Application::RemoveOnBeforeRender(UnityEngine::Events::UnityAction del) { - Plugin::SystemInt32Array1SetItem1(Handle, index0, item); + Plugin::UnityEngineApplicationRemoveEventOnBeforeRender(del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3857,60 +3737,261 @@ namespace System } } -namespace System +namespace UnityEngine { - Array1::Array1(std::nullptr_t n) - : Array1(Plugin::InternalUse::Only, 0) - { - } - - Array1::Array1(Plugin::InternalUse iu, int32_t handle) - : System::Array(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Array1::Array1(const Array1& other) - : Array1(Plugin::InternalUse::Only, other.Handle) - { - } - - Array1::Array1(Array1&& other) - : Array1(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Array1::~Array1() + namespace SceneManagement { - if (Handle) + SceneManager::SceneManager(std::nullptr_t n) + : SceneManager(Plugin::InternalUse::Only, 0) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; } - } - - Array1& Array1::operator=(const Array1& other) - { - if (this->Handle != other.Handle) + + SceneManager::SceneManager(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { - if (this->Handle) + if (handle) { - Plugin::DereferenceManagedClass(this->Handle); + Plugin::ReferenceManagedClass(handle); } - this->Handle = other.Handle; + } + + SceneManager::SceneManager(const SceneManager& other) + : SceneManager(Plugin::InternalUse::Only, other.Handle) + { + } + + SceneManager::SceneManager(SceneManager&& other) + : SceneManager(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + SceneManager::~SceneManager() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + SceneManager& SceneManager::operator=(const SceneManager& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + SceneManager& SceneManager::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + SceneManager& SceneManager::operator=(SceneManager&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool SceneManager::operator==(const SceneManager& other) const + { + return Handle == other.Handle; + } + + bool SceneManager::operator!=(const SceneManager& other) const + { + return Handle != other.Handle; + } + + void SceneManager::AddSceneLoaded(UnityEngine::Events::UnityAction2 del) + { + Plugin::UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void SceneManager::RemoveSceneLoaded(UnityEngine::Events::UnityAction2 del) + { + Plugin::UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } +} + +namespace UnityEngine +{ + namespace SceneManagement + { + Scene::Scene() + { + } + } +} + +namespace MyGame +{ + namespace MonoBehaviours + { + TestScript::TestScript(std::nullptr_t n) + : TestScript(Plugin::InternalUse::Only, 0) + { + } + + TestScript::TestScript(Plugin::InternalUse iu, int32_t handle) + : UnityEngine::MonoBehaviour(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + TestScript::TestScript(const TestScript& other) + : TestScript(Plugin::InternalUse::Only, other.Handle) + { + } + + TestScript::TestScript(TestScript&& other) + : TestScript(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + TestScript::~TestScript() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + TestScript& TestScript::operator=(const TestScript& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; if (this->Handle) { Plugin::ReferenceManagedClass(this->Handle); } + return *this; + } + + TestScript& TestScript::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + TestScript& TestScript::operator=(TestScript&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool TestScript::operator==(const TestScript& other) const + { + return Handle == other.Handle; + } + + bool TestScript::operator!=(const TestScript& other) const + { + return Handle != other.Handle; + } + } +} + +namespace System +{ + Array1::Array1(std::nullptr_t n) + : Array1(Plugin::InternalUse::Only, 0) + { + } + + Array1::Array1(Plugin::InternalUse iu, int32_t handle) + : System::Array(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Array1::Array1(const Array1& other) + : Array1(Plugin::InternalUse::Only, other.Handle) + { + } + + Array1::Array1(Array1&& other) + : Array1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Array1::~Array1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Array1& Array1::operator=(const Array1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } - Array1& Array1::operator=(std::nullptr_t other) + Array1& Array1::operator=(std::nullptr_t other) { if (Handle) { @@ -3920,7 +4001,7 @@ namespace System return *this; } - Array1& Array1::operator=(Array1&& other) + Array1& Array1::operator=(Array1&& other) { if (Handle) { @@ -3931,20 +4012,20 @@ namespace System return *this; } - bool Array1::operator==(const Array1& other) const + bool Array1::operator==(const Array1& other) const { return Handle == other.Handle; } - bool Array1::operator!=(const Array1& other) const + bool Array1::operator!=(const Array1& other) const { return Handle != other.Handle; } - Array1::Array1(int32_t length0) + Array1::Array1(int32_t length0) : System::Array(nullptr) { - auto returnValue = Plugin::SystemSingleArray1Constructor1(length0); + auto returnValue = Plugin::SystemInt32Array1Constructor1(length0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3959,19 +4040,19 @@ namespace System } } - int32_t Array1::GetLength() + int32_t Array1::GetLength() { return Array::GetLength(); } - int32_t Array1::GetRank() + int32_t Array1::GetRank() { return Array::GetRank(); } - float Array1::GetItem(int32_t index0) + int32_t Array1::GetItem(int32_t index0) { - auto returnValue = Plugin::SystemSingleArray1GetItem1(Handle, index0); + auto returnValue = Plugin::SystemInt32Array1GetItem1(Handle, index0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3982,9 +4063,9 @@ namespace System return returnValue; } - void Array1::SetItem(int32_t index0, float item) + void Array1::SetItem(int32_t index0, int32_t item) { - Plugin::SystemSingleArray1SetItem1(Handle, index0, item); + Plugin::SystemInt32Array1SetItem1(Handle, index0, item); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3997,12 +4078,12 @@ namespace System namespace System { - Array2::Array2(std::nullptr_t n) - : Array2(Plugin::InternalUse::Only, 0) + Array1::Array1(std::nullptr_t n) + : Array1(Plugin::InternalUse::Only, 0) { } - Array2::Array2(Plugin::InternalUse iu, int32_t handle) + Array1::Array1(Plugin::InternalUse iu, int32_t handle) : System::Array(iu, handle) { if (handle) @@ -4011,18 +4092,18 @@ namespace System } } - Array2::Array2(const Array2& other) - : Array2(Plugin::InternalUse::Only, other.Handle) + Array1::Array1(const Array1& other) + : Array1(Plugin::InternalUse::Only, other.Handle) { } - Array2::Array2(Array2&& other) - : Array2(Plugin::InternalUse::Only, other.Handle) + Array1::Array1(Array1&& other) + : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - Array2::~Array2() + Array1::~Array1() { if (Handle) { @@ -4031,19 +4112,151 @@ namespace System } } - Array2& Array2::operator=(const Array2& other) + Array1& Array1::operator=(const Array1& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Array1& Array1::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Array1& Array1::operator=(Array1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Array1::operator==(const Array1& other) const + { + return Handle == other.Handle; + } + + bool Array1::operator!=(const Array1& other) const + { + return Handle != other.Handle; + } + + Array1::Array1(int32_t length0) + : System::Array(nullptr) + { + auto returnValue = Plugin::SystemSingleArray1Constructor1(length0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + int32_t Array1::GetLength() + { + return Array::GetLength(); + } + + int32_t Array1::GetRank() + { + return Array::GetRank(); + } + + float Array1::GetItem(int32_t index0) + { + auto returnValue = Plugin::SystemSingleArray1GetItem1(Handle, index0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + void Array1::SetItem(int32_t index0, float item) + { + Plugin::SystemSingleArray1SetItem1(Handle, index0, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace System +{ + Array2::Array2(std::nullptr_t n) + : Array2(Plugin::InternalUse::Only, 0) + { + } + + Array2::Array2(Plugin::InternalUse iu, int32_t handle) + : System::Array(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Array2::Array2(const Array2& other) + : Array2(Plugin::InternalUse::Only, other.Handle) + { + } + + Array2::Array2(Array2&& other) + : Array2(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Array2::~Array2() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Array2& Array2::operator=(const Array2& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -4184,17 +4397,14 @@ namespace System Array3& Array3::operator=(const Array3& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -4335,17 +4545,14 @@ namespace System Array1& Array1::operator=(const Array1& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -4473,17 +4680,14 @@ namespace System Array1& Array1::operator=(const Array1& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -4611,17 +4815,14 @@ namespace System Array1& Array1::operator=(const Array1& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -4749,17 +4950,14 @@ namespace System Array1& Array1::operator=(const Array1& other) { - if (this->Handle != other.Handle) + if (this->Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } @@ -4851,112 +5049,170 @@ namespace System namespace System { + Action::Action() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemAction(this); + Plugin::SystemActionConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemAction(CppHandle); + ClassHandle = 0; + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + Action::Action(std::nullptr_t n) - : Action(Plugin::InternalUse::Only, 0) + : System::Object(Plugin::InternalUse::Only, 0) { + CppHandle = Plugin::StoreSystemAction(this); + ClassHandle = 0; } Action::Action(const Action& other) - : Action(Plugin::InternalUse::Only, other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { + CppHandle = Plugin::StoreSystemAction(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = other.ClassHandle; } Action::Action(Action&& other) - : Action(Plugin::InternalUse::Only, other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; } - Action& Action::operator=(const Action& other) + Action::Action(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { - if (this->Handle != other.Handle) + CppHandle = Plugin::StoreSystemAction(this); + if (Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + Plugin::ReferenceManagedClass(Handle); } - return *this; + ClassHandle = 0; } - Action& Action::operator=(std::nullptr_t other) + Action::~Action() { + Plugin::RemoveSystemAction(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemAction(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } - return *this; } - Action& Action::operator=(Action&& other) + Action& Action::operator=(const Action& other) { - if (Handle) + if (this->Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedClass(this->Handle); } - Handle = other.Handle; - other.Handle = 0; + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + ClassHandle = other.ClassHandle; return *this; } - bool Action::operator==(const Action& other) const - { - return Handle == other.Handle; - } - - bool Action::operator!=(const Action& other) const - { - return Handle != other.Handle; - } - - Action::Action() - : System::Object(nullptr) + Action& Action::operator=(std::nullptr_t other) { - CppHandle = Plugin::StoreSystemAction(this); - Plugin::SystemActionConstructor(CppHandle, &Handle, &ClassHandle); if (Handle) { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemAction(CppHandle); - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemAction(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = 0; + Handle = 0; + return *this; } - Action::Action(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + Action& Action::operator=(Action&& other) { - ClassHandle = 0; - CppHandle = Plugin::StoreSystemAction(this); + Plugin::RemoveSystemAction(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemAction(CppHandle); - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemAction(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Action::operator==(const Action& other) const + { + return Handle == other.Handle; + } + + bool Action::operator!=(const Action& other) const + { + return Handle != other.Handle; } void Action::operator()() @@ -4975,24 +5231,6 @@ namespace System } } - Action::~Action() - { - if (Handle) - { - Plugin::ReleaseSystemAction(Handle, ClassHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Plugin::RemoveSystemAction(CppHandle); - ClassHandle = 0; - Handle = 0; - } - } - void Action::operator+=(System::Action& del) { Plugin::SystemActionAdd(Handle, del.Handle); @@ -5019,42 +5257,124 @@ namespace System DLLEXPORT void SystemActionCppInvoke(int32_t cppHandle) { - (*Plugin::GetSystemAction(cppHandle))(); + try + { + (*Plugin::GetSystemAction(cppHandle))(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Action"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } } } namespace System { + Action1::Action1() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemActionSystemSingle(this); + Plugin::SystemActionSystemSingleConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemActionSystemSingle(CppHandle); + ClassHandle = 0; + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + Action1::Action1(std::nullptr_t n) - : Action1(Plugin::InternalUse::Only, 0) + : System::Object(Plugin::InternalUse::Only, 0) { + CppHandle = Plugin::StoreSystemActionSystemSingle(this); + ClassHandle = 0; } Action1::Action1(const Action1& other) - : Action1(Plugin::InternalUse::Only, other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { + CppHandle = Plugin::StoreSystemActionSystemSingle(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = other.ClassHandle; } Action1::Action1(Action1&& other) - : Action1(Plugin::InternalUse::Only, other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; } - Action1& Action1::operator=(const Action1& other) + Action1::Action1(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemActionSystemSingle(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = 0; + } + + Action1::~Action1() { - if (this->Handle != other.Handle) + Plugin::RemoveSystemActionSystemSingle(CppHandle); + CppHandle = 0; + if (Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReferenceManagedClass(this->Handle); + Plugin::ReleaseSystemActionSystemSingle(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } + } + + Action1& Action1::operator=(const Action1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + ClassHandle = other.ClassHandle; return *this; } @@ -5062,18 +5382,51 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemActionSystemSingle(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = 0; + Handle = 0; return *this; } Action1& Action1::operator=(Action1&& other) { + Plugin::RemoveSystemActionSystemSingle(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemActionSystemSingle(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; Handle = other.Handle; other.Handle = 0; return *this; @@ -5089,19 +5442,13 @@ namespace System return Handle != other.Handle; } - Action1::Action1() - : System::Object(nullptr) + void Action1::operator()(float obj) { - CppHandle = Plugin::StoreSystemActionSystemSingle(this); - Plugin::SystemActionSystemSingleConstructor(CppHandle, &Handle, &ClassHandle); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemActionSystemSingle(CppHandle); - } + } + + void Action1::Invoke(float obj) + { + Plugin::SystemActionSystemSingleInvoke(Handle, obj); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5111,19 +5458,9 @@ namespace System } } - Action1::Action1(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + void Action1::operator+=(System::Action1& del) { - ClassHandle = 0; - CppHandle = Plugin::StoreSystemActionSystemSingle(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemActionSystemSingle(CppHandle); - } + Plugin::SystemActionSystemSingleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5133,13 +5470,9 @@ namespace System } } - void Action1::operator()(float obj) - { - } - - void Action1::Invoke(float obj) + void Action1::operator-=(System::Action1& del) { - Plugin::SystemActionSystemSingleInvoke(Handle, obj); + Plugin::SystemActionSystemSingleRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5149,39 +5482,42 @@ namespace System } } - Action1::~Action1() + DLLEXPORT void SystemActionSystemSingleCppInvoke(int32_t cppHandle, float obj) { - if (Handle) + try { - Plugin::ReleaseSystemActionSystemSingle(Handle, ClassHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Plugin::RemoveSystemActionSystemSingle(CppHandle); - ClassHandle = 0; - Handle = 0; + (*Plugin::GetSystemActionSystemSingle(cppHandle))(obj); } - } - - void Action1::operator+=(System::Action1& del) - { - Plugin::SystemActionSystemSingleAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) + catch (System::Exception ex) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Action1"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); } } - - void Action1::operator-=(System::Action1& del) +} + +namespace System +{ + Action2::Action2() + : System::Object(nullptr) { - Plugin::SystemActionSystemSingleRemove(Handle, del.Handle); + CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); + Plugin::SystemActionSystemSingle_SystemSingleConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); + ClassHandle = 0; + CppHandle = 0; + } if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5191,44 +5527,81 @@ namespace System } } - DLLEXPORT void SystemActionSystemSingleCppInvoke(int32_t cppHandle, float obj) - { - (*Plugin::GetSystemActionSystemSingle(cppHandle))(obj); - } -} - -namespace System -{ Action2::Action2(std::nullptr_t n) - : Action2(Plugin::InternalUse::Only, 0) + : System::Object(Plugin::InternalUse::Only, 0) { + CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); + ClassHandle = 0; } Action2::Action2(const Action2& other) - : Action2(Plugin::InternalUse::Only, other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { + CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = other.ClassHandle; } Action2::Action2(Action2&& other) - : Action2(Plugin::InternalUse::Only, other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; } - Action2& Action2::operator=(const Action2& other) + Action2::Action2(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = 0; + } + + Action2::~Action2() { - if (this->Handle != other.Handle) + Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); + CppHandle = 0; + if (Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReferenceManagedClass(this->Handle); + Plugin::ReleaseSystemActionSystemSingle_SystemSingle(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } + } + + Action2& Action2::operator=(const Action2& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + ClassHandle = other.ClassHandle; return *this; } @@ -5236,18 +5609,51 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemActionSystemSingle_SystemSingle(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = 0; + Handle = 0; return *this; } Action2& Action2::operator=(Action2&& other) { + Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemActionSystemSingle_SystemSingle(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; Handle = other.Handle; other.Handle = 0; return *this; @@ -5263,50 +5669,6 @@ namespace System return Handle != other.Handle; } - Action2::Action2() - : System::Object(nullptr) - { - CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); - Plugin::SystemActionSystemSingle_SystemSingleConstructor(CppHandle, &Handle, &ClassHandle); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - Action2::Action2(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - ClassHandle = 0; - CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - void Action2::operator()(float arg1, float arg2) { } @@ -5323,24 +5685,6 @@ namespace System } } - Action2::~Action2() - { - if (Handle) - { - Plugin::ReleaseSystemActionSystemSingle_SystemSingle(Handle, ClassHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); - ClassHandle = 0; - Handle = 0; - } - } - void Action2::operator+=(System::Action2& del) { Plugin::SystemActionSystemSingle_SystemSingleAdd(Handle, del.Handle); @@ -5367,76 +5711,25 @@ namespace System DLLEXPORT void SystemActionSystemSingle_SystemSingleCppInvoke(int32_t cppHandle, float arg1, float arg2) { - (*Plugin::GetSystemActionSystemSingle_SystemSingle(cppHandle))(arg1, arg2); - } -} - -namespace System -{ - Func3::Func3(std::nullptr_t n) - : Func3(Plugin::InternalUse::Only, 0) - { - } - - Func3::Func3(const Func3& other) - : Func3(Plugin::InternalUse::Only, other.Handle) - { - } - - Func3::Func3(Func3&& other) - : Func3(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Func3& Func3::operator=(const Func3& other) - { - if (this->Handle != other.Handle) + try { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } + (*Plugin::GetSystemActionSystemSingle_SystemSingle(cppHandle))(arg1, arg2); } - return *this; - } - - Func3& Func3::operator=(std::nullptr_t other) - { - if (Handle) + catch (System::Exception ex) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + Plugin::SetException(ex.Handle); } - return *this; - } - - Func3& Func3::operator=(Func3&& other) - { - if (Handle) + catch (...) { - Plugin::DereferenceManagedClass(Handle); + System::String msg = "Unhandled exception invoking System::Action2"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Func3::operator==(const Func3& other) const - { - return Handle == other.Handle; - } - - bool Func3::operator!=(const Func3& other) const - { - return Handle != other.Handle; } - +} + +namespace System +{ Func3::Func3() : System::Object(nullptr) { @@ -5449,6 +5742,8 @@ namespace System else { Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); + ClassHandle = 0; + CppHandle = 0; } if (Plugin::unhandledCsharpException) { @@ -5459,62 +5754,164 @@ namespace System } } - Func3::Func3(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + Func3::Func3(std::nullptr_t n) + : System::Object(Plugin::InternalUse::Only, 0) { + CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); ClassHandle = 0; + } + + Func3::Func3(const Func3& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } - else - { - Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + ClassHandle = other.ClassHandle; } - double Func3::operator()(int32_t arg1, float arg2) + Func3::Func3(Func3&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - return {}; + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; + other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; } - double Func3::Invoke(int32_t arg1, float arg2) + Func3::Func3(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { - auto returnValue = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(Handle, arg1, arg2); - if (Plugin::unhandledCsharpException) + CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(Handle); } - return returnValue; + ClassHandle = 0; } - Func3::~Func3() + Func3::~Func3() { + Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(Handle, ClassHandle); - if (Plugin::unhandledCsharpException) + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); + } + } + + Func3& Func3::operator=(const Func3& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + ClassHandle = other.ClassHandle; + return *this; + } + + Func3& Func3::operator=(std::nullptr_t other) + { + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + ClassHandle = 0; + Handle = 0; + return *this; + } + + Func3& Func3::operator=(Func3&& other) + { + Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Func3::operator==(const Func3& other) const + { + return Handle == other.Handle; + } + + bool Func3::operator!=(const Func3& other) const + { + return Handle != other.Handle; + } + + double Func3::operator()(int32_t arg1, float arg2) + { + return {}; + } + + double Func3::Invoke(int32_t arg1, float arg2) + { + auto returnValue = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(Handle, arg1, arg2); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnValue; } void Func3::operator+=(System::Func3& del) @@ -5543,42 +5940,126 @@ namespace System DLLEXPORT double SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke(int32_t cppHandle, int32_t arg1, float arg2) { - return (*Plugin::GetSystemFuncSystemInt32_SystemSingle_SystemDouble(cppHandle))(arg1, arg2); + try + { + return (*Plugin::GetSystemFuncSystemInt32_SystemSingle_SystemDouble(cppHandle))(arg1, arg2); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Func3"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } } } namespace System { + Func3::Func3() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); + ClassHandle = 0; + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + Func3::Func3(std::nullptr_t n) - : Func3(Plugin::InternalUse::Only, 0) + : System::Object(Plugin::InternalUse::Only, 0) { + CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); + ClassHandle = 0; } Func3::Func3(const Func3& other) - : Func3(Plugin::InternalUse::Only, other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { + CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = other.ClassHandle; } Func3::Func3(Func3&& other) - : Func3(Plugin::InternalUse::Only, other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; } - Func3& Func3::operator=(const Func3& other) + Func3::Func3(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { - if (this->Handle != other.Handle) + CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); + if (Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = 0; + } + + Func3::~Func3() + { + Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReferenceManagedClass(this->Handle); + Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } + } + + Func3& Func3::operator=(const Func3& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + ClassHandle = other.ClassHandle; return *this; } @@ -5586,18 +6067,51 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = 0; + Handle = 0; return *this; } Func3& Func3::operator=(Func3&& other) { + Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; Handle = other.Handle; other.Handle = 0; return *this; @@ -5613,19 +6127,14 @@ namespace System return Handle != other.Handle; } - Func3::Func3() - : System::Object(nullptr) + System::String Func3::operator()(int16_t arg1, int32_t arg2) { - CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(CppHandle, &Handle, &ClassHandle); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); - } + return {}; + } + + System::String Func3::Invoke(int16_t arg1, int32_t arg2) + { + auto returnValue = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(Handle, arg1, arg2); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5633,21 +6142,12 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } + return System::String(Plugin::InternalUse::Only, returnValue); } - Func3::Func3(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + void Func3::operator+=(System::Func3& del) { - ClassHandle = 0; - CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); - } + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5657,14 +6157,9 @@ namespace System } } - System::String Func3::operator()(int16_t arg1, int32_t arg2) - { - return {}; - } - - System::String Func3::Invoke(int16_t arg1, int32_t arg2) + void Func3::operator-=(System::Func3& del) { - auto returnValue = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(Handle, arg1, arg2); + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5672,42 +6167,46 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return System::String(Plugin::InternalUse::Only, returnValue); } - Func3::~Func3() + DLLEXPORT int32_t SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke(int32_t cppHandle, int16_t arg1, int32_t arg2) { - if (Handle) + try { - Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(Handle, ClassHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); - ClassHandle = 0; - Handle = 0; + return (*Plugin::GetSystemFuncSystemInt16_SystemInt32_SystemString(cppHandle))(arg1, arg2).Handle; } - } - - void Func3::operator+=(System::Func3& del) - { - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) + catch (System::Exception ex) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Func3"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; } } - - void Func3::operator-=(System::Func3& del) +} + +namespace System +{ + AppDomainInitializer::AppDomainInitializer() + : System::Object(nullptr) { - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove(Handle, del.Handle); + CppHandle = Plugin::StoreSystemAppDomainInitializer(this); + Plugin::SystemAppDomainInitializerConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemAppDomainInitializer(CppHandle); + ClassHandle = 0; + CppHandle = 0; + } if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5717,44 +6216,81 @@ namespace System } } - DLLEXPORT int32_t SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke(int32_t cppHandle, int16_t arg1, int32_t arg2) - { - return (*Plugin::GetSystemFuncSystemInt16_SystemInt32_SystemString(cppHandle))(arg1, arg2).Handle; - } -} - -namespace System -{ AppDomainInitializer::AppDomainInitializer(std::nullptr_t n) - : AppDomainInitializer(Plugin::InternalUse::Only, 0) + : System::Object(Plugin::InternalUse::Only, 0) { + CppHandle = Plugin::StoreSystemAppDomainInitializer(this); + ClassHandle = 0; } AppDomainInitializer::AppDomainInitializer(const AppDomainInitializer& other) - : AppDomainInitializer(Plugin::InternalUse::Only, other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { + CppHandle = Plugin::StoreSystemAppDomainInitializer(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = other.ClassHandle; } AppDomainInitializer::AppDomainInitializer(AppDomainInitializer&& other) - : AppDomainInitializer(Plugin::InternalUse::Only, other.Handle) + : System::Object(Plugin::InternalUse::Only, other.Handle) { + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; } - AppDomainInitializer& AppDomainInitializer::operator=(const AppDomainInitializer& other) + AppDomainInitializer::AppDomainInitializer(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { - if (this->Handle != other.Handle) + CppHandle = Plugin::StoreSystemAppDomainInitializer(this); + if (Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = 0; + } + + AppDomainInitializer::~AppDomainInitializer() + { + Plugin::RemoveSystemAppDomainInitializer(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReferenceManagedClass(this->Handle); + Plugin::ReleaseSystemAppDomainInitializer(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } + } + + AppDomainInitializer& AppDomainInitializer::operator=(const AppDomainInitializer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + ClassHandle = other.ClassHandle; return *this; } @@ -5762,18 +6298,51 @@ namespace System { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemAppDomainInitializer(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = 0; + Handle = 0; return *this; } AppDomainInitializer& AppDomainInitializer::operator=(AppDomainInitializer&& other) { + Plugin::RemoveSystemAppDomainInitializer(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemAppDomainInitializer(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; Handle = other.Handle; other.Handle = 0; return *this; @@ -5789,19 +6358,13 @@ namespace System return Handle != other.Handle; } - AppDomainInitializer::AppDomainInitializer() - : System::Object(nullptr) + void AppDomainInitializer::operator()(System::Array1 args) { - CppHandle = Plugin::StoreSystemAppDomainInitializer(this); - Plugin::SystemAppDomainInitializerConstructor(CppHandle, &Handle, &ClassHandle); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemAppDomainInitializer(CppHandle); - } + } + + void AppDomainInitializer::Invoke(System::Array1 args) + { + Plugin::SystemAppDomainInitializerInvoke(Handle, args.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5811,19 +6374,9 @@ namespace System } } - AppDomainInitializer::AppDomainInitializer(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + void AppDomainInitializer::operator+=(System::AppDomainInitializer& del) { - ClassHandle = 0; - CppHandle = Plugin::StoreSystemAppDomainInitializer(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemAppDomainInitializer(CppHandle); - } + Plugin::SystemAppDomainInitializerAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5833,13 +6386,9 @@ namespace System } } - void AppDomainInitializer::operator()(System::Array1 args) - { - } - - void AppDomainInitializer::Invoke(System::Array1 args) + void AppDomainInitializer::operator-=(System::AppDomainInitializer& del) { - Plugin::SystemAppDomainInitializerInvoke(Handle, args.Handle); + Plugin::SystemAppDomainInitializerRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5849,11 +6398,44 @@ namespace System } } - AppDomainInitializer::~AppDomainInitializer() + DLLEXPORT void SystemAppDomainInitializerCppInvoke(int32_t cppHandle, int32_t argsHandle) { - if (Handle) + try { - Plugin::ReleaseSystemAppDomainInitializer(Handle, ClassHandle); + (*Plugin::GetSystemAppDomainInitializer(cppHandle))(System::Array1(Plugin::InternalUse::Only, argsHandle)); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::AppDomainInitializer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } +} + +namespace UnityEngine +{ + namespace Events + { + UnityAction::UnityAction() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); + Plugin::UnityEngineEventsUnityActionConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveUnityEngineEventsUnityAction(CppHandle); + ClassHandle = 0; + CppHandle = 0; + } if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5861,39 +6443,437 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - Plugin::RemoveSystemAppDomainInitializer(CppHandle); + } + + UnityAction::UnityAction(std::nullptr_t n) + : System::Object(Plugin::InternalUse::Only, 0) + { + CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); + ClassHandle = 0; + } + + UnityAction::UnityAction(const UnityAction& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = other.ClassHandle; + } + + UnityAction::UnityAction(UnityAction&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; + other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; + } + + UnityAction::UnityAction(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = 0; + } + + UnityAction::~UnityAction() + { + Plugin::RemoveUnityEngineEventsUnityAction(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseUnityEngineEventsUnityAction(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + UnityAction& UnityAction::operator=(const UnityAction& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + ClassHandle = other.ClassHandle; + return *this; + } + + UnityAction& UnityAction::operator=(std::nullptr_t other) + { + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseUnityEngineEventsUnityAction(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } ClassHandle = 0; Handle = 0; + return *this; } - } - - void AppDomainInitializer::operator+=(System::AppDomainInitializer& del) - { - Plugin::SystemAppDomainInitializerAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) + + UnityAction& UnityAction::operator=(UnityAction&& other) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::RemoveUnityEngineEventsUnityAction(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseUnityEngineEventsUnityAction(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; + Handle = other.Handle; + other.Handle = 0; + return *this; } - } - - void AppDomainInitializer::operator-=(System::AppDomainInitializer& del) - { - Plugin::SystemAppDomainInitializerRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) + + bool UnityAction::operator==(const UnityAction& other) const { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Handle == other.Handle; + } + + bool UnityAction::operator!=(const UnityAction& other) const + { + return Handle != other.Handle; + } + + void UnityAction::operator()() + { + } + + void UnityAction::Invoke() + { + Plugin::UnityEngineEventsUnityActionInvoke(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void UnityAction::operator+=(UnityEngine::Events::UnityAction& del) + { + Plugin::UnityEngineEventsUnityActionAdd(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void UnityAction::operator-=(UnityEngine::Events::UnityAction& del) + { + Plugin::UnityEngineEventsUnityActionRemove(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + DLLEXPORT void UnityEngineEventsUnityActionCppInvoke(int32_t cppHandle) + { + try + { + (*Plugin::GetUnityEngineEventsUnityAction(cppHandle))(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking UnityEngine::Events::UnityAction"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } } } - - DLLEXPORT void SystemAppDomainInitializerCppInvoke(int32_t cppHandle, int32_t argsHandle) +} + +namespace UnityEngine +{ + namespace Events { - (*Plugin::GetSystemAppDomainInitializer(cppHandle))(System::Array1(Plugin::InternalUse::Only, argsHandle)); + UnityAction2::UnityAction2() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(CppHandle); + ClassHandle = 0; + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + UnityAction2::UnityAction2(std::nullptr_t n) + : System::Object(Plugin::InternalUse::Only, 0) + { + CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); + ClassHandle = 0; + } + + UnityAction2::UnityAction2(const UnityAction2& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = other.ClassHandle; + } + + UnityAction2::UnityAction2(UnityAction2&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; + other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; + } + + UnityAction2::UnityAction2(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = 0; + } + + UnityAction2::~UnityAction2() + { + Plugin::RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + UnityAction2& UnityAction2::operator=(const UnityAction2& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + ClassHandle = other.ClassHandle; + return *this; + } + + UnityAction2& UnityAction2::operator=(std::nullptr_t other) + { + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + ClassHandle = 0; + Handle = 0; + return *this; + } + + UnityAction2& UnityAction2::operator=(UnityAction2&& other) + { + Plugin::RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool UnityAction2::operator==(const UnityAction2& other) const + { + return Handle == other.Handle; + } + + bool UnityAction2::operator!=(const UnityAction2& other) const + { + return Handle != other.Handle; + } + + void UnityAction2::operator()(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + { + } + + void UnityAction2::Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + { + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(Handle, arg0, arg1); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void UnityAction2::operator+=(UnityEngine::Events::UnityAction2& del) + { + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void UnityAction2::operator-=(UnityEngine::Events::UnityAction2& del) + { + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + DLLEXPORT void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvoke(int32_t cppHandle, UnityEngine::SceneManagement::Scene arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + { + try + { + (*Plugin::GetUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(cppHandle))(arg0, arg1); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking UnityEngine::Events::UnityAction2"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } } } @@ -6005,6 +6985,10 @@ DLLEXPORT void Init( int32_t (*systemAppDomainSetupConstructor)(), int32_t (*systemAppDomainSetupPropertyGetAppDomainInitializer)(int32_t thisHandle), void (*systemAppDomainSetupPropertySetAppDomainInitializer)(int32_t thisHandle, int32_t valueHandle), + void (*unityEngineApplicationAddEventOnBeforeRender)(int32_t delHandle), + void (*unityEngineApplicationRemoveEventOnBeforeRender)(int32_t delHandle), + void (*unityEngineSceneManagementSceneManagerAddEventSceneLoaded)(int32_t delHandle), + void (*unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)(int32_t delHandle), int32_t (*systemInt32Array1Constructor1)(int32_t length0), int32_t (*systemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*systemInt32Array1SetItem1)(int32_t thisHandle, int32_t index0, int32_t item), @@ -6060,14 +7044,24 @@ DLLEXPORT void Init( void (*systemAppDomainInitializerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), void (*systemAppDomainInitializerInvoke)(int32_t thisHandle, int32_t argsHandle), void (*systemAppDomainInitializerAdd)(int32_t thisHandle, int32_t delHandle), - void (*systemAppDomainInitializerRemove)(int32_t thisHandle, int32_t delHandle) + void (*systemAppDomainInitializerRemove)(int32_t thisHandle, int32_t delHandle), + void (*releaseUnityEngineEventsUnityAction)(int32_t handle, int32_t classHandle), + void (*unityEngineEventsUnityActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), + void (*unityEngineEventsUnityActionInvoke)(int32_t thisHandle), + void (*unityEngineEventsUnityActionAdd)(int32_t thisHandle, int32_t delHandle), + void (*unityEngineEventsUnityActionRemove)(int32_t thisHandle, int32_t delHandle), + void (*releaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode)(int32_t handle, int32_t classHandle), + void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), + void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1), + void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)(int32_t thisHandle, int32_t delHandle), + void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle) /*END INIT PARAMS*/) { using namespace Plugin; // Init managed object ref counting Plugin::RefCountsLenClass = maxManagedObjects; - Plugin::RefCountsClass = new int32_t[maxManagedObjects]; + Plugin::RefCountsClass = new int32_t[maxManagedObjects](); // Init pointers to C# functions Plugin::StringNew = stringNew; @@ -6143,6 +7137,10 @@ DLLEXPORT void Init( Plugin::SystemAppDomainSetupConstructor = systemAppDomainSetupConstructor; Plugin::SystemAppDomainSetupPropertyGetAppDomainInitializer = systemAppDomainSetupPropertyGetAppDomainInitializer; Plugin::SystemAppDomainSetupPropertySetAppDomainInitializer = systemAppDomainSetupPropertySetAppDomainInitializer; + Plugin::UnityEngineApplicationAddEventOnBeforeRender = unityEngineApplicationAddEventOnBeforeRender; + Plugin::UnityEngineApplicationRemoveEventOnBeforeRender = unityEngineApplicationRemoveEventOnBeforeRender; + Plugin::UnityEngineSceneManagementSceneManagerAddEventSceneLoaded = unityEngineSceneManagementSceneManagerAddEventSceneLoaded; + Plugin::UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded = unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded; Plugin::SystemInt32Array1Constructor1 = systemInt32Array1Constructor1; Plugin::SystemInt32Array1GetItem1 = systemInt32Array1GetItem1; Plugin::SystemInt32Array1SetItem1 = systemInt32Array1SetItem1; @@ -6247,6 +7245,32 @@ DLLEXPORT void Init( Plugin::SystemAppDomainInitializerInvoke = systemAppDomainInitializerInvoke; Plugin::SystemAppDomainInitializerAdd = systemAppDomainInitializerAdd; Plugin::SystemAppDomainInitializerRemove = systemAppDomainInitializerRemove; + UnityEngineEventsUnityActionFreeListSize = maxManagedObjects; + UnityEngineEventsUnityActionFreeList = new UnityEngine::Events::UnityAction*[UnityEngineEventsUnityActionFreeListSize]; + for (int32_t i = 0, end = UnityEngineEventsUnityActionFreeListSize - 1; i < end; ++i) + { + UnityEngineEventsUnityActionFreeList[i] = (UnityEngine::Events::UnityAction*)(UnityEngineEventsUnityActionFreeList + i + 1); + } + UnityEngineEventsUnityActionFreeList[UnityEngineEventsUnityActionFreeListSize - 1] = nullptr; + NextFreeUnityEngineEventsUnityAction = UnityEngineEventsUnityActionFreeList + 1; + Plugin::ReleaseUnityEngineEventsUnityAction = releaseUnityEngineEventsUnityAction; + Plugin::UnityEngineEventsUnityActionConstructor = unityEngineEventsUnityActionConstructor; + Plugin::UnityEngineEventsUnityActionInvoke = unityEngineEventsUnityActionInvoke; + Plugin::UnityEngineEventsUnityActionAdd = unityEngineEventsUnityActionAdd; + Plugin::UnityEngineEventsUnityActionRemove = unityEngineEventsUnityActionRemove; + UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize = 10; + UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList = new UnityEngine::Events::UnityAction2*[UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize]; + for (int32_t i = 0, end = UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize - 1; i < end; ++i) + { + UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList[i] = (UnityEngine::Events::UnityAction2*)(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList + i + 1); + } + UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList[UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize - 1] = nullptr; + NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList + 1; + Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = releaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor; + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke; + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd; + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove; /*END INIT BODY*/ try diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 00a35e9..40a7f6d 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -481,6 +481,39 @@ namespace System struct AppDomainSetup; } +namespace UnityEngine +{ + struct Application; +} + +namespace UnityEngine +{ + namespace SceneManagement + { + struct SceneManager; + } +} + +namespace UnityEngine +{ + namespace SceneManagement + { + struct Scene; + } +} + +namespace UnityEngine +{ + namespace SceneManagement + { + enum struct LoadSceneMode : int32_t + { + Single = 0, + Additive = 1 + }; + } +} + namespace MyGame { namespace MonoBehaviours @@ -578,6 +611,30 @@ namespace System { struct AppDomainInitializer; } + +namespace UnityEngine +{ + namespace Events + { + struct UnityAction; + } +} + +namespace UnityEngine +{ + namespace Events + { + template struct UnityAction2; + } +} + +namespace UnityEngine +{ + namespace Events + { + template<> struct UnityAction2; + } +} /*END TYPE DECLARATIONS*/ /*BEGIN TYPE DEFINITIONS*/ @@ -1199,6 +1256,59 @@ namespace System }; } +namespace UnityEngine +{ + struct Application : System::Object + { + Application(std::nullptr_t n); + Application(Plugin::InternalUse iu, int32_t handle); + Application(const Application& other); + Application(Application&& other); + virtual ~Application(); + Application& operator=(const Application& other); + Application& operator=(std::nullptr_t other); + Application& operator=(Application&& other); + bool operator==(const Application& other) const; + bool operator!=(const Application& other) const; + static void AddOnBeforeRender(UnityEngine::Events::UnityAction del); + static void RemoveOnBeforeRender(UnityEngine::Events::UnityAction del); + }; +} + +namespace UnityEngine +{ + namespace SceneManagement + { + struct SceneManager : System::Object + { + SceneManager(std::nullptr_t n); + SceneManager(Plugin::InternalUse iu, int32_t handle); + SceneManager(const SceneManager& other); + SceneManager(SceneManager&& other); + virtual ~SceneManager(); + SceneManager& operator=(const SceneManager& other); + SceneManager& operator=(std::nullptr_t other); + SceneManager& operator=(SceneManager&& other); + bool operator==(const SceneManager& other) const; + bool operator!=(const SceneManager& other) const; + static void AddSceneLoaded(UnityEngine::Events::UnityAction2 del); + static void RemoveSceneLoaded(UnityEngine::Events::UnityAction2 del); + }; + } +} + +namespace UnityEngine +{ + namespace SceneManagement + { + struct Scene + { + Scene(); + int32_t m_Handle; + }; + } +} + namespace MyGame { namespace MonoBehaviours @@ -1544,4 +1654,58 @@ namespace System void operator-=(System::AppDomainInitializer& del); }; } + +namespace UnityEngine +{ + namespace Events + { + struct UnityAction : System::Object + { + UnityAction(std::nullptr_t n); + UnityAction(Plugin::InternalUse iu, int32_t handle); + UnityAction(const UnityAction& other); + UnityAction(UnityAction&& other); + virtual ~UnityAction(); + UnityAction& operator=(const UnityAction& other); + UnityAction& operator=(std::nullptr_t other); + UnityAction& operator=(UnityAction&& other); + bool operator==(const UnityAction& other) const; + bool operator!=(const UnityAction& other) const; + int32_t CppHandle; + int32_t ClassHandle; + UnityAction(); + void Invoke(); + virtual void operator()(); + void operator+=(UnityEngine::Events::UnityAction& del); + void operator-=(UnityEngine::Events::UnityAction& del); + }; + } +} + +namespace UnityEngine +{ + namespace Events + { + template<> struct UnityAction2 : System::Object + { + UnityAction2(std::nullptr_t n); + UnityAction2(Plugin::InternalUse iu, int32_t handle); + UnityAction2(const UnityAction2& other); + UnityAction2(UnityAction2&& other); + virtual ~UnityAction2(); + UnityAction2& operator=(const UnityAction2& other); + UnityAction2& operator=(std::nullptr_t other); + UnityAction2& operator=(UnityAction2&& other); + bool operator==(const UnityAction2& other) const; + bool operator!=(const UnityAction2& other) const; + int32_t CppHandle; + int32_t ClassHandle; + UnityAction2(); + void Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); + virtual void operator()(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); + void operator+=(UnityEngine::Events::UnityAction2& del); + void operator-=(UnityEngine::Events::UnityAction2& del); + }; + } +} /*END TYPE DEFINITIONS*/ From 4f60cb2f50433e186b87e57da72846b6bc4a9146 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 22 Oct 2017 21:10:37 -0700 Subject: [PATCH 32/95] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5713381..197278d 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ While IL2CPP transforms C# into C++ already, it generates a lot of overhead. The * Overloaded operators * Arrays (single- and multi-dimensional) * Delegates + * Events # Performance @@ -188,7 +189,6 @@ To configure the code generator, open `NativeScriptTypes.json` and notice the ex Note that the code generator does not support (yet): -* Events * Boxing and unboxing (e.g. boxing `int` to `object`, casting `object` to `int`) * `MonoBehaviour` contents (e.g. fields) except for "message" functions * `Array` methods (e.g. `IndexOf`) From 4b1bdeab543ba50a8e4e53ba2c415a6db9961812 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 29 Oct 2017 21:51:10 -0700 Subject: [PATCH 33/95] Support boxing and unboxing --- README.md | 8 +- Unity/Assets/NativeScript/Bindings.cs | 1307 ++++++++++++++++- .../NativeScript/Editor/GenerateBindings.cs | 416 +++++- Unity/CppSource/NativeScript/Bindings.cpp | 901 +++++++++++- Unity/CppSource/NativeScript/Bindings.h | 141 +- 5 files changed, 2684 insertions(+), 89 deletions(-) diff --git a/README.md b/README.md index 197278d..55006c6 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ This project aims to give you a viable alternative to C#. Scripting in C++ isn't * Low performance overhead * Easy integration with any Unity project * Fast compile, build, and code generation times +* Don't lose support from Unity Technologies # Reasons to Prefer C++ Over C# # @@ -94,12 +95,13 @@ While IL2CPP transforms C# into C++ already, it generates a lot of overhead. The * Arrays (single- and multi-dimensional) * Delegates * Events + * Boxing and unboxing (e.g. boxing `int` to `object`, casting `object` to `int`) # Performance -Most projects will see a net performance win by reducing garbage collection, eliminating IL2CPP overhead, and access to compiler intrinsics and assembly. Calls from C++ into C# incur a minor performance penalty, so if most of your code is calls to .NET APIs then you may experience a net performance loss. +Almost all projects will see a net performance win by reducing garbage collection, eliminating IL2CPP overhead, and access to compiler intrinsics and assembly. Calls from C++ into C# incur only a minor performance penalty. In the rare case that almost all of your code is calls to .NET APIs then you may experience a net performance loss. -For testing and benchmarks, see this [article](http://jacksondunstan.com/articles/3952). +[Testing and benchmarks article](http://jacksondunstan.com/articles/3952) # Project Structure @@ -189,9 +191,9 @@ To configure the code generator, open `NativeScriptTypes.json` and notice the ex Note that the code generator does not support (yet): -* Boxing and unboxing (e.g. boxing `int` to `object`, casting `object` to `int`) * `MonoBehaviour` contents (e.g. fields) except for "message" functions * `Array` methods (e.g. `IndexOf`) +* `string` methods (e.g. `Substring`) * Default parameters * Interfaces * `decimal` diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index be02899..1f6d2ca 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -303,16 +303,26 @@ delegate void InitDelegate( IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, IntPtr unityEngineVector3Methodop_UnaryNegationUnityEngineVector3, + IntPtr boxVector3, + IntPtr unboxVector3, IntPtr unityEngineMatrix4x4PropertyGetItem, IntPtr unityEngineMatrix4x4PropertySetItem, + IntPtr boxMatrix4x4, + IntPtr unboxMatrix4x4, IntPtr releaseUnityEngineRaycastHit, IntPtr unityEngineRaycastHitPropertyGetPoint, IntPtr unityEngineRaycastHitPropertySetPoint, IntPtr unityEngineRaycastHitPropertyGetTransform, + IntPtr boxRaycastHit, + IntPtr unboxRaycastHit, + IntPtr boxQueryTriggerInteraction, + IntPtr unboxQueryTriggerInteraction, IntPtr releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue, + IntPtr boxKeyValuePairSystemString_SystemDouble, + IntPtr unboxKeyValuePairSystemString_SystemDouble, IntPtr systemCollectionsGenericListSystemStringConstructor, IntPtr systemCollectionsGenericListSystemStringPropertyGetItem, IntPtr systemCollectionsGenericListSystemStringPropertySetItem, @@ -330,10 +340,18 @@ delegate void InitDelegate( IntPtr unityEngineResolutionPropertySetHeight, IntPtr unityEngineResolutionPropertyGetRefreshRate, IntPtr unityEngineResolutionPropertySetRefreshRate, + IntPtr boxResolution, + IntPtr unboxResolution, IntPtr unityEngineScreenPropertyGetResolutions, IntPtr unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3, + IntPtr boxRay, + IntPtr unboxRay, IntPtr unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit, IntPtr unityEnginePhysicsMethodRaycastAllUnityEngineRay, + IntPtr boxColor, + IntPtr unboxColor, + IntPtr boxGradientColorKey, + IntPtr unboxGradientColorKey, IntPtr unityEngineGradientConstructor, IntPtr unityEngineGradientPropertyGetColorKeys, IntPtr unityEngineGradientPropertySetColorKeys, @@ -344,6 +362,34 @@ delegate void InitDelegate( IntPtr unityEngineApplicationRemoveEventOnBeforeRender, IntPtr unityEngineSceneManagementSceneManagerAddEventSceneLoaded, IntPtr unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded, + IntPtr boxScene, + IntPtr unboxScene, + IntPtr boxLoadSceneMode, + IntPtr unboxLoadSceneMode, + IntPtr boxBoolean, + IntPtr unboxBoolean, + IntPtr boxSByte, + IntPtr unboxSByte, + IntPtr boxByte, + IntPtr unboxByte, + IntPtr boxInt16, + IntPtr unboxInt16, + IntPtr boxUInt16, + IntPtr unboxUInt16, + IntPtr boxInt32, + IntPtr unboxInt32, + IntPtr boxUInt32, + IntPtr unboxUInt32, + IntPtr boxInt64, + IntPtr unboxInt64, + IntPtr boxUInt64, + IntPtr unboxUInt64, + IntPtr boxChar, + IntPtr unboxChar, + IntPtr boxSingle, + IntPtr unboxSingle, + IntPtr boxDouble, + IntPtr unboxDouble, IntPtr systemInt32Array1Constructor1, IntPtr systemInt32Array1GetItem1, IntPtr systemInt32Array1SetItem1, @@ -581,16 +627,26 @@ static extern void Init( IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, IntPtr unityEngineVector3Methodop_UnaryNegationUnityEngineVector3, + IntPtr boxVector3, + IntPtr unboxVector3, IntPtr unityEngineMatrix4x4PropertyGetItem, IntPtr unityEngineMatrix4x4PropertySetItem, + IntPtr boxMatrix4x4, + IntPtr unboxMatrix4x4, IntPtr releaseUnityEngineRaycastHit, IntPtr unityEngineRaycastHitPropertyGetPoint, IntPtr unityEngineRaycastHitPropertySetPoint, IntPtr unityEngineRaycastHitPropertyGetTransform, + IntPtr boxRaycastHit, + IntPtr unboxRaycastHit, + IntPtr boxQueryTriggerInteraction, + IntPtr unboxQueryTriggerInteraction, IntPtr releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey, IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue, + IntPtr boxKeyValuePairSystemString_SystemDouble, + IntPtr unboxKeyValuePairSystemString_SystemDouble, IntPtr systemCollectionsGenericListSystemStringConstructor, IntPtr systemCollectionsGenericListSystemStringPropertyGetItem, IntPtr systemCollectionsGenericListSystemStringPropertySetItem, @@ -608,10 +664,18 @@ static extern void Init( IntPtr unityEngineResolutionPropertySetHeight, IntPtr unityEngineResolutionPropertyGetRefreshRate, IntPtr unityEngineResolutionPropertySetRefreshRate, + IntPtr boxResolution, + IntPtr unboxResolution, IntPtr unityEngineScreenPropertyGetResolutions, IntPtr unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3, + IntPtr boxRay, + IntPtr unboxRay, IntPtr unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit, IntPtr unityEnginePhysicsMethodRaycastAllUnityEngineRay, + IntPtr boxColor, + IntPtr unboxColor, + IntPtr boxGradientColorKey, + IntPtr unboxGradientColorKey, IntPtr unityEngineGradientConstructor, IntPtr unityEngineGradientPropertyGetColorKeys, IntPtr unityEngineGradientPropertySetColorKeys, @@ -622,6 +686,34 @@ static extern void Init( IntPtr unityEngineApplicationRemoveEventOnBeforeRender, IntPtr unityEngineSceneManagementSceneManagerAddEventSceneLoaded, IntPtr unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded, + IntPtr boxScene, + IntPtr unboxScene, + IntPtr boxLoadSceneMode, + IntPtr unboxLoadSceneMode, + IntPtr boxBoolean, + IntPtr unboxBoolean, + IntPtr boxSByte, + IntPtr unboxSByte, + IntPtr boxByte, + IntPtr unboxByte, + IntPtr boxInt16, + IntPtr unboxInt16, + IntPtr boxUInt16, + IntPtr unboxUInt16, + IntPtr boxInt32, + IntPtr unboxInt32, + IntPtr boxUInt32, + IntPtr unboxUInt32, + IntPtr boxInt64, + IntPtr unboxInt64, + IntPtr boxUInt64, + IntPtr unboxUInt64, + IntPtr boxChar, + IntPtr unboxChar, + IntPtr boxSingle, + IntPtr unboxSingle, + IntPtr boxDouble, + IntPtr unboxDouble, IntPtr systemInt32Array1Constructor1, IntPtr systemInt32Array1GetItem1, IntPtr systemInt32Array1SetItem1, @@ -770,16 +862,26 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc 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 int BoxVector3Delegate(ref UnityEngine.Vector3 val); + delegate UnityEngine.Vector3 UnboxVector3Delegate(int valHandle); 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 int BoxMatrix4x4Delegate(ref UnityEngine.Matrix4x4 val); + delegate UnityEngine.Matrix4x4 UnboxMatrix4x4Delegate(int valHandle); 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 int BoxRaycastHitDelegate(int valHandle); + delegate int UnboxRaycastHitDelegate(int valHandle); + delegate int BoxQueryTriggerInteractionDelegate(UnityEngine.QueryTriggerInteraction val); + delegate UnityEngine.QueryTriggerInteraction UnboxQueryTriggerInteractionDelegate(int valHandle); 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 BoxKeyValuePairSystemString_SystemDoubleDelegate(int valHandle); + delegate int UnboxKeyValuePairSystemString_SystemDoubleDelegate(int valHandle); delegate int SystemCollectionsGenericListSystemStringConstructorDelegate(); delegate int SystemCollectionsGenericListSystemStringPropertyGetItemDelegate(int thisHandle, int index); delegate void SystemCollectionsGenericListSystemStringPropertySetItemDelegate(int thisHandle, int index, int valueHandle); @@ -797,10 +899,18 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc 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 BoxResolutionDelegate(ref UnityEngine.Resolution val); + delegate UnityEngine.Resolution UnboxResolutionDelegate(int valHandle); delegate int UnityEngineScreenPropertyGetResolutionsDelegate(); delegate UnityEngine.Ray UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction); + delegate int BoxRayDelegate(ref UnityEngine.Ray val); + delegate UnityEngine.Ray UnboxRayDelegate(int valHandle); delegate int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitDelegate(ref UnityEngine.Ray ray, int resultsHandle); delegate int UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate(ref UnityEngine.Ray ray); + delegate int BoxColorDelegate(ref UnityEngine.Color val); + delegate UnityEngine.Color UnboxColorDelegate(int valHandle); + delegate int BoxGradientColorKeyDelegate(ref UnityEngine.GradientColorKey val); + delegate UnityEngine.GradientColorKey UnboxGradientColorKeyDelegate(int valHandle); delegate int UnityEngineGradientConstructorDelegate(); delegate int UnityEngineGradientPropertyGetColorKeysDelegate(int thisHandle); delegate void UnityEngineGradientPropertySetColorKeysDelegate(int thisHandle, int valueHandle); @@ -811,6 +921,34 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc delegate void UnityEngineApplicationRemoveEventOnBeforeRenderDelegate(int delHandle); delegate void UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate(int delHandle); delegate void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate(int delHandle); + delegate int BoxSceneDelegate(ref UnityEngine.SceneManagement.Scene val); + delegate UnityEngine.SceneManagement.Scene UnboxSceneDelegate(int valHandle); + delegate int BoxLoadSceneModeDelegate(UnityEngine.SceneManagement.LoadSceneMode val); + delegate UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneModeDelegate(int valHandle); + delegate int BoxBooleanDelegate(bool val); + delegate bool UnboxBooleanDelegate(int valHandle); + delegate int BoxSByteDelegate(sbyte val); + delegate sbyte UnboxSByteDelegate(int valHandle); + delegate int BoxByteDelegate(byte val); + delegate byte UnboxByteDelegate(int valHandle); + delegate int BoxInt16Delegate(short val); + delegate short UnboxInt16Delegate(int valHandle); + delegate int BoxUInt16Delegate(ushort val); + delegate ushort UnboxUInt16Delegate(int valHandle); + delegate int BoxInt32Delegate(int val); + delegate int UnboxInt32Delegate(int valHandle); + delegate int BoxUInt32Delegate(uint val); + delegate uint UnboxUInt32Delegate(int valHandle); + delegate int BoxInt64Delegate(long val); + delegate long UnboxInt64Delegate(int valHandle); + delegate int BoxUInt64Delegate(ulong val); + delegate ulong UnboxUInt64Delegate(int valHandle); + delegate int BoxCharDelegate(char val); + delegate char UnboxCharDelegate(int valHandle); + delegate int BoxSingleDelegate(float val); + delegate float UnboxSingleDelegate(int valHandle); + delegate int BoxDoubleDelegate(double val); + delegate double UnboxDoubleDelegate(int valHandle); delegate int SystemInt32Array1Constructor1Delegate(int length0); delegate int SystemInt32Array1GetItem1Delegate(int thisHandle, int index0); delegate void SystemInt32Array1SetItem1Delegate(int thisHandle, int index0, int item); @@ -965,16 +1103,26 @@ public static void Open( 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 BoxVector3Delegate(BoxVector3)), + Marshal.GetFunctionPointerForDelegate(new UnboxVector3Delegate(UnboxVector3)), Marshal.GetFunctionPointerForDelegate(new UnityEngineMatrix4x4PropertyGetItemDelegate(UnityEngineMatrix4x4PropertyGetItem)), Marshal.GetFunctionPointerForDelegate(new UnityEngineMatrix4x4PropertySetItemDelegate(UnityEngineMatrix4x4PropertySetItem)), + Marshal.GetFunctionPointerForDelegate(new BoxMatrix4x4Delegate(BoxMatrix4x4)), + Marshal.GetFunctionPointerForDelegate(new UnboxMatrix4x4Delegate(UnboxMatrix4x4)), Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineRaycastHitDelegate(ReleaseUnityEngineRaycastHit)), Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetPointDelegate(UnityEngineRaycastHitPropertyGetPoint)), Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertySetPointDelegate(UnityEngineRaycastHitPropertySetPoint)), Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetTransformDelegate(UnityEngineRaycastHitPropertyGetTransform)), + Marshal.GetFunctionPointerForDelegate(new BoxRaycastHitDelegate(BoxRaycastHit)), + Marshal.GetFunctionPointerForDelegate(new UnboxRaycastHitDelegate(UnboxRaycastHit)), + Marshal.GetFunctionPointerForDelegate(new BoxQueryTriggerInteractionDelegate(BoxQueryTriggerInteraction)), + Marshal.GetFunctionPointerForDelegate(new UnboxQueryTriggerInteractionDelegate(UnboxQueryTriggerInteraction)), 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 BoxKeyValuePairSystemString_SystemDoubleDelegate(BoxKeyValuePairSystemString_SystemDouble)), + Marshal.GetFunctionPointerForDelegate(new UnboxKeyValuePairSystemString_SystemDoubleDelegate(UnboxKeyValuePairSystemString_SystemDouble)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringConstructorDelegate(SystemCollectionsGenericListSystemStringConstructor)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringPropertyGetItemDelegate(SystemCollectionsGenericListSystemStringPropertyGetItem)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringPropertySetItemDelegate(SystemCollectionsGenericListSystemStringPropertySetItem)), @@ -992,10 +1140,18 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertySetHeightDelegate(UnityEngineResolutionPropertySetHeight)), Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertyGetRefreshRateDelegate(UnityEngineResolutionPropertyGetRefreshRate)), Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertySetRefreshRateDelegate(UnityEngineResolutionPropertySetRefreshRate)), + Marshal.GetFunctionPointerForDelegate(new BoxResolutionDelegate(BoxResolution)), + Marshal.GetFunctionPointerForDelegate(new UnboxResolutionDelegate(UnboxResolution)), Marshal.GetFunctionPointerForDelegate(new UnityEngineScreenPropertyGetResolutionsDelegate(UnityEngineScreenPropertyGetResolutions)), Marshal.GetFunctionPointerForDelegate(new UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)), + Marshal.GetFunctionPointerForDelegate(new BoxRayDelegate(BoxRay)), + Marshal.GetFunctionPointerForDelegate(new UnboxRayDelegate(UnboxRay)), Marshal.GetFunctionPointerForDelegate(new UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitDelegate(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)), Marshal.GetFunctionPointerForDelegate(new UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate(UnityEnginePhysicsMethodRaycastAllUnityEngineRay)), + Marshal.GetFunctionPointerForDelegate(new BoxColorDelegate(BoxColor)), + Marshal.GetFunctionPointerForDelegate(new UnboxColorDelegate(UnboxColor)), + Marshal.GetFunctionPointerForDelegate(new BoxGradientColorKeyDelegate(BoxGradientColorKey)), + Marshal.GetFunctionPointerForDelegate(new UnboxGradientColorKeyDelegate(UnboxGradientColorKey)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientConstructorDelegate(UnityEngineGradientConstructor)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientPropertyGetColorKeysDelegate(UnityEngineGradientPropertyGetColorKeys)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientPropertySetColorKeysDelegate(UnityEngineGradientPropertySetColorKeys)), @@ -1006,6 +1162,34 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnityEngineApplicationRemoveEventOnBeforeRenderDelegate(UnityEngineApplicationRemoveEventOnBeforeRender)), Marshal.GetFunctionPointerForDelegate(new UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate(UnityEngineSceneManagementSceneManagerAddEventSceneLoaded)), Marshal.GetFunctionPointerForDelegate(new UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate(UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)), + Marshal.GetFunctionPointerForDelegate(new BoxSceneDelegate(BoxScene)), + Marshal.GetFunctionPointerForDelegate(new UnboxSceneDelegate(UnboxScene)), + Marshal.GetFunctionPointerForDelegate(new BoxLoadSceneModeDelegate(BoxLoadSceneMode)), + Marshal.GetFunctionPointerForDelegate(new UnboxLoadSceneModeDelegate(UnboxLoadSceneMode)), + Marshal.GetFunctionPointerForDelegate(new BoxBooleanDelegate(BoxBoolean)), + Marshal.GetFunctionPointerForDelegate(new UnboxBooleanDelegate(UnboxBoolean)), + Marshal.GetFunctionPointerForDelegate(new BoxSByteDelegate(BoxSByte)), + Marshal.GetFunctionPointerForDelegate(new UnboxSByteDelegate(UnboxSByte)), + Marshal.GetFunctionPointerForDelegate(new BoxByteDelegate(BoxByte)), + Marshal.GetFunctionPointerForDelegate(new UnboxByteDelegate(UnboxByte)), + Marshal.GetFunctionPointerForDelegate(new BoxInt16Delegate(BoxInt16)), + Marshal.GetFunctionPointerForDelegate(new UnboxInt16Delegate(UnboxInt16)), + Marshal.GetFunctionPointerForDelegate(new BoxUInt16Delegate(BoxUInt16)), + Marshal.GetFunctionPointerForDelegate(new UnboxUInt16Delegate(UnboxUInt16)), + Marshal.GetFunctionPointerForDelegate(new BoxInt32Delegate(BoxInt32)), + Marshal.GetFunctionPointerForDelegate(new UnboxInt32Delegate(UnboxInt32)), + Marshal.GetFunctionPointerForDelegate(new BoxUInt32Delegate(BoxUInt32)), + Marshal.GetFunctionPointerForDelegate(new UnboxUInt32Delegate(UnboxUInt32)), + Marshal.GetFunctionPointerForDelegate(new BoxInt64Delegate(BoxInt64)), + Marshal.GetFunctionPointerForDelegate(new UnboxInt64Delegate(UnboxInt64)), + Marshal.GetFunctionPointerForDelegate(new BoxUInt64Delegate(BoxUInt64)), + Marshal.GetFunctionPointerForDelegate(new UnboxUInt64Delegate(UnboxUInt64)), + Marshal.GetFunctionPointerForDelegate(new BoxCharDelegate(BoxChar)), + Marshal.GetFunctionPointerForDelegate(new UnboxCharDelegate(UnboxChar)), + Marshal.GetFunctionPointerForDelegate(new BoxSingleDelegate(BoxSingle)), + Marshal.GetFunctionPointerForDelegate(new UnboxSingleDelegate(UnboxSingle)), + Marshal.GetFunctionPointerForDelegate(new BoxDoubleDelegate(BoxDouble)), + Marshal.GetFunctionPointerForDelegate(new UnboxDoubleDelegate(UnboxDouble)), Marshal.GetFunctionPointerForDelegate(new SystemInt32Array1Constructor1Delegate(SystemInt32Array1Constructor1)), Marshal.GetFunctionPointerForDelegate(new SystemInt32Array1GetItem1Delegate(SystemInt32Array1GetItem1)), Marshal.GetFunctionPointerForDelegate(new SystemInt32Array1SetItem1Delegate(SystemInt32Array1SetItem1)), @@ -1737,6 +1921,51 @@ static UnityEngine.Vector3 UnityEngineVector3Methodop_UnaryNegationUnityEngineVe } } + [MonoPInvokeCallback(typeof(BoxVector3Delegate))] + static int BoxVector3(ref UnityEngine.Vector3 val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxVector3Delegate))] + static UnityEngine.Vector3 UnboxVector3(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Vector3)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } + } + [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertyGetItemDelegate))] static float UnityEngineMatrix4x4PropertyGetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column) { @@ -1778,6 +2007,51 @@ static void UnityEngineMatrix4x4PropertySetItem(ref UnityEngine.Matrix4x4 thiz, } } + [MonoPInvokeCallback(typeof(BoxMatrix4x4Delegate))] + static int BoxMatrix4x4(ref UnityEngine.Matrix4x4 val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxMatrix4x4Delegate))] + static UnityEngine.Matrix4x4 UnboxMatrix4x4(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Matrix4x4)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Matrix4x4); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Matrix4x4); + } + } + [MonoPInvokeCallback(typeof(ReleaseUnityEngineRaycastHitDelegate))] static void ReleaseUnityEngineRaycastHit(int handle) { @@ -1867,6 +2141,97 @@ static int UnityEngineRaycastHitPropertyGetTransform(int thisHandle) } } + [MonoPInvokeCallback(typeof(BoxRaycastHitDelegate))] + static int BoxRaycastHit(int valHandle) + { + try + { + var val = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxRaycastHitDelegate))] + static int UnboxRaycastHit(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.RaycastHit)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(BoxQueryTriggerInteractionDelegate))] + static int BoxQueryTriggerInteraction(UnityEngine.QueryTriggerInteraction val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxQueryTriggerInteractionDelegate))] + static UnityEngine.QueryTriggerInteraction UnboxQueryTriggerInteraction(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.QueryTriggerInteraction)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.QueryTriggerInteraction); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.QueryTriggerInteraction); + } + } + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate))] static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int handle) { @@ -1958,6 +2323,52 @@ static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePrope } } + [MonoPInvokeCallback(typeof(BoxKeyValuePairSystemString_SystemDoubleDelegate))] + static int BoxKeyValuePairSystemString_SystemDouble(int valHandle) + { + try + { + var val = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxKeyValuePairSystemString_SystemDoubleDelegate))] + static int UnboxKeyValuePairSystemString_SystemDouble(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore>.Store((System.Collections.Generic.KeyValuePair)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringConstructorDelegate))] static int SystemCollectionsGenericListSystemStringConstructor() { @@ -2325,13 +2736,13 @@ static void UnityEngineResolutionPropertySetRefreshRate(ref UnityEngine.Resoluti } } - [MonoPInvokeCallback(typeof(UnityEngineScreenPropertyGetResolutionsDelegate))] - static int UnityEngineScreenPropertyGetResolutions() + [MonoPInvokeCallback(typeof(BoxResolutionDelegate))] + static int BoxResolution(ref UnityEngine.Resolution val) { try { - var returnValue = UnityEngine.Screen.resolutions; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -2347,36 +2758,36 @@ static int UnityEngineScreenPropertyGetResolutions() } } - [MonoPInvokeCallback(typeof(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate))] - static UnityEngine.Ray UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction) + [MonoPInvokeCallback(typeof(UnboxResolutionDelegate))] + static UnityEngine.Resolution UnboxResolution(int valHandle) { try { - var returnValue = new UnityEngine.Ray(origin, direction); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Resolution)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Ray); + return default(UnityEngine.Resolution); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Ray); + return default(UnityEngine.Resolution); } } - [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitDelegate))] - static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit(ref UnityEngine.Ray ray, int resultsHandle) + [MonoPInvokeCallback(typeof(UnityEngineScreenPropertyGetResolutionsDelegate))] + static int UnityEngineScreenPropertyGetResolutions() { try { - var results = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(resultsHandle); - var returnValue = UnityEngine.Physics.RaycastNonAlloc(ray, results); - return returnValue; + var returnValue = UnityEngine.Screen.resolutions; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -2392,34 +2803,34 @@ static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRayc } } - [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate))] - static int UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ref UnityEngine.Ray ray) + [MonoPInvokeCallback(typeof(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate))] + static UnityEngine.Ray UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction) { try { - var returnValue = UnityEngine.Physics.RaycastAll(ray); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = new UnityEngine.Ray(origin, direction); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Ray); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Ray); } } - [MonoPInvokeCallback(typeof(UnityEngineGradientConstructorDelegate))] - static int UnityEngineGradientConstructor() + [MonoPInvokeCallback(typeof(BoxRayDelegate))] + static int BoxRay(ref UnityEngine.Ray val) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.Gradient()); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } catch (System.NullReferenceException ex) @@ -2436,57 +2847,59 @@ static int UnityEngineGradientConstructor() } } - [MonoPInvokeCallback(typeof(UnityEngineGradientPropertyGetColorKeysDelegate))] - static int UnityEngineGradientPropertyGetColorKeys(int thisHandle) + [MonoPInvokeCallback(typeof(UnboxRayDelegate))] + static UnityEngine.Ray UnboxRay(int valHandle) { try { - var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.colorKeys; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Ray)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Ray); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Ray); } } - [MonoPInvokeCallback(typeof(UnityEngineGradientPropertySetColorKeysDelegate))] - static void UnityEngineGradientPropertySetColorKeys(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitDelegate))] + static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit(ref UnityEngine.Ray ray, int resultsHandle) { try { - var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.colorKeys = value; + var results = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(resultsHandle); + var returnValue = UnityEngine.Physics.RaycastNonAlloc(ray, results); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemAppDomainSetupConstructorDelegate))] - static int SystemAppDomainSetupConstructor() + [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate))] + static int UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ref UnityEngine.Ray ray) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.AppDomainSetup()); - return returnValue; + var returnValue = UnityEngine.Physics.RaycastAll(ray); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -2502,13 +2915,191 @@ static int SystemAppDomainSetupConstructor() } } - [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertyGetAppDomainInitializerDelegate))] - static int SystemAppDomainSetupPropertyGetAppDomainInitializer(int thisHandle) + [MonoPInvokeCallback(typeof(BoxColorDelegate))] + static int BoxColor(ref UnityEngine.Color val) { try { - var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.AppDomainInitializer; + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxColorDelegate))] + static UnityEngine.Color UnboxColor(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Color)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Color); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Color); + } + } + + [MonoPInvokeCallback(typeof(BoxGradientColorKeyDelegate))] + static int BoxGradientColorKey(ref UnityEngine.GradientColorKey val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxGradientColorKeyDelegate))] + static UnityEngine.GradientColorKey UnboxGradientColorKey(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.GradientColorKey)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.GradientColorKey); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.GradientColorKey); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGradientConstructorDelegate))] + static int UnityEngineGradientConstructor() + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.Gradient()); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGradientPropertyGetColorKeysDelegate))] + static int UnityEngineGradientPropertyGetColorKeys(int thisHandle) + { + try + { + var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.colorKeys; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGradientPropertySetColorKeysDelegate))] + static void UnityEngineGradientPropertySetColorKeys(int thisHandle, int valueHandle) + { + try + { + var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.colorKeys = value; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemAppDomainSetupConstructorDelegate))] + static int SystemAppDomainSetupConstructor() + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.AppDomainSetup()); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertyGetAppDomainInitializerDelegate))] + static int SystemAppDomainSetupPropertyGetAppDomainInitializer(int thisHandle) + { + try + { + var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.AppDomainInitializer; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) @@ -2626,6 +3217,636 @@ static void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(int del } } + [MonoPInvokeCallback(typeof(BoxSceneDelegate))] + static int BoxScene(ref UnityEngine.SceneManagement.Scene val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxSceneDelegate))] + static UnityEngine.SceneManagement.Scene UnboxScene(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.SceneManagement.Scene)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.SceneManagement.Scene); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.SceneManagement.Scene); + } + } + + [MonoPInvokeCallback(typeof(BoxLoadSceneModeDelegate))] + static int BoxLoadSceneMode(UnityEngine.SceneManagement.LoadSceneMode val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxLoadSceneModeDelegate))] + static UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneMode(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.SceneManagement.LoadSceneMode)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.SceneManagement.LoadSceneMode); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.SceneManagement.LoadSceneMode); + } + } + + [MonoPInvokeCallback(typeof(BoxBooleanDelegate))] + static int BoxBoolean(bool val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxBooleanDelegate))] + static bool UnboxBoolean(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (bool)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } + } + + [MonoPInvokeCallback(typeof(BoxSByteDelegate))] + static int BoxSByte(sbyte val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxSByteDelegate))] + static sbyte UnboxSByte(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (sbyte)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(sbyte); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(sbyte); + } + } + + [MonoPInvokeCallback(typeof(BoxByteDelegate))] + static int BoxByte(byte val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxByteDelegate))] + static byte UnboxByte(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (byte)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(byte); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(byte); + } + } + + [MonoPInvokeCallback(typeof(BoxInt16Delegate))] + static int BoxInt16(short val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxInt16Delegate))] + static short UnboxInt16(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (short)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(short); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(short); + } + } + + [MonoPInvokeCallback(typeof(BoxUInt16Delegate))] + static int BoxUInt16(ushort val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxUInt16Delegate))] + static ushort UnboxUInt16(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (ushort)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(ushort); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(ushort); + } + } + + [MonoPInvokeCallback(typeof(BoxInt32Delegate))] + static int BoxInt32(int val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxInt32Delegate))] + static int UnboxInt32(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (int)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(BoxUInt32Delegate))] + static int BoxUInt32(uint val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxUInt32Delegate))] + static uint UnboxUInt32(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (uint)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(uint); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(uint); + } + } + + [MonoPInvokeCallback(typeof(BoxInt64Delegate))] + static int BoxInt64(long val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxInt64Delegate))] + static long UnboxInt64(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (long)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(long); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(long); + } + } + + [MonoPInvokeCallback(typeof(BoxUInt64Delegate))] + static int BoxUInt64(ulong val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxUInt64Delegate))] + static ulong UnboxUInt64(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (ulong)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(ulong); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(ulong); + } + } + + [MonoPInvokeCallback(typeof(BoxCharDelegate))] + static int BoxChar(char val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxCharDelegate))] + static char UnboxChar(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (char)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(char); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(char); + } + } + + [MonoPInvokeCallback(typeof(BoxSingleDelegate))] + static int BoxSingle(float val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxSingleDelegate))] + static float UnboxSingle(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (float)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + } + + [MonoPInvokeCallback(typeof(BoxDoubleDelegate))] + static int BoxDouble(double val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxDoubleDelegate))] + static double UnboxDouble(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (double)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(double); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(double); + } + } + [MonoPInvokeCallback(typeof(SystemInt32Array1Constructor1Delegate))] static int SystemInt32Array1Constructor1(int length0) { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 531b981..a17c733 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -164,6 +164,8 @@ class StringBuilders new StringBuilder(InitialStringBuilderCapacity); public StringBuilder CppGlobalStateAndFunctions = new StringBuilder(InitialStringBuilderCapacity); + public StringBuilder CppBoxingMethodDeclarations = + new StringBuilder(InitialStringBuilderCapacity); public StringBuilder TempStrBuilder = new StringBuilder(InitialStringBuilderCapacity); } @@ -308,6 +310,21 @@ public MessageInfo( new MessageInfo("Update"), }; + private static readonly Type[] PRIMITIVE_TYPES = new [] { + typeof(bool), + typeof(sbyte), + typeof(byte), + typeof(short), + typeof(ushort), + typeof(int), + typeof(uint), + typeof(long), + typeof(ulong), + typeof(char), + typeof(float), + typeof(double), + }; + const string PostCompileWorkPref = "NativeScriptGenerateBindingsPostCompileWork"; const string DryRunPref = "NativeScriptGenerateBindingsDryRun"; @@ -513,6 +530,17 @@ static void DoPostCompileWork(bool canRefreshAssetDb) builders); } + // Generate boxing and unboxing for primitive types + foreach (Type type in PRIMITIVE_TYPES) + { + AppendBoxingUnboxing( + type, + TypeKind.Primitive, + null, + assemblies, + builders); + } + // Generate MonoBehaviours if (doc.MonoBehaviours != null) { @@ -1147,12 +1175,19 @@ static void AppendType( StringBuilders builders) { Type type = GetType(jsonType.Name, assemblies); - if (type.IsEnum) + TypeKind typeKind = GetTypeKind(type); + if (typeKind == TypeKind.Enum) { AppendEnum( type, assemblies, builders); + AppendBoxingUnboxing( + type, + typeKind, + null, + assemblies, + builders); } else { @@ -1188,6 +1223,15 @@ static void AppendType( maxSimultaneous, assemblies, builders); + if (typeKind != TypeKind.Class) + { + AppendBoxingUnboxing( + genericType, + typeKind, + typeParams, + assemblies, + builders); + } } } else @@ -1203,6 +1247,15 @@ static void AppendType( maxSimultaneous, assemblies, builders); + if (typeKind != TypeKind.Class) + { + AppendBoxingUnboxing( + type, + typeKind, + null, + assemblies, + builders); + } } } } @@ -1653,6 +1706,362 @@ static void AppendEnum( builders.CppTypeDeclarations.Append('\n'); } + static void AppendBoxingUnboxing( + Type type, + TypeKind typeKind, + Type[] typeParams, + Assembly[] assemblies, + StringBuilders builders) + { + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("Box"); + AppendTypeNameWithoutSuffixes( + type.Name, + builders.TempStrBuilder); + AppendTypeNames( + typeParams, + builders.TempStrBuilder); + string boxFuncName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string boxFuncNameLower = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("Unbox"); + AppendTypeNameWithoutSuffixes( + type.Name, + builders.TempStrBuilder); + AppendTypeNames( + typeParams, + builders.TempStrBuilder); + string unboxFuncName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string unboxFuncNameLower = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("operator "); + AppendCppTypeName( + type, + builders.TempStrBuilder); + string unboxMethodDefinitionName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("explicit "); + builders.TempStrBuilder.Append(unboxMethodDefinitionName); + string unboxMethodDeclarationName = builders.TempStrBuilder.ToString(); + + ParameterInfo[] boxParams = new [] { + new ParameterInfo + { + Name = "val", + ParameterType = type, + DereferencedParameterType = type, + IsOut = false, + IsRef = false, + Kind = typeKind + } + }; + + ParameterInfo[] unboxParams = new [] { + new ParameterInfo + { + Name = "val", + ParameterType = typeof(object), + DereferencedParameterType = typeof(object), + IsOut = false, + IsRef = false, + Kind = TypeKind.Class + } + }; + + ParameterInfo[] unboxCppParams = new ParameterInfo[0]; + + // C# init params + AppendCsharpInitParam( + boxFuncNameLower, + builders.CsharpInitParams); + AppendCsharpInitParam( + unboxFuncNameLower, + builders.CsharpInitParams); + + // C# delegate types + AppendCsharpDelegateType( + boxFuncName, + true, + type, + typeKind, + typeof(object), + boxParams, + builders.CsharpDelegateTypes); + AppendCsharpDelegateType( + unboxFuncName, + true, + type, + typeKind, + type, + unboxParams, + builders.CsharpDelegateTypes); + + // C# init call args + AppendCsharpInitCallArg( + boxFuncName, + builders.CsharpInitCall); + AppendCsharpInitCallArg( + unboxFuncName, + builders.CsharpInitCall); + + // C# box function + AppendCsharpFunctionBeginning( + typeof(object), + boxFuncName, + true, + TypeKind.Class, + typeof(object), + typeParams, + boxParams, + builders.CsharpFunctions); + builders.CsharpFunctions.Append( + "NativeScript.Bindings.ObjectStore.Store((object)val);"); + AppendCsharpFunctionReturn( + boxParams, + typeof(object), + TypeKind.Class, + null, + true, + builders.CsharpFunctions); + + // C# unbox function + AppendCsharpFunctionBeginning( + typeof(object), + unboxFuncName, + true, + TypeKind.Class, + type, + null, + unboxParams, + builders.CsharpFunctions); + switch (typeKind) + { + case TypeKind.Class: + case TypeKind.ManagedStruct: + AppendHandleStoreTypeName( + type, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(".Store(("); + AppendCsharpTypeName( + type, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(")val);"); + break; + default: + builders.CsharpFunctions.Append('('); + AppendCsharpTypeName( + type, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(")val;"); + break; + } + AppendCsharpFunctionReturn( + unboxParams, + type, + typeKind, + null, + true, + builders.CsharpFunctions); + + // C++ function pointers + AppendCppFunctionPointerDefinition( + boxFuncName, + true, + type.Name, + type.Namespace, + typeKind, + boxParams, + typeof(object), + builders.CppFunctionPointers); + AppendCppFunctionPointerDefinition( + unboxFuncName, + true, + type.Name, + type.Namespace, + typeKind, + unboxParams, + type, + builders.CppFunctionPointers); + + // C++ method declarations + AppendIndent( + 2, + builders.CppBoxingMethodDeclarations); + AppendCppMethodDeclaration( + "Object", + false, + false, + false, + null, + null, + boxParams, + builders.CppBoxingMethodDeclarations); + AppendIndent( + 2, + builders.CppBoxingMethodDeclarations); + AppendCppMethodDeclaration( + unboxMethodDeclarationName, + false, + false, + false, + null, + null, + unboxCppParams, + builders.CppBoxingMethodDeclarations); + + // C++ method definitions (begin) + int indent = AppendNamespaceBeginning( + "System", + builders.CppMethodDefinitions); + + // C++ box method definition + AppendCppMethodDefinitionBegin( + "Object", + null, + "Object", + null, + null, + boxParams, + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("int32_t handle = Plugin::"); + builders.CppMethodDefinitions.Append(boxFuncName); + builders.CppMethodDefinitions.Append("(val"); + if (typeKind == TypeKind.ManagedStruct) + { + builders.CppMethodDefinitions.Append(".Handle"); + } + builders.CppMethodDefinitions.Append(");\n"); + AppendCppUnhandledExceptionHandling( + indent + 1, + builders.CppMethodDefinitions); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "if (handle)\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "{\n"); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + AppendReferenceManagedHandleFunctionCall( + "Object", + "System", + TypeKind.Class, + null, + "handle", + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(";\n"); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Handle = handle;\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n\t\n"); + + // C++ unbox method definition + AppendCppMethodDefinitionBegin( + "Object", + null, + unboxMethodDefinitionName, + null, + null, + unboxCppParams, + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + AppendCppTypeName( + type, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(" returnVal("); + if (typeKind == TypeKind.ManagedStruct) + { + builders.CppMethodDefinitions.Append("Plugin::InternalUse::Only, "); + } + builders.CppMethodDefinitions.Append("Plugin::"); + builders.CppMethodDefinitions.Append(unboxFuncName); + builders.CppMethodDefinitions.Append("(Handle));\n"); + AppendCppUnhandledExceptionHandling( + indent + 1, + builders.CppMethodDefinitions); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("return returnVal;\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n\t\n"); + + // C++ method definitions (end) + AppendCppMethodDefinitionsEnd( + indent, + builders.CppMethodDefinitions); + + // C++ init params + AppendCppInitParam( + boxFuncNameLower, + true, + type.Name, + type.Namespace, + typeKind, + boxParams, + typeof(object), + builders.CppInitParams); + AppendCppInitParam( + unboxFuncNameLower, + true, + type.Name, + type.Namespace, + typeKind, + unboxParams, + type, + builders.CppInitParams); + + // C++ init body + AppendCppInitBody( + boxFuncName, + boxFuncNameLower, + builders.CppInitBody); + AppendCppInitBody( + unboxFuncName, + unboxFuncNameLower, + builders.CppInitBody); + } + static void AppendHandleStoreTypeName( Type type, StringBuilder output) @@ -9491,6 +9900,11 @@ static void InjectBuilders( "/*BEGIN GLOBAL STATE AND FUNCTIONS*/\n", "\n\t/*END GLOBAL STATE AND FUNCTIONS*/", builders.CppGlobalStateAndFunctions.ToString()); + cppHeaderContents = InjectIntoString( + cppHeaderContents, + "*BEGIN BOXING METHOD DECLARATIONS*/\n", + "\n\t\t/*END BOXING METHOD DECLARATIONS*/", + builders.CppBoxingMethodDeclarations.ToString()); File.WriteAllText(CsharpPath, csharpContents); File.WriteAllText(CppHeaderPath, cppHeaderContents); diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 53e97e8..79cdce3 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -69,16 +69,26 @@ namespace Plugin void (*UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ); UnityEngine::Vector3 (*UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b); UnityEngine::Vector3 (*UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a); + int32_t (*BoxVector3)(UnityEngine::Vector3& val); + UnityEngine::Vector3 (*UnboxVector3)(int32_t valHandle); float (*UnityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column); void (*UnityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value); + int32_t (*BoxMatrix4x4)(UnityEngine::Matrix4x4& val); + UnityEngine::Matrix4x4 (*UnboxMatrix4x4)(int32_t valHandle); void (*ReleaseUnityEngineRaycastHit)(int32_t handle); UnityEngine::Vector3 (*UnityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle); void (*UnityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value); int32_t (*UnityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle); + int32_t (*BoxRaycastHit)(int32_t valHandle); + int32_t (*UnboxRaycastHit)(int32_t valHandle); + int32_t (*BoxQueryTriggerInteraction)(UnityEngine::QueryTriggerInteraction val); + UnityEngine::QueryTriggerInteraction (*UnboxQueryTriggerInteraction)(int32_t valHandle); void (*ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)(int32_t handle); int32_t (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble)(int32_t keyHandle, double value); int32_t (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)(int32_t thisHandle); double (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle); + int32_t (*BoxKeyValuePairSystemString_SystemDouble)(int32_t valHandle); + int32_t (*UnboxKeyValuePairSystemString_SystemDouble)(int32_t valHandle); int32_t (*SystemCollectionsGenericListSystemStringConstructor)(); int32_t (*SystemCollectionsGenericListSystemStringPropertyGetItem)(int32_t thisHandle, int32_t index); void (*SystemCollectionsGenericListSystemStringPropertySetItem)(int32_t thisHandle, int32_t index, int32_t valueHandle); @@ -96,10 +106,18 @@ namespace Plugin void (*UnityEngineResolutionPropertySetHeight)(UnityEngine::Resolution* thiz, int32_t value); int32_t (*UnityEngineResolutionPropertyGetRefreshRate)(UnityEngine::Resolution* thiz); void (*UnityEngineResolutionPropertySetRefreshRate)(UnityEngine::Resolution* thiz, int32_t value); + int32_t (*BoxResolution)(UnityEngine::Resolution& val); + UnityEngine::Resolution (*UnboxResolution)(int32_t valHandle); int32_t (*UnityEngineScreenPropertyGetResolutions)(); UnityEngine::Ray (*UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); + int32_t (*BoxRay)(UnityEngine::Ray& val); + UnityEngine::Ray (*UnboxRay)(int32_t valHandle); int32_t (*UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)(UnityEngine::Ray& ray, int32_t resultsHandle); int32_t (*UnityEnginePhysicsMethodRaycastAllUnityEngineRay)(UnityEngine::Ray& ray); + int32_t (*BoxColor)(UnityEngine::Color& val); + UnityEngine::Color (*UnboxColor)(int32_t valHandle); + int32_t (*BoxGradientColorKey)(UnityEngine::GradientColorKey& val); + UnityEngine::GradientColorKey (*UnboxGradientColorKey)(int32_t valHandle); int32_t (*UnityEngineGradientConstructor)(); int32_t (*UnityEngineGradientPropertyGetColorKeys)(int32_t thisHandle); void (*UnityEngineGradientPropertySetColorKeys)(int32_t thisHandle, int32_t valueHandle); @@ -110,6 +128,34 @@ namespace Plugin void (*UnityEngineApplicationRemoveEventOnBeforeRender)(int32_t delHandle); void (*UnityEngineSceneManagementSceneManagerAddEventSceneLoaded)(int32_t delHandle); void (*UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)(int32_t delHandle); + int32_t (*BoxScene)(UnityEngine::SceneManagement::Scene& val); + UnityEngine::SceneManagement::Scene (*UnboxScene)(int32_t valHandle); + int32_t (*BoxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val); + UnityEngine::SceneManagement::LoadSceneMode (*UnboxLoadSceneMode)(int32_t valHandle); + int32_t (*BoxBoolean)(System::Boolean val); + System::Boolean (*UnboxBoolean)(int32_t valHandle); + int32_t (*BoxSByte)(int8_t val); + int8_t (*UnboxSByte)(int32_t valHandle); + int32_t (*BoxByte)(uint8_t val); + uint8_t (*UnboxByte)(int32_t valHandle); + int32_t (*BoxInt16)(int16_t val); + int16_t (*UnboxInt16)(int32_t valHandle); + int32_t (*BoxUInt16)(uint16_t val); + uint16_t (*UnboxUInt16)(int32_t valHandle); + int32_t (*BoxInt32)(int32_t val); + int32_t (*UnboxInt32)(int32_t valHandle); + int32_t (*BoxUInt32)(uint32_t val); + uint32_t (*UnboxUInt32)(int32_t valHandle); + int32_t (*BoxInt64)(int64_t val); + int64_t (*UnboxInt64)(int32_t valHandle); + int32_t (*BoxUInt64)(uint64_t val); + uint64_t (*UnboxUInt64)(int32_t valHandle); + int32_t (*BoxChar)(System::Char val); + System::Char (*UnboxChar)(int32_t valHandle); + int32_t (*BoxSingle)(float val); + float (*UnboxSingle)(int32_t valHandle); + int32_t (*BoxDouble)(double val); + double (*UnboxDouble)(int32_t valHandle); int32_t (*SystemInt32Array1Constructor1)(int32_t length0); int32_t (*SystemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*SystemInt32Array1SetItem1)(int32_t thisHandle, int32_t index0, int32_t item); @@ -528,7 +574,7 @@ namespace System } String::String(std::nullptr_t n) - : Object(0) + : Object(Plugin::InternalUse::Only, 0) { } @@ -619,7 +665,7 @@ namespace System } Array::Array(std::nullptr_t n) - : Object(0) + : Object(Plugin::InternalUse::Only, 0) { } @@ -1933,6 +1979,39 @@ namespace UnityEngine } } +namespace System +{ + Object::Object(UnityEngine::Vector3& val) + { + int32_t handle = Plugin::BoxVector3(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::Vector3() + { + UnityEngine::Vector3 returnVal(Plugin::UnboxVector3(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + namespace UnityEngine { Matrix4x4::Matrix4x4() @@ -1965,6 +2044,39 @@ namespace UnityEngine } } +namespace System +{ + Object::Object(UnityEngine::Matrix4x4& val) + { + int32_t handle = Plugin::BoxMatrix4x4(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::Matrix4x4() + { + UnityEngine::Matrix4x4 returnVal(Plugin::UnboxMatrix4x4(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + namespace UnityEngine { RaycastHit::RaycastHit(std::nullptr_t n) @@ -2085,6 +2197,72 @@ namespace UnityEngine } } +namespace System +{ + Object::Object(UnityEngine::RaycastHit val) + { + int32_t handle = Plugin::BoxRaycastHit(val.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::RaycastHit() + { + UnityEngine::RaycastHit returnVal(Plugin::InternalUse::Only, Plugin::UnboxRaycastHit(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(UnityEngine::QueryTriggerInteraction val) + { + int32_t handle = Plugin::BoxQueryTriggerInteraction(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::QueryTriggerInteraction() + { + UnityEngine::QueryTriggerInteraction returnVal(Plugin::UnboxQueryTriggerInteraction(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + namespace System { namespace Collections @@ -2217,6 +2395,39 @@ namespace System } } +namespace System +{ + Object::Object(System::Collections::Generic::KeyValuePair val) + { + int32_t handle = Plugin::BoxKeyValuePairSystemString_SystemDouble(val.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator System::Collections::Generic::KeyValuePair() + { + System::Collections::Generic::KeyValuePair returnVal(Plugin::InternalUse::Only, Plugin::UnboxKeyValuePairSystemString_SystemDouble(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + namespace System { namespace Collections @@ -3144,6 +3355,39 @@ namespace UnityEngine } } +namespace System +{ + Object::Object(UnityEngine::Resolution& val) + { + int32_t handle = Plugin::BoxResolution(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::Resolution() + { + UnityEngine::Resolution returnVal(Plugin::UnboxResolution(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + namespace UnityEngine { Screen::Screen(std::nullptr_t n) @@ -3259,6 +3503,39 @@ namespace UnityEngine } } +namespace System +{ + Object::Object(UnityEngine::Ray& val) + { + int32_t handle = Plugin::BoxRay(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::Ray() + { + UnityEngine::Ray returnVal(Plugin::UnboxRay(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + namespace UnityEngine { Physics::Physics(std::nullptr_t n) @@ -3374,6 +3651,39 @@ namespace UnityEngine } } +namespace System +{ + Object::Object(UnityEngine::Color& val) + { + int32_t handle = Plugin::BoxColor(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::Color() + { + UnityEngine::Color returnVal(Plugin::UnboxColor(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + namespace UnityEngine { GradientColorKey::GradientColorKey() @@ -3381,6 +3691,39 @@ namespace UnityEngine } } +namespace System +{ + Object::Object(UnityEngine::GradientColorKey& val) + { + int32_t handle = Plugin::BoxGradientColorKey(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::GradientColorKey() + { + UnityEngine::GradientColorKey returnVal(Plugin::UnboxGradientColorKey(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + namespace UnityEngine { Gradient::Gradient(std::nullptr_t n) @@ -3856,6 +4199,468 @@ namespace UnityEngine } } +namespace System +{ + Object::Object(UnityEngine::SceneManagement::Scene& val) + { + int32_t handle = Plugin::BoxScene(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::SceneManagement::Scene() + { + UnityEngine::SceneManagement::Scene returnVal(Plugin::UnboxScene(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(UnityEngine::SceneManagement::LoadSceneMode val) + { + int32_t handle = Plugin::BoxLoadSceneMode(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::SceneManagement::LoadSceneMode() + { + UnityEngine::SceneManagement::LoadSceneMode returnVal(Plugin::UnboxLoadSceneMode(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(System::Boolean val) + { + int32_t handle = Plugin::BoxBoolean(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator System::Boolean() + { + System::Boolean returnVal(Plugin::UnboxBoolean(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(int8_t val) + { + int32_t handle = Plugin::BoxSByte(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator int8_t() + { + int8_t returnVal(Plugin::UnboxSByte(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(uint8_t val) + { + int32_t handle = Plugin::BoxByte(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator uint8_t() + { + uint8_t returnVal(Plugin::UnboxByte(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(int16_t val) + { + int32_t handle = Plugin::BoxInt16(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator int16_t() + { + int16_t returnVal(Plugin::UnboxInt16(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(uint16_t val) + { + int32_t handle = Plugin::BoxUInt16(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator uint16_t() + { + uint16_t returnVal(Plugin::UnboxUInt16(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(int32_t val) + { + int32_t handle = Plugin::BoxInt32(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator int32_t() + { + int32_t returnVal(Plugin::UnboxInt32(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(uint32_t val) + { + int32_t handle = Plugin::BoxUInt32(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator uint32_t() + { + uint32_t returnVal(Plugin::UnboxUInt32(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(int64_t val) + { + int32_t handle = Plugin::BoxInt64(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator int64_t() + { + int64_t returnVal(Plugin::UnboxInt64(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(uint64_t val) + { + int32_t handle = Plugin::BoxUInt64(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator uint64_t() + { + uint64_t returnVal(Plugin::UnboxUInt64(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(System::Char val) + { + int32_t handle = Plugin::BoxChar(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator System::Char() + { + System::Char returnVal(Plugin::UnboxChar(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(float val) + { + int32_t handle = Plugin::BoxSingle(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator float() + { + float returnVal(Plugin::UnboxSingle(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(double val) + { + int32_t handle = Plugin::BoxDouble(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator double() + { + double returnVal(Plugin::UnboxDouble(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + namespace MyGame { namespace MonoBehaviours @@ -6948,16 +7753,26 @@ DLLEXPORT void Init( void (*unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ), UnityEngine::Vector3 (*unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b), UnityEngine::Vector3 (*unityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a), + int32_t (*boxVector3)(UnityEngine::Vector3& val), + UnityEngine::Vector3 (*unboxVector3)(int32_t valHandle), float (*unityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column), void (*unityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value), + int32_t (*boxMatrix4x4)(UnityEngine::Matrix4x4& val), + UnityEngine::Matrix4x4 (*unboxMatrix4x4)(int32_t valHandle), void (*releaseUnityEngineRaycastHit)(int32_t handle), UnityEngine::Vector3 (*unityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle), void (*unityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value), int32_t (*unityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle), + int32_t (*boxRaycastHit)(int32_t valHandle), + int32_t (*unboxRaycastHit)(int32_t valHandle), + int32_t (*boxQueryTriggerInteraction)(UnityEngine::QueryTriggerInteraction val), + UnityEngine::QueryTriggerInteraction (*unboxQueryTriggerInteraction)(int32_t valHandle), void (*releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)(int32_t handle), int32_t (*systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble)(int32_t keyHandle, double value), int32_t (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)(int32_t thisHandle), double (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle), + int32_t (*boxKeyValuePairSystemString_SystemDouble)(int32_t valHandle), + int32_t (*unboxKeyValuePairSystemString_SystemDouble)(int32_t valHandle), int32_t (*systemCollectionsGenericListSystemStringConstructor)(), int32_t (*systemCollectionsGenericListSystemStringPropertyGetItem)(int32_t thisHandle, int32_t index), void (*systemCollectionsGenericListSystemStringPropertySetItem)(int32_t thisHandle, int32_t index, int32_t valueHandle), @@ -6975,10 +7790,18 @@ DLLEXPORT void Init( void (*unityEngineResolutionPropertySetHeight)(UnityEngine::Resolution* thiz, int32_t value), int32_t (*unityEngineResolutionPropertyGetRefreshRate)(UnityEngine::Resolution* thiz), void (*unityEngineResolutionPropertySetRefreshRate)(UnityEngine::Resolution* thiz, int32_t value), + int32_t (*boxResolution)(UnityEngine::Resolution& val), + UnityEngine::Resolution (*unboxResolution)(int32_t valHandle), int32_t (*unityEngineScreenPropertyGetResolutions)(), UnityEngine::Ray (*unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction), + int32_t (*boxRay)(UnityEngine::Ray& val), + UnityEngine::Ray (*unboxRay)(int32_t valHandle), int32_t (*unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)(UnityEngine::Ray& ray, int32_t resultsHandle), int32_t (*unityEnginePhysicsMethodRaycastAllUnityEngineRay)(UnityEngine::Ray& ray), + int32_t (*boxColor)(UnityEngine::Color& val), + UnityEngine::Color (*unboxColor)(int32_t valHandle), + int32_t (*boxGradientColorKey)(UnityEngine::GradientColorKey& val), + UnityEngine::GradientColorKey (*unboxGradientColorKey)(int32_t valHandle), int32_t (*unityEngineGradientConstructor)(), int32_t (*unityEngineGradientPropertyGetColorKeys)(int32_t thisHandle), void (*unityEngineGradientPropertySetColorKeys)(int32_t thisHandle, int32_t valueHandle), @@ -6989,6 +7812,34 @@ DLLEXPORT void Init( void (*unityEngineApplicationRemoveEventOnBeforeRender)(int32_t delHandle), void (*unityEngineSceneManagementSceneManagerAddEventSceneLoaded)(int32_t delHandle), void (*unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)(int32_t delHandle), + int32_t (*boxScene)(UnityEngine::SceneManagement::Scene& val), + UnityEngine::SceneManagement::Scene (*unboxScene)(int32_t valHandle), + int32_t (*boxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val), + UnityEngine::SceneManagement::LoadSceneMode (*unboxLoadSceneMode)(int32_t valHandle), + int32_t (*boxBoolean)(System::Boolean val), + System::Boolean (*unboxBoolean)(int32_t valHandle), + int32_t (*boxSByte)(int8_t val), + int8_t (*unboxSByte)(int32_t valHandle), + int32_t (*boxByte)(uint8_t val), + uint8_t (*unboxByte)(int32_t valHandle), + int32_t (*boxInt16)(int16_t val), + int16_t (*unboxInt16)(int32_t valHandle), + int32_t (*boxUInt16)(uint16_t val), + uint16_t (*unboxUInt16)(int32_t valHandle), + int32_t (*boxInt32)(int32_t val), + int32_t (*unboxInt32)(int32_t valHandle), + int32_t (*boxUInt32)(uint32_t val), + uint32_t (*unboxUInt32)(int32_t valHandle), + int32_t (*boxInt64)(int64_t val), + int64_t (*unboxInt64)(int32_t valHandle), + int32_t (*boxUInt64)(uint64_t val), + uint64_t (*unboxUInt64)(int32_t valHandle), + int32_t (*boxChar)(System::Char val), + System::Char (*unboxChar)(int32_t valHandle), + int32_t (*boxSingle)(float val), + float (*unboxSingle)(int32_t valHandle), + int32_t (*boxDouble)(double val), + double (*unboxDouble)(int32_t valHandle), int32_t (*systemInt32Array1Constructor1)(int32_t length0), int32_t (*systemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*systemInt32Array1SetItem1)(int32_t thisHandle, int32_t index0, int32_t item), @@ -7098,18 +7949,28 @@ DLLEXPORT void Init( Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle = unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle; Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3 = unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3; Plugin::UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3 = unityEngineVector3Methodop_UnaryNegationUnityEngineVector3; + Plugin::BoxVector3 = boxVector3; + Plugin::UnboxVector3 = unboxVector3; Plugin::UnityEngineMatrix4x4PropertyGetItem = unityEngineMatrix4x4PropertyGetItem; Plugin::UnityEngineMatrix4x4PropertySetItem = unityEngineMatrix4x4PropertySetItem; + Plugin::BoxMatrix4x4 = boxMatrix4x4; + Plugin::UnboxMatrix4x4 = unboxMatrix4x4; Plugin::ReleaseUnityEngineRaycastHit = releaseUnityEngineRaycastHit; Plugin::RefCountsUnityEngineRaycastHit = new int32_t[1000](); Plugin::UnityEngineRaycastHitPropertyGetPoint = unityEngineRaycastHitPropertyGetPoint; Plugin::UnityEngineRaycastHitPropertySetPoint = unityEngineRaycastHitPropertySetPoint; Plugin::UnityEngineRaycastHitPropertyGetTransform = unityEngineRaycastHitPropertyGetTransform; + Plugin::BoxRaycastHit = boxRaycastHit; + Plugin::UnboxRaycastHit = unboxRaycastHit; + Plugin::BoxQueryTriggerInteraction = boxQueryTriggerInteraction; + Plugin::UnboxQueryTriggerInteraction = unboxQueryTriggerInteraction; Plugin::ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; Plugin::RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = new int32_t[maxManagedObjects](); Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble = systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble; Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey; Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue; + Plugin::BoxKeyValuePairSystemString_SystemDouble = boxKeyValuePairSystemString_SystemDouble; + Plugin::UnboxKeyValuePairSystemString_SystemDouble = unboxKeyValuePairSystemString_SystemDouble; Plugin::SystemCollectionsGenericListSystemStringConstructor = systemCollectionsGenericListSystemStringConstructor; Plugin::SystemCollectionsGenericListSystemStringPropertyGetItem = systemCollectionsGenericListSystemStringPropertyGetItem; Plugin::SystemCollectionsGenericListSystemStringPropertySetItem = systemCollectionsGenericListSystemStringPropertySetItem; @@ -7127,10 +7988,18 @@ DLLEXPORT void Init( Plugin::UnityEngineResolutionPropertySetHeight = unityEngineResolutionPropertySetHeight; Plugin::UnityEngineResolutionPropertyGetRefreshRate = unityEngineResolutionPropertyGetRefreshRate; Plugin::UnityEngineResolutionPropertySetRefreshRate = unityEngineResolutionPropertySetRefreshRate; + Plugin::BoxResolution = boxResolution; + Plugin::UnboxResolution = unboxResolution; Plugin::UnityEngineScreenPropertyGetResolutions = unityEngineScreenPropertyGetResolutions; Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3 = unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3; + Plugin::BoxRay = boxRay; + Plugin::UnboxRay = unboxRay; Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit = unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit; Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay = unityEnginePhysicsMethodRaycastAllUnityEngineRay; + Plugin::BoxColor = boxColor; + Plugin::UnboxColor = unboxColor; + Plugin::BoxGradientColorKey = boxGradientColorKey; + Plugin::UnboxGradientColorKey = unboxGradientColorKey; Plugin::UnityEngineGradientConstructor = unityEngineGradientConstructor; Plugin::UnityEngineGradientPropertyGetColorKeys = unityEngineGradientPropertyGetColorKeys; Plugin::UnityEngineGradientPropertySetColorKeys = unityEngineGradientPropertySetColorKeys; @@ -7141,6 +8010,34 @@ DLLEXPORT void Init( Plugin::UnityEngineApplicationRemoveEventOnBeforeRender = unityEngineApplicationRemoveEventOnBeforeRender; Plugin::UnityEngineSceneManagementSceneManagerAddEventSceneLoaded = unityEngineSceneManagementSceneManagerAddEventSceneLoaded; Plugin::UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded = unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded; + Plugin::BoxScene = boxScene; + Plugin::UnboxScene = unboxScene; + Plugin::BoxLoadSceneMode = boxLoadSceneMode; + Plugin::UnboxLoadSceneMode = unboxLoadSceneMode; + Plugin::BoxBoolean = boxBoolean; + Plugin::UnboxBoolean = unboxBoolean; + Plugin::BoxSByte = boxSByte; + Plugin::UnboxSByte = unboxSByte; + Plugin::BoxByte = boxByte; + Plugin::UnboxByte = unboxByte; + Plugin::BoxInt16 = boxInt16; + Plugin::UnboxInt16 = unboxInt16; + Plugin::BoxUInt16 = boxUInt16; + Plugin::UnboxUInt16 = unboxUInt16; + Plugin::BoxInt32 = boxInt32; + Plugin::UnboxInt32 = unboxInt32; + Plugin::BoxUInt32 = boxUInt32; + Plugin::UnboxUInt32 = unboxUInt32; + Plugin::BoxInt64 = boxInt64; + Plugin::UnboxInt64 = unboxInt64; + Plugin::BoxUInt64 = boxUInt64; + Plugin::UnboxUInt64 = unboxUInt64; + Plugin::BoxChar = boxChar; + Plugin::UnboxChar = unboxChar; + Plugin::BoxSingle = boxSingle; + Plugin::UnboxSingle = unboxSingle; + Plugin::BoxDouble = boxDouble; + Plugin::UnboxDouble = unboxDouble; Plugin::SystemInt32Array1Constructor1 = systemInt32Array1Constructor1; Plugin::SystemInt32Array1GetItem1 = systemInt32Array1GetItem1; Plugin::SystemInt32Array1SetItem1 = systemInt32Array1SetItem1; diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 40a7f6d..f06394d 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -150,46 +150,10 @@ namespace System namespace System { - struct Object - { - int32_t Handle; - Object(Plugin::InternalUse iu, int32_t handle); - Object(std::nullptr_t n); - virtual ~Object() = default; - bool operator==(std::nullptr_t other) const; - bool operator!=(std::nullptr_t other) const; - virtual void ThrowReferenceToThis(); - }; - - struct ValueType - { - int32_t Handle; - ValueType(Plugin::InternalUse iu, int32_t handle); - ValueType(std::nullptr_t n); - }; - - struct String : Object - { - String(Plugin::InternalUse iu, int32_t handle); - String(std::nullptr_t n); - String(const String& other); - String(String&& other); - virtual ~String(); - String& operator=(const String& other); - String& operator=(std::nullptr_t other); - String& operator=(String&& other); - String(); - String(const char* chars); - }; - - struct Array : Object - { - Array(Plugin::InternalUse iu, int32_t handle); - Array(std::nullptr_t n); - int32_t GetLength(); - int32_t GetRank(); - }; - + struct Object; + struct ValueType; + struct String; + struct Array; template struct Array1; template struct Array2; template struct Array3; @@ -637,6 +601,103 @@ namespace UnityEngine } /*END TYPE DECLARATIONS*/ +//////////////////////////////////////////////////////////////// +// C# type definitions +//////////////////////////////////////////////////////////////// + +namespace System +{ + struct Object + { + int32_t Handle; + Object(Plugin::InternalUse iu, int32_t handle); + Object(std::nullptr_t n); + virtual ~Object() = default; + bool operator==(std::nullptr_t other) const; + bool operator!=(std::nullptr_t other) const; + virtual void ThrowReferenceToThis(); + + /*BEGIN BOXING METHOD DECLARATIONS*/ + Object(UnityEngine::Vector3& val); + explicit operator UnityEngine::Vector3(); + Object(UnityEngine::Matrix4x4& val); + explicit operator UnityEngine::Matrix4x4(); + Object(UnityEngine::RaycastHit val); + explicit operator UnityEngine::RaycastHit(); + Object(UnityEngine::QueryTriggerInteraction val); + explicit operator UnityEngine::QueryTriggerInteraction(); + Object(System::Collections::Generic::KeyValuePair val); + explicit operator System::Collections::Generic::KeyValuePair(); + Object(UnityEngine::Resolution& val); + explicit operator UnityEngine::Resolution(); + Object(UnityEngine::Ray& val); + explicit operator UnityEngine::Ray(); + Object(UnityEngine::Color& val); + explicit operator UnityEngine::Color(); + Object(UnityEngine::GradientColorKey& val); + explicit operator UnityEngine::GradientColorKey(); + Object(UnityEngine::SceneManagement::Scene& val); + explicit operator UnityEngine::SceneManagement::Scene(); + Object(UnityEngine::SceneManagement::LoadSceneMode val); + explicit operator UnityEngine::SceneManagement::LoadSceneMode(); + Object(System::Boolean val); + explicit operator System::Boolean(); + Object(int8_t val); + explicit operator int8_t(); + Object(uint8_t val); + explicit operator uint8_t(); + Object(int16_t val); + explicit operator int16_t(); + Object(uint16_t val); + explicit operator uint16_t(); + Object(int32_t val); + explicit operator int32_t(); + Object(uint32_t val); + explicit operator uint32_t(); + Object(int64_t val); + explicit operator int64_t(); + Object(uint64_t val); + explicit operator uint64_t(); + Object(System::Char val); + explicit operator System::Char(); + Object(float val); + explicit operator float(); + Object(double val); + explicit operator double(); + + /*END BOXING METHOD DECLARATIONS*/ + }; + + struct ValueType + { + int32_t Handle; + ValueType(Plugin::InternalUse iu, int32_t handle); + ValueType(std::nullptr_t n); + }; + + struct String : Object + { + String(Plugin::InternalUse iu, int32_t handle); + String(std::nullptr_t n); + String(const String& other); + String(String&& other); + virtual ~String(); + String& operator=(const String& other); + String& operator=(std::nullptr_t other); + String& operator=(String&& other); + String(); + String(const char* chars); + }; + + struct Array : Object + { + Array(Plugin::InternalUse iu, int32_t handle); + Array(std::nullptr_t n); + int32_t GetLength(); + int32_t GetRank(); + }; +} + /*BEGIN TYPE DEFINITIONS*/ namespace System { From 7dede45f7244dbe7f2021d78329d121266b38adb Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 5 Nov 2017 21:27:50 -0800 Subject: [PATCH 34/95] Implement array index operator for managed array types in C++ --- Unity/Assets/NativeScript/Bindings.cs | 120 +-- .../NativeScript/Editor/GenerateBindings.cs | 733 ++++++++++++++---- Unity/CppSource/NativeScript/Bindings.cpp | 418 ++++++---- Unity/CppSource/NativeScript/Bindings.h | 232 +++++- 4 files changed, 1152 insertions(+), 351 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 1f6d2ca..242ca37 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -390,30 +390,30 @@ delegate void InitDelegate( IntPtr unboxSingle, IntPtr boxDouble, IntPtr unboxDouble, - IntPtr systemInt32Array1Constructor1, + IntPtr systemSystemInt32Array1Constructor1, IntPtr systemInt32Array1GetItem1, IntPtr systemInt32Array1SetItem1, - IntPtr systemSingleArray1Constructor1, + IntPtr systemSystemSingleArray1Constructor1, IntPtr systemSingleArray1GetItem1, IntPtr systemSingleArray1SetItem1, - IntPtr systemSingleArray2Constructor2, - IntPtr systemSingleArray2GetLength2, + IntPtr systemSystemSingleArray2Constructor2, + IntPtr systemSystemSingleArray2GetLength2, IntPtr systemSingleArray2GetItem2, IntPtr systemSingleArray2SetItem2, - IntPtr systemSingleArray3Constructor3, - IntPtr systemSingleArray3GetLength3, + IntPtr systemSystemSingleArray3Constructor3, + IntPtr systemSystemSingleArray3GetLength3, IntPtr systemSingleArray3GetItem3, IntPtr systemSingleArray3SetItem3, - IntPtr systemStringArray1Constructor1, + IntPtr systemSystemStringArray1Constructor1, IntPtr systemStringArray1GetItem1, IntPtr systemStringArray1SetItem1, - IntPtr unityEngineResolutionArray1Constructor1, + IntPtr unityEngineUnityEngineResolutionArray1Constructor1, IntPtr unityEngineResolutionArray1GetItem1, IntPtr unityEngineResolutionArray1SetItem1, - IntPtr unityEngineRaycastHitArray1Constructor1, + IntPtr unityEngineUnityEngineRaycastHitArray1Constructor1, IntPtr unityEngineRaycastHitArray1GetItem1, IntPtr unityEngineRaycastHitArray1SetItem1, - IntPtr unityEngineGradientColorKeyArray1Constructor1, + IntPtr unityEngineUnityEngineGradientColorKeyArray1Constructor1, IntPtr unityEngineGradientColorKeyArray1GetItem1, IntPtr unityEngineGradientColorKeyArray1SetItem1, IntPtr releaseSystemAction, @@ -714,30 +714,30 @@ static extern void Init( IntPtr unboxSingle, IntPtr boxDouble, IntPtr unboxDouble, - IntPtr systemInt32Array1Constructor1, + IntPtr systemSystemInt32Array1Constructor1, IntPtr systemInt32Array1GetItem1, IntPtr systemInt32Array1SetItem1, - IntPtr systemSingleArray1Constructor1, + IntPtr systemSystemSingleArray1Constructor1, IntPtr systemSingleArray1GetItem1, IntPtr systemSingleArray1SetItem1, - IntPtr systemSingleArray2Constructor2, - IntPtr systemSingleArray2GetLength2, + IntPtr systemSystemSingleArray2Constructor2, + IntPtr systemSystemSingleArray2GetLength2, IntPtr systemSingleArray2GetItem2, IntPtr systemSingleArray2SetItem2, - IntPtr systemSingleArray3Constructor3, - IntPtr systemSingleArray3GetLength3, + IntPtr systemSystemSingleArray3Constructor3, + IntPtr systemSystemSingleArray3GetLength3, IntPtr systemSingleArray3GetItem3, IntPtr systemSingleArray3SetItem3, - IntPtr systemStringArray1Constructor1, + IntPtr systemSystemStringArray1Constructor1, IntPtr systemStringArray1GetItem1, IntPtr systemStringArray1SetItem1, - IntPtr unityEngineResolutionArray1Constructor1, + IntPtr unityEngineUnityEngineResolutionArray1Constructor1, IntPtr unityEngineResolutionArray1GetItem1, IntPtr unityEngineResolutionArray1SetItem1, - IntPtr unityEngineRaycastHitArray1Constructor1, + IntPtr unityEngineUnityEngineRaycastHitArray1Constructor1, IntPtr unityEngineRaycastHitArray1GetItem1, IntPtr unityEngineRaycastHitArray1SetItem1, - IntPtr unityEngineGradientColorKeyArray1Constructor1, + IntPtr unityEngineUnityEngineGradientColorKeyArray1Constructor1, IntPtr unityEngineGradientColorKeyArray1GetItem1, IntPtr unityEngineGradientColorKeyArray1SetItem1, IntPtr releaseSystemAction, @@ -949,30 +949,30 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc delegate float UnboxSingleDelegate(int valHandle); delegate int BoxDoubleDelegate(double val); delegate double UnboxDoubleDelegate(int valHandle); - delegate int SystemInt32Array1Constructor1Delegate(int length0); + delegate int SystemSystemInt32Array1Constructor1Delegate(int length0); delegate int SystemInt32Array1GetItem1Delegate(int thisHandle, int index0); delegate void SystemInt32Array1SetItem1Delegate(int thisHandle, int index0, int item); - delegate int SystemSingleArray1Constructor1Delegate(int length0); + delegate int SystemSystemSingleArray1Constructor1Delegate(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 int SystemSystemSingleArray2Constructor2Delegate(int length0, int length1); + delegate int SystemSystemSingleArray2GetLength2Delegate(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 int SystemSystemSingleArray3Constructor3Delegate(int length0, int length1, int length2); + delegate int SystemSystemSingleArray3GetLength3Delegate(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 SystemSystemStringArray1Constructor1Delegate(int length0); delegate int SystemStringArray1GetItem1Delegate(int thisHandle, int index0); delegate void SystemStringArray1SetItem1Delegate(int thisHandle, int index0, int itemHandle); - delegate int UnityEngineResolutionArray1Constructor1Delegate(int length0); + delegate int UnityEngineUnityEngineResolutionArray1Constructor1Delegate(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 UnityEngineUnityEngineRaycastHitArray1Constructor1Delegate(int length0); delegate int UnityEngineRaycastHitArray1GetItem1Delegate(int thisHandle, int index0); delegate void UnityEngineRaycastHitArray1SetItem1Delegate(int thisHandle, int index0, int itemHandle); - delegate int UnityEngineGradientColorKeyArray1Constructor1Delegate(int length0); + delegate int UnityEngineUnityEngineGradientColorKeyArray1Constructor1Delegate(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); @@ -1190,30 +1190,30 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnboxSingleDelegate(UnboxSingle)), Marshal.GetFunctionPointerForDelegate(new BoxDoubleDelegate(BoxDouble)), Marshal.GetFunctionPointerForDelegate(new UnboxDoubleDelegate(UnboxDouble)), - Marshal.GetFunctionPointerForDelegate(new SystemInt32Array1Constructor1Delegate(SystemInt32Array1Constructor1)), + Marshal.GetFunctionPointerForDelegate(new SystemSystemInt32Array1Constructor1Delegate(SystemSystemInt32Array1Constructor1)), Marshal.GetFunctionPointerForDelegate(new SystemInt32Array1GetItem1Delegate(SystemInt32Array1GetItem1)), Marshal.GetFunctionPointerForDelegate(new SystemInt32Array1SetItem1Delegate(SystemInt32Array1SetItem1)), - Marshal.GetFunctionPointerForDelegate(new SystemSingleArray1Constructor1Delegate(SystemSingleArray1Constructor1)), + Marshal.GetFunctionPointerForDelegate(new SystemSystemSingleArray1Constructor1Delegate(SystemSystemSingleArray1Constructor1)), Marshal.GetFunctionPointerForDelegate(new SystemSingleArray1GetItem1Delegate(SystemSingleArray1GetItem1)), Marshal.GetFunctionPointerForDelegate(new SystemSingleArray1SetItem1Delegate(SystemSingleArray1SetItem1)), - Marshal.GetFunctionPointerForDelegate(new SystemSingleArray2Constructor2Delegate(SystemSingleArray2Constructor2)), - Marshal.GetFunctionPointerForDelegate(new SystemSingleArray2GetLength2Delegate(SystemSingleArray2GetLength2)), + Marshal.GetFunctionPointerForDelegate(new SystemSystemSingleArray2Constructor2Delegate(SystemSystemSingleArray2Constructor2)), + Marshal.GetFunctionPointerForDelegate(new SystemSystemSingleArray2GetLength2Delegate(SystemSystemSingleArray2GetLength2)), Marshal.GetFunctionPointerForDelegate(new SystemSingleArray2GetItem2Delegate(SystemSingleArray2GetItem2)), Marshal.GetFunctionPointerForDelegate(new SystemSingleArray2SetItem2Delegate(SystemSingleArray2SetItem2)), - Marshal.GetFunctionPointerForDelegate(new SystemSingleArray3Constructor3Delegate(SystemSingleArray3Constructor3)), - Marshal.GetFunctionPointerForDelegate(new SystemSingleArray3GetLength3Delegate(SystemSingleArray3GetLength3)), + Marshal.GetFunctionPointerForDelegate(new SystemSystemSingleArray3Constructor3Delegate(SystemSystemSingleArray3Constructor3)), + Marshal.GetFunctionPointerForDelegate(new SystemSystemSingleArray3GetLength3Delegate(SystemSystemSingleArray3GetLength3)), Marshal.GetFunctionPointerForDelegate(new SystemSingleArray3GetItem3Delegate(SystemSingleArray3GetItem3)), Marshal.GetFunctionPointerForDelegate(new SystemSingleArray3SetItem3Delegate(SystemSingleArray3SetItem3)), - Marshal.GetFunctionPointerForDelegate(new SystemStringArray1Constructor1Delegate(SystemStringArray1Constructor1)), + Marshal.GetFunctionPointerForDelegate(new SystemSystemStringArray1Constructor1Delegate(SystemSystemStringArray1Constructor1)), Marshal.GetFunctionPointerForDelegate(new SystemStringArray1GetItem1Delegate(SystemStringArray1GetItem1)), Marshal.GetFunctionPointerForDelegate(new SystemStringArray1SetItem1Delegate(SystemStringArray1SetItem1)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionArray1Constructor1Delegate(UnityEngineResolutionArray1Constructor1)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineUnityEngineResolutionArray1Constructor1Delegate(UnityEngineUnityEngineResolutionArray1Constructor1)), Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionArray1GetItem1Delegate(UnityEngineResolutionArray1GetItem1)), Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionArray1SetItem1Delegate(UnityEngineResolutionArray1SetItem1)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitArray1Constructor1Delegate(UnityEngineRaycastHitArray1Constructor1)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineUnityEngineRaycastHitArray1Constructor1Delegate(UnityEngineUnityEngineRaycastHitArray1Constructor1)), Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitArray1GetItem1Delegate(UnityEngineRaycastHitArray1GetItem1)), Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitArray1SetItem1Delegate(UnityEngineRaycastHitArray1SetItem1)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientColorKeyArray1Constructor1Delegate(UnityEngineGradientColorKeyArray1Constructor1)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineUnityEngineGradientColorKeyArray1Constructor1Delegate(UnityEngineUnityEngineGradientColorKeyArray1Constructor1)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientColorKeyArray1GetItem1Delegate(UnityEngineGradientColorKeyArray1GetItem1)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientColorKeyArray1SetItem1Delegate(UnityEngineGradientColorKeyArray1SetItem1)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemActionDelegate(ReleaseSystemAction)), @@ -3847,8 +3847,8 @@ static double UnboxDouble(int valHandle) } } - [MonoPInvokeCallback(typeof(SystemInt32Array1Constructor1Delegate))] - static int SystemInt32Array1Constructor1(int length0) + [MonoPInvokeCallback(typeof(SystemSystemInt32Array1Constructor1Delegate))] + static int SystemSystemInt32Array1Constructor1(int length0) { try { @@ -3912,8 +3912,8 @@ static void SystemInt32Array1SetItem1(int thisHandle, int index0, int item) } } - [MonoPInvokeCallback(typeof(SystemSingleArray1Constructor1Delegate))] - static int SystemSingleArray1Constructor1(int length0) + [MonoPInvokeCallback(typeof(SystemSystemSingleArray1Constructor1Delegate))] + static int SystemSystemSingleArray1Constructor1(int length0) { try { @@ -3977,8 +3977,8 @@ static void SystemSingleArray1SetItem1(int thisHandle, int index0, float item) } } - [MonoPInvokeCallback(typeof(SystemSingleArray2Constructor2Delegate))] - static int SystemSingleArray2Constructor2(int length0, int length1) + [MonoPInvokeCallback(typeof(SystemSystemSingleArray2Constructor2Delegate))] + static int SystemSystemSingleArray2Constructor2(int length0, int length1) { try { @@ -3999,8 +3999,8 @@ static int SystemSingleArray2Constructor2(int length0, int length1) } } - [MonoPInvokeCallback(typeof(SystemSingleArray2GetLength2Delegate))] - static int SystemSingleArray2GetLength2(int thisHandle, int dimension) + [MonoPInvokeCallback(typeof(SystemSystemSingleArray2GetLength2Delegate))] + static int SystemSystemSingleArray2GetLength2(int thisHandle, int dimension) { try { @@ -4065,8 +4065,8 @@ static void SystemSingleArray2SetItem2(int thisHandle, int index0, int index1, f } } - [MonoPInvokeCallback(typeof(SystemSingleArray3Constructor3Delegate))] - static int SystemSingleArray3Constructor3(int length0, int length1, int length2) + [MonoPInvokeCallback(typeof(SystemSystemSingleArray3Constructor3Delegate))] + static int SystemSystemSingleArray3Constructor3(int length0, int length1, int length2) { try { @@ -4087,8 +4087,8 @@ static int SystemSingleArray3Constructor3(int length0, int length1, int length2) } } - [MonoPInvokeCallback(typeof(SystemSingleArray3GetLength3Delegate))] - static int SystemSingleArray3GetLength3(int thisHandle, int dimension) + [MonoPInvokeCallback(typeof(SystemSystemSingleArray3GetLength3Delegate))] + static int SystemSystemSingleArray3GetLength3(int thisHandle, int dimension) { try { @@ -4153,8 +4153,8 @@ static void SystemSingleArray3SetItem3(int thisHandle, int index0, int index1, i } } - [MonoPInvokeCallback(typeof(SystemStringArray1Constructor1Delegate))] - static int SystemStringArray1Constructor1(int length0) + [MonoPInvokeCallback(typeof(SystemSystemStringArray1Constructor1Delegate))] + static int SystemSystemStringArray1Constructor1(int length0) { try { @@ -4219,8 +4219,8 @@ static void SystemStringArray1SetItem1(int thisHandle, int index0, int itemHandl } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionArray1Constructor1Delegate))] - static int UnityEngineResolutionArray1Constructor1(int length0) + [MonoPInvokeCallback(typeof(UnityEngineUnityEngineResolutionArray1Constructor1Delegate))] + static int UnityEngineUnityEngineResolutionArray1Constructor1(int length0) { try { @@ -4284,8 +4284,8 @@ static void UnityEngineResolutionArray1SetItem1(int thisHandle, int index0, ref } } - [MonoPInvokeCallback(typeof(UnityEngineRaycastHitArray1Constructor1Delegate))] - static int UnityEngineRaycastHitArray1Constructor1(int length0) + [MonoPInvokeCallback(typeof(UnityEngineUnityEngineRaycastHitArray1Constructor1Delegate))] + static int UnityEngineUnityEngineRaycastHitArray1Constructor1(int length0) { try { @@ -4350,8 +4350,8 @@ static void UnityEngineRaycastHitArray1SetItem1(int thisHandle, int index0, int } } - [MonoPInvokeCallback(typeof(UnityEngineGradientColorKeyArray1Constructor1Delegate))] - static int UnityEngineGradientColorKeyArray1Constructor1(int length0) + [MonoPInvokeCallback(typeof(UnityEngineUnityEngineGradientColorKeyArray1Constructor1Delegate))] + static int UnityEngineUnityEngineGradientColorKeyArray1Constructor1(int length0) { try { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index a17c733..0ddb332 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -4008,20 +4008,79 @@ static void AppendArray( ranks = jsonArray.Ranks; } + // C++ element proxy for [1-R] for all ranks R + Type[] cppTypeParams = new Type[]{ elementType }; foreach (int rank in ranks) { // Build array name builders.TempStrBuilder.Length = 0; - builders.TempStrBuilder.Append("Array"); - builders.TempStrBuilder.Append(rank); + AppendCppArrayTypeName( + rank, + builders.TempStrBuilder); string cppArrayTypeName = builders.TempStrBuilder.ToString(); // Build "TypeArray" name builders.TempStrBuilder.Length = 0; - AppendTypeNameWithoutGenericSuffix( + AppendBindingArrayTypeName( + elementType.Name, + elementType.Namespace, + cppArrayTypeName, + builders.TempStrBuilder); + string bindingArrayTypeName = builders.TempStrBuilder.ToString(); + + // GetItem params + ParameterInfo[] getItemParams = BuildArrayGetItemsParams( + rank, + "index"); + + for (int i = 1; i <= rank; ++i) + { + AppendArrayElementProxy( + elementType, + elementTypeKind, + bindingArrayTypeName, + i, + rank, + cppTypeParams, + cppArrayTypeName, + getItemParams, + builders); + } + } + + foreach (int rank in ranks) + { + // Build array name + builders.TempStrBuilder.Length = 0; + AppendCppArrayTypeName( + rank, + builders.TempStrBuilder); + string cppArrayTypeName = builders.TempStrBuilder.ToString(); + + // Build array name with element type + builders.TempStrBuilder.Append('<'); + AppendCppTypeName( + elementType, + builders.TempStrBuilder); + builders.TempStrBuilder.Append('>'); + string cppGenericArrayTypeName = builders.TempStrBuilder.ToString(); + + // Build element proxy name + builders.TempStrBuilder.Length = 0; + AppendCppArrayElementProxyName( + 1, + rank, + elementType, + builders.TempStrBuilder); + string cppElementProxyTypeName = builders.TempStrBuilder.ToString(); + + // Build "TypeArray" name + builders.TempStrBuilder.Length = 0; + AppendBindingArrayTypeName( elementType.Name, + elementType.Namespace, + cppArrayTypeName, builders.TempStrBuilder); - builders.TempStrBuilder.Append(cppArrayTypeName); string bindingArrayTypeName = builders.TempStrBuilder.ToString(); // MakeArrayType() creates a Type for a "vector" @@ -4041,7 +4100,6 @@ static void AppendArray( } // C++ type declaration - Type[] cppTypeParams = new Type[]{ elementType }; int indent = AppendCppTypeDeclaration( "System", cppArrayTypeName, @@ -4131,6 +4189,32 @@ static void AppendArray( indent, builders); + // C++ operator[] method declaration + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("Plugin::"); + AppendCppArrayElementProxyName( + 1, + rank, + elementType, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append(' '); + AppendTypeNameWithoutGenericSuffix( + "operator[]", + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("(int32_t index);\n"); + + // C++ operator[] method definition + AppendCppArrayIndexOperatorMethodDefinition( + 0, + cppMethodDefinitionsIndent, + cppGenericArrayTypeName, + "System", + cppElementProxyTypeName, + builders.CppMethodDefinitions); + + // C++ type definition (end) AppendCppTypeDefinitionEnd( false, indent, @@ -4143,6 +4227,490 @@ static void AppendArray( } } + static void AppendCppArrayIndexOperatorMethodDefinition( + int rank, + int indent, + string enclosingTypeName, + string enclosingTypeNamespace, + string nextCppElementProxyTypeName, + StringBuilder output) + { + AppendIndent( + indent, + output); + AppendCppTypeName( + "Plugin", + nextCppElementProxyTypeName, + output); + output.Append(' '); + output.Append(enclosingTypeNamespace); + output.Append("::"); + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, + output); + output.Append("::operator[](int32_t index)\n"); + AppendIndent( + indent, + output); + output.Append("{\n"); + AppendIndent( + indent + 1, + output); + output.Append("return Plugin::"); + output.Append(nextCppElementProxyTypeName); + output.Append("(Plugin::InternalUse::Only, Handle, "); + for (int i = 0; i < rank; ++i) + { + output.Append("Index"); + output.Append(i); + output.Append(", "); + } + output.Append("index);\n"); + AppendIndent( + indent, + output); + output.Append("}\n"); + AppendIndent( + indent, + output); + output.Append('\n'); + } + + static void AppendCppArrayTypeName( + int rank, + StringBuilder output) + { + output.Append("Array"); + output.Append(rank); + } + + static void AppendCppArrayElementProxyName( + int rank, + int maxRank, + Type elementType, + StringBuilder output) + { + output.Append("ArrayElementProxy"); + output.Append(rank); + output.Append('_'); + output.Append(maxRank); + output.Append('<'); + AppendCppTypeName( + elementType, + output); + output.Append('>'); + } + + static void AppendBindingArrayTypeName( + string elementTypeName, + string elementTypeNamespace, + string cppArrayTypeName, + StringBuilder output) + { + AppendNamespace( + elementTypeNamespace, + string.Empty, + output); + AppendTypeNameWithoutGenericSuffix( + elementTypeName, + output); + output.Append(cppArrayTypeName); + } + + static ParameterInfo[] BuildArrayGetItemsParams( + int rank, + string indexName) + { + ParameterInfo[] parameters = new ParameterInfo[rank]; + for (int i = 0; i < rank; ++i) + { + ParameterInfo param = new ParameterInfo(); + param.Name = indexName + i; + param.ParameterType = typeof(int); + param.IsOut = false; + param.IsRef = false; + param.DereferencedParameterType = param.ParameterType; + param.Kind = GetTypeKind( + param.DereferencedParameterType); + parameters[i] = param; + } + return parameters; + } + + static ParameterInfo[] BuildArraySetItemsParams( + int rank, + string indexName, + Type elementType) + { + ParameterInfo[] parameters = new ParameterInfo[rank+1]; + for (int i = 0; i < rank; ++i) + { + ParameterInfo param = new ParameterInfo(); + param.Name = indexName + i; + param.ParameterType = typeof(int); + param.IsOut = false; + param.IsRef = false; + param.DereferencedParameterType = param.ParameterType; + param.Kind = GetTypeKind( + param.DereferencedParameterType); + parameters[i] = param; + } + + ParameterInfo lastParamInfo = new ParameterInfo(); + lastParamInfo.Name = "item"; + lastParamInfo.ParameterType = elementType; + lastParamInfo.IsOut = false; + lastParamInfo.IsRef = false; + lastParamInfo.DereferencedParameterType = lastParamInfo.ParameterType; + lastParamInfo.Kind = GetTypeKind( + lastParamInfo.DereferencedParameterType); + parameters[rank] = lastParamInfo; + + return parameters; + } + + static void AppendArrayGetItemFuncName( + string elementTypeName, + string elementTypeNamespace, + string bindingArrayTypeName, + int rank, + StringBuilder output) + { + AppendNamespace( + elementTypeNamespace, + string.Empty, + output); + output.Append(elementTypeName); + AppendTypeNameWithoutGenericSuffix( + bindingArrayTypeName, + output); + output.Append("GetItem"); + output.Append(rank); + } + + static void AppendArraySetItemFuncName( + string elementTypeName, + string elementTypeNamespace, + string bindingArrayTypeName, + int rank, + StringBuilder output) + { + AppendNamespace( + elementTypeNamespace, + string.Empty, + output); + output.Append(elementTypeName); + AppendTypeNameWithoutGenericSuffix( + bindingArrayTypeName, + output); + output.Append("SetItem"); + output.Append(rank); + } + + static void AppendArrayElementProxy( + Type elementType, + TypeKind elementTypeKind, + string bindingArrayTypeName, + int rank, + int maxRank, + Type[] cppTypeParams, + string cppArrayTypeName, + ParameterInfo[] getItemParams, + StringBuilders builders) + { + // Build element proxy name + builders.TempStrBuilder.Length = 0; + AppendCppArrayElementProxyName( + rank, + maxRank, + elementType, + builders.TempStrBuilder); + string cppElementProxyTypeName = builders.TempStrBuilder.ToString(); + + // Build next element proxy name + builders.TempStrBuilder.Length = 0; + AppendCppArrayElementProxyName( + rank + 1, + maxRank, + elementType, + builders.TempStrBuilder); + string nextCppElementProxyTypeName = builders.TempStrBuilder.ToString(); + + // GetItem name + builders.TempStrBuilder.Length = 0; + AppendArrayGetItemFuncName( + elementType.Name, + elementType.Namespace, + cppArrayTypeName, + rank, + builders.TempStrBuilder); + string getItemFuncName = builders.TempStrBuilder.ToString(); + + // SetItem name + builders.TempStrBuilder.Length = 0; + AppendArraySetItemFuncName( + elementType.Name, + elementType.Namespace, + cppArrayTypeName, + rank, + builders.TempStrBuilder); + string setItemFuncName = builders.TempStrBuilder.ToString(); + + // GetItem call params + ParameterInfo[] getItemCallParams = BuildArrayGetItemsParams( + rank, + "Index"); + + // SetItem params + ParameterInfo[] setItemCallParams = BuildArraySetItemsParams( + rank, + "Index", + elementType); + + // C++ element proxy type declaration + int indent = AppendNamespaceBeginning( + "Plugin", + builders.CppTypeDeclarations); + AppendIndent(indent, builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append("template<> struct "); + AppendTypeNameWithoutGenericSuffix( + cppElementProxyTypeName, + builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append(";\n"); + AppendNamespaceEnding( + indent, + builders.CppTypeDeclarations); + builders.CppTypeDeclarations.Append('\n'); + + // C++ element proxy type definition + AppendNamespaceBeginning( + "Plugin", + builders.CppTypeDefinitions); + AppendIndent( + indent, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("template<> struct "); + builders.CppTypeDefinitions.Append(cppElementProxyTypeName); + builders.CppTypeDefinitions.Append('\n'); + AppendIndent( + indent, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("int32_t Handle;\n"); + for (int i = 0; i < rank; ++i) + { + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("int32_t Index"); + builders.CppTypeDefinitions.Append(i); + builders.CppTypeDefinitions.Append(";\n"); + } + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append(cppElementProxyTypeName); + builders.CppTypeDefinitions.Append( + "(Plugin::InternalUse iu, int32_t handle, "); + for (int i = 0; i < rank; ++i) + { + builders.CppTypeDefinitions.Append("int32_t index"); + builders.CppTypeDefinitions.Append(i); + if (i != rank - 1) + { + builders.CppTypeDefinitions.Append(", "); + } + } + builders.CppTypeDefinitions.Append(");\n"); + if (rank == maxRank) + { + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("void operator=("); + AppendCppTypeName( + elementType, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append(" item);\n"); + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("operator "); + AppendCppTypeName( + elementType, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("();\n"); + } + else + { + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("Plugin::"); + AppendCppArrayElementProxyName( + rank + 1, + maxRank, + elementType, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append(" operator[]("); + builders.CppTypeDefinitions.Append("int32_t index);\n"); + } + AppendIndent( + indent, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("};\n"); + builders.CppTypeDefinitions.Append("}\n"); + builders.CppTypeDefinitions.Append('\n'); + + // C++ element proxy method definitions (beginning) + int cppMethodDefinitionsIndent = AppendNamespaceBeginning( + "Plugin", + builders.CppMethodDefinitions); + + // C++ element proxy constructor definition + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(cppElementProxyTypeName); + builders.CppMethodDefinitions.Append( + "::ArrayElementProxy"); + builders.CppMethodDefinitions.Append(rank); + builders.CppMethodDefinitions.Append('_'); + builders.CppMethodDefinitions.Append(maxRank); + builders.CppMethodDefinitions.Append( + "(Plugin::InternalUse iu, int32_t handle, "); + for (int i = 0; i < rank; ++i) + { + builders.CppMethodDefinitions.Append("int32_t index"); + builders.CppMethodDefinitions.Append(i); + if (i != rank - 1) + { + builders.CppMethodDefinitions.Append(", "); + } + } + builders.CppMethodDefinitions.Append(")\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Handle = handle;\n"); + for (int i = 0; i < rank; ++i) + { + AppendIndent( + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("Index"); + builders.CppMethodDefinitions.Append(i); + builders.CppMethodDefinitions.Append(" = index"); + builders.CppMethodDefinitions.Append(i); + builders.CppMethodDefinitions.Append(";\n"); + } + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + + if (rank == maxRank) + { + // C++ element proxy operator= definition + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("void "); + builders.CppMethodDefinitions.Append(cppElementProxyTypeName); + builders.CppMethodDefinitions.Append("::"); + builders.CppMethodDefinitions.Append("operator=("); + AppendCppTypeName( + elementType, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(" item)\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendCppPluginFunctionCall( + false, + cppArrayTypeName, + "System", + TypeKind.Class, + cppTypeParams, + typeof(void), + setItemFuncName, + setItemCallParams, + cppMethodDefinitionsIndent + 1, + builders.CppMethodDefinitions); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + + // C++ element proxy type conversion operator definition + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(cppElementProxyTypeName); + builders.CppMethodDefinitions.Append("::"); + builders.CppMethodDefinitions.Append("operator "); + AppendCppTypeName( + elementType, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("()\n"); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendCppPluginFunctionCall( + false, + cppArrayTypeName, + "System", + TypeKind.Class, + cppTypeParams, + elementType, + getItemFuncName, + getItemCallParams, + indent + 1, + builders.CppMethodDefinitions); + AppendCppMethodReturn( + elementType, + elementTypeKind, + indent + 1, + builders.CppMethodDefinitions); + AppendIndent( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + } + else + { + AppendCppArrayIndexOperatorMethodDefinition( + rank, + cppMethodDefinitionsIndent, + cppElementProxyTypeName, + "Plugin", + nextCppElementProxyTypeName, + builders.CppMethodDefinitions); + } + + // C++ method definitions (ending) + AppendCppMethodDefinitionsEnd( + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + } + static void AppendArrayConstructor( Type elementType, Type arrayType, @@ -4565,34 +5133,21 @@ static void AppendArrayGetItem( StringBuilders builders) { builders.TempStrBuilder.Length = 0; - AppendNamespace( + AppendArrayGetItemFuncName( + elementType.Name, elementType.Namespace, - string.Empty, - builders.TempStrBuilder); - AppendTypeNameWithoutGenericSuffix( - csharpTypeName, + cppArrayTypeName, + rank, builders.TempStrBuilder); - builders.TempStrBuilder.Append("GetItem"); - builders.TempStrBuilder.Append(rank); string funcName = builders.TempStrBuilder.ToString(); builders.TempStrBuilder[0] = char.ToLower( builders.TempStrBuilder[0]); string funcNameLower = builders.TempStrBuilder.ToString(); - ParameterInfo[] parameters = new ParameterInfo[rank]; - for (int i = 0; i < rank; ++i) - { - ParameterInfo info = new ParameterInfo(); - info.Name = "index" + i; - info.ParameterType = typeof(int); - info.IsOut = false; - info.IsRef = false; - info.DereferencedParameterType = info.ParameterType; - info.Kind = GetTypeKind( - info.DereferencedParameterType); - parameters[i] = info; - } + ParameterInfo[] parameters = BuildArrayGetItemsParams( + rank, + "index"); // C# Delegate Type AppendCsharpDelegateType( @@ -4670,54 +5225,6 @@ static void AppendArrayGetItem( funcName, funcNameLower, builders.CppInitBody); - - // C++ method declaration - AppendIndent( - indent + 1, - builders.CppTypeDefinitions); - AppendCppMethodDeclaration( - "GetItem", - false, - false, - false, - elementType, - null, - parameters, - builders.CppTypeDefinitions); - - // C++ method definition - Type[] cppTypeParams = new Type[] { elementType }; - AppendCppMethodDefinitionBegin( - cppArrayTypeName, - elementType, - "GetItem", - cppTypeParams, - null, - parameters, - indent, - builders.CppMethodDefinitions); - AppendIndent(indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendCppPluginFunctionCall( - false, - cppArrayTypeName, - "System", - TypeKind.Class, - cppTypeParams, - elementType, - funcName, - parameters, - indent + 1, - builders.CppMethodDefinitions); - AppendCppMethodReturn( - elementType, - elementTypeKind, - indent + 1, - builders.CppMethodDefinitions); - AppendIndent(indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); - AppendIndent(indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); } static void AppendArraySetItem( @@ -4730,15 +5237,12 @@ static void AppendArraySetItem( StringBuilders builders) { builders.TempStrBuilder.Length = 0; - AppendNamespace( + AppendArraySetItemFuncName( + elementType.Name, elementType.Namespace, - string.Empty, - builders.TempStrBuilder); - AppendTypeNameWithoutGenericSuffix( - csharpTypeName, + cppArrayTypeName, + rank, builders.TempStrBuilder); - builders.TempStrBuilder.Append("SetItem"); - builders.TempStrBuilder.Append(rank); string funcName = builders.TempStrBuilder.ToString(); builders.TempStrBuilder[0] = char.ToLower( @@ -4746,28 +5250,10 @@ static void AppendArraySetItem( string funcNameLower = builders.TempStrBuilder.ToString(); // Build parameters as indexes then element - ParameterInfo[] parameters = new ParameterInfo[rank+1]; - for (int i = 0; i < rank; ++i) - { - ParameterInfo info = new ParameterInfo(); - info.Name = "index" + i; - info.ParameterType = typeof(int); - info.IsOut = false; - info.IsRef = false; - info.DereferencedParameterType = info.ParameterType; - info.Kind = GetTypeKind( - info.DereferencedParameterType); - parameters[i] = info; - } - ParameterInfo lastParamInfo = new ParameterInfo(); - lastParamInfo.Name = "item"; - lastParamInfo.ParameterType = elementType; - lastParamInfo.IsOut = false; - lastParamInfo.IsRef = false; - lastParamInfo.DereferencedParameterType = lastParamInfo.ParameterType; - lastParamInfo.Kind = GetTypeKind( - lastParamInfo.DereferencedParameterType); - parameters[rank] = lastParamInfo; + ParameterInfo[] parameters = BuildArraySetItemsParams( + rank, + "index", + elementType); // C# Delegate Type AppendCsharpDelegateType( @@ -4845,49 +5331,6 @@ static void AppendArraySetItem( funcName, funcNameLower, builders.CppInitBody); - - // C++ method declaration - AppendIndent( - indent + 1, - builders.CppTypeDefinitions); - AppendCppMethodDeclaration( - "SetItem", - false, - false, - false, - typeof(void), - null, - parameters, - builders.CppTypeDefinitions); - - // C++ method definition - Type[] cppTypeParams = new Type[] { elementType }; - AppendCppMethodDefinitionBegin( - cppArrayTypeName, - typeof(void), - "SetItem", - cppTypeParams, - null, - parameters, - indent, - builders.CppMethodDefinitions); - AppendIndent(indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendCppPluginFunctionCall( - false, - cppArrayTypeName, - "System", - TypeKind.Class, - cppTypeParams, - typeof(void), - funcName, - parameters, - indent + 1, - builders.CppMethodDefinitions); - AppendIndent(indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); - AppendIndent(indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); } static void AppendDelegate( diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 79cdce3..2c42ed2 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -156,30 +156,30 @@ namespace Plugin float (*UnboxSingle)(int32_t valHandle); int32_t (*BoxDouble)(double val); double (*UnboxDouble)(int32_t valHandle); - int32_t (*SystemInt32Array1Constructor1)(int32_t length0); + int32_t (*SystemSystemInt32Array1Constructor1)(int32_t length0); int32_t (*SystemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*SystemInt32Array1SetItem1)(int32_t thisHandle, int32_t index0, int32_t item); - int32_t (*SystemSingleArray1Constructor1)(int32_t length0); + int32_t (*SystemSystemSingleArray1Constructor1)(int32_t length0); float (*SystemSingleArray1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*SystemSingleArray1SetItem1)(int32_t thisHandle, int32_t index0, float item); - int32_t (*SystemSingleArray2Constructor2)(int32_t length0, int32_t length1); - int32_t (*SystemSingleArray2GetLength2)(int32_t thisHandle, int32_t dimension); + int32_t (*SystemSystemSingleArray2Constructor2)(int32_t length0, int32_t length1); + int32_t (*SystemSystemSingleArray2GetLength2)(int32_t thisHandle, int32_t dimension); float (*SystemSingleArray2GetItem2)(int32_t thisHandle, int32_t index0, int32_t index1); int32_t (*SystemSingleArray2SetItem2)(int32_t thisHandle, int32_t index0, int32_t index1, float item); - int32_t (*SystemSingleArray3Constructor3)(int32_t length0, int32_t length1, int32_t length2); - int32_t (*SystemSingleArray3GetLength3)(int32_t thisHandle, int32_t dimension); + int32_t (*SystemSystemSingleArray3Constructor3)(int32_t length0, int32_t length1, int32_t length2); + int32_t (*SystemSystemSingleArray3GetLength3)(int32_t thisHandle, int32_t dimension); float (*SystemSingleArray3GetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2); int32_t (*SystemSingleArray3SetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2, float item); - int32_t (*SystemStringArray1Constructor1)(int32_t length0); + int32_t (*SystemSystemStringArray1Constructor1)(int32_t length0); int32_t (*SystemStringArray1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*SystemStringArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle); - int32_t (*UnityEngineResolutionArray1Constructor1)(int32_t length0); + int32_t (*UnityEngineUnityEngineResolutionArray1Constructor1)(int32_t length0); UnityEngine::Resolution (*UnityEngineResolutionArray1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*UnityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::Resolution& item); - int32_t (*UnityEngineRaycastHitArray1Constructor1)(int32_t length0); + int32_t (*UnityEngineUnityEngineRaycastHitArray1Constructor1)(int32_t length0); int32_t (*UnityEngineRaycastHitArray1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*UnityEngineRaycastHitArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle); - int32_t (*UnityEngineGradientColorKeyArray1Constructor1)(int32_t length0); + int32_t (*UnityEngineUnityEngineGradientColorKeyArray1Constructor1)(int32_t length0); UnityEngine::GradientColorKey (*UnityEngineGradientColorKeyArray1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*UnityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item); void (*ReleaseSystemAction)(int32_t handle, int32_t classHandle); @@ -4746,6 +4746,40 @@ namespace MyGame } } +namespace Plugin +{ + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + { + Handle = handle; + Index0 = index0; + } + + void ArrayElementProxy1_1::operator=(int32_t item) + { + Plugin::SystemInt32Array1SetItem1(Handle, Index0, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + ArrayElementProxy1_1::operator int32_t() + { + auto returnValue = Plugin::SystemInt32Array1GetItem1(Handle, Index0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } +} + namespace System { Array1::Array1(std::nullptr_t n) @@ -4830,7 +4864,7 @@ namespace System Array1::Array1(int32_t length0) : System::Array(nullptr) { - auto returnValue = Plugin::SystemInt32Array1Constructor1(length0); + auto returnValue = Plugin::SystemSystemInt32Array1Constructor1(length0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4855,9 +4889,35 @@ namespace System return Array::GetRank(); } - int32_t Array1::GetItem(int32_t index0) + Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) { - auto returnValue = Plugin::SystemInt32Array1GetItem1(Handle, index0); + return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); + } +} + +namespace Plugin +{ + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + { + Handle = handle; + Index0 = index0; + } + + void ArrayElementProxy1_1::operator=(float item) + { + Plugin::SystemSingleArray1SetItem1(Handle, Index0, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + ArrayElementProxy1_1::operator float() + { + auto returnValue = Plugin::SystemSingleArray1GetItem1(Handle, Index0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4867,10 +4927,99 @@ namespace System } return returnValue; } +} + +namespace Plugin +{ + ArrayElementProxy1_2::ArrayElementProxy1_2(Plugin::InternalUse iu, int32_t handle, int32_t index0) + { + Handle = handle; + Index0 = index0; + } + + Plugin::ArrayElementProxy2_2 Plugin::ArrayElementProxy1_2::operator[](int32_t index) + { + return Plugin::ArrayElementProxy2_2(Plugin::InternalUse::Only, Handle, Index0, index); + } +} + +namespace Plugin +{ + ArrayElementProxy2_2::ArrayElementProxy2_2(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1) + { + Handle = handle; + Index0 = index0; + Index1 = index1; + } + + void ArrayElementProxy2_2::operator=(float item) + { + Plugin::SystemSingleArray2SetItem2(Handle, Index0, Index1, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + ArrayElementProxy2_2::operator float() + { + auto returnValue = Plugin::SystemSingleArray2GetItem2(Handle, Index0, Index1); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } +} + +namespace Plugin +{ + ArrayElementProxy1_3::ArrayElementProxy1_3(Plugin::InternalUse iu, int32_t handle, int32_t index0) + { + Handle = handle; + Index0 = index0; + } + + Plugin::ArrayElementProxy2_3 Plugin::ArrayElementProxy1_3::operator[](int32_t index) + { + return Plugin::ArrayElementProxy2_3(Plugin::InternalUse::Only, Handle, Index0, index); + } +} + +namespace Plugin +{ + ArrayElementProxy2_3::ArrayElementProxy2_3(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1) + { + Handle = handle; + Index0 = index0; + Index1 = index1; + } + + Plugin::ArrayElementProxy3_3 Plugin::ArrayElementProxy2_3::operator[](int32_t index) + { + return Plugin::ArrayElementProxy3_3(Plugin::InternalUse::Only, Handle, Index0, Index1, index); + } +} + +namespace Plugin +{ + ArrayElementProxy3_3::ArrayElementProxy3_3(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1, int32_t index2) + { + Handle = handle; + Index0 = index0; + Index1 = index1; + Index2 = index2; + } - void Array1::SetItem(int32_t index0, int32_t item) + void ArrayElementProxy3_3::operator=(float item) { - Plugin::SystemInt32Array1SetItem1(Handle, index0, item); + Plugin::SystemSingleArray3SetItem3(Handle, Index0, Index1, Index2, item); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4879,6 +5028,19 @@ namespace System delete ex; } } + + ArrayElementProxy3_3::operator float() + { + auto returnValue = Plugin::SystemSingleArray3GetItem3(Handle, Index0, Index1, Index2); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } } namespace System @@ -4965,7 +5127,7 @@ namespace System Array1::Array1(int32_t length0) : System::Array(nullptr) { - auto returnValue = Plugin::SystemSingleArray1Constructor1(length0); + auto returnValue = Plugin::SystemSystemSingleArray1Constructor1(length0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4990,29 +5152,9 @@ namespace System return Array::GetRank(); } - float Array1::GetItem(int32_t index0) + Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) { - auto returnValue = Plugin::SystemSingleArray1GetItem1(Handle, index0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void Array1::SetItem(int32_t index0, float item) - { - Plugin::SystemSingleArray1SetItem1(Handle, index0, item); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); } } @@ -5100,7 +5242,7 @@ namespace System Array2::Array2(int32_t length0, int32_t length1) : System::Array(nullptr) { - auto returnValue = Plugin::SystemSingleArray2Constructor2(length0, length1); + auto returnValue = Plugin::SystemSystemSingleArray2Constructor2(length0, length1); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5122,7 +5264,7 @@ namespace System int32_t Array2::GetLength(int32_t dimension) { - auto returnValue = Plugin::SystemSingleArray2GetLength2(Handle, dimension); + auto returnValue = Plugin::SystemSystemSingleArray2GetLength2(Handle, dimension); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5138,29 +5280,9 @@ namespace System return Array::GetRank(); } - float Array2::GetItem(int32_t index0, int32_t index1) + Plugin::ArrayElementProxy1_2 System::Array2::operator[](int32_t index) { - auto returnValue = Plugin::SystemSingleArray2GetItem2(Handle, index0, index1); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void Array2::SetItem(int32_t index0, int32_t index1, float item) - { - Plugin::SystemSingleArray2SetItem2(Handle, index0, index1, item); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + return Plugin::ArrayElementProxy1_2(Plugin::InternalUse::Only, Handle, index); } } @@ -5248,7 +5370,7 @@ namespace System Array3::Array3(int32_t length0, int32_t length1, int32_t length2) : System::Array(nullptr) { - auto returnValue = Plugin::SystemSingleArray3Constructor3(length0, length1, length2); + auto returnValue = Plugin::SystemSystemSingleArray3Constructor3(length0, length1, length2); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5270,7 +5392,7 @@ namespace System int32_t Array3::GetLength(int32_t dimension) { - auto returnValue = Plugin::SystemSingleArray3GetLength3(Handle, dimension); + auto returnValue = Plugin::SystemSystemSingleArray3GetLength3(Handle, dimension); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5286,9 +5408,23 @@ namespace System return Array::GetRank(); } - float Array3::GetItem(int32_t index0, int32_t index1, int32_t index2) + Plugin::ArrayElementProxy1_3 System::Array3::operator[](int32_t index) + { + return Plugin::ArrayElementProxy1_3(Plugin::InternalUse::Only, Handle, index); + } +} + +namespace Plugin +{ + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + { + Handle = handle; + Index0 = index0; + } + + void ArrayElementProxy1_1::operator=(System::String item) { - auto returnValue = Plugin::SystemSingleArray3GetItem3(Handle, index0, index1, index2); + Plugin::SystemStringArray1SetItem1(Handle, Index0, item.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5296,12 +5432,11 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return returnValue; } - void Array3::SetItem(int32_t index0, int32_t index1, int32_t index2, float item) + ArrayElementProxy1_1::operator System::String() { - Plugin::SystemSingleArray3SetItem3(Handle, index0, index1, index2, item); + auto returnValue = Plugin::SystemStringArray1GetItem1(Handle, Index0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5309,6 +5444,7 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } + return System::String(Plugin::InternalUse::Only, returnValue); } } @@ -5396,7 +5532,7 @@ namespace System Array1::Array1(int32_t length0) : System::Array(nullptr) { - auto returnValue = Plugin::SystemStringArray1Constructor1(length0); + auto returnValue = Plugin::SystemSystemStringArray1Constructor1(length0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5421,9 +5557,23 @@ namespace System return Array::GetRank(); } - System::String Array1::GetItem(int32_t index0) + Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) + { + return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); + } +} + +namespace Plugin +{ + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + { + Handle = handle; + Index0 = index0; + } + + void ArrayElementProxy1_1::operator=(UnityEngine::Resolution item) { - auto returnValue = Plugin::SystemStringArray1GetItem1(Handle, index0); + Plugin::UnityEngineResolutionArray1SetItem1(Handle, Index0, item); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5431,12 +5581,11 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return System::String(Plugin::InternalUse::Only, returnValue); } - void Array1::SetItem(int32_t index0, System::String item) + ArrayElementProxy1_1::operator UnityEngine::Resolution() { - Plugin::SystemStringArray1SetItem1(Handle, index0, item.Handle); + auto returnValue = Plugin::UnityEngineResolutionArray1GetItem1(Handle, Index0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5444,6 +5593,7 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } + return returnValue; } } @@ -5531,7 +5681,7 @@ namespace System Array1::Array1(int32_t length0) : System::Array(nullptr) { - auto returnValue = Plugin::UnityEngineResolutionArray1Constructor1(length0); + auto returnValue = Plugin::UnityEngineUnityEngineResolutionArray1Constructor1(length0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5556,9 +5706,23 @@ namespace System return Array::GetRank(); } - UnityEngine::Resolution Array1::GetItem(int32_t index0) + Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) { - auto returnValue = Plugin::UnityEngineResolutionArray1GetItem1(Handle, index0); + return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); + } +} + +namespace Plugin +{ + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + { + Handle = handle; + Index0 = index0; + } + + void ArrayElementProxy1_1::operator=(UnityEngine::RaycastHit item) + { + Plugin::UnityEngineRaycastHitArray1SetItem1(Handle, Index0, item.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5566,12 +5730,11 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return returnValue; } - void Array1::SetItem(int32_t index0, UnityEngine::Resolution& item) + ArrayElementProxy1_1::operator UnityEngine::RaycastHit() { - Plugin::UnityEngineResolutionArray1SetItem1(Handle, index0, item); + auto returnValue = Plugin::UnityEngineRaycastHitArray1GetItem1(Handle, Index0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5579,6 +5742,7 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } + return UnityEngine::RaycastHit(Plugin::InternalUse::Only, returnValue); } } @@ -5666,7 +5830,7 @@ namespace System Array1::Array1(int32_t length0) : System::Array(nullptr) { - auto returnValue = Plugin::UnityEngineRaycastHitArray1Constructor1(length0); + auto returnValue = Plugin::UnityEngineUnityEngineRaycastHitArray1Constructor1(length0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5691,9 +5855,23 @@ namespace System return Array::GetRank(); } - UnityEngine::RaycastHit Array1::GetItem(int32_t index0) + Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) + { + return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); + } +} + +namespace Plugin +{ + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + { + Handle = handle; + Index0 = index0; + } + + void ArrayElementProxy1_1::operator=(UnityEngine::GradientColorKey item) { - auto returnValue = Plugin::UnityEngineRaycastHitArray1GetItem1(Handle, index0); + Plugin::UnityEngineGradientColorKeyArray1SetItem1(Handle, Index0, item); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5701,12 +5879,11 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return UnityEngine::RaycastHit(Plugin::InternalUse::Only, returnValue); } - void Array1::SetItem(int32_t index0, UnityEngine::RaycastHit item) + ArrayElementProxy1_1::operator UnityEngine::GradientColorKey() { - Plugin::UnityEngineRaycastHitArray1SetItem1(Handle, index0, item.Handle); + auto returnValue = Plugin::UnityEngineGradientColorKeyArray1GetItem1(Handle, Index0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5714,6 +5891,7 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } + return returnValue; } } @@ -5801,7 +5979,7 @@ namespace System Array1::Array1(int32_t length0) : System::Array(nullptr) { - auto returnValue = Plugin::UnityEngineGradientColorKeyArray1Constructor1(length0); + auto returnValue = Plugin::UnityEngineUnityEngineGradientColorKeyArray1Constructor1(length0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5826,29 +6004,9 @@ namespace System return Array::GetRank(); } - UnityEngine::GradientColorKey Array1::GetItem(int32_t index0) - { - auto returnValue = Plugin::UnityEngineGradientColorKeyArray1GetItem1(Handle, index0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void Array1::SetItem(int32_t index0, UnityEngine::GradientColorKey& item) + Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) { - Plugin::UnityEngineGradientColorKeyArray1SetItem1(Handle, index0, item); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); } } @@ -7840,30 +7998,30 @@ DLLEXPORT void Init( float (*unboxSingle)(int32_t valHandle), int32_t (*boxDouble)(double val), double (*unboxDouble)(int32_t valHandle), - int32_t (*systemInt32Array1Constructor1)(int32_t length0), + int32_t (*systemSystemInt32Array1Constructor1)(int32_t length0), int32_t (*systemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*systemInt32Array1SetItem1)(int32_t thisHandle, int32_t index0, int32_t item), - int32_t (*systemSingleArray1Constructor1)(int32_t length0), + int32_t (*systemSystemSingleArray1Constructor1)(int32_t length0), float (*systemSingleArray1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*systemSingleArray1SetItem1)(int32_t thisHandle, int32_t index0, float item), - int32_t (*systemSingleArray2Constructor2)(int32_t length0, int32_t length1), - int32_t (*systemSingleArray2GetLength2)(int32_t thisHandle, int32_t dimension), + int32_t (*systemSystemSingleArray2Constructor2)(int32_t length0, int32_t length1), + int32_t (*systemSystemSingleArray2GetLength2)(int32_t thisHandle, int32_t dimension), float (*systemSingleArray2GetItem2)(int32_t thisHandle, int32_t index0, int32_t index1), int32_t (*systemSingleArray2SetItem2)(int32_t thisHandle, int32_t index0, int32_t index1, float item), - int32_t (*systemSingleArray3Constructor3)(int32_t length0, int32_t length1, int32_t length2), - int32_t (*systemSingleArray3GetLength3)(int32_t thisHandle, int32_t dimension), + int32_t (*systemSystemSingleArray3Constructor3)(int32_t length0, int32_t length1, int32_t length2), + int32_t (*systemSystemSingleArray3GetLength3)(int32_t thisHandle, int32_t dimension), float (*systemSingleArray3GetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2), int32_t (*systemSingleArray3SetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2, float item), - int32_t (*systemStringArray1Constructor1)(int32_t length0), + int32_t (*systemSystemStringArray1Constructor1)(int32_t length0), int32_t (*systemStringArray1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*systemStringArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), - int32_t (*unityEngineResolutionArray1Constructor1)(int32_t length0), + int32_t (*unityEngineUnityEngineResolutionArray1Constructor1)(int32_t length0), UnityEngine::Resolution (*unityEngineResolutionArray1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*unityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::Resolution& item), - int32_t (*unityEngineRaycastHitArray1Constructor1)(int32_t length0), + int32_t (*unityEngineUnityEngineRaycastHitArray1Constructor1)(int32_t length0), int32_t (*unityEngineRaycastHitArray1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*unityEngineRaycastHitArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), - int32_t (*unityEngineGradientColorKeyArray1Constructor1)(int32_t length0), + int32_t (*unityEngineUnityEngineGradientColorKeyArray1Constructor1)(int32_t length0), UnityEngine::GradientColorKey (*unityEngineGradientColorKeyArray1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*unityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item), void (*releaseSystemAction)(int32_t handle, int32_t classHandle), @@ -8038,30 +8196,30 @@ DLLEXPORT void Init( Plugin::UnboxSingle = unboxSingle; Plugin::BoxDouble = boxDouble; Plugin::UnboxDouble = unboxDouble; - Plugin::SystemInt32Array1Constructor1 = systemInt32Array1Constructor1; + Plugin::SystemSystemInt32Array1Constructor1 = systemSystemInt32Array1Constructor1; Plugin::SystemInt32Array1GetItem1 = systemInt32Array1GetItem1; Plugin::SystemInt32Array1SetItem1 = systemInt32Array1SetItem1; - Plugin::SystemSingleArray1Constructor1 = systemSingleArray1Constructor1; + Plugin::SystemSystemSingleArray1Constructor1 = systemSystemSingleArray1Constructor1; Plugin::SystemSingleArray1GetItem1 = systemSingleArray1GetItem1; Plugin::SystemSingleArray1SetItem1 = systemSingleArray1SetItem1; - Plugin::SystemSingleArray2Constructor2 = systemSingleArray2Constructor2; - Plugin::SystemSingleArray2GetLength2 = systemSingleArray2GetLength2; + Plugin::SystemSystemSingleArray2Constructor2 = systemSystemSingleArray2Constructor2; + Plugin::SystemSystemSingleArray2GetLength2 = systemSystemSingleArray2GetLength2; Plugin::SystemSingleArray2GetItem2 = systemSingleArray2GetItem2; Plugin::SystemSingleArray2SetItem2 = systemSingleArray2SetItem2; - Plugin::SystemSingleArray3Constructor3 = systemSingleArray3Constructor3; - Plugin::SystemSingleArray3GetLength3 = systemSingleArray3GetLength3; + Plugin::SystemSystemSingleArray3Constructor3 = systemSystemSingleArray3Constructor3; + Plugin::SystemSystemSingleArray3GetLength3 = systemSystemSingleArray3GetLength3; Plugin::SystemSingleArray3GetItem3 = systemSingleArray3GetItem3; Plugin::SystemSingleArray3SetItem3 = systemSingleArray3SetItem3; - Plugin::SystemStringArray1Constructor1 = systemStringArray1Constructor1; + Plugin::SystemSystemStringArray1Constructor1 = systemSystemStringArray1Constructor1; Plugin::SystemStringArray1GetItem1 = systemStringArray1GetItem1; Plugin::SystemStringArray1SetItem1 = systemStringArray1SetItem1; - Plugin::UnityEngineResolutionArray1Constructor1 = unityEngineResolutionArray1Constructor1; + Plugin::UnityEngineUnityEngineResolutionArray1Constructor1 = unityEngineUnityEngineResolutionArray1Constructor1; Plugin::UnityEngineResolutionArray1GetItem1 = unityEngineResolutionArray1GetItem1; Plugin::UnityEngineResolutionArray1SetItem1 = unityEngineResolutionArray1SetItem1; - Plugin::UnityEngineRaycastHitArray1Constructor1 = unityEngineRaycastHitArray1Constructor1; + Plugin::UnityEngineUnityEngineRaycastHitArray1Constructor1 = unityEngineUnityEngineRaycastHitArray1Constructor1; Plugin::UnityEngineRaycastHitArray1GetItem1 = unityEngineRaycastHitArray1GetItem1; Plugin::UnityEngineRaycastHitArray1SetItem1 = unityEngineRaycastHitArray1SetItem1; - Plugin::UnityEngineGradientColorKeyArray1Constructor1 = unityEngineGradientColorKeyArray1Constructor1; + Plugin::UnityEngineUnityEngineGradientColorKeyArray1Constructor1 = unityEngineUnityEngineGradientColorKeyArray1Constructor1; Plugin::UnityEngineGradientColorKeyArray1GetItem1 = unityEngineGradientColorKeyArray1GetItem1; Plugin::UnityEngineGradientColorKeyArray1SetItem1 = unityEngineGradientColorKeyArray1SetItem1; SystemActionFreeListSize = maxManagedObjects; diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index f06394d..e7989fe 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -26,6 +26,26 @@ namespace Plugin { Only }; + + template struct ArrayElementProxy1_1; + + template struct ArrayElementProxy1_2; + template struct ArrayElementProxy2_2; + + template struct ArrayElementProxy1_3; + template struct ArrayElementProxy2_3; + template struct ArrayElementProxy3_3; + + template struct ArrayElementProxy1_4; + template struct ArrayElementProxy2_4; + template struct ArrayElementProxy3_4; + template struct ArrayElementProxy4_4; + + template struct ArrayElementProxy1_5; + template struct ArrayElementProxy2_5; + template struct ArrayElementProxy3_5; + template struct ArrayElementProxy4_5; + template struct ArrayElementProxy5_5; } //////////////////////////////////////////////////////////////// @@ -486,11 +506,46 @@ namespace MyGame } } +namespace Plugin +{ + template<> struct ArrayElementProxy1_1; +} + namespace System { template<> struct Array1; } +namespace Plugin +{ + template<> struct ArrayElementProxy1_1; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_2; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy2_2; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_3; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy2_3; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy3_3; +} + namespace System { template<> struct Array1; @@ -506,21 +561,41 @@ namespace System template<> struct Array3; } +namespace Plugin +{ + template<> struct ArrayElementProxy1_1; +} + namespace System { template<> struct Array1; } +namespace Plugin +{ + template<> struct ArrayElementProxy1_1; +} + namespace System { template<> struct Array1; } +namespace Plugin +{ + template<> struct ArrayElementProxy1_1; +} + namespace System { template<> struct Array1; } +namespace Plugin +{ + template<> struct ArrayElementProxy1_1; +} + namespace System { template<> struct Array1; @@ -1394,6 +1469,18 @@ namespace MyGame } } +namespace Plugin +{ + template<> struct ArrayElementProxy1_1 + { + int32_t Handle; + int32_t Index0; + ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0); + void operator=(int32_t item); + operator int32_t(); + }; +} + namespace System { template<> struct Array1 : System::Array @@ -1411,8 +1498,80 @@ namespace System Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); - int32_t GetItem(int32_t index0); - void SetItem(int32_t index0, int32_t item); + Plugin::ArrayElementProxy1_1 operator[](int32_t index); + }; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_1 + { + int32_t Handle; + int32_t Index0; + ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0); + void operator=(float item); + operator float(); + }; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_2 + { + int32_t Handle; + int32_t Index0; + ArrayElementProxy1_2(Plugin::InternalUse iu, int32_t handle, int32_t index0); + Plugin::ArrayElementProxy2_2 operator[](int32_t index); + }; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy2_2 + { + int32_t Handle; + int32_t Index0; + int32_t Index1; + ArrayElementProxy2_2(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1); + void operator=(float item); + operator float(); + }; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_3 + { + int32_t Handle; + int32_t Index0; + ArrayElementProxy1_3(Plugin::InternalUse iu, int32_t handle, int32_t index0); + Plugin::ArrayElementProxy2_3 operator[](int32_t index); + }; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy2_3 + { + int32_t Handle; + int32_t Index0; + int32_t Index1; + ArrayElementProxy2_3(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1); + Plugin::ArrayElementProxy3_3 operator[](int32_t index); + }; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy3_3 + { + int32_t Handle; + int32_t Index0; + int32_t Index1; + int32_t Index2; + ArrayElementProxy3_3(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1, int32_t index2); + void operator=(float item); + operator float(); }; } @@ -1433,8 +1592,7 @@ namespace System Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); - float GetItem(int32_t index0); - void SetItem(int32_t index0, float item); + Plugin::ArrayElementProxy1_1 operator[](int32_t index); }; } @@ -1456,8 +1614,7 @@ namespace System int32_t GetLength(); int32_t GetLength(int32_t dimension); int32_t GetRank(); - float GetItem(int32_t index0, int32_t index1); - void SetItem(int32_t index0, int32_t index1, float item); + Plugin::ArrayElementProxy1_2 operator[](int32_t index); }; } @@ -1479,8 +1636,19 @@ namespace System int32_t GetLength(); int32_t GetLength(int32_t dimension); int32_t GetRank(); - float GetItem(int32_t index0, int32_t index1, int32_t index2); - void SetItem(int32_t index0, int32_t index1, int32_t index2, float item); + Plugin::ArrayElementProxy1_3 operator[](int32_t index); + }; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_1 + { + int32_t Handle; + int32_t Index0; + ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0); + void operator=(System::String item); + operator System::String(); }; } @@ -1501,8 +1669,19 @@ namespace System Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); - System::String GetItem(int32_t index0); - void SetItem(int32_t index0, System::String item); + Plugin::ArrayElementProxy1_1 operator[](int32_t index); + }; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_1 + { + int32_t Handle; + int32_t Index0; + ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0); + void operator=(UnityEngine::Resolution item); + operator UnityEngine::Resolution(); }; } @@ -1523,8 +1702,19 @@ namespace System Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); - UnityEngine::Resolution GetItem(int32_t index0); - void SetItem(int32_t index0, UnityEngine::Resolution& item); + Plugin::ArrayElementProxy1_1 operator[](int32_t index); + }; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_1 + { + int32_t Handle; + int32_t Index0; + ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0); + void operator=(UnityEngine::RaycastHit item); + operator UnityEngine::RaycastHit(); }; } @@ -1545,8 +1735,19 @@ namespace System Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); - UnityEngine::RaycastHit GetItem(int32_t index0); - void SetItem(int32_t index0, UnityEngine::RaycastHit item); + Plugin::ArrayElementProxy1_1 operator[](int32_t index); + }; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_1 + { + int32_t Handle; + int32_t Index0; + ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0); + void operator=(UnityEngine::GradientColorKey item); + operator UnityEngine::GradientColorKey(); }; } @@ -1567,8 +1768,7 @@ namespace System Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); - UnityEngine::GradientColorKey GetItem(int32_t index0); - void SetItem(int32_t index0, UnityEngine::GradientColorKey& item); + Plugin::ArrayElementProxy1_1 operator[](int32_t index); }; } From 6657523369e69c6fd837b0b31364ae3ad1ee6e4a Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 12 Nov 2017 23:22:07 -0800 Subject: [PATCH 35/95] Support C++ classes that derive from C# classes and implement C# interfaces --- README.md | 4 +- Unity/Assets/NativeScript/Bindings.cs | 1722 ++++--- .../NativeScript/Editor/GenerateBindings.cs | 4222 ++++++++++------- Unity/Assets/NativeScriptTypes.json | 40 + Unity/CppSource/NativeScript/Bindings.cpp | 1570 +++++- Unity/CppSource/NativeScript/Bindings.h | 229 +- 6 files changed, 5222 insertions(+), 2565 deletions(-) diff --git a/README.md b/README.md index 55006c6..ad80b82 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,7 @@ While IL2CPP transforms C# into C++ already, it generates a lot of overhead. The * Delegates * Events * Boxing and unboxing (e.g. boxing `int` to `object`, casting `object` to `int`) + * Implementing C# interfaces and deriving from C# classes with C++ classes # Performance @@ -195,7 +196,8 @@ Note that the code generator does not support (yet): * `Array` methods (e.g. `IndexOf`) * `string` methods (e.g. `Substring`) * Default parameters -* Interfaces +* Overriding properties, events, and indexers +* Deriving from classes without a default constructor * `decimal` * C# pointers diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 242ca37..7822da0 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -327,6 +327,12 @@ delegate void InitDelegate( IntPtr systemCollectionsGenericListSystemStringPropertyGetItem, IntPtr systemCollectionsGenericListSystemStringPropertySetItem, IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString, + IntPtr systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer, + IntPtr systemCollectionsGenericListSystemInt32Constructor, + IntPtr systemCollectionsGenericListSystemInt32PropertyGetItem, + IntPtr systemCollectionsGenericListSystemInt32PropertySetItem, + IntPtr systemCollectionsGenericListSystemInt32MethodAddSystemInt32, + IntPtr systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer, IntPtr systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString, IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue, IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue, @@ -366,6 +372,14 @@ delegate void InitDelegate( IntPtr unboxScene, IntPtr boxLoadSceneMode, IntPtr unboxLoadSceneMode, + IntPtr releaseSystemCollectionsGenericIComparerSystemInt32, + IntPtr systemCollectionsGenericIComparerSystemInt32Constructor, + IntPtr releaseSystemCollectionsGenericIComparerSystemString, + IntPtr systemCollectionsGenericIComparerSystemStringConstructor, + IntPtr releaseSystemStringComparer, + IntPtr systemStringComparerConstructor, + IntPtr releaseSystemEventArgs, + IntPtr systemEventArgsConstructor, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -418,49 +432,67 @@ delegate void InitDelegate( IntPtr unityEngineGradientColorKeyArray1SetItem1, IntPtr releaseSystemAction, IntPtr systemActionConstructor, - IntPtr systemActionInvoke, IntPtr systemActionAdd, IntPtr systemActionRemove, + IntPtr systemActionInvoke, IntPtr releaseSystemActionSystemSingle, IntPtr systemActionSystemSingleConstructor, - IntPtr systemActionSystemSingleInvoke, IntPtr systemActionSystemSingleAdd, IntPtr systemActionSystemSingleRemove, + IntPtr systemActionSystemSingleInvoke, IntPtr releaseSystemActionSystemSingle_SystemSingle, IntPtr systemActionSystemSingle_SystemSingleConstructor, - IntPtr systemActionSystemSingle_SystemSingleInvoke, IntPtr systemActionSystemSingle_SystemSingleAdd, IntPtr systemActionSystemSingle_SystemSingleRemove, + IntPtr systemActionSystemSingle_SystemSingleInvoke, IntPtr releaseSystemFuncSystemInt32_SystemSingle_SystemDouble, IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor, - IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke, IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleAdd, IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleRemove, + IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke, IntPtr releaseSystemFuncSystemInt16_SystemInt32_SystemString, IntPtr systemFuncSystemInt16_SystemInt32_SystemStringConstructor, - IntPtr systemFuncSystemInt16_SystemInt32_SystemStringInvoke, IntPtr systemFuncSystemInt16_SystemInt32_SystemStringAdd, IntPtr systemFuncSystemInt16_SystemInt32_SystemStringRemove, + IntPtr systemFuncSystemInt16_SystemInt32_SystemStringInvoke, IntPtr releaseSystemAppDomainInitializer, IntPtr systemAppDomainInitializerConstructor, - IntPtr systemAppDomainInitializerInvoke, IntPtr systemAppDomainInitializerAdd, IntPtr systemAppDomainInitializerRemove, + IntPtr systemAppDomainInitializerInvoke, IntPtr releaseUnityEngineEventsUnityAction, IntPtr unityEngineEventsUnityActionConstructor, - IntPtr unityEngineEventsUnityActionInvoke, IntPtr unityEngineEventsUnityActionAdd, IntPtr unityEngineEventsUnityActionRemove, + IntPtr unityEngineEventsUnityActionInvoke, IntPtr releaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode, IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor, - IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke, IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd, - IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove + IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove, + IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke /*END INIT PARAMS*/); public delegate void SetCsharpExceptionDelegate(int handle); /*BEGIN MONOBEHAVIOUR DELEGATES*/ + public delegate int SystemCollectionsGenericIComparerSystemInt32CompareDelegate(int thisHandle, int param0, int param1); + public static SystemCollectionsGenericIComparerSystemInt32CompareDelegate SystemCollectionsGenericIComparerSystemInt32Compare; + + public delegate int SystemCollectionsGenericIComparerSystemStringCompareDelegate(int thisHandle, int param0, int param1); + public static SystemCollectionsGenericIComparerSystemStringCompareDelegate SystemCollectionsGenericIComparerSystemStringCompare; + + public delegate int SystemStringComparerCompareDelegate(int thisHandle, int param0, int param1); + public static SystemStringComparerCompareDelegate SystemStringComparerCompare; + + public delegate bool SystemStringComparerEqualsDelegate(int thisHandle, int param0, int param1); + public static SystemStringComparerEqualsDelegate SystemStringComparerEquals; + + public delegate int SystemStringComparerGetHashCodeDelegate(int thisHandle, int param0); + public static SystemStringComparerGetHashCodeDelegate SystemStringComparerGetHashCode; + + public delegate int SystemEventArgsToStringDelegate(int thisHandle); + public static SystemEventArgsToStringDelegate SystemEventArgsToString; + public delegate void MyGameMonoBehavioursTestScriptAwakeDelegate(int thisHandle); public static MyGameMonoBehavioursTestScriptAwakeDelegate MyGameMonoBehavioursTestScriptAwake; @@ -473,29 +505,29 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc public delegate void MyGameMonoBehavioursTestScriptUpdateDelegate(int thisHandle); public static MyGameMonoBehavioursTestScriptUpdateDelegate MyGameMonoBehavioursTestScriptUpdate; - public delegate void SystemActionCppInvokeDelegate(int thisHandle); - public static SystemActionCppInvokeDelegate SystemActionCppInvoke; + public delegate void SystemActionNativeInvokeDelegate(int thisHandle); + public static SystemActionNativeInvokeDelegate SystemActionNativeInvoke; - public delegate void SystemActionSystemSingleCppInvokeDelegate(int thisHandle, float param0); - public static SystemActionSystemSingleCppInvokeDelegate SystemActionSystemSingleCppInvoke; + public delegate void SystemActionSystemSingleNativeInvokeDelegate(int thisHandle, float param0); + public static SystemActionSystemSingleNativeInvokeDelegate SystemActionSystemSingleNativeInvoke; - public delegate void SystemActionSystemSingle_SystemSingleCppInvokeDelegate(int thisHandle, float param0, float param1); - public static SystemActionSystemSingle_SystemSingleCppInvokeDelegate SystemActionSystemSingle_SystemSingleCppInvoke; + public delegate void SystemActionSystemSingle_SystemSingleNativeInvokeDelegate(int thisHandle, float param0, float param1); + public static SystemActionSystemSingle_SystemSingleNativeInvokeDelegate SystemActionSystemSingle_SystemSingleNativeInvoke; - public delegate double SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvokeDelegate(int thisHandle, int param0, float param1); - public static SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvokeDelegate SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke; + public delegate double SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvokeDelegate(int thisHandle, int param0, float param1); + public static SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvokeDelegate SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke; - public delegate int SystemFuncSystemInt16_SystemInt32_SystemStringCppInvokeDelegate(int thisHandle, short param0, int param1); - public static SystemFuncSystemInt16_SystemInt32_SystemStringCppInvokeDelegate SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke; + public delegate int SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvokeDelegate(int thisHandle, short param0, int param1); + public static SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvokeDelegate SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke; - public delegate void SystemAppDomainInitializerCppInvokeDelegate(int thisHandle, int param0); - public static SystemAppDomainInitializerCppInvokeDelegate SystemAppDomainInitializerCppInvoke; + public delegate void SystemAppDomainInitializerNativeInvokeDelegate(int thisHandle, int param0); + public static SystemAppDomainInitializerNativeInvokeDelegate SystemAppDomainInitializerNativeInvoke; - public delegate void UnityEngineEventsUnityActionCppInvokeDelegate(int thisHandle); - public static UnityEngineEventsUnityActionCppInvokeDelegate UnityEngineEventsUnityActionCppInvoke; + public delegate void UnityEngineEventsUnityActionNativeInvokeDelegate(int thisHandle); + public static UnityEngineEventsUnityActionNativeInvokeDelegate UnityEngineEventsUnityActionNativeInvoke; - public delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvokeDelegate(int thisHandle, UnityEngine.SceneManagement.Scene param0, UnityEngine.SceneManagement.LoadSceneMode param1); - public static UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvokeDelegate UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvoke; + public delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvokeDelegate(int thisHandle, UnityEngine.SceneManagement.Scene param0, UnityEngine.SceneManagement.LoadSceneMode param1); + public static UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvokeDelegate UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke; public delegate void SetCsharpExceptionSystemNullReferenceExceptionDelegate(int param0); public static SetCsharpExceptionSystemNullReferenceExceptionDelegate SetCsharpExceptionSystemNullReferenceException; @@ -651,6 +683,12 @@ static extern void Init( IntPtr systemCollectionsGenericListSystemStringPropertyGetItem, IntPtr systemCollectionsGenericListSystemStringPropertySetItem, IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString, + IntPtr systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer, + IntPtr systemCollectionsGenericListSystemInt32Constructor, + IntPtr systemCollectionsGenericListSystemInt32PropertyGetItem, + IntPtr systemCollectionsGenericListSystemInt32PropertySetItem, + IntPtr systemCollectionsGenericListSystemInt32MethodAddSystemInt32, + IntPtr systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer, IntPtr systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString, IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue, IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue, @@ -690,6 +728,14 @@ static extern void Init( IntPtr unboxScene, IntPtr boxLoadSceneMode, IntPtr unboxLoadSceneMode, + IntPtr releaseSystemCollectionsGenericIComparerSystemInt32, + IntPtr systemCollectionsGenericIComparerSystemInt32Constructor, + IntPtr releaseSystemCollectionsGenericIComparerSystemString, + IntPtr systemCollectionsGenericIComparerSystemStringConstructor, + IntPtr releaseSystemStringComparer, + IntPtr systemStringComparerConstructor, + IntPtr releaseSystemEventArgs, + IntPtr systemEventArgsConstructor, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -742,50 +788,68 @@ static extern void Init( IntPtr unityEngineGradientColorKeyArray1SetItem1, IntPtr releaseSystemAction, IntPtr systemActionConstructor, - IntPtr systemActionInvoke, IntPtr systemActionAdd, IntPtr systemActionRemove, + IntPtr systemActionInvoke, IntPtr releaseSystemActionSystemSingle, IntPtr systemActionSystemSingleConstructor, - IntPtr systemActionSystemSingleInvoke, IntPtr systemActionSystemSingleAdd, IntPtr systemActionSystemSingleRemove, + IntPtr systemActionSystemSingleInvoke, IntPtr releaseSystemActionSystemSingle_SystemSingle, IntPtr systemActionSystemSingle_SystemSingleConstructor, - IntPtr systemActionSystemSingle_SystemSingleInvoke, IntPtr systemActionSystemSingle_SystemSingleAdd, IntPtr systemActionSystemSingle_SystemSingleRemove, + IntPtr systemActionSystemSingle_SystemSingleInvoke, IntPtr releaseSystemFuncSystemInt32_SystemSingle_SystemDouble, IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor, - IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke, IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleAdd, IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleRemove, + IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke, IntPtr releaseSystemFuncSystemInt16_SystemInt32_SystemString, IntPtr systemFuncSystemInt16_SystemInt32_SystemStringConstructor, - IntPtr systemFuncSystemInt16_SystemInt32_SystemStringInvoke, IntPtr systemFuncSystemInt16_SystemInt32_SystemStringAdd, IntPtr systemFuncSystemInt16_SystemInt32_SystemStringRemove, + IntPtr systemFuncSystemInt16_SystemInt32_SystemStringInvoke, IntPtr releaseSystemAppDomainInitializer, IntPtr systemAppDomainInitializerConstructor, - IntPtr systemAppDomainInitializerInvoke, IntPtr systemAppDomainInitializerAdd, IntPtr systemAppDomainInitializerRemove, + IntPtr systemAppDomainInitializerInvoke, IntPtr releaseUnityEngineEventsUnityAction, IntPtr unityEngineEventsUnityActionConstructor, - IntPtr unityEngineEventsUnityActionInvoke, IntPtr unityEngineEventsUnityActionAdd, IntPtr unityEngineEventsUnityActionRemove, + IntPtr unityEngineEventsUnityActionInvoke, IntPtr releaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode, IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor, - IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke, IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd, - IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove + IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove, + IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke /*END INIT PARAMS*/); [DllImport(PluginName)] static extern void SetCsharpException(int handle); /*BEGIN MONOBEHAVIOUR IMPORTS*/ + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsGenericIComparerSystemInt32Compare(int thisHandle, int param0, int param1); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsGenericIComparerSystemStringCompare(int thisHandle, int param0, int param1); + + [DllImport(Constants.PluginName)] + public static extern void SystemStringComparerCompare(int thisHandle, int param0, int param1); + + [DllImport(Constants.PluginName)] + public static extern void SystemStringComparerEquals(int thisHandle, int param0, int param1); + + [DllImport(Constants.PluginName)] + public static extern void SystemStringComparerGetHashCode(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemEventArgsToString(int thisHandle); + [DllImport(Constants.PluginName)] public static extern void MyGameMonoBehavioursTestScriptAwake(int thisHandle); @@ -799,28 +863,28 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc public static extern void MyGameMonoBehavioursTestScriptUpdate(int thisHandle); [DllImport(Constants.PluginName)] - public static extern void SystemActionCppInvoke(int thisHandle); + public static extern void SystemActionNativeInvoke(int thisHandle); [DllImport(Constants.PluginName)] - public static extern void SystemActionSystemSingleCppInvoke(int thisHandle, int param0); + public static extern void SystemActionSystemSingleNativeInvoke(int thisHandle, int param0); [DllImport(Constants.PluginName)] - public static extern void SystemActionSystemSingle_SystemSingleCppInvoke(int thisHandle, int param0, int param1); + public static extern void SystemActionSystemSingle_SystemSingleNativeInvoke(int thisHandle, int param0, int param1); [DllImport(Constants.PluginName)] - public static extern void SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke(int thisHandle, int param0, int param1); + public static extern void SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke(int thisHandle, int param0, int param1); [DllImport(Constants.PluginName)] - public static extern void SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke(int thisHandle, int param0, int param1); + public static extern void SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke(int thisHandle, int param0, int param1); [DllImport(Constants.PluginName)] - public static extern void SystemAppDomainInitializerCppInvoke(int thisHandle, int param0); + public static extern void SystemAppDomainInitializerNativeInvoke(int thisHandle, int param0); [DllImport(Constants.PluginName)] - public static extern void UnityEngineEventsUnityActionCppInvoke(int thisHandle); + public static extern void UnityEngineEventsUnityActionNativeInvoke(int thisHandle); [DllImport(Constants.PluginName)] - public static extern void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvoke(int thisHandle, UnityEngine.SceneManagement.Scene param0, int param1); + public static extern void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(int thisHandle, UnityEngine.SceneManagement.Scene param0, int param1); [DllImport(Constants.PluginName)] public static extern void SetCsharpExceptionSystemNullReferenceException(int thisHandle, int param0); @@ -886,6 +950,12 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc delegate int SystemCollectionsGenericListSystemStringPropertyGetItemDelegate(int thisHandle, int index); delegate void SystemCollectionsGenericListSystemStringPropertySetItemDelegate(int thisHandle, int index, int valueHandle); delegate void SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate(int thisHandle, int itemHandle); + delegate void SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate(int thisHandle, int comparerHandle); + delegate int SystemCollectionsGenericListSystemInt32ConstructorDelegate(); + delegate int SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate(int thisHandle, int index); + delegate void SystemCollectionsGenericListSystemInt32PropertySetItemDelegate(int thisHandle, int index, int value); + delegate void SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate(int thisHandle, int item); + delegate void SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate(int thisHandle, int comparerHandle); delegate int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate(int valueHandle); delegate int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate(int thisHandle); delegate void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate(int thisHandle, int valueHandle); @@ -925,6 +995,14 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc delegate UnityEngine.SceneManagement.Scene UnboxSceneDelegate(int valHandle); delegate int BoxLoadSceneModeDelegate(UnityEngine.SceneManagement.LoadSceneMode val); delegate UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneModeDelegate(int valHandle); + delegate void SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemCollectionsGenericIComparerSystemInt32Delegate(int handle); + delegate void SystemCollectionsGenericIComparerSystemStringConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemCollectionsGenericIComparerSystemStringDelegate(int handle); + delegate void SystemStringComparerConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemStringComparerDelegate(int handle); + delegate void SystemEventArgsConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemEventArgsDelegate(int handle); delegate int BoxBooleanDelegate(bool val); delegate bool UnboxBooleanDelegate(int valHandle); delegate int BoxSByteDelegate(sbyte val); @@ -975,44 +1053,44 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc delegate int UnityEngineUnityEngineGradientColorKeyArray1Constructor1Delegate(int length0); delegate UnityEngine.GradientColorKey UnityEngineGradientColorKeyArray1GetItem1Delegate(int thisHandle, int index0); delegate void UnityEngineGradientColorKeyArray1SetItem1Delegate(int thisHandle, int index0, ref UnityEngine.GradientColorKey item); + delegate void SystemActionInvokeDelegate(int thisHandle); 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 SystemActionSystemSingleInvokeDelegate(int thisHandle, float obj); 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_SystemSingleInvokeDelegate(int thisHandle, float arg1, float arg2); 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 double SystemFuncSystemInt32_SystemSingle_SystemDoubleInvokeDelegate(int thisHandle, int arg1, float arg2); 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 int SystemFuncSystemInt16_SystemInt32_SystemStringInvokeDelegate(int thisHandle, short arg1, int arg2); 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 SystemAppDomainInitializerInvokeDelegate(int thisHandle, int argsHandle); 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); + delegate void UnityEngineEventsUnityActionInvokeDelegate(int thisHandle); delegate void UnityEngineEventsUnityActionConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); delegate void ReleaseUnityEngineEventsUnityActionDelegate(int handle, int classHandle); - delegate void UnityEngineEventsUnityActionInvokeDelegate(int thisHandle); delegate void UnityEngineEventsUnityActionAddDelegate(int thisHandle, int delHandle); delegate void UnityEngineEventsUnityActionRemoveDelegate(int thisHandle, int delHandle); + delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate(int thisHandle, ref UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1); delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); delegate void ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeDelegate(int handle, int classHandle); - delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate(int thisHandle, ref UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1); delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAddDelegate(int thisHandle, int delHandle); delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemoveDelegate(int thisHandle, int delHandle); /*END DELEGATE TYPES*/ @@ -1049,18 +1127,24 @@ public static void Open( libraryHandle, "SetCsharpException"); /*BEGIN MONOBEHAVIOUR GETDELEGATE CALLS*/ + SystemCollectionsGenericIComparerSystemInt32Compare = GetDelegate(libraryHandle, "SystemCollectionsGenericIComparerSystemInt32Compare"); + SystemCollectionsGenericIComparerSystemStringCompare = GetDelegate(libraryHandle, "SystemCollectionsGenericIComparerSystemStringCompare"); + SystemStringComparerCompare = GetDelegate(libraryHandle, "SystemStringComparerCompare"); + SystemStringComparerEquals = GetDelegate(libraryHandle, "SystemStringComparerEquals"); + SystemStringComparerGetHashCode = GetDelegate(libraryHandle, "SystemStringComparerGetHashCode"); + SystemEventArgsToString = GetDelegate(libraryHandle, "SystemEventArgsToString"); MyGameMonoBehavioursTestScriptAwake = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptAwake"); MyGameMonoBehavioursTestScriptOnAnimatorIK = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptOnAnimatorIK"); MyGameMonoBehavioursTestScriptOnCollisionEnter = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptOnCollisionEnter"); MyGameMonoBehavioursTestScriptUpdate = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptUpdate"); - SystemActionCppInvoke = GetDelegate(libraryHandle, "SystemActionCppInvoke"); - SystemActionSystemSingleCppInvoke = GetDelegate(libraryHandle, "SystemActionSystemSingleCppInvoke"); - SystemActionSystemSingle_SystemSingleCppInvoke = GetDelegate(libraryHandle, "SystemActionSystemSingle_SystemSingleCppInvoke"); - SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke = GetDelegate(libraryHandle, "SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke"); - SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke = GetDelegate(libraryHandle, "SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke"); - SystemAppDomainInitializerCppInvoke = GetDelegate(libraryHandle, "SystemAppDomainInitializerCppInvoke"); - UnityEngineEventsUnityActionCppInvoke = GetDelegate(libraryHandle, "UnityEngineEventsUnityActionCppInvoke"); - UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvoke = GetDelegate(libraryHandle, "UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvoke"); + SystemActionNativeInvoke = GetDelegate(libraryHandle, "SystemActionNativeInvoke"); + SystemActionSystemSingleNativeInvoke = GetDelegate(libraryHandle, "SystemActionSystemSingleNativeInvoke"); + SystemActionSystemSingle_SystemSingleNativeInvoke = GetDelegate(libraryHandle, "SystemActionSystemSingle_SystemSingleNativeInvoke"); + SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke = GetDelegate(libraryHandle, "SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke"); + SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke = GetDelegate(libraryHandle, "SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke"); + SystemAppDomainInitializerNativeInvoke = GetDelegate(libraryHandle, "SystemAppDomainInitializerNativeInvoke"); + UnityEngineEventsUnityActionNativeInvoke = GetDelegate(libraryHandle, "UnityEngineEventsUnityActionNativeInvoke"); + UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke = GetDelegate(libraryHandle, "UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke"); SetCsharpExceptionSystemNullReferenceException = GetDelegate(libraryHandle, "SetCsharpExceptionSystemNullReferenceException"); /*END MONOBEHAVIOUR GETDELEGATE CALLS*/ @@ -1127,6 +1211,12 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringPropertyGetItemDelegate(SystemCollectionsGenericListSystemStringPropertyGetItem)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringPropertySetItemDelegate(SystemCollectionsGenericListSystemStringPropertySetItem)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate(SystemCollectionsGenericListSystemStringMethodAddSystemString)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate(SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32ConstructorDelegate(SystemCollectionsGenericListSystemInt32Constructor)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate(SystemCollectionsGenericListSystemInt32PropertyGetItem)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32PropertySetItemDelegate(SystemCollectionsGenericListSystemInt32PropertySetItem)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate(SystemCollectionsGenericListSystemInt32MethodAddSystemInt32)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate(SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate(SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate(SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue)), @@ -1166,6 +1256,14 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnboxSceneDelegate(UnboxScene)), Marshal.GetFunctionPointerForDelegate(new BoxLoadSceneModeDelegate(BoxLoadSceneMode)), Marshal.GetFunctionPointerForDelegate(new UnboxLoadSceneModeDelegate(UnboxLoadSceneMode)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericIComparerSystemInt32Delegate(ReleaseSystemCollectionsGenericIComparerSystemInt32)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate(SystemCollectionsGenericIComparerSystemInt32Constructor)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericIComparerSystemStringDelegate(ReleaseSystemCollectionsGenericIComparerSystemString)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIComparerSystemStringConstructorDelegate(SystemCollectionsGenericIComparerSystemStringConstructor)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemStringComparerDelegate(ReleaseSystemStringComparer)), + Marshal.GetFunctionPointerForDelegate(new SystemStringComparerConstructorDelegate(SystemStringComparerConstructor)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemEventArgsDelegate(ReleaseSystemEventArgs)), + Marshal.GetFunctionPointerForDelegate(new SystemEventArgsConstructorDelegate(SystemEventArgsConstructor)), Marshal.GetFunctionPointerForDelegate(new BoxBooleanDelegate(BoxBoolean)), Marshal.GetFunctionPointerForDelegate(new UnboxBooleanDelegate(UnboxBoolean)), Marshal.GetFunctionPointerForDelegate(new BoxSByteDelegate(BoxSByte)), @@ -1218,44 +1316,44 @@ public static void Open( 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 SystemActionInvokeDelegate(SystemActionInvoke)), 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 SystemActionSystemSingleInvokeDelegate(SystemActionSystemSingleInvoke)), 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 SystemActionSystemSingle_SystemSingleInvokeDelegate(SystemActionSystemSingle_SystemSingleInvoke)), 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 SystemFuncSystemInt32_SystemSingle_SystemDoubleInvokeDelegate(SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)), 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 SystemFuncSystemInt16_SystemInt32_SystemStringInvokeDelegate(SystemFuncSystemInt16_SystemInt32_SystemStringInvoke)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemAppDomainInitializerDelegate(ReleaseSystemAppDomainInitializer)), Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerConstructorDelegate(SystemAppDomainInitializerConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerInvokeDelegate(SystemAppDomainInitializerInvoke)), Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerAddDelegate(SystemAppDomainInitializerAdd)), Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerRemoveDelegate(SystemAppDomainInitializerRemove)), + Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerInvokeDelegate(SystemAppDomainInitializerInvoke)), Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineEventsUnityActionDelegate(ReleaseUnityEngineEventsUnityAction)), Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionConstructorDelegate(UnityEngineEventsUnityActionConstructor)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionInvokeDelegate(UnityEngineEventsUnityActionInvoke)), Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionAddDelegate(UnityEngineEventsUnityActionAdd)), Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionRemoveDelegate(UnityEngineEventsUnityActionRemove)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionInvokeDelegate(UnityEngineEventsUnityActionInvoke)), Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeDelegate(ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode)), Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructorDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)), Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAddDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemoveDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)) + Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemoveDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)) /*END INIT CALL*/ ); if (UnhandledCppException != null) @@ -1317,117 +1415,487 @@ static int ArrayGetRank(int handle) return ((Array)ObjectStore.Get(handle)).Rank; } - /*BEGIN FUNCTIONS*/ - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchConstructorDelegate))] - static int SystemDiagnosticsStopwatchConstructor() + /*BEGIN BASE TYPES*/ + class SystemCollectionsGenericIComparerSystemInt32 : System.Collections.Generic.IComparer { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Diagnostics.Stopwatch()); - return returnValue; - } - catch (System.NullReferenceException ex) + public int CppHandle; + + public SystemCollectionsGenericIComparerSystemInt32(int cppHandle) { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + CppHandle = cppHandle; } - catch (System.Exception ex) + + public int Compare(int x, int y) { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemCollectionsGenericIComparerSystemInt32Compare(thisHandle, x, y); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } return default(int); } } - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate))] - static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHandle) + class SystemCollectionsGenericIComparerSystemString : System.Collections.Generic.IComparer { - try - { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.ElapsedMilliseconds; - return returnValue; - } - catch (System.NullReferenceException ex) + public int CppHandle; + + public SystemCollectionsGenericIComparerSystemString(int cppHandle) { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(long); + CppHandle = cppHandle; } - catch (System.Exception ex) + + public int Compare(string x, string y) { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(long); + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int xHandle = NativeScript.Bindings.ObjectStore.GetHandle(x); + int yHandle = NativeScript.Bindings.ObjectStore.GetHandle(y); + var returnVal = NativeScript.Bindings.SystemCollectionsGenericIComparerSystemStringCompare(thisHandle, xHandle, yHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(int); } } - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodStartDelegate))] - static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) + class SystemStringComparer : System.StringComparer { - try + public int CppHandle; + + public SystemStringComparer(int cppHandle) { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Start(); + CppHandle = cppHandle; } - catch (System.NullReferenceException ex) + + public override int Compare(string x, string y) { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int xHandle = NativeScript.Bindings.ObjectStore.GetHandle(x); + int yHandle = NativeScript.Bindings.ObjectStore.GetHandle(y); + var returnVal = NativeScript.Bindings.SystemStringComparerCompare(thisHandle, xHandle, yHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(int); } - catch (System.Exception ex) + public override bool Equals(string x, string y) { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int xHandle = NativeScript.Bindings.ObjectStore.GetHandle(x); + int yHandle = NativeScript.Bindings.ObjectStore.GetHandle(y); + var returnVal = NativeScript.Bindings.SystemStringComparerEquals(thisHandle, xHandle, yHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(bool); + } + public override int GetHashCode(string obj) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int objHandle = NativeScript.Bindings.ObjectStore.GetHandle(obj); + var returnVal = NativeScript.Bindings.SystemStringComparerGetHashCode(thisHandle, objHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(int); } } - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodResetDelegate))] - static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) + class SystemEventArgs : System.EventArgs { - try - { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Reset(); - } - catch (System.NullReferenceException ex) + public int CppHandle; + + public SystemEventArgs(int cppHandle) { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + CppHandle = cppHandle; } - catch (System.Exception ex) + + public override string ToString() { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemEventArgsToString(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return (string)NativeScript.Bindings.ObjectStore.Get(returnVal); + } + return default(string); } } - [MonoPInvokeCallback(typeof(UnityEngineObjectPropertyGetNameDelegate))] - static int UnityEngineObjectPropertyGetName(int thisHandle) + class SystemAction { - try - { - var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.name; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) + public int CppHandle; + public System.Action Delegate; + + public SystemAction(int cppHandle) { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + CppHandle = cppHandle; + Delegate = NativeInvoke; } - catch (System.Exception ex) + + public void NativeInvoke() { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.SystemActionNativeInvoke(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } } } - [MonoPInvokeCallback(typeof(UnityEngineObjectPropertySetNameDelegate))] - static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) + class SystemActionSystemSingle + { + public int CppHandle; + public System.Action Delegate; + + public SystemActionSystemSingle(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke(float obj) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.SystemActionSystemSingleNativeInvoke(thisHandle, obj); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } + + class SystemActionSystemSingle_SystemSingle + { + public int CppHandle; + public System.Action Delegate; + + public SystemActionSystemSingle_SystemSingle(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke(float arg1, float arg2) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.SystemActionSystemSingle_SystemSingleNativeInvoke(thisHandle, arg1, arg2); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } + + class SystemFuncSystemInt32_SystemSingle_SystemDouble + { + public int CppHandle; + public System.Func Delegate; + + public SystemFuncSystemInt32_SystemSingle_SystemDouble(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public double NativeInvoke(int arg1, float arg2) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke(thisHandle, arg1, arg2); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(double); + } + } + + class SystemFuncSystemInt16_SystemInt32_SystemString + { + public int CppHandle; + public System.Func Delegate; + + public SystemFuncSystemInt16_SystemInt32_SystemString(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public string NativeInvoke(short arg1, int arg2) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke(thisHandle, arg1, arg2); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return (string)NativeScript.Bindings.ObjectStore.Get(returnVal); + } + return default(string); + } + } + + class SystemAppDomainInitializer + { + public int CppHandle; + public System.AppDomainInitializer Delegate; + + public SystemAppDomainInitializer(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke(string[] args) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int argsHandle = NativeScript.Bindings.ObjectStore.GetHandle(args); + NativeScript.Bindings.SystemAppDomainInitializerNativeInvoke(thisHandle, argsHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } + + class UnityEngineEventsUnityAction + { + public int CppHandle; + public UnityEngine.Events.UnityAction Delegate; + + public UnityEngineEventsUnityAction(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke() + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.UnityEngineEventsUnityActionNativeInvoke(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } + + class UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode + { + public int CppHandle; + public UnityEngine.Events.UnityAction Delegate; + + public UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(thisHandle, arg0, arg1); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } + /*END BASE TYPES*/ + + /*BEGIN FUNCTIONS*/ + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchConstructorDelegate))] + static int SystemDiagnosticsStopwatchConstructor() + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Diagnostics.Stopwatch()); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate))] + static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHandle) + { + try + { + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.ElapsedMilliseconds; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(long); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(long); + } + } + + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodStartDelegate))] + static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) + { + try + { + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Start(); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodResetDelegate))] + static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) + { + try + { + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Reset(); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineObjectPropertyGetNameDelegate))] + static int UnityEngineObjectPropertyGetName(int thisHandle) + { + try + { + var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.name; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineObjectPropertySetNameDelegate))] + static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) { try { @@ -2254,13 +2722,127 @@ static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate))] - static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(int keyHandle, double value) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate))] + static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(int keyHandle, double value) + { + try + { + var key = (string)NativeScript.Bindings.ObjectStore.Get(keyHandle); + var returnValue = NativeScript.Bindings.StructStore>.Store(new System.Collections.Generic.KeyValuePair(key, value)); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate))] + static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(int thisHandle) + { + try + { + var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); + var returnValue = thiz.Key; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate))] + static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(int thisHandle) + { + try + { + var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); + var returnValue = thiz.Value; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(double); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(double); + } + } + + [MonoPInvokeCallback(typeof(BoxKeyValuePairSystemString_SystemDoubleDelegate))] + static int BoxKeyValuePairSystemString_SystemDouble(int valHandle) + { + try + { + var val = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxKeyValuePairSystemString_SystemDoubleDelegate))] + static int UnboxKeyValuePairSystemString_SystemDouble(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore>.Store((System.Collections.Generic.KeyValuePair)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringConstructorDelegate))] + static int SystemCollectionsGenericListSystemStringConstructor() { try { - var key = (string)NativeScript.Bindings.ObjectStore.Get(keyHandle); - var returnValue = NativeScript.Bindings.StructStore>.Store(new System.Collections.Generic.KeyValuePair(key, value)); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); return returnValue; } catch (System.NullReferenceException ex) @@ -2277,13 +2859,13 @@ static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstruc } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate))] - static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(int thisHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertyGetItemDelegate))] + static int SystemCollectionsGenericListSystemStringPropertyGetItem(int thisHandle, int index) { try { - var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); - var returnValue = thiz.Key; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index]; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) @@ -2300,81 +2882,75 @@ static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleProperty } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate))] - static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(int thisHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertySetItemDelegate))] + static void SystemCollectionsGenericListSystemStringPropertySetItem(int thisHandle, int index, int valueHandle) { try { - var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); - var returnValue = thiz.Value; - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz[index] = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); } } - [MonoPInvokeCallback(typeof(BoxKeyValuePairSystemString_SystemDoubleDelegate))] - static int BoxKeyValuePairSystemString_SystemDouble(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate))] + static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int thisHandle, int itemHandle) { try { - var val = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); + thiz.Add(item); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxKeyValuePairSystemString_SystemDoubleDelegate))] - static int UnboxKeyValuePairSystemString_SystemDouble(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate))] + static void SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore>.Store((System.Collections.Generic.KeyValuePair)val); - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); + thiz.Sort(comparer); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringConstructorDelegate))] - static int SystemCollectionsGenericListSystemStringConstructor() + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32ConstructorDelegate))] + static int SystemCollectionsGenericListSystemInt32Constructor() { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); return returnValue; } catch (System.NullReferenceException ex) @@ -2391,14 +2967,14 @@ static int SystemCollectionsGenericListSystemStringConstructor() } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertyGetItemDelegate))] - static int SystemCollectionsGenericListSystemStringPropertyGetItem(int thisHandle, int index) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate))] + static int SystemCollectionsGenericListSystemInt32PropertyGetItem(int thisHandle, int index) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz[index]; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + return returnValue; } catch (System.NullReferenceException ex) { @@ -2414,13 +2990,12 @@ static int SystemCollectionsGenericListSystemStringPropertyGetItem(int thisHandl } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertySetItemDelegate))] - static void SystemCollectionsGenericListSystemStringPropertySetItem(int thisHandle, int index, int valueHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertySetItemDelegate))] + static void SystemCollectionsGenericListSystemInt32PropertySetItem(int thisHandle, int index, int value) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz[index] = value; } catch (System.NullReferenceException ex) @@ -2435,13 +3010,12 @@ static void SystemCollectionsGenericListSystemStringPropertySetItem(int thisHand } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate))] - static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int thisHandle, int itemHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate))] + static void SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(int thisHandle, int item) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz.Add(item); } catch (System.NullReferenceException ex) @@ -2456,6 +3030,27 @@ static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int th } } + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate))] + static void SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) + { + try + { + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); + thiz.Sort(comparer); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate))] static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(int valueHandle) { @@ -2987,120 +3582,288 @@ static UnityEngine.GradientColorKey UnboxGradientColorKey(int valHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.GradientColorKey)val; - return returnValue; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.GradientColorKey)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.GradientColorKey); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.GradientColorKey); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGradientConstructorDelegate))] + static int UnityEngineGradientConstructor() + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.Gradient()); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGradientPropertyGetColorKeysDelegate))] + static int UnityEngineGradientPropertyGetColorKeys(int thisHandle) + { + try + { + var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.colorKeys; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGradientPropertySetColorKeysDelegate))] + static void UnityEngineGradientPropertySetColorKeys(int thisHandle, int valueHandle) + { + try + { + var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.colorKeys = value; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemAppDomainSetupConstructorDelegate))] + static int SystemAppDomainSetupConstructor() + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.AppDomainSetup()); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertyGetAppDomainInitializerDelegate))] + static int SystemAppDomainSetupPropertyGetAppDomainInitializer(int thisHandle) + { + try + { + var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.AppDomainInitializer; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertySetAppDomainInitializerDelegate))] + static void SystemAppDomainSetupPropertySetAppDomainInitializer(int thisHandle, int valueHandle) + { + try + { + var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.AppDomainInitializer = value; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineApplicationAddEventOnBeforeRenderDelegate))] + static void UnityEngineApplicationAddEventOnBeforeRender(int delHandle) + { + try + { + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.Application.onBeforeRender += del; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineApplicationRemoveEventOnBeforeRenderDelegate))] + static void UnityEngineApplicationRemoveEventOnBeforeRender(int delHandle) + { + try + { + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.Application.onBeforeRender += del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); } } - [MonoPInvokeCallback(typeof(UnityEngineGradientConstructorDelegate))] - static int UnityEngineGradientConstructor() + [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate))] + static void UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(int delHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.Gradient()); - return returnValue; + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineGradientPropertyGetColorKeysDelegate))] - static int UnityEngineGradientPropertyGetColorKeys(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate))] + static void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(int delHandle) { try { - var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.colorKeys; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineGradientPropertySetColorKeysDelegate))] - static void UnityEngineGradientPropertySetColorKeys(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(BoxSceneDelegate))] + static int BoxScene(ref UnityEngine.SceneManagement.Scene val) { try { - var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.colorKeys = value; + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemAppDomainSetupConstructorDelegate))] - static int SystemAppDomainSetupConstructor() + [MonoPInvokeCallback(typeof(UnboxSceneDelegate))] + static UnityEngine.SceneManagement.Scene UnboxScene(int valHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.AppDomainSetup()); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.SceneManagement.Scene)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.SceneManagement.Scene); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.SceneManagement.Scene); } } - [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertyGetAppDomainInitializerDelegate))] - static int SystemAppDomainSetupPropertyGetAppDomainInitializer(int thisHandle) + [MonoPInvokeCallback(typeof(BoxLoadSceneModeDelegate))] + static int BoxLoadSceneMode(UnityEngine.SceneManagement.LoadSceneMode val) { try { - var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.AppDomainInitializer; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -3116,34 +3879,36 @@ static int SystemAppDomainSetupPropertyGetAppDomainInitializer(int thisHandle) } } - [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertySetAppDomainInitializerDelegate))] - static void SystemAppDomainSetupPropertySetAppDomainInitializer(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(UnboxLoadSceneModeDelegate))] + static UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneMode(int valHandle) { try { - var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.AppDomainInitializer = value; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.SceneManagement.LoadSceneMode)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.SceneManagement.LoadSceneMode); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.SceneManagement.LoadSceneMode); } } - [MonoPInvokeCallback(typeof(UnityEngineApplicationAddEventOnBeforeRenderDelegate))] - static void UnityEngineApplicationAddEventOnBeforeRender(int delHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate))] + static void SystemCollectionsGenericIComparerSystemInt32Constructor(int cppHandle, ref int handle) { try { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.Application.onBeforeRender += del; + var thiz = new SystemCollectionsGenericIComparerSystemInt32(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { @@ -3157,13 +3922,12 @@ static void UnityEngineApplicationAddEventOnBeforeRender(int delHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineApplicationRemoveEventOnBeforeRenderDelegate))] - static void UnityEngineApplicationRemoveEventOnBeforeRender(int delHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericIComparerSystemInt32Delegate))] + static void ReleaseSystemCollectionsGenericIComparerSystemInt32(int handle) { try { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.Application.onBeforeRender += del; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -3177,13 +3941,13 @@ static void UnityEngineApplicationRemoveEventOnBeforeRender(int delHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate))] - static void UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(int delHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIComparerSystemStringConstructorDelegate))] + static void SystemCollectionsGenericIComparerSystemStringConstructor(int cppHandle, ref int handle) { try { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; + var thiz = new SystemCollectionsGenericIComparerSystemString(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { @@ -3197,13 +3961,12 @@ static void UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(int delHan } } - [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate))] - static void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(int delHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericIComparerSystemStringDelegate))] + static void ReleaseSystemCollectionsGenericIComparerSystemString(int handle) { try { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -3217,93 +3980,81 @@ static void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(int del } } - [MonoPInvokeCallback(typeof(BoxSceneDelegate))] - static int BoxScene(ref UnityEngine.SceneManagement.Scene val) + [MonoPInvokeCallback(typeof(SystemStringComparerConstructorDelegate))] + static void SystemStringComparerConstructor(int cppHandle, ref int handle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = new SystemStringComparer(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxSceneDelegate))] - static UnityEngine.SceneManagement.Scene UnboxScene(int valHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemStringComparerDelegate))] + static void ReleaseSystemStringComparer(int handle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.SceneManagement.Scene)val; - return returnValue; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.SceneManagement.Scene); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.SceneManagement.Scene); } } - [MonoPInvokeCallback(typeof(BoxLoadSceneModeDelegate))] - static int BoxLoadSceneMode(UnityEngine.SceneManagement.LoadSceneMode val) + [MonoPInvokeCallback(typeof(SystemEventArgsConstructorDelegate))] + static void SystemEventArgsConstructor(int cppHandle, ref int handle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = new SystemEventArgs(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxLoadSceneModeDelegate))] - static UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneMode(int valHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemEventArgsDelegate))] + static void ReleaseSystemEventArgs(int handle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.SceneManagement.LoadSceneMode)val; - return returnValue; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.SceneManagement.LoadSceneMode); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.SceneManagement.LoadSceneMode); } } @@ -4415,30 +5166,22 @@ static void UnityEngineGradientColorKeyArray1SetItem1(int thisHandle, int index0 } } - class SystemAction + [MonoPInvokeCallback(typeof(SystemActionInvokeDelegate))] + static void SystemActionInvoke(int thisHandle) { - public int CppHandle; - public System.Action Delegate; - - public SystemAction(int cppHandle) + try { - CppHandle = cppHandle; - Delegate = Invoke; + ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(); } - - public void Invoke() + catch (System.NullReferenceException ex) { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - NativeScript.Bindings.SystemActionCppInvoke(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } } @@ -4448,8 +5191,7 @@ static void SystemActionConstructor(int cppHandle, ref int handle, ref int class try { var thiz = new SystemAction(cppHandle); - classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); - handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { @@ -4487,12 +5229,14 @@ static void ReleaseSystemAction(int handle, int classHandle) } } - [MonoPInvokeCallback(typeof(SystemActionInvokeDelegate))] - static void SystemActionInvoke(int thisHandle) + [MonoPInvokeCallback(typeof(SystemActionAddDelegate))] + static void SystemActionAdd(int thisHandle, int delHandle) { try { - ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(); + var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz += del; } catch (System.NullReferenceException ex) { @@ -4506,14 +5250,14 @@ static void SystemActionInvoke(int thisHandle) } } - [MonoPInvokeCallback(typeof(SystemActionAddDelegate))] - static void SystemActionAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemActionRemoveDelegate))] + static void SystemActionRemove(int thisHandle, int delHandle) { try { var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; + thiz -= del; } catch (System.NullReferenceException ex) { @@ -4527,14 +5271,12 @@ static void SystemActionAdd(int thisHandle, int delHandle) } } - [MonoPInvokeCallback(typeof(SystemActionRemoveDelegate))] - static void SystemActionRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemActionSystemSingleInvokeDelegate))] + static void SystemActionSystemSingleInvoke(int thisHandle, float obj) { try { - var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; + ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(obj); } catch (System.NullReferenceException ex) { @@ -4548,41 +5290,13 @@ static void SystemActionRemove(int thisHandle, int delHandle) } } - class SystemActionSystemSingle - { - public int CppHandle; - public System.Action Delegate; - - public SystemActionSystemSingle(int cppHandle) - { - CppHandle = cppHandle; - Delegate = Invoke; - } - - public void Invoke(float obj) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - NativeScript.Bindings.SystemActionSystemSingleCppInvoke(thisHandle, obj); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - [MonoPInvokeCallback(typeof(SystemActionSystemSingleConstructorDelegate))] static void SystemActionSystemSingleConstructor(int cppHandle, ref int handle, ref int classHandle) { try { var thiz = new SystemActionSystemSingle(cppHandle); - classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); - handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { @@ -4620,25 +5334,6 @@ static void ReleaseSystemActionSystemSingle(int handle, int classHandle) } } - [MonoPInvokeCallback(typeof(SystemActionSystemSingleInvokeDelegate))] - static void SystemActionSystemSingleInvoke(int thisHandle, float obj) - { - try - { - ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(obj); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - [MonoPInvokeCallback(typeof(SystemActionSystemSingleAddDelegate))] static void SystemActionSystemSingleAdd(int thisHandle, int delHandle) { @@ -4681,41 +5376,12 @@ static void SystemActionSystemSingleRemove(int thisHandle, int delHandle) } } - class SystemActionSystemSingle_SystemSingle - { - public int CppHandle; - public System.Action Delegate; - - public SystemActionSystemSingle_SystemSingle(int cppHandle) - { - CppHandle = cppHandle; - Delegate = Invoke; - } - - public void Invoke(float arg1, float arg2) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - NativeScript.Bindings.SystemActionSystemSingle_SystemSingleCppInvoke(thisHandle, arg1, arg2); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - - [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleConstructorDelegate))] - static void SystemActionSystemSingle_SystemSingleConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleInvokeDelegate))] + static void SystemActionSystemSingle_SystemSingleInvoke(int thisHandle, float arg1, float arg2) { try { - var thiz = new SystemActionSystemSingle_SystemSingle(cppHandle); - classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); - handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); } catch (System.NullReferenceException ex) { @@ -4729,17 +5395,13 @@ static void SystemActionSystemSingle_SystemSingleConstructor(int cppHandle, ref } } - [MonoPInvokeCallback(typeof(ReleaseSystemActionSystemSingle_SystemSingleDelegate))] - static void ReleaseSystemActionSystemSingle_SystemSingle(int handle, int classHandle) + [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleConstructorDelegate))] + static void SystemActionSystemSingle_SystemSingleConstructor(int cppHandle, ref int handle, ref int classHandle) { try { - if (classHandle != 0) - { - var thiz = (SystemActionSystemSingle_SystemSingle)NativeScript.Bindings.ObjectStore.Remove(classHandle); - thiz.CppHandle = 0; - } - NativeScript.Bindings.ObjectStore.Remove(handle); + var thiz = new SystemActionSystemSingle_SystemSingle(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { @@ -4753,12 +5415,17 @@ static void ReleaseSystemActionSystemSingle_SystemSingle(int handle, int classHa } } - [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleInvokeDelegate))] - static void SystemActionSystemSingle_SystemSingleInvoke(int thisHandle, float arg1, float arg2) + [MonoPInvokeCallback(typeof(ReleaseSystemActionSystemSingle_SystemSingleDelegate))] + static void ReleaseSystemActionSystemSingle_SystemSingle(int handle, int classHandle) { try { - ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); + if (classHandle != 0) + { + var thiz = (SystemActionSystemSingle_SystemSingle)NativeScript.Bindings.ObjectStore.Remove(classHandle); + thiz.CppHandle = 0; + } + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -4814,31 +5481,24 @@ static void SystemActionSystemSingle_SystemSingleRemove(int thisHandle, int delH } } - class SystemFuncSystemInt32_SystemSingle_SystemDouble + [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleInvokeDelegate))] + static double SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(int thisHandle, int arg1, float arg2) { - public int CppHandle; - public System.Func Delegate; - - public SystemFuncSystemInt32_SystemSingle_SystemDouble(int cppHandle) + try { - CppHandle = cppHandle; - Delegate = Invoke; + var returnValue = ((System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); + return returnValue; } - - public double Invoke(int arg1, float arg2) + catch (System.NullReferenceException ex) { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke(thisHandle, arg1, arg2); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(double); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(double); } } @@ -4849,8 +5509,7 @@ static void SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(int cppHa try { var thiz = new SystemFuncSystemInt32_SystemSingle_SystemDouble(cppHandle); - classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); - handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { @@ -4888,36 +5547,35 @@ static void ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(int handle, i } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleInvokeDelegate))] - static double SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(int thisHandle, int arg1, float arg2) + [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleAddDelegate))] + static void SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(int thisHandle, int delHandle) { try { - var returnValue = ((System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); - return returnValue; + var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz += del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleAddDelegate))] - static void SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleRemoveDelegate))] + static void SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(int thisHandle, int delHandle) { try { var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; + thiz -= del; } catch (System.NullReferenceException ex) { @@ -4931,53 +5589,25 @@ static void SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(int thisHandle, i } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleRemoveDelegate))] - static void SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringInvokeDelegate))] + static int SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(int thisHandle, short arg1, int arg2) { try { - var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; + var returnValue = ((System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - class SystemFuncSystemInt16_SystemInt32_SystemString - { - public int CppHandle; - public System.Func Delegate; - - public SystemFuncSystemInt16_SystemInt32_SystemString(int cppHandle) - { - CppHandle = cppHandle; - Delegate = Invoke; - } - - public string Invoke(short arg1, int arg2) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke(thisHandle, arg1, arg2); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return (string)NativeScript.Bindings.ObjectStore.Get(returnVal); - } - return default(string); + return default(int); } } @@ -4987,8 +5617,7 @@ static void SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(int cppHan try { var thiz = new SystemFuncSystemInt16_SystemInt32_SystemString(cppHandle); - classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); - handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { @@ -5026,36 +5655,35 @@ static void ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(int handle, in } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringInvokeDelegate))] - static int SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(int thisHandle, short arg1, int arg2) + [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringAddDelegate))] + static void SystemFuncSystemInt16_SystemInt32_SystemStringAdd(int thisHandle, int delHandle) { try { - var returnValue = ((System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz += del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringAddDelegate))] - static void SystemFuncSystemInt16_SystemInt32_SystemStringAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringRemoveDelegate))] + static void SystemFuncSystemInt16_SystemInt32_SystemStringRemove(int thisHandle, int delHandle) { try { var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; + thiz -= del; } catch (System.NullReferenceException ex) { @@ -5069,14 +5697,13 @@ static void SystemFuncSystemInt16_SystemInt32_SystemStringAdd(int thisHandle, in } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringRemoveDelegate))] - static void SystemFuncSystemInt16_SystemInt32_SystemStringRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemAppDomainInitializerInvokeDelegate))] + static void SystemAppDomainInitializerInvoke(int thisHandle, int argsHandle) { try { - var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; + var args = (string[])NativeScript.Bindings.ObjectStore.Get(argsHandle); + ((System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle))(args); } catch (System.NullReferenceException ex) { @@ -5090,42 +5717,13 @@ static void SystemFuncSystemInt16_SystemInt32_SystemStringRemove(int thisHandle, } } - class SystemAppDomainInitializer - { - public int CppHandle; - public System.AppDomainInitializer Delegate; - - public SystemAppDomainInitializer(int cppHandle) - { - CppHandle = cppHandle; - Delegate = Invoke; - } - - public void Invoke(string[] args) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int argsHandle = NativeScript.Bindings.ObjectStore.GetHandle(args); - NativeScript.Bindings.SystemAppDomainInitializerCppInvoke(thisHandle, argsHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - [MonoPInvokeCallback(typeof(SystemAppDomainInitializerConstructorDelegate))] static void SystemAppDomainInitializerConstructor(int cppHandle, ref int handle, ref int classHandle) { try { var thiz = new SystemAppDomainInitializer(cppHandle); - classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); - handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { @@ -5163,13 +5761,14 @@ static void ReleaseSystemAppDomainInitializer(int handle, int classHandle) } } - [MonoPInvokeCallback(typeof(SystemAppDomainInitializerInvokeDelegate))] - static void SystemAppDomainInitializerInvoke(int thisHandle, int argsHandle) + [MonoPInvokeCallback(typeof(SystemAppDomainInitializerAddDelegate))] + static void SystemAppDomainInitializerAdd(int thisHandle, int delHandle) { try { - var args = (string[])NativeScript.Bindings.ObjectStore.Get(argsHandle); - ((System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle))(args); + var thiz = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz += del; } catch (System.NullReferenceException ex) { @@ -5183,14 +5782,14 @@ static void SystemAppDomainInitializerInvoke(int thisHandle, int argsHandle) } } - [MonoPInvokeCallback(typeof(SystemAppDomainInitializerAddDelegate))] - static void SystemAppDomainInitializerAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemAppDomainInitializerRemoveDelegate))] + static void SystemAppDomainInitializerRemove(int thisHandle, int delHandle) { try { var thiz = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; + thiz -= del; } catch (System.NullReferenceException ex) { @@ -5204,14 +5803,12 @@ static void SystemAppDomainInitializerAdd(int thisHandle, int delHandle) } } - [MonoPInvokeCallback(typeof(SystemAppDomainInitializerRemoveDelegate))] - static void SystemAppDomainInitializerRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionInvokeDelegate))] + static void UnityEngineEventsUnityActionInvoke(int thisHandle) { try { - var thiz = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; + ((UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle))(); } catch (System.NullReferenceException ex) { @@ -5225,41 +5822,13 @@ static void SystemAppDomainInitializerRemove(int thisHandle, int delHandle) } } - class UnityEngineEventsUnityAction - { - public int CppHandle; - public UnityEngine.Events.UnityAction Delegate; - - public UnityEngineEventsUnityAction(int cppHandle) - { - CppHandle = cppHandle; - Delegate = Invoke; - } - - public void Invoke() - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - NativeScript.Bindings.UnityEngineEventsUnityActionCppInvoke(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionConstructorDelegate))] static void UnityEngineEventsUnityActionConstructor(int cppHandle, ref int handle, ref int classHandle) { try { var thiz = new UnityEngineEventsUnityAction(cppHandle); - classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); - handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { @@ -5297,12 +5866,14 @@ static void ReleaseUnityEngineEventsUnityAction(int handle, int classHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionInvokeDelegate))] - static void UnityEngineEventsUnityActionInvoke(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionAddDelegate))] + static void UnityEngineEventsUnityActionAdd(int thisHandle, int delHandle) { try { - ((UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle))(); + var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz += del; } catch (System.NullReferenceException ex) { @@ -5316,14 +5887,14 @@ static void UnityEngineEventsUnityActionInvoke(int thisHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionAddDelegate))] - static void UnityEngineEventsUnityActionAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionRemoveDelegate))] + static void UnityEngineEventsUnityActionRemove(int thisHandle, int delHandle) { try { var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; + thiz -= del; } catch (System.NullReferenceException ex) { @@ -5337,14 +5908,12 @@ static void UnityEngineEventsUnityActionAdd(int thisHandle, int delHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionRemoveDelegate))] - static void UnityEngineEventsUnityActionRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate))] + static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(int thisHandle, ref UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1) { try { - var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; + ((UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg0, arg1); } catch (System.NullReferenceException ex) { @@ -5358,41 +5927,13 @@ static void UnityEngineEventsUnityActionRemove(int thisHandle, int delHandle) } } - class UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode - { - public int CppHandle; - public UnityEngine.Events.UnityAction Delegate; - - public UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int cppHandle) - { - CppHandle = cppHandle; - Delegate = Invoke; - } - - public void Invoke(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - NativeScript.Bindings.UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvoke(thisHandle, arg0, arg1); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructorDelegate))] static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor(int cppHandle, ref int handle, ref int classHandle) { try { var thiz = new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(cppHandle); - classHandle = NativeScript.Bindings.ObjectStore.Store(thiz); - handle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { @@ -5430,25 +5971,6 @@ static void ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_U } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate))] - static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(int thisHandle, ref UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1) - { - try - { - ((UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg0, arg1); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAddDelegate))] static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd(int thisHandle, int delHandle) { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 0ddb332..a7b5fc1 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -94,6 +94,15 @@ class JsonType public int MaxSimultaneous; } + [Serializable] + class JsonBaseType + { + public string Name; + public JsonGenericParams[] GenericParams; + public int MaxSimultaneous; + public JsonMethod[] OverrideMethods; + } + [Serializable] class JsonMonoBehaviour { @@ -121,6 +130,7 @@ class JsonDocument { public string[] Assemblies; public JsonType[] Types; + public JsonBaseType[] BaseTypes; public JsonMonoBehaviour[] MonoBehaviours; public JsonArray[] Arrays; public JsonDelegate[] Delegates; @@ -130,43 +140,45 @@ class JsonDocument class StringBuilders { - public StringBuilder CsharpInitParams = + public readonly StringBuilder CsharpInitParams = + new StringBuilder(InitialStringBuilderCapacity); + public readonly StringBuilder CsharpDelegateTypes = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CsharpDelegateTypes = + public readonly StringBuilder CsharpStructStoreInitCalls = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CsharpStructStoreInitCalls = + public readonly StringBuilder CsharpInitCall = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CsharpInitCall = + public readonly StringBuilder CsharpBaseTypes = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CsharpFunctions = + public readonly StringBuilder CsharpFunctions = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CsharpMonoBehaviours = + public readonly StringBuilder CsharpMonoBehaviours = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CsharpDelegates = + public readonly StringBuilder CsharpDelegates = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CsharpImports = + public readonly StringBuilder CsharpImports = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CsharpGetDelegateCalls = + public readonly StringBuilder CsharpGetDelegateCalls = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CppFunctionPointers = + public readonly StringBuilder CppFunctionPointers = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CppTypeDeclarations = + public readonly StringBuilder CppTypeDeclarations = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CppTypeDefinitions = + public readonly StringBuilder CppTypeDefinitions = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CppMethodDefinitions = + public readonly StringBuilder CppMethodDefinitions = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CppInitParams = + public readonly StringBuilder CppInitParams = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CppInitBody = + public readonly StringBuilder CppInitBody = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CppMonoBehaviourMessages = + public readonly StringBuilder CppMonoBehaviourMessages = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CppGlobalStateAndFunctions = + public readonly StringBuilder CppGlobalStateAndFunctions = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder CppBoxingMethodDeclarations = + public readonly StringBuilder CppBoxingMethodDeclarations = new StringBuilder(InitialStringBuilderCapacity); - public StringBuilder TempStrBuilder = + public readonly StringBuilder TempStrBuilder = new StringBuilder(InitialStringBuilderCapacity); } @@ -206,10 +218,7 @@ enum TypeKind Primitive, // A pointer to any type, either X*, IntPtr, or UIntPtr - Pointer, - - // The decimal type - Decimal + Pointer } // Compares by field declaration order @@ -231,8 +240,8 @@ int IComparer.Compare(object x, object y) class MessageInfo { - public string Name; - public Type[] ParameterTypes; + public readonly string Name; + public readonly Type[] ParameterTypes; public bool Selected; public MessageInfo( @@ -310,7 +319,7 @@ public MessageInfo( new MessageInfo("Update"), }; - private static readonly Type[] PRIMITIVE_TYPES = new [] { + private static readonly Type[] PRIMITIVE_TYPES = { typeof(bool), typeof(sbyte), typeof(byte), @@ -326,7 +335,6 @@ public MessageInfo( }; const string PostCompileWorkPref = "NativeScriptGenerateBindingsPostCompileWork"; - const string DryRunPref = "NativeScriptGenerateBindingsDryRun"; static readonly string DotNetDllsDirPath = new FileInfo( new Uri(typeof(string).Assembly.CodeBase).LocalPath @@ -365,87 +373,68 @@ static readonly FieldOrderComparer DefaultFieldOrderComparer [MenuItem("NativeScript/Generate Bindings #%g")] public static void Generate() - { - Generate(false); - } - - [MenuItem("NativeScript/Generate Bindings (dry run) #%&g")] - public static void GenerateDryRun() - { - Generate(true); - } - - static void Generate(bool dryRun) { EditorPrefs.DeleteKey(PostCompileWorkPref); - EditorPrefs.SetBool(DryRunPref, dryRun); - if (dryRun) - { - DoPostCompileWork(true); - } - else + JsonDocument doc = LoadJson(); + Assembly[] assemblies = GetAssemblies(doc.Assemblies); + + // Determine whether we need to generate stubs + // We can skip this step if we've already generated all the + // required MonoBehaviour classes and their messages + bool needStubs = false; + foreach (JsonMonoBehaviour monoBehaviour in doc.MonoBehaviours) { - JsonDocument doc = LoadJson(); - Assembly[] assemblies = GetAssemblies(doc.Assemblies); + // Check if the MonoBehaviour type is already generated + Type type = TryGetType( + monoBehaviour.Name, + assemblies); + if (type == null) + { + needStubs = true; + break; + } - // Determine whether we need to generate stubs - // We can skip this step if we've already generated all the - // required MonoBehaviour classes and their messages - bool needStubs = false; - foreach (JsonMonoBehaviour monoBehaviour in doc.MonoBehaviours) + // Check if all the messages are already generated + foreach (string message in monoBehaviour.Messages) { - // Check if the MonoBehaviour type is already generated - Type type = TryGetType( - monoBehaviour.Name, - assemblies); - if (type == null) + MethodInfo methodInfo = type.GetMethod(message); + if (methodInfo == null) { needStubs = true; - break; - } - - // Check if all the messages are already generated - foreach (string message in monoBehaviour.Messages) - { - MethodInfo methodInfo = type.GetMethod(message); - if (methodInfo == null) - { - needStubs = true; - goto determinedNeedStubs; - } + goto determinedNeedStubs; } } - determinedNeedStubs:; + } + determinedNeedStubs:; + + if (needStubs) + { + // We'll need to be able to get these via reflection later + StringBuilder csharpMonoBehaviours = new StringBuilder( + InitialStringBuilderCapacity); + string timestamp = DateTime.Now.ToLongTimeString(); + AppendStubMonoBehaviours( + doc.MonoBehaviours, + timestamp, + csharpMonoBehaviours); - if (needStubs) - { - // We'll need to be able to get these via reflection later - StringBuilder csharpMonoBehaviours = new StringBuilder( - InitialStringBuilderCapacity); - string timestamp = DateTime.Now.ToLongTimeString(); - AppendStubMonoBehaviours( - doc.MonoBehaviours, - timestamp, - csharpMonoBehaviours); - - // Inject - string csharpContents = File.ReadAllText(CsharpPath); - csharpContents = InjectIntoString( - csharpContents, - "/*BEGIN MONOBEHAVIOURS*/\n", - "\n/*END MONOBEHAVIOURS*/", - csharpMonoBehaviours.ToString()); - File.WriteAllText(CsharpPath, csharpContents); - - // Compile and continue after scripts are refreshed - Debug.Log("Waiting for compile..."); - AssetDatabase.Refresh(); - EditorPrefs.SetBool(PostCompileWorkPref, true); - } - else - { - DoPostCompileWork(true); - } + // Inject + string csharpContents = File.ReadAllText(CsharpPath); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN MONOBEHAVIOURS*/\n", + "\n/*END MONOBEHAVIOURS*/", + csharpMonoBehaviours.ToString()); + File.WriteAllText(CsharpPath, csharpContents); + + // Compile and continue after scripts are refreshed + Debug.Log("Waiting for compile..."); + AssetDatabase.Refresh(); + EditorPrefs.SetBool(PostCompileWorkPref, true); + } + else + { + DoPostCompileWork(true); } } @@ -512,9 +501,6 @@ static void OnScriptsReloaded() static void DoPostCompileWork(bool canRefreshAssetDb) { - bool dryRun = EditorPrefs.GetBool(DryRunPref); - EditorPrefs.DeleteKey(DryRunPref); - DateTime beforeTime = DateTime.Now; JsonDocument doc = LoadJson(); @@ -522,14 +508,29 @@ static void DoPostCompileWork(bool canRefreshAssetDb) StringBuilders builders = new StringBuilders(); // Generate types - foreach (JsonType jsonType in doc.Types) + if (doc.Types != null) { - AppendType( - jsonType, - assemblies, - builders); + foreach (JsonType jsonType in doc.Types) + { + AppendType( + jsonType, + assemblies, + builders); + } } - + + // Generate base types + if (doc.BaseTypes != null) + { + foreach (JsonBaseType jsonBaseType in doc.BaseTypes) + { + AppendBaseType( + jsonBaseType, + assemblies, + builders); + } + } + // Generate boxing and unboxing for primitive types foreach (Type type in PRIMITIVE_TYPES) { @@ -537,7 +538,6 @@ static void DoPostCompileWork(bool canRefreshAssetDb) type, TypeKind.Primitive, null, - assemblies, builders); } @@ -584,29 +584,22 @@ static void DoPostCompileWork(bool canRefreshAssetDb) RemoveTrailingChars(builders); - if (dryRun) + InjectBuilders(builders); + if (canRefreshAssetDb) { - LogStringBuilders(builders); + AssetDatabase.Refresh(); + DateTime afterTime = DateTime.Now; + TimeSpan duration = afterTime - beforeTime; + Debug.LogFormat( + "Done generating bindings in {0} seconds.", + duration.TotalSeconds); } else { - InjectBuilders(builders); - if (canRefreshAssetDb) - { - AssetDatabase.Refresh(); - DateTime afterTime = DateTime.Now; - TimeSpan duration = afterTime - beforeTime; - Debug.LogFormat( - "Done generating bindings in {0} seconds.", - duration.TotalSeconds); - } - else - { - Debug.LogWarning( - "Can't auto-refresh due to a bug in Unity. " + - "Please manually refresh assets with " + - "Assets -> Refresh to finish generating bindings"); - } + Debug.LogWarning( + "Can't auto-refresh due to a bug in Unity. " + + "Please manually refresh assets with " + + "Assets -> Refresh to finish generating bindings"); } } @@ -999,7 +992,6 @@ static void AppendNamespace( { break; } - break; } output.Append( namespaceName, @@ -1180,13 +1172,11 @@ static void AppendType( { AppendEnum( type, - assemblies, builders); AppendBoxingUnboxing( type, typeKind, null, - assemblies, builders); } else @@ -1229,7 +1219,6 @@ static void AppendType( genericType, typeKind, typeParams, - assemblies, builders); } } @@ -1253,7 +1242,6 @@ static void AppendType( type, typeKind, null, - assemblies, builders); } } @@ -1269,14 +1257,6 @@ static void AppendType( Assembly[] assemblies, StringBuilders builders) { - builders.TempStrBuilder.Length = 0; - AppendTypeNameWithoutGenericSuffix( - type.Name, - builders.TempStrBuilder); - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string typeNameLower = builders.TempStrBuilder.ToString(); - bool isStatic = IsStatic(type); TypeKind typeKind = GetTypeKind(type); if (!isStatic && typeKind == TypeKind.ManagedStruct) @@ -1334,7 +1314,7 @@ static void AppendType( paramInfo.IsRef = false; paramInfo.DereferencedParameterType = typeof(int); paramInfo.Kind = TypeKind.Primitive; - ParameterInfo[] parameters = new[] { paramInfo }; + ParameterInfo[] parameters = { paramInfo }; // ReleaseX C# delegate type AppendCsharpDelegateType( @@ -1353,7 +1333,6 @@ static void AppendType( true, typeKind, typeof(void), - null, parameters, builders.CsharpFunctions); builders.CsharpFunctions.Append( @@ -1473,14 +1452,15 @@ static void AppendType( builders.CppTypeDeclarations); // C++ type definition (beginning) + Type baseType = type.BaseType ?? typeof(object); AppendCppTypeDefinitionBegin( type.Name, type.Namespace, typeKind, typeParams, - type.BaseType.Name, - type.BaseType.Namespace, - type.BaseType.GetGenericArguments(), + baseType.Name, + baseType.Namespace, + baseType.GetGenericArguments(), isStatic, indent, builders.CppTypeDefinitions); @@ -1491,9 +1471,9 @@ static void AppendType( type.Namespace, typeKind, typeParams, - type.BaseType.Name, - type.BaseType.Namespace, - type.BaseType.GetGenericArguments(), + baseType.Name, + baseType.Namespace, + baseType.GetGenericArguments(), isStatic, indent, builders.CppMethodDefinitions); @@ -1519,7 +1499,6 @@ static void AppendType( assemblies, typeParams, genericArgTypes, - typeNameLower, indent, builders); } @@ -1581,7 +1560,6 @@ static void AppendType( isStatic, typeKind, typeParams, - genericArgTypes, indent, builders ); @@ -1602,7 +1580,6 @@ static void AppendType( typeKind, methods, typeParams, - typeNameLower, genericArgTypes, indent, builders); @@ -1621,6 +1598,60 @@ static void AppendType( builders.CppMethodDefinitions); } + static void AppendBaseType( + JsonBaseType jsonBaseType, + Assembly[] assemblies, + StringBuilders builders) + { + Type type = GetType(jsonBaseType.Name, assemblies); + Type[] genericArgTypes = type.GetGenericArguments(); + if (jsonBaseType.GenericParams != null) + { + if (!IsStatic(type)) + { + AppendCppTemplateDeclaration( + type.Name, + type.Namespace, + genericArgTypes.Length, + builders.CppTypeDeclarations); + } + + foreach (JsonGenericParams jsonGenericParams + in jsonBaseType.GenericParams) + { + Type[] typeParams = GetTypes( + jsonGenericParams.Types, + assemblies); + Type genericType = type.MakeGenericType(typeParams); + int? maxSimultaneous = jsonGenericParams.MaxSimultaneous != 0 + ? jsonGenericParams.MaxSimultaneous + : jsonBaseType.MaxSimultaneous != 0 + ? jsonBaseType.MaxSimultaneous + : default(int?); + AppendBaseType( + genericType, + jsonBaseType, + type.Name, + typeParams, + maxSimultaneous, + builders); + } + } + else + { + int? maxSimultaneous = jsonBaseType.MaxSimultaneous != 0 + ? jsonBaseType.MaxSimultaneous + : default(int?); + AppendBaseType( + type, + jsonBaseType, + type.Name, + null, + maxSimultaneous, + builders); + } + } + static void AppendReleaseFunctionNameSuffix( string typeName, string typeNamespace, @@ -1656,7 +1687,6 @@ static void AppendReleaseFunctionNameSuffix( static void AppendEnum( Type type, - Assembly[] assemblies, StringBuilders builders) { // C++ type declaration (actually definition) @@ -1710,7 +1740,6 @@ static void AppendBoxingUnboxing( Type type, TypeKind typeKind, Type[] typeParams, - Assembly[] assemblies, StringBuilders builders) { builders.TempStrBuilder.Length = 0; @@ -1753,7 +1782,7 @@ static void AppendBoxingUnboxing( builders.TempStrBuilder.Append(unboxMethodDefinitionName); string unboxMethodDeclarationName = builders.TempStrBuilder.ToString(); - ParameterInfo[] boxParams = new [] { + ParameterInfo[] boxParams = { new ParameterInfo { Name = "val", @@ -1765,7 +1794,7 @@ static void AppendBoxingUnboxing( } }; - ParameterInfo[] unboxParams = new [] { + ParameterInfo[] unboxParams = { new ParameterInfo { Name = "val", @@ -1820,7 +1849,6 @@ static void AppendBoxingUnboxing( true, TypeKind.Class, typeof(object), - typeParams, boxParams, builders.CsharpFunctions); builders.CsharpFunctions.Append( @@ -1840,7 +1868,6 @@ static void AppendBoxingUnboxing( true, TypeKind.Class, type, - null, unboxParams, builders.CsharpFunctions); switch (typeKind) @@ -2088,7 +2115,6 @@ static void AppendConstructor( Assembly[] assemblies, Type[] enclosingTypeParams, Type[] genericArgTypes, - string typeNameLower, int indent, StringBuilders builders) { @@ -2184,7 +2210,6 @@ static void AppendConstructor( true, enclosingTypeKind, enclosingType, - null, parameters, builders.CsharpFunctions); builders.CsharpFunctions.Append("new "); @@ -2192,7 +2217,6 @@ static void AppendConstructor( enclosingType, builders.CsharpFunctions); AppendCsharpFunctionCallParameters( - true, parameters, builders.CsharpFunctions); builders.CsharpFunctions.Append(";"); @@ -2212,7 +2236,6 @@ static void AppendConstructor( true, enclosingTypeKind, typeof(int), - null, parameters, builders.CsharpFunctions); AppendHandleStoreTypeName( @@ -2224,7 +2247,6 @@ static void AppendConstructor( enclosingType, builders.CsharpFunctions); AppendCsharpFunctionCallParameters( - true, parameters, builders.CsharpFunctions); builders.CsharpFunctions.Append(");"); @@ -2382,7 +2404,7 @@ static void AppendProperty( if (jsonPropertyGet != null) { PropertyInfo property = null; - MethodInfo getMethod = null; + MethodInfo getMethod; if (jsonPropertyGet.ParamTypes != null) { PropertyInfo[] properties = enclosingType.GetProperties(); @@ -2414,9 +2436,19 @@ static void AppendProperty( else { property = enclosingType.GetProperty(jsonProperty.Name); - getMethod = property.GetGetMethod(); } + if (property == null) + { + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("Property '"); + builders.TempStrBuilder.Append(jsonProperty.Name); + builders.TempStrBuilder.Append("' not found on "); + builders.TempStrBuilder.Append(enclosingType); + throw new Exception(builders.TempStrBuilder.ToString()); + } + + getMethod = property.GetGetMethod(); if (getMethod != null) { Type propertyType = property.PropertyType; @@ -2452,7 +2484,6 @@ static void AppendProperty( if (jsonPropertySet != null) { PropertyInfo property = null; - MethodInfo setMethod = null; if (jsonPropertySet.ParamTypes != null) { PropertyInfo[] properties = enclosingType.GetProperties(); @@ -2465,7 +2496,7 @@ static void AppendProperty( } // Must have a set method - setMethod = curProperty.GetSetMethod(); + MethodInfo setMethod = curProperty.GetSetMethod(); if (setMethod == null) { continue; @@ -2484,7 +2515,16 @@ static void AppendProperty( else { property = enclosingType.GetProperty(jsonProperty.Name); - setMethod = property.GetSetMethod(); + } + + if (property == null) + { + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("Property '"); + builders.TempStrBuilder.Append(jsonProperty.Name); + builders.TempStrBuilder.Append("' not found on "); + builders.TempStrBuilder.Append(enclosingType); + throw new Exception(builders.TempStrBuilder.ToString()); } MethodInfo method = property.GetSetMethod(); @@ -2509,7 +2549,6 @@ static void AppendProperty( jsonPropertySet.IsReadOnly, enclosingType, typeParams, - property.PropertyType, indent, exceptionTypes, builders); @@ -2619,7 +2658,7 @@ static void AppendField( setParam.DereferencedParameterType = setParam.ParameterType; setParam.Kind = GetTypeKind( setParam.DereferencedParameterType); - ParameterInfo[] parameters = new []{ setParam }; + ParameterInfo[] parameters = { setParam }; AppendSetter( field.Name, "Field", @@ -2630,7 +2669,6 @@ static void AppendField( false, enclosingType, typeTypeParams, - fieldType, indent, exceptionTypes, builders); @@ -2642,7 +2680,6 @@ static void AppendEvent( bool enclosingTypeIsStatic, TypeKind enclosingTypeKind, Type[] typeTypeParams, - Type[] typeGenericArgumentTypes, int indent, StringBuilders builders) { @@ -2653,7 +2690,7 @@ static void AppendEvent( string uppercaseEventName = char.ToUpper(jsonEvent.Name[0]) + jsonEvent.Name.Substring(1); - ParameterInfo[] addRemoveParams = new ParameterInfo[] { + ParameterInfo[] addRemoveParams = { new ParameterInfo { Name = "del", ParameterType = eventType, @@ -2756,7 +2793,6 @@ static void AppendEventAddRemoveMethod( methodIsStatic, enclosingTypeKind, typeof(void), - typeTypeParams, methodParams, builders.CsharpFunctions); AppendCsharpFunctionCallSubject( @@ -2783,15 +2819,11 @@ static void AppendEventAddRemoveMethod( builders.CppFunctionPointers); // C++ method declaration - string cppMethodName; - bool cppMethodIsStatic; - ParameterInfo[] cppParameters; - ParameterInfo[] cppCallParameters; Type cppReturnType = typeof(void); - cppMethodName = methodName; - cppMethodIsStatic = methodIsStatic; - cppParameters = methodParams; - cppCallParameters = methodParams; + string cppMethodName = methodName; + bool cppMethodIsStatic = methodIsStatic; + ParameterInfo[] cppParameters = methodParams; + ParameterInfo[] cppCallParameters = methodParams; AppendIndent( indent + 1, builders.CppTypeDefinitions); @@ -2853,18 +2885,12 @@ static void AppendEventAddRemoveMethod( builders.CppInitBody); } - static void AppendMethod( + static MethodInfo GetMethod( JsonMethod jsonMethod, - Assembly[] assemblies, Type enclosingType, - bool enclosingTypeIsStatic, - TypeKind enclosingTypeKind, - MethodInfo[] methods, Type[] typeTypeParams, - string typeNameLower, Type[] genericArgTypes, - int indent, - StringBuilders builders) + MethodInfo[] methods) { // Map convenience method names to actual method names switch (jsonMethod.Name) @@ -2949,15 +2975,13 @@ static void AppendMethod( break; } - // Get the method - MethodInfo method; if (enclosingType.IsGenericType) { string[] overriddenParamTypeNames = OverrideGenericTypeNames( jsonMethod.ParamTypes, genericArgTypes, typeTypeParams); - method = GetMethod( + return GetMethod( enclosingType, methods, jsonMethod.Name, @@ -2965,12 +2989,32 @@ static void AppendMethod( } else { - method = GetMethod( + return GetMethod( enclosingType, methods, jsonMethod.Name, jsonMethod.ParamTypes); } + } + + static void AppendMethod( + JsonMethod jsonMethod, + Assembly[] assemblies, + Type enclosingType, + bool enclosingTypeIsStatic, + TypeKind enclosingTypeKind, + MethodInfo[] methods, + Type[] typeTypeParams, + Type[] genericArgTypes, + int indent, + StringBuilders builders) + { + MethodInfo method = GetMethod( + jsonMethod, + enclosingType, + typeTypeParams, + genericArgTypes, + methods); Type[] exceptionTypes = GetTypes( jsonMethod.Exceptions, @@ -2992,8 +3036,6 @@ static void AppendMethod( TypeKind returnTypeKind = GetTypeKind(returnType); AppendMethod( enclosingType, - assemblies, - typeNameLower, method.Name, enclosingTypeIsStatic, enclosingTypeKind, @@ -3017,8 +3059,6 @@ static void AppendMethod( TypeKind returnTypeKind = GetTypeKind(returnType); AppendMethod( enclosingType, - assemblies, - typeNameLower, method.Name, enclosingTypeIsStatic, enclosingTypeKind, @@ -3044,7 +3084,7 @@ static Type OverrideGenericType( { for (int i = 0, len = genericArgumentTypes.Length; i < len; ++i) { - if (genericType.Equals(genericArgumentTypes[i])) + if (genericType == genericArgumentTypes[i]) { return overrideTypes[i]; } @@ -3058,9 +3098,8 @@ static void OverrideGenericParameterTypes( Type[] typeGenericArgumentTypes, Type[] typeParams) { - for (int i = 0; i < parameters.Length; ++i) + foreach (ParameterInfo info in parameters) { - ParameterInfo info = parameters[i]; info.ParameterType = OverrideGenericType( info.ParameterType, typeGenericArgumentTypes, @@ -3078,11 +3117,11 @@ static string[] OverrideGenericTypeNames( for (int i = 0; i < numParams; ++i) { string typeName = typeNames[i]; - for (int j = 0; j < genericArgTypes.Length; ++j) + foreach (Type genericArgType in genericArgTypes) { if (CheckTypeNameMatches( typeName, - genericArgTypes[j])) + genericArgType)) { typeName = typeParams[i].FullName; break; @@ -3095,8 +3134,6 @@ static string[] OverrideGenericTypeNames( static void AppendMethod( Type enclosingType, - Assembly[] assemblies, - string typeNameLower, string methodName, bool enclosingTypeIsStatic, TypeKind enclosingTypeKind, @@ -3165,7 +3202,6 @@ static void AppendMethod( methodIsStatic, enclosingTypeKind, returnType, - methodTypeParams, parameters, builders.CsharpFunctions); if (methodName.StartsWith("op_")) @@ -3292,7 +3328,6 @@ static void AppendMethod( methodTypeParams, builders.CsharpFunctions); AppendCsharpFunctionCallParameters( - methodIsStatic, parameters, builders.CsharpFunctions); } @@ -3662,6 +3697,14 @@ static void AppendMonoBehaviour( break; } } + if (messageInfo == null) + { + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("Unknown message '"); + builders.TempStrBuilder.Append(message); + builders.TempStrBuilder.Append("'. Aborting."); + throw new Exception(builders.TempStrBuilder.ToString()); + } // Build the C++ function name builders.TempStrBuilder.Length = 0; @@ -3726,8 +3769,6 @@ static void AppendMonoBehaviour( cppFunctionName, parameters, typeof(void), - type.Name, - type.Namespace, false, csharpIndent + 2, builders.CsharpMonoBehaviours); @@ -3883,17 +3924,14 @@ static void AppendCppFunctionCall( string funcName, ParameterInfo[] parameters, Type returnType, - string enclosingTypeName, - string enclosingTypeNamespace, bool enclosingTypeIsStatic, int indent, StringBuilder output) { - for (int i = 0; i < parameters.Length; ++i) + foreach (ParameterInfo param in parameters) { - ParameterInfo param = parameters[i]; if (param.Kind == TypeKind.Class - || param.Kind == TypeKind.ManagedStruct) + || param.Kind == TypeKind.ManagedStruct) { AppendIndent( indent, @@ -4001,7 +4039,7 @@ static void AppendArray( if (jsonArray.Ranks == null || jsonArray.Ranks.Length == 0) { - ranks = new int[]{ 1 }; + ranks = new[]{ 1 }; } else { @@ -4009,7 +4047,7 @@ static void AppendArray( } // C++ element proxy for [1-R] for all ranks R - Type[] cppTypeParams = new Type[]{ elementType }; + Type[] cppTypeParams = { elementType }; foreach (int rank in ranks) { // Build array name @@ -4019,31 +4057,15 @@ static void AppendArray( builders.TempStrBuilder); string cppArrayTypeName = builders.TempStrBuilder.ToString(); - // Build "TypeArray" name - builders.TempStrBuilder.Length = 0; - AppendBindingArrayTypeName( - elementType.Name, - elementType.Namespace, - cppArrayTypeName, - builders.TempStrBuilder); - string bindingArrayTypeName = builders.TempStrBuilder.ToString(); - - // GetItem params - ParameterInfo[] getItemParams = BuildArrayGetItemsParams( - rank, - "index"); - for (int i = 1; i <= rank; ++i) { AppendArrayElementProxy( elementType, elementTypeKind, - bindingArrayTypeName, i, rank, cppTypeParams, cppArrayTypeName, - getItemParams, builders); } } @@ -4176,8 +4198,6 @@ static void AppendArray( arrayType, cppArrayTypeName, rank, - bindingArrayTypeName, - indent, builders); AppendArraySetItem( @@ -4185,8 +4205,6 @@ static void AppendArray( arrayType, cppArrayTypeName, rank, - bindingArrayTypeName, - indent, builders); // C++ operator[] method declaration @@ -4410,12 +4428,10 @@ static void AppendArraySetItemFuncName( static void AppendArrayElementProxy( Type elementType, TypeKind elementTypeKind, - string bindingArrayTypeName, int rank, int maxRank, Type[] cppTypeParams, string cppArrayTypeName, - ParameterInfo[] getItemParams, StringBuilders builders) { // Build element proxy name @@ -4776,7 +4792,6 @@ static void AppendArrayConstructor( true, TypeKind.Class, arrayType, - null, parameters, builders.CsharpFunctions); AppendHandleStoreTypeName( @@ -4848,7 +4863,7 @@ static void AppendArrayConstructor( builders.CppTypeDefinitions); // C++ method definition - Type[] cppTypeParams = new Type[] { elementType }; + Type[] cppTypeParams = { elementType }; AppendCppMethodDefinitionBegin( cppArrayTypeName, null, @@ -4994,7 +5009,7 @@ static void AppendArrayGetLength( builders.TempStrBuilder[0]); string funcNameLower = builders.TempStrBuilder.ToString(); - ParameterInfo[] parameters = new ParameterInfo[] { + ParameterInfo[] parameters = { new ParameterInfo { Name = "dimension", ParameterType = typeof(int), @@ -5032,7 +5047,6 @@ static void AppendArrayGetLength( false, TypeKind.Class, typeof(int), - null, parameters, builders.CsharpFunctions); builders.CsharpFunctions.Append( @@ -5088,7 +5102,7 @@ static void AppendArrayGetLength( builders.CppTypeDefinitions); // C++ method definition - Type[] cppTypeParams = new Type[] { elementType }; + Type[] cppTypeParams = { elementType }; AppendCppMethodDefinitionBegin( cppArrayTypeName, typeof(int), @@ -5128,8 +5142,6 @@ static void AppendArrayGetItem( Type arrayType, string cppArrayTypeName, int rank, - string csharpTypeName, - int indent, StringBuilders builders) { builders.TempStrBuilder.Length = 0; @@ -5176,7 +5188,6 @@ static void AppendArrayGetItem( false, TypeKind.Class, elementType, - null, parameters, builders.CsharpFunctions); builders.CsharpFunctions.Append("thiz["); @@ -5232,8 +5243,6 @@ static void AppendArraySetItem( Type arrayType, string cppArrayTypeName, int rank, - string csharpTypeName, - int indent, StringBuilders builders) { builders.TempStrBuilder.Length = 0; @@ -5282,7 +5291,6 @@ static void AppendArraySetItem( false, TypeKind.Class, typeof(void), - null, parameters, builders.CsharpFunctions); builders.CsharpFunctions.Append("thiz["); @@ -5391,11 +5399,8 @@ static void AppendDelegate( AppendDelegate( genericType, numberedTypeName, - jsonDelegate, - genericArgTypes, typeParams, maxSimultaneous, - assemblies, builders); } } @@ -5407,11 +5412,8 @@ static void AppendDelegate( AppendDelegate( type, type.Name, - jsonDelegate, - genericArgTypes, null, maxSimultaneous, - assemblies, builders); } } @@ -5419,11 +5421,8 @@ static void AppendDelegate( static void AppendDelegate( Type type, string numberedTypeName, - JsonDelegate jsonDelegate, - Type[] genericArgTypes, Type[] typeParams, int? maxSimultaneous, - Assembly[] assemblies, StringBuilders builders) { builders.TempStrBuilder.Length = 0; @@ -5457,15 +5456,6 @@ static void AppendDelegate( builders.TempStrBuilder[0]); string constructorFuncNameLower = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder.Length = 0; - builders.TempStrBuilder.Append(typeName); - builders.TempStrBuilder.Append("Invoke"); - string invokeFuncName = builders.TempStrBuilder.ToString(); - - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string invokeFuncNameLower = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append(typeName); builders.TempStrBuilder.Append("Add"); @@ -5484,36 +5474,15 @@ static void AppendDelegate( builders.TempStrBuilder[0]); string removeFuncNameLower = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder.Length = 0; - AppendCsharpDelegateName( - type.Name, + // C++ type declaration + int indent = AppendCppTypeDeclaration( type.Namespace, + numberedTypeName, + false, typeParams, - "CppInvoke", - builders.TempStrBuilder); - string cppInvokeFuncName = builders.TempStrBuilder.ToString(); - - MethodInfo invokeMethod = type.GetMethod("Invoke"); - TypeKind invokeReturnTypeKind = GetTypeKind( - invokeMethod.ReturnType); - ParameterInfo[] invokeParams = ConvertParameters( - invokeMethod.GetParameters()); - ParameterInfo[] invokeParamsWithThis = new ParameterInfo[ - invokeParams.Length + 1]; - for (int i = 0; i < invokeParams.Length; ++i) - { - invokeParamsWithThis[i+1] = invokeParams[i]; - } - invokeParamsWithThis[0] = new ParameterInfo { - Name = "thisHandle", - ParameterType = typeof(int), - DereferencedParameterType = typeof(int), - IsOut = false, - IsRef = false, - Kind = TypeKind.Primitive - }; + builders.CppTypeDeclarations); - ParameterInfo[] addRemoveParams = new ParameterInfo[] { + ParameterInfo[] addRemoveParams = { new ParameterInfo { Name = "del", @@ -5525,7 +5494,7 @@ static void AppendDelegate( IsVirtual = true }}; - ParameterInfo[] releaseParams = new ParameterInfo[] { + ParameterInfo[] releaseParams = { new ParameterInfo { Name = "handle", @@ -5545,7 +5514,7 @@ static void AppendDelegate( Kind = TypeKind.Primitive }}; - ParameterInfo[] constructorParams = new ParameterInfo[] { + ParameterInfo[] constructorParams = { new ParameterInfo { Name = "cppHandle", @@ -5574,150 +5543,17 @@ static void AppendDelegate( Kind = TypeKind.Primitive }}; - // Free list state and functions - builders.CppGlobalStateAndFunctions.Append("\tint32_t "); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append("FreeListSize;\n"); - builders.CppGlobalStateAndFunctions.Append('\t'); - AppendCppTypeName( + AppendCppFreeListStateAndFunctions( type, + typeName, builders.CppGlobalStateAndFunctions); - builders.CppGlobalStateAndFunctions.Append("** "); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append("FreeList;\n"); - builders.CppGlobalStateAndFunctions.Append('\t'); - AppendCppTypeName( - type, - builders.CppGlobalStateAndFunctions); - builders.CppGlobalStateAndFunctions.Append("** NextFree"); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append(";\n"); - builders.CppGlobalStateAndFunctions.Append("\t\n"); - builders.CppGlobalStateAndFunctions.Append("\tint32_t Store"); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append('('); - AppendCppTypeName( - type, - builders.CppGlobalStateAndFunctions); - builders.CppGlobalStateAndFunctions.Append("* del)\n"); - builders.CppGlobalStateAndFunctions.Append("\t{\n"); - builders.CppGlobalStateAndFunctions.Append("\t\tassert(NextFree"); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append(" != nullptr);\n"); - builders.CppGlobalStateAndFunctions.Append("\t\t"); - AppendCppTypeName( - type, - builders.CppGlobalStateAndFunctions); - builders.CppGlobalStateAndFunctions.Append("** pNext = NextFree"); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append(";\n"); - builders.CppGlobalStateAndFunctions.Append("\t\tNextFree"); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append(" = ("); - AppendCppTypeName( - type, - builders.CppGlobalStateAndFunctions); - builders.CppGlobalStateAndFunctions.Append("**)*pNext;\n"); - builders.CppGlobalStateAndFunctions.Append("\t\t*pNext = del;\n"); - builders.CppGlobalStateAndFunctions.Append("\t\treturn (int32_t)(pNext - "); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append("FreeList);\n"); - builders.CppGlobalStateAndFunctions.Append("\t}\n"); - builders.CppGlobalStateAndFunctions.Append("\t\n"); - builders.CppGlobalStateAndFunctions.Append('\t'); - AppendCppTypeName( - type, - builders.CppGlobalStateAndFunctions); - builders.CppGlobalStateAndFunctions.Append("* Get"); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append("(int32_t handle)\n"); - builders.CppGlobalStateAndFunctions.Append("\t{\n"); - builders.CppGlobalStateAndFunctions.Append("\t\tassert(handle >= 0 && handle < "); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append("FreeListSize);\n"); - builders.CppGlobalStateAndFunctions.Append("\t\treturn "); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append("FreeList[handle];\n"); - builders.CppGlobalStateAndFunctions.Append("\t}\n"); - builders.CppGlobalStateAndFunctions.Append("\t\n"); - builders.CppGlobalStateAndFunctions.Append("\tvoid Remove"); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append("(int32_t handle)\n"); - builders.CppGlobalStateAndFunctions.Append("\t{\n"); - builders.CppGlobalStateAndFunctions.Append("\t\t"); - AppendCppTypeName( - type, - builders.CppGlobalStateAndFunctions); - builders.CppGlobalStateAndFunctions.Append("** pRelease = "); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append("FreeList + handle;\n"); - builders.CppGlobalStateAndFunctions.Append("\t\t*pRelease = ("); - AppendCppTypeName( - type, - builders.CppGlobalStateAndFunctions); - builders.CppGlobalStateAndFunctions.Append("*)NextFree"); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append(";\n"); - builders.CppGlobalStateAndFunctions.Append("\t\tNextFree"); - builders.CppGlobalStateAndFunctions.Append(typeName); - builders.CppGlobalStateAndFunctions.Append(" = pRelease;\n"); - builders.CppGlobalStateAndFunctions.Append("\t}\n"); - - // Free list init - builders.CppInitBody.Append('\t'); - builders.CppInitBody.Append(typeName); - builders.CppInitBody.Append("FreeListSize = "); - if (maxSimultaneous.HasValue) - { - builders.CppInitBody.Append(maxSimultaneous); - } - else - { - builders.CppInitBody.Append("maxManagedObjects"); - } - builders.CppInitBody.Append(";\n"); - builders.CppInitBody.Append("\t"); - builders.CppInitBody.Append(typeName); - builders.CppInitBody.Append("FreeList = new "); - AppendCppTypeName( - type, - builders.CppInitBody); - builders.CppInitBody.Append("*["); - builders.CppInitBody.Append(typeName); - builders.CppInitBody.Append("FreeListSize];\n"); - builders.CppInitBody.Append("\tfor (int32_t i = 0, end = "); - builders.CppInitBody.Append(typeName); - builders.CppInitBody.Append("FreeListSize - 1; i < end; ++i)\n"); - builders.CppInitBody.Append("\t{\n"); - builders.CppInitBody.Append("\t "); - builders.CppInitBody.Append(typeName); - builders.CppInitBody.Append("FreeList[i] = ("); - AppendCppTypeName( + + AppendCppFreeListInit( type, + maxSimultaneous, + typeName, builders.CppInitBody); - builders.CppInitBody.Append("*)("); - builders.CppInitBody.Append(typeName); - builders.CppInitBody.Append("FreeList + i + 1);\n"); - builders.CppInitBody.Append("\t}\n"); - builders.CppInitBody.Append('\t'); - builders.CppInitBody.Append(typeName); - builders.CppInitBody.Append("FreeList["); - builders.CppInitBody.Append(typeName); - builders.CppInitBody.Append("FreeListSize - 1] = nullptr;\n"); - builders.CppInitBody.Append("\tNextFree"); - builders.CppInitBody.Append(typeName); - builders.CppInitBody.Append(" = "); - builders.CppInitBody.Append(typeName); - builders.CppInitBody.Append("FreeList + 1;\n"); - - // C++ type declaration - int indent = AppendCppTypeDeclaration( - type.Namespace, - numberedTypeName, - false, - typeParams, - builders.CppTypeDeclarations); - + // C++ type definition (begin) AppendCppTypeDefinitionBegin( numberedTypeName, @@ -5757,30 +5593,6 @@ static void AppendDelegate( AppendIndent( indent + 1, builders.CppTypeDefinitions); - AppendCppMethodDeclaration( - "Invoke", - false, - false, - false, - invokeMethod.ReturnType, - null, - invokeParams, - builders.CppTypeDefinitions); - AppendIndent( - indent + 1, - builders.CppTypeDefinitions); - AppendCppMethodDeclaration( - "operator()", - false, - true, - false, - invokeMethod.ReturnType, - null, - invokeParams, - builders.CppTypeDefinitions); - AppendIndent( - indent + 1, - builders.CppTypeDefinitions); AppendCppMethodDeclaration( "operator+=", false, @@ -5822,15 +5634,6 @@ static void AppendDelegate( constructorParams, typeof(void), builders.CppFunctionPointers); - AppendCppFunctionPointerDefinition( - invokeFuncName, - false, - null, - null, - TypeKind.None, - invokeParams, - invokeMethod.ReturnType, - builders.CppFunctionPointers); AppendCppFunctionPointerDefinition( addFuncName, false, @@ -5869,15 +5672,6 @@ static void AppendDelegate( constructorParams, typeof(void), builders.CppInitParams); - AppendCppInitParam( - invokeFuncNameLower, - false, - null, - null, - TypeKind.None, - invokeParams, - invokeMethod.ReturnType, - builders.CppInitParams); AppendCppInitParam( addFuncNameLower, false, @@ -5897,7 +5691,7 @@ static void AppendDelegate( typeof(void), builders.CppInitParams); - // C++ init body + // C++ and C# init params AppendCppInitBody( releaseFuncName, releaseFuncNameLower, @@ -5906,10 +5700,6 @@ static void AppendDelegate( constructorFuncName, constructorFuncNameLower, builders.CppInitBody); - AppendCppInitBody( - invokeFuncName, - invokeFuncNameLower, - builders.CppInitBody); AppendCppInitBody( addFuncName, addFuncNameLower, @@ -5918,1418 +5708,2494 @@ static void AppendDelegate( removeFuncName, removeFuncNameLower, builders.CppInitBody); + AppendCsharpInitParam( + releaseFuncNameLower, + builders.CsharpInitParams); + AppendCsharpInitParam( + constructorFuncNameLower, + builders.CsharpInitParams); + AppendCsharpInitParam( + addFuncNameLower, + builders.CsharpInitParams); + AppendCsharpInitParam( + removeFuncNameLower, + builders.CsharpInitParams); + AppendCsharpInitCallArg( + releaseFuncName, + builders.CsharpInitCall); + AppendCsharpInitCallArg( + constructorFuncName, + builders.CsharpInitCall); + AppendCsharpInitCallArg( + addFuncName, + builders.CsharpInitCall); + AppendCsharpInitCallArg( + removeFuncName, + builders.CsharpInitCall); // C++ method definitions (end) int cppMethodDefinitionsIndent = AppendNamespaceBeginning( type.Namespace, builders.CppMethodDefinitions); - // C++ default constructor - AppendCppMethodDefinitionBegin( - numberedTypeName, - null, + AppendCppBaseTypeDefaultConstructor( + typeName, numberedTypeName, typeParams, - null, - new ParameterInfo[0], + true, + constructorFuncName, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(" : System::Object(nullptr)\n"); - AppendIndent( + + AppendCppBaseTypeNullptrConstructor( + typeName, + numberedTypeName, + typeParams, + true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, + + AppendCppBaseTypeCopyConstructor( + typeName, + numberedTypeName, + typeParams, + true, + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("CppHandle = Plugin::Store"); - builders.CppMethodDefinitions.Append(typeName); - builders.CppMethodDefinitions.Append("(this);\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, + + AppendCppBaseTypeMoveConstructor( + numberedTypeName, + typeParams, + true, + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Plugin::"); - builders.CppMethodDefinitions.Append(constructorFuncName); - builders.CppMethodDefinitions.Append("(CppHandle, &Handle, &ClassHandle);\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, + + AppendCppBaseTypeHandleConstructor( + typeName, + numberedTypeName, + typeParams, + true, + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("if (Handle)\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, + + AppendCppBaseTypeDestructor( + typeName, + numberedTypeName, + typeParams, + true, + releaseFuncName, + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendIndent( - cppMethodDefinitionsIndent + 2, + + AppendCppBaseTypeAssignmentOperatorSameType( + type, + numberedTypeName, + typeParams, + true, + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "Plugin::ReferenceManagedClass(Handle);\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, + + AppendCppBaseTypeAssignmentOperatorNullptr( + numberedTypeName, + typeParams, + true, + releaseFuncName, + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, + + AppendCppBaseTypeMoveAssignmentOperator( + typeName, + numberedTypeName, + typeParams, + true, + releaseFuncName, + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("else\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, + + AppendCppBaseTypeEqualityOperator( + numberedTypeName, + typeParams, + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendIndent( - cppMethodDefinitionsIndent + 2, + + AppendCppBaseTypeInequalityOperator( + numberedTypeName, + typeParams, + cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Plugin::Remove"); - builders.CppMethodDefinitions.Append(typeName); - builders.CppMethodDefinitions.Append("(CppHandle);\n"); - AppendIndent( - cppMethodDefinitionsIndent + 2, + + // C++ add + AppendCppMethodDefinitionBegin( + numberedTypeName, + typeof(void), + "operator+=", + typeParams, + null, + addRemoveParams, + indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); AppendIndent( - cppMethodDefinitionsIndent + 2, + indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("CppHandle = 0;\n"); + builders.CppMethodDefinitions.Append("{\n"); AppendIndent( - cppMethodDefinitionsIndent + 1, + indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.Append("Plugin::"); + builders.CppMethodDefinitions.Append(addFuncName); + builders.CppMethodDefinitions.Append("(Handle, del.Handle);\n"); AppendCppUnhandledExceptionHandling( - cppMethodDefinitionsIndent + 1, + indent + 1, builders.CppMethodDefinitions); AppendIndent( - cppMethodDefinitionsIndent, + indent, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("}\n"); AppendIndent( - cppMethodDefinitionsIndent, + indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.Append("\n"); - // Construct with nullptr_t - AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - AppendTypeNameWithoutGenericSuffix( + // C++ remove + AppendCppMethodDefinitionBegin( numberedTypeName, - builders.CppMethodDefinitions); - AppendCppTypeParameters( + typeof(void), + "operator-=", typeParams, + null, + addRemoveParams, + indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("::"); - AppendTypeNameWithoutGenericSuffix( - numberedTypeName, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("(std::nullptr_t n)\n"); - AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "\t: System::Object(Plugin::InternalUse::Only, 0)\n"); AppendIndent( - cppMethodDefinitionsIndent, + indent, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("{\n"); AppendIndent( - cppMethodDefinitionsIndent + 1, + indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("CppHandle = Plugin::Store"); - builders.CppMethodDefinitions.Append(typeName); - builders.CppMethodDefinitions.Append("(this);\n"); + builders.CppMethodDefinitions.Append("Plugin::"); + builders.CppMethodDefinitions.Append(removeFuncName); + builders.CppMethodDefinitions.Append("(Handle, del.Handle);\n"); + AppendCppUnhandledExceptionHandling( + indent + 1, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("\n"); + + // C# GetDelegate call + AppendCsharpGetDelegateCall( + type.Name, + type.Namespace, + typeParams, + "NativeInvoke", + builders.CsharpGetDelegateCalls); + + // C# class (beginning) + builders.CsharpBaseTypes.Append("\t\tclass "); + builders.CsharpBaseTypes.Append(typeName); + builders.CsharpBaseTypes.Append("\n"); + builders.CsharpBaseTypes.Append("\t\t{\n"); + + // C# class fields + builders.CsharpBaseTypes.Append("\t\t\tpublic int CppHandle;\n"); + builders.CsharpBaseTypes.Append("\t\t\tpublic "); + AppendCsharpTypeName( + type, + builders.CsharpBaseTypes); + builders.CsharpBaseTypes.Append(" Delegate;\n"); + builders.CsharpBaseTypes.Append("\t\t\t\n"); + + // C# class constructor + builders.CsharpBaseTypes.Append("\t\t\tpublic "); + builders.CsharpBaseTypes.Append(typeName); + builders.CsharpBaseTypes.Append("(int cppHandle)\n"); + builders.CsharpBaseTypes.Append("\t\t\t{\n"); + builders.CsharpBaseTypes.Append("\t\t\t\tCppHandle = cppHandle;\n"); + builders.CsharpBaseTypes.Append("\t\t\t\tDelegate = NativeInvoke;\n"); + builders.CsharpBaseTypes.Append("\t\t\t}\n"); + builders.CsharpBaseTypes.Append("\t\t\t\n"); + + // operator() is how C# forwards the delegate invocation to C++ + AppendBaseTypeCppMethodCall( + type, + typeName, + numberedTypeName, + typeParams, + type.GetMethod("Invoke"), + "NativeInvoke", + "operator()", + false, + indent, + builders); + + // C# class (ending) + builders.CsharpBaseTypes.Append("\t\t}\n"); + builders.CsharpBaseTypes.Append("\t\t\n"); + + // Invoke() is how C++ invokes the delegate + MethodInfo invokeMethod = type.GetMethod("Invoke"); + AppendBaseTypeMethodCallsCsharpMethod( + type, + typeName, + numberedTypeName, + typeParams, + invokeMethod, + "Invoke", + null, + indent, + builders); + + // C# constructor delegate type + AppendCsharpDelegateType( + constructorFuncName, + true, + type, + TypeKind.Class, + typeof(void), + constructorParams, + builders.CsharpDelegateTypes); + + AppendCsharpBaseTypeConstructorFunction( + type, + typeName, + false, + constructorFuncName, + constructorParams, + builders.CsharpFunctions); + + // C# release delegate type + AppendCsharpDelegateType( + releaseFuncName, + true, + type, + TypeKind.Class, + typeof(void), + releaseParams, + builders.CsharpDelegateTypes); + + AppendCsharpBaseTypeReleaseFunction( + type, + typeName, + true, + releaseFuncName, + releaseParams, + builders.CsharpFunctions); + + // C# add delegate type + AppendCsharpDelegateType( + addFuncName, + false, + type, + TypeKind.Class, + typeof(void), + addRemoveParams, + builders.CsharpDelegateTypes); + + // C# add function + AppendCsharpFunctionBeginning( + type, + addFuncName, + false, + TypeKind.Class, + typeof(void), + addRemoveParams, + builders.CsharpFunctions); + builders.CsharpFunctions.Append("thiz += del;"); + AppendCsharpFunctionReturn( + addRemoveParams, + typeof(void), + TypeKind.Class, + null, + false, + builders.CsharpFunctions); + + // C# remove delegate type + AppendCsharpDelegateType( + removeFuncName, + false, + type, + TypeKind.Class, + typeof(void), + addRemoveParams, + builders.CsharpDelegateTypes); + + // C# remove function + AppendCsharpFunctionBeginning( + type, + removeFuncName, + false, + TypeKind.Class, + typeof(void), + addRemoveParams, + builders.CsharpFunctions); + builders.CsharpFunctions.Append("thiz -= del;"); + AppendCsharpFunctionReturn( + addRemoveParams, + typeof(void), + TypeKind.Class, + null, + false, + builders.CsharpFunctions); + + // C++ method definitions (end) + AppendCppMethodDefinitionsEnd( + indent, + builders.CppMethodDefinitions); + + // C++ type definition (end) + AppendCppTypeDefinitionEnd( + false, + indent, + builders.CppTypeDefinitions); + } + + static void AppendBaseType( + Type type, + JsonBaseType jsonBaseType, + string numberedTypeName, + Type[] typeParams, + int? maxSimultaneous, + StringBuilders builders) + { + builders.TempStrBuilder.Length = 0; + AppendNamespace( + type.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendTypeNameWithoutSuffixes( + type.Name, + builders.TempStrBuilder); + AppendTypeNames( + typeParams, + builders.TempStrBuilder); + string typeName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("Release"); + builders.TempStrBuilder.Append(typeName); + string releaseFuncName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string releaseFuncNameLower = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append(typeName); + builders.TempStrBuilder.Append("Constructor"); + string constructorFuncName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string constructorFuncNameLower = builders.TempStrBuilder.ToString(); + + // C++ type declaration + int indent = AppendCppTypeDeclaration( + type.Namespace, + numberedTypeName, + false, + typeParams, + builders.CppTypeDeclarations); + + ParameterInfo[] releaseParams = { + new ParameterInfo + { + Name = "handle", + ParameterType = typeof(int), + DereferencedParameterType = typeof(int), + IsOut = false, + IsRef = false, + Kind = TypeKind.Primitive + }}; + + ParameterInfo[] constructorParams = { + new ParameterInfo + { + Name = "cppHandle", + ParameterType = typeof(int), + DereferencedParameterType = typeof(int), + IsOut = false, + IsRef = false, + Kind = TypeKind.Primitive + }, + new ParameterInfo + { + Name = "handle", + ParameterType = typeof(int), + DereferencedParameterType = typeof(int), + IsOut = true, + IsRef = false, + Kind = TypeKind.Primitive + }}; + + AppendCppFreeListStateAndFunctions( + type, + typeName, + builders.CppGlobalStateAndFunctions); + + AppendCppFreeListInit( + type, + maxSimultaneous, + typeName, + builders.CppInitBody); + + // C++ type definition (begin) + AppendCppTypeDefinitionBegin( + numberedTypeName, + type.Namespace, + TypeKind.Class, + typeParams, + "Object", + "System", + null, + false, + indent, + builders.CppTypeDefinitions); + + // C++ type fields + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("int32_t CppHandle;\n"); + + // C++ method declarations + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + numberedTypeName, + false, + false, + false, + null, + null, + new ParameterInfo[0], + builders.CppTypeDefinitions); + + // C++ function pointers + AppendCppFunctionPointerDefinition( + releaseFuncName, + true, + null, + null, + TypeKind.None, + releaseParams, + typeof(void), + builders.CppFunctionPointers); + AppendCppFunctionPointerDefinition( + constructorFuncName, + true, + null, + null, + TypeKind.None, + constructorParams, + typeof(void), + builders.CppFunctionPointers); + + // C++ init params + AppendCppInitParam( + releaseFuncNameLower, + true, + null, + null, + TypeKind.None, + releaseParams, + typeof(void), + builders.CppInitParams); + AppendCppInitParam( + constructorFuncNameLower, + true, + null, + null, + TypeKind.None, + constructorParams, + typeof(void), + builders.CppInitParams); + + // C++ and C# init params + AppendCppInitBody( + releaseFuncName, + releaseFuncNameLower, + builders.CppInitBody); + AppendCppInitBody( + constructorFuncName, + constructorFuncNameLower, + builders.CppInitBody); + AppendCsharpInitParam( + releaseFuncNameLower, + builders.CsharpInitParams); + AppendCsharpInitParam( + constructorFuncNameLower, + builders.CsharpInitParams); + AppendCsharpInitCallArg( + releaseFuncName, + builders.CsharpInitCall); + AppendCsharpInitCallArg( + constructorFuncName, + builders.CsharpInitCall); + + // C++ method definitions (end) + int cppMethodDefinitionsIndent = AppendNamespaceBeginning( + type.Namespace, + builders.CppMethodDefinitions); + + AppendCppBaseTypeDefaultConstructor( + typeName, + numberedTypeName, + typeParams, + false, + constructorFuncName, + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + + AppendCppBaseTypeNullptrConstructor( + typeName, + numberedTypeName, + typeParams, + false, + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + + AppendCppBaseTypeCopyConstructor( + typeName, + numberedTypeName, + typeParams, + false, + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + + AppendCppBaseTypeMoveConstructor( + numberedTypeName, + typeParams, + false, + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + + AppendCppBaseTypeHandleConstructor( + typeName, + numberedTypeName, + typeParams, + false, + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + + AppendCppBaseTypeDestructor( + typeName, + numberedTypeName, + typeParams, + false, + releaseFuncName, + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + + AppendCppBaseTypeAssignmentOperatorSameType( + type, + numberedTypeName, + typeParams, + false, + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + + AppendCppBaseTypeAssignmentOperatorNullptr( + numberedTypeName, + typeParams, + false, + releaseFuncName, + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + + AppendCppBaseTypeMoveAssignmentOperator( + typeName, + numberedTypeName, + typeParams, + false, + releaseFuncName, + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + + AppendCppBaseTypeEqualityOperator( + numberedTypeName, + typeParams, + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + + AppendCppBaseTypeInequalityOperator( + numberedTypeName, + typeParams, + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + + // C# class (beginning) + builders.CsharpBaseTypes.Append("\t\tclass "); + builders.CsharpBaseTypes.Append(typeName); + if (jsonBaseType != null) + { + builders.CsharpBaseTypes.Append(" : "); + AppendCsharpTypeName( + type, + builders.CsharpBaseTypes); + } + builders.CsharpBaseTypes.Append("\n"); + builders.CsharpBaseTypes.Append("\t\t{\n"); + + // C# class fields + builders.CsharpBaseTypes.Append("\t\t\tpublic int CppHandle;\n"); + builders.CsharpBaseTypes.Append("\t\t\t\n"); + + // C# class constructor + builders.CsharpBaseTypes.Append("\t\t\tpublic "); + builders.CsharpBaseTypes.Append(typeName); + builders.CsharpBaseTypes.Append("(int cppHandle)\n"); + builders.CsharpBaseTypes.Append("\t\t\t{\n"); + builders.CsharpBaseTypes.Append("\t\t\t\tCppHandle = cppHandle;\n"); + builders.CsharpBaseTypes.Append("\t\t\t}\n"); + builders.CsharpBaseTypes.Append("\t\t\t\n"); + + // C# constructor delegate type + AppendCsharpDelegateType( + constructorFuncName, + true, + type, + TypeKind.Class, + typeof(void), + constructorParams, + builders.CsharpDelegateTypes); + + AppendCsharpBaseTypeConstructorFunction( + type, + typeName, + false, + constructorFuncName, + constructorParams, + builders.CsharpFunctions); + + // C# release delegate type + AppendCsharpDelegateType( + releaseFuncName, + true, + type, + TypeKind.Class, + typeof(void), + releaseParams, + builders.CsharpDelegateTypes); + + AppendCsharpBaseTypeReleaseFunction( + type, + typeName, + false, + releaseFuncName, + releaseParams, + builders.CsharpFunctions); + + // All abstract methods + foreach (MethodInfo methodInfo in type.GetMethods()) + { + if (methodInfo.IsAbstract) + { + AppendBaseTypeNativeMethod( + type, + typeName, + typeParams, + numberedTypeName, + methodInfo, + indent, + builders); + } + } + + // Specified virtual methods + if (jsonBaseType.OverrideMethods != null) + { + MethodInfo[] methods = type.GetMethods(); + Type[] genericArgTypes = type.GetGenericArguments(); + foreach (JsonMethod jsonMethod in jsonBaseType.OverrideMethods) + { + MethodInfo methodInfo = GetMethod( + jsonMethod, + type, + typeParams, + genericArgTypes, + methods); + AppendBaseTypeNativeMethod( + type, + typeName, + typeParams, + numberedTypeName, + methodInfo, + indent, + builders); + } + } + + // C# class (ending) + builders.CsharpBaseTypes.Append("\t\t}\n"); + builders.CsharpBaseTypes.Append("\t\t\n"); + + // C++ method definitions (end) + AppendCppMethodDefinitionsEnd( + indent, + builders.CppMethodDefinitions); + + // C++ type definition (end) + AppendCppTypeDefinitionEnd( + false, + indent, + builders.CppTypeDefinitions); + } + + static void AppendBaseTypeNativeMethod( + Type type, + string typeName, + Type[] typeParams, + string cppTypeName, + MethodInfo methodInfo, + int indent, + StringBuilders builders) + { + AppendCsharpGetDelegateCall( + type.Name, + type.Namespace, + typeParams, + methodInfo.Name, + builders.CsharpGetDelegateCalls); + + AppendBaseTypeCppMethodCall( + type, + typeName, + cppTypeName, + typeParams, + methodInfo, + methodInfo.Name, + methodInfo.Name, + !type.IsInterface, + indent, + builders); + } + + static void AppendBaseTypeMethodCallsCsharpMethod( + Type type, + string typeName, + string cppTypeName, + Type[] typeParams, + MethodInfo methodInfo, + string methodName, + string csharpMethodName, + int indent, + StringBuilders builders) + { + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append(typeName); + builders.TempStrBuilder.Append(methodName); + string funcName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string funcNameLower = builders.TempStrBuilder.ToString(); + + // C++ method declaration for the method + ParameterInfo[] invokeParams = ConvertParameters( + methodInfo.GetParameters()); + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + methodName, + false, + false, + false, + methodInfo.ReturnType, + null, + invokeParams, + builders.CppTypeDefinitions); + + // C++ function pointer for the C# binding function + AppendCppFunctionPointerDefinition( + funcName, + false, + null, + null, + TypeKind.None, + invokeParams, + methodInfo.ReturnType, + builders.CppFunctionPointers); + + // C++ and C# Init parameter and body for the C# binding function + AppendCppInitParam( + funcNameLower, + false, + null, + null, + TypeKind.None, + invokeParams, + methodInfo.ReturnType, + builders.CppInitParams); + AppendCppInitBody( + funcName, + funcNameLower, + builders.CppInitBody); + AppendCsharpInitParam( + funcNameLower, + builders.CsharpInitParams); + AppendCsharpInitCallArg( + funcName, + builders.CsharpInitCall); + + // C++ method definition for the method + TypeKind returnTypeKind = GetTypeKind( + methodInfo.ReturnType); + AppendCppMethodDefinitionBegin( + cppTypeName, + methodInfo.ReturnType, + methodName, + typeParams, + null, + invokeParams, + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendCppPluginFunctionCall( + false, + type.Name, + type.Namespace, + TypeKind.Class, + typeParams, + methodInfo.ReturnType, + funcName, + invokeParams, + indent + 1, + builders.CppMethodDefinitions); + AppendCppMethodReturn( + methodInfo.ReturnType, + returnTypeKind, + indent + 1, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + + // C# delegate type for the binding function that C++ calls + ParameterInfo[] invokeParamsWithThis = new ParameterInfo[ + invokeParams.Length + 1]; + for (int i = 0; i < invokeParams.Length; ++i) + { + invokeParamsWithThis[i+1] = invokeParams[i]; + } + invokeParamsWithThis[0] = new ParameterInfo { + Name = "thisHandle", + ParameterType = typeof(int), + DereferencedParameterType = typeof(int), + IsOut = false, + IsRef = false, + Kind = TypeKind.Primitive + }; + AppendCsharpDelegateType( + funcName, + true, + type, + TypeKind.Class, + methodInfo.ReturnType, + invokeParamsWithThis, + builders.CsharpDelegateTypes); + + // C# binding function that C++ calls to invoke the method + AppendCsharpFunctionBeginning( + type, + funcName, + true, + TypeKind.Class, + methodInfo.ReturnType, + invokeParamsWithThis, + builders.CsharpFunctions); + builders.CsharpFunctions.Append("(("); + AppendCsharpTypeName( + type, + builders.CsharpFunctions); + builders.CsharpFunctions.Append( + ")NativeScript.Bindings.ObjectStore.Get(thisHandle))"); + if (csharpMethodName != null) + { + builders.CsharpFunctions.Append('.'); + builders.CsharpFunctions.Append(csharpMethodName); + } + AppendCsharpFunctionCallParameters( + invokeParams, + builders.CsharpFunctions); + builders.CsharpFunctions.Append(';'); + AppendCsharpFunctionReturn( + invokeParams, + methodInfo.ReturnType, + returnTypeKind, + null, + false, + builders.CsharpFunctions); + } + + static void AppendBaseTypeCppMethodCall( + Type type, + string typeName, + string numberedTypeName, + Type[] typeParams, + MethodInfo invokeMethod, + string funcName, + string methodName, + bool isOverride, + int indent, + StringBuilders builders) + { + // Build the name of the C++ binding function that C# calls + builders.TempStrBuilder.Length = 0; + AppendNamespace( + type.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendTypeNameWithoutSuffixes( + type.Name, + builders.TempStrBuilder); + AppendTypeNames( + typeParams, + builders.TempStrBuilder); + builders.TempStrBuilder.Append(funcName); + string nativeInvokeFuncName = builders.TempStrBuilder.ToString(); + + // C++ method declaration + ParameterInfo[] invokeParams = ConvertParameters( + invokeMethod.GetParameters()); + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + methodName, + false, + true, + false, + invokeMethod.ReturnType, + null, + invokeParams, + builders.CppTypeDefinitions); + + // C++ method definition. This is a no-op that game code overrides. + AppendCppMethodDefinitionBegin( + numberedTypeName, + invokeMethod.ReturnType, + methodName, + typeParams, + null, + invokeParams, + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + if (invokeMethod.ReturnType != typeof(void)) + { + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("return {};\n"); + } AppendIndent( - cppMethodDefinitionsIndent + 1, + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + + // C++ binding function that C# calls. Calls the C++ method. + TypeKind invokeReturnTypeKind = GetTypeKind( + invokeMethod.ReturnType); + AppendCppBaseTypeMethodInvokeBindingFunction( + funcName, + type, + typeParams, + invokeMethod, + methodName, + invokeReturnTypeKind, + invokeParams, + indent, + typeName, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); + + // C# method that calls the C++ binding function + ParameterInfo[] invokeParamsWithThis = new ParameterInfo[ + invokeParams.Length + 1]; + for (int i = 0; i < invokeParams.Length; ++i) + { + invokeParamsWithThis[i+1] = invokeParams[i]; + } + invokeParamsWithThis[0] = new ParameterInfo { + Name = "thisHandle", + ParameterType = typeof(int), + DereferencedParameterType = typeof(int), + IsOut = false, + IsRef = false, + Kind = TypeKind.Primitive + }; + AppendCsharpBaseTypeCppMethodCallMethod( + isOverride, + invokeMethod, + funcName, + invokeParams, + nativeInvokeFuncName, + invokeParamsWithThis, + invokeReturnTypeKind, + builders.CsharpBaseTypes); + + // C# delegate for the C++ binding function + AppendCsharpDelegate( + false, + type.Name, + type.Namespace, + typeParams, + funcName, + invokeParams, + invokeMethod.ReturnType, + invokeReturnTypeKind, + builders.CsharpDelegates); + + // C# import for the C++ binding function + AppendCsharpImport( + type.Name, + type.Namespace, + typeParams, + funcName, + invokeParams, + builders.CsharpImports); + } + + static void AppendCsharpBaseTypeReleaseFunction( + Type type, + string typeName, + bool typeIsDelegate, + string releaseFuncName, + ParameterInfo[] releaseParams, + StringBuilder output) + { + AppendCsharpFunctionBeginning( + type, + releaseFuncName, + true, + TypeKind.Class, + typeof(void), + releaseParams, + output); + if (typeIsDelegate) + { + output.Append("if (classHandle != 0)\n"); + output.Append("\t\t\t\t{\n"); + output.Append("\t\t\t\t\tvar thiz = ("); + output.Append(typeName); + output.Append( + ")NativeScript.Bindings.ObjectStore.Remove(classHandle);\n"); + output.Append("\t\t\t\t\tthiz.CppHandle = 0;\n"); + output.Append("\t\t\t\t}\n"); + output.Append("\t\t\t\t"); + } + output.Append( + "NativeScript.Bindings.ObjectStore.Remove(handle);"); + AppendCsharpFunctionReturn( + releaseParams, + typeof(void), + TypeKind.Class, + null, + true, + output); + } + + static void AppendCsharpBaseTypeCppMethodCallMethod( + bool isOverride, + MethodInfo invokeMethod, + string funcName, + ParameterInfo[] invokeParams, + string nativeInvokeFuncName, + ParameterInfo[] invokeParamsWithThis, + TypeKind invokeReturnTypeKind, + StringBuilder output) + { + output.Append("\t\t\tpublic "); + if (isOverride) + { + output.Append("override "); + } + AppendCsharpTypeName( + invokeMethod.ReturnType, + output); + output.Append(" "); + output.Append(funcName); + output.Append("("); + for (int i = 0; i < invokeParams.Length; ++i) + { + ParameterInfo param = invokeParams[i]; + AppendCsharpTypeName( + param.ParameterType, + output); + output.Append(' '); + output.Append(param.Name); + if (i != invokeParams.Length - 1) + { + output.Append(", "); + } + } + output.Append(")\n"); + output.Append("\t\t\t{\n"); + output.Append("\t\t\t\tif (CppHandle != 0)\n"); + output.Append("\t\t\t\t{\n"); + output.Append("\t\t\t\t\tint thisHandle = CppHandle;\n"); + AppendCppFunctionCall( + nativeInvokeFuncName, + invokeParamsWithThis, + invokeMethod.ReturnType, + true, + 5, + output); + if (invokeMethod.ReturnType != typeof(void)) + { + output.Append("\t\t\t\t\treturn "); + switch (invokeReturnTypeKind) + { + case TypeKind.Class: + case TypeKind.ManagedStruct: + if (invokeMethod.ReturnType != typeof(object)) + { + output.Append('('); + AppendCsharpTypeName( + invokeMethod.ReturnType, + output); + output.Append(')'); + } + AppendHandleStoreTypeName( + invokeMethod.ReturnType, + output); + output.Append(".Get(returnVal);\n"); + break; + default: + output.Append("returnVal;\n"); + break; + } + } + output.Append("\t\t\t\t}\n"); + if (invokeMethod.ReturnType != typeof(void)) + { + output.Append("\t\t\t\treturn default("); + AppendCsharpTypeName( + invokeMethod.ReturnType, + output); + output.Append(");\n"); + } + output.Append("\t\t\t}\n"); + } + + private static void AppendCsharpBaseTypeConstructorFunction( + Type type, + string typeName, + bool typeIsDelegate, + string constructorFuncName, + ParameterInfo[] constructorParams, + StringBuilder output) + { + AppendCsharpFunctionBeginning( + type, + constructorFuncName, + true, + TypeKind.Class, + typeof(void), + constructorParams, + output); + output.Append("var thiz = new "); + output.Append(typeName); + output.Append("(cppHandle);\n"); + if (typeIsDelegate) + { + output.Append( + "\t\t\t\tclassHandle = NativeScript.Bindings.ObjectStore.Store(thiz);\n"); + output.Append( + "\t\t\t\thandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate);"); + } + else + { + output.Append( + "\t\t\t\thandle = NativeScript.Bindings.ObjectStore.Store(thiz);"); + } + AppendCsharpFunctionReturn( + constructorParams, + typeof(void), + TypeKind.Class, + null, + true, + output); + } + + static void AppendCppBaseTypeMethodInvokeBindingFunction( + string funcName, + Type type, + Type[] typeParams, + MethodInfo method, + string methodName, + TypeKind methodReturnTypeKind, + ParameterInfo[] methodParams, + int indent, + string typeName, + StringBuilder output) + { + AppendIndent( + indent, + output); + output.Append("DLLEXPORT "); + if (method.ReturnType == typeof(void)) + { + output.Append("void"); + } + else + { + switch (methodReturnTypeKind) + { + case TypeKind.Class: + case TypeKind.ManagedStruct: + output.Append("int32_t"); + break; + default: + AppendCppTypeName( + method.ReturnType, + output); + break; + } + } + output.Append(' '); + AppendCsharpDelegateName( + type.Name, + type.Namespace, + typeParams, + funcName, + output); + output.Append("(int32_t cppHandle"); + if (methodParams.Length > 0) + { + output.Append(", "); + } + for (int i = 0; i < methodParams.Length; ++i) + { + ParameterInfo param = methodParams[i]; + switch (param.Kind) + { + case TypeKind.Class: + case TypeKind.ManagedStruct: + output.Append("int32_t "); + output.Append(param.Name); + output.Append("Handle"); + break; + default: + AppendCppTypeName( + param.ParameterType, + output); + output.Append(' '); + output.Append(param.Name); + break; + } + if (i != methodParams.Length - 1) + { + output.Append(", "); + } + } + output.Append(")\n"); + AppendIndent( + indent, + output); + output.Append("{\n"); + AppendIndent( + indent + 1, + output); + output.Append("try\n"); + AppendIndent( + indent + 1, + output); + output.Append("{\n"); + AppendIndent( + indent + 2, + output); + if (method.ReturnType != typeof(void)) + { + output.Append("return "); + } + output.Append("Plugin::Get"); + output.Append(typeName); + output.Append("(cppHandle)->"); + output.Append(methodName); + output.Append("("); + for (int i = 0; i < methodParams.Length; ++i) + { + ParameterInfo parameter = methodParams[i]; + if (parameter.Kind == TypeKind.Class || + parameter.Kind == TypeKind.ManagedStruct) + { + AppendCppTypeName( + parameter.ParameterType, + output); + output.Append("(Plugin::InternalUse::Only, "); + output.Append(parameter.Name); + output.Append("Handle)"); + } + else + { + output.Append(parameter.Name); + } + if (i != methodParams.Length - 1) + { + output.Append(", "); + } + } + output.Append(")"); + if ( + method.ReturnType != typeof(void) && + (methodReturnTypeKind == TypeKind.Class || + methodReturnTypeKind == TypeKind.ManagedStruct)) + { + output.Append(".Handle"); + } + output.Append(";\n"); AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + indent + 1, + output); + output.Append("}\n"); AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); - - // Copy constructor + indent + 1, + output); + output.Append( + "catch (System::Exception ex)\n"); AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - AppendTypeNameWithoutGenericSuffix( - numberedTypeName, - builders.CppMethodDefinitions); - AppendCppTypeParameters( - typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("::"); - AppendTypeNameWithoutGenericSuffix( - numberedTypeName, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("(const "); - AppendTypeNameWithoutGenericSuffix( - numberedTypeName, - builders.CppMethodDefinitions); - AppendCppTypeParameters( - typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("& other)\n"); + indent + 1, + output); + output.Append("{\n"); AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "\t: System::Object(Plugin::InternalUse::Only, other.Handle)\n"); + indent + 2, + output); + output.Append( + "Plugin::SetException(ex.Handle);\n"); + if (method.ReturnType != typeof(void)) + { + AppendIndent( + indent + 2, + output); + output.Append( + "return {};\n"); + } AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + indent + 1, + output); + output.Append("}\n"); AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("CppHandle = Plugin::Store"); - builders.CppMethodDefinitions.Append(typeName); - builders.CppMethodDefinitions.Append("(this);\n"); + indent + 1, + output); + output.Append("catch (...)\n"); AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("if (Handle)\n"); + indent + 1, + output); + output.Append("{\n"); AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + indent + 2, + output); + output.Append( + "System::String msg = \"Unhandled exception invoking "); + AppendCppTypeName( + type, + output); + output.Append("\";\n"); AppendIndent( - cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "Plugin::ReferenceManagedClass(Handle);\n"); + indent + 2, + output); + output.Append( + "System::Exception ex(msg);\n"); AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + indent + 2, + output); + output.Append( + "Plugin::SetException(ex.Handle);\n"); + if (method.ReturnType != typeof(void)) + { + AppendIndent( + indent + 2, + output); + output.Append( + "return {};\n"); + } AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "ClassHandle = other.ClassHandle;\n"); + indent + 1, + output); + output.Append("}\n"); AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + indent, + output); + output.Append("}\n"); AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); - - // Move constructor + indent, + output); + output.Append("\n"); + } + + static void AppendCppBaseTypeInequalityOperator( + string numberedTypeName, + Type[] typeParams, + int cppMethodDefinitionsIndent, + StringBuilder output) + { AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); + output); + output.Append("bool "); AppendTypeNameWithoutGenericSuffix( numberedTypeName, - builders.CppMethodDefinitions); + output); AppendCppTypeParameters( typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("::"); - AppendTypeNameWithoutGenericSuffix( - numberedTypeName, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("("); + output); + output.Append("::operator!=(const "); AppendTypeNameWithoutGenericSuffix( numberedTypeName, - builders.CppMethodDefinitions); + output); AppendCppTypeParameters( typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("&& other)\n"); - AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "\t: System::Object(Plugin::InternalUse::Only, other.Handle)\n"); + output); + output.Append("& other) const\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "CppHandle = other.CppHandle;\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "ClassHandle = other.ClassHandle;\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("other.Handle = 0;\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("other.CppHandle = 0;\n"); + output); + output.Append("{\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("other.ClassHandle = 0;\n"); + output); + output.Append( + "return Handle != other.Handle;\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + output); + output.Append("}\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); - - // Handle constructor + output); + output.Append('\n'); + } + + static void AppendCppBaseTypeEqualityOperator( + string numberedTypeName, + Type[] typeParams, + int cppMethodDefinitionsIndent, + StringBuilder output) + { AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); + output); + output.Append("bool "); AppendTypeNameWithoutGenericSuffix( numberedTypeName, - builders.CppMethodDefinitions); + output); AppendCppTypeParameters( typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("::"); + output); + output.Append("::operator==(const "); AppendTypeNameWithoutGenericSuffix( numberedTypeName, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "(Plugin::InternalUse iu, int32_t handle)\n"); - AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "\t: System::Object(iu, handle)\n"); + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& other) const\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("CppHandle = Plugin::Store"); - builders.CppMethodDefinitions.Append(typeName); - builders.CppMethodDefinitions.Append("(this);\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("if (Handle)\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendIndent( - cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "Plugin::ReferenceManagedClass(Handle);\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + output); + output.Append("{\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "ClassHandle = 0;\n"); + output); + output.Append( + "return Handle == other.Handle;\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + output); + output.Append("}\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); - - // Destructor + output); + output.Append('\n'); + } + + static void AppendCppBaseTypeMoveAssignmentOperator( + string typeName, + string numberedTypeName, + Type[] typeParams, + bool typeIsDelegate, + string releaseFuncName, + int cppMethodDefinitionsIndent, + StringBuilder output) + { AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); + output); AppendTypeNameWithoutGenericSuffix( numberedTypeName, - builders.CppMethodDefinitions); + output); AppendCppTypeParameters( typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("::~"); + output); + output.Append("& "); AppendTypeNameWithoutGenericSuffix( numberedTypeName, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("()\n"); + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("::operator=("); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("&& other)\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + output); + output.Append("{\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Plugin::Remove"); - builders.CppMethodDefinitions.Append(typeName); - builders.CppMethodDefinitions.Append("(CppHandle);\n"); + output); + output.Append("Plugin::Remove"); + output.Append(typeName); + output.Append("(CppHandle);\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("CppHandle = 0;\n"); + output); + output.Append("CppHandle = 0;\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("if (Handle)\n"); + output); + output.Append("if (Handle)\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendIndent( - cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("int32_t handle = Handle;\n"); - AppendIndent( - cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("int32_t classHandle = ClassHandle;\n"); + output); + output.Append("{\n"); AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Handle = 0;\n"); + output); + output.Append("int32_t handle = Handle;\n"); + if (typeIsDelegate) + { + AppendIndent( + cppMethodDefinitionsIndent + 2, + output); + output.Append("int32_t classHandle = ClassHandle;\n"); + } AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); + output); + output.Append("Handle = 0;\n"); + if (typeIsDelegate) + { + AppendIndent( + cppMethodDefinitionsIndent + 2, + output); + output.Append("ClassHandle = 0;\n"); + } AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( + output); + output.Append( "if (Plugin::DereferenceManagedClassNoRelease(handle))\n"); AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + output); + output.Append("{\n"); AppendIndent( cppMethodDefinitionsIndent + 3, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Plugin::"); - builders.CppMethodDefinitions.Append(releaseFuncName); - builders.CppMethodDefinitions.Append("(handle, classHandle);\n"); + output); + output.Append("Plugin::"); + output.Append(releaseFuncName); + output.Append("(handle"); + if (typeIsDelegate) + { + output.Append(", classHandle"); + } + output.Append(");\n"); AppendCppUnhandledExceptionHandling( cppMethodDefinitionsIndent + 3, - builders.CppMethodDefinitions); + output); AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + output); + output.Append("}\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); - AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); - AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); - - // Assignment operator to same type - AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - AppendTypeNameWithoutGenericSuffix( - numberedTypeName, - builders.CppMethodDefinitions); - AppendCppTypeParameters( - typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("& "); - AppendTypeNameWithoutGenericSuffix( - numberedTypeName, - builders.CppMethodDefinitions); - AppendCppTypeParameters( - typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("::operator=(const "); - AppendTypeNameWithoutGenericSuffix( - numberedTypeName, - builders.CppMethodDefinitions); - AppendCppTypeParameters( - typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("& other)\n"); + output); + output.Append("}\n"); + if (typeIsDelegate) + { + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append( + "ClassHandle = other.ClassHandle;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("other.ClassHandle = 0;\n"); + } AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendSetHandle( - numberedTypeName, - type.Namespace, - TypeKind.Class, - typeParams, cppMethodDefinitionsIndent + 1, - "this", - "other.Handle", - builders.CppMethodDefinitions); + output); + output.Append("Handle = other.Handle;\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "ClassHandle = other.ClassHandle;\n"); + output); + output.Append("other.Handle = 0;\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("return *this;\n"); + output); + output.Append("return *this;\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + output); + output.Append("}\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); - - // Assignment operator to nullptr_t + output); + output.Append("\n"); + } + + static void AppendCppBaseTypeAssignmentOperatorNullptr( + string numberedTypeName, + Type[] typeParams, + bool typeIsDelegate, + string releaseFuncName, + int cppMethodDefinitionsIndent, + StringBuilder output) + { AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); + output); AppendTypeNameWithoutGenericSuffix( numberedTypeName, - builders.CppMethodDefinitions); + output); AppendCppTypeParameters( typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("& "); + output); + output.Append("& "); AppendTypeNameWithoutGenericSuffix( numberedTypeName, - builders.CppMethodDefinitions); + output); AppendCppTypeParameters( typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( + output); + output.Append( "::operator=(std::nullptr_t other)\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + output); + output.Append("{\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("if (Handle)\n"); + output); + output.Append("if (Handle)\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendIndent( - cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("int32_t handle = Handle;\n"); - AppendIndent( - cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("int32_t classHandle = ClassHandle;\n"); + output); + output.Append("{\n"); AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Handle = 0;\n"); + output); + output.Append("int32_t handle = Handle;\n"); + if (typeIsDelegate) + { + AppendIndent( + cppMethodDefinitionsIndent + 2, + output); + output.Append("int32_t classHandle = ClassHandle;\n"); + } AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); + output); + output.Append("Handle = 0;\n"); + if (typeIsDelegate) + { + AppendIndent( + cppMethodDefinitionsIndent + 2, + output); + output.Append("ClassHandle = 0;\n"); + } AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( + output); + output.Append( "if (Plugin::DereferenceManagedClassNoRelease(handle))\n"); AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + output); + output.Append("{\n"); AppendIndent( cppMethodDefinitionsIndent + 3, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Plugin::"); - builders.CppMethodDefinitions.Append(releaseFuncName); - builders.CppMethodDefinitions.Append("(handle, classHandle);\n"); + output); + output.Append("Plugin::"); + output.Append(releaseFuncName); + output.Append("(handle"); + if (typeIsDelegate) + { + output.Append(", classHandle"); + } + output.Append(");\n"); AppendCppUnhandledExceptionHandling( cppMethodDefinitionsIndent + 3, - builders.CppMethodDefinitions); + output); AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + output); + output.Append("}\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + output); + output.Append("}\n"); + if (typeIsDelegate) + { + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("ClassHandle = 0;\n"); + } AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); + output); + output.Append("Handle = 0;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("return *this;\n"); + AppendIndent( + cppMethodDefinitionsIndent, + output); + output.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, + output); + output.Append("\n"); + } + + static void AppendCppBaseTypeAssignmentOperatorSameType( + Type type, + string numberedTypeName, + Type[] typeParams, + bool typeIsDelegate, + int cppMethodDefinitionsIndent, + StringBuilder output) + { + AppendIndent( + cppMethodDefinitionsIndent, + output); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& "); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("::operator=(const "); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("& other)\n"); AppendIndent( + cppMethodDefinitionsIndent, + output); + output.Append("{\n"); + AppendSetHandle( + numberedTypeName, + type.Namespace, + TypeKind.Class, + typeParams, cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Handle = 0;\n"); + "this", + "other.Handle", + output); + if (typeIsDelegate) + { + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append( + "ClassHandle = other.ClassHandle;\n"); + } AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("return *this;\n"); + output); + output.Append("return *this;\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + output); + output.Append("}\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); - - // Move assignment operator to same type + output); + output.Append("\n"); + } + + static void AppendCppBaseTypeDestructor( + string typeName, + string numberedTypeName, + Type[] typeParams, + bool typeIsDelegate, + string releaseFuncName, + int cppMethodDefinitionsIndent, + StringBuilder output) + { AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - AppendTypeNameWithoutGenericSuffix( - numberedTypeName, - builders.CppMethodDefinitions); - AppendCppTypeParameters( - typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("& "); + output); AppendTypeNameWithoutGenericSuffix( numberedTypeName, - builders.CppMethodDefinitions); + output); AppendCppTypeParameters( typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("::operator=("); + output); + output.Append("::~"); AppendTypeNameWithoutGenericSuffix( numberedTypeName, - builders.CppMethodDefinitions); - AppendCppTypeParameters( - typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("&& other)\n"); + output); + output.Append("()\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + output); + output.Append("{\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Plugin::Remove"); - builders.CppMethodDefinitions.Append(typeName); - builders.CppMethodDefinitions.Append("(CppHandle);\n"); + output); + output.Append("Plugin::Remove"); + output.Append(typeName); + output.Append("(CppHandle);\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("CppHandle = 0;\n"); + output); + output.Append("CppHandle = 0;\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("if (Handle)\n"); + output); + output.Append("if (Handle)\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendIndent( - cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("int32_t handle = Handle;\n"); - AppendIndent( - cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("int32_t classHandle = ClassHandle;\n"); + output); + output.Append("{\n"); AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Handle = 0;\n"); + output); + output.Append("int32_t handle = Handle;\n"); + if (typeIsDelegate) + { + AppendIndent( + cppMethodDefinitionsIndent + 2, + output); + output.Append("int32_t classHandle = ClassHandle;\n"); + } AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("ClassHandle = 0;\n"); + output); + output.Append("Handle = 0;\n"); + if (typeIsDelegate) + { + AppendIndent( + cppMethodDefinitionsIndent + 2, + output); + output.Append("ClassHandle = 0;\n"); + } AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( + output); + output.Append( "if (Plugin::DereferenceManagedClassNoRelease(handle))\n"); AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + output); + output.Append("{\n"); AppendIndent( cppMethodDefinitionsIndent + 3, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Plugin::"); - builders.CppMethodDefinitions.Append(releaseFuncName); - builders.CppMethodDefinitions.Append("(handle, classHandle);\n"); + output); + output.Append("Plugin::"); + output.Append(releaseFuncName); + output.Append("(handle"); + if (typeIsDelegate) + { + output.Append(", classHandle"); + } + output.Append(");\n"); AppendCppUnhandledExceptionHandling( cppMethodDefinitionsIndent + 3, - builders.CppMethodDefinitions); + output); AppendIndent( cppMethodDefinitionsIndent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "ClassHandle = other.ClassHandle;\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("other.ClassHandle = 0;\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Handle = other.Handle;\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("other.Handle = 0;\n"); + output); + output.Append("}\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("return *this;\n"); + output); + output.Append("}\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + output); + output.Append("}\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); - - // Equality operator with same type + output); + output.Append("\n"); + } + + static void AppendCppBaseTypeHandleConstructor( + string typeName, + string numberedTypeName, + Type[] typeParams, + bool typeIsDelegate, + int cppMethodDefinitionsIndent, + StringBuilder output) + { AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("bool "); + output); AppendTypeNameWithoutGenericSuffix( numberedTypeName, - builders.CppMethodDefinitions); + output); AppendCppTypeParameters( typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("::operator==(const "); + output); + output.Append("::"); AppendTypeNameWithoutGenericSuffix( numberedTypeName, - builders.CppMethodDefinitions); - AppendCppTypeParameters( - typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("& other) const\n"); + output); + output.Append( + "(Plugin::InternalUse iu, int32_t handle)\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + output); + output.Append( + "\t: System::Object(iu, handle)\n"); + AppendIndent( + cppMethodDefinitionsIndent, + output); + output.Append("{\n"); AppendIndent( cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "return Handle == other.Handle;\n"); + output); + output.Append("CppHandle = Plugin::Store"); + output.Append(typeName); + output.Append("(this);\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("if (Handle)\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + output); + output.Append( + "Plugin::ReferenceManagedClass(Handle);\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("}\n"); + if (typeIsDelegate) + { + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append( + "ClassHandle = 0;\n"); + } AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + output); + output.Append("}\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); - - // Inequality operator with same type + output); + output.Append("\n"); + } + + static void AppendCppBaseTypeMoveConstructor( + string numberedTypeName, + Type[] typeParams, + bool typeIsDelegate, + int cppMethodDefinitionsIndent, + StringBuilder output) + { AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("bool "); + output); AppendTypeNameWithoutGenericSuffix( numberedTypeName, - builders.CppMethodDefinitions); + output); AppendCppTypeParameters( typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("::operator!=(const "); + output); + output.Append("::"); AppendTypeNameWithoutGenericSuffix( numberedTypeName, - builders.CppMethodDefinitions); + output); + output.Append("("); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + output); AppendCppTypeParameters( typeParams, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("& other) const\n"); - AppendIndent( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendIndent( - cppMethodDefinitionsIndent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "return Handle != other.Handle;\n"); + output); + output.Append("&& other)\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + output); + output.Append( + "\t: System::Object(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent( cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); - - // C++ operator() - AppendCppMethodDefinitionBegin( - numberedTypeName, - invokeMethod.ReturnType, - "operator()", - typeParams, - null, - invokeParams, - indent, - builders.CppMethodDefinitions); + output); + output.Append("{\n"); AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - if (invokeMethod.ReturnType != typeof(void)) + cppMethodDefinitionsIndent + 1, + output); + output.Append( + "CppHandle = other.CppHandle;\n"); + if (typeIsDelegate) { AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("return {};\n"); + cppMethodDefinitionsIndent + 1, + output); + output.Append( + "ClassHandle = other.ClassHandle;\n"); } AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + cppMethodDefinitionsIndent + 1, + output); + output.Append("other.Handle = 0;\n"); AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); - - // C++ Invoke - AppendCppMethodDefinitionBegin( - numberedTypeName, - invokeMethod.ReturnType, - "Invoke", - typeParams, - null, - invokeParams, - indent, - builders.CppMethodDefinitions); + cppMethodDefinitionsIndent + 1, + output); + output.Append("other.CppHandle = 0;\n"); + if (typeIsDelegate) + { + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("other.ClassHandle = 0;\n"); + } AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendCppPluginFunctionCall( - false, - type.Name, - type.Namespace, - TypeKind.Class, - typeParams, - invokeMethod.ReturnType, - invokeFuncName, - invokeParams, - indent + 1, - builders.CppMethodDefinitions); - AppendCppMethodReturn( - invokeMethod.ReturnType, - invokeReturnTypeKind, - indent + 1, - builders.CppMethodDefinitions); + cppMethodDefinitionsIndent, + output); + output.Append("}\n"); AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + cppMethodDefinitionsIndent, + output); + output.Append("\n"); + } + + static void AppendCppBaseTypeCopyConstructor( + string typeName, + string numberedTypeName, + Type[] typeParams, + bool typeIsDelegate, + int cppMethodDefinitionsIndent, + StringBuilder output) + { AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); - - // C++ add - AppendCppMethodDefinitionBegin( + cppMethodDefinitionsIndent, + output); + AppendTypeNameWithoutGenericSuffix( numberedTypeName, - typeof(void), - "operator+=", + output); + AppendCppTypeParameters( typeParams, - null, - addRemoveParams, - indent, - builders.CppMethodDefinitions); - AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Plugin::"); - builders.CppMethodDefinitions.Append(addFuncName); - builders.CppMethodDefinitions.Append("(Handle, del.Handle);\n"); - AppendCppUnhandledExceptionHandling( - indent + 1, - builders.CppMethodDefinitions); - AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); - AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); - - // C++ remove - AppendCppMethodDefinitionBegin( + output); + output.Append("::"); + AppendTypeNameWithoutGenericSuffix( numberedTypeName, - typeof(void), - "operator-=", + output); + output.Append("(const "); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + output); + AppendCppTypeParameters( typeParams, - null, - addRemoveParams, - indent, - builders.CppMethodDefinitions); + output); + output.Append("& other)\n"); AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + cppMethodDefinitionsIndent, + output); + output.Append( + "\t: System::Object(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Plugin::"); - builders.CppMethodDefinitions.Append(removeFuncName); - builders.CppMethodDefinitions.Append("(Handle, del.Handle);\n"); - AppendCppUnhandledExceptionHandling( - indent + 1, - builders.CppMethodDefinitions); + cppMethodDefinitionsIndent, + output); + output.Append("{\n"); AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + cppMethodDefinitionsIndent + 1, + output); + output.Append("CppHandle = Plugin::Store"); + output.Append(typeName); + output.Append("(this);\n"); AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); - - // C++ CppInvoke function + cppMethodDefinitionsIndent + 1, + output); + output.Append("if (Handle)\n"); AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("DLLEXPORT "); - if (invokeMethod.ReturnType == typeof(void)) - { - builders.CppMethodDefinitions.Append("void"); - } - else - { - switch (invokeReturnTypeKind) - { - case TypeKind.Class: - case TypeKind.ManagedStruct: - builders.CppMethodDefinitions.Append("int32_t"); - break; - default: - AppendCppTypeName( - invokeMethod.ReturnType, - builders.CppMethodDefinitions); - break; - } - } - builders.CppMethodDefinitions.Append(' '); - AppendCsharpDelegateName( - type.Name, - type.Namespace, - typeParams, - "CppInvoke", - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("(int32_t cppHandle"); - if (invokeParams.Length > 0) - { - builders.CppMethodDefinitions.Append(", "); - } - for (int i = 0; i < invokeParams.Length; ++i) + cppMethodDefinitionsIndent + 1, + output); + output.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + output); + output.Append( + "Plugin::ReferenceManagedClass(Handle);\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("}\n"); + if (typeIsDelegate) { - ParameterInfo param = invokeParams[i]; - switch (param.Kind) - { - case TypeKind.Class: - case TypeKind.ManagedStruct: - builders.CppMethodDefinitions.Append("int32_t "); - builders.CppMethodDefinitions.Append(param.Name); - builders.CppMethodDefinitions.Append("Handle"); - break; - default: - AppendCppTypeName( - param.ParameterType, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(' '); - builders.CppMethodDefinitions.Append(param.Name); - break; - } - if (i != invokeParams.Length - 1) - { - builders.CppMethodDefinitions.Append(", "); - } + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append( + "ClassHandle = other.ClassHandle;\n"); } - builders.CppMethodDefinitions.Append(")\n"); - AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("try\n"); + cppMethodDefinitionsIndent, + output); + output.Append("}\n"); AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + cppMethodDefinitionsIndent, + output); + output.Append("\n"); + } + + static void AppendCppBaseTypeNullptrConstructor( + string typeName, + string numberedTypeName, + Type[] typeParams, + bool typeIsDelegate, + int cppMethodDefinitionsIndent, + StringBuilder output) + { AppendIndent( - indent + 2, - builders.CppMethodDefinitions); - if (invokeMethod.ReturnType != typeof(void)) - { - builders.CppMethodDefinitions.Append("return "); - } - builders.CppMethodDefinitions.Append("(*Plugin::Get"); - builders.CppMethodDefinitions.Append(typeName); - builders.CppMethodDefinitions.Append("(cppHandle))("); - for (int i = 0; i < invokeParams.Length; ++i) - { - ParameterInfo parameter = invokeParams[i]; - if (parameter.Kind == TypeKind.Class - || parameter.Kind == TypeKind.ManagedStruct) - { - AppendCppTypeName( - parameter.ParameterType, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("(Plugin::InternalUse::Only, "); - builders.CppMethodDefinitions.Append(parameter.Name); - builders.CppMethodDefinitions.Append("Handle)"); - } - else - { - builders.CppMethodDefinitions.Append(parameter.Name); - } - if (i != invokeParams.Length - 1) - { - builders.CppMethodDefinitions.Append(", "); - } - } - builders.CppMethodDefinitions.Append(")"); - if ( - invokeMethod.ReturnType != typeof(void) && - (invokeReturnTypeKind == TypeKind.Class || - invokeReturnTypeKind == TypeKind.ManagedStruct)) + cppMethodDefinitionsIndent, + output); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("::"); + AppendTypeNameWithoutGenericSuffix( + numberedTypeName, + output); + output.Append("(std::nullptr_t n)\n"); + AppendIndent( + cppMethodDefinitionsIndent, + output); + output.Append( + "\t: System::Object(Plugin::InternalUse::Only, 0)\n"); + AppendIndent( + cppMethodDefinitionsIndent, + output); + output.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("CppHandle = Plugin::Store"); + output.Append(typeName); + output.Append("(this);\n"); + if (typeIsDelegate) { - builders.CppMethodDefinitions.Append(".Handle"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("ClassHandle = 0;\n"); } - builders.CppMethodDefinitions.Append(";\n"); AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + cppMethodDefinitionsIndent, + output); + output.Append("}\n"); AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "catch (System::Exception ex)\n"); + cppMethodDefinitionsIndent, + output); + output.Append("\n"); + } + + static void AppendCppBaseTypeDefaultConstructor( + string typeName, + string numberedTypeName, + Type[] typeParams, + bool typeIsDelegate, + string constructorFuncName, + int cppMethodDefinitionsIndent, + StringBuilder output) + { + AppendCppMethodDefinitionBegin( + numberedTypeName, + null, + numberedTypeName, + typeParams, + null, + new ParameterInfo[0], + cppMethodDefinitionsIndent, + output); AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + cppMethodDefinitionsIndent + 1, + output); + output.Append(" : System::Object(nullptr)\n"); AppendIndent( - indent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "Plugin::SetException(ex.Handle);\n"); - if (invokeMethod.ReturnType != typeof(void)) + cppMethodDefinitionsIndent, + output); + output.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("CppHandle = Plugin::Store"); + output.Append(typeName); + output.Append("(this);\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("Plugin::"); + output.Append(constructorFuncName); + output.Append("(CppHandle, &Handle"); + if (typeIsDelegate) { - AppendIndent( - indent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "return {};\n"); + output.Append(", &ClassHandle"); } + output.Append(");\n"); AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + cppMethodDefinitionsIndent + 1, + output); + output.Append("if (Handle)\n"); AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("catch (...)\n"); + cppMethodDefinitionsIndent + 1, + output); + output.Append("{\n"); AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + cppMethodDefinitionsIndent + 2, + output); + output.Append( + "Plugin::ReferenceManagedClass(Handle);\n"); AppendIndent( - indent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "System::String msg = \"Unhandled exception invoking "); - AppendCppTypeName( - type, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\";\n"); + cppMethodDefinitionsIndent + 1, + output); + output.Append("}\n"); AppendIndent( - indent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "System::Exception ex(msg);\n"); + cppMethodDefinitionsIndent + 1, + output); + output.Append("else\n"); AppendIndent( - indent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "Plugin::SetException(ex.Handle);\n"); - if (invokeMethod.ReturnType != typeof(void)) + cppMethodDefinitionsIndent + 1, + output); + output.Append("{\n"); + AppendIndent( + cppMethodDefinitionsIndent + 2, + output); + output.Append("Plugin::Remove"); + output.Append(typeName); + output.Append("(CppHandle);\n"); + if (typeIsDelegate) { AppendIndent( - indent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "return {};\n"); + cppMethodDefinitionsIndent + 2, + output); + output.Append("ClassHandle = 0;\n"); } AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + cppMethodDefinitionsIndent + 2, + output); + output.Append("CppHandle = 0;\n"); AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + cppMethodDefinitionsIndent + 1, + output); + output.Append("}\n"); + AppendCppUnhandledExceptionHandling( + cppMethodDefinitionsIndent + 1, + output); AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); - - // C++ method definitions (end) - AppendCppMethodDefinitionsEnd( - indent, - builders.CppMethodDefinitions); - - // C++ type definition (end) - AppendCppTypeDefinitionEnd( - false, - indent, - builders.CppTypeDefinitions); - - // C# delegate - AppendCsharpDelegate( - false, - type.Name, - type.Namespace, - typeParams, - "CppInvoke", - invokeParams, - invokeMethod.ReturnType, - invokeReturnTypeKind, - builders.CsharpDelegates); - - // C# GetDelegate call - AppendCsharpGetDelegateCall( - type.Name, - type.Namespace, - typeParams, - "CppInvoke", - builders.CsharpGetDelegateCalls); - - // C# import - AppendCsharpImport( - type.Name, - type.Namespace, - typeParams, - "CppInvoke", - invokeParams, - builders.CsharpImports); - - // C# class - builders.CsharpFunctions.Append("\t\tclass "); - builders.CsharpFunctions.Append(typeName); - builders.CsharpFunctions.Append("\n"); - builders.CsharpFunctions.Append("\t\t{\n"); - builders.CsharpFunctions.Append("\t\t\tpublic int CppHandle;\n"); - builders.CsharpFunctions.Append("\t\t\tpublic "); - AppendCsharpTypeName( - type, - builders.CsharpFunctions); - builders.CsharpFunctions.Append(" Delegate;\n"); - builders.CsharpFunctions.Append("\t\t\t\n"); - builders.CsharpFunctions.Append("\t\t\tpublic "); - builders.CsharpFunctions.Append(typeName); - builders.CsharpFunctions.Append("(int cppHandle)\n"); - builders.CsharpFunctions.Append("\t\t\t{\n"); - builders.CsharpFunctions.Append("\t\t\t\tCppHandle = cppHandle;\n"); - builders.CsharpFunctions.Append("\t\t\t\tDelegate = Invoke;\n"); - builders.CsharpFunctions.Append("\t\t\t}\n"); - builders.CsharpFunctions.Append("\t\t\t\n"); - builders.CsharpFunctions.Append("\t\t\tpublic "); - AppendCsharpTypeName( - invokeMethod.ReturnType, - builders.CsharpFunctions); - builders.CsharpFunctions.Append(" Invoke("); - for (int i = 0; i < invokeParams.Length; ++i) - { - ParameterInfo param = invokeParams[i]; - AppendCsharpTypeName( - param.ParameterType, - builders.CsharpFunctions); - builders.CsharpFunctions.Append(' '); - builders.CsharpFunctions.Append(param.Name); - if (i != invokeParams.Length - 1) - { - builders.CsharpFunctions.Append(", "); - } - } - builders.CsharpFunctions.Append(")\n"); - builders.CsharpFunctions.Append("\t\t\t{\n"); - builders.CsharpFunctions.Append("\t\t\t\tif (CppHandle != 0)\n"); - builders.CsharpFunctions.Append("\t\t\t\t{\n"); - builders.CsharpFunctions.Append("\t\t\t\t\tint thisHandle = CppHandle;\n"); - AppendCppFunctionCall( - cppInvokeFuncName, - invokeParamsWithThis, - invokeMethod.ReturnType, - type.Name, - type.Namespace, - true, - 5, - builders.CsharpFunctions); - if (invokeMethod.ReturnType != typeof(void)) - { - builders.CsharpFunctions.Append("\t\t\t\t\treturn "); - switch (invokeReturnTypeKind) - { - case TypeKind.Class: - case TypeKind.ManagedStruct: - if (invokeMethod.ReturnType != typeof(object)) - { - builders.CsharpFunctions.Append('('); - AppendCsharpTypeName( - invokeMethod.ReturnType, - builders.CsharpFunctions); - builders.CsharpFunctions.Append(')'); - } - AppendHandleStoreTypeName( - invokeMethod.ReturnType, - builders.CsharpFunctions); - builders.CsharpFunctions.Append(".Get(returnVal);\n"); - break; - default: - builders.CsharpFunctions.Append("returnVal;\n"); - break; - } - } - builders.CsharpFunctions.Append("\t\t\t\t}\n"); - if (invokeMethod.ReturnType != typeof(void)) - { - builders.CsharpFunctions.Append("\t\t\t\treturn default("); - AppendCsharpTypeName( - invokeMethod.ReturnType, - builders.CsharpFunctions); - builders.CsharpFunctions.Append(");\n"); - } - builders.CsharpFunctions.Append("\t\t\t}\n"); - builders.CsharpFunctions.Append("\t\t}\n"); - builders.CsharpFunctions.Append("\t\t\n"); - - // C# constructor delegate type - AppendCsharpDelegateType( - constructorFuncName, - true, - type, - TypeKind.Class, - typeof(void), - constructorParams, - builders.CsharpDelegateTypes); - - // C# constructor function - AppendCsharpFunctionBeginning( + cppMethodDefinitionsIndent, + output); + output.Append("}\n"); + AppendIndent( + cppMethodDefinitionsIndent, + output); + output.Append('\n'); + } + + static void AppendCppFreeListInit( + Type type, + int? maxSimultaneous, + string typeName, + StringBuilder output) + { + output.Append('\t'); + output.Append(typeName); + output.Append("FreeListSize = "); + if (maxSimultaneous.HasValue) + { + output.Append(maxSimultaneous); + } + else + { + output.Append("maxManagedObjects"); + } + output.Append(";\n"); + output.Append("\t"); + output.Append(typeName); + output.Append("FreeList = new "); + AppendCppTypeName( type, - constructorFuncName, - true, - TypeKind.Class, - typeof(void), - typeParams, - constructorParams, - builders.CsharpFunctions); - builders.CsharpFunctions.Append("var thiz = new "); - builders.CsharpFunctions.Append(typeName); - builders.CsharpFunctions.Append("(cppHandle);\n"); - builders.CsharpFunctions.Append("\t\t\t\tclassHandle = NativeScript.Bindings.ObjectStore.Store(thiz);\n"); - builders.CsharpFunctions.Append("\t\t\t\thandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate);"); - AppendCsharpFunctionReturn( - constructorParams, - typeof(void), - TypeKind.Class, - null, - true, - builders.CsharpFunctions); - - // C# release delegate type - AppendCsharpDelegateType( - releaseFuncName, - true, + output); + output.Append("*["); + output.Append(typeName); + output.Append("FreeListSize];\n"); + output.Append("\tfor (int32_t i = 0, end = "); + output.Append(typeName); + output.Append("FreeListSize - 1; i < end; ++i)\n"); + output.Append("\t{\n"); + output.Append("\t "); + output.Append(typeName); + output.Append("FreeList[i] = ("); + AppendCppTypeName( type, - TypeKind.Class, - typeof(void), - releaseParams, - builders.CsharpDelegateTypes); - - // C# release function - AppendCsharpFunctionBeginning( + output); + output.Append("*)("); + output.Append(typeName); + output.Append("FreeList + i + 1);\n"); + output.Append("\t}\n"); + output.Append('\t'); + output.Append(typeName); + output.Append("FreeList["); + output.Append(typeName); + output.Append("FreeListSize - 1] = nullptr;\n"); + output.Append("\tNextFree"); + output.Append(typeName); + output.Append(" = "); + output.Append(typeName); + output.Append("FreeList + 1;\n"); + } + + static void AppendCppFreeListStateAndFunctions( + Type type, + string typeName, + StringBuilder output) + { + output.Append("\tint32_t "); + output.Append(typeName); + output.Append("FreeListSize;\n"); + output.Append('\t'); + AppendCppTypeName( type, - releaseFuncName, - true, - TypeKind.Class, - typeof(void), - typeParams, - releaseParams, - builders.CsharpFunctions); - builders.CsharpFunctions.Append("if (classHandle != 0)\n"); - builders.CsharpFunctions.Append("\t\t\t\t{\n"); - builders.CsharpFunctions.Append("\t\t\t\t\tvar thiz = ("); - builders.CsharpFunctions.Append(typeName); - builders.CsharpFunctions.Append(")NativeScript.Bindings.ObjectStore.Remove(classHandle);\n"); - builders.CsharpFunctions.Append("\t\t\t\t\tthiz.CppHandle = 0;\n"); - builders.CsharpFunctions.Append("\t\t\t\t}\n"); - builders.CsharpFunctions.Append("\t\t\t\tNativeScript.Bindings.ObjectStore.Remove(handle);"); - AppendCsharpFunctionReturn( - releaseParams, - typeof(void), - TypeKind.Class, - null, - true, - builders.CsharpFunctions); - - // C# invoke delegate type - AppendCsharpDelegateType( - invokeFuncName, - true, + output); + output.Append("** "); + output.Append(typeName); + output.Append("FreeList;\n"); + output.Append('\t'); + AppendCppTypeName( type, - TypeKind.Class, - invokeMethod.ReturnType, - invokeParamsWithThis, - builders.CsharpDelegateTypes); - - // C# invoke function - AppendCsharpFunctionBeginning( + output); + output.Append("** NextFree"); + output.Append(typeName); + output.Append(";\n"); + output.Append("\t\n"); + output.Append("\tint32_t Store"); + output.Append(typeName); + output.Append('('); + AppendCppTypeName( type, - invokeFuncName, - true, - TypeKind.Class, - invokeMethod.ReturnType, - typeParams, - invokeParamsWithThis, - builders.CsharpFunctions); - builders.CsharpFunctions.Append("(("); - AppendCsharpTypeName( + output); + output.Append("* del)\n"); + output.Append("\t{\n"); + output.Append("\t\tassert(NextFree"); + output.Append(typeName); + output.Append(" != nullptr);\n"); + output.Append("\t\t"); + AppendCppTypeName( type, - builders.CsharpFunctions); - builders.CsharpFunctions.Append(")NativeScript.Bindings.ObjectStore.Get(thisHandle))"); - AppendCsharpFunctionCallParameters( - true, - invokeParams, - builders.CsharpFunctions); - builders.CsharpFunctions.Append(';'); - AppendCsharpFunctionReturn( - invokeParams, - invokeMethod.ReturnType, - invokeReturnTypeKind, - null, - false, - builders.CsharpFunctions); - - // C# add delegate type - AppendCsharpDelegateType( - addFuncName, - false, + output); + output.Append("** pNext = NextFree"); + output.Append(typeName); + output.Append(";\n"); + output.Append("\t\tNextFree"); + output.Append(typeName); + output.Append(" = ("); + AppendCppTypeName( type, - TypeKind.Class, - typeof(void), - addRemoveParams, - builders.CsharpDelegateTypes); - - // C# add function - AppendCsharpFunctionBeginning( + output); + output.Append("**)*pNext;\n"); + output.Append("\t\t*pNext = del;\n"); + output.Append("\t\treturn (int32_t)(pNext - "); + output.Append(typeName); + output.Append("FreeList);\n"); + output.Append("\t}\n"); + output.Append("\t\n"); + output.Append('\t'); + AppendCppTypeName( type, - addFuncName, - false, - TypeKind.Class, - typeof(void), - typeParams, - addRemoveParams, - builders.CsharpFunctions); - builders.CsharpFunctions.Append("thiz += del;"); - AppendCsharpFunctionReturn( - addRemoveParams, - typeof(void), - TypeKind.Class, - null, - false, - builders.CsharpFunctions); - - // C# remove delegate type - AppendCsharpDelegateType( - removeFuncName, - false, + output); + output.Append("* Get"); + output.Append(typeName); + output.Append("(int32_t handle)\n"); + output.Append("\t{\n"); + output.Append( + "\t\tassert(handle >= 0 && handle < "); + output.Append(typeName); + output.Append("FreeListSize);\n"); + output.Append("\t\treturn "); + output.Append(typeName); + output.Append("FreeList[handle];\n"); + output.Append("\t}\n"); + output.Append("\t\n"); + output.Append("\tvoid Remove"); + output.Append(typeName); + output.Append("(int32_t handle)\n"); + output.Append("\t{\n"); + output.Append("\t\t"); + AppendCppTypeName( type, - TypeKind.Class, - typeof(void), - addRemoveParams, - builders.CsharpDelegateTypes); - - // C# remove function - AppendCsharpFunctionBeginning( + output); + output.Append("** pRelease = "); + output.Append(typeName); + output.Append("FreeList + handle;\n"); + output.Append("\t\t*pRelease = ("); + AppendCppTypeName( type, - removeFuncName, - false, - TypeKind.Class, - typeof(void), - typeParams, - addRemoveParams, - builders.CsharpFunctions); - builders.CsharpFunctions.Append("thiz -= del;"); - AppendCsharpFunctionReturn( - addRemoveParams, - typeof(void), - TypeKind.Class, - null, - false, - builders.CsharpFunctions); - - // C# init params - AppendCsharpInitParam( - releaseFuncNameLower, - builders.CsharpInitParams); - AppendCsharpInitParam( - constructorFuncNameLower, - builders.CsharpInitParams); - AppendCsharpInitParam( - invokeFuncNameLower, - builders.CsharpInitParams); - AppendCsharpInitParam( - addFuncNameLower, - builders.CsharpInitParams); - AppendCsharpInitParam( - removeFuncNameLower, - builders.CsharpInitParams); - - // C# init call args - AppendCsharpInitCallArg( - releaseFuncName, - builders.CsharpInitCall); - AppendCsharpInitCallArg( - constructorFuncName, - builders.CsharpInitCall); - AppendCsharpInitCallArg( - invokeFuncName, - builders.CsharpInitCall); - AppendCsharpInitCallArg( - addFuncName, - builders.CsharpInitCall); - AppendCsharpInitCallArg( - removeFuncName, - builders.CsharpInitCall); + output); + output.Append("*)NextFree"); + output.Append(typeName); + output.Append(";\n"); + output.Append("\t\tNextFree"); + output.Append(typeName); + output.Append(" = pRelease;\n"); + output.Append("\t}\n"); } - + static void AppendCsharpDelegate( bool isStatic, string typeName, @@ -7672,7 +8538,7 @@ static void AppendExceptions( // Build parameters ParameterInfo[] parameters = ConvertParameters( - new Type[]{ typeof(int) }); + new[]{ typeof(int) }); // C# imports AppendCsharpImport( @@ -7805,7 +8671,6 @@ static void AppendGetter( methodIsStatic, enclosingTypeKind, fieldType, - enclosingTypeParams, parameters, builders.CsharpFunctions); AppendCsharpFunctionCallSubject( @@ -7932,7 +8797,6 @@ static void AppendSetter( bool isReadOnly, Type enclosingType, Type[] enclosingTypeParams, - Type fieldType, int indent, Type[] exceptionTypes, StringBuilders builders) @@ -8001,7 +8865,6 @@ static void AppendSetter( methodIsStatic, enclosingTypeKind, typeof(void), - enclosingTypeParams, parameters, builders.CsharpFunctions); AppendCsharpFunctionCallSubject( @@ -9048,7 +9911,6 @@ static void AppendCsharpFunctionBeginning( bool isStatic, TypeKind enclosingTypeKind, Type returnType, - Type[] typeParams, ParameterInfo[] parameters, StringBuilder output) { @@ -9130,7 +9992,7 @@ static void AppendCsharpFunctionBeginning( output.Append("var "); output.Append(param.Name); output.Append(" = "); - if (!paramType.Equals(typeof(object))) + if (paramType != typeof(object)) { output.Append('('); AppendCsharpTypeName(paramType, output); @@ -9144,10 +10006,10 @@ static void AppendCsharpFunctionBeginning( } // Save return value as local variable - if (!returnType.Equals(typeof(void))) + if (returnType != typeof(void)) { output.Append("var returnValue = "); - }; + } } static void AppendCsharpFunctionCallSubject( @@ -9168,7 +10030,6 @@ static void AppendCsharpFunctionCallSubject( } static void AppendCsharpFunctionCallParameters( - bool isStatic, ParameterInfo[] parameters, StringBuilder output) { @@ -9251,7 +10112,7 @@ static void AppendCsharpFunctionReturn( } // Return - if (!returnType.Equals(typeof(void))) + if (returnType != typeof(void)) { output.Append("\n\t\t\t\treturn "); if ( @@ -9473,29 +10334,7 @@ static void AppendCppParameterDeclaration( } } } - - static void AppendParameterCall( - ParameterInfo[] parameters, - string separator, - StringBuilder output) - { - for (int i = 0; i < parameters.Length; ++i) - { - ParameterInfo parameter = parameters[i]; - output.Append(parameter.Name); - if (parameter.Kind == TypeKind.Class - || parameter.Kind == TypeKind.ManagedStruct) - { - output.Append("Handle"); - } - if (i != parameters.Length - 1) - { - output.Append(','); - output.Append(separator); - } - } - } - + static void AppendCppInitBody( string globalVariableName, string paramName, @@ -9571,7 +10410,7 @@ static void AppendCppMethodReturn( int indent, StringBuilder output) { - if (returnType != null && !returnType.Equals(typeof(void))) + if (returnType != null && returnType != typeof(void)) { AppendIndent(indent, output); output.Append("return "); @@ -9943,59 +10782,59 @@ static void AppendCsharpTypeName( Type type, StringBuilder output) { - if (type.Equals(typeof(void))) + if (type == typeof(void)) { output.Append("void"); } - else if (type.Equals(typeof(bool))) + else if (type == typeof(bool)) { output.Append("bool"); } - else if (type.Equals(typeof(sbyte))) + else if (type == typeof(sbyte)) { output.Append("sbyte"); } - else if (type.Equals(typeof(byte))) + else if (type == typeof(byte)) { output.Append("byte"); } - else if (type.Equals(typeof(short))) + else if (type == typeof(short)) { output.Append("short"); } - else if (type.Equals(typeof(ushort))) + else if (type == typeof(ushort)) { output.Append("ushort"); } - else if (type.Equals(typeof(int))) + else if (type == typeof(int)) { output.Append("int"); } - else if (type.Equals(typeof(uint))) + else if (type == typeof(uint)) { output.Append("uint"); } - else if (type.Equals(typeof(long))) + else if (type == typeof(long)) { output.Append("long"); } - else if (type.Equals(typeof(ulong))) + else if (type == typeof(ulong)) { output.Append("ulong"); } - else if (type.Equals(typeof(char))) + else if (type == typeof(char)) { output.Append("char"); } - else if (type.Equals(typeof(float))) + else if (type == typeof(float)) { output.Append("float"); } - else if (type.Equals(typeof(double))) + else if (type == typeof(double)) { output.Append("double"); } - else if (type.Equals(typeof(string))) + else if (type == typeof(string)) { output.Append("string"); } @@ -10026,59 +10865,59 @@ static void AppendCppTypeName( Type type, StringBuilder output) { - if (type.Equals(typeof(void))) + if (type == typeof(void)) { output.Append("void"); } - else if (type.Equals(typeof(bool))) + else if (type == typeof(bool)) { output.Append("System::Boolean"); } - else if (type.Equals(typeof(sbyte))) + else if (type == typeof(sbyte)) { output.Append("int8_t"); } - else if (type.Equals(typeof(byte))) + else if (type == typeof(byte)) { output.Append("uint8_t"); } - else if (type.Equals(typeof(short))) + else if (type == typeof(short)) { output.Append("int16_t"); } - else if (type.Equals(typeof(ushort))) + else if (type == typeof(ushort)) { output.Append("uint16_t"); } - else if (type.Equals(typeof(int))) + else if (type == typeof(int)) { output.Append("int32_t"); } - else if (type.Equals(typeof(uint))) + else if (type == typeof(uint)) { output.Append("uint32_t"); } - else if (type.Equals(typeof(long))) + else if (type == typeof(long)) { output.Append("int64_t"); } - else if (type.Equals(typeof(ulong))) + else if (type == typeof(ulong)) { output.Append("uint64_t"); } - else if (type.Equals(typeof(char))) + else if (type == typeof(char)) { output.Append("System::Char"); } - else if (type.Equals(typeof(float))) + else if (type == typeof(float)) { output.Append("float"); } - else if (type.Equals(typeof(double))) + else if (type == typeof(double)) { output.Append("double"); } - else if (type.Equals(typeof(string))) + else if (type == typeof(string)) { output.Append("System::String"); } @@ -10108,7 +10947,7 @@ static void AppendCppTypeName( type.Name, output); Type[] genTypes = type.GetGenericArguments(); - if (genTypes != null && genTypes.Length > 0) + if (genTypes.Length > 0) { output.Append(genTypes.Length); } @@ -10141,69 +10980,6 @@ static void AppendCppTypeName( output); } - static void LogStringBuilders( - StringBuilders builders) - { - LogStringBuilder( - "C# init params", - builders.CsharpInitParams); - LogStringBuilder( - "C# delegates", - builders.CsharpDelegateTypes); - LogStringBuilder( - "C# StructStore Init calls", - builders.CsharpStructStoreInitCalls); - LogStringBuilder( - "C# init call", - builders.CsharpInitCall); - LogStringBuilder( - "C# functions", - builders.CsharpFunctions); - LogStringBuilder( - "C# MonoBehaviours", - builders.CsharpMonoBehaviours); - LogStringBuilder( - "C# MonoBehaviour Delegates", - builders.CsharpDelegates); - LogStringBuilder( - "C# MonoBehaviour Imports", - builders.CsharpImports); - LogStringBuilder( - "C# MonoBehaviour GetDelegate Calls", - builders.CsharpGetDelegateCalls); - LogStringBuilder( - "C++ function pointers", - builders.CppFunctionPointers); - LogStringBuilder( - "C++ type declarations", - builders.CppTypeDeclarations); - LogStringBuilder( - "C++ type definitions", - builders.CppTypeDefinitions); - LogStringBuilder( - "C++ method definitions", - builders.CppMethodDefinitions); - LogStringBuilder( - "C++ init params", - builders.CppInitParams); - LogStringBuilder( - "C++ init body", - builders.CppInitBody); - LogStringBuilder( - "C++ MonoBehaviour messages", - builders.CppMonoBehaviourMessages); - } - - static void LogStringBuilder( - string title, - StringBuilder builder) - { - Debug.LogFormat( - "{0}:\n\n{1}\n\n", - title, - builder); - } - static void RemoveTrailingChars( StringBuilders builders) { @@ -10211,6 +10987,7 @@ static void RemoveTrailingChars( RemoveTrailingChars(builders.CsharpDelegateTypes); RemoveTrailingChars(builders.CsharpStructStoreInitCalls); RemoveTrailingChars(builders.CsharpInitCall); + RemoveTrailingChars(builders.CsharpBaseTypes); RemoveTrailingChars(builders.CsharpFunctions); RemoveTrailingChars(builders.CsharpMonoBehaviours); RemoveTrailingChars(builders.CsharpDelegates); @@ -10218,11 +10995,13 @@ static void RemoveTrailingChars( RemoveTrailingChars(builders.CsharpGetDelegateCalls); RemoveTrailingChars(builders.CppFunctionPointers); RemoveTrailingChars(builders.CppTypeDeclarations); - RemoveTrailingChars(builders.CppMethodDefinitions); RemoveTrailingChars(builders.CppTypeDefinitions); + RemoveTrailingChars(builders.CppMethodDefinitions); RemoveTrailingChars(builders.CppInitParams); RemoveTrailingChars(builders.CppInitBody); RemoveTrailingChars(builders.CppMonoBehaviourMessages); + RemoveTrailingChars(builders.CppGlobalStateAndFunctions); + RemoveTrailingChars(builders.CppBoxingMethodDeclarations); } // Remove trailing chars (e.g. commas) for last elements @@ -10278,6 +11057,11 @@ static void InjectBuilders( "/*BEGIN INIT CALL*/\n", "\n\t\t\t\t/*END INIT CALL*/", builders.CsharpInitCall.ToString()); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN BASE TYPES*/\n", + "\n\t\t/*END BASE TYPES*/", + builders.CsharpBaseTypes.ToString()); csharpContents = InjectIntoString( csharpContents, "/*BEGIN FUNCTIONS*/\n", @@ -10360,7 +11144,7 @@ static string InjectIntoString( string endMarker, string text) { - for (int startIndex = 0; true; ) + for (int startIndex = 0; ; ) { int beginIndex = contents.IndexOf(beginMarker, startIndex); if (beginIndex < 0) diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index be0f906..1d9522a 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -308,6 +308,11 @@ "Types": [ "System.String" ] + }, + { + "Types": [ + "System.Int32" + ] } ], "Constructors": [ @@ -328,6 +333,12 @@ "ParamTypes": [ "T" ] + }, + { + "Name": "Sort", + "ParamTypes": [ + "System.Collections.Generic.IComparer`1" + ] } ] }, @@ -529,6 +540,35 @@ "Name": "UnityEngine.SceneManagement.LoadSceneMode" } ], + "BaseTypes": [ + { + "Name": "System.Collections.Generic.IComparer`1", + "GenericParams": [ + { + "Types": [ + "System.Int32" + ] + }, + { + "Types": [ + "System.String" + ] + } + ] + }, + { + "Name": "System.StringComparer" + }, + { + "Name": "System.EventArgs", + "OverrideMethods": [ + { + "Name": "ToString", + "ParamTypes": [] + } + ] + } + ], "MonoBehaviours": [ { "Name": "MyGame.MonoBehaviours.TestScript", diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 2c42ed2..7db5553 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -93,6 +93,12 @@ namespace Plugin int32_t (*SystemCollectionsGenericListSystemStringPropertyGetItem)(int32_t thisHandle, int32_t index); void (*SystemCollectionsGenericListSystemStringPropertySetItem)(int32_t thisHandle, int32_t index, int32_t valueHandle); void (*SystemCollectionsGenericListSystemStringMethodAddSystemString)(int32_t thisHandle, int32_t itemHandle); + void (*SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle); + int32_t (*SystemCollectionsGenericListSystemInt32Constructor)(); + int32_t (*SystemCollectionsGenericListSystemInt32PropertyGetItem)(int32_t thisHandle, int32_t index); + void (*SystemCollectionsGenericListSystemInt32PropertySetItem)(int32_t thisHandle, int32_t index, int32_t value); + void (*SystemCollectionsGenericListSystemInt32MethodAddSystemInt32)(int32_t thisHandle, int32_t item); + void (*SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle); int32_t (*SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)(int32_t valueHandle); int32_t (*SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue)(int32_t thisHandle); void (*SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue)(int32_t thisHandle, int32_t valueHandle); @@ -132,6 +138,14 @@ namespace Plugin UnityEngine::SceneManagement::Scene (*UnboxScene)(int32_t valHandle); int32_t (*BoxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val); UnityEngine::SceneManagement::LoadSceneMode (*UnboxLoadSceneMode)(int32_t valHandle); + void (*ReleaseSystemCollectionsGenericIComparerSystemInt32)(int32_t handle); + void (*SystemCollectionsGenericIComparerSystemInt32Constructor)(int32_t cppHandle, int32_t* handle); + void (*ReleaseSystemCollectionsGenericIComparerSystemString)(int32_t handle); + void (*SystemCollectionsGenericIComparerSystemStringConstructor)(int32_t cppHandle, int32_t* handle); + void (*ReleaseSystemStringComparer)(int32_t handle); + void (*SystemStringComparerConstructor)(int32_t cppHandle, int32_t* handle); + void (*ReleaseSystemEventArgs)(int32_t handle); + void (*SystemEventArgsConstructor)(int32_t cppHandle, int32_t* handle); int32_t (*BoxBoolean)(System::Boolean val); System::Boolean (*UnboxBoolean)(int32_t valHandle); int32_t (*BoxSByte)(int8_t val); @@ -184,44 +198,44 @@ namespace Plugin int32_t (*UnityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item); void (*ReleaseSystemAction)(int32_t handle, int32_t classHandle); void (*SystemActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*SystemActionInvoke)(int32_t thisHandle); void (*SystemActionAdd)(int32_t thisHandle, int32_t delHandle); void (*SystemActionRemove)(int32_t thisHandle, int32_t delHandle); + void (*SystemActionInvoke)(int32_t thisHandle); void (*ReleaseSystemActionSystemSingle)(int32_t handle, int32_t classHandle); void (*SystemActionSystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*SystemActionSystemSingleInvoke)(int32_t thisHandle, float obj); void (*SystemActionSystemSingleAdd)(int32_t thisHandle, int32_t delHandle); void (*SystemActionSystemSingleRemove)(int32_t thisHandle, int32_t delHandle); + void (*SystemActionSystemSingleInvoke)(int32_t thisHandle, float obj); void (*ReleaseSystemActionSystemSingle_SystemSingle)(int32_t handle, int32_t classHandle); void (*SystemActionSystemSingle_SystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*SystemActionSystemSingle_SystemSingleInvoke)(int32_t thisHandle, float arg1, float arg2); void (*SystemActionSystemSingle_SystemSingleAdd)(int32_t thisHandle, int32_t delHandle); void (*SystemActionSystemSingle_SystemSingleRemove)(int32_t thisHandle, int32_t delHandle); + void (*SystemActionSystemSingle_SystemSingleInvoke)(int32_t thisHandle, float arg1, float arg2); void (*ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble)(int32_t handle, int32_t classHandle); void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - double (*SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)(int32_t thisHandle, int32_t arg1, float arg2); void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd)(int32_t thisHandle, int32_t delHandle); void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove)(int32_t thisHandle, int32_t delHandle); + double (*SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)(int32_t thisHandle, int32_t arg1, float arg2); void (*ReleaseSystemFuncSystemInt16_SystemInt32_SystemString)(int32_t handle, int32_t classHandle); void (*SystemFuncSystemInt16_SystemInt32_SystemStringConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - int32_t (*SystemFuncSystemInt16_SystemInt32_SystemStringInvoke)(int32_t thisHandle, int16_t arg1, int32_t arg2); void (*SystemFuncSystemInt16_SystemInt32_SystemStringAdd)(int32_t thisHandle, int32_t delHandle); void (*SystemFuncSystemInt16_SystemInt32_SystemStringRemove)(int32_t thisHandle, int32_t delHandle); + int32_t (*SystemFuncSystemInt16_SystemInt32_SystemStringInvoke)(int32_t thisHandle, int16_t arg1, int32_t arg2); void (*ReleaseSystemAppDomainInitializer)(int32_t handle, int32_t classHandle); void (*SystemAppDomainInitializerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*SystemAppDomainInitializerInvoke)(int32_t thisHandle, int32_t argsHandle); void (*SystemAppDomainInitializerAdd)(int32_t thisHandle, int32_t delHandle); void (*SystemAppDomainInitializerRemove)(int32_t thisHandle, int32_t delHandle); + void (*SystemAppDomainInitializerInvoke)(int32_t thisHandle, int32_t argsHandle); void (*ReleaseUnityEngineEventsUnityAction)(int32_t handle, int32_t classHandle); void (*UnityEngineEventsUnityActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*UnityEngineEventsUnityActionInvoke)(int32_t thisHandle); void (*UnityEngineEventsUnityActionAdd)(int32_t thisHandle, int32_t delHandle); void (*UnityEngineEventsUnityActionRemove)(int32_t thisHandle, int32_t delHandle); + void (*UnityEngineEventsUnityActionInvoke)(int32_t thisHandle); void (*ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode)(int32_t handle, int32_t classHandle); void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)(int32_t thisHandle, int32_t delHandle); void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle); + void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); /*END FUNCTION POINTERS*/ } @@ -321,6 +335,106 @@ namespace Plugin } } + int32_t SystemCollectionsGenericIComparerSystemInt32FreeListSize; + System::Collections::Generic::IComparer** SystemCollectionsGenericIComparerSystemInt32FreeList; + System::Collections::Generic::IComparer** NextFreeSystemCollectionsGenericIComparerSystemInt32; + + int32_t StoreSystemCollectionsGenericIComparerSystemInt32(System::Collections::Generic::IComparer* del) + { + assert(NextFreeSystemCollectionsGenericIComparerSystemInt32 != nullptr); + System::Collections::Generic::IComparer** pNext = NextFreeSystemCollectionsGenericIComparerSystemInt32; + NextFreeSystemCollectionsGenericIComparerSystemInt32 = (System::Collections::Generic::IComparer**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemCollectionsGenericIComparerSystemInt32FreeList); + } + + System::Collections::Generic::IComparer* GetSystemCollectionsGenericIComparerSystemInt32(int32_t handle) + { + assert(handle >= 0 && handle < SystemCollectionsGenericIComparerSystemInt32FreeListSize); + return SystemCollectionsGenericIComparerSystemInt32FreeList[handle]; + } + + void RemoveSystemCollectionsGenericIComparerSystemInt32(int32_t handle) + { + System::Collections::Generic::IComparer** pRelease = SystemCollectionsGenericIComparerSystemInt32FreeList + handle; + *pRelease = (System::Collections::Generic::IComparer*)NextFreeSystemCollectionsGenericIComparerSystemInt32; + NextFreeSystemCollectionsGenericIComparerSystemInt32 = pRelease; + } + int32_t SystemCollectionsGenericIComparerSystemStringFreeListSize; + System::Collections::Generic::IComparer** SystemCollectionsGenericIComparerSystemStringFreeList; + System::Collections::Generic::IComparer** NextFreeSystemCollectionsGenericIComparerSystemString; + + int32_t StoreSystemCollectionsGenericIComparerSystemString(System::Collections::Generic::IComparer* del) + { + assert(NextFreeSystemCollectionsGenericIComparerSystemString != nullptr); + System::Collections::Generic::IComparer** pNext = NextFreeSystemCollectionsGenericIComparerSystemString; + NextFreeSystemCollectionsGenericIComparerSystemString = (System::Collections::Generic::IComparer**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemCollectionsGenericIComparerSystemStringFreeList); + } + + System::Collections::Generic::IComparer* GetSystemCollectionsGenericIComparerSystemString(int32_t handle) + { + assert(handle >= 0 && handle < SystemCollectionsGenericIComparerSystemStringFreeListSize); + return SystemCollectionsGenericIComparerSystemStringFreeList[handle]; + } + + void RemoveSystemCollectionsGenericIComparerSystemString(int32_t handle) + { + System::Collections::Generic::IComparer** pRelease = SystemCollectionsGenericIComparerSystemStringFreeList + handle; + *pRelease = (System::Collections::Generic::IComparer*)NextFreeSystemCollectionsGenericIComparerSystemString; + NextFreeSystemCollectionsGenericIComparerSystemString = pRelease; + } + int32_t SystemStringComparerFreeListSize; + System::StringComparer** SystemStringComparerFreeList; + System::StringComparer** NextFreeSystemStringComparer; + + int32_t StoreSystemStringComparer(System::StringComparer* del) + { + assert(NextFreeSystemStringComparer != nullptr); + System::StringComparer** pNext = NextFreeSystemStringComparer; + NextFreeSystemStringComparer = (System::StringComparer**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemStringComparerFreeList); + } + + System::StringComparer* GetSystemStringComparer(int32_t handle) + { + assert(handle >= 0 && handle < SystemStringComparerFreeListSize); + return SystemStringComparerFreeList[handle]; + } + + void RemoveSystemStringComparer(int32_t handle) + { + System::StringComparer** pRelease = SystemStringComparerFreeList + handle; + *pRelease = (System::StringComparer*)NextFreeSystemStringComparer; + NextFreeSystemStringComparer = pRelease; + } + int32_t SystemEventArgsFreeListSize; + System::EventArgs** SystemEventArgsFreeList; + System::EventArgs** NextFreeSystemEventArgs; + + int32_t StoreSystemEventArgs(System::EventArgs* del) + { + assert(NextFreeSystemEventArgs != nullptr); + System::EventArgs** pNext = NextFreeSystemEventArgs; + NextFreeSystemEventArgs = (System::EventArgs**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemEventArgsFreeList); + } + + System::EventArgs* GetSystemEventArgs(int32_t handle) + { + assert(handle >= 0 && handle < SystemEventArgsFreeListSize); + return SystemEventArgsFreeList[handle]; + } + + void RemoveSystemEventArgs(int32_t handle) + { + System::EventArgs** pRelease = SystemEventArgsFreeList + handle; + *pRelease = (System::EventArgs*)NextFreeSystemEventArgs; + NextFreeSystemEventArgs = pRelease; + } int32_t SystemActionFreeListSize; System::Action** SystemActionFreeList; System::Action** NextFreeSystemAction; @@ -521,7 +635,6 @@ namespace Plugin *pRelease = (UnityEngine::Events::UnityAction2*)NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = pRelease; } - /*END GLOBAL STATE AND FUNCTIONS*/ } @@ -2567,6 +2680,173 @@ namespace System delete ex; } } + + void List::Sort(System::Collections::Generic::IComparer comparer) + { + Plugin::SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + List::List(std::nullptr_t n) + : List(Plugin::InternalUse::Only, 0) + { + } + + List::List(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + List::List(const List& other) + : List(Plugin::InternalUse::Only, other.Handle) + { + } + + List::List(List&& other) + : List(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + List::~List() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + List& List::operator=(const List& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + List& List::operator=(std::nullptr_t other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + List& List::operator=(List&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool List::operator==(const List& other) const + { + return Handle == other.Handle; + } + + bool List::operator!=(const List& other) const + { + return Handle != other.Handle; + } + + List::List() + : System::Object(nullptr) + { + auto returnValue = Plugin::SystemCollectionsGenericListSystemInt32Constructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + int32_t List::GetItem(int32_t index) + { + auto returnValue = Plugin::SystemCollectionsGenericListSystemInt32PropertyGetItem(Handle, index); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + void List::SetItem(int32_t index, int32_t value) + { + Plugin::SystemCollectionsGenericListSystemInt32PropertySetItem(Handle, index, value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void List::Add(int32_t item) + { + Plugin::SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(Handle, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void List::Sort(System::Collections::Generic::IComparer comparer) + { + Plugin::SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } } } @@ -4267,60 +4547,834 @@ namespace System namespace System { - Object::Object(System::Boolean val) - { - int32_t handle = Plugin::BoxBoolean(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator System::Boolean() - { - System::Boolean returnVal(Plugin::UnboxBoolean(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::Object(int8_t val) + namespace Collections { - int32_t handle = Plugin::BoxSByte(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) + namespace Generic { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator int8_t() - { - int8_t returnVal(Plugin::UnboxSByte(Handle)); - if (Plugin::unhandledCsharpException) + IComparer::IComparer() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); + Plugin::SystemCollectionsGenericIComparerSystemInt32Constructor(CppHandle, &Handle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemCollectionsGenericIComparerSystemInt32(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + IComparer::IComparer(std::nullptr_t n) + : System::Object(Plugin::InternalUse::Only, 0) + { + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); + } + + IComparer::IComparer(const IComparer& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + IComparer::IComparer(IComparer&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + IComparer::~IComparer() + { + Plugin::RemoveSystemCollectionsGenericIComparerSystemInt32(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericIComparerSystemInt32(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + IComparer& IComparer::operator=(const IComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparer& IComparer::operator=(std::nullptr_t other) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericIComparerSystemInt32(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + IComparer& IComparer::operator=(IComparer&& other) + { + Plugin::RemoveSystemCollectionsGenericIComparerSystemInt32(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericIComparerSystemInt32(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparer::operator==(const IComparer& other) const + { + return Handle == other.Handle; + } + + bool IComparer::operator!=(const IComparer& other) const + { + return Handle != other.Handle; + } + + int32_t IComparer::Compare(int32_t x, int32_t y) + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemInt32Compare(int32_t cppHandle, int32_t x, int32_t y) + { + try + { + return Plugin::GetSystemCollectionsGenericIComparerSystemInt32(cppHandle)->Compare(x, y); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + IComparer::IComparer() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); + Plugin::SystemCollectionsGenericIComparerSystemStringConstructor(CppHandle, &Handle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemCollectionsGenericIComparerSystemString(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + IComparer::IComparer(std::nullptr_t n) + : System::Object(Plugin::InternalUse::Only, 0) + { + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); + } + + IComparer::IComparer(const IComparer& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + IComparer::IComparer(IComparer&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + IComparer::~IComparer() + { + Plugin::RemoveSystemCollectionsGenericIComparerSystemString(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericIComparerSystemString(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + IComparer& IComparer::operator=(const IComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparer& IComparer::operator=(std::nullptr_t other) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericIComparerSystemString(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + IComparer& IComparer::operator=(IComparer&& other) + { + Plugin::RemoveSystemCollectionsGenericIComparerSystemString(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericIComparerSystemString(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparer::operator==(const IComparer& other) const + { + return Handle == other.Handle; + } + + bool IComparer::operator!=(const IComparer& other) const + { + return Handle != other.Handle; + } + + int32_t IComparer::Compare(System::String x, System::String y) + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemStringCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + { + try + { + return Plugin::GetSystemCollectionsGenericIComparerSystemString(cppHandle)->Compare(System::String(Plugin::InternalUse::Only, xHandle), System::String(Plugin::InternalUse::Only, yHandle)); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + } + } +} + +namespace System +{ + StringComparer::StringComparer() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemStringComparer(this); + Plugin::SystemStringComparerConstructor(CppHandle, &Handle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemStringComparer(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + StringComparer::StringComparer(std::nullptr_t n) + : System::Object(Plugin::InternalUse::Only, 0) + { + CppHandle = Plugin::StoreSystemStringComparer(this); + } + + StringComparer::StringComparer(const StringComparer& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreSystemStringComparer(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + StringComparer::StringComparer(StringComparer&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + StringComparer::StringComparer(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemStringComparer(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + StringComparer::~StringComparer() + { + Plugin::RemoveSystemStringComparer(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemStringComparer(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + StringComparer& StringComparer::operator=(const StringComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + StringComparer& StringComparer::operator=(std::nullptr_t other) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemStringComparer(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + StringComparer& StringComparer::operator=(StringComparer&& other) + { + Plugin::RemoveSystemStringComparer(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemStringComparer(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool StringComparer::operator==(const StringComparer& other) const + { + return Handle == other.Handle; + } + + bool StringComparer::operator!=(const StringComparer& other) const + { + return Handle != other.Handle; + } + + int32_t StringComparer::Compare(System::String x, System::String y) + { + return {}; + } + + DLLEXPORT int32_t SystemStringComparerCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + { + try + { + return Plugin::GetSystemStringComparer(cppHandle)->Compare(System::String(Plugin::InternalUse::Only, xHandle), System::String(Plugin::InternalUse::Only, yHandle)); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::StringComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + System::Boolean StringComparer::Equals(System::String x, System::String y) + { + return {}; + } + + DLLEXPORT System::Boolean SystemStringComparerEquals(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + { + try + { + return Plugin::GetSystemStringComparer(cppHandle)->Equals(System::String(Plugin::InternalUse::Only, xHandle), System::String(Plugin::InternalUse::Only, yHandle)); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::StringComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + int32_t StringComparer::GetHashCode(System::String obj) + { + return {}; + } + + DLLEXPORT int32_t SystemStringComparerGetHashCode(int32_t cppHandle, int32_t objHandle) + { + try + { + return Plugin::GetSystemStringComparer(cppHandle)->GetHashCode(System::String(Plugin::InternalUse::Only, objHandle)); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::StringComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } +} + +namespace System +{ + EventArgs::EventArgs() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemEventArgs(this); + Plugin::SystemEventArgsConstructor(CppHandle, &Handle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemEventArgs(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + EventArgs::EventArgs(std::nullptr_t n) + : System::Object(Plugin::InternalUse::Only, 0) + { + CppHandle = Plugin::StoreSystemEventArgs(this); + } + + EventArgs::EventArgs(const EventArgs& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreSystemEventArgs(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + EventArgs::EventArgs(EventArgs&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + EventArgs::EventArgs(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemEventArgs(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + EventArgs::~EventArgs() + { + Plugin::RemoveSystemEventArgs(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemEventArgs(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + EventArgs& EventArgs::operator=(const EventArgs& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + EventArgs& EventArgs::operator=(std::nullptr_t other) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemEventArgs(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + EventArgs& EventArgs::operator=(EventArgs&& other) + { + Plugin::RemoveSystemEventArgs(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemEventArgs(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool EventArgs::operator==(const EventArgs& other) const + { + return Handle == other.Handle; + } + + bool EventArgs::operator!=(const EventArgs& other) const + { + return Handle != other.Handle; + } + + System::String EventArgs::ToString() + { + return {}; + } + + DLLEXPORT int32_t SystemEventArgsToString(int32_t cppHandle) + { + try + { + return Plugin::GetSystemEventArgs(cppHandle)->ToString().Handle; + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::EventArgs"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } +} + +namespace System +{ + Object::Object(System::Boolean val) + { + int32_t handle = Plugin::BoxBoolean(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator System::Boolean() + { + System::Boolean returnVal(Plugin::UnboxBoolean(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(int8_t val) + { + int32_t handle = Plugin::BoxSByte(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator int8_t() + { + int8_t returnVal(Plugin::UnboxSByte(Handle)); + if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; @@ -6178,22 +7232,6 @@ namespace System return Handle != other.Handle; } - void Action::operator()() - { - } - - void Action::Invoke() - { - Plugin::SystemActionInvoke(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - void Action::operator+=(System::Action& del) { Plugin::SystemActionAdd(Handle, del.Handle); @@ -6218,11 +7256,15 @@ namespace System } } - DLLEXPORT void SystemActionCppInvoke(int32_t cppHandle) + void Action::operator()() + { + } + + DLLEXPORT void SystemActionNativeInvoke(int32_t cppHandle) { try { - (*Plugin::GetSystemAction(cppHandle))(); + Plugin::GetSystemAction(cppHandle)->operator()(); } catch (System::Exception ex) { @@ -6235,6 +7277,18 @@ namespace System Plugin::SetException(ex.Handle); } } + + void Action::Invoke() + { + Plugin::SystemActionInvoke(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } namespace System @@ -6400,25 +7454,9 @@ namespace System return Handle == other.Handle; } - bool Action1::operator!=(const Action1& other) const - { - return Handle != other.Handle; - } - - void Action1::operator()(float obj) - { - } - - void Action1::Invoke(float obj) + bool Action1::operator!=(const Action1& other) const { - Plugin::SystemActionSystemSingleInvoke(Handle, obj); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + return Handle != other.Handle; } void Action1::operator+=(System::Action1& del) @@ -6445,11 +7483,15 @@ namespace System } } - DLLEXPORT void SystemActionSystemSingleCppInvoke(int32_t cppHandle, float obj) + void Action1::operator()(float obj) + { + } + + DLLEXPORT void SystemActionSystemSingleNativeInvoke(int32_t cppHandle, float obj) { try { - (*Plugin::GetSystemActionSystemSingle(cppHandle))(obj); + Plugin::GetSystemActionSystemSingle(cppHandle)->operator()(obj); } catch (System::Exception ex) { @@ -6462,6 +7504,18 @@ namespace System Plugin::SetException(ex.Handle); } } + + void Action1::Invoke(float obj) + { + Plugin::SystemActionSystemSingleInvoke(Handle, obj); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } namespace System @@ -6632,22 +7686,6 @@ namespace System return Handle != other.Handle; } - void Action2::operator()(float arg1, float arg2) - { - } - - void Action2::Invoke(float arg1, float arg2) - { - Plugin::SystemActionSystemSingle_SystemSingleInvoke(Handle, arg1, arg2); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - void Action2::operator+=(System::Action2& del) { Plugin::SystemActionSystemSingle_SystemSingleAdd(Handle, del.Handle); @@ -6672,11 +7710,15 @@ namespace System } } - DLLEXPORT void SystemActionSystemSingle_SystemSingleCppInvoke(int32_t cppHandle, float arg1, float arg2) + void Action2::operator()(float arg1, float arg2) + { + } + + DLLEXPORT void SystemActionSystemSingle_SystemSingleNativeInvoke(int32_t cppHandle, float arg1, float arg2) { try { - (*Plugin::GetSystemActionSystemSingle_SystemSingle(cppHandle))(arg1, arg2); + Plugin::GetSystemActionSystemSingle_SystemSingle(cppHandle)->operator()(arg1, arg2); } catch (System::Exception ex) { @@ -6689,6 +7731,18 @@ namespace System Plugin::SetException(ex.Handle); } } + + void Action2::Invoke(float arg1, float arg2) + { + Plugin::SystemActionSystemSingle_SystemSingleInvoke(Handle, arg1, arg2); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } namespace System @@ -6859,24 +7913,6 @@ namespace System return Handle != other.Handle; } - double Func3::operator()(int32_t arg1, float arg2) - { - return {}; - } - - double Func3::Invoke(int32_t arg1, float arg2) - { - auto returnValue = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(Handle, arg1, arg2); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - void Func3::operator+=(System::Func3& del) { Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(Handle, del.Handle); @@ -6901,11 +7937,16 @@ namespace System } } - DLLEXPORT double SystemFuncSystemInt32_SystemSingle_SystemDoubleCppInvoke(int32_t cppHandle, int32_t arg1, float arg2) + double Func3::operator()(int32_t arg1, float arg2) + { + return {}; + } + + DLLEXPORT double SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke(int32_t cppHandle, int32_t arg1, float arg2) { try { - return (*Plugin::GetSystemFuncSystemInt32_SystemSingle_SystemDouble(cppHandle))(arg1, arg2); + return Plugin::GetSystemFuncSystemInt32_SystemSingle_SystemDouble(cppHandle)->operator()(arg1, arg2); } catch (System::Exception ex) { @@ -6920,6 +7961,19 @@ namespace System return {}; } } + + double Func3::Invoke(int32_t arg1, float arg2) + { + auto returnValue = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(Handle, arg1, arg2); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } } namespace System @@ -7090,24 +8144,6 @@ namespace System return Handle != other.Handle; } - System::String Func3::operator()(int16_t arg1, int32_t arg2) - { - return {}; - } - - System::String Func3::Invoke(int16_t arg1, int32_t arg2) - { - auto returnValue = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(Handle, arg1, arg2); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); - } - void Func3::operator+=(System::Func3& del) { Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd(Handle, del.Handle); @@ -7132,11 +8168,16 @@ namespace System } } - DLLEXPORT int32_t SystemFuncSystemInt16_SystemInt32_SystemStringCppInvoke(int32_t cppHandle, int16_t arg1, int32_t arg2) + System::String Func3::operator()(int16_t arg1, int32_t arg2) + { + return {}; + } + + DLLEXPORT int32_t SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke(int32_t cppHandle, int16_t arg1, int32_t arg2) { try { - return (*Plugin::GetSystemFuncSystemInt16_SystemInt32_SystemString(cppHandle))(arg1, arg2).Handle; + return Plugin::GetSystemFuncSystemInt16_SystemInt32_SystemString(cppHandle)->operator()(arg1, arg2).Handle; } catch (System::Exception ex) { @@ -7151,6 +8192,19 @@ namespace System return {}; } } + + System::String Func3::Invoke(int16_t arg1, int32_t arg2) + { + auto returnValue = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(Handle, arg1, arg2); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::String(Plugin::InternalUse::Only, returnValue); + } } namespace System @@ -7321,22 +8375,6 @@ namespace System return Handle != other.Handle; } - void AppDomainInitializer::operator()(System::Array1 args) - { - } - - void AppDomainInitializer::Invoke(System::Array1 args) - { - Plugin::SystemAppDomainInitializerInvoke(Handle, args.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - void AppDomainInitializer::operator+=(System::AppDomainInitializer& del) { Plugin::SystemAppDomainInitializerAdd(Handle, del.Handle); @@ -7361,11 +8399,15 @@ namespace System } } - DLLEXPORT void SystemAppDomainInitializerCppInvoke(int32_t cppHandle, int32_t argsHandle) + void AppDomainInitializer::operator()(System::Array1 args) + { + } + + DLLEXPORT void SystemAppDomainInitializerNativeInvoke(int32_t cppHandle, int32_t argsHandle) { try { - (*Plugin::GetSystemAppDomainInitializer(cppHandle))(System::Array1(Plugin::InternalUse::Only, argsHandle)); + Plugin::GetSystemAppDomainInitializer(cppHandle)->operator()(System::Array1(Plugin::InternalUse::Only, argsHandle)); } catch (System::Exception ex) { @@ -7378,6 +8420,18 @@ namespace System Plugin::SetException(ex.Handle); } } + + void AppDomainInitializer::Invoke(System::Array1 args) + { + Plugin::SystemAppDomainInitializerInvoke(Handle, args.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } namespace UnityEngine @@ -7550,22 +8604,6 @@ namespace UnityEngine return Handle != other.Handle; } - void UnityAction::operator()() - { - } - - void UnityAction::Invoke() - { - Plugin::UnityEngineEventsUnityActionInvoke(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - void UnityAction::operator+=(UnityEngine::Events::UnityAction& del) { Plugin::UnityEngineEventsUnityActionAdd(Handle, del.Handle); @@ -7590,11 +8628,15 @@ namespace UnityEngine } } - DLLEXPORT void UnityEngineEventsUnityActionCppInvoke(int32_t cppHandle) + void UnityAction::operator()() + { + } + + DLLEXPORT void UnityEngineEventsUnityActionNativeInvoke(int32_t cppHandle) { try { - (*Plugin::GetUnityEngineEventsUnityAction(cppHandle))(); + Plugin::GetUnityEngineEventsUnityAction(cppHandle)->operator()(); } catch (System::Exception ex) { @@ -7607,6 +8649,18 @@ namespace UnityEngine Plugin::SetException(ex.Handle); } } + + void UnityAction::Invoke() + { + Plugin::UnityEngineEventsUnityActionInvoke(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } } @@ -7780,22 +8834,6 @@ namespace UnityEngine return Handle != other.Handle; } - void UnityAction2::operator()(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) - { - } - - void UnityAction2::Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) - { - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(Handle, arg0, arg1); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - void UnityAction2::operator+=(UnityEngine::Events::UnityAction2& del) { Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd(Handle, del.Handle); @@ -7820,11 +8858,15 @@ namespace UnityEngine } } - DLLEXPORT void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeCppInvoke(int32_t cppHandle, UnityEngine::SceneManagement::Scene arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + void UnityAction2::operator()(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + { + } + + DLLEXPORT void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(int32_t cppHandle, UnityEngine::SceneManagement::Scene arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) { try { - (*Plugin::GetUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(cppHandle))(arg0, arg1); + Plugin::GetUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(cppHandle)->operator()(arg0, arg1); } catch (System::Exception ex) { @@ -7837,6 +8879,18 @@ namespace UnityEngine Plugin::SetException(ex.Handle); } } + + void UnityAction2::Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + { + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(Handle, arg0, arg1); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } } @@ -7935,6 +8989,12 @@ DLLEXPORT void Init( int32_t (*systemCollectionsGenericListSystemStringPropertyGetItem)(int32_t thisHandle, int32_t index), void (*systemCollectionsGenericListSystemStringPropertySetItem)(int32_t thisHandle, int32_t index, int32_t valueHandle), void (*systemCollectionsGenericListSystemStringMethodAddSystemString)(int32_t thisHandle, int32_t itemHandle), + void (*systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle), + int32_t (*systemCollectionsGenericListSystemInt32Constructor)(), + int32_t (*systemCollectionsGenericListSystemInt32PropertyGetItem)(int32_t thisHandle, int32_t index), + void (*systemCollectionsGenericListSystemInt32PropertySetItem)(int32_t thisHandle, int32_t index, int32_t value), + void (*systemCollectionsGenericListSystemInt32MethodAddSystemInt32)(int32_t thisHandle, int32_t item), + void (*systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle), int32_t (*systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)(int32_t valueHandle), int32_t (*systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue)(int32_t thisHandle), void (*systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue)(int32_t thisHandle, int32_t valueHandle), @@ -7974,6 +9034,14 @@ DLLEXPORT void Init( UnityEngine::SceneManagement::Scene (*unboxScene)(int32_t valHandle), int32_t (*boxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val), UnityEngine::SceneManagement::LoadSceneMode (*unboxLoadSceneMode)(int32_t valHandle), + void (*releaseSystemCollectionsGenericIComparerSystemInt32)(int32_t handle), + void (*systemCollectionsGenericIComparerSystemInt32Constructor)(int32_t cppHandle, int32_t* handle), + void (*releaseSystemCollectionsGenericIComparerSystemString)(int32_t handle), + void (*systemCollectionsGenericIComparerSystemStringConstructor)(int32_t cppHandle, int32_t* handle), + void (*releaseSystemStringComparer)(int32_t handle), + void (*systemStringComparerConstructor)(int32_t cppHandle, int32_t* handle), + void (*releaseSystemEventArgs)(int32_t handle), + void (*systemEventArgsConstructor)(int32_t cppHandle, int32_t* handle), int32_t (*boxBoolean)(System::Boolean val), System::Boolean (*unboxBoolean)(int32_t valHandle), int32_t (*boxSByte)(int8_t val), @@ -8026,44 +9094,44 @@ DLLEXPORT void Init( int32_t (*unityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item), void (*releaseSystemAction)(int32_t handle, int32_t classHandle), void (*systemActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*systemActionInvoke)(int32_t thisHandle), void (*systemActionAdd)(int32_t thisHandle, int32_t delHandle), void (*systemActionRemove)(int32_t thisHandle, int32_t delHandle), + void (*systemActionInvoke)(int32_t thisHandle), void (*releaseSystemActionSystemSingle)(int32_t handle, int32_t classHandle), void (*systemActionSystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*systemActionSystemSingleInvoke)(int32_t thisHandle, float obj), void (*systemActionSystemSingleAdd)(int32_t thisHandle, int32_t delHandle), void (*systemActionSystemSingleRemove)(int32_t thisHandle, int32_t delHandle), + void (*systemActionSystemSingleInvoke)(int32_t thisHandle, float obj), void (*releaseSystemActionSystemSingle_SystemSingle)(int32_t handle, int32_t classHandle), void (*systemActionSystemSingle_SystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*systemActionSystemSingle_SystemSingleInvoke)(int32_t thisHandle, float arg1, float arg2), void (*systemActionSystemSingle_SystemSingleAdd)(int32_t thisHandle, int32_t delHandle), void (*systemActionSystemSingle_SystemSingleRemove)(int32_t thisHandle, int32_t delHandle), + void (*systemActionSystemSingle_SystemSingleInvoke)(int32_t thisHandle, float arg1, float arg2), void (*releaseSystemFuncSystemInt32_SystemSingle_SystemDouble)(int32_t handle, int32_t classHandle), void (*systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - double (*systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)(int32_t thisHandle, int32_t arg1, float arg2), void (*systemFuncSystemInt32_SystemSingle_SystemDoubleAdd)(int32_t thisHandle, int32_t delHandle), void (*systemFuncSystemInt32_SystemSingle_SystemDoubleRemove)(int32_t thisHandle, int32_t delHandle), + double (*systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)(int32_t thisHandle, int32_t arg1, float arg2), void (*releaseSystemFuncSystemInt16_SystemInt32_SystemString)(int32_t handle, int32_t classHandle), void (*systemFuncSystemInt16_SystemInt32_SystemStringConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - int32_t (*systemFuncSystemInt16_SystemInt32_SystemStringInvoke)(int32_t thisHandle, int16_t arg1, int32_t arg2), void (*systemFuncSystemInt16_SystemInt32_SystemStringAdd)(int32_t thisHandle, int32_t delHandle), void (*systemFuncSystemInt16_SystemInt32_SystemStringRemove)(int32_t thisHandle, int32_t delHandle), + int32_t (*systemFuncSystemInt16_SystemInt32_SystemStringInvoke)(int32_t thisHandle, int16_t arg1, int32_t arg2), void (*releaseSystemAppDomainInitializer)(int32_t handle, int32_t classHandle), void (*systemAppDomainInitializerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*systemAppDomainInitializerInvoke)(int32_t thisHandle, int32_t argsHandle), void (*systemAppDomainInitializerAdd)(int32_t thisHandle, int32_t delHandle), void (*systemAppDomainInitializerRemove)(int32_t thisHandle, int32_t delHandle), + void (*systemAppDomainInitializerInvoke)(int32_t thisHandle, int32_t argsHandle), void (*releaseUnityEngineEventsUnityAction)(int32_t handle, int32_t classHandle), void (*unityEngineEventsUnityActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*unityEngineEventsUnityActionInvoke)(int32_t thisHandle), void (*unityEngineEventsUnityActionAdd)(int32_t thisHandle, int32_t delHandle), void (*unityEngineEventsUnityActionRemove)(int32_t thisHandle, int32_t delHandle), + void (*unityEngineEventsUnityActionInvoke)(int32_t thisHandle), void (*releaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode)(int32_t handle, int32_t classHandle), void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1), void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)(int32_t thisHandle, int32_t delHandle), - void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle) + void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle), + void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) /*END INIT PARAMS*/) { using namespace Plugin; @@ -8133,6 +9201,12 @@ DLLEXPORT void Init( Plugin::SystemCollectionsGenericListSystemStringPropertyGetItem = systemCollectionsGenericListSystemStringPropertyGetItem; Plugin::SystemCollectionsGenericListSystemStringPropertySetItem = systemCollectionsGenericListSystemStringPropertySetItem; Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString = systemCollectionsGenericListSystemStringMethodAddSystemString; + Plugin::SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer = systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer; + Plugin::SystemCollectionsGenericListSystemInt32Constructor = systemCollectionsGenericListSystemInt32Constructor; + Plugin::SystemCollectionsGenericListSystemInt32PropertyGetItem = systemCollectionsGenericListSystemInt32PropertyGetItem; + Plugin::SystemCollectionsGenericListSystemInt32PropertySetItem = systemCollectionsGenericListSystemInt32PropertySetItem; + Plugin::SystemCollectionsGenericListSystemInt32MethodAddSystemInt32 = systemCollectionsGenericListSystemInt32MethodAddSystemInt32; + Plugin::SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer = systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer; Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString = systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString; Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue = systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue; Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue = systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue; @@ -8172,6 +9246,46 @@ DLLEXPORT void Init( Plugin::UnboxScene = unboxScene; Plugin::BoxLoadSceneMode = boxLoadSceneMode; Plugin::UnboxLoadSceneMode = unboxLoadSceneMode; + SystemCollectionsGenericIComparerSystemInt32FreeListSize = maxManagedObjects; + SystemCollectionsGenericIComparerSystemInt32FreeList = new System::Collections::Generic::IComparer*[SystemCollectionsGenericIComparerSystemInt32FreeListSize]; + for (int32_t i = 0, end = SystemCollectionsGenericIComparerSystemInt32FreeListSize - 1; i < end; ++i) + { + SystemCollectionsGenericIComparerSystemInt32FreeList[i] = (System::Collections::Generic::IComparer*)(SystemCollectionsGenericIComparerSystemInt32FreeList + i + 1); + } + SystemCollectionsGenericIComparerSystemInt32FreeList[SystemCollectionsGenericIComparerSystemInt32FreeListSize - 1] = nullptr; + NextFreeSystemCollectionsGenericIComparerSystemInt32 = SystemCollectionsGenericIComparerSystemInt32FreeList + 1; + Plugin::ReleaseSystemCollectionsGenericIComparerSystemInt32 = releaseSystemCollectionsGenericIComparerSystemInt32; + Plugin::SystemCollectionsGenericIComparerSystemInt32Constructor = systemCollectionsGenericIComparerSystemInt32Constructor; + SystemCollectionsGenericIComparerSystemStringFreeListSize = maxManagedObjects; + SystemCollectionsGenericIComparerSystemStringFreeList = new System::Collections::Generic::IComparer*[SystemCollectionsGenericIComparerSystemStringFreeListSize]; + for (int32_t i = 0, end = SystemCollectionsGenericIComparerSystemStringFreeListSize - 1; i < end; ++i) + { + SystemCollectionsGenericIComparerSystemStringFreeList[i] = (System::Collections::Generic::IComparer*)(SystemCollectionsGenericIComparerSystemStringFreeList + i + 1); + } + SystemCollectionsGenericIComparerSystemStringFreeList[SystemCollectionsGenericIComparerSystemStringFreeListSize - 1] = nullptr; + NextFreeSystemCollectionsGenericIComparerSystemString = SystemCollectionsGenericIComparerSystemStringFreeList + 1; + Plugin::ReleaseSystemCollectionsGenericIComparerSystemString = releaseSystemCollectionsGenericIComparerSystemString; + Plugin::SystemCollectionsGenericIComparerSystemStringConstructor = systemCollectionsGenericIComparerSystemStringConstructor; + SystemStringComparerFreeListSize = maxManagedObjects; + SystemStringComparerFreeList = new System::StringComparer*[SystemStringComparerFreeListSize]; + for (int32_t i = 0, end = SystemStringComparerFreeListSize - 1; i < end; ++i) + { + SystemStringComparerFreeList[i] = (System::StringComparer*)(SystemStringComparerFreeList + i + 1); + } + SystemStringComparerFreeList[SystemStringComparerFreeListSize - 1] = nullptr; + NextFreeSystemStringComparer = SystemStringComparerFreeList + 1; + Plugin::ReleaseSystemStringComparer = releaseSystemStringComparer; + Plugin::SystemStringComparerConstructor = systemStringComparerConstructor; + SystemEventArgsFreeListSize = maxManagedObjects; + SystemEventArgsFreeList = new System::EventArgs*[SystemEventArgsFreeListSize]; + for (int32_t i = 0, end = SystemEventArgsFreeListSize - 1; i < end; ++i) + { + SystemEventArgsFreeList[i] = (System::EventArgs*)(SystemEventArgsFreeList + i + 1); + } + SystemEventArgsFreeList[SystemEventArgsFreeListSize - 1] = nullptr; + NextFreeSystemEventArgs = SystemEventArgsFreeList + 1; + Plugin::ReleaseSystemEventArgs = releaseSystemEventArgs; + Plugin::SystemEventArgsConstructor = systemEventArgsConstructor; Plugin::BoxBoolean = boxBoolean; Plugin::UnboxBoolean = unboxBoolean; Plugin::BoxSByte = boxSByte; @@ -8232,9 +9346,9 @@ DLLEXPORT void Init( NextFreeSystemAction = SystemActionFreeList + 1; Plugin::ReleaseSystemAction = releaseSystemAction; Plugin::SystemActionConstructor = systemActionConstructor; - Plugin::SystemActionInvoke = systemActionInvoke; Plugin::SystemActionAdd = systemActionAdd; Plugin::SystemActionRemove = systemActionRemove; + Plugin::SystemActionInvoke = systemActionInvoke; SystemActionSystemSingleFreeListSize = maxManagedObjects; SystemActionSystemSingleFreeList = new System::Action1*[SystemActionSystemSingleFreeListSize]; for (int32_t i = 0, end = SystemActionSystemSingleFreeListSize - 1; i < end; ++i) @@ -8245,9 +9359,9 @@ DLLEXPORT void Init( NextFreeSystemActionSystemSingle = SystemActionSystemSingleFreeList + 1; Plugin::ReleaseSystemActionSystemSingle = releaseSystemActionSystemSingle; Plugin::SystemActionSystemSingleConstructor = systemActionSystemSingleConstructor; - Plugin::SystemActionSystemSingleInvoke = systemActionSystemSingleInvoke; Plugin::SystemActionSystemSingleAdd = systemActionSystemSingleAdd; Plugin::SystemActionSystemSingleRemove = systemActionSystemSingleRemove; + Plugin::SystemActionSystemSingleInvoke = systemActionSystemSingleInvoke; SystemActionSystemSingle_SystemSingleFreeListSize = 100; SystemActionSystemSingle_SystemSingleFreeList = new System::Action2*[SystemActionSystemSingle_SystemSingleFreeListSize]; for (int32_t i = 0, end = SystemActionSystemSingle_SystemSingleFreeListSize - 1; i < end; ++i) @@ -8258,9 +9372,9 @@ DLLEXPORT void Init( NextFreeSystemActionSystemSingle_SystemSingle = SystemActionSystemSingle_SystemSingleFreeList + 1; Plugin::ReleaseSystemActionSystemSingle_SystemSingle = releaseSystemActionSystemSingle_SystemSingle; Plugin::SystemActionSystemSingle_SystemSingleConstructor = systemActionSystemSingle_SystemSingleConstructor; - Plugin::SystemActionSystemSingle_SystemSingleInvoke = systemActionSystemSingle_SystemSingleInvoke; Plugin::SystemActionSystemSingle_SystemSingleAdd = systemActionSystemSingle_SystemSingleAdd; Plugin::SystemActionSystemSingle_SystemSingleRemove = systemActionSystemSingle_SystemSingleRemove; + Plugin::SystemActionSystemSingle_SystemSingleInvoke = systemActionSystemSingle_SystemSingleInvoke; SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize = 50; SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList = new System::Func3*[SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize]; for (int32_t i = 0, end = SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize - 1; i < end; ++i) @@ -8271,9 +9385,9 @@ DLLEXPORT void Init( NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble = SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + 1; Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble = releaseSystemFuncSystemInt32_SystemSingle_SystemDouble; Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor = systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor; - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke = systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke; Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd = systemFuncSystemInt32_SystemSingle_SystemDoubleAdd; Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove = systemFuncSystemInt32_SystemSingle_SystemDoubleRemove; + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke = systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke; SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize = 25; SystemFuncSystemInt16_SystemInt32_SystemStringFreeList = new System::Func3*[SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize]; for (int32_t i = 0, end = SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize - 1; i < end; ++i) @@ -8284,9 +9398,9 @@ DLLEXPORT void Init( NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + 1; Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString = releaseSystemFuncSystemInt16_SystemInt32_SystemString; Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor = systemFuncSystemInt16_SystemInt32_SystemStringConstructor; - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke = systemFuncSystemInt16_SystemInt32_SystemStringInvoke; Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd = systemFuncSystemInt16_SystemInt32_SystemStringAdd; Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove = systemFuncSystemInt16_SystemInt32_SystemStringRemove; + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke = systemFuncSystemInt16_SystemInt32_SystemStringInvoke; SystemAppDomainInitializerFreeListSize = maxManagedObjects; SystemAppDomainInitializerFreeList = new System::AppDomainInitializer*[SystemAppDomainInitializerFreeListSize]; for (int32_t i = 0, end = SystemAppDomainInitializerFreeListSize - 1; i < end; ++i) @@ -8297,9 +9411,9 @@ DLLEXPORT void Init( NextFreeSystemAppDomainInitializer = SystemAppDomainInitializerFreeList + 1; Plugin::ReleaseSystemAppDomainInitializer = releaseSystemAppDomainInitializer; Plugin::SystemAppDomainInitializerConstructor = systemAppDomainInitializerConstructor; - Plugin::SystemAppDomainInitializerInvoke = systemAppDomainInitializerInvoke; Plugin::SystemAppDomainInitializerAdd = systemAppDomainInitializerAdd; Plugin::SystemAppDomainInitializerRemove = systemAppDomainInitializerRemove; + Plugin::SystemAppDomainInitializerInvoke = systemAppDomainInitializerInvoke; UnityEngineEventsUnityActionFreeListSize = maxManagedObjects; UnityEngineEventsUnityActionFreeList = new UnityEngine::Events::UnityAction*[UnityEngineEventsUnityActionFreeListSize]; for (int32_t i = 0, end = UnityEngineEventsUnityActionFreeListSize - 1; i < end; ++i) @@ -8310,9 +9424,9 @@ DLLEXPORT void Init( NextFreeUnityEngineEventsUnityAction = UnityEngineEventsUnityActionFreeList + 1; Plugin::ReleaseUnityEngineEventsUnityAction = releaseUnityEngineEventsUnityAction; Plugin::UnityEngineEventsUnityActionConstructor = unityEngineEventsUnityActionConstructor; - Plugin::UnityEngineEventsUnityActionInvoke = unityEngineEventsUnityActionInvoke; Plugin::UnityEngineEventsUnityActionAdd = unityEngineEventsUnityActionAdd; Plugin::UnityEngineEventsUnityActionRemove = unityEngineEventsUnityActionRemove; + Plugin::UnityEngineEventsUnityActionInvoke = unityEngineEventsUnityActionInvoke; UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize = 10; UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList = new UnityEngine::Events::UnityAction2*[UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize]; for (int32_t i = 0, end = UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize - 1; i < end; ++i) @@ -8323,9 +9437,9 @@ DLLEXPORT void Init( NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList + 1; Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = releaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor; - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke; Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd; Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove; + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke; /*END INIT BODY*/ try diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index e7989fe..e1a940a 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -181,6 +181,25 @@ namespace System template struct Array5; } +//////////////////////////////////////////////////////////////// +// C# type aliases +//////////////////////////////////////////////////////////////// + +namespace System +{ + using SByte = int8_t; + using Byte = uint8_t; + using Int16 = int16_t; + using UInt16 = uint16_t; + using Int32 = int32_t; + using UInt32 = uint32_t; + using Int64 = int64_t; + using UInt64 = uint64_t; + using Boolean = Boolean; + using Single = float; + using Double = double; +} + /*BEGIN TYPE DECLARATIONS*/ namespace System { @@ -322,6 +341,17 @@ namespace System } } +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct List; + } + } +} + namespace System { namespace Collections @@ -498,6 +528,49 @@ namespace UnityEngine } } +namespace System +{ + namespace Collections + { + namespace Generic + { + template struct IComparer; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IComparer; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IComparer; + } + } +} + +namespace System +{ + struct StringComparer; +} + +namespace System +{ + struct EventArgs; +} + namespace MyGame { namespace MonoBehaviours @@ -739,7 +812,6 @@ namespace System explicit operator float(); Object(double val); explicit operator double(); - /*END BOXING METHOD DECLARATIONS*/ }; @@ -1110,6 +1182,35 @@ namespace System System::String GetItem(int32_t index); void SetItem(int32_t index, System::String value); void Add(System::String item); + void Sort(System::Collections::Generic::IComparer comparer); + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct List : System::Object + { + List(std::nullptr_t n); + List(Plugin::InternalUse iu, int32_t handle); + List(const List& other); + List(List&& other); + virtual ~List(); + List& operator=(const List& other); + List& operator=(std::nullptr_t other); + List& operator=(List&& other); + bool operator==(const List& other) const; + bool operator!=(const List& other) const; + List(); + int32_t GetItem(int32_t index); + void SetItem(int32_t index, int32_t value); + void Add(int32_t item); + void Sort(System::Collections::Generic::IComparer comparer); }; } } @@ -1445,6 +1546,100 @@ namespace UnityEngine } } +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IComparer : System::Object + { + IComparer(std::nullptr_t n); + IComparer(Plugin::InternalUse iu, int32_t handle); + IComparer(const IComparer& other); + IComparer(IComparer&& other); + virtual ~IComparer(); + IComparer& operator=(const IComparer& other); + IComparer& operator=(std::nullptr_t other); + IComparer& operator=(IComparer&& other); + bool operator==(const IComparer& other) const; + bool operator!=(const IComparer& other) const; + int32_t CppHandle; + IComparer(); + virtual int32_t Compare(int32_t x, int32_t y); + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IComparer : System::Object + { + IComparer(std::nullptr_t n); + IComparer(Plugin::InternalUse iu, int32_t handle); + IComparer(const IComparer& other); + IComparer(IComparer&& other); + virtual ~IComparer(); + IComparer& operator=(const IComparer& other); + IComparer& operator=(std::nullptr_t other); + IComparer& operator=(IComparer&& other); + bool operator==(const IComparer& other) const; + bool operator!=(const IComparer& other) const; + int32_t CppHandle; + IComparer(); + virtual int32_t Compare(System::String x, System::String y); + }; + } + } +} + +namespace System +{ + struct StringComparer : System::Object + { + StringComparer(std::nullptr_t n); + StringComparer(Plugin::InternalUse iu, int32_t handle); + StringComparer(const StringComparer& other); + StringComparer(StringComparer&& other); + virtual ~StringComparer(); + StringComparer& operator=(const StringComparer& other); + StringComparer& operator=(std::nullptr_t other); + StringComparer& operator=(StringComparer&& other); + bool operator==(const StringComparer& other) const; + bool operator!=(const StringComparer& other) const; + int32_t CppHandle; + StringComparer(); + virtual int32_t Compare(System::String x, System::String y); + virtual System::Boolean Equals(System::String x, System::String y); + virtual int32_t GetHashCode(System::String obj); + }; +} + +namespace System +{ + struct EventArgs : System::Object + { + EventArgs(std::nullptr_t n); + EventArgs(Plugin::InternalUse iu, int32_t handle); + EventArgs(const EventArgs& other); + EventArgs(EventArgs&& other); + virtual ~EventArgs(); + EventArgs& operator=(const EventArgs& other); + EventArgs& operator=(std::nullptr_t other); + EventArgs& operator=(EventArgs&& other); + bool operator==(const EventArgs& other) const; + bool operator!=(const EventArgs& other) const; + int32_t CppHandle; + EventArgs(); + virtual System::String ToString(); + }; +} + namespace MyGame { namespace MonoBehaviours @@ -1789,10 +1984,10 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Action(); - void Invoke(); - virtual void operator()(); void operator+=(System::Action& del); void operator-=(System::Action& del); + virtual void operator()(); + void Invoke(); }; } @@ -1813,10 +2008,10 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Action1(); - void Invoke(float obj); - virtual void operator()(float obj); void operator+=(System::Action1& del); void operator-=(System::Action1& del); + virtual void operator()(float obj); + void Invoke(float obj); }; } @@ -1837,10 +2032,10 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Action2(); - void Invoke(float arg1, float arg2); - virtual void operator()(float arg1, float arg2); void operator+=(System::Action2& del); void operator-=(System::Action2& del); + virtual void operator()(float arg1, float arg2); + void Invoke(float arg1, float arg2); }; } @@ -1861,10 +2056,10 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Func3(); - double Invoke(int32_t arg1, float arg2); - virtual double operator()(int32_t arg1, float arg2); void operator+=(System::Func3& del); void operator-=(System::Func3& del); + virtual double operator()(int32_t arg1, float arg2); + double Invoke(int32_t arg1, float arg2); }; } @@ -1885,10 +2080,10 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Func3(); - System::String Invoke(int16_t arg1, int32_t arg2); - virtual System::String operator()(int16_t arg1, int32_t arg2); void operator+=(System::Func3& del); void operator-=(System::Func3& del); + virtual System::String operator()(int16_t arg1, int32_t arg2); + System::String Invoke(int16_t arg1, int32_t arg2); }; } @@ -1909,10 +2104,10 @@ namespace System int32_t CppHandle; int32_t ClassHandle; AppDomainInitializer(); - void Invoke(System::Array1 args); - virtual void operator()(System::Array1 args); void operator+=(System::AppDomainInitializer& del); void operator-=(System::AppDomainInitializer& del); + virtual void operator()(System::Array1 args); + void Invoke(System::Array1 args); }; } @@ -1935,10 +2130,10 @@ namespace UnityEngine int32_t CppHandle; int32_t ClassHandle; UnityAction(); - void Invoke(); - virtual void operator()(); void operator+=(UnityEngine::Events::UnityAction& del); void operator-=(UnityEngine::Events::UnityAction& del); + virtual void operator()(); + void Invoke(); }; } } @@ -1962,10 +2157,10 @@ namespace UnityEngine int32_t CppHandle; int32_t ClassHandle; UnityAction2(); - void Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); - virtual void operator()(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); void operator+=(UnityEngine::Events::UnityAction2& del); void operator-=(UnityEngine::Events::UnityAction2& del); + virtual void operator()(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); + void Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); }; } } From b84f6c469f81add539b34f1fb15786580236c320 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 19 Nov 2017 09:15:36 -0800 Subject: [PATCH 36/95] Remove dependency on the C++ standard library Update README --- README.md | 7 +- .../NativeScript/Editor/GenerateBindings.cs | 12 +- Unity/CppSource/NativeScript/Bindings.cpp | 210 ++++++++--------- Unity/CppSource/NativeScript/Bindings.h | 213 +++++++++--------- 4 files changed, 222 insertions(+), 220 deletions(-) diff --git a/README.md b/README.md index ad80b82..0128b59 100644 --- a/README.md +++ b/README.md @@ -56,9 +56,14 @@ C++ is a much larger language than C# and some developers will prefer having mor While IL2CPP transforms C# into C++ already, it generates a lot of overhead. There are many [surprises](http://jacksondunstan.com/articles/3916) if you read through the generated C++. For example, there's overhead for any function using a static variable and an extra two pointers are stored at the beginning of every class. The same goes for all sorts of features such as `sizeof()`, mandatory null checks, and so forth. Instead, you could write C++ directly and not need to work around IL2CPP. +## Industry Standard Language + +C++ is the standard language for video games as well as many other fields. By programming in C++ you can more easily transfer your skills and code to and from non-Unity projects. For example, you can avoid lock-in by using the same language (C++) that you'd use in the Unreal or Lumberyard engines. + # UnityNativeScripting Features -* Supports Windows, macOS, iOS, and Android (editor and standalone) +* Supports Windows, macOS, Linux, iOS, and Android (editor and standalone) +* Works with Unity 2017.x and 5.x * Plays nice with other C# scripts- no need to use 100% C++ * Object-oriented API just like in C# diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index a7b5fc1..c252acd 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -7399,7 +7399,7 @@ static void AppendCppBaseTypeAssignmentOperatorNullptr( typeParams, output); output.Append( - "::operator=(std::nullptr_t other)\n"); + "::operator=(decltype(nullptr) other)\n"); AppendIndent( cppMethodDefinitionsIndent, output); @@ -7913,7 +7913,7 @@ static void AppendCppBaseTypeNullptrConstructor( AppendTypeNameWithoutGenericSuffix( numberedTypeName, output); - output.Append("(std::nullptr_t n)\n"); + output.Append("(decltype(nullptr) n)\n"); AppendIndent( cppMethodDefinitionsIndent, output); @@ -9125,7 +9125,7 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeParameters( typeParams, output); - output.Append("(std::nullptr_t n);\n"); + output.Append("(decltype(nullptr) n);\n"); // Constructor from handle AppendIndent(indent + 1, output); @@ -9208,7 +9208,7 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeParameters( typeParams, output); - output.Append("& operator=(std::nullptr_t other);\n"); + output.Append("& operator=(decltype(nullptr) other);\n"); // Move assignment operator to same type AppendIndent(indent + 1, output); @@ -9310,7 +9310,7 @@ static int AppendCppMethodDefinitionsBegin( AppendTypeNameWithoutGenericSuffix( enclosingTypeName, output); - output.Append("(std::nullptr_t n)\n"); + output.Append("(decltype(nullptr) n)\n"); AppendIndent(indent, output); output.Append("\t: "); AppendTypeNameWithoutGenericSuffix( @@ -9531,7 +9531,7 @@ static int AppendCppMethodDefinitionsBegin( AppendCppTypeParameters( enclosingTypeParams, output); - output.Append("::operator=(std::nullptr_t other)\n"); + output.Append("::operator=(decltype(nullptr) other)\n"); AppendIndent(indent, output); output.Append("{\n"); AppendIndent(indent, output); diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 7db5553..b0b52df 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -656,17 +656,17 @@ namespace System { } - Object::Object(std::nullptr_t n) + Object::Object(decltype(nullptr) n) : Handle(0) { } - bool Object::operator==(std::nullptr_t other) const + bool Object::operator==(decltype(nullptr) other) const { return Handle == 0; } - bool Object::operator!=(std::nullptr_t other) const + bool Object::operator!=(decltype(nullptr) other) const { return Handle != 0; } @@ -681,12 +681,12 @@ namespace System Handle = handle; } - ValueType::ValueType(std::nullptr_t n) + ValueType::ValueType(decltype(nullptr) n) { Handle = 0; } - String::String(std::nullptr_t n) + String::String(decltype(nullptr) n) : Object(Plugin::InternalUse::Only, 0) { } @@ -741,7 +741,7 @@ namespace System return *this; } - String& String::operator=(std::nullptr_t other) + String& String::operator=(decltype(nullptr) other) { if (Handle) { @@ -777,7 +777,7 @@ namespace System { } - Array::Array(std::nullptr_t n) + Array::Array(decltype(nullptr) n) : Object(Plugin::InternalUse::Only, 0) { } @@ -798,7 +798,7 @@ namespace System { namespace Diagnostics { - Stopwatch::Stopwatch(std::nullptr_t n) + Stopwatch::Stopwatch(decltype(nullptr) n) : Stopwatch(Plugin::InternalUse::Only, 0) { } @@ -846,7 +846,7 @@ namespace System return *this; } - Stopwatch& Stopwatch::operator=(std::nullptr_t other) + Stopwatch& Stopwatch::operator=(decltype(nullptr) other) { if (Handle) { @@ -936,7 +936,7 @@ namespace System namespace UnityEngine { - Object::Object(std::nullptr_t n) + Object::Object(decltype(nullptr) n) : Object(Plugin::InternalUse::Only, 0) { } @@ -984,7 +984,7 @@ namespace UnityEngine return *this; } - Object& Object::operator=(std::nullptr_t other) + Object& Object::operator=(decltype(nullptr) other) { if (Handle) { @@ -1069,7 +1069,7 @@ namespace UnityEngine namespace UnityEngine { - GameObject::GameObject(std::nullptr_t n) + GameObject::GameObject(decltype(nullptr) n) : GameObject(Plugin::InternalUse::Only, 0) { } @@ -1117,7 +1117,7 @@ namespace UnityEngine return *this; } - GameObject& GameObject::operator=(std::nullptr_t other) + GameObject& GameObject::operator=(decltype(nullptr) other) { if (Handle) { @@ -1213,7 +1213,7 @@ namespace UnityEngine namespace UnityEngine { - Component::Component(std::nullptr_t n) + Component::Component(decltype(nullptr) n) : Component(Plugin::InternalUse::Only, 0) { } @@ -1261,7 +1261,7 @@ namespace UnityEngine return *this; } - Component& Component::operator=(std::nullptr_t other) + Component& Component::operator=(decltype(nullptr) other) { if (Handle) { @@ -1308,7 +1308,7 @@ namespace UnityEngine namespace UnityEngine { - Transform::Transform(std::nullptr_t n) + Transform::Transform(decltype(nullptr) n) : Transform(Plugin::InternalUse::Only, 0) { } @@ -1356,7 +1356,7 @@ namespace UnityEngine return *this; } - Transform& Transform::operator=(std::nullptr_t other) + Transform& Transform::operator=(decltype(nullptr) other) { if (Handle) { @@ -1415,7 +1415,7 @@ namespace UnityEngine namespace UnityEngine { - Debug::Debug(std::nullptr_t n) + Debug::Debug(decltype(nullptr) n) : Debug(Plugin::InternalUse::Only, 0) { } @@ -1463,7 +1463,7 @@ namespace UnityEngine return *this; } - Debug& Debug::operator=(std::nullptr_t other) + Debug& Debug::operator=(decltype(nullptr) other) { if (Handle) { @@ -1564,7 +1564,7 @@ namespace UnityEngine namespace UnityEngine { - Collision::Collision(std::nullptr_t n) + Collision::Collision(decltype(nullptr) n) : Collision(Plugin::InternalUse::Only, 0) { } @@ -1612,7 +1612,7 @@ namespace UnityEngine return *this; } - Collision& Collision::operator=(std::nullptr_t other) + Collision& Collision::operator=(decltype(nullptr) other) { if (Handle) { @@ -1646,7 +1646,7 @@ namespace UnityEngine namespace UnityEngine { - Behaviour::Behaviour(std::nullptr_t n) + Behaviour::Behaviour(decltype(nullptr) n) : Behaviour(Plugin::InternalUse::Only, 0) { } @@ -1694,7 +1694,7 @@ namespace UnityEngine return *this; } - Behaviour& Behaviour::operator=(std::nullptr_t other) + Behaviour& Behaviour::operator=(decltype(nullptr) other) { if (Handle) { @@ -1728,7 +1728,7 @@ namespace UnityEngine namespace UnityEngine { - MonoBehaviour::MonoBehaviour(std::nullptr_t n) + MonoBehaviour::MonoBehaviour(decltype(nullptr) n) : MonoBehaviour(Plugin::InternalUse::Only, 0) { } @@ -1776,7 +1776,7 @@ namespace UnityEngine return *this; } - MonoBehaviour& MonoBehaviour::operator=(std::nullptr_t other) + MonoBehaviour& MonoBehaviour::operator=(decltype(nullptr) other) { if (Handle) { @@ -1810,7 +1810,7 @@ namespace UnityEngine namespace UnityEngine { - AudioSettings::AudioSettings(std::nullptr_t n) + AudioSettings::AudioSettings(decltype(nullptr) n) : AudioSettings(Plugin::InternalUse::Only, 0) { } @@ -1858,7 +1858,7 @@ namespace UnityEngine return *this; } - AudioSettings& AudioSettings::operator=(std::nullptr_t other) + AudioSettings& AudioSettings::operator=(decltype(nullptr) other) { if (Handle) { @@ -1906,7 +1906,7 @@ namespace UnityEngine { namespace Networking { - NetworkTransport::NetworkTransport(std::nullptr_t n) + NetworkTransport::NetworkTransport(decltype(nullptr) n) : NetworkTransport(Plugin::InternalUse::Only, 0) { } @@ -1954,7 +1954,7 @@ namespace UnityEngine return *this; } - NetworkTransport& NetworkTransport::operator=(std::nullptr_t other) + NetworkTransport& NetworkTransport::operator=(decltype(nullptr) other) { if (Handle) { @@ -2192,7 +2192,7 @@ namespace System namespace UnityEngine { - RaycastHit::RaycastHit(std::nullptr_t n) + RaycastHit::RaycastHit(decltype(nullptr) n) : RaycastHit(Plugin::InternalUse::Only, 0) { } @@ -2240,7 +2240,7 @@ namespace UnityEngine return *this; } - RaycastHit& RaycastHit::operator=(std::nullptr_t other) + RaycastHit& RaycastHit::operator=(decltype(nullptr) other) { if (Handle) { @@ -2382,7 +2382,7 @@ namespace System { namespace Generic { - KeyValuePair::KeyValuePair(std::nullptr_t n) + KeyValuePair::KeyValuePair(decltype(nullptr) n) : KeyValuePair(Plugin::InternalUse::Only, 0) { } @@ -2430,7 +2430,7 @@ namespace System return *this; } - KeyValuePair& KeyValuePair::operator=(std::nullptr_t other) + KeyValuePair& KeyValuePair::operator=(decltype(nullptr) other) { if (Handle) { @@ -2547,7 +2547,7 @@ namespace System { namespace Generic { - List::List(std::nullptr_t n) + List::List(decltype(nullptr) n) : List(Plugin::InternalUse::Only, 0) { } @@ -2595,7 +2595,7 @@ namespace System return *this; } - List& List::operator=(std::nullptr_t other) + List& List::operator=(decltype(nullptr) other) { if (Handle) { @@ -2702,7 +2702,7 @@ namespace System { namespace Generic { - List::List(std::nullptr_t n) + List::List(decltype(nullptr) n) : List(Plugin::InternalUse::Only, 0) { } @@ -2750,7 +2750,7 @@ namespace System return *this; } - List& List::operator=(std::nullptr_t other) + List& List::operator=(decltype(nullptr) other) { if (Handle) { @@ -2857,7 +2857,7 @@ namespace System { namespace Generic { - LinkedListNode::LinkedListNode(std::nullptr_t n) + LinkedListNode::LinkedListNode(decltype(nullptr) n) : LinkedListNode(Plugin::InternalUse::Only, 0) { } @@ -2905,7 +2905,7 @@ namespace System return *this; } - LinkedListNode& LinkedListNode::operator=(std::nullptr_t other) + LinkedListNode& LinkedListNode::operator=(decltype(nullptr) other) { if (Handle) { @@ -2988,7 +2988,7 @@ namespace System { namespace CompilerServices { - StrongBox::StrongBox(std::nullptr_t n) + StrongBox::StrongBox(decltype(nullptr) n) : StrongBox(Plugin::InternalUse::Only, 0) { } @@ -3036,7 +3036,7 @@ namespace System return *this; } - StrongBox& StrongBox::operator=(std::nullptr_t other) + StrongBox& StrongBox::operator=(decltype(nullptr) other) { if (Handle) { @@ -3119,7 +3119,7 @@ namespace System { namespace ObjectModel { - Collection::Collection(std::nullptr_t n) + Collection::Collection(decltype(nullptr) n) : Collection(Plugin::InternalUse::Only, 0) { } @@ -3167,7 +3167,7 @@ namespace System return *this; } - Collection& Collection::operator=(std::nullptr_t other) + Collection& Collection::operator=(decltype(nullptr) other) { if (Handle) { @@ -3207,7 +3207,7 @@ namespace System { namespace ObjectModel { - KeyedCollection::KeyedCollection(std::nullptr_t n) + KeyedCollection::KeyedCollection(decltype(nullptr) n) : KeyedCollection(Plugin::InternalUse::Only, 0) { } @@ -3255,7 +3255,7 @@ namespace System return *this; } - KeyedCollection& KeyedCollection::operator=(std::nullptr_t other) + KeyedCollection& KeyedCollection::operator=(decltype(nullptr) other) { if (Handle) { @@ -3291,7 +3291,7 @@ namespace System namespace System { - Exception::Exception(std::nullptr_t n) + Exception::Exception(decltype(nullptr) n) : Exception(Plugin::InternalUse::Only, 0) { } @@ -3339,7 +3339,7 @@ namespace System return *this; } - Exception& Exception::operator=(std::nullptr_t other) + Exception& Exception::operator=(decltype(nullptr) other) { if (Handle) { @@ -3391,7 +3391,7 @@ namespace System namespace System { - SystemException::SystemException(std::nullptr_t n) + SystemException::SystemException(decltype(nullptr) n) : SystemException(Plugin::InternalUse::Only, 0) { } @@ -3439,7 +3439,7 @@ namespace System return *this; } - SystemException& SystemException::operator=(std::nullptr_t other) + SystemException& SystemException::operator=(decltype(nullptr) other) { if (Handle) { @@ -3473,7 +3473,7 @@ namespace System namespace System { - NullReferenceException::NullReferenceException(std::nullptr_t n) + NullReferenceException::NullReferenceException(decltype(nullptr) n) : NullReferenceException(Plugin::InternalUse::Only, 0) { } @@ -3521,7 +3521,7 @@ namespace System return *this; } - NullReferenceException& NullReferenceException::operator=(std::nullptr_t other) + NullReferenceException& NullReferenceException::operator=(decltype(nullptr) other) { if (Handle) { @@ -3670,7 +3670,7 @@ namespace System namespace UnityEngine { - Screen::Screen(std::nullptr_t n) + Screen::Screen(decltype(nullptr) n) : Screen(Plugin::InternalUse::Only, 0) { } @@ -3718,7 +3718,7 @@ namespace UnityEngine return *this; } - Screen& Screen::operator=(std::nullptr_t other) + Screen& Screen::operator=(decltype(nullptr) other) { if (Handle) { @@ -3818,7 +3818,7 @@ namespace System namespace UnityEngine { - Physics::Physics(std::nullptr_t n) + Physics::Physics(decltype(nullptr) n) : Physics(Plugin::InternalUse::Only, 0) { } @@ -3866,7 +3866,7 @@ namespace UnityEngine return *this; } - Physics& Physics::operator=(std::nullptr_t other) + Physics& Physics::operator=(decltype(nullptr) other) { if (Handle) { @@ -4006,7 +4006,7 @@ namespace System namespace UnityEngine { - Gradient::Gradient(std::nullptr_t n) + Gradient::Gradient(decltype(nullptr) n) : Gradient(Plugin::InternalUse::Only, 0) { } @@ -4054,7 +4054,7 @@ namespace UnityEngine return *this; } - Gradient& Gradient::operator=(std::nullptr_t other) + Gradient& Gradient::operator=(decltype(nullptr) other) { if (Handle) { @@ -4131,7 +4131,7 @@ namespace UnityEngine namespace System { - AppDomainSetup::AppDomainSetup(std::nullptr_t n) + AppDomainSetup::AppDomainSetup(decltype(nullptr) n) : AppDomainSetup(Plugin::InternalUse::Only, 0) { } @@ -4179,7 +4179,7 @@ namespace System return *this; } - AppDomainSetup& AppDomainSetup::operator=(std::nullptr_t other) + AppDomainSetup& AppDomainSetup::operator=(decltype(nullptr) other) { if (Handle) { @@ -4256,7 +4256,7 @@ namespace System namespace UnityEngine { - Application::Application(std::nullptr_t n) + Application::Application(decltype(nullptr) n) : Application(Plugin::InternalUse::Only, 0) { } @@ -4304,7 +4304,7 @@ namespace UnityEngine return *this; } - Application& Application::operator=(std::nullptr_t other) + Application& Application::operator=(decltype(nullptr) other) { if (Handle) { @@ -4364,7 +4364,7 @@ namespace UnityEngine { namespace SceneManagement { - SceneManager::SceneManager(std::nullptr_t n) + SceneManager::SceneManager(decltype(nullptr) n) : SceneManager(Plugin::InternalUse::Only, 0) { } @@ -4412,7 +4412,7 @@ namespace UnityEngine return *this; } - SceneManager& SceneManager::operator=(std::nullptr_t other) + SceneManager& SceneManager::operator=(decltype(nullptr) other) { if (Handle) { @@ -4574,7 +4574,7 @@ namespace System } } - IComparer::IComparer(std::nullptr_t n) + IComparer::IComparer(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); @@ -4644,7 +4644,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(std::nullptr_t other) + IComparer& IComparer::operator=(decltype(nullptr) other) { if (Handle) { @@ -4758,7 +4758,7 @@ namespace System } } - IComparer::IComparer(std::nullptr_t n) + IComparer::IComparer(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); @@ -4828,7 +4828,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(std::nullptr_t other) + IComparer& IComparer::operator=(decltype(nullptr) other) { if (Handle) { @@ -4938,7 +4938,7 @@ namespace System } } - StringComparer::StringComparer(std::nullptr_t n) + StringComparer::StringComparer(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemStringComparer(this); @@ -5008,7 +5008,7 @@ namespace System return *this; } - StringComparer& StringComparer::operator=(std::nullptr_t other) + StringComparer& StringComparer::operator=(decltype(nullptr) other) { if (Handle) { @@ -5166,7 +5166,7 @@ namespace System } } - EventArgs::EventArgs(std::nullptr_t n) + EventArgs::EventArgs(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemEventArgs(this); @@ -5236,7 +5236,7 @@ namespace System return *this; } - EventArgs& EventArgs::operator=(std::nullptr_t other) + EventArgs& EventArgs::operator=(decltype(nullptr) other) { if (Handle) { @@ -5719,7 +5719,7 @@ namespace MyGame { namespace MonoBehaviours { - TestScript::TestScript(std::nullptr_t n) + TestScript::TestScript(decltype(nullptr) n) : TestScript(Plugin::InternalUse::Only, 0) { } @@ -5767,7 +5767,7 @@ namespace MyGame return *this; } - TestScript& TestScript::operator=(std::nullptr_t other) + TestScript& TestScript::operator=(decltype(nullptr) other) { if (Handle) { @@ -5836,7 +5836,7 @@ namespace Plugin namespace System { - Array1::Array1(std::nullptr_t n) + Array1::Array1(decltype(nullptr) n) : Array1(Plugin::InternalUse::Only, 0) { } @@ -5884,7 +5884,7 @@ namespace System return *this; } - Array1& Array1::operator=(std::nullptr_t other) + Array1& Array1::operator=(decltype(nullptr) other) { if (Handle) { @@ -6099,7 +6099,7 @@ namespace Plugin namespace System { - Array1::Array1(std::nullptr_t n) + Array1::Array1(decltype(nullptr) n) : Array1(Plugin::InternalUse::Only, 0) { } @@ -6147,7 +6147,7 @@ namespace System return *this; } - Array1& Array1::operator=(std::nullptr_t other) + Array1& Array1::operator=(decltype(nullptr) other) { if (Handle) { @@ -6214,7 +6214,7 @@ namespace System namespace System { - Array2::Array2(std::nullptr_t n) + Array2::Array2(decltype(nullptr) n) : Array2(Plugin::InternalUse::Only, 0) { } @@ -6262,7 +6262,7 @@ namespace System return *this; } - Array2& Array2::operator=(std::nullptr_t other) + Array2& Array2::operator=(decltype(nullptr) other) { if (Handle) { @@ -6342,7 +6342,7 @@ namespace System namespace System { - Array3::Array3(std::nullptr_t n) + Array3::Array3(decltype(nullptr) n) : Array3(Plugin::InternalUse::Only, 0) { } @@ -6390,7 +6390,7 @@ namespace System return *this; } - Array3& Array3::operator=(std::nullptr_t other) + Array3& Array3::operator=(decltype(nullptr) other) { if (Handle) { @@ -6504,7 +6504,7 @@ namespace Plugin namespace System { - Array1::Array1(std::nullptr_t n) + Array1::Array1(decltype(nullptr) n) : Array1(Plugin::InternalUse::Only, 0) { } @@ -6552,7 +6552,7 @@ namespace System return *this; } - Array1& Array1::operator=(std::nullptr_t other) + Array1& Array1::operator=(decltype(nullptr) other) { if (Handle) { @@ -6653,7 +6653,7 @@ namespace Plugin namespace System { - Array1::Array1(std::nullptr_t n) + Array1::Array1(decltype(nullptr) n) : Array1(Plugin::InternalUse::Only, 0) { } @@ -6701,7 +6701,7 @@ namespace System return *this; } - Array1& Array1::operator=(std::nullptr_t other) + Array1& Array1::operator=(decltype(nullptr) other) { if (Handle) { @@ -6802,7 +6802,7 @@ namespace Plugin namespace System { - Array1::Array1(std::nullptr_t n) + Array1::Array1(decltype(nullptr) n) : Array1(Plugin::InternalUse::Only, 0) { } @@ -6850,7 +6850,7 @@ namespace System return *this; } - Array1& Array1::operator=(std::nullptr_t other) + Array1& Array1::operator=(decltype(nullptr) other) { if (Handle) { @@ -6951,7 +6951,7 @@ namespace Plugin namespace System { - Array1::Array1(std::nullptr_t n) + Array1::Array1(decltype(nullptr) n) : Array1(Plugin::InternalUse::Only, 0) { } @@ -6999,7 +6999,7 @@ namespace System return *this; } - Array1& Array1::operator=(std::nullptr_t other) + Array1& Array1::operator=(decltype(nullptr) other) { if (Handle) { @@ -7090,7 +7090,7 @@ namespace System } } - Action::Action(std::nullptr_t n) + Action::Action(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemAction(this); @@ -7168,7 +7168,7 @@ namespace System return *this; } - Action& Action::operator=(std::nullptr_t other) + Action& Action::operator=(decltype(nullptr) other) { if (Handle) { @@ -7317,7 +7317,7 @@ namespace System } } - Action1::Action1(std::nullptr_t n) + Action1::Action1(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemActionSystemSingle(this); @@ -7395,7 +7395,7 @@ namespace System return *this; } - Action1& Action1::operator=(std::nullptr_t other) + Action1& Action1::operator=(decltype(nullptr) other) { if (Handle) { @@ -7544,7 +7544,7 @@ namespace System } } - Action2::Action2(std::nullptr_t n) + Action2::Action2(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); @@ -7622,7 +7622,7 @@ namespace System return *this; } - Action2& Action2::operator=(std::nullptr_t other) + Action2& Action2::operator=(decltype(nullptr) other) { if (Handle) { @@ -7771,7 +7771,7 @@ namespace System } } - Func3::Func3(std::nullptr_t n) + Func3::Func3(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); @@ -7849,7 +7849,7 @@ namespace System return *this; } - Func3& Func3::operator=(std::nullptr_t other) + Func3& Func3::operator=(decltype(nullptr) other) { if (Handle) { @@ -8002,7 +8002,7 @@ namespace System } } - Func3::Func3(std::nullptr_t n) + Func3::Func3(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); @@ -8080,7 +8080,7 @@ namespace System return *this; } - Func3& Func3::operator=(std::nullptr_t other) + Func3& Func3::operator=(decltype(nullptr) other) { if (Handle) { @@ -8233,7 +8233,7 @@ namespace System } } - AppDomainInitializer::AppDomainInitializer(std::nullptr_t n) + AppDomainInitializer::AppDomainInitializer(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemAppDomainInitializer(this); @@ -8311,7 +8311,7 @@ namespace System return *this; } - AppDomainInitializer& AppDomainInitializer::operator=(std::nullptr_t other) + AppDomainInitializer& AppDomainInitializer::operator=(decltype(nullptr) other) { if (Handle) { @@ -8462,7 +8462,7 @@ namespace UnityEngine } } - UnityAction::UnityAction(std::nullptr_t n) + UnityAction::UnityAction(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); @@ -8540,7 +8540,7 @@ namespace UnityEngine return *this; } - UnityAction& UnityAction::operator=(std::nullptr_t other) + UnityAction& UnityAction::operator=(decltype(nullptr) other) { if (Handle) { @@ -8692,7 +8692,7 @@ namespace UnityEngine } } - UnityAction2::UnityAction2(std::nullptr_t n) + UnityAction2::UnityAction2(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); @@ -8770,7 +8770,7 @@ namespace UnityEngine return *this; } - UnityAction2& UnityAction2::operator=(std::nullptr_t other) + UnityAction2& UnityAction2::operator=(decltype(nullptr) other) { if (Handle) { diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index e1a940a..c737a55 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -13,9 +13,6 @@ // For int32_t, etc. #include -// For nullptr_t -#include - //////////////////////////////////////////////////////////////// // Plugin internals //////////////////////////////////////////////////////////////// @@ -759,10 +756,10 @@ namespace System { int32_t Handle; Object(Plugin::InternalUse iu, int32_t handle); - Object(std::nullptr_t n); + Object(decltype(nullptr) n); virtual ~Object() = default; - bool operator==(std::nullptr_t other) const; - bool operator!=(std::nullptr_t other) const; + bool operator==(decltype(nullptr) other) const; + bool operator!=(decltype(nullptr) other) const; virtual void ThrowReferenceToThis(); /*BEGIN BOXING METHOD DECLARATIONS*/ @@ -819,18 +816,18 @@ namespace System { int32_t Handle; ValueType(Plugin::InternalUse iu, int32_t handle); - ValueType(std::nullptr_t n); + ValueType(decltype(nullptr) n); }; struct String : Object { String(Plugin::InternalUse iu, int32_t handle); - String(std::nullptr_t n); + String(decltype(nullptr) n); String(const String& other); String(String&& other); virtual ~String(); String& operator=(const String& other); - String& operator=(std::nullptr_t other); + String& operator=(decltype(nullptr) other); String& operator=(String&& other); String(); String(const char* chars); @@ -839,7 +836,7 @@ namespace System struct Array : Object { Array(Plugin::InternalUse iu, int32_t handle); - Array(std::nullptr_t n); + Array(decltype(nullptr) n); int32_t GetLength(); int32_t GetRank(); }; @@ -852,13 +849,13 @@ namespace System { struct Stopwatch : System::Object { - Stopwatch(std::nullptr_t n); + Stopwatch(decltype(nullptr) n); Stopwatch(Plugin::InternalUse iu, int32_t handle); Stopwatch(const Stopwatch& other); Stopwatch(Stopwatch&& other); virtual ~Stopwatch(); Stopwatch& operator=(const Stopwatch& other); - Stopwatch& operator=(std::nullptr_t other); + Stopwatch& operator=(decltype(nullptr) other); Stopwatch& operator=(Stopwatch&& other); bool operator==(const Stopwatch& other) const; bool operator!=(const Stopwatch& other) const; @@ -874,13 +871,13 @@ namespace UnityEngine { struct Object : System::Object { - Object(std::nullptr_t n); + Object(decltype(nullptr) n); Object(Plugin::InternalUse iu, int32_t handle); Object(const Object& other); Object(Object&& other); virtual ~Object(); Object& operator=(const Object& other); - Object& operator=(std::nullptr_t other); + Object& operator=(decltype(nullptr) other); Object& operator=(Object&& other); bool operator==(const Object& other) const; bool operator!=(const Object& other) const; @@ -895,13 +892,13 @@ namespace UnityEngine { struct GameObject : UnityEngine::Object { - GameObject(std::nullptr_t n); + GameObject(decltype(nullptr) n); GameObject(Plugin::InternalUse iu, int32_t handle); GameObject(const GameObject& other); GameObject(GameObject&& other); virtual ~GameObject(); GameObject& operator=(const GameObject& other); - GameObject& operator=(std::nullptr_t other); + GameObject& operator=(decltype(nullptr) other); GameObject& operator=(GameObject&& other); bool operator==(const GameObject& other) const; bool operator!=(const GameObject& other) const; @@ -916,13 +913,13 @@ namespace UnityEngine { struct Component : UnityEngine::Object { - Component(std::nullptr_t n); + Component(decltype(nullptr) n); Component(Plugin::InternalUse iu, int32_t handle); Component(const Component& other); Component(Component&& other); virtual ~Component(); Component& operator=(const Component& other); - Component& operator=(std::nullptr_t other); + Component& operator=(decltype(nullptr) other); Component& operator=(Component&& other); bool operator==(const Component& other) const; bool operator!=(const Component& other) const; @@ -934,13 +931,13 @@ namespace UnityEngine { struct Transform : UnityEngine::Component { - Transform(std::nullptr_t n); + Transform(decltype(nullptr) n); Transform(Plugin::InternalUse iu, int32_t handle); Transform(const Transform& other); Transform(Transform&& other); virtual ~Transform(); Transform& operator=(const Transform& other); - Transform& operator=(std::nullptr_t other); + Transform& operator=(decltype(nullptr) other); Transform& operator=(Transform&& other); bool operator==(const Transform& other) const; bool operator!=(const Transform& other) const; @@ -953,13 +950,13 @@ namespace UnityEngine { struct Debug : System::Object { - Debug(std::nullptr_t n); + Debug(decltype(nullptr) n); Debug(Plugin::InternalUse iu, int32_t handle); Debug(const Debug& other); Debug(Debug&& other); virtual ~Debug(); Debug& operator=(const Debug& other); - Debug& operator=(std::nullptr_t other); + Debug& operator=(decltype(nullptr) other); Debug& operator=(Debug&& other); bool operator==(const Debug& other) const; bool operator!=(const Debug& other) const; @@ -985,13 +982,13 @@ namespace UnityEngine { struct Collision : System::Object { - Collision(std::nullptr_t n); + Collision(decltype(nullptr) n); Collision(Plugin::InternalUse iu, int32_t handle); Collision(const Collision& other); Collision(Collision&& other); virtual ~Collision(); Collision& operator=(const Collision& other); - Collision& operator=(std::nullptr_t other); + Collision& operator=(decltype(nullptr) other); Collision& operator=(Collision&& other); bool operator==(const Collision& other) const; bool operator!=(const Collision& other) const; @@ -1002,13 +999,13 @@ namespace UnityEngine { struct Behaviour : UnityEngine::Component { - Behaviour(std::nullptr_t n); + Behaviour(decltype(nullptr) n); Behaviour(Plugin::InternalUse iu, int32_t handle); Behaviour(const Behaviour& other); Behaviour(Behaviour&& other); virtual ~Behaviour(); Behaviour& operator=(const Behaviour& other); - Behaviour& operator=(std::nullptr_t other); + Behaviour& operator=(decltype(nullptr) other); Behaviour& operator=(Behaviour&& other); bool operator==(const Behaviour& other) const; bool operator!=(const Behaviour& other) const; @@ -1019,13 +1016,13 @@ namespace UnityEngine { struct MonoBehaviour : UnityEngine::Behaviour { - MonoBehaviour(std::nullptr_t n); + MonoBehaviour(decltype(nullptr) n); MonoBehaviour(Plugin::InternalUse iu, int32_t handle); MonoBehaviour(const MonoBehaviour& other); MonoBehaviour(MonoBehaviour&& other); virtual ~MonoBehaviour(); MonoBehaviour& operator=(const MonoBehaviour& other); - MonoBehaviour& operator=(std::nullptr_t other); + MonoBehaviour& operator=(decltype(nullptr) other); MonoBehaviour& operator=(MonoBehaviour&& other); bool operator==(const MonoBehaviour& other) const; bool operator!=(const MonoBehaviour& other) const; @@ -1036,13 +1033,13 @@ namespace UnityEngine { struct AudioSettings : System::Object { - AudioSettings(std::nullptr_t n); + AudioSettings(decltype(nullptr) n); AudioSettings(Plugin::InternalUse iu, int32_t handle); AudioSettings(const AudioSettings& other); AudioSettings(AudioSettings&& other); virtual ~AudioSettings(); AudioSettings& operator=(const AudioSettings& other); - AudioSettings& operator=(std::nullptr_t other); + AudioSettings& operator=(decltype(nullptr) other); AudioSettings& operator=(AudioSettings&& other); bool operator==(const AudioSettings& other) const; bool operator!=(const AudioSettings& other) const; @@ -1056,13 +1053,13 @@ namespace UnityEngine { struct NetworkTransport : System::Object { - NetworkTransport(std::nullptr_t n); + NetworkTransport(decltype(nullptr) n); NetworkTransport(Plugin::InternalUse iu, int32_t handle); NetworkTransport(const NetworkTransport& other); NetworkTransport(NetworkTransport&& other); virtual ~NetworkTransport(); NetworkTransport& operator=(const NetworkTransport& other); - NetworkTransport& operator=(std::nullptr_t other); + NetworkTransport& operator=(decltype(nullptr) other); NetworkTransport& operator=(NetworkTransport&& other); bool operator==(const NetworkTransport& other) const; bool operator!=(const NetworkTransport& other) const; @@ -1118,13 +1115,13 @@ namespace UnityEngine { struct RaycastHit : System::ValueType { - RaycastHit(std::nullptr_t n); + RaycastHit(decltype(nullptr) n); RaycastHit(Plugin::InternalUse iu, int32_t handle); RaycastHit(const RaycastHit& other); RaycastHit(RaycastHit&& other); virtual ~RaycastHit(); RaycastHit& operator=(const RaycastHit& other); - RaycastHit& operator=(std::nullptr_t other); + RaycastHit& operator=(decltype(nullptr) other); RaycastHit& operator=(RaycastHit&& other); bool operator==(const RaycastHit& other) const; bool operator!=(const RaycastHit& other) const; @@ -1142,13 +1139,13 @@ namespace System { template<> struct KeyValuePair : System::ValueType { - KeyValuePair(std::nullptr_t n); + KeyValuePair(decltype(nullptr) n); KeyValuePair(Plugin::InternalUse iu, int32_t handle); KeyValuePair(const KeyValuePair& other); KeyValuePair(KeyValuePair&& other); virtual ~KeyValuePair(); KeyValuePair& operator=(const KeyValuePair& other); - KeyValuePair& operator=(std::nullptr_t other); + KeyValuePair& operator=(decltype(nullptr) other); KeyValuePair& operator=(KeyValuePair&& other); bool operator==(const KeyValuePair& other) const; bool operator!=(const KeyValuePair& other) const; @@ -1168,13 +1165,13 @@ namespace System { template<> struct List : System::Object { - List(std::nullptr_t n); + List(decltype(nullptr) n); List(Plugin::InternalUse iu, int32_t handle); List(const List& other); List(List&& other); virtual ~List(); List& operator=(const List& other); - List& operator=(std::nullptr_t other); + List& operator=(decltype(nullptr) other); List& operator=(List&& other); bool operator==(const List& other) const; bool operator!=(const List& other) const; @@ -1196,13 +1193,13 @@ namespace System { template<> struct List : System::Object { - List(std::nullptr_t n); + List(decltype(nullptr) n); List(Plugin::InternalUse iu, int32_t handle); List(const List& other); List(List&& other); virtual ~List(); List& operator=(const List& other); - List& operator=(std::nullptr_t other); + List& operator=(decltype(nullptr) other); List& operator=(List&& other); bool operator==(const List& other) const; bool operator!=(const List& other) const; @@ -1224,13 +1221,13 @@ namespace System { template<> struct LinkedListNode : System::Object { - LinkedListNode(std::nullptr_t n); + LinkedListNode(decltype(nullptr) n); LinkedListNode(Plugin::InternalUse iu, int32_t handle); LinkedListNode(const LinkedListNode& other); LinkedListNode(LinkedListNode&& other); virtual ~LinkedListNode(); LinkedListNode& operator=(const LinkedListNode& other); - LinkedListNode& operator=(std::nullptr_t other); + LinkedListNode& operator=(decltype(nullptr) other); LinkedListNode& operator=(LinkedListNode&& other); bool operator==(const LinkedListNode& other) const; bool operator!=(const LinkedListNode& other) const; @@ -1250,13 +1247,13 @@ namespace System { template<> struct StrongBox : System::Object { - StrongBox(std::nullptr_t n); + StrongBox(decltype(nullptr) n); StrongBox(Plugin::InternalUse iu, int32_t handle); StrongBox(const StrongBox& other); StrongBox(StrongBox&& other); virtual ~StrongBox(); StrongBox& operator=(const StrongBox& other); - StrongBox& operator=(std::nullptr_t other); + StrongBox& operator=(decltype(nullptr) other); StrongBox& operator=(StrongBox&& other); bool operator==(const StrongBox& other) const; bool operator!=(const StrongBox& other) const; @@ -1276,13 +1273,13 @@ namespace System { template<> struct Collection : System::Object { - Collection(std::nullptr_t n); + Collection(decltype(nullptr) n); Collection(Plugin::InternalUse iu, int32_t handle); Collection(const Collection& other); Collection(Collection&& other); virtual ~Collection(); Collection& operator=(const Collection& other); - Collection& operator=(std::nullptr_t other); + Collection& operator=(decltype(nullptr) other); Collection& operator=(Collection&& other); bool operator==(const Collection& other) const; bool operator!=(const Collection& other) const; @@ -1299,13 +1296,13 @@ namespace System { template<> struct KeyedCollection : System::Collections::ObjectModel::Collection { - KeyedCollection(std::nullptr_t n); + KeyedCollection(decltype(nullptr) n); KeyedCollection(Plugin::InternalUse iu, int32_t handle); KeyedCollection(const KeyedCollection& other); KeyedCollection(KeyedCollection&& other); virtual ~KeyedCollection(); KeyedCollection& operator=(const KeyedCollection& other); - KeyedCollection& operator=(std::nullptr_t other); + KeyedCollection& operator=(decltype(nullptr) other); KeyedCollection& operator=(KeyedCollection&& other); bool operator==(const KeyedCollection& other) const; bool operator!=(const KeyedCollection& other) const; @@ -1318,13 +1315,13 @@ namespace System { struct Exception : System::Object { - Exception(std::nullptr_t n); + Exception(decltype(nullptr) n); Exception(Plugin::InternalUse iu, int32_t handle); Exception(const Exception& other); Exception(Exception&& other); virtual ~Exception(); Exception& operator=(const Exception& other); - Exception& operator=(std::nullptr_t other); + Exception& operator=(decltype(nullptr) other); Exception& operator=(Exception&& other); bool operator==(const Exception& other) const; bool operator!=(const Exception& other) const; @@ -1336,13 +1333,13 @@ namespace System { struct SystemException : System::Exception { - SystemException(std::nullptr_t n); + SystemException(decltype(nullptr) n); SystemException(Plugin::InternalUse iu, int32_t handle); SystemException(const SystemException& other); SystemException(SystemException&& other); virtual ~SystemException(); SystemException& operator=(const SystemException& other); - SystemException& operator=(std::nullptr_t other); + SystemException& operator=(decltype(nullptr) other); SystemException& operator=(SystemException&& other); bool operator==(const SystemException& other) const; bool operator!=(const SystemException& other) const; @@ -1353,13 +1350,13 @@ namespace System { struct NullReferenceException : System::SystemException { - NullReferenceException(std::nullptr_t n); + NullReferenceException(decltype(nullptr) n); NullReferenceException(Plugin::InternalUse iu, int32_t handle); NullReferenceException(const NullReferenceException& other); NullReferenceException(NullReferenceException&& other); virtual ~NullReferenceException(); NullReferenceException& operator=(const NullReferenceException& other); - NullReferenceException& operator=(std::nullptr_t other); + NullReferenceException& operator=(decltype(nullptr) other); NullReferenceException& operator=(NullReferenceException&& other); bool operator==(const NullReferenceException& other) const; bool operator!=(const NullReferenceException& other) const; @@ -1387,13 +1384,13 @@ namespace UnityEngine { struct Screen : System::Object { - Screen(std::nullptr_t n); + Screen(decltype(nullptr) n); Screen(Plugin::InternalUse iu, int32_t handle); Screen(const Screen& other); Screen(Screen&& other); virtual ~Screen(); Screen& operator=(const Screen& other); - Screen& operator=(std::nullptr_t other); + Screen& operator=(decltype(nullptr) other); Screen& operator=(Screen&& other); bool operator==(const Screen& other) const; bool operator!=(const Screen& other) const; @@ -1416,13 +1413,13 @@ namespace UnityEngine { struct Physics : System::Object { - Physics(std::nullptr_t n); + Physics(decltype(nullptr) n); Physics(Plugin::InternalUse iu, int32_t handle); Physics(const Physics& other); Physics(Physics&& other); virtual ~Physics(); Physics& operator=(const Physics& other); - Physics& operator=(std::nullptr_t other); + Physics& operator=(decltype(nullptr) other); Physics& operator=(Physics&& other); bool operator==(const Physics& other) const; bool operator!=(const Physics& other) const; @@ -1457,13 +1454,13 @@ namespace UnityEngine { struct Gradient : System::Object { - Gradient(std::nullptr_t n); + Gradient(decltype(nullptr) n); Gradient(Plugin::InternalUse iu, int32_t handle); Gradient(const Gradient& other); Gradient(Gradient&& other); virtual ~Gradient(); Gradient& operator=(const Gradient& other); - Gradient& operator=(std::nullptr_t other); + Gradient& operator=(decltype(nullptr) other); Gradient& operator=(Gradient&& other); bool operator==(const Gradient& other) const; bool operator!=(const Gradient& other) const; @@ -1477,13 +1474,13 @@ namespace System { struct AppDomainSetup : System::Object { - AppDomainSetup(std::nullptr_t n); + AppDomainSetup(decltype(nullptr) n); AppDomainSetup(Plugin::InternalUse iu, int32_t handle); AppDomainSetup(const AppDomainSetup& other); AppDomainSetup(AppDomainSetup&& other); virtual ~AppDomainSetup(); AppDomainSetup& operator=(const AppDomainSetup& other); - AppDomainSetup& operator=(std::nullptr_t other); + AppDomainSetup& operator=(decltype(nullptr) other); AppDomainSetup& operator=(AppDomainSetup&& other); bool operator==(const AppDomainSetup& other) const; bool operator!=(const AppDomainSetup& other) const; @@ -1497,13 +1494,13 @@ namespace UnityEngine { struct Application : System::Object { - Application(std::nullptr_t n); + Application(decltype(nullptr) n); Application(Plugin::InternalUse iu, int32_t handle); Application(const Application& other); Application(Application&& other); virtual ~Application(); Application& operator=(const Application& other); - Application& operator=(std::nullptr_t other); + Application& operator=(decltype(nullptr) other); Application& operator=(Application&& other); bool operator==(const Application& other) const; bool operator!=(const Application& other) const; @@ -1518,13 +1515,13 @@ namespace UnityEngine { struct SceneManager : System::Object { - SceneManager(std::nullptr_t n); + SceneManager(decltype(nullptr) n); SceneManager(Plugin::InternalUse iu, int32_t handle); SceneManager(const SceneManager& other); SceneManager(SceneManager&& other); virtual ~SceneManager(); SceneManager& operator=(const SceneManager& other); - SceneManager& operator=(std::nullptr_t other); + SceneManager& operator=(decltype(nullptr) other); SceneManager& operator=(SceneManager&& other); bool operator==(const SceneManager& other) const; bool operator!=(const SceneManager& other) const; @@ -1554,13 +1551,13 @@ namespace System { template<> struct IComparer : System::Object { - IComparer(std::nullptr_t n); + IComparer(decltype(nullptr) n); IComparer(Plugin::InternalUse iu, int32_t handle); IComparer(const IComparer& other); IComparer(IComparer&& other); virtual ~IComparer(); IComparer& operator=(const IComparer& other); - IComparer& operator=(std::nullptr_t other); + IComparer& operator=(decltype(nullptr) other); IComparer& operator=(IComparer&& other); bool operator==(const IComparer& other) const; bool operator!=(const IComparer& other) const; @@ -1580,13 +1577,13 @@ namespace System { template<> struct IComparer : System::Object { - IComparer(std::nullptr_t n); + IComparer(decltype(nullptr) n); IComparer(Plugin::InternalUse iu, int32_t handle); IComparer(const IComparer& other); IComparer(IComparer&& other); virtual ~IComparer(); IComparer& operator=(const IComparer& other); - IComparer& operator=(std::nullptr_t other); + IComparer& operator=(decltype(nullptr) other); IComparer& operator=(IComparer&& other); bool operator==(const IComparer& other) const; bool operator!=(const IComparer& other) const; @@ -1602,13 +1599,13 @@ namespace System { struct StringComparer : System::Object { - StringComparer(std::nullptr_t n); + StringComparer(decltype(nullptr) n); StringComparer(Plugin::InternalUse iu, int32_t handle); StringComparer(const StringComparer& other); StringComparer(StringComparer&& other); virtual ~StringComparer(); StringComparer& operator=(const StringComparer& other); - StringComparer& operator=(std::nullptr_t other); + StringComparer& operator=(decltype(nullptr) other); StringComparer& operator=(StringComparer&& other); bool operator==(const StringComparer& other) const; bool operator!=(const StringComparer& other) const; @@ -1624,13 +1621,13 @@ namespace System { struct EventArgs : System::Object { - EventArgs(std::nullptr_t n); + EventArgs(decltype(nullptr) n); EventArgs(Plugin::InternalUse iu, int32_t handle); EventArgs(const EventArgs& other); EventArgs(EventArgs&& other); virtual ~EventArgs(); EventArgs& operator=(const EventArgs& other); - EventArgs& operator=(std::nullptr_t other); + EventArgs& operator=(decltype(nullptr) other); EventArgs& operator=(EventArgs&& other); bool operator==(const EventArgs& other) const; bool operator!=(const EventArgs& other) const; @@ -1646,13 +1643,13 @@ namespace MyGame { struct TestScript : UnityEngine::MonoBehaviour { - TestScript(std::nullptr_t n); + TestScript(decltype(nullptr) n); TestScript(Plugin::InternalUse iu, int32_t handle); TestScript(const TestScript& other); TestScript(TestScript&& other); virtual ~TestScript(); TestScript& operator=(const TestScript& other); - TestScript& operator=(std::nullptr_t other); + TestScript& operator=(decltype(nullptr) other); TestScript& operator=(TestScript&& other); bool operator==(const TestScript& other) const; bool operator!=(const TestScript& other) const; @@ -1680,13 +1677,13 @@ namespace System { template<> struct Array1 : System::Array { - Array1(std::nullptr_t n); + Array1(decltype(nullptr) n); Array1(Plugin::InternalUse iu, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); Array1& operator=(const Array1& other); - Array1& operator=(std::nullptr_t other); + Array1& operator=(decltype(nullptr) other); Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; @@ -1774,13 +1771,13 @@ namespace System { template<> struct Array1 : System::Array { - Array1(std::nullptr_t n); + Array1(decltype(nullptr) n); Array1(Plugin::InternalUse iu, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); Array1& operator=(const Array1& other); - Array1& operator=(std::nullptr_t other); + Array1& operator=(decltype(nullptr) other); Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; @@ -1795,13 +1792,13 @@ namespace System { template<> struct Array2 : System::Array { - Array2(std::nullptr_t n); + Array2(decltype(nullptr) n); Array2(Plugin::InternalUse iu, int32_t handle); Array2(const Array2& other); Array2(Array2&& other); virtual ~Array2(); Array2& operator=(const Array2& other); - Array2& operator=(std::nullptr_t other); + Array2& operator=(decltype(nullptr) other); Array2& operator=(Array2&& other); bool operator==(const Array2& other) const; bool operator!=(const Array2& other) const; @@ -1817,13 +1814,13 @@ namespace System { template<> struct Array3 : System::Array { - Array3(std::nullptr_t n); + Array3(decltype(nullptr) n); Array3(Plugin::InternalUse iu, int32_t handle); Array3(const Array3& other); Array3(Array3&& other); virtual ~Array3(); Array3& operator=(const Array3& other); - Array3& operator=(std::nullptr_t other); + Array3& operator=(decltype(nullptr) other); Array3& operator=(Array3&& other); bool operator==(const Array3& other) const; bool operator!=(const Array3& other) const; @@ -1851,13 +1848,13 @@ namespace System { template<> struct Array1 : System::Array { - Array1(std::nullptr_t n); + Array1(decltype(nullptr) n); Array1(Plugin::InternalUse iu, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); Array1& operator=(const Array1& other); - Array1& operator=(std::nullptr_t other); + Array1& operator=(decltype(nullptr) other); Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; @@ -1884,13 +1881,13 @@ namespace System { template<> struct Array1 : System::Array { - Array1(std::nullptr_t n); + Array1(decltype(nullptr) n); Array1(Plugin::InternalUse iu, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); Array1& operator=(const Array1& other); - Array1& operator=(std::nullptr_t other); + Array1& operator=(decltype(nullptr) other); Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; @@ -1917,13 +1914,13 @@ namespace System { template<> struct Array1 : System::Array { - Array1(std::nullptr_t n); + Array1(decltype(nullptr) n); Array1(Plugin::InternalUse iu, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); Array1& operator=(const Array1& other); - Array1& operator=(std::nullptr_t other); + Array1& operator=(decltype(nullptr) other); Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; @@ -1950,13 +1947,13 @@ namespace System { template<> struct Array1 : System::Array { - Array1(std::nullptr_t n); + Array1(decltype(nullptr) n); Array1(Plugin::InternalUse iu, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); Array1& operator=(const Array1& other); - Array1& operator=(std::nullptr_t other); + Array1& operator=(decltype(nullptr) other); Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; @@ -1971,13 +1968,13 @@ namespace System { struct Action : System::Object { - Action(std::nullptr_t n); + Action(decltype(nullptr) n); Action(Plugin::InternalUse iu, int32_t handle); Action(const Action& other); Action(Action&& other); virtual ~Action(); Action& operator=(const Action& other); - Action& operator=(std::nullptr_t other); + Action& operator=(decltype(nullptr) other); Action& operator=(Action&& other); bool operator==(const Action& other) const; bool operator!=(const Action& other) const; @@ -1995,13 +1992,13 @@ namespace System { template<> struct Action1 : System::Object { - Action1(std::nullptr_t n); + Action1(decltype(nullptr) n); Action1(Plugin::InternalUse iu, int32_t handle); Action1(const Action1& other); Action1(Action1&& other); virtual ~Action1(); Action1& operator=(const Action1& other); - Action1& operator=(std::nullptr_t other); + Action1& operator=(decltype(nullptr) other); Action1& operator=(Action1&& other); bool operator==(const Action1& other) const; bool operator!=(const Action1& other) const; @@ -2019,13 +2016,13 @@ namespace System { template<> struct Action2 : System::Object { - Action2(std::nullptr_t n); + Action2(decltype(nullptr) n); Action2(Plugin::InternalUse iu, int32_t handle); Action2(const Action2& other); Action2(Action2&& other); virtual ~Action2(); Action2& operator=(const Action2& other); - Action2& operator=(std::nullptr_t other); + Action2& operator=(decltype(nullptr) other); Action2& operator=(Action2&& other); bool operator==(const Action2& other) const; bool operator!=(const Action2& other) const; @@ -2043,13 +2040,13 @@ namespace System { template<> struct Func3 : System::Object { - Func3(std::nullptr_t n); + Func3(decltype(nullptr) n); Func3(Plugin::InternalUse iu, int32_t handle); Func3(const Func3& other); Func3(Func3&& other); virtual ~Func3(); Func3& operator=(const Func3& other); - Func3& operator=(std::nullptr_t other); + Func3& operator=(decltype(nullptr) other); Func3& operator=(Func3&& other); bool operator==(const Func3& other) const; bool operator!=(const Func3& other) const; @@ -2067,13 +2064,13 @@ namespace System { template<> struct Func3 : System::Object { - Func3(std::nullptr_t n); + Func3(decltype(nullptr) n); Func3(Plugin::InternalUse iu, int32_t handle); Func3(const Func3& other); Func3(Func3&& other); virtual ~Func3(); Func3& operator=(const Func3& other); - Func3& operator=(std::nullptr_t other); + Func3& operator=(decltype(nullptr) other); Func3& operator=(Func3&& other); bool operator==(const Func3& other) const; bool operator!=(const Func3& other) const; @@ -2091,13 +2088,13 @@ namespace System { struct AppDomainInitializer : System::Object { - AppDomainInitializer(std::nullptr_t n); + AppDomainInitializer(decltype(nullptr) n); AppDomainInitializer(Plugin::InternalUse iu, int32_t handle); AppDomainInitializer(const AppDomainInitializer& other); AppDomainInitializer(AppDomainInitializer&& other); virtual ~AppDomainInitializer(); AppDomainInitializer& operator=(const AppDomainInitializer& other); - AppDomainInitializer& operator=(std::nullptr_t other); + AppDomainInitializer& operator=(decltype(nullptr) other); AppDomainInitializer& operator=(AppDomainInitializer&& other); bool operator==(const AppDomainInitializer& other) const; bool operator!=(const AppDomainInitializer& other) const; @@ -2117,13 +2114,13 @@ namespace UnityEngine { struct UnityAction : System::Object { - UnityAction(std::nullptr_t n); + UnityAction(decltype(nullptr) n); UnityAction(Plugin::InternalUse iu, int32_t handle); UnityAction(const UnityAction& other); UnityAction(UnityAction&& other); virtual ~UnityAction(); UnityAction& operator=(const UnityAction& other); - UnityAction& operator=(std::nullptr_t other); + UnityAction& operator=(decltype(nullptr) other); UnityAction& operator=(UnityAction&& other); bool operator==(const UnityAction& other) const; bool operator!=(const UnityAction& other) const; @@ -2144,13 +2141,13 @@ namespace UnityEngine { template<> struct UnityAction2 : System::Object { - UnityAction2(std::nullptr_t n); + UnityAction2(decltype(nullptr) n); UnityAction2(Plugin::InternalUse iu, int32_t handle); UnityAction2(const UnityAction2& other); UnityAction2(UnityAction2&& other); virtual ~UnityAction2(); UnityAction2& operator=(const UnityAction2& other); - UnityAction2& operator=(std::nullptr_t other); + UnityAction2& operator=(decltype(nullptr) other); UnityAction2& operator=(UnityAction2&& other); bool operator==(const UnityAction2& other) const; bool operator!=(const UnityAction2& other) const; From ffe00cf5cc1bdae3f2e70d08ae808d6664e3e280 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 19 Nov 2017 11:12:07 -0800 Subject: [PATCH 37/95] Cache array lengths and rank in C++ --- .../NativeScript/Editor/GenerateBindings.cs | 295 +++++++++++++--- Unity/CppSource/NativeScript/Bindings.cpp | 321 +++++++++++++++++- Unity/CppSource/NativeScript/Bindings.h | 18 + 3 files changed, 574 insertions(+), 60 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index c252acd..d68fa90 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -1475,6 +1475,8 @@ static void AppendType( baseType.Namespace, baseType.GetGenericArguments(), isStatic, + (extraIndent, subject) => {}, + (extraIndent, subject) => {}, indent, builders.CppMethodDefinitions); @@ -3665,6 +3667,8 @@ static void AppendMonoBehaviour( "UnityEngine", null, false, + (extraIndent, subject) => {}, + (extraIndent, subject) => {}, cppIndent, builders.CppMethodDefinitions); AppendCppMethodDefinitionsEnd( @@ -4152,9 +4156,98 @@ static void AppendArray( "System", null, false, + (extraIndent, subject) => { + AppendIndent( + extraIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(subject); + builders.CppMethodDefinitions.Append( + "InternalLength = 0;\n"); + AppendIndent( + extraIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(subject); + builders.CppMethodDefinitions.Append( + "InternalRank = 0;\n"); + if (rank > 1) + { + for (int i = 0; i < rank; ++i) + { + AppendIndent( + extraIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(subject); + builders.CppMethodDefinitions.Append( + "InternalLengths["); + builders.CppMethodDefinitions.Append(i); + builders.CppMethodDefinitions.Append( + "] = 0;\n"); + } + } + }, + (extraIndent, subject) => { + AppendIndent( + extraIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "InternalLength = "); + builders.CppMethodDefinitions.Append(subject); + builders.CppMethodDefinitions.Append( + "InternalLength;\n"); + AppendIndent( + extraIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "InternalRank = "); + builders.CppMethodDefinitions.Append(subject); + builders.CppMethodDefinitions.Append( + "InternalRank;\n"); + if (rank > 1) + { + for (int i = 0; i < rank; ++i) + { + AppendIndent( + extraIndent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "InternalLengths["); + builders.CppMethodDefinitions.Append(i); + builders.CppMethodDefinitions.Append( + "] = "); + builders.CppMethodDefinitions.Append(subject); + builders.CppMethodDefinitions.Append( + "InternalLengths["); + builders.CppMethodDefinitions.Append(i); + builders.CppMethodDefinitions.Append( + "];\n"); + } + } + }, indent, builders.CppMethodDefinitions); + // C++ fields + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append( + "int32_t InternalLength;\n"); + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append( + "int32_t InternalRank;\n"); + if (rank > 1) + { + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append( + "int32_t InternalLengths["); + builders.CppTypeDefinitions.Append(rank); + builders.CppTypeDefinitions.Append("];\n"); + } + AppendArrayConstructor( elementType, arrayType, @@ -4169,13 +4262,14 @@ static void AppendArray( indent, cppArrayTypeName, "GetLength", + "InternalLength", cppTypeParams, builders); // GetLength for multi-dimensional arrays if (rank > 1) { - AppendArrayGetLength( + AppendArrayMultidimensionalGetLength( elementType, arrayType, cppArrayTypeName, @@ -4189,6 +4283,7 @@ static void AppendArray( indent, cppArrayTypeName, "GetRank", + "InternalRank", cppTypeParams, builders); @@ -4923,6 +5018,42 @@ static void AppendArrayConstructor( "returnValue", builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append(";\n"); + if (rank > 1) + { + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("InternalLength = "); + for (int i = 0; i < rank; ++i) + { + builders.CppMethodDefinitions.Append("length"); + builders.CppMethodDefinitions.Append(i); + if (i != rank - 1) + { + builders.CppMethodDefinitions.Append(" * "); + } + } + builders.CppMethodDefinitions.Append(";\n"); + for (int i = 0; i < rank; ++i) + { + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("InternalLengths["); + builders.CppMethodDefinitions.Append(i); + builders.CppMethodDefinitions.Append("] = length"); + builders.CppMethodDefinitions.Append(i); + builders.CppMethodDefinitions.Append(";\n"); + } + } + else + { + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "InternalLength = length0;\n"); + } AppendIndent( indent + 1, builders.CppMethodDefinitions); @@ -4942,9 +5073,9 @@ static void AppendArrayCppCallBaseGetIntFunction( int indent, string cppArrayTypeName, string baseFunctionName, + string memberVariableName, Type[] cppTypeParams, - StringBuilders builders - ) + StringBuilders builders) { ParameterInfo[] parameters = new ParameterInfo[0]; @@ -4972,19 +5103,54 @@ StringBuilders builders parameters, indent, builders.CppMethodDefinitions); - AppendIndent(indent, builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("{\n"); - AppendIndent(indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("return Array::"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("int32_t returnVal = "); + builders.CppMethodDefinitions.Append(memberVariableName); + builders.CppMethodDefinitions.Append(";\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("if (returnVal == 0)\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("returnVal = Array::"); builders.CppMethodDefinitions.Append(baseFunctionName); builders.CppMethodDefinitions.Append("();\n"); - AppendIndent(indent, builders.CppMethodDefinitions); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(memberVariableName); + builders.CppMethodDefinitions.Append(" = returnVal;\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("};\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("return returnVal;\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("}\n"); - AppendIndent(indent, builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append('\n'); } - static void AppendArrayGetLength( + static void AppendArrayMultidimensionalGetLength( Type elementType, Type arrayType, string cppArrayTypeName, @@ -5112,8 +5278,30 @@ static void AppendArrayGetLength( parameters, indent, builders.CppMethodDefinitions); - AppendIndent(indent, builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("int32_t length = InternalLengths[dimension];\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("if (length)\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("return length;\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); AppendCppPluginFunctionCall( false, cppArrayTypeName, @@ -5125,14 +5313,23 @@ static void AppendArrayGetLength( parameters, indent + 1, builders.CppMethodDefinitions); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "InternalLengths[dimension] = returnValue;\n"); AppendCppMethodReturn( typeof(int), TypeKind.Primitive, indent + 1, builders.CppMethodDefinitions); - AppendIndent(indent, builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("}\n"); - AppendIndent(indent, builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append('\n'); } @@ -9117,7 +9314,7 @@ static void AppendCppTypeDefinitionBegin( { case TypeKind.Class: case TypeKind.ManagedStruct: - // Constructor from nullptr_t + // Constructor from nullptr AppendIndent(indent + 1, output); AppendTypeNameWithoutGenericSuffix( typeName, @@ -9200,7 +9397,7 @@ static void AppendCppTypeDefinitionBegin( output); output.Append("& other);\n"); - // Assignment operator to nullptr_t + // Assignment operator to nullptr AppendIndent(indent + 1, output); AppendTypeNameWithoutGenericSuffix( typeName, @@ -9282,6 +9479,8 @@ static int AppendCppMethodDefinitionsBegin( string baseTypeNamespace, Type[] baseTypeTypeParams, bool isStatic, + Action extraDefault, + Action extraCopy, int indent, StringBuilder output) { @@ -9298,7 +9497,7 @@ static int AppendCppMethodDefinitionsBegin( baseTypeNamespace = "System"; } - // Construct with nullptr_t + // Construct with nullptr AppendIndent(indent, output); AppendTypeNameWithoutGenericSuffix( enclosingTypeName, @@ -9319,11 +9518,13 @@ static int AppendCppMethodDefinitionsBegin( output.Append("(Plugin::InternalUse::Only, 0)\n"); AppendIndent(indent, output); output.Append("{\n"); + extraDefault(indent + 1, "this->"); AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); output.Append("\n"); + // Handle constructor AppendIndent(indent, output); AppendTypeNameWithoutGenericSuffix( enclosingTypeName, @@ -9363,6 +9564,7 @@ static int AppendCppMethodDefinitionsBegin( output.Append(";\n"); AppendIndent(indent + 1, output); output.Append("}\n"); + extraDefault(indent + 1, "this->"); AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); @@ -9396,6 +9598,7 @@ static int AppendCppMethodDefinitionsBegin( output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent(indent, output); output.Append("{\n"); + extraCopy(indent + 1, "other."); AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); @@ -9431,11 +9634,14 @@ static int AppendCppMethodDefinitionsBegin( output.Append("{\n"); AppendIndent(indent + 1, output); output.Append("other.Handle = 0;\n"); + extraCopy(indent + 1, "other."); + extraDefault(indent + 1, "other."); AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); output.Append("\n"); + // Destructor AppendIndent(indent, output); AppendTypeNameWithoutGenericSuffix( enclosingTypeName, @@ -9509,14 +9715,15 @@ static int AppendCppMethodDefinitionsBegin( "this", "other.Handle", output); - AppendIndent(indent, output); - output.Append("\treturn *this;\n"); + extraCopy(indent + 1, "other."); + AppendIndent(indent + 1, output); + output.Append("return *this;\n"); AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); output.Append("\n"); - // Assignment operator to nullptr_t + // Assignment operator to nullptr AppendIndent(indent, output); AppendTypeNameWithoutGenericSuffix( enclosingTypeName, @@ -9534,12 +9741,11 @@ static int AppendCppMethodDefinitionsBegin( output.Append("::operator=(decltype(nullptr) other)\n"); AppendIndent(indent, output); output.Append("{\n"); - AppendIndent(indent, output); - output.Append("\tif (Handle)\n"); - AppendIndent(indent, output); - output.Append("\t{\n"); - AppendIndent(indent, output); - output.Append("\t\t"); + AppendIndent(indent + 1, output); + output.Append("if (Handle)\n"); + AppendIndent(indent + 1, output); + output.Append("{\n"); + AppendIndent(indent + 2, output); AppendDereferenceManagedHandleFunctionCall( enclosingTypeName, enclosingTypeNamespace, @@ -9548,12 +9754,12 @@ static int AppendCppMethodDefinitionsBegin( "Handle", output); output.Append(";\n"); - AppendIndent(indent, output); - output.Append("\t\tHandle = 0;\n"); - AppendIndent(indent, output); - output.Append("\t}\n"); - AppendIndent(indent, output); - output.Append("\treturn *this;\n"); + AppendIndent(indent + 2, output); + output.Append("Handle = 0;\n"); + AppendIndent(indent + 1, output); + output.Append("}\n"); + AppendIndent(indent + 1, output); + output.Append("return *this;\n"); AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); @@ -9584,12 +9790,11 @@ static int AppendCppMethodDefinitionsBegin( output.Append("&& other)\n"); AppendIndent(indent, output); output.Append("{\n"); - AppendIndent(indent, output); - output.Append("\tif (Handle)\n"); - AppendIndent(indent, output); - output.Append("\t{\n"); - AppendIndent(indent, output); - output.Append("\t\t"); + AppendIndent(indent + 1, output); + output.Append("if (Handle)\n"); + AppendIndent(indent + 1, output); + output.Append("{\n"); + AppendIndent(indent + 2, output); AppendDereferenceManagedHandleFunctionCall( enclosingTypeName, enclosingTypeNamespace, @@ -9598,14 +9803,16 @@ static int AppendCppMethodDefinitionsBegin( "Handle", output); output.Append(";\n"); - AppendIndent(indent, output); - output.Append("\t}\n"); - AppendIndent(indent, output); - output.Append("\tHandle = other.Handle;\n"); - AppendIndent(indent, output); - output.Append("\tother.Handle = 0;\n"); - AppendIndent(indent, output); - output.Append("\treturn *this;\n"); + AppendIndent(indent + 1, output); + output.Append("}\n"); + AppendIndent(indent + 1, output); + output.Append("Handle = other.Handle;\n"); + extraCopy(indent + 1, "other."); + AppendIndent(indent + 1, output); + output.Append("other.Handle = 0;\n"); + extraDefault(indent + 1, "other."); + AppendIndent(indent + 1, output); + output.Append("return *this;\n"); AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index b0b52df..7dc8191 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -5839,6 +5839,8 @@ namespace System Array1::Array1(decltype(nullptr) n) : Array1(Plugin::InternalUse::Only, 0) { + this->InternalLength = 0; + this->InternalRank = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) @@ -5848,17 +5850,25 @@ namespace System { Plugin::ReferenceManagedClass(handle); } + this->InternalLength = 0; + this->InternalRank = 0; } Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; } Array1::Array1(Array1&& other) : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; + other.InternalLength = 0; + other.InternalRank = 0; } Array1::~Array1() @@ -5881,6 +5891,8 @@ namespace System { Plugin::ReferenceManagedClass(this->Handle); } + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; return *this; } @@ -5901,7 +5913,11 @@ namespace System Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; other.Handle = 0; + other.InternalLength = 0; + other.InternalRank = 0; return *this; } @@ -5930,17 +5946,30 @@ namespace System if (returnValue) { Plugin::ReferenceManagedClass(returnValue); + InternalLength = length0; } } int32_t Array1::GetLength() { - return Array::GetLength(); + int32_t returnVal = InternalLength; + if (returnVal == 0) + { + returnVal = Array::GetLength(); + InternalLength = returnVal; + }; + return returnVal; } int32_t Array1::GetRank() { - return Array::GetRank(); + int32_t returnVal = InternalRank; + if (returnVal == 0) + { + returnVal = Array::GetRank(); + InternalRank = returnVal; + }; + return returnVal; } Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) @@ -6102,6 +6131,8 @@ namespace System Array1::Array1(decltype(nullptr) n) : Array1(Plugin::InternalUse::Only, 0) { + this->InternalLength = 0; + this->InternalRank = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) @@ -6111,17 +6142,25 @@ namespace System { Plugin::ReferenceManagedClass(handle); } + this->InternalLength = 0; + this->InternalRank = 0; } Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; } Array1::Array1(Array1&& other) : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; + other.InternalLength = 0; + other.InternalRank = 0; } Array1::~Array1() @@ -6144,6 +6183,8 @@ namespace System { Plugin::ReferenceManagedClass(this->Handle); } + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; return *this; } @@ -6164,7 +6205,11 @@ namespace System Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; other.Handle = 0; + other.InternalLength = 0; + other.InternalRank = 0; return *this; } @@ -6193,17 +6238,30 @@ namespace System if (returnValue) { Plugin::ReferenceManagedClass(returnValue); + InternalLength = length0; } } int32_t Array1::GetLength() { - return Array::GetLength(); + int32_t returnVal = InternalLength; + if (returnVal == 0) + { + returnVal = Array::GetLength(); + InternalLength = returnVal; + }; + return returnVal; } int32_t Array1::GetRank() { - return Array::GetRank(); + int32_t returnVal = InternalRank; + if (returnVal == 0) + { + returnVal = Array::GetRank(); + InternalRank = returnVal; + }; + return returnVal; } Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) @@ -6217,6 +6275,10 @@ namespace System Array2::Array2(decltype(nullptr) n) : Array2(Plugin::InternalUse::Only, 0) { + this->InternalLength = 0; + this->InternalRank = 0; + this->InternalLengths[0] = 0; + this->InternalLengths[1] = 0; } Array2::Array2(Plugin::InternalUse iu, int32_t handle) @@ -6226,17 +6288,33 @@ namespace System { Plugin::ReferenceManagedClass(handle); } + this->InternalLength = 0; + this->InternalRank = 0; + this->InternalLengths[0] = 0; + this->InternalLengths[1] = 0; } Array2::Array2(const Array2& other) : Array2(Plugin::InternalUse::Only, other.Handle) { + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; } Array2::Array2(Array2&& other) : Array2(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; + other.InternalLength = 0; + other.InternalRank = 0; + other.InternalLengths[0] = 0; + other.InternalLengths[1] = 0; } Array2::~Array2() @@ -6259,6 +6337,10 @@ namespace System { Plugin::ReferenceManagedClass(this->Handle); } + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; return *this; } @@ -6279,7 +6361,15 @@ namespace System Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; other.Handle = 0; + other.InternalLength = 0; + other.InternalRank = 0; + other.InternalLengths[0] = 0; + other.InternalLengths[1] = 0; return *this; } @@ -6308,16 +6398,30 @@ namespace System if (returnValue) { Plugin::ReferenceManagedClass(returnValue); + InternalLength = length0 * length1; + InternalLengths[0] = length0; + InternalLengths[1] = length1; } } int32_t Array2::GetLength() { - return Array::GetLength(); + int32_t returnVal = InternalLength; + if (returnVal == 0) + { + returnVal = Array::GetLength(); + InternalLength = returnVal; + }; + return returnVal; } int32_t Array2::GetLength(int32_t dimension) { + int32_t length = InternalLengths[dimension]; + if (length) + { + return length; + } auto returnValue = Plugin::SystemSystemSingleArray2GetLength2(Handle, dimension); if (Plugin::unhandledCsharpException) { @@ -6326,12 +6430,19 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } + InternalLengths[dimension] = returnValue; return returnValue; } int32_t Array2::GetRank() { - return Array::GetRank(); + int32_t returnVal = InternalRank; + if (returnVal == 0) + { + returnVal = Array::GetRank(); + InternalRank = returnVal; + }; + return returnVal; } Plugin::ArrayElementProxy1_2 System::Array2::operator[](int32_t index) @@ -6345,6 +6456,11 @@ namespace System Array3::Array3(decltype(nullptr) n) : Array3(Plugin::InternalUse::Only, 0) { + this->InternalLength = 0; + this->InternalRank = 0; + this->InternalLengths[0] = 0; + this->InternalLengths[1] = 0; + this->InternalLengths[2] = 0; } Array3::Array3(Plugin::InternalUse iu, int32_t handle) @@ -6354,17 +6470,37 @@ namespace System { Plugin::ReferenceManagedClass(handle); } + this->InternalLength = 0; + this->InternalRank = 0; + this->InternalLengths[0] = 0; + this->InternalLengths[1] = 0; + this->InternalLengths[2] = 0; } Array3::Array3(const Array3& other) : Array3(Plugin::InternalUse::Only, other.Handle) { + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; + InternalLengths[2] = other.InternalLengths[2]; } Array3::Array3(Array3&& other) : Array3(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; + InternalLengths[2] = other.InternalLengths[2]; + other.InternalLength = 0; + other.InternalRank = 0; + other.InternalLengths[0] = 0; + other.InternalLengths[1] = 0; + other.InternalLengths[2] = 0; } Array3::~Array3() @@ -6387,6 +6523,11 @@ namespace System { Plugin::ReferenceManagedClass(this->Handle); } + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; + InternalLengths[2] = other.InternalLengths[2]; return *this; } @@ -6407,7 +6548,17 @@ namespace System Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; + InternalLengths[2] = other.InternalLengths[2]; other.Handle = 0; + other.InternalLength = 0; + other.InternalRank = 0; + other.InternalLengths[0] = 0; + other.InternalLengths[1] = 0; + other.InternalLengths[2] = 0; return *this; } @@ -6436,16 +6587,31 @@ namespace System if (returnValue) { Plugin::ReferenceManagedClass(returnValue); + InternalLength = length0 * length1 * length2; + InternalLengths[0] = length0; + InternalLengths[1] = length1; + InternalLengths[2] = length2; } } int32_t Array3::GetLength() { - return Array::GetLength(); + int32_t returnVal = InternalLength; + if (returnVal == 0) + { + returnVal = Array::GetLength(); + InternalLength = returnVal; + }; + return returnVal; } int32_t Array3::GetLength(int32_t dimension) { + int32_t length = InternalLengths[dimension]; + if (length) + { + return length; + } auto returnValue = Plugin::SystemSystemSingleArray3GetLength3(Handle, dimension); if (Plugin::unhandledCsharpException) { @@ -6454,12 +6620,19 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } + InternalLengths[dimension] = returnValue; return returnValue; } int32_t Array3::GetRank() { - return Array::GetRank(); + int32_t returnVal = InternalRank; + if (returnVal == 0) + { + returnVal = Array::GetRank(); + InternalRank = returnVal; + }; + return returnVal; } Plugin::ArrayElementProxy1_3 System::Array3::operator[](int32_t index) @@ -6507,6 +6680,8 @@ namespace System Array1::Array1(decltype(nullptr) n) : Array1(Plugin::InternalUse::Only, 0) { + this->InternalLength = 0; + this->InternalRank = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) @@ -6516,17 +6691,25 @@ namespace System { Plugin::ReferenceManagedClass(handle); } + this->InternalLength = 0; + this->InternalRank = 0; } Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; } Array1::Array1(Array1&& other) : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; + other.InternalLength = 0; + other.InternalRank = 0; } Array1::~Array1() @@ -6549,6 +6732,8 @@ namespace System { Plugin::ReferenceManagedClass(this->Handle); } + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; return *this; } @@ -6569,7 +6754,11 @@ namespace System Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; other.Handle = 0; + other.InternalLength = 0; + other.InternalRank = 0; return *this; } @@ -6598,17 +6787,30 @@ namespace System if (returnValue) { Plugin::ReferenceManagedClass(returnValue); + InternalLength = length0; } } int32_t Array1::GetLength() { - return Array::GetLength(); + int32_t returnVal = InternalLength; + if (returnVal == 0) + { + returnVal = Array::GetLength(); + InternalLength = returnVal; + }; + return returnVal; } int32_t Array1::GetRank() { - return Array::GetRank(); + int32_t returnVal = InternalRank; + if (returnVal == 0) + { + returnVal = Array::GetRank(); + InternalRank = returnVal; + }; + return returnVal; } Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) @@ -6656,6 +6858,8 @@ namespace System Array1::Array1(decltype(nullptr) n) : Array1(Plugin::InternalUse::Only, 0) { + this->InternalLength = 0; + this->InternalRank = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) @@ -6665,17 +6869,25 @@ namespace System { Plugin::ReferenceManagedClass(handle); } + this->InternalLength = 0; + this->InternalRank = 0; } Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; } Array1::Array1(Array1&& other) : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; + other.InternalLength = 0; + other.InternalRank = 0; } Array1::~Array1() @@ -6698,6 +6910,8 @@ namespace System { Plugin::ReferenceManagedClass(this->Handle); } + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; return *this; } @@ -6718,7 +6932,11 @@ namespace System Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; other.Handle = 0; + other.InternalLength = 0; + other.InternalRank = 0; return *this; } @@ -6747,17 +6965,30 @@ namespace System if (returnValue) { Plugin::ReferenceManagedClass(returnValue); + InternalLength = length0; } } int32_t Array1::GetLength() { - return Array::GetLength(); + int32_t returnVal = InternalLength; + if (returnVal == 0) + { + returnVal = Array::GetLength(); + InternalLength = returnVal; + }; + return returnVal; } int32_t Array1::GetRank() { - return Array::GetRank(); + int32_t returnVal = InternalRank; + if (returnVal == 0) + { + returnVal = Array::GetRank(); + InternalRank = returnVal; + }; + return returnVal; } Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) @@ -6805,6 +7036,8 @@ namespace System Array1::Array1(decltype(nullptr) n) : Array1(Plugin::InternalUse::Only, 0) { + this->InternalLength = 0; + this->InternalRank = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) @@ -6814,17 +7047,25 @@ namespace System { Plugin::ReferenceManagedClass(handle); } + this->InternalLength = 0; + this->InternalRank = 0; } Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; } Array1::Array1(Array1&& other) : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; + other.InternalLength = 0; + other.InternalRank = 0; } Array1::~Array1() @@ -6847,6 +7088,8 @@ namespace System { Plugin::ReferenceManagedClass(this->Handle); } + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; return *this; } @@ -6867,7 +7110,11 @@ namespace System Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; other.Handle = 0; + other.InternalLength = 0; + other.InternalRank = 0; return *this; } @@ -6896,17 +7143,30 @@ namespace System if (returnValue) { Plugin::ReferenceManagedClass(returnValue); + InternalLength = length0; } } int32_t Array1::GetLength() { - return Array::GetLength(); + int32_t returnVal = InternalLength; + if (returnVal == 0) + { + returnVal = Array::GetLength(); + InternalLength = returnVal; + }; + return returnVal; } int32_t Array1::GetRank() { - return Array::GetRank(); + int32_t returnVal = InternalRank; + if (returnVal == 0) + { + returnVal = Array::GetRank(); + InternalRank = returnVal; + }; + return returnVal; } Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) @@ -6954,6 +7214,8 @@ namespace System Array1::Array1(decltype(nullptr) n) : Array1(Plugin::InternalUse::Only, 0) { + this->InternalLength = 0; + this->InternalRank = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) @@ -6963,17 +7225,25 @@ namespace System { Plugin::ReferenceManagedClass(handle); } + this->InternalLength = 0; + this->InternalRank = 0; } Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; } Array1::Array1(Array1&& other) : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; + other.InternalLength = 0; + other.InternalRank = 0; } Array1::~Array1() @@ -6996,6 +7266,8 @@ namespace System { Plugin::ReferenceManagedClass(this->Handle); } + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; return *this; } @@ -7016,7 +7288,11 @@ namespace System Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; + InternalLength = other.InternalLength; + InternalRank = other.InternalRank; other.Handle = 0; + other.InternalLength = 0; + other.InternalRank = 0; return *this; } @@ -7045,17 +7321,30 @@ namespace System if (returnValue) { Plugin::ReferenceManagedClass(returnValue); + InternalLength = length0; } } int32_t Array1::GetLength() { - return Array::GetLength(); + int32_t returnVal = InternalLength; + if (returnVal == 0) + { + returnVal = Array::GetLength(); + InternalLength = returnVal; + }; + return returnVal; } int32_t Array1::GetRank() { - return Array::GetRank(); + int32_t returnVal = InternalRank; + if (returnVal == 0) + { + returnVal = Array::GetRank(); + InternalRank = returnVal; + }; + return returnVal; } Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index c737a55..2e4f3a9 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -1687,6 +1687,8 @@ namespace System Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; + int32_t InternalLength; + int32_t InternalRank; Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); @@ -1781,6 +1783,8 @@ namespace System Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; + int32_t InternalLength; + int32_t InternalRank; Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); @@ -1802,6 +1806,9 @@ namespace System Array2& operator=(Array2&& other); bool operator==(const Array2& other) const; bool operator!=(const Array2& other) const; + int32_t InternalLength; + int32_t InternalRank; + int32_t InternalLengths[2]; Array2(int32_t length0, int32_t length1); int32_t GetLength(); int32_t GetLength(int32_t dimension); @@ -1824,6 +1831,9 @@ namespace System Array3& operator=(Array3&& other); bool operator==(const Array3& other) const; bool operator!=(const Array3& other) const; + int32_t InternalLength; + int32_t InternalRank; + int32_t InternalLengths[3]; Array3(int32_t length0, int32_t length1, int32_t length2); int32_t GetLength(); int32_t GetLength(int32_t dimension); @@ -1858,6 +1868,8 @@ namespace System Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; + int32_t InternalLength; + int32_t InternalRank; Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); @@ -1891,6 +1903,8 @@ namespace System Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; + int32_t InternalLength; + int32_t InternalRank; Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); @@ -1924,6 +1938,8 @@ namespace System Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; + int32_t InternalLength; + int32_t InternalRank; Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); @@ -1957,6 +1973,8 @@ namespace System Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; + int32_t InternalLength; + int32_t InternalRank; Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); From 2c1867dc79a8ca268a7fc36085fb5f08a5397afb Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 19 Nov 2017 11:45:54 -0800 Subject: [PATCH 38/95] Pass Object parameters by const reference Fix a C linkage issue Update README --- README.md | 11 +- .../NativeScript/Editor/GenerateBindings.cs | 52 ++++- Unity/CppSource/Game/Game.cpp | 55 ++--- Unity/CppSource/NativeScript/Bindings.cpp | 210 +++++++++--------- Unity/CppSource/NativeScript/Bindings.h | 134 +++++------ 5 files changed, 246 insertions(+), 216 deletions(-) diff --git a/README.md b/README.md index 0128b59..71b8c4d 100644 --- a/README.md +++ b/README.md @@ -16,16 +16,16 @@ This project aims to give you a viable alternative to C#. Scripting in C++ isn't # Reasons to Prefer C++ Over C# # -## Fast Compile Times - -C++ [compiles much more quickly](https://github.com/jacksondunstan/cscppcompiletimes) than C#. Incremental builds when just one file changes-- the most common builds-- can be 15x faster than with C#. Faster compilation adds up over time to productivity gains. Quicker iteration times make it easier to stay in the "flow" of programming. - ## Fast Device Build Times Changing one line of C# code requires you to make a new build of the game. Typical iOS build times tend to be at least 10 minutes because IL2CPP has to run and then Xcode has to compile a huge amount of C++. By using C++, we can compile the game as a C++ plugin in about 1 second, swap the plugin into the Xcode project, and then immediately run the game. That's a huge productivity boost! +## Fast Compile Times + +C++ [compiles much more quickly](https://github.com/jacksondunstan/cscppcompiletimes) than C#. Incremental builds when just one file changes-- the most common builds-- can be 15x faster than with C#. Faster compilation adds up over time to productivity gains. Quicker iteration times make it easier to stay in the "flow" of programming. + ## No Garbage Collector Unity's garbage collector is mandatory and has a lot of problems. It's slow, runs on the main thread, collects all garbage at once, fragments the heap, and never shrinks the heap. So your game will experience "frame hitches" and eventually you'll run out of memory and crash. @@ -79,7 +79,8 @@ C++ is the standard language for video games as well as many other fields. By pr > void MyScript::Start() { - Debug::Log(String("MyScript has started")); + String message("MyScript has started"); + Debug::Log(message); } * Platform-dependent compilation via the [usual flags](https://docs.unity3d.com/Manual/PlatformDependentCompilation.html) (e.g. `#if UNITY_EDITOR`) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index d68fa90..5a83f1d 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -7157,6 +7157,16 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( { output.Append("void"); } + else if (method.ReturnType == typeof(bool)) + { + // C linkage requires us to use primitive types + output.Append("int32_t"); + } + else if (method.ReturnType == typeof(char)) + { + // C linkage requires us to use primitive types + output.Append("int16_t"); + } else { switch (methodReturnTypeKind) @@ -7221,6 +7231,26 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( indent + 1, output); output.Append("{\n"); + for (int i = 0; i < methodParams.Length; ++i) + { + ParameterInfo parameter = methodParams[i]; + if (parameter.Kind == TypeKind.Class || + parameter.Kind == TypeKind.ManagedStruct) + { + AppendIndent( + indent + 2, + output); + output.Append("auto param"); + output.Append(i); + output.Append(" = "); + AppendCppTypeName( + parameter.ParameterType, + output); + output.Append("(Plugin::InternalUse::Only, "); + output.Append(parameter.Name); + output.Append("Handle);\n"); + } + } AppendIndent( indent + 2, output); @@ -7239,12 +7269,8 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( if (parameter.Kind == TypeKind.Class || parameter.Kind == TypeKind.ManagedStruct) { - AppendCppTypeName( - parameter.ParameterType, - output); - output.Append("(Plugin::InternalUse::Only, "); - output.Append(parameter.Name); - output.Append("Handle)"); + output.Append("param"); + output.Append(i); } else { @@ -10515,6 +10541,17 @@ static void AppendCppParameterDeclaration( for (int i = 0; i < parameters.Length; ++i) { ParameterInfo param = parameters[i]; + + // Const qualifier if necessary + if ((!param.IsOut && !param.IsRef) && + (param.Kind == TypeKind.FullStruct || + param.Kind == TypeKind.ManagedStruct || + param.Kind == TypeKind.Class || + param.IsVirtual)) + { + output.Append("const "); + } + AppendCppTypeName( param.DereferencedParameterType, output); @@ -10526,6 +10563,8 @@ static void AppendCppParameterDeclaration( } else if ( param.Kind == TypeKind.FullStruct || + param.Kind == TypeKind.ManagedStruct || + param.Kind == TypeKind.Class || param.IsVirtual) { output.Append('&'); @@ -10879,6 +10918,7 @@ static void AppendCppFunctionPointer( } break; case TypeKind.FullStruct: + output.Append("const "); AppendCppTypeName( param.DereferencedParameterType, output); diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index 4d3c5c5..b78e177 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -19,26 +19,30 @@ void PrintPlatformDefines(); // This is mostly full of test code. Feel free to remove it all. void PluginMain() { - PrintPlatformDefines(); - Debug::Log(String("Game booted up")); + String message("Game booted up"); + Debug::Log(message); - GameObject go(String("GameObject with a TestScript")); + String name("GameObject with a TestScript"); + GameObject go(name); go.AddComponent(); } void MyGame::MonoBehaviours::TestScript::Awake() { - Debug::Log(String("C++ TestScript Awake")); + String message("C++ TestScript Awake"); + Debug::Log(message); } void MyGame::MonoBehaviours::TestScript::OnAnimatorIK(int32_t param0) { - Debug::Log(String("C++ TestScript OnAnimatorIK")); + String message("C++ TestScript OnAnimatorIK"); + Debug::Log(message); } -void MyGame::MonoBehaviours::TestScript::OnCollisionEnter(UnityEngine::Collision param0) +void MyGame::MonoBehaviours::TestScript::OnCollisionEnter(const UnityEngine::Collision& param0) { - Debug::Log(String("C++ TestScript OnCollisionEnter")); + String message("C++ TestScript OnCollisionEnter"); + Debug::Log(message); } void MyGame::MonoBehaviours::TestScript::Update() @@ -54,41 +58,8 @@ void MyGame::MonoBehaviours::TestScript::Update() numCreated++; if (numCreated == 10) { - Debug::Log(String("Done spawning game objects")); + String message("Done spawning game objects"); + Debug::Log(message); } } } - -void PrintPlatformDefines() -{ -#if defined(UNITY_EDITOR) - Debug::Log(String("UNITY_EDITOR")); -#endif -#if defined(UNITY_STANDALONE) - Debug::Log(String("UNITY_STANDALONE")); -#endif -#if defined(UNITY_IOS) - Debug::Log(String("UNITY_IOS")); -#endif -#if defined(UNITY_ANDROID) - Debug::Log(String("UNITY_ANDROID")); -#endif -#if defined(UNITY_EDITOR_WIN) - Debug::Log(String("UNITY_EDITOR_WIN")); -#endif -#if defined(UNITY_EDITOR_OSX) - Debug::Log(String("UNITY_EDITOR_OSX")); -#endif -#if defined(UNITY_EDITOR_LINUX) - Debug::Log(String("UNITY_EDITOR_LINUX")); -#endif -#if defined(UNITY_STANDALONE_OSX) - Debug::Log(String("UNITY_STANDALONE_OSX")); -#endif -#if defined(UNITY_STANDALONE_WIN) - Debug::Log(String("UNITY_STANDALONE_WIN")); -#endif -#if defined(UNITY_STANDALONE_LINUX) - Debug::Log(String("UNITY_STANDALONE_LINUX")); -#endif -} diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 7dc8191..4a531e8 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -55,7 +55,7 @@ namespace Plugin int32_t (*UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle); int32_t (*UnityEngineComponentPropertyGetTransform)(int32_t thisHandle); UnityEngine::Vector3 (*UnityEngineTransformPropertyGetPosition)(int32_t thisHandle); - void (*UnityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value); + void (*UnityEngineTransformPropertySetPosition)(int32_t thisHandle, const UnityEngine::Vector3& value); void (*UnityEngineDebugMethodLogSystemObject)(int32_t messageHandle); System::Boolean (*UnityEngineAssertionsAssertFieldGetRaiseExceptions)(); void (*UnityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value); @@ -67,17 +67,17 @@ namespace Plugin UnityEngine::Vector3 (*UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z); float (*UnityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz); void (*UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ); - UnityEngine::Vector3 (*UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b); - UnityEngine::Vector3 (*UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a); - int32_t (*BoxVector3)(UnityEngine::Vector3& val); + UnityEngine::Vector3 (*UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(const UnityEngine::Vector3& a, const UnityEngine::Vector3& b); + UnityEngine::Vector3 (*UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(const UnityEngine::Vector3& a); + int32_t (*BoxVector3)(const UnityEngine::Vector3& val); UnityEngine::Vector3 (*UnboxVector3)(int32_t valHandle); float (*UnityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column); void (*UnityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value); - int32_t (*BoxMatrix4x4)(UnityEngine::Matrix4x4& val); + int32_t (*BoxMatrix4x4)(const UnityEngine::Matrix4x4& val); UnityEngine::Matrix4x4 (*UnboxMatrix4x4)(int32_t valHandle); void (*ReleaseUnityEngineRaycastHit)(int32_t handle); UnityEngine::Vector3 (*UnityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle); - void (*UnityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value); + void (*UnityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, const UnityEngine::Vector3& value); int32_t (*UnityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle); int32_t (*BoxRaycastHit)(int32_t valHandle); int32_t (*UnboxRaycastHit)(int32_t valHandle); @@ -112,17 +112,17 @@ namespace Plugin void (*UnityEngineResolutionPropertySetHeight)(UnityEngine::Resolution* thiz, int32_t value); int32_t (*UnityEngineResolutionPropertyGetRefreshRate)(UnityEngine::Resolution* thiz); void (*UnityEngineResolutionPropertySetRefreshRate)(UnityEngine::Resolution* thiz, int32_t value); - int32_t (*BoxResolution)(UnityEngine::Resolution& val); + int32_t (*BoxResolution)(const UnityEngine::Resolution& val); UnityEngine::Resolution (*UnboxResolution)(int32_t valHandle); int32_t (*UnityEngineScreenPropertyGetResolutions)(); - UnityEngine::Ray (*UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); - int32_t (*BoxRay)(UnityEngine::Ray& val); + UnityEngine::Ray (*UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(const UnityEngine::Vector3& origin, const UnityEngine::Vector3& direction); + int32_t (*BoxRay)(const UnityEngine::Ray& val); UnityEngine::Ray (*UnboxRay)(int32_t valHandle); - int32_t (*UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)(UnityEngine::Ray& ray, int32_t resultsHandle); - int32_t (*UnityEnginePhysicsMethodRaycastAllUnityEngineRay)(UnityEngine::Ray& ray); - int32_t (*BoxColor)(UnityEngine::Color& val); + int32_t (*UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)(const UnityEngine::Ray& ray, int32_t resultsHandle); + int32_t (*UnityEnginePhysicsMethodRaycastAllUnityEngineRay)(const UnityEngine::Ray& ray); + int32_t (*BoxColor)(const UnityEngine::Color& val); UnityEngine::Color (*UnboxColor)(int32_t valHandle); - int32_t (*BoxGradientColorKey)(UnityEngine::GradientColorKey& val); + int32_t (*BoxGradientColorKey)(const UnityEngine::GradientColorKey& val); UnityEngine::GradientColorKey (*UnboxGradientColorKey)(int32_t valHandle); int32_t (*UnityEngineGradientConstructor)(); int32_t (*UnityEngineGradientPropertyGetColorKeys)(int32_t thisHandle); @@ -134,7 +134,7 @@ namespace Plugin void (*UnityEngineApplicationRemoveEventOnBeforeRender)(int32_t delHandle); void (*UnityEngineSceneManagementSceneManagerAddEventSceneLoaded)(int32_t delHandle); void (*UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)(int32_t delHandle); - int32_t (*BoxScene)(UnityEngine::SceneManagement::Scene& val); + int32_t (*BoxScene)(const UnityEngine::SceneManagement::Scene& val); UnityEngine::SceneManagement::Scene (*UnboxScene)(int32_t valHandle); int32_t (*BoxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val); UnityEngine::SceneManagement::LoadSceneMode (*UnboxLoadSceneMode)(int32_t valHandle); @@ -189,13 +189,13 @@ namespace Plugin int32_t (*SystemStringArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle); int32_t (*UnityEngineUnityEngineResolutionArray1Constructor1)(int32_t length0); UnityEngine::Resolution (*UnityEngineResolutionArray1GetItem1)(int32_t thisHandle, int32_t index0); - int32_t (*UnityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::Resolution& item); + int32_t (*UnityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, const UnityEngine::Resolution& item); int32_t (*UnityEngineUnityEngineRaycastHitArray1Constructor1)(int32_t length0); int32_t (*UnityEngineRaycastHitArray1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*UnityEngineRaycastHitArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle); int32_t (*UnityEngineUnityEngineGradientColorKeyArray1Constructor1)(int32_t length0); UnityEngine::GradientColorKey (*UnityEngineGradientColorKeyArray1GetItem1)(int32_t thisHandle, int32_t index0); - int32_t (*UnityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item); + int32_t (*UnityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, const UnityEngine::GradientColorKey& item); void (*ReleaseSystemAction)(int32_t handle, int32_t classHandle); void (*SystemActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); void (*SystemActionAdd)(int32_t thisHandle, int32_t delHandle); @@ -235,7 +235,7 @@ namespace Plugin void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)(int32_t thisHandle, int32_t delHandle); void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle); - void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); + void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, const UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); /*END FUNCTION POINTERS*/ } @@ -1028,7 +1028,7 @@ namespace UnityEngine return System::String(Plugin::InternalUse::Only, returnValue); } - void Object::SetName(System::String value) + void Object::SetName(const System::String& value) { Plugin::UnityEngineObjectPropertySetName(Handle, value.Handle); if (Plugin::unhandledCsharpException) @@ -1040,7 +1040,7 @@ namespace UnityEngine } } - System::Boolean Object::operator==(UnityEngine::Object x) + System::Boolean Object::operator==(const UnityEngine::Object& x) { auto returnValue = Plugin::UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject(Handle, x.Handle); if (Plugin::unhandledCsharpException) @@ -1166,7 +1166,7 @@ namespace UnityEngine } } - GameObject::GameObject(System::String name) + GameObject::GameObject(const System::String& name) : UnityEngine::Object(nullptr) { auto returnValue = Plugin::UnityEngineGameObjectConstructorSystemString(name.Handle); @@ -1400,7 +1400,7 @@ namespace UnityEngine return returnValue; } - void Transform::SetPosition(UnityEngine::Vector3& value) + void Transform::SetPosition(const UnityEngine::Vector3& value) { Plugin::UnityEngineTransformPropertySetPosition(Handle, value); if (Plugin::unhandledCsharpException) @@ -1494,7 +1494,7 @@ namespace UnityEngine return Handle != other.Handle; } - void Debug::Log(System::Object message) + void Debug::Log(const System::Object& message) { Plugin::UnityEngineDebugMethodLogSystemObject(message.Handle); if (Plugin::unhandledCsharpException) @@ -1536,7 +1536,7 @@ namespace UnityEngine } } - template<> void Assert::AreEqual(System::String expected, System::String actual) + template<> void Assert::AreEqual(const System::String& expected, const System::String& actual) { Plugin::UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(expected.Handle, actual.Handle); if (Plugin::unhandledCsharpException) @@ -1548,7 +1548,7 @@ namespace UnityEngine } } - template<> void Assert::AreEqual(UnityEngine::GameObject expected, UnityEngine::GameObject actual) + template<> void Assert::AreEqual(const UnityEngine::GameObject& expected, const UnityEngine::GameObject& actual) { Plugin::UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(expected.Handle, actual.Handle); if (Plugin::unhandledCsharpException) @@ -2065,7 +2065,7 @@ namespace UnityEngine } } - UnityEngine::Vector3 Vector3::operator+(UnityEngine::Vector3& a) + UnityEngine::Vector3 Vector3::operator+(const UnityEngine::Vector3& a) { auto returnValue = Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(*this, a); if (Plugin::unhandledCsharpException) @@ -2094,7 +2094,7 @@ namespace UnityEngine namespace System { - Object::Object(UnityEngine::Vector3& val) + Object::Object(const UnityEngine::Vector3& val) { int32_t handle = Plugin::BoxVector3(val); if (Plugin::unhandledCsharpException) @@ -2159,7 +2159,7 @@ namespace UnityEngine namespace System { - Object::Object(UnityEngine::Matrix4x4& val) + Object::Object(const UnityEngine::Matrix4x4& val) { int32_t handle = Plugin::BoxMatrix4x4(val); if (Plugin::unhandledCsharpException) @@ -2284,7 +2284,7 @@ namespace UnityEngine return returnValue; } - void RaycastHit::SetPoint(UnityEngine::Vector3& value) + void RaycastHit::SetPoint(const UnityEngine::Vector3& value) { Plugin::UnityEngineRaycastHitPropertySetPoint(Handle, value); if (Plugin::unhandledCsharpException) @@ -2312,7 +2312,7 @@ namespace UnityEngine namespace System { - Object::Object(UnityEngine::RaycastHit val) + Object::Object(const UnityEngine::RaycastHit& val) { int32_t handle = Plugin::BoxRaycastHit(val.Handle); if (Plugin::unhandledCsharpException) @@ -2461,7 +2461,7 @@ namespace System return Handle != other.Handle; } - KeyValuePair::KeyValuePair(System::String key, double value) + KeyValuePair::KeyValuePair(const System::String& key, double value) : System::ValueType(nullptr) { auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(key.Handle, value); @@ -2510,7 +2510,7 @@ namespace System namespace System { - Object::Object(System::Collections::Generic::KeyValuePair val) + Object::Object(const System::Collections::Generic::KeyValuePair& val) { int32_t handle = Plugin::BoxKeyValuePairSystemString_SystemDouble(val.Handle); if (Plugin::unhandledCsharpException) @@ -2657,7 +2657,7 @@ namespace System return System::String(Plugin::InternalUse::Only, returnValue); } - void List::SetItem(int32_t index, System::String value) + void List::SetItem(int32_t index, const System::String& value) { Plugin::SystemCollectionsGenericListSystemStringPropertySetItem(Handle, index, value.Handle); if (Plugin::unhandledCsharpException) @@ -2669,7 +2669,7 @@ namespace System } } - void List::Add(System::String item) + void List::Add(const System::String& item) { Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString(Handle, item.Handle); if (Plugin::unhandledCsharpException) @@ -2681,7 +2681,7 @@ namespace System } } - void List::Sort(System::Collections::Generic::IComparer comparer) + void List::Sort(const System::Collections::Generic::IComparer& comparer) { Plugin::SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); if (Plugin::unhandledCsharpException) @@ -2836,7 +2836,7 @@ namespace System } } - void List::Sort(System::Collections::Generic::IComparer comparer) + void List::Sort(const System::Collections::Generic::IComparer& comparer) { Plugin::SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); if (Plugin::unhandledCsharpException) @@ -2936,7 +2936,7 @@ namespace System return Handle != other.Handle; } - LinkedListNode::LinkedListNode(System::String value) + LinkedListNode::LinkedListNode(const System::String& value) : System::Object(nullptr) { auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(value.Handle); @@ -2967,7 +2967,7 @@ namespace System return System::String(Plugin::InternalUse::Only, returnValue); } - void LinkedListNode::SetValue(System::String value) + void LinkedListNode::SetValue(const System::String& value) { Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(Handle, value.Handle); if (Plugin::unhandledCsharpException) @@ -3067,7 +3067,7 @@ namespace System return Handle != other.Handle; } - StrongBox::StrongBox(System::String value) + StrongBox::StrongBox(const System::String& value) : System::Object(nullptr) { auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(value.Handle); @@ -3098,7 +3098,7 @@ namespace System return System::String(Plugin::InternalUse::Only, returnValue); } - void StrongBox::SetValue(System::String value) + void StrongBox::SetValue(const System::String& value) { Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(Handle, value.Handle); if (Plugin::unhandledCsharpException) @@ -3370,7 +3370,7 @@ namespace System return Handle != other.Handle; } - Exception::Exception(System::String message) + Exception::Exception(const System::String& message) : System::Object(nullptr) { auto returnValue = Plugin::SystemExceptionConstructorSystemString(message.Handle); @@ -3637,7 +3637,7 @@ namespace UnityEngine namespace System { - Object::Object(UnityEngine::Resolution& val) + Object::Object(const UnityEngine::Resolution& val) { int32_t handle = Plugin::BoxResolution(val); if (Plugin::unhandledCsharpException) @@ -3769,7 +3769,7 @@ namespace UnityEngine { } - Ray::Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction) + Ray::Ray(const UnityEngine::Vector3& origin, const UnityEngine::Vector3& direction) { auto returnValue = Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(origin, direction); if (Plugin::unhandledCsharpException) @@ -3785,7 +3785,7 @@ namespace UnityEngine namespace System { - Object::Object(UnityEngine::Ray& val) + Object::Object(const UnityEngine::Ray& val) { int32_t handle = Plugin::BoxRay(val); if (Plugin::unhandledCsharpException) @@ -3897,7 +3897,7 @@ namespace UnityEngine return Handle != other.Handle; } - int32_t Physics::RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1 results) + int32_t Physics::RaycastNonAlloc(const UnityEngine::Ray& ray, const System::Array1& results) { auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit(ray, results.Handle); if (Plugin::unhandledCsharpException) @@ -3910,7 +3910,7 @@ namespace UnityEngine return returnValue; } - System::Array1 Physics::RaycastAll(UnityEngine::Ray& ray) + System::Array1 Physics::RaycastAll(const UnityEngine::Ray& ray) { auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ray); if (Plugin::unhandledCsharpException) @@ -3933,7 +3933,7 @@ namespace UnityEngine namespace System { - Object::Object(UnityEngine::Color& val) + Object::Object(const UnityEngine::Color& val) { int32_t handle = Plugin::BoxColor(val); if (Plugin::unhandledCsharpException) @@ -3973,7 +3973,7 @@ namespace UnityEngine namespace System { - Object::Object(UnityEngine::GradientColorKey& val) + Object::Object(const UnityEngine::GradientColorKey& val) { int32_t handle = Plugin::BoxGradientColorKey(val); if (Plugin::unhandledCsharpException) @@ -4116,7 +4116,7 @@ namespace UnityEngine return System::Array1(Plugin::InternalUse::Only, returnValue); } - void Gradient::SetColorKeys(System::Array1 value) + void Gradient::SetColorKeys(const System::Array1& value) { Plugin::UnityEngineGradientPropertySetColorKeys(Handle, value.Handle); if (Plugin::unhandledCsharpException) @@ -4241,7 +4241,7 @@ namespace System return System::AppDomainInitializer(Plugin::InternalUse::Only, returnValue); } - void AppDomainSetup::SetAppDomainInitializer(System::AppDomainInitializer value) + void AppDomainSetup::SetAppDomainInitializer(const System::AppDomainInitializer& value) { Plugin::SystemAppDomainSetupPropertySetAppDomainInitializer(Handle, value.Handle); if (Plugin::unhandledCsharpException) @@ -4335,7 +4335,7 @@ namespace UnityEngine return Handle != other.Handle; } - void Application::AddOnBeforeRender(UnityEngine::Events::UnityAction del) + void Application::AddOnBeforeRender(const UnityEngine::Events::UnityAction& del) { Plugin::UnityEngineApplicationAddEventOnBeforeRender(del.Handle); if (Plugin::unhandledCsharpException) @@ -4347,7 +4347,7 @@ namespace UnityEngine } } - void Application::RemoveOnBeforeRender(UnityEngine::Events::UnityAction del) + void Application::RemoveOnBeforeRender(const UnityEngine::Events::UnityAction& del) { Plugin::UnityEngineApplicationRemoveEventOnBeforeRender(del.Handle); if (Plugin::unhandledCsharpException) @@ -4443,7 +4443,7 @@ namespace UnityEngine return Handle != other.Handle; } - void SceneManager::AddSceneLoaded(UnityEngine::Events::UnityAction2 del) + void SceneManager::AddSceneLoaded(const UnityEngine::Events::UnityAction2& del) { Plugin::UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(del.Handle); if (Plugin::unhandledCsharpException) @@ -4455,7 +4455,7 @@ namespace UnityEngine } } - void SceneManager::RemoveSceneLoaded(UnityEngine::Events::UnityAction2 del) + void SceneManager::RemoveSceneLoaded(const UnityEngine::Events::UnityAction2& del) { Plugin::UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(del.Handle); if (Plugin::unhandledCsharpException) @@ -4481,7 +4481,7 @@ namespace UnityEngine namespace System { - Object::Object(UnityEngine::SceneManagement::Scene& val) + Object::Object(const UnityEngine::SceneManagement::Scene& val) { int32_t handle = Plugin::BoxScene(val); if (Plugin::unhandledCsharpException) @@ -4885,7 +4885,7 @@ namespace System return Handle != other.Handle; } - int32_t IComparer::Compare(System::String x, System::String y) + int32_t IComparer::Compare(const System::String& x, const System::String& y) { return {}; } @@ -4894,7 +4894,9 @@ namespace System { try { - return Plugin::GetSystemCollectionsGenericIComparerSystemString(cppHandle)->Compare(System::String(Plugin::InternalUse::Only, xHandle), System::String(Plugin::InternalUse::Only, yHandle)); + auto param0 = System::String(Plugin::InternalUse::Only, xHandle); + auto param1 = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemCollectionsGenericIComparerSystemString(cppHandle)->Compare(param0, param1); } catch (System::Exception ex) { @@ -5065,7 +5067,7 @@ namespace System return Handle != other.Handle; } - int32_t StringComparer::Compare(System::String x, System::String y) + int32_t StringComparer::Compare(const System::String& x, const System::String& y) { return {}; } @@ -5074,7 +5076,9 @@ namespace System { try { - return Plugin::GetSystemStringComparer(cppHandle)->Compare(System::String(Plugin::InternalUse::Only, xHandle), System::String(Plugin::InternalUse::Only, yHandle)); + auto param0 = System::String(Plugin::InternalUse::Only, xHandle); + auto param1 = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemStringComparer(cppHandle)->Compare(param0, param1); } catch (System::Exception ex) { @@ -5090,16 +5094,18 @@ namespace System } } - System::Boolean StringComparer::Equals(System::String x, System::String y) + System::Boolean StringComparer::Equals(const System::String& x, const System::String& y) { return {}; } - DLLEXPORT System::Boolean SystemStringComparerEquals(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + DLLEXPORT int32_t SystemStringComparerEquals(int32_t cppHandle, int32_t xHandle, int32_t yHandle) { try { - return Plugin::GetSystemStringComparer(cppHandle)->Equals(System::String(Plugin::InternalUse::Only, xHandle), System::String(Plugin::InternalUse::Only, yHandle)); + auto param0 = System::String(Plugin::InternalUse::Only, xHandle); + auto param1 = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemStringComparer(cppHandle)->Equals(param0, param1); } catch (System::Exception ex) { @@ -5115,7 +5121,7 @@ namespace System } } - int32_t StringComparer::GetHashCode(System::String obj) + int32_t StringComparer::GetHashCode(const System::String& obj) { return {}; } @@ -5124,7 +5130,8 @@ namespace System { try { - return Plugin::GetSystemStringComparer(cppHandle)->GetHashCode(System::String(Plugin::InternalUse::Only, objHandle)); + auto param0 = System::String(Plugin::InternalUse::Only, objHandle); + return Plugin::GetSystemStringComparer(cppHandle)->GetHashCode(param0); } catch (System::Exception ex) { @@ -7521,7 +7528,7 @@ namespace System return Handle != other.Handle; } - void Action::operator+=(System::Action& del) + void Action::operator+=(const System::Action& del) { Plugin::SystemActionAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -7533,7 +7540,7 @@ namespace System } } - void Action::operator-=(System::Action& del) + void Action::operator-=(const System::Action& del) { Plugin::SystemActionRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -7748,7 +7755,7 @@ namespace System return Handle != other.Handle; } - void Action1::operator+=(System::Action1& del) + void Action1::operator+=(const System::Action1& del) { Plugin::SystemActionSystemSingleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -7760,7 +7767,7 @@ namespace System } } - void Action1::operator-=(System::Action1& del) + void Action1::operator-=(const System::Action1& del) { Plugin::SystemActionSystemSingleRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -7975,7 +7982,7 @@ namespace System return Handle != other.Handle; } - void Action2::operator+=(System::Action2& del) + void Action2::operator+=(const System::Action2& del) { Plugin::SystemActionSystemSingle_SystemSingleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -7987,7 +7994,7 @@ namespace System } } - void Action2::operator-=(System::Action2& del) + void Action2::operator-=(const System::Action2& del) { Plugin::SystemActionSystemSingle_SystemSingleRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8202,7 +8209,7 @@ namespace System return Handle != other.Handle; } - void Func3::operator+=(System::Func3& del) + void Func3::operator+=(const System::Func3& del) { Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8214,7 +8221,7 @@ namespace System } } - void Func3::operator-=(System::Func3& del) + void Func3::operator-=(const System::Func3& del) { Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8433,7 +8440,7 @@ namespace System return Handle != other.Handle; } - void Func3::operator+=(System::Func3& del) + void Func3::operator+=(const System::Func3& del) { Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8445,7 +8452,7 @@ namespace System } } - void Func3::operator-=(System::Func3& del) + void Func3::operator-=(const System::Func3& del) { Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8664,7 +8671,7 @@ namespace System return Handle != other.Handle; } - void AppDomainInitializer::operator+=(System::AppDomainInitializer& del) + void AppDomainInitializer::operator+=(const System::AppDomainInitializer& del) { Plugin::SystemAppDomainInitializerAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8676,7 +8683,7 @@ namespace System } } - void AppDomainInitializer::operator-=(System::AppDomainInitializer& del) + void AppDomainInitializer::operator-=(const System::AppDomainInitializer& del) { Plugin::SystemAppDomainInitializerRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8688,7 +8695,7 @@ namespace System } } - void AppDomainInitializer::operator()(System::Array1 args) + void AppDomainInitializer::operator()(const System::Array1& args) { } @@ -8696,7 +8703,8 @@ namespace System { try { - Plugin::GetSystemAppDomainInitializer(cppHandle)->operator()(System::Array1(Plugin::InternalUse::Only, argsHandle)); + auto param0 = System::Array1(Plugin::InternalUse::Only, argsHandle); + Plugin::GetSystemAppDomainInitializer(cppHandle)->operator()(param0); } catch (System::Exception ex) { @@ -8710,7 +8718,7 @@ namespace System } } - void AppDomainInitializer::Invoke(System::Array1 args) + void AppDomainInitializer::Invoke(const System::Array1& args) { Plugin::SystemAppDomainInitializerInvoke(Handle, args.Handle); if (Plugin::unhandledCsharpException) @@ -8893,7 +8901,7 @@ namespace UnityEngine return Handle != other.Handle; } - void UnityAction::operator+=(UnityEngine::Events::UnityAction& del) + void UnityAction::operator+=(const UnityEngine::Events::UnityAction& del) { Plugin::UnityEngineEventsUnityActionAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8905,7 +8913,7 @@ namespace UnityEngine } } - void UnityAction::operator-=(UnityEngine::Events::UnityAction& del) + void UnityAction::operator-=(const UnityEngine::Events::UnityAction& del) { Plugin::UnityEngineEventsUnityActionRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -9123,7 +9131,7 @@ namespace UnityEngine return Handle != other.Handle; } - void UnityAction2::operator+=(UnityEngine::Events::UnityAction2& del) + void UnityAction2::operator+=(const UnityEngine::Events::UnityAction2& del) { Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -9135,7 +9143,7 @@ namespace UnityEngine } } - void UnityAction2::operator-=(UnityEngine::Events::UnityAction2& del) + void UnityAction2::operator-=(const UnityEngine::Events::UnityAction2& del) { Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -9147,7 +9155,7 @@ namespace UnityEngine } } - void UnityAction2::operator()(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + void UnityAction2::operator()(const UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) { } @@ -9169,7 +9177,7 @@ namespace UnityEngine } } - void UnityAction2::Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + void UnityAction2::Invoke(const UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) { Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(Handle, arg0, arg1); if (Plugin::unhandledCsharpException) @@ -9240,7 +9248,7 @@ DLLEXPORT void Init( int32_t (*unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle), int32_t (*unityEngineComponentPropertyGetTransform)(int32_t thisHandle), UnityEngine::Vector3 (*unityEngineTransformPropertyGetPosition)(int32_t thisHandle), - void (*unityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value), + void (*unityEngineTransformPropertySetPosition)(int32_t thisHandle, const UnityEngine::Vector3& value), void (*unityEngineDebugMethodLogSystemObject)(int32_t messageHandle), System::Boolean (*unityEngineAssertionsAssertFieldGetRaiseExceptions)(), void (*unityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value), @@ -9252,17 +9260,17 @@ DLLEXPORT void Init( UnityEngine::Vector3 (*unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z), float (*unityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz), void (*unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ), - UnityEngine::Vector3 (*unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b), - UnityEngine::Vector3 (*unityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a), - int32_t (*boxVector3)(UnityEngine::Vector3& val), + UnityEngine::Vector3 (*unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(const UnityEngine::Vector3& a, const UnityEngine::Vector3& b), + UnityEngine::Vector3 (*unityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(const UnityEngine::Vector3& a), + int32_t (*boxVector3)(const UnityEngine::Vector3& val), UnityEngine::Vector3 (*unboxVector3)(int32_t valHandle), float (*unityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column), void (*unityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value), - int32_t (*boxMatrix4x4)(UnityEngine::Matrix4x4& val), + int32_t (*boxMatrix4x4)(const UnityEngine::Matrix4x4& val), UnityEngine::Matrix4x4 (*unboxMatrix4x4)(int32_t valHandle), void (*releaseUnityEngineRaycastHit)(int32_t handle), UnityEngine::Vector3 (*unityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle), - void (*unityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value), + void (*unityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, const UnityEngine::Vector3& value), int32_t (*unityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle), int32_t (*boxRaycastHit)(int32_t valHandle), int32_t (*unboxRaycastHit)(int32_t valHandle), @@ -9297,17 +9305,17 @@ DLLEXPORT void Init( void (*unityEngineResolutionPropertySetHeight)(UnityEngine::Resolution* thiz, int32_t value), int32_t (*unityEngineResolutionPropertyGetRefreshRate)(UnityEngine::Resolution* thiz), void (*unityEngineResolutionPropertySetRefreshRate)(UnityEngine::Resolution* thiz, int32_t value), - int32_t (*boxResolution)(UnityEngine::Resolution& val), + int32_t (*boxResolution)(const UnityEngine::Resolution& val), UnityEngine::Resolution (*unboxResolution)(int32_t valHandle), int32_t (*unityEngineScreenPropertyGetResolutions)(), - UnityEngine::Ray (*unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction), - int32_t (*boxRay)(UnityEngine::Ray& val), + UnityEngine::Ray (*unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(const UnityEngine::Vector3& origin, const UnityEngine::Vector3& direction), + int32_t (*boxRay)(const UnityEngine::Ray& val), UnityEngine::Ray (*unboxRay)(int32_t valHandle), - int32_t (*unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)(UnityEngine::Ray& ray, int32_t resultsHandle), - int32_t (*unityEnginePhysicsMethodRaycastAllUnityEngineRay)(UnityEngine::Ray& ray), - int32_t (*boxColor)(UnityEngine::Color& val), + int32_t (*unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)(const UnityEngine::Ray& ray, int32_t resultsHandle), + int32_t (*unityEnginePhysicsMethodRaycastAllUnityEngineRay)(const UnityEngine::Ray& ray), + int32_t (*boxColor)(const UnityEngine::Color& val), UnityEngine::Color (*unboxColor)(int32_t valHandle), - int32_t (*boxGradientColorKey)(UnityEngine::GradientColorKey& val), + int32_t (*boxGradientColorKey)(const UnityEngine::GradientColorKey& val), UnityEngine::GradientColorKey (*unboxGradientColorKey)(int32_t valHandle), int32_t (*unityEngineGradientConstructor)(), int32_t (*unityEngineGradientPropertyGetColorKeys)(int32_t thisHandle), @@ -9319,7 +9327,7 @@ DLLEXPORT void Init( void (*unityEngineApplicationRemoveEventOnBeforeRender)(int32_t delHandle), void (*unityEngineSceneManagementSceneManagerAddEventSceneLoaded)(int32_t delHandle), void (*unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)(int32_t delHandle), - int32_t (*boxScene)(UnityEngine::SceneManagement::Scene& val), + int32_t (*boxScene)(const UnityEngine::SceneManagement::Scene& val), UnityEngine::SceneManagement::Scene (*unboxScene)(int32_t valHandle), int32_t (*boxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val), UnityEngine::SceneManagement::LoadSceneMode (*unboxLoadSceneMode)(int32_t valHandle), @@ -9374,13 +9382,13 @@ DLLEXPORT void Init( int32_t (*systemStringArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), int32_t (*unityEngineUnityEngineResolutionArray1Constructor1)(int32_t length0), UnityEngine::Resolution (*unityEngineResolutionArray1GetItem1)(int32_t thisHandle, int32_t index0), - int32_t (*unityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::Resolution& item), + int32_t (*unityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, const UnityEngine::Resolution& item), int32_t (*unityEngineUnityEngineRaycastHitArray1Constructor1)(int32_t length0), int32_t (*unityEngineRaycastHitArray1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*unityEngineRaycastHitArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), int32_t (*unityEngineUnityEngineGradientColorKeyArray1Constructor1)(int32_t length0), UnityEngine::GradientColorKey (*unityEngineGradientColorKeyArray1GetItem1)(int32_t thisHandle, int32_t index0), - int32_t (*unityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item), + int32_t (*unityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, const UnityEngine::GradientColorKey& item), void (*releaseSystemAction)(int32_t handle, int32_t classHandle), void (*systemActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), void (*systemActionAdd)(int32_t thisHandle, int32_t delHandle), @@ -9420,7 +9428,7 @@ DLLEXPORT void Init( void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)(int32_t thisHandle, int32_t delHandle), void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle), - void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, const UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) /*END INIT PARAMS*/) { using namespace Plugin; diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 2e4f3a9..37f505d 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -82,6 +82,11 @@ namespace System return (bool)Value; } + operator int32_t() const + { + return Value; + } + bool operator==(const Boolean other) const { return Value == other.Value; @@ -139,6 +144,11 @@ namespace System return (bool)Value; } + operator int16_t() const + { + return Value; + } + bool operator==(const Char other) const { return Value == other.Value; @@ -763,25 +773,25 @@ namespace System virtual void ThrowReferenceToThis(); /*BEGIN BOXING METHOD DECLARATIONS*/ - Object(UnityEngine::Vector3& val); + Object(const UnityEngine::Vector3& val); explicit operator UnityEngine::Vector3(); - Object(UnityEngine::Matrix4x4& val); + Object(const UnityEngine::Matrix4x4& val); explicit operator UnityEngine::Matrix4x4(); - Object(UnityEngine::RaycastHit val); + Object(const UnityEngine::RaycastHit& val); explicit operator UnityEngine::RaycastHit(); Object(UnityEngine::QueryTriggerInteraction val); explicit operator UnityEngine::QueryTriggerInteraction(); - Object(System::Collections::Generic::KeyValuePair val); + Object(const System::Collections::Generic::KeyValuePair& val); explicit operator System::Collections::Generic::KeyValuePair(); - Object(UnityEngine::Resolution& val); + Object(const UnityEngine::Resolution& val); explicit operator UnityEngine::Resolution(); - Object(UnityEngine::Ray& val); + Object(const UnityEngine::Ray& val); explicit operator UnityEngine::Ray(); - Object(UnityEngine::Color& val); + Object(const UnityEngine::Color& val); explicit operator UnityEngine::Color(); - Object(UnityEngine::GradientColorKey& val); + Object(const UnityEngine::GradientColorKey& val); explicit operator UnityEngine::GradientColorKey(); - Object(UnityEngine::SceneManagement::Scene& val); + Object(const UnityEngine::SceneManagement::Scene& val); explicit operator UnityEngine::SceneManagement::Scene(); Object(UnityEngine::SceneManagement::LoadSceneMode val); explicit operator UnityEngine::SceneManagement::LoadSceneMode(); @@ -882,8 +892,8 @@ namespace UnityEngine bool operator==(const Object& other) const; bool operator!=(const Object& other) const; System::String GetName(); - void SetName(System::String value); - System::Boolean operator==(UnityEngine::Object x); + void SetName(const System::String& value); + System::Boolean operator==(const UnityEngine::Object& x); operator System::Boolean(); }; } @@ -903,7 +913,7 @@ namespace UnityEngine bool operator==(const GameObject& other) const; bool operator!=(const GameObject& other) const; GameObject(); - GameObject(System::String name); + GameObject(const System::String& name); UnityEngine::Transform GetTransform(); template MyGame::MonoBehaviours::TestScript AddComponent(); }; @@ -942,7 +952,7 @@ namespace UnityEngine bool operator==(const Transform& other) const; bool operator!=(const Transform& other) const; UnityEngine::Vector3 GetPosition(); - void SetPosition(UnityEngine::Vector3& value); + void SetPosition(const UnityEngine::Vector3& value); }; } @@ -960,7 +970,7 @@ namespace UnityEngine Debug& operator=(Debug&& other); bool operator==(const Debug& other) const; bool operator!=(const Debug& other) const; - static void Log(System::Object message); + static void Log(const System::Object& message); }; } @@ -972,8 +982,8 @@ namespace UnityEngine { System::Boolean GetRaiseExceptions(); void SetRaiseExceptions(System::Boolean value); - template void AreEqual(System::String expected, System::String actual); - template void AreEqual(UnityEngine::GameObject expected, UnityEngine::GameObject actual); + template void AreEqual(const System::String& expected, const System::String& actual); + template void AreEqual(const UnityEngine::GameObject& expected, const UnityEngine::GameObject& actual); } } } @@ -1080,7 +1090,7 @@ namespace UnityEngine float y; float z; void Set(float newX, float newY, float newZ); - UnityEngine::Vector3 operator+(UnityEngine::Vector3& a); + UnityEngine::Vector3 operator+(const UnityEngine::Vector3& a); UnityEngine::Vector3 operator-(); }; } @@ -1126,7 +1136,7 @@ namespace UnityEngine bool operator==(const RaycastHit& other) const; bool operator!=(const RaycastHit& other) const; UnityEngine::Vector3 GetPoint(); - void SetPoint(UnityEngine::Vector3& value); + void SetPoint(const UnityEngine::Vector3& value); UnityEngine::Transform GetTransform(); }; } @@ -1149,7 +1159,7 @@ namespace System KeyValuePair& operator=(KeyValuePair&& other); bool operator==(const KeyValuePair& other) const; bool operator!=(const KeyValuePair& other) const; - KeyValuePair(System::String key, double value); + KeyValuePair(const System::String& key, double value); System::String GetKey(); double GetValue(); }; @@ -1177,9 +1187,9 @@ namespace System bool operator!=(const List& other) const; List(); System::String GetItem(int32_t index); - void SetItem(int32_t index, System::String value); - void Add(System::String item); - void Sort(System::Collections::Generic::IComparer comparer); + void SetItem(int32_t index, const System::String& value); + void Add(const System::String& item); + void Sort(const System::Collections::Generic::IComparer& comparer); }; } } @@ -1207,7 +1217,7 @@ namespace System int32_t GetItem(int32_t index); void SetItem(int32_t index, int32_t value); void Add(int32_t item); - void Sort(System::Collections::Generic::IComparer comparer); + void Sort(const System::Collections::Generic::IComparer& comparer); }; } } @@ -1231,9 +1241,9 @@ namespace System LinkedListNode& operator=(LinkedListNode&& other); bool operator==(const LinkedListNode& other) const; bool operator!=(const LinkedListNode& other) const; - LinkedListNode(System::String value); + LinkedListNode(const System::String& value); System::String GetValue(); - void SetValue(System::String value); + void SetValue(const System::String& value); }; } } @@ -1257,9 +1267,9 @@ namespace System StrongBox& operator=(StrongBox&& other); bool operator==(const StrongBox& other) const; bool operator!=(const StrongBox& other) const; - StrongBox(System::String value); + StrongBox(const System::String& value); System::String GetValue(); - void SetValue(System::String value); + void SetValue(const System::String& value); }; } } @@ -1325,7 +1335,7 @@ namespace System Exception& operator=(Exception&& other); bool operator==(const Exception& other) const; bool operator!=(const Exception& other) const; - Exception(System::String message); + Exception(const System::String& message); }; } @@ -1403,7 +1413,7 @@ namespace UnityEngine struct Ray { Ray(); - Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); + Ray(const UnityEngine::Vector3& origin, const UnityEngine::Vector3& direction); UnityEngine::Vector3 m_Origin; UnityEngine::Vector3 m_Direction; }; @@ -1423,8 +1433,8 @@ namespace UnityEngine Physics& operator=(Physics&& other); bool operator==(const Physics& other) const; bool operator!=(const Physics& other) const; - static int32_t RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1 results); - static System::Array1 RaycastAll(UnityEngine::Ray& ray); + static int32_t RaycastNonAlloc(const UnityEngine::Ray& ray, const System::Array1& results); + static System::Array1 RaycastAll(const UnityEngine::Ray& ray); }; } @@ -1466,7 +1476,7 @@ namespace UnityEngine bool operator!=(const Gradient& other) const; Gradient(); System::Array1 GetColorKeys(); - void SetColorKeys(System::Array1 value); + void SetColorKeys(const System::Array1& value); }; } @@ -1486,7 +1496,7 @@ namespace System bool operator!=(const AppDomainSetup& other) const; AppDomainSetup(); System::AppDomainInitializer GetAppDomainInitializer(); - void SetAppDomainInitializer(System::AppDomainInitializer value); + void SetAppDomainInitializer(const System::AppDomainInitializer& value); }; } @@ -1504,8 +1514,8 @@ namespace UnityEngine Application& operator=(Application&& other); bool operator==(const Application& other) const; bool operator!=(const Application& other) const; - static void AddOnBeforeRender(UnityEngine::Events::UnityAction del); - static void RemoveOnBeforeRender(UnityEngine::Events::UnityAction del); + static void AddOnBeforeRender(const UnityEngine::Events::UnityAction& del); + static void RemoveOnBeforeRender(const UnityEngine::Events::UnityAction& del); }; } @@ -1525,8 +1535,8 @@ namespace UnityEngine SceneManager& operator=(SceneManager&& other); bool operator==(const SceneManager& other) const; bool operator!=(const SceneManager& other) const; - static void AddSceneLoaded(UnityEngine::Events::UnityAction2 del); - static void RemoveSceneLoaded(UnityEngine::Events::UnityAction2 del); + static void AddSceneLoaded(const UnityEngine::Events::UnityAction2& del); + static void RemoveSceneLoaded(const UnityEngine::Events::UnityAction2& del); }; } } @@ -1589,7 +1599,7 @@ namespace System bool operator!=(const IComparer& other) const; int32_t CppHandle; IComparer(); - virtual int32_t Compare(System::String x, System::String y); + virtual int32_t Compare(const System::String& x, const System::String& y); }; } } @@ -1611,9 +1621,9 @@ namespace System bool operator!=(const StringComparer& other) const; int32_t CppHandle; StringComparer(); - virtual int32_t Compare(System::String x, System::String y); - virtual System::Boolean Equals(System::String x, System::String y); - virtual int32_t GetHashCode(System::String obj); + virtual int32_t Compare(const System::String& x, const System::String& y); + virtual System::Boolean Equals(const System::String& x, const System::String& y); + virtual int32_t GetHashCode(const System::String& obj); }; } @@ -1655,7 +1665,7 @@ namespace MyGame bool operator!=(const TestScript& other) const; void Awake(); void OnAnimatorIK(int32_t param0); - void OnCollisionEnter(UnityEngine::Collision param0); + void OnCollisionEnter(const UnityEngine::Collision& param0); void Update(); }; } @@ -1999,8 +2009,8 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Action(); - void operator+=(System::Action& del); - void operator-=(System::Action& del); + void operator+=(const System::Action& del); + void operator-=(const System::Action& del); virtual void operator()(); void Invoke(); }; @@ -2023,8 +2033,8 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Action1(); - void operator+=(System::Action1& del); - void operator-=(System::Action1& del); + void operator+=(const System::Action1& del); + void operator-=(const System::Action1& del); virtual void operator()(float obj); void Invoke(float obj); }; @@ -2047,8 +2057,8 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Action2(); - void operator+=(System::Action2& del); - void operator-=(System::Action2& del); + void operator+=(const System::Action2& del); + void operator-=(const System::Action2& del); virtual void operator()(float arg1, float arg2); void Invoke(float arg1, float arg2); }; @@ -2071,8 +2081,8 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Func3(); - void operator+=(System::Func3& del); - void operator-=(System::Func3& del); + void operator+=(const System::Func3& del); + void operator-=(const System::Func3& del); virtual double operator()(int32_t arg1, float arg2); double Invoke(int32_t arg1, float arg2); }; @@ -2095,8 +2105,8 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Func3(); - void operator+=(System::Func3& del); - void operator-=(System::Func3& del); + void operator+=(const System::Func3& del); + void operator-=(const System::Func3& del); virtual System::String operator()(int16_t arg1, int32_t arg2); System::String Invoke(int16_t arg1, int32_t arg2); }; @@ -2119,10 +2129,10 @@ namespace System int32_t CppHandle; int32_t ClassHandle; AppDomainInitializer(); - void operator+=(System::AppDomainInitializer& del); - void operator-=(System::AppDomainInitializer& del); - virtual void operator()(System::Array1 args); - void Invoke(System::Array1 args); + void operator+=(const System::AppDomainInitializer& del); + void operator-=(const System::AppDomainInitializer& del); + virtual void operator()(const System::Array1& args); + void Invoke(const System::Array1& args); }; } @@ -2145,8 +2155,8 @@ namespace UnityEngine int32_t CppHandle; int32_t ClassHandle; UnityAction(); - void operator+=(UnityEngine::Events::UnityAction& del); - void operator-=(UnityEngine::Events::UnityAction& del); + void operator+=(const UnityEngine::Events::UnityAction& del); + void operator-=(const UnityEngine::Events::UnityAction& del); virtual void operator()(); void Invoke(); }; @@ -2172,10 +2182,10 @@ namespace UnityEngine int32_t CppHandle; int32_t ClassHandle; UnityAction2(); - void operator+=(UnityEngine::Events::UnityAction2& del); - void operator-=(UnityEngine::Events::UnityAction2& del); - virtual void operator()(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); - void Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); + void operator+=(const UnityEngine::Events::UnityAction2& del); + void operator-=(const UnityEngine::Events::UnityAction2& del); + virtual void operator()(const UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); + void Invoke(const UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); }; } } From 31c8826b78cc1bb3e3f95f358d8efcd82032d175 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 19 Nov 2017 18:30:09 -0800 Subject: [PATCH 39/95] Remove const qualifier from object parameter references --- .../NativeScript/Editor/GenerateBindings.cs | 11 - Unity/CppSource/Game/Game.cpp | 2 +- Unity/CppSource/NativeScript/Bindings.cpp | 190 +++++++++--------- Unity/CppSource/NativeScript/Bindings.h | 124 ++++++------ 4 files changed, 158 insertions(+), 169 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 5a83f1d..6731bf1 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -10542,16 +10542,6 @@ static void AppendCppParameterDeclaration( { ParameterInfo param = parameters[i]; - // Const qualifier if necessary - if ((!param.IsOut && !param.IsRef) && - (param.Kind == TypeKind.FullStruct || - param.Kind == TypeKind.ManagedStruct || - param.Kind == TypeKind.Class || - param.IsVirtual)) - { - output.Append("const "); - } - AppendCppTypeName( param.DereferencedParameterType, output); @@ -10918,7 +10908,6 @@ static void AppendCppFunctionPointer( } break; case TypeKind.FullStruct: - output.Append("const "); AppendCppTypeName( param.DereferencedParameterType, output); diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index b78e177..c8c1285 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -39,7 +39,7 @@ void MyGame::MonoBehaviours::TestScript::OnAnimatorIK(int32_t param0) Debug::Log(message); } -void MyGame::MonoBehaviours::TestScript::OnCollisionEnter(const UnityEngine::Collision& param0) +void MyGame::MonoBehaviours::TestScript::OnCollisionEnter(UnityEngine::Collision& param0) { String message("C++ TestScript OnCollisionEnter"); Debug::Log(message); diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 4a531e8..87b888a 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -55,7 +55,7 @@ namespace Plugin int32_t (*UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle); int32_t (*UnityEngineComponentPropertyGetTransform)(int32_t thisHandle); UnityEngine::Vector3 (*UnityEngineTransformPropertyGetPosition)(int32_t thisHandle); - void (*UnityEngineTransformPropertySetPosition)(int32_t thisHandle, const UnityEngine::Vector3& value); + void (*UnityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value); void (*UnityEngineDebugMethodLogSystemObject)(int32_t messageHandle); System::Boolean (*UnityEngineAssertionsAssertFieldGetRaiseExceptions)(); void (*UnityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value); @@ -67,17 +67,17 @@ namespace Plugin UnityEngine::Vector3 (*UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z); float (*UnityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz); void (*UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ); - UnityEngine::Vector3 (*UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(const UnityEngine::Vector3& a, const UnityEngine::Vector3& b); - UnityEngine::Vector3 (*UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(const UnityEngine::Vector3& a); - int32_t (*BoxVector3)(const UnityEngine::Vector3& val); + UnityEngine::Vector3 (*UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b); + UnityEngine::Vector3 (*UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a); + int32_t (*BoxVector3)(UnityEngine::Vector3& val); UnityEngine::Vector3 (*UnboxVector3)(int32_t valHandle); float (*UnityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column); void (*UnityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value); - int32_t (*BoxMatrix4x4)(const UnityEngine::Matrix4x4& val); + int32_t (*BoxMatrix4x4)(UnityEngine::Matrix4x4& val); UnityEngine::Matrix4x4 (*UnboxMatrix4x4)(int32_t valHandle); void (*ReleaseUnityEngineRaycastHit)(int32_t handle); UnityEngine::Vector3 (*UnityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle); - void (*UnityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, const UnityEngine::Vector3& value); + void (*UnityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value); int32_t (*UnityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle); int32_t (*BoxRaycastHit)(int32_t valHandle); int32_t (*UnboxRaycastHit)(int32_t valHandle); @@ -112,17 +112,17 @@ namespace Plugin void (*UnityEngineResolutionPropertySetHeight)(UnityEngine::Resolution* thiz, int32_t value); int32_t (*UnityEngineResolutionPropertyGetRefreshRate)(UnityEngine::Resolution* thiz); void (*UnityEngineResolutionPropertySetRefreshRate)(UnityEngine::Resolution* thiz, int32_t value); - int32_t (*BoxResolution)(const UnityEngine::Resolution& val); + int32_t (*BoxResolution)(UnityEngine::Resolution& val); UnityEngine::Resolution (*UnboxResolution)(int32_t valHandle); int32_t (*UnityEngineScreenPropertyGetResolutions)(); - UnityEngine::Ray (*UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(const UnityEngine::Vector3& origin, const UnityEngine::Vector3& direction); - int32_t (*BoxRay)(const UnityEngine::Ray& val); + UnityEngine::Ray (*UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); + int32_t (*BoxRay)(UnityEngine::Ray& val); UnityEngine::Ray (*UnboxRay)(int32_t valHandle); - int32_t (*UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)(const UnityEngine::Ray& ray, int32_t resultsHandle); - int32_t (*UnityEnginePhysicsMethodRaycastAllUnityEngineRay)(const UnityEngine::Ray& ray); - int32_t (*BoxColor)(const UnityEngine::Color& val); + int32_t (*UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)(UnityEngine::Ray& ray, int32_t resultsHandle); + int32_t (*UnityEnginePhysicsMethodRaycastAllUnityEngineRay)(UnityEngine::Ray& ray); + int32_t (*BoxColor)(UnityEngine::Color& val); UnityEngine::Color (*UnboxColor)(int32_t valHandle); - int32_t (*BoxGradientColorKey)(const UnityEngine::GradientColorKey& val); + int32_t (*BoxGradientColorKey)(UnityEngine::GradientColorKey& val); UnityEngine::GradientColorKey (*UnboxGradientColorKey)(int32_t valHandle); int32_t (*UnityEngineGradientConstructor)(); int32_t (*UnityEngineGradientPropertyGetColorKeys)(int32_t thisHandle); @@ -134,7 +134,7 @@ namespace Plugin void (*UnityEngineApplicationRemoveEventOnBeforeRender)(int32_t delHandle); void (*UnityEngineSceneManagementSceneManagerAddEventSceneLoaded)(int32_t delHandle); void (*UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)(int32_t delHandle); - int32_t (*BoxScene)(const UnityEngine::SceneManagement::Scene& val); + int32_t (*BoxScene)(UnityEngine::SceneManagement::Scene& val); UnityEngine::SceneManagement::Scene (*UnboxScene)(int32_t valHandle); int32_t (*BoxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val); UnityEngine::SceneManagement::LoadSceneMode (*UnboxLoadSceneMode)(int32_t valHandle); @@ -189,13 +189,13 @@ namespace Plugin int32_t (*SystemStringArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle); int32_t (*UnityEngineUnityEngineResolutionArray1Constructor1)(int32_t length0); UnityEngine::Resolution (*UnityEngineResolutionArray1GetItem1)(int32_t thisHandle, int32_t index0); - int32_t (*UnityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, const UnityEngine::Resolution& item); + int32_t (*UnityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::Resolution& item); int32_t (*UnityEngineUnityEngineRaycastHitArray1Constructor1)(int32_t length0); int32_t (*UnityEngineRaycastHitArray1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*UnityEngineRaycastHitArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle); int32_t (*UnityEngineUnityEngineGradientColorKeyArray1Constructor1)(int32_t length0); UnityEngine::GradientColorKey (*UnityEngineGradientColorKeyArray1GetItem1)(int32_t thisHandle, int32_t index0); - int32_t (*UnityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, const UnityEngine::GradientColorKey& item); + int32_t (*UnityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item); void (*ReleaseSystemAction)(int32_t handle, int32_t classHandle); void (*SystemActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); void (*SystemActionAdd)(int32_t thisHandle, int32_t delHandle); @@ -235,7 +235,7 @@ namespace Plugin void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)(int32_t thisHandle, int32_t delHandle); void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle); - void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, const UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); + void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); /*END FUNCTION POINTERS*/ } @@ -1028,7 +1028,7 @@ namespace UnityEngine return System::String(Plugin::InternalUse::Only, returnValue); } - void Object::SetName(const System::String& value) + void Object::SetName(System::String& value) { Plugin::UnityEngineObjectPropertySetName(Handle, value.Handle); if (Plugin::unhandledCsharpException) @@ -1040,7 +1040,7 @@ namespace UnityEngine } } - System::Boolean Object::operator==(const UnityEngine::Object& x) + System::Boolean Object::operator==(UnityEngine::Object& x) { auto returnValue = Plugin::UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject(Handle, x.Handle); if (Plugin::unhandledCsharpException) @@ -1166,7 +1166,7 @@ namespace UnityEngine } } - GameObject::GameObject(const System::String& name) + GameObject::GameObject(System::String& name) : UnityEngine::Object(nullptr) { auto returnValue = Plugin::UnityEngineGameObjectConstructorSystemString(name.Handle); @@ -1400,7 +1400,7 @@ namespace UnityEngine return returnValue; } - void Transform::SetPosition(const UnityEngine::Vector3& value) + void Transform::SetPosition(UnityEngine::Vector3& value) { Plugin::UnityEngineTransformPropertySetPosition(Handle, value); if (Plugin::unhandledCsharpException) @@ -1494,7 +1494,7 @@ namespace UnityEngine return Handle != other.Handle; } - void Debug::Log(const System::Object& message) + void Debug::Log(System::Object& message) { Plugin::UnityEngineDebugMethodLogSystemObject(message.Handle); if (Plugin::unhandledCsharpException) @@ -1536,7 +1536,7 @@ namespace UnityEngine } } - template<> void Assert::AreEqual(const System::String& expected, const System::String& actual) + template<> void Assert::AreEqual(System::String& expected, System::String& actual) { Plugin::UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(expected.Handle, actual.Handle); if (Plugin::unhandledCsharpException) @@ -1548,7 +1548,7 @@ namespace UnityEngine } } - template<> void Assert::AreEqual(const UnityEngine::GameObject& expected, const UnityEngine::GameObject& actual) + template<> void Assert::AreEqual(UnityEngine::GameObject& expected, UnityEngine::GameObject& actual) { Plugin::UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(expected.Handle, actual.Handle); if (Plugin::unhandledCsharpException) @@ -2065,7 +2065,7 @@ namespace UnityEngine } } - UnityEngine::Vector3 Vector3::operator+(const UnityEngine::Vector3& a) + UnityEngine::Vector3 Vector3::operator+(UnityEngine::Vector3& a) { auto returnValue = Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(*this, a); if (Plugin::unhandledCsharpException) @@ -2094,7 +2094,7 @@ namespace UnityEngine namespace System { - Object::Object(const UnityEngine::Vector3& val) + Object::Object(UnityEngine::Vector3& val) { int32_t handle = Plugin::BoxVector3(val); if (Plugin::unhandledCsharpException) @@ -2159,7 +2159,7 @@ namespace UnityEngine namespace System { - Object::Object(const UnityEngine::Matrix4x4& val) + Object::Object(UnityEngine::Matrix4x4& val) { int32_t handle = Plugin::BoxMatrix4x4(val); if (Plugin::unhandledCsharpException) @@ -2284,7 +2284,7 @@ namespace UnityEngine return returnValue; } - void RaycastHit::SetPoint(const UnityEngine::Vector3& value) + void RaycastHit::SetPoint(UnityEngine::Vector3& value) { Plugin::UnityEngineRaycastHitPropertySetPoint(Handle, value); if (Plugin::unhandledCsharpException) @@ -2312,7 +2312,7 @@ namespace UnityEngine namespace System { - Object::Object(const UnityEngine::RaycastHit& val) + Object::Object(UnityEngine::RaycastHit& val) { int32_t handle = Plugin::BoxRaycastHit(val.Handle); if (Plugin::unhandledCsharpException) @@ -2461,7 +2461,7 @@ namespace System return Handle != other.Handle; } - KeyValuePair::KeyValuePair(const System::String& key, double value) + KeyValuePair::KeyValuePair(System::String& key, double value) : System::ValueType(nullptr) { auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(key.Handle, value); @@ -2510,7 +2510,7 @@ namespace System namespace System { - Object::Object(const System::Collections::Generic::KeyValuePair& val) + Object::Object(System::Collections::Generic::KeyValuePair& val) { int32_t handle = Plugin::BoxKeyValuePairSystemString_SystemDouble(val.Handle); if (Plugin::unhandledCsharpException) @@ -2657,7 +2657,7 @@ namespace System return System::String(Plugin::InternalUse::Only, returnValue); } - void List::SetItem(int32_t index, const System::String& value) + void List::SetItem(int32_t index, System::String& value) { Plugin::SystemCollectionsGenericListSystemStringPropertySetItem(Handle, index, value.Handle); if (Plugin::unhandledCsharpException) @@ -2669,7 +2669,7 @@ namespace System } } - void List::Add(const System::String& item) + void List::Add(System::String& item) { Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString(Handle, item.Handle); if (Plugin::unhandledCsharpException) @@ -2681,7 +2681,7 @@ namespace System } } - void List::Sort(const System::Collections::Generic::IComparer& comparer) + void List::Sort(System::Collections::Generic::IComparer& comparer) { Plugin::SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); if (Plugin::unhandledCsharpException) @@ -2836,7 +2836,7 @@ namespace System } } - void List::Sort(const System::Collections::Generic::IComparer& comparer) + void List::Sort(System::Collections::Generic::IComparer& comparer) { Plugin::SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); if (Plugin::unhandledCsharpException) @@ -2936,7 +2936,7 @@ namespace System return Handle != other.Handle; } - LinkedListNode::LinkedListNode(const System::String& value) + LinkedListNode::LinkedListNode(System::String& value) : System::Object(nullptr) { auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(value.Handle); @@ -2967,7 +2967,7 @@ namespace System return System::String(Plugin::InternalUse::Only, returnValue); } - void LinkedListNode::SetValue(const System::String& value) + void LinkedListNode::SetValue(System::String& value) { Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(Handle, value.Handle); if (Plugin::unhandledCsharpException) @@ -3067,7 +3067,7 @@ namespace System return Handle != other.Handle; } - StrongBox::StrongBox(const System::String& value) + StrongBox::StrongBox(System::String& value) : System::Object(nullptr) { auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(value.Handle); @@ -3098,7 +3098,7 @@ namespace System return System::String(Plugin::InternalUse::Only, returnValue); } - void StrongBox::SetValue(const System::String& value) + void StrongBox::SetValue(System::String& value) { Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(Handle, value.Handle); if (Plugin::unhandledCsharpException) @@ -3370,7 +3370,7 @@ namespace System return Handle != other.Handle; } - Exception::Exception(const System::String& message) + Exception::Exception(System::String& message) : System::Object(nullptr) { auto returnValue = Plugin::SystemExceptionConstructorSystemString(message.Handle); @@ -3637,7 +3637,7 @@ namespace UnityEngine namespace System { - Object::Object(const UnityEngine::Resolution& val) + Object::Object(UnityEngine::Resolution& val) { int32_t handle = Plugin::BoxResolution(val); if (Plugin::unhandledCsharpException) @@ -3769,7 +3769,7 @@ namespace UnityEngine { } - Ray::Ray(const UnityEngine::Vector3& origin, const UnityEngine::Vector3& direction) + Ray::Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction) { auto returnValue = Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(origin, direction); if (Plugin::unhandledCsharpException) @@ -3785,7 +3785,7 @@ namespace UnityEngine namespace System { - Object::Object(const UnityEngine::Ray& val) + Object::Object(UnityEngine::Ray& val) { int32_t handle = Plugin::BoxRay(val); if (Plugin::unhandledCsharpException) @@ -3897,7 +3897,7 @@ namespace UnityEngine return Handle != other.Handle; } - int32_t Physics::RaycastNonAlloc(const UnityEngine::Ray& ray, const System::Array1& results) + int32_t Physics::RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1& results) { auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit(ray, results.Handle); if (Plugin::unhandledCsharpException) @@ -3910,7 +3910,7 @@ namespace UnityEngine return returnValue; } - System::Array1 Physics::RaycastAll(const UnityEngine::Ray& ray) + System::Array1 Physics::RaycastAll(UnityEngine::Ray& ray) { auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ray); if (Plugin::unhandledCsharpException) @@ -3933,7 +3933,7 @@ namespace UnityEngine namespace System { - Object::Object(const UnityEngine::Color& val) + Object::Object(UnityEngine::Color& val) { int32_t handle = Plugin::BoxColor(val); if (Plugin::unhandledCsharpException) @@ -3973,7 +3973,7 @@ namespace UnityEngine namespace System { - Object::Object(const UnityEngine::GradientColorKey& val) + Object::Object(UnityEngine::GradientColorKey& val) { int32_t handle = Plugin::BoxGradientColorKey(val); if (Plugin::unhandledCsharpException) @@ -4116,7 +4116,7 @@ namespace UnityEngine return System::Array1(Plugin::InternalUse::Only, returnValue); } - void Gradient::SetColorKeys(const System::Array1& value) + void Gradient::SetColorKeys(System::Array1& value) { Plugin::UnityEngineGradientPropertySetColorKeys(Handle, value.Handle); if (Plugin::unhandledCsharpException) @@ -4241,7 +4241,7 @@ namespace System return System::AppDomainInitializer(Plugin::InternalUse::Only, returnValue); } - void AppDomainSetup::SetAppDomainInitializer(const System::AppDomainInitializer& value) + void AppDomainSetup::SetAppDomainInitializer(System::AppDomainInitializer& value) { Plugin::SystemAppDomainSetupPropertySetAppDomainInitializer(Handle, value.Handle); if (Plugin::unhandledCsharpException) @@ -4335,7 +4335,7 @@ namespace UnityEngine return Handle != other.Handle; } - void Application::AddOnBeforeRender(const UnityEngine::Events::UnityAction& del) + void Application::AddOnBeforeRender(UnityEngine::Events::UnityAction& del) { Plugin::UnityEngineApplicationAddEventOnBeforeRender(del.Handle); if (Plugin::unhandledCsharpException) @@ -4347,7 +4347,7 @@ namespace UnityEngine } } - void Application::RemoveOnBeforeRender(const UnityEngine::Events::UnityAction& del) + void Application::RemoveOnBeforeRender(UnityEngine::Events::UnityAction& del) { Plugin::UnityEngineApplicationRemoveEventOnBeforeRender(del.Handle); if (Plugin::unhandledCsharpException) @@ -4443,7 +4443,7 @@ namespace UnityEngine return Handle != other.Handle; } - void SceneManager::AddSceneLoaded(const UnityEngine::Events::UnityAction2& del) + void SceneManager::AddSceneLoaded(UnityEngine::Events::UnityAction2& del) { Plugin::UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(del.Handle); if (Plugin::unhandledCsharpException) @@ -4455,7 +4455,7 @@ namespace UnityEngine } } - void SceneManager::RemoveSceneLoaded(const UnityEngine::Events::UnityAction2& del) + void SceneManager::RemoveSceneLoaded(UnityEngine::Events::UnityAction2& del) { Plugin::UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(del.Handle); if (Plugin::unhandledCsharpException) @@ -4481,7 +4481,7 @@ namespace UnityEngine namespace System { - Object::Object(const UnityEngine::SceneManagement::Scene& val) + Object::Object(UnityEngine::SceneManagement::Scene& val) { int32_t handle = Plugin::BoxScene(val); if (Plugin::unhandledCsharpException) @@ -4885,7 +4885,7 @@ namespace System return Handle != other.Handle; } - int32_t IComparer::Compare(const System::String& x, const System::String& y) + int32_t IComparer::Compare(System::String& x, System::String& y) { return {}; } @@ -5067,7 +5067,7 @@ namespace System return Handle != other.Handle; } - int32_t StringComparer::Compare(const System::String& x, const System::String& y) + int32_t StringComparer::Compare(System::String& x, System::String& y) { return {}; } @@ -5094,7 +5094,7 @@ namespace System } } - System::Boolean StringComparer::Equals(const System::String& x, const System::String& y) + System::Boolean StringComparer::Equals(System::String& x, System::String& y) { return {}; } @@ -5121,7 +5121,7 @@ namespace System } } - int32_t StringComparer::GetHashCode(const System::String& obj) + int32_t StringComparer::GetHashCode(System::String& obj) { return {}; } @@ -7528,7 +7528,7 @@ namespace System return Handle != other.Handle; } - void Action::operator+=(const System::Action& del) + void Action::operator+=(System::Action& del) { Plugin::SystemActionAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -7540,7 +7540,7 @@ namespace System } } - void Action::operator-=(const System::Action& del) + void Action::operator-=(System::Action& del) { Plugin::SystemActionRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -7755,7 +7755,7 @@ namespace System return Handle != other.Handle; } - void Action1::operator+=(const System::Action1& del) + void Action1::operator+=(System::Action1& del) { Plugin::SystemActionSystemSingleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -7767,7 +7767,7 @@ namespace System } } - void Action1::operator-=(const System::Action1& del) + void Action1::operator-=(System::Action1& del) { Plugin::SystemActionSystemSingleRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -7982,7 +7982,7 @@ namespace System return Handle != other.Handle; } - void Action2::operator+=(const System::Action2& del) + void Action2::operator+=(System::Action2& del) { Plugin::SystemActionSystemSingle_SystemSingleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -7994,7 +7994,7 @@ namespace System } } - void Action2::operator-=(const System::Action2& del) + void Action2::operator-=(System::Action2& del) { Plugin::SystemActionSystemSingle_SystemSingleRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8209,7 +8209,7 @@ namespace System return Handle != other.Handle; } - void Func3::operator+=(const System::Func3& del) + void Func3::operator+=(System::Func3& del) { Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8221,7 +8221,7 @@ namespace System } } - void Func3::operator-=(const System::Func3& del) + void Func3::operator-=(System::Func3& del) { Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8440,7 +8440,7 @@ namespace System return Handle != other.Handle; } - void Func3::operator+=(const System::Func3& del) + void Func3::operator+=(System::Func3& del) { Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8452,7 +8452,7 @@ namespace System } } - void Func3::operator-=(const System::Func3& del) + void Func3::operator-=(System::Func3& del) { Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8671,7 +8671,7 @@ namespace System return Handle != other.Handle; } - void AppDomainInitializer::operator+=(const System::AppDomainInitializer& del) + void AppDomainInitializer::operator+=(System::AppDomainInitializer& del) { Plugin::SystemAppDomainInitializerAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8683,7 +8683,7 @@ namespace System } } - void AppDomainInitializer::operator-=(const System::AppDomainInitializer& del) + void AppDomainInitializer::operator-=(System::AppDomainInitializer& del) { Plugin::SystemAppDomainInitializerRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8695,7 +8695,7 @@ namespace System } } - void AppDomainInitializer::operator()(const System::Array1& args) + void AppDomainInitializer::operator()(System::Array1& args) { } @@ -8718,7 +8718,7 @@ namespace System } } - void AppDomainInitializer::Invoke(const System::Array1& args) + void AppDomainInitializer::Invoke(System::Array1& args) { Plugin::SystemAppDomainInitializerInvoke(Handle, args.Handle); if (Plugin::unhandledCsharpException) @@ -8901,7 +8901,7 @@ namespace UnityEngine return Handle != other.Handle; } - void UnityAction::operator+=(const UnityEngine::Events::UnityAction& del) + void UnityAction::operator+=(UnityEngine::Events::UnityAction& del) { Plugin::UnityEngineEventsUnityActionAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -8913,7 +8913,7 @@ namespace UnityEngine } } - void UnityAction::operator-=(const UnityEngine::Events::UnityAction& del) + void UnityAction::operator-=(UnityEngine::Events::UnityAction& del) { Plugin::UnityEngineEventsUnityActionRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -9131,7 +9131,7 @@ namespace UnityEngine return Handle != other.Handle; } - void UnityAction2::operator+=(const UnityEngine::Events::UnityAction2& del) + void UnityAction2::operator+=(UnityEngine::Events::UnityAction2& del) { Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -9143,7 +9143,7 @@ namespace UnityEngine } } - void UnityAction2::operator-=(const UnityEngine::Events::UnityAction2& del) + void UnityAction2::operator-=(UnityEngine::Events::UnityAction2& del) { Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -9155,7 +9155,7 @@ namespace UnityEngine } } - void UnityAction2::operator()(const UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + void UnityAction2::operator()(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) { } @@ -9177,7 +9177,7 @@ namespace UnityEngine } } - void UnityAction2::Invoke(const UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + void UnityAction2::Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) { Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(Handle, arg0, arg1); if (Plugin::unhandledCsharpException) @@ -9248,7 +9248,7 @@ DLLEXPORT void Init( int32_t (*unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle), int32_t (*unityEngineComponentPropertyGetTransform)(int32_t thisHandle), UnityEngine::Vector3 (*unityEngineTransformPropertyGetPosition)(int32_t thisHandle), - void (*unityEngineTransformPropertySetPosition)(int32_t thisHandle, const UnityEngine::Vector3& value), + void (*unityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value), void (*unityEngineDebugMethodLogSystemObject)(int32_t messageHandle), System::Boolean (*unityEngineAssertionsAssertFieldGetRaiseExceptions)(), void (*unityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value), @@ -9260,17 +9260,17 @@ DLLEXPORT void Init( UnityEngine::Vector3 (*unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z), float (*unityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz), void (*unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ), - UnityEngine::Vector3 (*unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(const UnityEngine::Vector3& a, const UnityEngine::Vector3& b), - UnityEngine::Vector3 (*unityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(const UnityEngine::Vector3& a), - int32_t (*boxVector3)(const UnityEngine::Vector3& val), + UnityEngine::Vector3 (*unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b), + UnityEngine::Vector3 (*unityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a), + int32_t (*boxVector3)(UnityEngine::Vector3& val), UnityEngine::Vector3 (*unboxVector3)(int32_t valHandle), float (*unityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column), void (*unityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value), - int32_t (*boxMatrix4x4)(const UnityEngine::Matrix4x4& val), + int32_t (*boxMatrix4x4)(UnityEngine::Matrix4x4& val), UnityEngine::Matrix4x4 (*unboxMatrix4x4)(int32_t valHandle), void (*releaseUnityEngineRaycastHit)(int32_t handle), UnityEngine::Vector3 (*unityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle), - void (*unityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, const UnityEngine::Vector3& value), + void (*unityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value), int32_t (*unityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle), int32_t (*boxRaycastHit)(int32_t valHandle), int32_t (*unboxRaycastHit)(int32_t valHandle), @@ -9305,17 +9305,17 @@ DLLEXPORT void Init( void (*unityEngineResolutionPropertySetHeight)(UnityEngine::Resolution* thiz, int32_t value), int32_t (*unityEngineResolutionPropertyGetRefreshRate)(UnityEngine::Resolution* thiz), void (*unityEngineResolutionPropertySetRefreshRate)(UnityEngine::Resolution* thiz, int32_t value), - int32_t (*boxResolution)(const UnityEngine::Resolution& val), + int32_t (*boxResolution)(UnityEngine::Resolution& val), UnityEngine::Resolution (*unboxResolution)(int32_t valHandle), int32_t (*unityEngineScreenPropertyGetResolutions)(), - UnityEngine::Ray (*unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(const UnityEngine::Vector3& origin, const UnityEngine::Vector3& direction), - int32_t (*boxRay)(const UnityEngine::Ray& val), + UnityEngine::Ray (*unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction), + int32_t (*boxRay)(UnityEngine::Ray& val), UnityEngine::Ray (*unboxRay)(int32_t valHandle), - int32_t (*unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)(const UnityEngine::Ray& ray, int32_t resultsHandle), - int32_t (*unityEnginePhysicsMethodRaycastAllUnityEngineRay)(const UnityEngine::Ray& ray), - int32_t (*boxColor)(const UnityEngine::Color& val), + int32_t (*unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)(UnityEngine::Ray& ray, int32_t resultsHandle), + int32_t (*unityEnginePhysicsMethodRaycastAllUnityEngineRay)(UnityEngine::Ray& ray), + int32_t (*boxColor)(UnityEngine::Color& val), UnityEngine::Color (*unboxColor)(int32_t valHandle), - int32_t (*boxGradientColorKey)(const UnityEngine::GradientColorKey& val), + int32_t (*boxGradientColorKey)(UnityEngine::GradientColorKey& val), UnityEngine::GradientColorKey (*unboxGradientColorKey)(int32_t valHandle), int32_t (*unityEngineGradientConstructor)(), int32_t (*unityEngineGradientPropertyGetColorKeys)(int32_t thisHandle), @@ -9327,7 +9327,7 @@ DLLEXPORT void Init( void (*unityEngineApplicationRemoveEventOnBeforeRender)(int32_t delHandle), void (*unityEngineSceneManagementSceneManagerAddEventSceneLoaded)(int32_t delHandle), void (*unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)(int32_t delHandle), - int32_t (*boxScene)(const UnityEngine::SceneManagement::Scene& val), + int32_t (*boxScene)(UnityEngine::SceneManagement::Scene& val), UnityEngine::SceneManagement::Scene (*unboxScene)(int32_t valHandle), int32_t (*boxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val), UnityEngine::SceneManagement::LoadSceneMode (*unboxLoadSceneMode)(int32_t valHandle), @@ -9382,13 +9382,13 @@ DLLEXPORT void Init( int32_t (*systemStringArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), int32_t (*unityEngineUnityEngineResolutionArray1Constructor1)(int32_t length0), UnityEngine::Resolution (*unityEngineResolutionArray1GetItem1)(int32_t thisHandle, int32_t index0), - int32_t (*unityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, const UnityEngine::Resolution& item), + int32_t (*unityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::Resolution& item), int32_t (*unityEngineUnityEngineRaycastHitArray1Constructor1)(int32_t length0), int32_t (*unityEngineRaycastHitArray1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*unityEngineRaycastHitArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), int32_t (*unityEngineUnityEngineGradientColorKeyArray1Constructor1)(int32_t length0), UnityEngine::GradientColorKey (*unityEngineGradientColorKeyArray1GetItem1)(int32_t thisHandle, int32_t index0), - int32_t (*unityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, const UnityEngine::GradientColorKey& item), + int32_t (*unityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item), void (*releaseSystemAction)(int32_t handle, int32_t classHandle), void (*systemActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), void (*systemActionAdd)(int32_t thisHandle, int32_t delHandle), @@ -9428,7 +9428,7 @@ DLLEXPORT void Init( void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)(int32_t thisHandle, int32_t delHandle), void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle), - void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, const UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) /*END INIT PARAMS*/) { using namespace Plugin; diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 37f505d..61dd7ca 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -773,25 +773,25 @@ namespace System virtual void ThrowReferenceToThis(); /*BEGIN BOXING METHOD DECLARATIONS*/ - Object(const UnityEngine::Vector3& val); + Object(UnityEngine::Vector3& val); explicit operator UnityEngine::Vector3(); - Object(const UnityEngine::Matrix4x4& val); + Object(UnityEngine::Matrix4x4& val); explicit operator UnityEngine::Matrix4x4(); - Object(const UnityEngine::RaycastHit& val); + Object(UnityEngine::RaycastHit& val); explicit operator UnityEngine::RaycastHit(); Object(UnityEngine::QueryTriggerInteraction val); explicit operator UnityEngine::QueryTriggerInteraction(); - Object(const System::Collections::Generic::KeyValuePair& val); + Object(System::Collections::Generic::KeyValuePair& val); explicit operator System::Collections::Generic::KeyValuePair(); - Object(const UnityEngine::Resolution& val); + Object(UnityEngine::Resolution& val); explicit operator UnityEngine::Resolution(); - Object(const UnityEngine::Ray& val); + Object(UnityEngine::Ray& val); explicit operator UnityEngine::Ray(); - Object(const UnityEngine::Color& val); + Object(UnityEngine::Color& val); explicit operator UnityEngine::Color(); - Object(const UnityEngine::GradientColorKey& val); + Object(UnityEngine::GradientColorKey& val); explicit operator UnityEngine::GradientColorKey(); - Object(const UnityEngine::SceneManagement::Scene& val); + Object(UnityEngine::SceneManagement::Scene& val); explicit operator UnityEngine::SceneManagement::Scene(); Object(UnityEngine::SceneManagement::LoadSceneMode val); explicit operator UnityEngine::SceneManagement::LoadSceneMode(); @@ -892,8 +892,8 @@ namespace UnityEngine bool operator==(const Object& other) const; bool operator!=(const Object& other) const; System::String GetName(); - void SetName(const System::String& value); - System::Boolean operator==(const UnityEngine::Object& x); + void SetName(System::String& value); + System::Boolean operator==(UnityEngine::Object& x); operator System::Boolean(); }; } @@ -913,7 +913,7 @@ namespace UnityEngine bool operator==(const GameObject& other) const; bool operator!=(const GameObject& other) const; GameObject(); - GameObject(const System::String& name); + GameObject(System::String& name); UnityEngine::Transform GetTransform(); template MyGame::MonoBehaviours::TestScript AddComponent(); }; @@ -952,7 +952,7 @@ namespace UnityEngine bool operator==(const Transform& other) const; bool operator!=(const Transform& other) const; UnityEngine::Vector3 GetPosition(); - void SetPosition(const UnityEngine::Vector3& value); + void SetPosition(UnityEngine::Vector3& value); }; } @@ -970,7 +970,7 @@ namespace UnityEngine Debug& operator=(Debug&& other); bool operator==(const Debug& other) const; bool operator!=(const Debug& other) const; - static void Log(const System::Object& message); + static void Log(System::Object& message); }; } @@ -982,8 +982,8 @@ namespace UnityEngine { System::Boolean GetRaiseExceptions(); void SetRaiseExceptions(System::Boolean value); - template void AreEqual(const System::String& expected, const System::String& actual); - template void AreEqual(const UnityEngine::GameObject& expected, const UnityEngine::GameObject& actual); + template void AreEqual(System::String& expected, System::String& actual); + template void AreEqual(UnityEngine::GameObject& expected, UnityEngine::GameObject& actual); } } } @@ -1090,7 +1090,7 @@ namespace UnityEngine float y; float z; void Set(float newX, float newY, float newZ); - UnityEngine::Vector3 operator+(const UnityEngine::Vector3& a); + UnityEngine::Vector3 operator+(UnityEngine::Vector3& a); UnityEngine::Vector3 operator-(); }; } @@ -1136,7 +1136,7 @@ namespace UnityEngine bool operator==(const RaycastHit& other) const; bool operator!=(const RaycastHit& other) const; UnityEngine::Vector3 GetPoint(); - void SetPoint(const UnityEngine::Vector3& value); + void SetPoint(UnityEngine::Vector3& value); UnityEngine::Transform GetTransform(); }; } @@ -1159,7 +1159,7 @@ namespace System KeyValuePair& operator=(KeyValuePair&& other); bool operator==(const KeyValuePair& other) const; bool operator!=(const KeyValuePair& other) const; - KeyValuePair(const System::String& key, double value); + KeyValuePair(System::String& key, double value); System::String GetKey(); double GetValue(); }; @@ -1187,9 +1187,9 @@ namespace System bool operator!=(const List& other) const; List(); System::String GetItem(int32_t index); - void SetItem(int32_t index, const System::String& value); - void Add(const System::String& item); - void Sort(const System::Collections::Generic::IComparer& comparer); + void SetItem(int32_t index, System::String& value); + void Add(System::String& item); + void Sort(System::Collections::Generic::IComparer& comparer); }; } } @@ -1217,7 +1217,7 @@ namespace System int32_t GetItem(int32_t index); void SetItem(int32_t index, int32_t value); void Add(int32_t item); - void Sort(const System::Collections::Generic::IComparer& comparer); + void Sort(System::Collections::Generic::IComparer& comparer); }; } } @@ -1241,9 +1241,9 @@ namespace System LinkedListNode& operator=(LinkedListNode&& other); bool operator==(const LinkedListNode& other) const; bool operator!=(const LinkedListNode& other) const; - LinkedListNode(const System::String& value); + LinkedListNode(System::String& value); System::String GetValue(); - void SetValue(const System::String& value); + void SetValue(System::String& value); }; } } @@ -1267,9 +1267,9 @@ namespace System StrongBox& operator=(StrongBox&& other); bool operator==(const StrongBox& other) const; bool operator!=(const StrongBox& other) const; - StrongBox(const System::String& value); + StrongBox(System::String& value); System::String GetValue(); - void SetValue(const System::String& value); + void SetValue(System::String& value); }; } } @@ -1335,7 +1335,7 @@ namespace System Exception& operator=(Exception&& other); bool operator==(const Exception& other) const; bool operator!=(const Exception& other) const; - Exception(const System::String& message); + Exception(System::String& message); }; } @@ -1413,7 +1413,7 @@ namespace UnityEngine struct Ray { Ray(); - Ray(const UnityEngine::Vector3& origin, const UnityEngine::Vector3& direction); + Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); UnityEngine::Vector3 m_Origin; UnityEngine::Vector3 m_Direction; }; @@ -1433,8 +1433,8 @@ namespace UnityEngine Physics& operator=(Physics&& other); bool operator==(const Physics& other) const; bool operator!=(const Physics& other) const; - static int32_t RaycastNonAlloc(const UnityEngine::Ray& ray, const System::Array1& results); - static System::Array1 RaycastAll(const UnityEngine::Ray& ray); + static int32_t RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1& results); + static System::Array1 RaycastAll(UnityEngine::Ray& ray); }; } @@ -1476,7 +1476,7 @@ namespace UnityEngine bool operator!=(const Gradient& other) const; Gradient(); System::Array1 GetColorKeys(); - void SetColorKeys(const System::Array1& value); + void SetColorKeys(System::Array1& value); }; } @@ -1496,7 +1496,7 @@ namespace System bool operator!=(const AppDomainSetup& other) const; AppDomainSetup(); System::AppDomainInitializer GetAppDomainInitializer(); - void SetAppDomainInitializer(const System::AppDomainInitializer& value); + void SetAppDomainInitializer(System::AppDomainInitializer& value); }; } @@ -1514,8 +1514,8 @@ namespace UnityEngine Application& operator=(Application&& other); bool operator==(const Application& other) const; bool operator!=(const Application& other) const; - static void AddOnBeforeRender(const UnityEngine::Events::UnityAction& del); - static void RemoveOnBeforeRender(const UnityEngine::Events::UnityAction& del); + static void AddOnBeforeRender(UnityEngine::Events::UnityAction& del); + static void RemoveOnBeforeRender(UnityEngine::Events::UnityAction& del); }; } @@ -1535,8 +1535,8 @@ namespace UnityEngine SceneManager& operator=(SceneManager&& other); bool operator==(const SceneManager& other) const; bool operator!=(const SceneManager& other) const; - static void AddSceneLoaded(const UnityEngine::Events::UnityAction2& del); - static void RemoveSceneLoaded(const UnityEngine::Events::UnityAction2& del); + static void AddSceneLoaded(UnityEngine::Events::UnityAction2& del); + static void RemoveSceneLoaded(UnityEngine::Events::UnityAction2& del); }; } } @@ -1599,7 +1599,7 @@ namespace System bool operator!=(const IComparer& other) const; int32_t CppHandle; IComparer(); - virtual int32_t Compare(const System::String& x, const System::String& y); + virtual int32_t Compare(System::String& x, System::String& y); }; } } @@ -1621,9 +1621,9 @@ namespace System bool operator!=(const StringComparer& other) const; int32_t CppHandle; StringComparer(); - virtual int32_t Compare(const System::String& x, const System::String& y); - virtual System::Boolean Equals(const System::String& x, const System::String& y); - virtual int32_t GetHashCode(const System::String& obj); + virtual int32_t Compare(System::String& x, System::String& y); + virtual System::Boolean Equals(System::String& x, System::String& y); + virtual int32_t GetHashCode(System::String& obj); }; } @@ -1665,7 +1665,7 @@ namespace MyGame bool operator!=(const TestScript& other) const; void Awake(); void OnAnimatorIK(int32_t param0); - void OnCollisionEnter(const UnityEngine::Collision& param0); + void OnCollisionEnter(UnityEngine::Collision& param0); void Update(); }; } @@ -2009,8 +2009,8 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Action(); - void operator+=(const System::Action& del); - void operator-=(const System::Action& del); + void operator+=(System::Action& del); + void operator-=(System::Action& del); virtual void operator()(); void Invoke(); }; @@ -2033,8 +2033,8 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Action1(); - void operator+=(const System::Action1& del); - void operator-=(const System::Action1& del); + void operator+=(System::Action1& del); + void operator-=(System::Action1& del); virtual void operator()(float obj); void Invoke(float obj); }; @@ -2057,8 +2057,8 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Action2(); - void operator+=(const System::Action2& del); - void operator-=(const System::Action2& del); + void operator+=(System::Action2& del); + void operator-=(System::Action2& del); virtual void operator()(float arg1, float arg2); void Invoke(float arg1, float arg2); }; @@ -2081,8 +2081,8 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Func3(); - void operator+=(const System::Func3& del); - void operator-=(const System::Func3& del); + void operator+=(System::Func3& del); + void operator-=(System::Func3& del); virtual double operator()(int32_t arg1, float arg2); double Invoke(int32_t arg1, float arg2); }; @@ -2105,8 +2105,8 @@ namespace System int32_t CppHandle; int32_t ClassHandle; Func3(); - void operator+=(const System::Func3& del); - void operator-=(const System::Func3& del); + void operator+=(System::Func3& del); + void operator-=(System::Func3& del); virtual System::String operator()(int16_t arg1, int32_t arg2); System::String Invoke(int16_t arg1, int32_t arg2); }; @@ -2129,10 +2129,10 @@ namespace System int32_t CppHandle; int32_t ClassHandle; AppDomainInitializer(); - void operator+=(const System::AppDomainInitializer& del); - void operator-=(const System::AppDomainInitializer& del); - virtual void operator()(const System::Array1& args); - void Invoke(const System::Array1& args); + void operator+=(System::AppDomainInitializer& del); + void operator-=(System::AppDomainInitializer& del); + virtual void operator()(System::Array1& args); + void Invoke(System::Array1& args); }; } @@ -2155,8 +2155,8 @@ namespace UnityEngine int32_t CppHandle; int32_t ClassHandle; UnityAction(); - void operator+=(const UnityEngine::Events::UnityAction& del); - void operator-=(const UnityEngine::Events::UnityAction& del); + void operator+=(UnityEngine::Events::UnityAction& del); + void operator-=(UnityEngine::Events::UnityAction& del); virtual void operator()(); void Invoke(); }; @@ -2182,10 +2182,10 @@ namespace UnityEngine int32_t CppHandle; int32_t ClassHandle; UnityAction2(); - void operator+=(const UnityEngine::Events::UnityAction2& del); - void operator-=(const UnityEngine::Events::UnityAction2& del); - virtual void operator()(const UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); - void Invoke(const UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); + void operator+=(UnityEngine::Events::UnityAction2& del); + void operator-=(UnityEngine::Events::UnityAction2& del); + virtual void operator()(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); + void Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); }; } } From 55b2bfbf78d8754669c83ec514927409696ff373 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 19 Nov 2017 19:12:19 -0800 Subject: [PATCH 40/95] Return a constant from GetRank(). --- .../NativeScript/Editor/GenerateBindings.cs | 103 ++++++++------ Unity/CppSource/NativeScript/Bindings.cpp | 128 ++---------------- Unity/CppSource/NativeScript/Bindings.h | 8 -- 3 files changed, 73 insertions(+), 166 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 6731bf1..5e04057 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -4163,12 +4163,6 @@ static void AppendArray( builders.CppMethodDefinitions.Append(subject); builders.CppMethodDefinitions.Append( "InternalLength = 0;\n"); - AppendIndent( - extraIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(subject); - builders.CppMethodDefinitions.Append( - "InternalRank = 0;\n"); if (rank > 1) { for (int i = 0; i < rank; ++i) @@ -4194,14 +4188,6 @@ static void AppendArray( builders.CppMethodDefinitions.Append(subject); builders.CppMethodDefinitions.Append( "InternalLength;\n"); - AppendIndent( - extraIndent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "InternalRank = "); - builders.CppMethodDefinitions.Append(subject); - builders.CppMethodDefinitions.Append( - "InternalRank;\n"); if (rank > 1) { for (int i = 0; i < rank; ++i) @@ -4232,11 +4218,6 @@ static void AppendArray( builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append( "int32_t InternalLength;\n"); - AppendIndent( - indent + 1, - builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append( - "int32_t InternalRank;\n"); if (rank > 1) { AppendIndent( @@ -4258,11 +4239,9 @@ static void AppendArray( builders); // Base GetLength - AppendArrayCppCallBaseGetIntFunction( + AppendArrayCppGetLengthFunction( indent, cppArrayTypeName, - "GetLength", - "InternalLength", cppTypeParams, builders); @@ -4279,12 +4258,11 @@ static void AppendArray( builders); } - AppendArrayCppCallBaseGetIntFunction( + AppendArrayCppGetRankFunction( indent, cppArrayTypeName, - "GetRank", - "InternalRank", cppTypeParams, + rank, builders); AppendArrayGetItem( @@ -5069,11 +5047,9 @@ static void AppendArrayConstructor( builders.CppMethodDefinitions.Append("\n"); } - static void AppendArrayCppCallBaseGetIntFunction( + static void AppendArrayCppGetLengthFunction( int indent, string cppArrayTypeName, - string baseFunctionName, - string memberVariableName, Type[] cppTypeParams, StringBuilders builders) { @@ -5084,7 +5060,7 @@ static void AppendArrayCppCallBaseGetIntFunction( indent + 1, builders.CppTypeDefinitions); AppendCppMethodDeclaration( - baseFunctionName, + "GetLength", false, false, false, @@ -5097,7 +5073,7 @@ static void AppendArrayCppCallBaseGetIntFunction( AppendCppMethodDefinitionBegin( cppArrayTypeName, typeof(int), - baseFunctionName, + "GetLength", cppTypeParams, null, parameters, @@ -5110,9 +5086,8 @@ static void AppendArrayCppCallBaseGetIntFunction( AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("int32_t returnVal = "); - builders.CppMethodDefinitions.Append(memberVariableName); - builders.CppMethodDefinitions.Append(";\n"); + builders.CppMethodDefinitions.Append( + "int32_t returnVal = InternalLength;\n"); AppendIndent( indent + 1, builders.CppMethodDefinitions); @@ -5124,14 +5099,13 @@ static void AppendArrayCppCallBaseGetIntFunction( AppendIndent( indent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("returnVal = Array::"); - builders.CppMethodDefinitions.Append(baseFunctionName); - builders.CppMethodDefinitions.Append("();\n"); + builders.CppMethodDefinitions.Append( + "returnVal = Array::GetLength();\n"); AppendIndent( indent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(memberVariableName); - builders.CppMethodDefinitions.Append(" = returnVal;\n"); + builders.CppMethodDefinitions.Append( + "InternalLength = returnVal;\n"); AppendIndent( indent + 1, builders.CppMethodDefinitions); @@ -5150,6 +5124,59 @@ static void AppendArrayCppCallBaseGetIntFunction( builders.CppMethodDefinitions.Append('\n'); } + static void AppendArrayCppGetRankFunction( + int indent, + string cppArrayTypeName, + Type[] cppTypeParams, + int rank, + StringBuilders builders) + { + ParameterInfo[] parameters = new ParameterInfo[0]; + + // C++ method declaration + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + "GetRank", + false, + false, + false, + typeof(int), + null, + parameters, + builders.CppTypeDefinitions); + + // C++ method definition + AppendCppMethodDefinitionBegin( + cppArrayTypeName, + typeof(int), + "GetRank", + cppTypeParams, + null, + parameters, + indent, + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("return "); + builders.CppMethodDefinitions.Append(rank); + builders.CppMethodDefinitions.Append(";\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + } + static void AppendArrayMultidimensionalGetLength( Type elementType, Type arrayType, diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 87b888a..a3c5fcf 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -5847,7 +5847,6 @@ namespace System : Array1(Plugin::InternalUse::Only, 0) { this->InternalLength = 0; - this->InternalRank = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) @@ -5858,14 +5857,12 @@ namespace System Plugin::ReferenceManagedClass(handle); } this->InternalLength = 0; - this->InternalRank = 0; } Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; - InternalRank = other.InternalRank; } Array1::Array1(Array1&& other) @@ -5873,9 +5870,7 @@ namespace System { other.Handle = 0; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; other.InternalLength = 0; - other.InternalRank = 0; } Array1::~Array1() @@ -5899,7 +5894,6 @@ namespace System Plugin::ReferenceManagedClass(this->Handle); } InternalLength = other.InternalLength; - InternalRank = other.InternalRank; return *this; } @@ -5921,10 +5915,8 @@ namespace System } Handle = other.Handle; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; other.Handle = 0; other.InternalLength = 0; - other.InternalRank = 0; return *this; } @@ -5970,13 +5962,7 @@ namespace System int32_t Array1::GetRank() { - int32_t returnVal = InternalRank; - if (returnVal == 0) - { - returnVal = Array::GetRank(); - InternalRank = returnVal; - }; - return returnVal; + return 1; } Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) @@ -6139,7 +6125,6 @@ namespace System : Array1(Plugin::InternalUse::Only, 0) { this->InternalLength = 0; - this->InternalRank = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) @@ -6150,14 +6135,12 @@ namespace System Plugin::ReferenceManagedClass(handle); } this->InternalLength = 0; - this->InternalRank = 0; } Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; - InternalRank = other.InternalRank; } Array1::Array1(Array1&& other) @@ -6165,9 +6148,7 @@ namespace System { other.Handle = 0; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; other.InternalLength = 0; - other.InternalRank = 0; } Array1::~Array1() @@ -6191,7 +6172,6 @@ namespace System Plugin::ReferenceManagedClass(this->Handle); } InternalLength = other.InternalLength; - InternalRank = other.InternalRank; return *this; } @@ -6213,10 +6193,8 @@ namespace System } Handle = other.Handle; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; other.Handle = 0; other.InternalLength = 0; - other.InternalRank = 0; return *this; } @@ -6262,13 +6240,7 @@ namespace System int32_t Array1::GetRank() { - int32_t returnVal = InternalRank; - if (returnVal == 0) - { - returnVal = Array::GetRank(); - InternalRank = returnVal; - }; - return returnVal; + return 1; } Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) @@ -6283,7 +6255,6 @@ namespace System : Array2(Plugin::InternalUse::Only, 0) { this->InternalLength = 0; - this->InternalRank = 0; this->InternalLengths[0] = 0; this->InternalLengths[1] = 0; } @@ -6296,7 +6267,6 @@ namespace System Plugin::ReferenceManagedClass(handle); } this->InternalLength = 0; - this->InternalRank = 0; this->InternalLengths[0] = 0; this->InternalLengths[1] = 0; } @@ -6305,7 +6275,6 @@ namespace System : Array2(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; - InternalRank = other.InternalRank; InternalLengths[0] = other.InternalLengths[0]; InternalLengths[1] = other.InternalLengths[1]; } @@ -6315,11 +6284,9 @@ namespace System { other.Handle = 0; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; InternalLengths[0] = other.InternalLengths[0]; InternalLengths[1] = other.InternalLengths[1]; other.InternalLength = 0; - other.InternalRank = 0; other.InternalLengths[0] = 0; other.InternalLengths[1] = 0; } @@ -6345,7 +6312,6 @@ namespace System Plugin::ReferenceManagedClass(this->Handle); } InternalLength = other.InternalLength; - InternalRank = other.InternalRank; InternalLengths[0] = other.InternalLengths[0]; InternalLengths[1] = other.InternalLengths[1]; return *this; @@ -6369,12 +6335,10 @@ namespace System } Handle = other.Handle; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; InternalLengths[0] = other.InternalLengths[0]; InternalLengths[1] = other.InternalLengths[1]; other.Handle = 0; other.InternalLength = 0; - other.InternalRank = 0; other.InternalLengths[0] = 0; other.InternalLengths[1] = 0; return *this; @@ -6443,13 +6407,7 @@ namespace System int32_t Array2::GetRank() { - int32_t returnVal = InternalRank; - if (returnVal == 0) - { - returnVal = Array::GetRank(); - InternalRank = returnVal; - }; - return returnVal; + return 2; } Plugin::ArrayElementProxy1_2 System::Array2::operator[](int32_t index) @@ -6464,7 +6422,6 @@ namespace System : Array3(Plugin::InternalUse::Only, 0) { this->InternalLength = 0; - this->InternalRank = 0; this->InternalLengths[0] = 0; this->InternalLengths[1] = 0; this->InternalLengths[2] = 0; @@ -6478,7 +6435,6 @@ namespace System Plugin::ReferenceManagedClass(handle); } this->InternalLength = 0; - this->InternalRank = 0; this->InternalLengths[0] = 0; this->InternalLengths[1] = 0; this->InternalLengths[2] = 0; @@ -6488,7 +6444,6 @@ namespace System : Array3(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; - InternalRank = other.InternalRank; InternalLengths[0] = other.InternalLengths[0]; InternalLengths[1] = other.InternalLengths[1]; InternalLengths[2] = other.InternalLengths[2]; @@ -6499,12 +6454,10 @@ namespace System { other.Handle = 0; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; InternalLengths[0] = other.InternalLengths[0]; InternalLengths[1] = other.InternalLengths[1]; InternalLengths[2] = other.InternalLengths[2]; other.InternalLength = 0; - other.InternalRank = 0; other.InternalLengths[0] = 0; other.InternalLengths[1] = 0; other.InternalLengths[2] = 0; @@ -6531,7 +6484,6 @@ namespace System Plugin::ReferenceManagedClass(this->Handle); } InternalLength = other.InternalLength; - InternalRank = other.InternalRank; InternalLengths[0] = other.InternalLengths[0]; InternalLengths[1] = other.InternalLengths[1]; InternalLengths[2] = other.InternalLengths[2]; @@ -6556,13 +6508,11 @@ namespace System } Handle = other.Handle; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; InternalLengths[0] = other.InternalLengths[0]; InternalLengths[1] = other.InternalLengths[1]; InternalLengths[2] = other.InternalLengths[2]; other.Handle = 0; other.InternalLength = 0; - other.InternalRank = 0; other.InternalLengths[0] = 0; other.InternalLengths[1] = 0; other.InternalLengths[2] = 0; @@ -6633,13 +6583,7 @@ namespace System int32_t Array3::GetRank() { - int32_t returnVal = InternalRank; - if (returnVal == 0) - { - returnVal = Array::GetRank(); - InternalRank = returnVal; - }; - return returnVal; + return 3; } Plugin::ArrayElementProxy1_3 System::Array3::operator[](int32_t index) @@ -6688,7 +6632,6 @@ namespace System : Array1(Plugin::InternalUse::Only, 0) { this->InternalLength = 0; - this->InternalRank = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) @@ -6699,14 +6642,12 @@ namespace System Plugin::ReferenceManagedClass(handle); } this->InternalLength = 0; - this->InternalRank = 0; } Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; - InternalRank = other.InternalRank; } Array1::Array1(Array1&& other) @@ -6714,9 +6655,7 @@ namespace System { other.Handle = 0; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; other.InternalLength = 0; - other.InternalRank = 0; } Array1::~Array1() @@ -6740,7 +6679,6 @@ namespace System Plugin::ReferenceManagedClass(this->Handle); } InternalLength = other.InternalLength; - InternalRank = other.InternalRank; return *this; } @@ -6762,10 +6700,8 @@ namespace System } Handle = other.Handle; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; other.Handle = 0; other.InternalLength = 0; - other.InternalRank = 0; return *this; } @@ -6811,13 +6747,7 @@ namespace System int32_t Array1::GetRank() { - int32_t returnVal = InternalRank; - if (returnVal == 0) - { - returnVal = Array::GetRank(); - InternalRank = returnVal; - }; - return returnVal; + return 1; } Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) @@ -6866,7 +6796,6 @@ namespace System : Array1(Plugin::InternalUse::Only, 0) { this->InternalLength = 0; - this->InternalRank = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) @@ -6877,14 +6806,12 @@ namespace System Plugin::ReferenceManagedClass(handle); } this->InternalLength = 0; - this->InternalRank = 0; } Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; - InternalRank = other.InternalRank; } Array1::Array1(Array1&& other) @@ -6892,9 +6819,7 @@ namespace System { other.Handle = 0; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; other.InternalLength = 0; - other.InternalRank = 0; } Array1::~Array1() @@ -6918,7 +6843,6 @@ namespace System Plugin::ReferenceManagedClass(this->Handle); } InternalLength = other.InternalLength; - InternalRank = other.InternalRank; return *this; } @@ -6940,10 +6864,8 @@ namespace System } Handle = other.Handle; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; other.Handle = 0; other.InternalLength = 0; - other.InternalRank = 0; return *this; } @@ -6989,13 +6911,7 @@ namespace System int32_t Array1::GetRank() { - int32_t returnVal = InternalRank; - if (returnVal == 0) - { - returnVal = Array::GetRank(); - InternalRank = returnVal; - }; - return returnVal; + return 1; } Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) @@ -7044,7 +6960,6 @@ namespace System : Array1(Plugin::InternalUse::Only, 0) { this->InternalLength = 0; - this->InternalRank = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) @@ -7055,14 +6970,12 @@ namespace System Plugin::ReferenceManagedClass(handle); } this->InternalLength = 0; - this->InternalRank = 0; } Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; - InternalRank = other.InternalRank; } Array1::Array1(Array1&& other) @@ -7070,9 +6983,7 @@ namespace System { other.Handle = 0; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; other.InternalLength = 0; - other.InternalRank = 0; } Array1::~Array1() @@ -7096,7 +7007,6 @@ namespace System Plugin::ReferenceManagedClass(this->Handle); } InternalLength = other.InternalLength; - InternalRank = other.InternalRank; return *this; } @@ -7118,10 +7028,8 @@ namespace System } Handle = other.Handle; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; other.Handle = 0; other.InternalLength = 0; - other.InternalRank = 0; return *this; } @@ -7167,13 +7075,7 @@ namespace System int32_t Array1::GetRank() { - int32_t returnVal = InternalRank; - if (returnVal == 0) - { - returnVal = Array::GetRank(); - InternalRank = returnVal; - }; - return returnVal; + return 1; } Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) @@ -7222,7 +7124,6 @@ namespace System : Array1(Plugin::InternalUse::Only, 0) { this->InternalLength = 0; - this->InternalRank = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) @@ -7233,14 +7134,12 @@ namespace System Plugin::ReferenceManagedClass(handle); } this->InternalLength = 0; - this->InternalRank = 0; } Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; - InternalRank = other.InternalRank; } Array1::Array1(Array1&& other) @@ -7248,9 +7147,7 @@ namespace System { other.Handle = 0; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; other.InternalLength = 0; - other.InternalRank = 0; } Array1::~Array1() @@ -7274,7 +7171,6 @@ namespace System Plugin::ReferenceManagedClass(this->Handle); } InternalLength = other.InternalLength; - InternalRank = other.InternalRank; return *this; } @@ -7296,10 +7192,8 @@ namespace System } Handle = other.Handle; InternalLength = other.InternalLength; - InternalRank = other.InternalRank; other.Handle = 0; other.InternalLength = 0; - other.InternalRank = 0; return *this; } @@ -7345,13 +7239,7 @@ namespace System int32_t Array1::GetRank() { - int32_t returnVal = InternalRank; - if (returnVal == 0) - { - returnVal = Array::GetRank(); - InternalRank = returnVal; - }; - return returnVal; + return 1; } Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 61dd7ca..57d8b43 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -1698,7 +1698,6 @@ namespace System bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; int32_t InternalLength; - int32_t InternalRank; Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); @@ -1794,7 +1793,6 @@ namespace System bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; int32_t InternalLength; - int32_t InternalRank; Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); @@ -1817,7 +1815,6 @@ namespace System bool operator==(const Array2& other) const; bool operator!=(const Array2& other) const; int32_t InternalLength; - int32_t InternalRank; int32_t InternalLengths[2]; Array2(int32_t length0, int32_t length1); int32_t GetLength(); @@ -1842,7 +1839,6 @@ namespace System bool operator==(const Array3& other) const; bool operator!=(const Array3& other) const; int32_t InternalLength; - int32_t InternalRank; int32_t InternalLengths[3]; Array3(int32_t length0, int32_t length1, int32_t length2); int32_t GetLength(); @@ -1879,7 +1875,6 @@ namespace System bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; int32_t InternalLength; - int32_t InternalRank; Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); @@ -1914,7 +1909,6 @@ namespace System bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; int32_t InternalLength; - int32_t InternalRank; Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); @@ -1949,7 +1943,6 @@ namespace System bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; int32_t InternalLength; - int32_t InternalRank; Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); @@ -1984,7 +1977,6 @@ namespace System bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; int32_t InternalLength; - int32_t InternalRank; Array1(int32_t length0); int32_t GetLength(); int32_t GetRank(); From 9fe25b7a8773ee574f5956387fe983b74f62e7b2 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 19 Nov 2017 19:21:48 -0800 Subject: [PATCH 41/95] Add an bounds-checking assert for GetLength(int32_t) Remove ArrayGetRank --- Unity/Assets/NativeScript/Bindings.cs | 10 ---------- Unity/Assets/NativeScript/Editor/GenerateBindings.cs | 10 +++++++++- Unity/CppSource/NativeScript/Bindings.cpp | 7 +++---- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 7822da0..8dfa908 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -273,7 +273,6 @@ delegate void InitDelegate( IntPtr stringNew, IntPtr setException, IntPtr arrayGetLength, - IntPtr arrayGetRank, /*BEGIN INIT PARAMS*/ IntPtr systemDiagnosticsStopwatchConstructor, IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds, @@ -629,7 +628,6 @@ static extern void Init( IntPtr stringNew, IntPtr setException, IntPtr arrayGetLength, - IntPtr arrayGetRank, /*BEGIN INIT PARAMS*/ IntPtr systemDiagnosticsStopwatchConstructor, IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds, @@ -895,7 +893,6 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc 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(); @@ -1157,7 +1154,6 @@ public static void Open( 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)), @@ -1409,12 +1405,6 @@ static int ArrayGetLength(int handle) return ((Array)ObjectStore.Get(handle)).Length; } - [MonoPInvokeCallback(typeof(ArrayGetRankDelegate))] - static int ArrayGetRank(int handle) - { - return ((Array)ObjectStore.Get(handle)).Rank; - } - /*BEGIN BASE TYPES*/ class SystemCollectionsGenericIComparerSystemInt32 : System.Collections.Generic.IComparer { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 5e04057..cdcb7fb 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -5312,7 +5312,15 @@ static void AppendArrayMultidimensionalGetLength( AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("int32_t length = InternalLengths[dimension];\n"); + builders.CppMethodDefinitions.Append( + "assert(dimension >= 0 && dimension < "); + builders.CppMethodDefinitions.Append(rank); + builders.CppMethodDefinitions.Append(");\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append( + "int32_t length = InternalLengths[dimension];\n"); AppendIndent( indent + 1, builders.CppMethodDefinitions); diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index a3c5fcf..716cc36 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -38,7 +38,6 @@ namespace Plugin int32_t (*StringNew)(const char* chars); void (*SetException)(int32_t handle); int32_t (*ArrayGetLength)(int32_t handle); - int32_t (*ArrayGetRank)(int32_t handle); /*BEGIN FUNCTION POINTERS*/ int32_t (*SystemDiagnosticsStopwatchConstructor)(); @@ -789,7 +788,7 @@ namespace System int32_t Array::GetRank() { - return Plugin::ArrayGetRank(Handle); + return 0; } } @@ -6388,6 +6387,7 @@ namespace System int32_t Array2::GetLength(int32_t dimension) { + assert(dimension >= 0 && dimension < 2); int32_t length = InternalLengths[dimension]; if (length) { @@ -6564,6 +6564,7 @@ namespace System int32_t Array3::GetLength(int32_t dimension) { + assert(dimension >= 0 && dimension < 3); int32_t length = InternalLengths[dimension]; if (length) { @@ -9120,7 +9121,6 @@ DLLEXPORT void Init( int32_t (*stringNew)(const char* chars), void (*setException)(int32_t handle), int32_t (*arrayGetLength)(int32_t handle), - int32_t (*arrayGetRank)(int32_t handle), /*BEGIN INIT PARAMS*/ int32_t (*systemDiagnosticsStopwatchConstructor)(), int64_t (*systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle), @@ -9330,7 +9330,6 @@ DLLEXPORT void Init( Plugin::ReleaseObject = releaseObject; Plugin::SetException = setException; Plugin::ArrayGetLength = arrayGetLength; - Plugin::ArrayGetRank = arrayGetRank; /*BEGIN INIT BODY*/ Plugin::SystemDiagnosticsStopwatchConstructor = systemDiagnosticsStopwatchConstructor; Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds = systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds; From 6db6efab77cc8b93b0b93931494fb9263061c5c5 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 19 Nov 2017 19:55:24 -0800 Subject: [PATCH 42/95] Update README --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 71b8c4d..2f47bdd 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ C++ [compiles much more quickly](https://github.com/jacksondunstan/cscppcompilet Unity's garbage collector is mandatory and has a lot of problems. It's slow, runs on the main thread, collects all garbage at once, fragments the heap, and never shrinks the heap. So your game will experience "frame hitches" and eventually you'll run out of memory and crash. -A significant amount of effort is required to work around the GC and the resulting code is difficult to maintain and slow. This includes techniques like [object pools](http://jacksondunstan.com/articles/3829), which essentially make memory management manual. You've also got to avoid boxing value types like `int` to to managed types like `object`, not use `foreach` loops in some situations, and various other [gotchas](http://jacksondunstan.com/articles/3850). +A significant amount of effort is required to work around the GC and the resulting code is difficult to maintain and slow. This includes techniques like [object pools](https://jacksondunstan.com/articles/3829), which essentially make memory management manual. You've also got to avoid boxing value types like `int` to to managed types like `object`, not use `foreach` loops in some situations, and various other [gotchas](https://jacksondunstan.com/articles/3850). C++ has no required garbage collector and features optional automatic memory management via "smart pointer" types like [shared_ptr](http://en.cppreference.com/w/cpp/memory/shared_ptr). It offers excellent alternatives to Unity's primitive garbage collector. @@ -38,7 +38,7 @@ While using some .NET APIs will still involve garbage creation, the problem is c ## Total Control -By using C++ directly, you gain complete control over the code the CPU will execute. It's much easier to generate optimal code with a C++ compiler than with a C# compiler, IL2CPP, and finally a C++ compiler. Cut out the middle-man and you can take advantage of compiler intrinsics or assembly to directly write machine code using powerful CPU features like [SIMD](http://jacksondunstan.com/articles/3890) and hardware AES encryption for massive performance gains. +By using C++ directly, you gain complete control over the code the CPU will execute. It's much easier to generate optimal code with a C++ compiler than with a C# compiler, IL2CPP, and finally a C++ compiler. Cut out the middle-man and you can take advantage of compiler intrinsics or assembly to directly write machine code using powerful CPU features like [SIMD](https://jacksondunstan.com/articles/3890) and hardware AES encryption for massive performance gains. ## More Features @@ -54,7 +54,7 @@ C++ is a much larger language than C# and some developers will prefer having mor ## No IL2CPP Surprises -While IL2CPP transforms C# into C++ already, it generates a lot of overhead. There are many [surprises](http://jacksondunstan.com/articles/3916) if you read through the generated C++. For example, there's overhead for any function using a static variable and an extra two pointers are stored at the beginning of every class. The same goes for all sorts of features such as `sizeof()`, mandatory null checks, and so forth. Instead, you could write C++ directly and not need to work around IL2CPP. +While IL2CPP transforms C# into C++ already, it generates a lot of overhead. There are many [surprises](https://jacksondunstan.com/articles/3916) if you read through the generated C++. For example, there's overhead for any function using a static variable and an extra two pointers are stored at the beginning of every class. The same goes for all sorts of features such as `sizeof()`, mandatory null checks, and so forth. Instead, you could write C++ directly and not need to work around IL2CPP. ## Industry Standard Language @@ -108,7 +108,7 @@ C++ is the standard language for video games as well as many other fields. By pr Almost all projects will see a net performance win by reducing garbage collection, eliminating IL2CPP overhead, and access to compiler intrinsics and assembly. Calls from C++ into C# incur only a minor performance penalty. In the rare case that almost all of your code is calls to .NET APIs then you may experience a net performance loss. -[Testing and benchmarks article](http://jacksondunstan.com/articles/3952) +[Testing and benchmarks article](https://jacksondunstan.com/articles/3952) # Project Structure @@ -213,11 +213,11 @@ To update to a new version of this project, overwrite your Unity project's `Asse # Reference -[Articles](http://jacksondunstan.com/articles/3938) by the author describing the development of this project. +[Articles](https://jacksondunstan.com/articles/3938) by the author describing the development of this project. # Author -[Jackson Dunstan](http://jacksondunstan.com) +[Jackson Dunstan](https://jacksondunstan.com) # Contributing From ee8fed78bee7f23606dd5531caed445da9134fb1 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 26 Nov 2017 22:11:30 -0800 Subject: [PATCH 43/95] Support overriding C# properties and indexers from C++ Update README --- README.md | 2 +- Unity/Assets/NativeScript/Bindings.cs | 793 ++++++++++ .../NativeScript/Editor/GenerateBindings.cs | 784 ++++++++-- Unity/Assets/NativeScriptTypes.json | 32 + Unity/CppSource/Game/Game.cpp | 2 - Unity/CppSource/NativeScript/Bindings.cpp | 1377 ++++++++++++++++- Unity/CppSource/NativeScript/Bindings.h | 142 ++ 7 files changed, 2888 insertions(+), 244 deletions(-) diff --git a/README.md b/README.md index 2f47bdd..72e395c 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,7 @@ Note that the code generator does not support (yet): * `Array` methods (e.g. `IndexOf`) * `string` methods (e.g. `Substring`) * Default parameters -* Overriding properties, events, and indexers +* Overriding events * Deriving from classes without a default constructor * `decimal` * C# pointers diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 8dfa908..aad32f6 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -371,6 +371,8 @@ delegate void InitDelegate( IntPtr unboxScene, IntPtr boxLoadSceneMode, IntPtr unboxLoadSceneMode, + IntPtr systemCollectionsIEnumeratorPropertyGetCurrent, + IntPtr systemCollectionsIEnumeratorMethodMoveNext, IntPtr releaseSystemCollectionsGenericIComparerSystemInt32, IntPtr systemCollectionsGenericIComparerSystemInt32Constructor, IntPtr releaseSystemCollectionsGenericIComparerSystemString, @@ -379,6 +381,12 @@ delegate void InitDelegate( IntPtr systemStringComparerConstructor, IntPtr releaseSystemEventArgs, IntPtr systemEventArgsConstructor, + IntPtr releaseSystemCollectionsICollection, + IntPtr systemCollectionsICollectionConstructor, + IntPtr releaseSystemCollectionsIList, + IntPtr systemCollectionsIListConstructor, + IntPtr releaseSystemCollectionsQueue, + IntPtr systemCollectionsQueueConstructor, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -492,6 +500,72 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc public delegate int SystemEventArgsToStringDelegate(int thisHandle); public static SystemEventArgsToStringDelegate SystemEventArgsToString; + public delegate void SystemCollectionsICollectionCopyToDelegate(int thisHandle, int param0, int param1); + public static SystemCollectionsICollectionCopyToDelegate SystemCollectionsICollectionCopyTo; + + public delegate int SystemCollectionsICollectionGetEnumeratorDelegate(int thisHandle); + public static SystemCollectionsICollectionGetEnumeratorDelegate SystemCollectionsICollectionGetEnumerator; + + public delegate int SystemCollectionsICollectionGetCountDelegate(int thisHandle); + public static SystemCollectionsICollectionGetCountDelegate SystemCollectionsICollectionGetCount; + + public delegate bool SystemCollectionsICollectionGetIsSynchronizedDelegate(int thisHandle); + public static SystemCollectionsICollectionGetIsSynchronizedDelegate SystemCollectionsICollectionGetIsSynchronized; + + public delegate int SystemCollectionsICollectionGetSyncRootDelegate(int thisHandle); + public static SystemCollectionsICollectionGetSyncRootDelegate SystemCollectionsICollectionGetSyncRoot; + + public delegate int SystemCollectionsIListAddDelegate(int thisHandle, int param0); + public static SystemCollectionsIListAddDelegate SystemCollectionsIListAdd; + + public delegate void SystemCollectionsIListClearDelegate(int thisHandle); + public static SystemCollectionsIListClearDelegate SystemCollectionsIListClear; + + public delegate bool SystemCollectionsIListContainsDelegate(int thisHandle, int param0); + public static SystemCollectionsIListContainsDelegate SystemCollectionsIListContains; + + public delegate int SystemCollectionsIListIndexOfDelegate(int thisHandle, int param0); + public static SystemCollectionsIListIndexOfDelegate SystemCollectionsIListIndexOf; + + public delegate void SystemCollectionsIListInsertDelegate(int thisHandle, int param0, int param1); + public static SystemCollectionsIListInsertDelegate SystemCollectionsIListInsert; + + public delegate void SystemCollectionsIListRemoveDelegate(int thisHandle, int param0); + public static SystemCollectionsIListRemoveDelegate SystemCollectionsIListRemove; + + public delegate void SystemCollectionsIListRemoveAtDelegate(int thisHandle, int param0); + public static SystemCollectionsIListRemoveAtDelegate SystemCollectionsIListRemoveAt; + + public delegate int SystemCollectionsIListGetEnumeratorDelegate(int thisHandle); + public static SystemCollectionsIListGetEnumeratorDelegate SystemCollectionsIListGetEnumerator; + + public delegate void SystemCollectionsIListCopyToDelegate(int thisHandle, int param0, int param1); + public static SystemCollectionsIListCopyToDelegate SystemCollectionsIListCopyTo; + + public delegate bool SystemCollectionsIListGetIsFixedSizeDelegate(int thisHandle); + public static SystemCollectionsIListGetIsFixedSizeDelegate SystemCollectionsIListGetIsFixedSize; + + public delegate bool SystemCollectionsIListGetIsReadOnlyDelegate(int thisHandle); + public static SystemCollectionsIListGetIsReadOnlyDelegate SystemCollectionsIListGetIsReadOnly; + + public delegate int SystemCollectionsIListGetItemDelegate(int thisHandle, int param0); + public static SystemCollectionsIListGetItemDelegate SystemCollectionsIListGetItem; + + public delegate void SystemCollectionsIListSetItemDelegate(int thisHandle, int param0, int param1); + public static SystemCollectionsIListSetItemDelegate SystemCollectionsIListSetItem; + + public delegate int SystemCollectionsIListGetCountDelegate(int thisHandle); + public static SystemCollectionsIListGetCountDelegate SystemCollectionsIListGetCount; + + public delegate bool SystemCollectionsIListGetIsSynchronizedDelegate(int thisHandle); + public static SystemCollectionsIListGetIsSynchronizedDelegate SystemCollectionsIListGetIsSynchronized; + + public delegate int SystemCollectionsIListGetSyncRootDelegate(int thisHandle); + public static SystemCollectionsIListGetSyncRootDelegate SystemCollectionsIListGetSyncRoot; + + public delegate int SystemCollectionsQueueGetCountDelegate(int thisHandle); + public static SystemCollectionsQueueGetCountDelegate SystemCollectionsQueueGetCount; + public delegate void MyGameMonoBehavioursTestScriptAwakeDelegate(int thisHandle); public static MyGameMonoBehavioursTestScriptAwakeDelegate MyGameMonoBehavioursTestScriptAwake; @@ -726,6 +800,8 @@ static extern void Init( IntPtr unboxScene, IntPtr boxLoadSceneMode, IntPtr unboxLoadSceneMode, + IntPtr systemCollectionsIEnumeratorPropertyGetCurrent, + IntPtr systemCollectionsIEnumeratorMethodMoveNext, IntPtr releaseSystemCollectionsGenericIComparerSystemInt32, IntPtr systemCollectionsGenericIComparerSystemInt32Constructor, IntPtr releaseSystemCollectionsGenericIComparerSystemString, @@ -734,6 +810,12 @@ static extern void Init( IntPtr systemStringComparerConstructor, IntPtr releaseSystemEventArgs, IntPtr systemEventArgsConstructor, + IntPtr releaseSystemCollectionsICollection, + IntPtr systemCollectionsICollectionConstructor, + IntPtr releaseSystemCollectionsIList, + IntPtr systemCollectionsIListConstructor, + IntPtr releaseSystemCollectionsQueue, + IntPtr systemCollectionsQueueConstructor, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -848,6 +930,72 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc [DllImport(Constants.PluginName)] public static extern void SystemEventArgsToString(int thisHandle); + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsICollectionCopyTo(int thisHandle, int param0, int param1); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsICollectionGetEnumerator(int thisHandle); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsICollectionGetCount(int thisHandle); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsICollectionGetIsSynchronized(int thisHandle); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsICollectionGetSyncRoot(int thisHandle); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListAdd(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListClear(int thisHandle); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListContains(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListIndexOf(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListInsert(int thisHandle, int param0, int param1); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListRemove(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListRemoveAt(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListGetEnumerator(int thisHandle); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListCopyTo(int thisHandle, int param0, int param1); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListGetIsFixedSize(int thisHandle); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListGetIsReadOnly(int thisHandle); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListGetItem(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListSetItem(int thisHandle, int param0, int param1); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListGetCount(int thisHandle); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListGetIsSynchronized(int thisHandle); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsIListGetSyncRoot(int thisHandle); + + [DllImport(Constants.PluginName)] + public static extern void SystemCollectionsQueueGetCount(int thisHandle); + [DllImport(Constants.PluginName)] public static extern void MyGameMonoBehavioursTestScriptAwake(int thisHandle); @@ -992,6 +1140,8 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc delegate UnityEngine.SceneManagement.Scene UnboxSceneDelegate(int valHandle); delegate int BoxLoadSceneModeDelegate(UnityEngine.SceneManagement.LoadSceneMode val); delegate UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneModeDelegate(int valHandle); + delegate int SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(int thisHandle); + delegate bool SystemCollectionsIEnumeratorMethodMoveNextDelegate(int thisHandle); delegate void SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate(int cppHandle, ref int handle); delegate void ReleaseSystemCollectionsGenericIComparerSystemInt32Delegate(int handle); delegate void SystemCollectionsGenericIComparerSystemStringConstructorDelegate(int cppHandle, ref int handle); @@ -1000,6 +1150,12 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc delegate void ReleaseSystemStringComparerDelegate(int handle); delegate void SystemEventArgsConstructorDelegate(int cppHandle, ref int handle); delegate void ReleaseSystemEventArgsDelegate(int handle); + delegate void SystemCollectionsICollectionConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemCollectionsICollectionDelegate(int handle); + delegate void SystemCollectionsIListConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemCollectionsIListDelegate(int handle); + delegate void SystemCollectionsQueueConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemCollectionsQueueDelegate(int handle); delegate int BoxBooleanDelegate(bool val); delegate bool UnboxBooleanDelegate(int valHandle); delegate int BoxSByteDelegate(sbyte val); @@ -1130,6 +1286,28 @@ public static void Open( SystemStringComparerEquals = GetDelegate(libraryHandle, "SystemStringComparerEquals"); SystemStringComparerGetHashCode = GetDelegate(libraryHandle, "SystemStringComparerGetHashCode"); SystemEventArgsToString = GetDelegate(libraryHandle, "SystemEventArgsToString"); + SystemCollectionsICollectionCopyTo = GetDelegate(libraryHandle, "SystemCollectionsICollectionCopyTo"); + SystemCollectionsICollectionGetEnumerator = GetDelegate(libraryHandle, "SystemCollectionsICollectionGetEnumerator"); + SystemCollectionsICollectionGetCount = GetDelegate(libraryHandle, "SystemCollectionsICollectionGetCount"); + SystemCollectionsICollectionGetIsSynchronized = GetDelegate(libraryHandle, "SystemCollectionsICollectionGetIsSynchronized"); + SystemCollectionsICollectionGetSyncRoot = GetDelegate(libraryHandle, "SystemCollectionsICollectionGetSyncRoot"); + SystemCollectionsIListAdd = GetDelegate(libraryHandle, "SystemCollectionsIListAdd"); + SystemCollectionsIListClear = GetDelegate(libraryHandle, "SystemCollectionsIListClear"); + SystemCollectionsIListContains = GetDelegate(libraryHandle, "SystemCollectionsIListContains"); + SystemCollectionsIListIndexOf = GetDelegate(libraryHandle, "SystemCollectionsIListIndexOf"); + SystemCollectionsIListInsert = GetDelegate(libraryHandle, "SystemCollectionsIListInsert"); + SystemCollectionsIListRemove = GetDelegate(libraryHandle, "SystemCollectionsIListRemove"); + SystemCollectionsIListRemoveAt = GetDelegate(libraryHandle, "SystemCollectionsIListRemoveAt"); + SystemCollectionsIListGetEnumerator = GetDelegate(libraryHandle, "SystemCollectionsIListGetEnumerator"); + SystemCollectionsIListCopyTo = GetDelegate(libraryHandle, "SystemCollectionsIListCopyTo"); + SystemCollectionsIListGetIsFixedSize = GetDelegate(libraryHandle, "SystemCollectionsIListGetIsFixedSize"); + SystemCollectionsIListGetIsReadOnly = GetDelegate(libraryHandle, "SystemCollectionsIListGetIsReadOnly"); + SystemCollectionsIListGetItem = GetDelegate(libraryHandle, "SystemCollectionsIListGetItem"); + SystemCollectionsIListSetItem = GetDelegate(libraryHandle, "SystemCollectionsIListSetItem"); + SystemCollectionsIListGetCount = GetDelegate(libraryHandle, "SystemCollectionsIListGetCount"); + SystemCollectionsIListGetIsSynchronized = GetDelegate(libraryHandle, "SystemCollectionsIListGetIsSynchronized"); + SystemCollectionsIListGetSyncRoot = GetDelegate(libraryHandle, "SystemCollectionsIListGetSyncRoot"); + SystemCollectionsQueueGetCount = GetDelegate(libraryHandle, "SystemCollectionsQueueGetCount"); MyGameMonoBehavioursTestScriptAwake = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptAwake"); MyGameMonoBehavioursTestScriptOnAnimatorIK = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptOnAnimatorIK"); MyGameMonoBehavioursTestScriptOnCollisionEnter = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptOnCollisionEnter"); @@ -1252,6 +1430,8 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnboxSceneDelegate(UnboxScene)), Marshal.GetFunctionPointerForDelegate(new BoxLoadSceneModeDelegate(BoxLoadSceneMode)), Marshal.GetFunctionPointerForDelegate(new UnboxLoadSceneModeDelegate(UnboxLoadSceneMode)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(SystemCollectionsIEnumeratorPropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIEnumeratorMethodMoveNextDelegate(SystemCollectionsIEnumeratorMethodMoveNext)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericIComparerSystemInt32Delegate(ReleaseSystemCollectionsGenericIComparerSystemInt32)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate(SystemCollectionsGenericIComparerSystemInt32Constructor)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericIComparerSystemStringDelegate(ReleaseSystemCollectionsGenericIComparerSystemString)), @@ -1260,6 +1440,12 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new SystemStringComparerConstructorDelegate(SystemStringComparerConstructor)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemEventArgsDelegate(ReleaseSystemEventArgs)), Marshal.GetFunctionPointerForDelegate(new SystemEventArgsConstructorDelegate(SystemEventArgsConstructor)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsICollectionDelegate(ReleaseSystemCollectionsICollection)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsICollectionConstructorDelegate(SystemCollectionsICollectionConstructor)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsIListDelegate(ReleaseSystemCollectionsIList)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIListConstructorDelegate(SystemCollectionsIListConstructor)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsQueueDelegate(ReleaseSystemCollectionsQueue)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsQueueConstructorDelegate(SystemCollectionsQueueConstructor)), Marshal.GetFunctionPointerForDelegate(new BoxBooleanDelegate(BoxBoolean)), Marshal.GetFunctionPointerForDelegate(new UnboxBooleanDelegate(UnboxBoolean)), Marshal.GetFunctionPointerForDelegate(new BoxSByteDelegate(BoxSByte)), @@ -1431,6 +1617,7 @@ public int Compare(int x, int y) } return default(int); } + } class SystemCollectionsGenericIComparerSystemString : System.Collections.Generic.IComparer @@ -1460,6 +1647,7 @@ public int Compare(string x, string y) } return default(int); } + } class SystemStringComparer : System.StringComparer @@ -1489,6 +1677,7 @@ public override int Compare(string x, string y) } return default(int); } + public override bool Equals(string x, string y) { if (CppHandle != 0) @@ -1507,6 +1696,7 @@ public override bool Equals(string x, string y) } return default(bool); } + public override int GetHashCode(string obj) { if (CppHandle != 0) @@ -1524,6 +1714,7 @@ public override int GetHashCode(string obj) } return default(int); } + } class SystemEventArgs : System.EventArgs @@ -1551,6 +1742,437 @@ public override string ToString() } return default(string); } + + } + + class SystemCollectionsICollection : System.Collections.ICollection + { + public int CppHandle; + + public SystemCollectionsICollection(int cppHandle) + { + CppHandle = cppHandle; + } + + public void CopyTo(System.Array array, int index) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int arrayHandle = NativeScript.Bindings.ObjectStore.GetHandle(array); + NativeScript.Bindings.SystemCollectionsICollectionCopyTo(thisHandle, arrayHandle, index); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + public System.Collections.IEnumerator GetEnumerator() + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemCollectionsICollectionGetEnumerator(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(returnVal); + } + return default(System.Collections.IEnumerator); + } + + public int Count + { + get + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemCollectionsICollectionGetCount(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(int); + } + } + + public bool IsSynchronized + { + get + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemCollectionsICollectionGetIsSynchronized(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(bool); + } + } + + public object SyncRoot + { + get + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemCollectionsICollectionGetSyncRoot(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return NativeScript.Bindings.ObjectStore.Get(returnVal); + } + return default(object); + } + } + + } + + class SystemCollectionsIList : System.Collections.IList + { + public int CppHandle; + + public SystemCollectionsIList(int cppHandle) + { + CppHandle = cppHandle; + } + + public int Add(object value) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + var returnVal = NativeScript.Bindings.SystemCollectionsIListAdd(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(int); + } + + public void Clear() + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.SystemCollectionsIListClear(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + public bool Contains(object value) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + var returnVal = NativeScript.Bindings.SystemCollectionsIListContains(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(bool); + } + + public int IndexOf(object value) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + var returnVal = NativeScript.Bindings.SystemCollectionsIListIndexOf(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(int); + } + + public void Insert(int index, object value) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemCollectionsIListInsert(thisHandle, index, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + public void Remove(object value) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemCollectionsIListRemove(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + public void RemoveAt(int index) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.SystemCollectionsIListRemoveAt(thisHandle, index); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + public System.Collections.IEnumerator GetEnumerator() + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemCollectionsIListGetEnumerator(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(returnVal); + } + return default(System.Collections.IEnumerator); + } + + public void CopyTo(System.Array array, int index) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int arrayHandle = NativeScript.Bindings.ObjectStore.GetHandle(array); + NativeScript.Bindings.SystemCollectionsIListCopyTo(thisHandle, arrayHandle, index); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + public bool IsFixedSize + { + get + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemCollectionsIListGetIsFixedSize(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(bool); + } + } + + public bool IsReadOnly + { + get + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemCollectionsIListGetIsReadOnly(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(bool); + } + } + + public object this[int index] + { + get + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemCollectionsIListGetItem(thisHandle, index); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return NativeScript.Bindings.ObjectStore.Get(returnVal); + } + return default(object); + } + set + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemCollectionsIListSetItem(thisHandle, index, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } + + public int Count + { + get + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemCollectionsIListGetCount(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(int); + } + } + + public bool IsSynchronized + { + get + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemCollectionsIListGetIsSynchronized(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(bool); + } + } + + public object SyncRoot + { + get + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemCollectionsIListGetSyncRoot(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return NativeScript.Bindings.ObjectStore.Get(returnVal); + } + return default(object); + } + } + + } + + class SystemCollectionsQueue : System.Collections.Queue + { + public int CppHandle; + + public SystemCollectionsQueue(int cppHandle) + { + CppHandle = cppHandle; + } + + public override int Count + { + get + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemCollectionsQueueGetCount(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(int); + } + } + } class SystemAction @@ -1578,6 +2200,7 @@ public void NativeInvoke() } } } + } class SystemActionSystemSingle @@ -1605,6 +2228,7 @@ public void NativeInvoke(float obj) } } } + } class SystemActionSystemSingle_SystemSingle @@ -1632,6 +2256,7 @@ public void NativeInvoke(float arg1, float arg2) } } } + } class SystemFuncSystemInt32_SystemSingle_SystemDouble @@ -1661,6 +2286,7 @@ public double NativeInvoke(int arg1, float arg2) } return default(double); } + } class SystemFuncSystemInt16_SystemInt32_SystemString @@ -1690,6 +2316,7 @@ public string NativeInvoke(short arg1, int arg2) } return default(string); } + } class SystemAppDomainInitializer @@ -1718,6 +2345,7 @@ public void NativeInvoke(string[] args) } } } + } class UnityEngineEventsUnityAction @@ -1745,6 +2373,7 @@ public void NativeInvoke() } } } + } class UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode @@ -1772,6 +2401,7 @@ public void NativeInvoke(UnityEngine.SceneManagement.Scene arg0, UnityEngine.Sce } } } + } /*END BASE TYPES*/ @@ -3892,6 +4522,52 @@ static UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneMode(int valHandl } } + [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorPropertyGetCurrentDelegate))] + static int SystemCollectionsIEnumeratorPropertyGetCurrent(int thisHandle) + { + try + { + var thiz = (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorMethodMoveNextDelegate))] + static bool SystemCollectionsIEnumeratorMethodMoveNext(int thisHandle) + { + try + { + var thiz = (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.MoveNext(); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } + } + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate))] static void SystemCollectionsGenericIComparerSystemInt32Constructor(int cppHandle, ref int handle) { @@ -4048,6 +4724,123 @@ static void ReleaseSystemEventArgs(int handle) } } + [MonoPInvokeCallback(typeof(SystemCollectionsICollectionConstructorDelegate))] + static void SystemCollectionsICollectionConstructor(int cppHandle, ref int handle) + { + try + { + var thiz = new SystemCollectionsICollection(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsICollectionDelegate))] + static void ReleaseSystemCollectionsICollection(int handle) + { + try + { + NativeScript.Bindings.ObjectStore.Remove(handle); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsIListConstructorDelegate))] + static void SystemCollectionsIListConstructor(int cppHandle, ref int handle) + { + try + { + var thiz = new SystemCollectionsIList(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsIListDelegate))] + static void ReleaseSystemCollectionsIList(int handle) + { + try + { + NativeScript.Bindings.ObjectStore.Remove(handle); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsQueueConstructorDelegate))] + static void SystemCollectionsQueueConstructor(int cppHandle, ref int handle) + { + try + { + var thiz = new SystemCollectionsQueue(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsQueueDelegate))] + static void ReleaseSystemCollectionsQueue(int handle) + { + try + { + NativeScript.Bindings.ObjectStore.Remove(handle); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + [MonoPInvokeCallback(typeof(BoxBooleanDelegate))] static int BoxBoolean(bool val) { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index cdcb7fb..888569b 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -101,6 +101,7 @@ class JsonBaseType public JsonGenericParams[] GenericParams; public int MaxSimultaneous; public JsonMethod[] OverrideMethods; + public JsonProperty[] OverrideProperties; } [Serializable] @@ -1009,11 +1010,13 @@ static void AppendNamespace( } static ParameterInfo[] ConvertParameters( - System.Reflection.ParameterInfo[] reflectionParameters) + System.Reflection.ParameterInfo[] reflectionParameters, + int start = 0, + int count = -1) { - int num = reflectionParameters.Length; + int num = reflectionParameters.Length - start; ParameterInfo[] parameters = new ParameterInfo[num]; - for (int i = 0; i < num; ++i) + for (int i = start; i < num; ++i) { var reflectionInfo = reflectionParameters[i]; ParameterInfo info = new ParameterInfo(); @@ -1025,7 +1028,7 @@ static ParameterInfo[] ConvertParameters( reflectionInfo); info.Kind = GetTypeKind( info.DereferencedParameterType); - parameters[i] = info; + parameters[i - start] = info; } return parameters; } @@ -1067,6 +1070,16 @@ static bool IsStatic(Type type) return type.IsAbstract && type.IsSealed; } + static bool IsDelegate(Type type) + { + return typeof(Delegate).IsAssignableFrom(type); + } + + static bool IsNonDelegateClass(Type type) + { + return type.IsClass && !IsDelegate(type); + } + static bool IsManagedValueType(Type type) { return type.IsValueType && !IsFullValueType(type); @@ -5594,11 +5607,11 @@ static void AppendDelegate( builders.TempStrBuilder); builders.TempStrBuilder.Append( jsonGenericParams.Types.Length); - string numberedTypeName = builders.TempStrBuilder.ToString(); + string cppTypeName = builders.TempStrBuilder.ToString(); // C++ template declaration AppendCppTemplateDeclaration( - numberedTypeName, + cppTypeName, type.Namespace, genericArgTypes.Length, builders.CppTypeDeclarations); @@ -5619,7 +5632,7 @@ static void AppendDelegate( builders.TempStrBuilder); builders.TempStrBuilder.Append( jsonGenericParams.Types.Length); - string numberedTypeName = builders.TempStrBuilder.ToString(); + string cppTypeName = builders.TempStrBuilder.ToString(); // Max simultaneous handles of this type int? maxSimultaneous = jsonGenericParams.MaxSimultaneous != 0 @@ -5630,7 +5643,7 @@ static void AppendDelegate( AppendDelegate( genericType, - numberedTypeName, + cppTypeName, typeParams, maxSimultaneous, builders); @@ -5652,7 +5665,7 @@ static void AppendDelegate( static void AppendDelegate( Type type, - string numberedTypeName, + string cppTypeName, Type[] typeParams, int? maxSimultaneous, StringBuilders builders) @@ -5709,7 +5722,7 @@ static void AppendDelegate( // C++ type declaration int indent = AppendCppTypeDeclaration( type.Namespace, - numberedTypeName, + cppTypeName, false, typeParams, builders.CppTypeDeclarations); @@ -5788,7 +5801,7 @@ static void AppendDelegate( // C++ type definition (begin) AppendCppTypeDefinitionBegin( - numberedTypeName, + cppTypeName, type.Namespace, TypeKind.Class, typeParams, @@ -5814,7 +5827,7 @@ static void AppendDelegate( indent + 1, builders.CppTypeDefinitions); AppendCppMethodDeclaration( - numberedTypeName, + cppTypeName, false, false, false, @@ -5972,7 +5985,7 @@ static void AppendDelegate( AppendCppBaseTypeDefaultConstructor( typeName, - numberedTypeName, + cppTypeName, typeParams, true, constructorFuncName, @@ -5981,7 +5994,7 @@ static void AppendDelegate( AppendCppBaseTypeNullptrConstructor( typeName, - numberedTypeName, + cppTypeName, typeParams, true, cppMethodDefinitionsIndent, @@ -5989,14 +6002,14 @@ static void AppendDelegate( AppendCppBaseTypeCopyConstructor( typeName, - numberedTypeName, + cppTypeName, typeParams, true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeMoveConstructor( - numberedTypeName, + cppTypeName, typeParams, true, cppMethodDefinitionsIndent, @@ -6004,7 +6017,7 @@ static void AppendDelegate( AppendCppBaseTypeHandleConstructor( typeName, - numberedTypeName, + cppTypeName, typeParams, true, cppMethodDefinitionsIndent, @@ -6012,7 +6025,7 @@ static void AppendDelegate( AppendCppBaseTypeDestructor( typeName, - numberedTypeName, + cppTypeName, typeParams, true, releaseFuncName, @@ -6021,14 +6034,14 @@ static void AppendDelegate( AppendCppBaseTypeAssignmentOperatorSameType( type, - numberedTypeName, + cppTypeName, typeParams, true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeAssignmentOperatorNullptr( - numberedTypeName, + cppTypeName, typeParams, true, releaseFuncName, @@ -6037,7 +6050,7 @@ static void AppendDelegate( AppendCppBaseTypeMoveAssignmentOperator( typeName, - numberedTypeName, + cppTypeName, typeParams, true, releaseFuncName, @@ -6045,20 +6058,20 @@ static void AppendDelegate( builders.CppMethodDefinitions); AppendCppBaseTypeEqualityOperator( - numberedTypeName, + cppTypeName, typeParams, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeInequalityOperator( - numberedTypeName, + cppTypeName, typeParams, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); // C++ add AppendCppMethodDefinitionBegin( - numberedTypeName, + cppTypeName, typeof(void), "operator+=", typeParams, @@ -6090,7 +6103,7 @@ static void AppendDelegate( // C++ remove AppendCppMethodDefinitionBegin( - numberedTypeName, + cppTypeName, typeof(void), "operator-=", typeParams, @@ -6153,14 +6166,25 @@ static void AppendDelegate( builders.CsharpBaseTypes.Append("\t\t\t}\n"); builders.CsharpBaseTypes.Append("\t\t\t\n"); + // Build the name of the C++ binding function that C# calls + builders.TempStrBuilder.Length = 0; + AppendNativeInvokeFuncName( + type, + typeParams, + "NativeInvoke", + builders.TempStrBuilder); + string nativeInvokeFuncName = builders.TempStrBuilder.ToString(); + // operator() is how C# forwards the delegate invocation to C++ + MethodInfo invokeMethod = type.GetMethod("Invoke"); AppendBaseTypeCppMethodCall( type, typeName, - numberedTypeName, + cppTypeName, typeParams, - type.GetMethod("Invoke"), + invokeMethod, "NativeInvoke", + nativeInvokeFuncName, "operator()", false, indent, @@ -6171,11 +6195,10 @@ static void AppendDelegate( builders.CsharpBaseTypes.Append("\t\t\n"); // Invoke() is how C++ invokes the delegate - MethodInfo invokeMethod = type.GetMethod("Invoke"); AppendBaseTypeMethodCallsCsharpMethod( type, typeName, - numberedTypeName, + cppTypeName, typeParams, invokeMethod, "Invoke", @@ -6290,7 +6313,7 @@ static void AppendDelegate( static void AppendBaseType( Type type, JsonBaseType jsonBaseType, - string numberedTypeName, + string cppTypeName, Type[] typeParams, int? maxSimultaneous, StringBuilders builders) @@ -6329,7 +6352,7 @@ static void AppendBaseType( // C++ type declaration int indent = AppendCppTypeDeclaration( type.Namespace, - numberedTypeName, + cppTypeName, false, typeParams, builders.CppTypeDeclarations); @@ -6378,7 +6401,7 @@ static void AppendBaseType( // C++ type definition (begin) AppendCppTypeDefinitionBegin( - numberedTypeName, + cppTypeName, type.Namespace, TypeKind.Class, typeParams, @@ -6400,7 +6423,7 @@ static void AppendBaseType( indent + 1, builders.CppTypeDefinitions); AppendCppMethodDeclaration( - numberedTypeName, + cppTypeName, false, false, false, @@ -6478,7 +6501,7 @@ static void AppendBaseType( AppendCppBaseTypeDefaultConstructor( typeName, - numberedTypeName, + cppTypeName, typeParams, false, constructorFuncName, @@ -6487,7 +6510,7 @@ static void AppendBaseType( AppendCppBaseTypeNullptrConstructor( typeName, - numberedTypeName, + cppTypeName, typeParams, false, cppMethodDefinitionsIndent, @@ -6495,14 +6518,14 @@ static void AppendBaseType( AppendCppBaseTypeCopyConstructor( typeName, - numberedTypeName, + cppTypeName, typeParams, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeMoveConstructor( - numberedTypeName, + cppTypeName, typeParams, false, cppMethodDefinitionsIndent, @@ -6510,7 +6533,7 @@ static void AppendBaseType( AppendCppBaseTypeHandleConstructor( typeName, - numberedTypeName, + cppTypeName, typeParams, false, cppMethodDefinitionsIndent, @@ -6518,7 +6541,7 @@ static void AppendBaseType( AppendCppBaseTypeDestructor( typeName, - numberedTypeName, + cppTypeName, typeParams, false, releaseFuncName, @@ -6527,14 +6550,14 @@ static void AppendBaseType( AppendCppBaseTypeAssignmentOperatorSameType( type, - numberedTypeName, + cppTypeName, typeParams, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeAssignmentOperatorNullptr( - numberedTypeName, + cppTypeName, typeParams, false, releaseFuncName, @@ -6543,7 +6566,7 @@ static void AppendBaseType( AppendCppBaseTypeMoveAssignmentOperator( typeName, - numberedTypeName, + cppTypeName, typeParams, false, releaseFuncName, @@ -6551,13 +6574,13 @@ static void AppendBaseType( builders.CppMethodDefinitions); AppendCppBaseTypeEqualityOperator( - numberedTypeName, + cppTypeName, typeParams, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeInequalityOperator( - numberedTypeName, + cppTypeName, typeParams, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6627,19 +6650,43 @@ static void AppendBaseType( // All abstract methods foreach (MethodInfo methodInfo in type.GetMethods()) { - if (methodInfo.IsAbstract) + // Property methods like "get_X" have a "special name" + if (methodInfo.IsAbstract && !methodInfo.IsSpecialName) { AppendBaseTypeNativeMethod( type, typeName, typeParams, - numberedTypeName, + cppTypeName, methodInfo, indent, builders); } } + // All interface methods + if (type.IsInterface) + { + foreach (Type interfaceType in type.GetInterfaces()) + { + foreach (MethodInfo methodInfo in interfaceType.GetMethods()) + { + // Property methods like "get_X" have a "special name" + if (methodInfo.IsAbstract && !methodInfo.IsSpecialName) + { + AppendBaseTypeNativeMethod( + type, + typeName, + typeParams, + cppTypeName, + methodInfo, + indent, + builders); + } + } + } + } + // Specified virtual methods if (jsonBaseType.OverrideMethods != null) { @@ -6657,13 +6704,123 @@ static void AppendBaseType( type, typeName, typeParams, - numberedTypeName, + cppTypeName, methodInfo, indent, builders); } } + // All abstract properties + foreach (PropertyInfo propertyInfo in type.GetProperties()) + { + MethodInfo getMethodInfo = propertyInfo.GetGetMethod(); + MethodInfo setMethodInfo = propertyInfo.GetSetMethod(); + if ((getMethodInfo == null || !getMethodInfo.IsAbstract) && + (setMethodInfo == null || !setMethodInfo.IsAbstract)) + { + continue; + } + AppendBaseTypeProperty( + type, + typeName, + cppTypeName, + typeParams, + propertyInfo, + getMethodInfo, + setMethodInfo, + indent, + builders); + } + + // All interface properties + if (type.IsInterface) + { + foreach (Type interfaceType in type.GetInterfaces()) + { + foreach (PropertyInfo propertyInfo in + interfaceType.GetProperties()) + { + MethodInfo getMethodInfo = propertyInfo.GetGetMethod(); + MethodInfo setMethodInfo = propertyInfo.GetSetMethod(); + if ((getMethodInfo == null || !getMethodInfo.IsAbstract) && + (setMethodInfo == null || !setMethodInfo.IsAbstract)) + { + continue; + } + AppendBaseTypeProperty( + type, + typeName, + cppTypeName, + typeParams, + propertyInfo, + getMethodInfo, + setMethodInfo, + indent, + builders); + } + } + } + + // Specified virtual properties + if (jsonBaseType.OverrideProperties != null) + { + PropertyInfo[] properties = type.GetProperties(); + foreach (JsonProperty jsonProperty in jsonBaseType.OverrideProperties) + { + PropertyInfo propertyInfo = null; + foreach (PropertyInfo curPropertyInfo in properties) + { + if (curPropertyInfo.Name == jsonProperty.Name) + { + propertyInfo = curPropertyInfo; + break; + } + } + if (propertyInfo == null) + { + // Throw an exception so the user knows what to fix in the JSON + StringBuilder errorBuilder = new StringBuilder(1024); + errorBuilder.Append("Property \""); + AppendCsharpTypeName( + type, + errorBuilder); + errorBuilder.Append('.'); + errorBuilder.Append(jsonProperty.Name); + errorBuilder.Append(")\" not found"); + throw new Exception(errorBuilder.ToString()); + } + + MethodInfo getMethodInfo = propertyInfo.GetGetMethod(); + MethodInfo setMethodInfo = propertyInfo.GetSetMethod(); + if ((getMethodInfo == null || !getMethodInfo.IsVirtual) && + (setMethodInfo == null || !setMethodInfo.IsVirtual)) + { + // Throw an exception so the user knows what to fix in the JSON + StringBuilder errorBuilder = new StringBuilder(1024); + errorBuilder.Append("Property \""); + AppendCsharpTypeName( + type, + errorBuilder); + errorBuilder.Append('.'); + errorBuilder.Append(jsonProperty.Name); + errorBuilder.Append( + ")\" doesn't have either a virtual 'get' or 'set' to override"); + throw new Exception(errorBuilder.ToString()); + } + AppendBaseTypeProperty( + type, + typeName, + cppTypeName, + typeParams, + propertyInfo, + getMethodInfo, + setMethodInfo, + indent, + builders); + } + } + // C# class (ending) builders.CsharpBaseTypes.Append("\t\t}\n"); builders.CsharpBaseTypes.Append("\t\t\n"); @@ -6696,6 +6853,15 @@ static void AppendBaseTypeNativeMethod( methodInfo.Name, builders.CsharpGetDelegateCalls); + // Build the name of the C++ binding function that C# calls + builders.TempStrBuilder.Length = 0; + AppendNativeInvokeFuncName( + type, + typeParams, + methodInfo.Name, + builders.TempStrBuilder); + string nativeInvokeFuncName = builders.TempStrBuilder.ToString(); + AppendBaseTypeCppMethodCall( type, typeName, @@ -6703,11 +6869,187 @@ static void AppendBaseTypeNativeMethod( typeParams, methodInfo, methodInfo.Name, + nativeInvokeFuncName, methodInfo.Name, - !type.IsInterface, + IsNonDelegateClass(type), indent, builders); } + + static void AppendBaseTypeProperty( + Type type, + string typeName, + string cppTypeName, + Type[] typeParams, + PropertyInfo propertyInfo, + MethodInfo getMethodInfo, + MethodInfo setMethodInfo, + int indent, + StringBuilders builders) + { + bool isOverride = IsNonDelegateClass(type); + + ParameterInfo[] parameters; + if (getMethodInfo != null && getMethodInfo.IsVirtual) + { + parameters = ConvertParameters( + getMethodInfo.GetParameters()); + } + else + { + System.Reflection.ParameterInfo[] setParams = + setMethodInfo.GetParameters(); + parameters = ConvertParameters( + setParams, + 1, + setParams.Length - 1); + } + + builders.CsharpBaseTypes.Append("\t\t\tpublic "); + if (isOverride) + { + builders.CsharpBaseTypes.Append("override "); + } + AppendCsharpTypeName( + propertyInfo.PropertyType, + builders.CsharpBaseTypes); + builders.CsharpBaseTypes.Append(' '); + if (parameters.Length == 0) + { + builders.CsharpBaseTypes.Append(propertyInfo.Name); + } + else + { + builders.CsharpBaseTypes.Append("this["); + AppendCsharpParams( + parameters, + builders.CsharpBaseTypes); + builders.CsharpBaseTypes.Append(']'); + } + builders.CsharpBaseTypes.Append('\n'); + builders.CsharpBaseTypes.Append("\t\t\t{\n"); + + if (getMethodInfo != null && getMethodInfo.IsVirtual) + { + AppendBaseTypeNativeProperty( + type, + typeName, + typeParams, + cppTypeName, + propertyInfo, + getMethodInfo, + "Get", + isOverride, + indent, + builders); + } + + if (setMethodInfo != null && setMethodInfo.IsVirtual) + { + AppendBaseTypeNativeProperty( + type, + typeName, + typeParams, + cppTypeName, + propertyInfo, + setMethodInfo, + "Set", + isOverride, + indent, + builders); + } + + builders.CsharpBaseTypes.Append("\t\t\t}\n"); + builders.CsharpBaseTypes.Append("\t\t\t\n"); + } + + static void AppendBaseTypeNativeProperty( + Type type, + string typeName, + Type[] typeParams, + string cppTypeName, + PropertyInfo propertyInfo, + MethodInfo methodInfo, + string operationType, + bool isOverride, + int indent, + StringBuilders builders) + { + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append(operationType); + builders.TempStrBuilder.Append(propertyInfo.Name); + string funcName = builders.TempStrBuilder.ToString(); + + AppendCsharpGetDelegateCall( + type.Name, + type.Namespace, + typeParams, + funcName, + builders.CsharpGetDelegateCalls); + + // Build the name of the C++ binding function that C# calls + builders.TempStrBuilder.Length = 0; + AppendNativeInvokeFuncName( + type, + typeParams, + funcName, + builders.TempStrBuilder); + string nativeInvokeFuncName = builders.TempStrBuilder.ToString(); + + ParameterInfo[] invokeParams = AppendBaseTypeCppNativeInvokeCall( + type, + typeName, + cppTypeName, + typeParams, + methodInfo, + funcName, + nativeInvokeFuncName, + funcName, + isOverride, + indent, + builders); + + // C# method that calls the C++ binding function + ParameterInfo[] invokeParamsWithThis = PrependThisParameter( + invokeParams); + TypeKind invokeReturnTypeKind = GetTypeKind( + propertyInfo.PropertyType); + builders.CsharpBaseTypes.Append("\t\t\t\t"); + builders.CsharpBaseTypes.Append(char.ToLower(operationType[0])); + builders.CsharpBaseTypes.Append( + operationType, + 1, + operationType.Length - 1); + builders.CsharpBaseTypes.Append('\n'); + builders.CsharpBaseTypes.Append("\t\t\t\t{\n"); + AppendCsharpBaseTypeCppMethodCallMethodBody( + methodInfo, + nativeInvokeFuncName, + invokeParamsWithThis, + invokeReturnTypeKind, + 5, + builders.CsharpBaseTypes); + builders.CsharpBaseTypes.Append("\t\t\t\t}\n"); + } + + static void AppendCsharpParams( + ParameterInfo[] parameters, + StringBuilder output) + { + for (int i = 0; i < parameters.Length; ++i) + { + ParameterInfo param = parameters[i]; + AppendCsharpTypeName( + param.ParameterType, + output); + output.Append(' '); + output.Append(param.Name); + if (i != parameters.Length - 1) + { + output.Append(", "); + } + } + } static void AppendBaseTypeMethodCallsCsharpMethod( Type type, @@ -6875,33 +7217,80 @@ static void AppendBaseTypeMethodCallsCsharpMethod( builders.CsharpFunctions); } + static void AppendNativeInvokeFuncName( + Type type, + Type[] typeParams, + string funcName, + StringBuilder output) + { + AppendNamespace( + type.Namespace, + string.Empty, + output); + AppendTypeNameWithoutSuffixes( + type.Name, + output); + AppendTypeNames( + typeParams, + output); + output.Append(funcName); + } + static void AppendBaseTypeCppMethodCall( Type type, string typeName, - string numberedTypeName, + string cppTypeName, Type[] typeParams, MethodInfo invokeMethod, string funcName, + string nativeInvokeFuncName, string methodName, bool isOverride, int indent, StringBuilders builders) { - // Build the name of the C++ binding function that C# calls - builders.TempStrBuilder.Length = 0; - AppendNamespace( - type.Namespace, - string.Empty, - builders.TempStrBuilder); - AppendTypeNameWithoutSuffixes( - type.Name, - builders.TempStrBuilder); - AppendTypeNames( + ParameterInfo[] invokeParams = AppendBaseTypeCppNativeInvokeCall( + type, + typeName, + cppTypeName, typeParams, - builders.TempStrBuilder); - builders.TempStrBuilder.Append(funcName); - string nativeInvokeFuncName = builders.TempStrBuilder.ToString(); + invokeMethod, + funcName, + nativeInvokeFuncName, + methodName, + isOverride, + indent, + builders); + // C# method that calls the C++ binding function + ParameterInfo[] invokeParamsWithThis = PrependThisParameter( + invokeParams); + TypeKind invokeReturnTypeKind = GetTypeKind( + invokeMethod.ReturnType); + AppendCsharpBaseTypeCppMethodCallMethod( + isOverride, + invokeMethod, + funcName, + invokeParams, + nativeInvokeFuncName, + invokeParamsWithThis, + invokeReturnTypeKind, + builders.CsharpBaseTypes); + } + + static ParameterInfo[] AppendBaseTypeCppNativeInvokeCall( + Type type, + string typeName, + string cppTypeName, + Type[] typeParams, + MethodInfo invokeMethod, + string funcName, + string nativeInvokeFuncName, + string methodName, + bool isOverride, + int indent, + StringBuilders builders) + { // C++ method declaration ParameterInfo[] invokeParams = ConvertParameters( invokeMethod.GetParameters()); @@ -6920,7 +7309,7 @@ static void AppendBaseTypeCppMethodCall( // C++ method definition. This is a no-op that game code overrides. AppendCppMethodDefinitionBegin( - numberedTypeName, + cppTypeName, invokeMethod.ReturnType, methodName, typeParams, @@ -6934,10 +7323,19 @@ static void AppendBaseTypeCppMethodCall( builders.CppMethodDefinitions.Append("{\n"); if (invokeMethod.ReturnType != typeof(void)) { + TypeKind returnTypeKind = GetTypeKind(invokeMethod.ReturnType); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("return {};\n"); + if (returnTypeKind == TypeKind.Class || + returnTypeKind == TypeKind.ManagedStruct) + { + builders.CppMethodDefinitions.Append("return nullptr;\n"); + } + else + { + builders.CppMethodDefinitions.Append("return {};\n"); + } } AppendIndent( indent, @@ -6963,31 +7361,6 @@ static void AppendBaseTypeCppMethodCall( typeName, builders.CppMethodDefinitions); - // C# method that calls the C++ binding function - ParameterInfo[] invokeParamsWithThis = new ParameterInfo[ - invokeParams.Length + 1]; - for (int i = 0; i < invokeParams.Length; ++i) - { - invokeParamsWithThis[i+1] = invokeParams[i]; - } - invokeParamsWithThis[0] = new ParameterInfo { - Name = "thisHandle", - ParameterType = typeof(int), - DereferencedParameterType = typeof(int), - IsOut = false, - IsRef = false, - Kind = TypeKind.Primitive - }; - AppendCsharpBaseTypeCppMethodCallMethod( - isOverride, - invokeMethod, - funcName, - invokeParams, - nativeInvokeFuncName, - invokeParamsWithThis, - invokeReturnTypeKind, - builders.CsharpBaseTypes); - // C# delegate for the C++ binding function AppendCsharpDelegate( false, @@ -7008,6 +7381,28 @@ static void AppendBaseTypeCppMethodCall( funcName, invokeParams, builders.CsharpImports); + + return invokeParams; + } + + static ParameterInfo[] PrependThisParameter( + ParameterInfo[] invokeParams) + { + ParameterInfo[] invokeParamsWithThis = new ParameterInfo[ + invokeParams.Length + 1]; + for (int i = 0; i < invokeParams.Length; ++i) + { + invokeParamsWithThis[i+1] = invokeParams[i]; + } + invokeParamsWithThis[0] = new ParameterInfo { + Name = "thisHandle", + ParameterType = typeof(int), + DereferencedParameterType = typeof(int), + IsOut = false, + IsRef = false, + Kind = TypeKind.Primitive + }; + return invokeParamsWithThis; } static void AppendCsharpBaseTypeReleaseFunction( @@ -7070,34 +7465,55 @@ static void AppendCsharpBaseTypeCppMethodCallMethod( output.Append(" "); output.Append(funcName); output.Append("("); - for (int i = 0; i < invokeParams.Length; ++i) - { - ParameterInfo param = invokeParams[i]; - AppendCsharpTypeName( - param.ParameterType, - output); - output.Append(' '); - output.Append(param.Name); - if (i != invokeParams.Length - 1) - { - output.Append(", "); - } - } + AppendCsharpParams( + invokeParams, + output); output.Append(")\n"); output.Append("\t\t\t{\n"); - output.Append("\t\t\t\tif (CppHandle != 0)\n"); - output.Append("\t\t\t\t{\n"); - output.Append("\t\t\t\t\tint thisHandle = CppHandle;\n"); + AppendCsharpBaseTypeCppMethodCallMethodBody( + invokeMethod, + nativeInvokeFuncName, + invokeParamsWithThis, + invokeReturnTypeKind, + 4, + output); + output.Append("\t\t\t}\n"); + output.Append("\t\t\t\n"); + } + + private static void AppendCsharpBaseTypeCppMethodCallMethodBody( + MethodInfo invokeMethod, + string nativeInvokeFuncName, + ParameterInfo[] invokeParamsWithThis, + TypeKind invokeReturnTypeKind, + int indent, + StringBuilder output) + { + AppendIndent( + indent, + output); + output.Append("if (CppHandle != 0)\n"); + AppendIndent( + indent, + output); + output.Append("{\n"); + AppendIndent( + indent + 1, + output); + output.Append("int thisHandle = CppHandle;\n"); AppendCppFunctionCall( nativeInvokeFuncName, invokeParamsWithThis, invokeMethod.ReturnType, true, - 5, + indent + 1, output); if (invokeMethod.ReturnType != typeof(void)) { - output.Append("\t\t\t\t\treturn "); + AppendIndent( + indent + 1, + output); + output.Append("return "); switch (invokeReturnTypeKind) { case TypeKind.Class: @@ -7120,16 +7536,21 @@ static void AppendCsharpBaseTypeCppMethodCallMethod( break; } } - output.Append("\t\t\t\t}\n"); + AppendIndent( + indent, + output); + output.Append("}\n"); if (invokeMethod.ReturnType != typeof(void)) { - output.Append("\t\t\t\treturn default("); + AppendIndent( + indent, + output); + output.Append("return default("); AppendCsharpTypeName( invokeMethod.ReturnType, output); output.Append(");\n"); } - output.Append("\t\t\t}\n"); } private static void AppendCsharpBaseTypeConstructorFunction( @@ -7405,7 +7826,7 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( } static void AppendCppBaseTypeInequalityOperator( - string numberedTypeName, + string cppTypeName, Type[] typeParams, int cppMethodDefinitionsIndent, StringBuilder output) @@ -7415,14 +7836,14 @@ static void AppendCppBaseTypeInequalityOperator( output); output.Append("bool "); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("::operator!=(const "); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, @@ -7448,7 +7869,7 @@ static void AppendCppBaseTypeInequalityOperator( } static void AppendCppBaseTypeEqualityOperator( - string numberedTypeName, + string cppTypeName, Type[] typeParams, int cppMethodDefinitionsIndent, StringBuilder output) @@ -7458,14 +7879,14 @@ static void AppendCppBaseTypeEqualityOperator( output); output.Append("bool "); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("::operator==(const "); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, @@ -7492,7 +7913,7 @@ static void AppendCppBaseTypeEqualityOperator( static void AppendCppBaseTypeMoveAssignmentOperator( string typeName, - string numberedTypeName, + string cppTypeName, Type[] typeParams, bool typeIsDelegate, string releaseFuncName, @@ -7503,21 +7924,21 @@ static void AppendCppBaseTypeMoveAssignmentOperator( cppMethodDefinitionsIndent, output); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("& "); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("::operator=("); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, @@ -7633,7 +8054,7 @@ static void AppendCppBaseTypeMoveAssignmentOperator( } static void AppendCppBaseTypeAssignmentOperatorNullptr( - string numberedTypeName, + string cppTypeName, Type[] typeParams, bool typeIsDelegate, string releaseFuncName, @@ -7644,14 +8065,14 @@ static void AppendCppBaseTypeAssignmentOperatorNullptr( cppMethodDefinitionsIndent, output); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("& "); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, @@ -7750,7 +8171,7 @@ static void AppendCppBaseTypeAssignmentOperatorNullptr( static void AppendCppBaseTypeAssignmentOperatorSameType( Type type, - string numberedTypeName, + string cppTypeName, Type[] typeParams, bool typeIsDelegate, int cppMethodDefinitionsIndent, @@ -7760,21 +8181,21 @@ static void AppendCppBaseTypeAssignmentOperatorSameType( cppMethodDefinitionsIndent, output); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("& "); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("::operator=(const "); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, @@ -7785,7 +8206,7 @@ static void AppendCppBaseTypeAssignmentOperatorSameType( output); output.Append("{\n"); AppendSetHandle( - numberedTypeName, + cppTypeName, type.Namespace, TypeKind.Class, typeParams, @@ -7817,7 +8238,7 @@ static void AppendCppBaseTypeAssignmentOperatorSameType( static void AppendCppBaseTypeDestructor( string typeName, - string numberedTypeName, + string cppTypeName, Type[] typeParams, bool typeIsDelegate, string releaseFuncName, @@ -7828,14 +8249,14 @@ static void AppendCppBaseTypeDestructor( cppMethodDefinitionsIndent, output); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("::~"); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); output.Append("()\n"); AppendIndent( @@ -7925,7 +8346,7 @@ static void AppendCppBaseTypeDestructor( static void AppendCppBaseTypeHandleConstructor( string typeName, - string numberedTypeName, + string cppTypeName, Type[] typeParams, bool typeIsDelegate, int cppMethodDefinitionsIndent, @@ -7935,14 +8356,14 @@ static void AppendCppBaseTypeHandleConstructor( cppMethodDefinitionsIndent, output); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("::"); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); output.Append( "(Plugin::InternalUse iu, int32_t handle)\n"); @@ -7997,7 +8418,7 @@ static void AppendCppBaseTypeHandleConstructor( } static void AppendCppBaseTypeMoveConstructor( - string numberedTypeName, + string cppTypeName, Type[] typeParams, bool typeIsDelegate, int cppMethodDefinitionsIndent, @@ -8007,18 +8428,18 @@ static void AppendCppBaseTypeMoveConstructor( cppMethodDefinitionsIndent, output); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("::"); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); output.Append("("); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, @@ -8073,7 +8494,7 @@ static void AppendCppBaseTypeMoveConstructor( static void AppendCppBaseTypeCopyConstructor( string typeName, - string numberedTypeName, + string cppTypeName, Type[] typeParams, bool typeIsDelegate, int cppMethodDefinitionsIndent, @@ -8083,18 +8504,18 @@ static void AppendCppBaseTypeCopyConstructor( cppMethodDefinitionsIndent, output); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("::"); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); output.Append("(const "); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, @@ -8152,7 +8573,7 @@ static void AppendCppBaseTypeCopyConstructor( static void AppendCppBaseTypeNullptrConstructor( string typeName, - string numberedTypeName, + string cppTypeName, Type[] typeParams, bool typeIsDelegate, int cppMethodDefinitionsIndent, @@ -8162,14 +8583,14 @@ static void AppendCppBaseTypeNullptrConstructor( cppMethodDefinitionsIndent, output); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("::"); AppendTypeNameWithoutGenericSuffix( - numberedTypeName, + cppTypeName, output); output.Append("(decltype(nullptr) n)\n"); AppendIndent( @@ -8206,7 +8627,7 @@ static void AppendCppBaseTypeNullptrConstructor( static void AppendCppBaseTypeDefaultConstructor( string typeName, - string numberedTypeName, + string cppTypeName, Type[] typeParams, bool typeIsDelegate, string constructorFuncName, @@ -8214,9 +8635,9 @@ static void AppendCppBaseTypeDefaultConstructor( StringBuilder output) { AppendCppMethodDefinitionBegin( - numberedTypeName, + cppTypeName, null, - numberedTypeName, + cppTypeName, typeParams, null, new ParameterInfo[0], @@ -8876,19 +9297,14 @@ static void AppendGetter( // Build uppercase function name builders.TempStrBuilder.Length = 0; - AppendNamespace( - enclosingType.Namespace, - string.Empty, - builders.TempStrBuilder); - AppendTypeNameWithoutGenericSuffix( + AppendFieldPropertyFuncName( enclosingType.Name, - builders.TempStrBuilder); - AppendTypeNames( + enclosingType.Namespace, enclosingTypeParams, + syntaxType, + "Get", + fieldName, builders.TempStrBuilder); - builders.TempStrBuilder.Append(syntaxType); - builders.TempStrBuilder.Append("Get"); - builders.TempStrBuilder.Append(fieldNameUpper); string funcName = builders.TempStrBuilder.ToString(); // Build lowercase function name @@ -9070,19 +9486,14 @@ static void AppendSetter( // Build uppercase function name builders.TempStrBuilder.Length = 0; - AppendNamespace( - enclosingType.Namespace, - string.Empty, - builders.TempStrBuilder); - AppendTypeNameWithoutGenericSuffix( + AppendFieldPropertyFuncName( enclosingType.Name, - builders.TempStrBuilder); - AppendTypeNames( + enclosingType.Namespace, enclosingTypeParams, + syntaxType, + "Set", + fieldName, builders.TempStrBuilder); - builders.TempStrBuilder.Append(syntaxType); - builders.TempStrBuilder.Append("Set"); - builders.TempStrBuilder.Append(fieldNameUpper); string funcName = builders.TempStrBuilder.ToString(); // Build lowercase function name @@ -9237,6 +9648,31 @@ static void AppendSetter( builders.CppInitBody); } + static void AppendFieldPropertyFuncName( + string enclosingTypeName, + string enclosingTypeNamespace, + Type[] enclosingTypeParams, + string syntaxType, + string operationType, + string fieldName, + StringBuilder output) + { + AppendNamespace( + enclosingTypeNamespace, + string.Empty, + output); + AppendTypeNameWithoutGenericSuffix( + enclosingTypeName, + output); + AppendTypeNames( + enclosingTypeParams, + output); + output.Append(syntaxType); + output.Append(operationType); + output.Append(char.ToUpper(fieldName[0])); + output.Append(fieldName, 1, fieldName.Length-1); + } + static void AppendCppTemplateDeclaration( string typeName, string typeNamespace, @@ -10167,7 +10603,7 @@ static void AppendCsharpDelegateType( output.Append(", "); } } - AppendCsharpParameterDeclaration( + AppendCsharpBindingParameterDeclaration( parameters, output); output.Append(");\n"); @@ -10226,7 +10662,7 @@ static void AppendCsharpFunctionBeginning( output.Append(", "); } } - AppendCsharpParameterDeclaration( + AppendCsharpBindingParameterDeclaration( parameters, output); output.Append(")\n\t\t{\n\t\t\t"); @@ -10505,7 +10941,7 @@ StringBuilder output } } - static void AppendCsharpParameterDeclaration( + static void AppendCsharpBindingParameterDeclaration( ParameterInfo[] parameters, StringBuilder output) { @@ -11109,6 +11545,10 @@ static void AppendCsharpTypeName( { output.Append("string"); } + else if (type == typeof(object)) + { + output.Append("object"); + } else if (type.IsArray) { AppendCsharpTypeName( @@ -11211,7 +11651,7 @@ static void AppendCppTypeName( } output.Append('>'); } - else if (typeof(Delegate).IsAssignableFrom(type)) + else if (IsDelegate(type)) { AppendCppTypeName( type.Namespace, diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 1d9522a..35a3cb7 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -538,6 +538,22 @@ }, { "Name": "UnityEngine.SceneManagement.LoadSceneMode" + }, + { + "Name": "System.Collections.IEnumerator", + "Methods": [ + { + "Name": "MoveNext", + "ParamTypes": [] + } + ], + "Properties": [ + { + "Name": "Current", + "Get": {}, + "Set": {} + } + ] } ], "BaseTypes": [ @@ -567,6 +583,22 @@ "ParamTypes": [] } ] + }, + { + "Name": "System.Collections.ICollection" + }, + { + "Name": "System.Collections.IList" + }, + { + "Name": "System.Collections.Queue", + "OverrideProperties": [ + { + "Name": "Count", + "Get": {}, + "Set": {} + } + ] } ], "MonoBehaviours": [ diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index c8c1285..8526d53 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -13,8 +13,6 @@ using namespace System; using namespace UnityEngine; -void PrintPlatformDefines(); - // Called when the plugin is initialized // This is mostly full of test code. Feel free to remove it all. void PluginMain() diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 716cc36..d6a52cc 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -137,6 +137,8 @@ namespace Plugin UnityEngine::SceneManagement::Scene (*UnboxScene)(int32_t valHandle); int32_t (*BoxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val); UnityEngine::SceneManagement::LoadSceneMode (*UnboxLoadSceneMode)(int32_t valHandle); + int32_t (*SystemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle); + System::Boolean (*SystemCollectionsIEnumeratorMethodMoveNext)(int32_t thisHandle); void (*ReleaseSystemCollectionsGenericIComparerSystemInt32)(int32_t handle); void (*SystemCollectionsGenericIComparerSystemInt32Constructor)(int32_t cppHandle, int32_t* handle); void (*ReleaseSystemCollectionsGenericIComparerSystemString)(int32_t handle); @@ -145,6 +147,12 @@ namespace Plugin void (*SystemStringComparerConstructor)(int32_t cppHandle, int32_t* handle); void (*ReleaseSystemEventArgs)(int32_t handle); void (*SystemEventArgsConstructor)(int32_t cppHandle, int32_t* handle); + void (*ReleaseSystemCollectionsICollection)(int32_t handle); + void (*SystemCollectionsICollectionConstructor)(int32_t cppHandle, int32_t* handle); + void (*ReleaseSystemCollectionsIList)(int32_t handle); + void (*SystemCollectionsIListConstructor)(int32_t cppHandle, int32_t* handle); + void (*ReleaseSystemCollectionsQueue)(int32_t handle); + void (*SystemCollectionsQueueConstructor)(int32_t cppHandle, int32_t* handle); int32_t (*BoxBoolean)(System::Boolean val); System::Boolean (*UnboxBoolean)(int32_t valHandle); int32_t (*BoxSByte)(int8_t val); @@ -434,6 +442,81 @@ namespace Plugin *pRelease = (System::EventArgs*)NextFreeSystemEventArgs; NextFreeSystemEventArgs = pRelease; } + int32_t SystemCollectionsICollectionFreeListSize; + System::Collections::ICollection** SystemCollectionsICollectionFreeList; + System::Collections::ICollection** NextFreeSystemCollectionsICollection; + + int32_t StoreSystemCollectionsICollection(System::Collections::ICollection* del) + { + assert(NextFreeSystemCollectionsICollection != nullptr); + System::Collections::ICollection** pNext = NextFreeSystemCollectionsICollection; + NextFreeSystemCollectionsICollection = (System::Collections::ICollection**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemCollectionsICollectionFreeList); + } + + System::Collections::ICollection* GetSystemCollectionsICollection(int32_t handle) + { + assert(handle >= 0 && handle < SystemCollectionsICollectionFreeListSize); + return SystemCollectionsICollectionFreeList[handle]; + } + + void RemoveSystemCollectionsICollection(int32_t handle) + { + System::Collections::ICollection** pRelease = SystemCollectionsICollectionFreeList + handle; + *pRelease = (System::Collections::ICollection*)NextFreeSystemCollectionsICollection; + NextFreeSystemCollectionsICollection = pRelease; + } + int32_t SystemCollectionsIListFreeListSize; + System::Collections::IList** SystemCollectionsIListFreeList; + System::Collections::IList** NextFreeSystemCollectionsIList; + + int32_t StoreSystemCollectionsIList(System::Collections::IList* del) + { + assert(NextFreeSystemCollectionsIList != nullptr); + System::Collections::IList** pNext = NextFreeSystemCollectionsIList; + NextFreeSystemCollectionsIList = (System::Collections::IList**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemCollectionsIListFreeList); + } + + System::Collections::IList* GetSystemCollectionsIList(int32_t handle) + { + assert(handle >= 0 && handle < SystemCollectionsIListFreeListSize); + return SystemCollectionsIListFreeList[handle]; + } + + void RemoveSystemCollectionsIList(int32_t handle) + { + System::Collections::IList** pRelease = SystemCollectionsIListFreeList + handle; + *pRelease = (System::Collections::IList*)NextFreeSystemCollectionsIList; + NextFreeSystemCollectionsIList = pRelease; + } + int32_t SystemCollectionsQueueFreeListSize; + System::Collections::Queue** SystemCollectionsQueueFreeList; + System::Collections::Queue** NextFreeSystemCollectionsQueue; + + int32_t StoreSystemCollectionsQueue(System::Collections::Queue* del) + { + assert(NextFreeSystemCollectionsQueue != nullptr); + System::Collections::Queue** pNext = NextFreeSystemCollectionsQueue; + NextFreeSystemCollectionsQueue = (System::Collections::Queue**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemCollectionsQueueFreeList); + } + + System::Collections::Queue* GetSystemCollectionsQueue(int32_t handle) + { + assert(handle >= 0 && handle < SystemCollectionsQueueFreeListSize); + return SystemCollectionsQueueFreeList[handle]; + } + + void RemoveSystemCollectionsQueue(int32_t handle) + { + System::Collections::Queue** pRelease = SystemCollectionsQueueFreeList + handle; + *pRelease = (System::Collections::Queue*)NextFreeSystemCollectionsQueue; + NextFreeSystemCollectionsQueue = pRelease; + } int32_t SystemActionFreeListSize; System::Action** SystemActionFreeList; System::Action** NextFreeSystemAction; @@ -4544,6 +4627,117 @@ namespace System } } +namespace System +{ + namespace Collections + { + IEnumerator::IEnumerator(decltype(nullptr) n) + : IEnumerator(Plugin::InternalUse::Only, 0) + { + } + + IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerator::~IEnumerator() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerator& IEnumerator::operator=(const IEnumerator& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerator& IEnumerator::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerator& IEnumerator::operator=(IEnumerator&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerator::operator==(const IEnumerator& other) const + { + return Handle == other.Handle; + } + + bool IEnumerator::operator!=(const IEnumerator& other) const + { + return Handle != other.Handle; + } + + System::Object IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Object(Plugin::InternalUse::Only, returnValue); + } + + System::Boolean IEnumerator::MoveNext() + { + auto returnValue = Plugin::SystemCollectionsIEnumeratorMethodMoveNext(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + } +} + namespace System { namespace Collections @@ -5301,7 +5495,7 @@ namespace System System::String EventArgs::ToString() { - return {}; + return nullptr; } DLLEXPORT int32_t SystemEventArgsToString(int32_t cppHandle) @@ -5327,89 +5521,1094 @@ namespace System namespace System { - Object::Object(System::Boolean val) + namespace Collections { - int32_t handle = Plugin::BoxBoolean(val); - if (Plugin::unhandledCsharpException) + ICollection::ICollection() + : System::Object(nullptr) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + CppHandle = Plugin::StoreSystemCollectionsICollection(this); + Plugin::SystemCollectionsICollectionConstructor(CppHandle, &Handle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemCollectionsICollection(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - if (handle) + + ICollection::ICollection(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + CppHandle = Plugin::StoreSystemCollectionsICollection(this); } - } - - Object::operator System::Boolean() - { - System::Boolean returnVal(Plugin::UnboxBoolean(Handle)); - if (Plugin::unhandledCsharpException) + + ICollection::ICollection(const ICollection& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + CppHandle = Plugin::StoreSystemCollectionsICollection(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } - return returnVal; - } -} - -namespace System -{ - Object::Object(int8_t val) - { - int32_t handle = Plugin::BoxSByte(val); - if (Plugin::unhandledCsharpException) + + ICollection::ICollection(ICollection&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; } - if (handle) + + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + CppHandle = Plugin::StoreSystemCollectionsICollection(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } - } - - Object::operator int8_t() - { - int8_t returnVal(Plugin::UnboxSByte(Handle)); - if (Plugin::unhandledCsharpException) + + ICollection::~ICollection() { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::RemoveSystemCollectionsICollection(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsICollection(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } } - return returnVal; - } -} - -namespace System -{ - Object::Object(uint8_t val) - { - int32_t handle = Plugin::BoxByte(val); - if (Plugin::unhandledCsharpException) + + ICollection& ICollection::operator=(const ICollection& other) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - if (handle) + + ICollection& ICollection::operator=(decltype(nullptr) other) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsICollection(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + ICollection& ICollection::operator=(ICollection&& other) + { + Plugin::RemoveSystemCollectionsICollection(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsICollection(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ICollection::operator==(const ICollection& other) const + { + return Handle == other.Handle; + } + + bool ICollection::operator!=(const ICollection& other) const + { + return Handle != other.Handle; + } + + void ICollection::CopyTo(System::Array& array, int32_t index) + { + } + + DLLEXPORT void SystemCollectionsICollectionCopyTo(int32_t cppHandle, int32_t arrayHandle, int32_t index) + { + try + { + auto param0 = System::Array(Plugin::InternalUse::Only, arrayHandle); + Plugin::GetSystemCollectionsICollection(cppHandle)->CopyTo(param0, index); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::ICollection"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + System::Collections::IEnumerator ICollection::GetEnumerator() + { + return nullptr; + } + + DLLEXPORT int32_t SystemCollectionsICollectionGetEnumerator(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsICollection(cppHandle)->GetEnumerator().Handle; + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::ICollection"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + int32_t ICollection::GetCount() + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsICollectionGetCount(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsICollection(cppHandle)->GetCount(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::ICollection"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + System::Boolean ICollection::GetIsSynchronized() + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsICollectionGetIsSynchronized(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsICollection(cppHandle)->GetIsSynchronized(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::ICollection"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + System::Object ICollection::GetSyncRoot() + { + return nullptr; + } + + DLLEXPORT int32_t SystemCollectionsICollectionGetSyncRoot(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsICollection(cppHandle)->GetSyncRoot().Handle; + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::ICollection"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + } +} + +namespace System +{ + namespace Collections + { + IList::IList() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemCollectionsIList(this); + Plugin::SystemCollectionsIListConstructor(CppHandle, &Handle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemCollectionsIList(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + IList::IList(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) + { + CppHandle = Plugin::StoreSystemCollectionsIList(this); + } + + IList::IList(const IList& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreSystemCollectionsIList(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + IList::IList(IList&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + IList::IList(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemCollectionsIList(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + IList::~IList() + { + Plugin::RemoveSystemCollectionsIList(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsIList(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + IList& IList::operator=(const IList& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IList& IList::operator=(decltype(nullptr) other) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsIList(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + IList& IList::operator=(IList&& other) + { + Plugin::RemoveSystemCollectionsIList(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsIList(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IList::operator==(const IList& other) const + { + return Handle == other.Handle; + } + + bool IList::operator!=(const IList& other) const + { + return Handle != other.Handle; + } + + int32_t IList::Add(System::Object& value) + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsIListAdd(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); + return Plugin::GetSystemCollectionsIList(cppHandle)->Add(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + void IList::Clear() + { + } + + DLLEXPORT void SystemCollectionsIListClear(int32_t cppHandle) + { + try + { + Plugin::GetSystemCollectionsIList(cppHandle)->Clear(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + System::Boolean IList::Contains(System::Object& value) + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsIListContains(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); + return Plugin::GetSystemCollectionsIList(cppHandle)->Contains(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + int32_t IList::IndexOf(System::Object& value) + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsIListIndexOf(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); + return Plugin::GetSystemCollectionsIList(cppHandle)->IndexOf(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + void IList::Insert(int32_t index, System::Object& value) + { + } + + DLLEXPORT void SystemCollectionsIListInsert(int32_t cppHandle, int32_t index, int32_t valueHandle) + { + try + { + auto param1 = System::Object(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemCollectionsIList(cppHandle)->Insert(index, param1); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IList::Remove(System::Object& value) + { + } + + DLLEXPORT void SystemCollectionsIListRemove(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemCollectionsIList(cppHandle)->Remove(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IList::RemoveAt(int32_t index) + { + } + + DLLEXPORT void SystemCollectionsIListRemoveAt(int32_t cppHandle, int32_t index) + { + try + { + Plugin::GetSystemCollectionsIList(cppHandle)->RemoveAt(index); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + System::Collections::IEnumerator IList::GetEnumerator() + { + return nullptr; + } + + DLLEXPORT int32_t SystemCollectionsIListGetEnumerator(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsIList(cppHandle)->GetEnumerator().Handle; + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + void IList::CopyTo(System::Array& array, int32_t index) + { + } + + DLLEXPORT void SystemCollectionsIListCopyTo(int32_t cppHandle, int32_t arrayHandle, int32_t index) + { + try + { + auto param0 = System::Array(Plugin::InternalUse::Only, arrayHandle); + Plugin::GetSystemCollectionsIList(cppHandle)->CopyTo(param0, index); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + System::Boolean IList::GetIsFixedSize() + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsIListGetIsFixedSize(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsIList(cppHandle)->GetIsFixedSize(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + System::Boolean IList::GetIsReadOnly() + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsIListGetIsReadOnly(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsIList(cppHandle)->GetIsReadOnly(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + System::Object IList::GetItem(int32_t index) + { + return nullptr; + } + + DLLEXPORT int32_t SystemCollectionsIListGetItem(int32_t cppHandle, int32_t index) + { + try + { + return Plugin::GetSystemCollectionsIList(cppHandle)->GetItem(index).Handle; + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + void IList::SetItem(int32_t index, System::Object& value) + { + } + + DLLEXPORT void SystemCollectionsIListSetItem(int32_t cppHandle, int32_t index, int32_t valueHandle) + { + try + { + auto param1 = System::Object(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemCollectionsIList(cppHandle)->SetItem(index, param1); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + int32_t IList::GetCount() + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsIListGetCount(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsIList(cppHandle)->GetCount(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + System::Boolean IList::GetIsSynchronized() + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsIListGetIsSynchronized(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsIList(cppHandle)->GetIsSynchronized(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + System::Object IList::GetSyncRoot() + { + return nullptr; + } + + DLLEXPORT int32_t SystemCollectionsIListGetSyncRoot(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsIList(cppHandle)->GetSyncRoot().Handle; + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + } +} + +namespace System +{ + namespace Collections + { + Queue::Queue() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemCollectionsQueue(this); + Plugin::SystemCollectionsQueueConstructor(CppHandle, &Handle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemCollectionsQueue(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + Queue::Queue(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) + { + CppHandle = Plugin::StoreSystemCollectionsQueue(this); + } + + Queue::Queue(const Queue& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreSystemCollectionsQueue(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Queue::Queue(Queue&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + Queue::Queue(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemCollectionsQueue(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + Queue::~Queue() + { + Plugin::RemoveSystemCollectionsQueue(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsQueue(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + Queue& Queue::operator=(const Queue& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Queue& Queue::operator=(decltype(nullptr) other) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsQueue(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + Queue& Queue::operator=(Queue&& other) + { + Plugin::RemoveSystemCollectionsQueue(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsQueue(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Queue::operator==(const Queue& other) const + { + return Handle == other.Handle; + } + + bool Queue::operator!=(const Queue& other) const + { + return Handle != other.Handle; + } + + int32_t Queue::GetCount() + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsQueueGetCount(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsQueue(cppHandle)->GetCount(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::Queue"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + } +} + +namespace System +{ + Object::Object(System::Boolean val) + { + int32_t handle = Plugin::BoxBoolean(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator System::Boolean() + { + System::Boolean returnVal(Plugin::UnboxBoolean(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(int8_t val) + { + int32_t handle = Plugin::BoxSByte(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator int8_t() + { + int8_t returnVal(Plugin::UnboxSByte(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(uint8_t val) + { + int32_t handle = Plugin::BoxByte(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + Object::operator uint8_t() { uint8_t returnVal(Plugin::UnboxByte(Handle)); @@ -8355,7 +9554,7 @@ namespace System System::String Func3::operator()(int16_t arg1, int32_t arg2) { - return {}; + return nullptr; } DLLEXPORT int32_t SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke(int32_t cppHandle, int16_t arg1, int32_t arg2) @@ -9219,6 +10418,8 @@ DLLEXPORT void Init( UnityEngine::SceneManagement::Scene (*unboxScene)(int32_t valHandle), int32_t (*boxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val), UnityEngine::SceneManagement::LoadSceneMode (*unboxLoadSceneMode)(int32_t valHandle), + int32_t (*systemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle), + System::Boolean (*systemCollectionsIEnumeratorMethodMoveNext)(int32_t thisHandle), void (*releaseSystemCollectionsGenericIComparerSystemInt32)(int32_t handle), void (*systemCollectionsGenericIComparerSystemInt32Constructor)(int32_t cppHandle, int32_t* handle), void (*releaseSystemCollectionsGenericIComparerSystemString)(int32_t handle), @@ -9227,6 +10428,12 @@ DLLEXPORT void Init( void (*systemStringComparerConstructor)(int32_t cppHandle, int32_t* handle), void (*releaseSystemEventArgs)(int32_t handle), void (*systemEventArgsConstructor)(int32_t cppHandle, int32_t* handle), + void (*releaseSystemCollectionsICollection)(int32_t handle), + void (*systemCollectionsICollectionConstructor)(int32_t cppHandle, int32_t* handle), + void (*releaseSystemCollectionsIList)(int32_t handle), + void (*systemCollectionsIListConstructor)(int32_t cppHandle, int32_t* handle), + void (*releaseSystemCollectionsQueue)(int32_t handle), + void (*systemCollectionsQueueConstructor)(int32_t cppHandle, int32_t* handle), int32_t (*boxBoolean)(System::Boolean val), System::Boolean (*unboxBoolean)(int32_t valHandle), int32_t (*boxSByte)(int8_t val), @@ -9430,6 +10637,8 @@ DLLEXPORT void Init( Plugin::UnboxScene = unboxScene; Plugin::BoxLoadSceneMode = boxLoadSceneMode; Plugin::UnboxLoadSceneMode = unboxLoadSceneMode; + Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent = systemCollectionsIEnumeratorPropertyGetCurrent; + Plugin::SystemCollectionsIEnumeratorMethodMoveNext = systemCollectionsIEnumeratorMethodMoveNext; SystemCollectionsGenericIComparerSystemInt32FreeListSize = maxManagedObjects; SystemCollectionsGenericIComparerSystemInt32FreeList = new System::Collections::Generic::IComparer*[SystemCollectionsGenericIComparerSystemInt32FreeListSize]; for (int32_t i = 0, end = SystemCollectionsGenericIComparerSystemInt32FreeListSize - 1; i < end; ++i) @@ -9470,6 +10679,36 @@ DLLEXPORT void Init( NextFreeSystemEventArgs = SystemEventArgsFreeList + 1; Plugin::ReleaseSystemEventArgs = releaseSystemEventArgs; Plugin::SystemEventArgsConstructor = systemEventArgsConstructor; + SystemCollectionsICollectionFreeListSize = maxManagedObjects; + SystemCollectionsICollectionFreeList = new System::Collections::ICollection*[SystemCollectionsICollectionFreeListSize]; + for (int32_t i = 0, end = SystemCollectionsICollectionFreeListSize - 1; i < end; ++i) + { + SystemCollectionsICollectionFreeList[i] = (System::Collections::ICollection*)(SystemCollectionsICollectionFreeList + i + 1); + } + SystemCollectionsICollectionFreeList[SystemCollectionsICollectionFreeListSize - 1] = nullptr; + NextFreeSystemCollectionsICollection = SystemCollectionsICollectionFreeList + 1; + Plugin::ReleaseSystemCollectionsICollection = releaseSystemCollectionsICollection; + Plugin::SystemCollectionsICollectionConstructor = systemCollectionsICollectionConstructor; + SystemCollectionsIListFreeListSize = maxManagedObjects; + SystemCollectionsIListFreeList = new System::Collections::IList*[SystemCollectionsIListFreeListSize]; + for (int32_t i = 0, end = SystemCollectionsIListFreeListSize - 1; i < end; ++i) + { + SystemCollectionsIListFreeList[i] = (System::Collections::IList*)(SystemCollectionsIListFreeList + i + 1); + } + SystemCollectionsIListFreeList[SystemCollectionsIListFreeListSize - 1] = nullptr; + NextFreeSystemCollectionsIList = SystemCollectionsIListFreeList + 1; + Plugin::ReleaseSystemCollectionsIList = releaseSystemCollectionsIList; + Plugin::SystemCollectionsIListConstructor = systemCollectionsIListConstructor; + SystemCollectionsQueueFreeListSize = maxManagedObjects; + SystemCollectionsQueueFreeList = new System::Collections::Queue*[SystemCollectionsQueueFreeListSize]; + for (int32_t i = 0, end = SystemCollectionsQueueFreeListSize - 1; i < end; ++i) + { + SystemCollectionsQueueFreeList[i] = (System::Collections::Queue*)(SystemCollectionsQueueFreeList + i + 1); + } + SystemCollectionsQueueFreeList[SystemCollectionsQueueFreeListSize - 1] = nullptr; + NextFreeSystemCollectionsQueue = SystemCollectionsQueueFreeList + 1; + Plugin::ReleaseSystemCollectionsQueue = releaseSystemCollectionsQueue; + Plugin::SystemCollectionsQueueConstructor = systemCollectionsQueueConstructor; Plugin::BoxBoolean = boxBoolean; Plugin::UnboxBoolean = unboxBoolean; Plugin::BoxSByte = boxSByte; diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 57d8b43..fbf5e52 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -535,6 +535,14 @@ namespace UnityEngine } } +namespace System +{ + namespace Collections + { + struct IEnumerator; + } +} + namespace System { namespace Collections @@ -578,6 +586,30 @@ namespace System struct EventArgs; } +namespace System +{ + namespace Collections + { + struct ICollection; + } +} + +namespace System +{ + namespace Collections + { + struct IList; + } +} + +namespace System +{ + namespace Collections + { + struct Queue; + } +} + namespace MyGame { namespace MonoBehaviours @@ -1553,6 +1585,28 @@ namespace UnityEngine } } +namespace System +{ + namespace Collections + { + struct IEnumerator : System::Object + { + IEnumerator(decltype(nullptr) n); + IEnumerator(Plugin::InternalUse iu, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr) other); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + System::Object GetCurrent(); + System::Boolean MoveNext(); + }; + } +} + namespace System { namespace Collections @@ -1647,6 +1701,94 @@ namespace System }; } +namespace System +{ + namespace Collections + { + struct ICollection : System::Object + { + ICollection(decltype(nullptr) n); + ICollection(Plugin::InternalUse iu, int32_t handle); + ICollection(const ICollection& other); + ICollection(ICollection&& other); + virtual ~ICollection(); + ICollection& operator=(const ICollection& other); + ICollection& operator=(decltype(nullptr) other); + ICollection& operator=(ICollection&& other); + bool operator==(const ICollection& other) const; + bool operator!=(const ICollection& other) const; + int32_t CppHandle; + ICollection(); + virtual void CopyTo(System::Array& array, int32_t index); + virtual System::Collections::IEnumerator GetEnumerator(); + virtual int32_t GetCount(); + virtual System::Boolean GetIsSynchronized(); + virtual System::Object GetSyncRoot(); + }; + } +} + +namespace System +{ + namespace Collections + { + struct IList : System::Object + { + IList(decltype(nullptr) n); + IList(Plugin::InternalUse iu, int32_t handle); + IList(const IList& other); + IList(IList&& other); + virtual ~IList(); + IList& operator=(const IList& other); + IList& operator=(decltype(nullptr) other); + IList& operator=(IList&& other); + bool operator==(const IList& other) const; + bool operator!=(const IList& other) const; + int32_t CppHandle; + IList(); + virtual int32_t Add(System::Object& value); + virtual void Clear(); + virtual System::Boolean Contains(System::Object& value); + virtual int32_t IndexOf(System::Object& value); + virtual void Insert(int32_t index, System::Object& value); + virtual void Remove(System::Object& value); + virtual void RemoveAt(int32_t index); + virtual System::Collections::IEnumerator GetEnumerator(); + virtual void CopyTo(System::Array& array, int32_t index); + virtual System::Boolean GetIsFixedSize(); + virtual System::Boolean GetIsReadOnly(); + virtual System::Object GetItem(int32_t index); + virtual void SetItem(int32_t index, System::Object& value); + virtual int32_t GetCount(); + virtual System::Boolean GetIsSynchronized(); + virtual System::Object GetSyncRoot(); + }; + } +} + +namespace System +{ + namespace Collections + { + struct Queue : System::Object + { + Queue(decltype(nullptr) n); + Queue(Plugin::InternalUse iu, int32_t handle); + Queue(const Queue& other); + Queue(Queue&& other); + virtual ~Queue(); + Queue& operator=(const Queue& other); + Queue& operator=(decltype(nullptr) other); + Queue& operator=(Queue&& other); + bool operator==(const Queue& other) const; + bool operator!=(const Queue& other) const; + int32_t CppHandle; + Queue(); + virtual int32_t GetCount(); + }; + } +} + namespace MyGame { namespace MonoBehaviours From 8599cf8da1cb6a6b40b064f210700cb0112636dc Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 3 Dec 2017 14:00:49 -0800 Subject: [PATCH 44/95] Support overriding events --- README.md | 1 - Unity/Assets/NativeScript/Bindings.cs | 3340 +++++--- .../NativeScript/Editor/GenerateBindings.cs | 200 +- Unity/Assets/NativeScriptTypes.json | 42 +- Unity/CppSource/NativeScript/Bindings.cpp | 7620 +++++++++++------ Unity/CppSource/NativeScript/Bindings.h | 427 +- 6 files changed, 7616 insertions(+), 4014 deletions(-) diff --git a/README.md b/README.md index 72e395c..5280b7a 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,6 @@ Note that the code generator does not support (yet): * `Array` methods (e.g. `IndexOf`) * `string` methods (e.g. `Substring`) * Default parameters -* Overriding events * Deriving from classes without a default constructor * `decimal` * C# pointers diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index aad32f6..b6fd6c0 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -379,14 +379,14 @@ delegate void InitDelegate( IntPtr systemCollectionsGenericIComparerSystemStringConstructor, IntPtr releaseSystemStringComparer, IntPtr systemStringComparerConstructor, - IntPtr releaseSystemEventArgs, - IntPtr systemEventArgsConstructor, IntPtr releaseSystemCollectionsICollection, IntPtr systemCollectionsICollectionConstructor, IntPtr releaseSystemCollectionsIList, IntPtr systemCollectionsIListConstructor, IntPtr releaseSystemCollectionsQueue, IntPtr systemCollectionsQueueConstructor, + IntPtr releaseSystemComponentModelDesignIComponentChangeService, + IntPtr systemComponentModelDesignIComponentChangeServiceConstructor, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -476,7 +476,27 @@ delegate void InitDelegate( IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor, IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd, IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove, - IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke + IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke, + IntPtr releaseSystemComponentModelDesignComponentEventHandler, + IntPtr systemComponentModelDesignComponentEventHandlerConstructor, + IntPtr systemComponentModelDesignComponentEventHandlerAdd, + IntPtr systemComponentModelDesignComponentEventHandlerRemove, + IntPtr systemComponentModelDesignComponentEventHandlerInvoke, + IntPtr releaseSystemComponentModelDesignComponentChangingEventHandler, + IntPtr systemComponentModelDesignComponentChangingEventHandlerConstructor, + IntPtr systemComponentModelDesignComponentChangingEventHandlerAdd, + IntPtr systemComponentModelDesignComponentChangingEventHandlerRemove, + IntPtr systemComponentModelDesignComponentChangingEventHandlerInvoke, + IntPtr releaseSystemComponentModelDesignComponentChangedEventHandler, + IntPtr systemComponentModelDesignComponentChangedEventHandlerConstructor, + IntPtr systemComponentModelDesignComponentChangedEventHandlerAdd, + IntPtr systemComponentModelDesignComponentChangedEventHandlerRemove, + IntPtr systemComponentModelDesignComponentChangedEventHandlerInvoke, + IntPtr releaseSystemComponentModelDesignComponentRenameEventHandler, + IntPtr systemComponentModelDesignComponentRenameEventHandlerConstructor, + IntPtr systemComponentModelDesignComponentRenameEventHandlerAdd, + IntPtr systemComponentModelDesignComponentRenameEventHandlerRemove, + IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke /*END INIT PARAMS*/); public delegate void SetCsharpExceptionDelegate(int handle); @@ -497,9 +517,6 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc public delegate int SystemStringComparerGetHashCodeDelegate(int thisHandle, int param0); public static SystemStringComparerGetHashCodeDelegate SystemStringComparerGetHashCode; - public delegate int SystemEventArgsToStringDelegate(int thisHandle); - public static SystemEventArgsToStringDelegate SystemEventArgsToString; - public delegate void SystemCollectionsICollectionCopyToDelegate(int thisHandle, int param0, int param1); public static SystemCollectionsICollectionCopyToDelegate SystemCollectionsICollectionCopyTo; @@ -566,6 +583,54 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc public delegate int SystemCollectionsQueueGetCountDelegate(int thisHandle); public static SystemCollectionsQueueGetCountDelegate SystemCollectionsQueueGetCount; + public delegate void SystemComponentModelDesignIComponentChangeServiceOnComponentChangedDelegate(int thisHandle, int param0, int param1, int param2, int param3); + public static SystemComponentModelDesignIComponentChangeServiceOnComponentChangedDelegate SystemComponentModelDesignIComponentChangeServiceOnComponentChanged; + + public delegate void SystemComponentModelDesignIComponentChangeServiceOnComponentChangingDelegate(int thisHandle, int param0, int param1); + public static SystemComponentModelDesignIComponentChangeServiceOnComponentChangingDelegate SystemComponentModelDesignIComponentChangeServiceOnComponentChanging; + + public delegate void SystemComponentModelDesignIComponentChangeServiceAddComponentAddedDelegate(int thisHandle, int param0); + public static SystemComponentModelDesignIComponentChangeServiceAddComponentAddedDelegate SystemComponentModelDesignIComponentChangeServiceAddComponentAdded; + + public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAddedDelegate(int thisHandle, int param0); + public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentAddedDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded; + + public delegate void SystemComponentModelDesignIComponentChangeServiceAddComponentAddingDelegate(int thisHandle, int param0); + public static SystemComponentModelDesignIComponentChangeServiceAddComponentAddingDelegate SystemComponentModelDesignIComponentChangeServiceAddComponentAdding; + + public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAddingDelegate(int thisHandle, int param0); + public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentAddingDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding; + + public delegate void SystemComponentModelDesignIComponentChangeServiceAddComponentChangedDelegate(int thisHandle, int param0); + public static SystemComponentModelDesignIComponentChangeServiceAddComponentChangedDelegate SystemComponentModelDesignIComponentChangeServiceAddComponentChanged; + + public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChangedDelegate(int thisHandle, int param0); + public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentChangedDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanged; + + public delegate void SystemComponentModelDesignIComponentChangeServiceAddComponentChangingDelegate(int thisHandle, int param0); + public static SystemComponentModelDesignIComponentChangeServiceAddComponentChangingDelegate SystemComponentModelDesignIComponentChangeServiceAddComponentChanging; + + public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChangingDelegate(int thisHandle, int param0); + public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentChangingDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanging; + + public delegate void SystemComponentModelDesignIComponentChangeServiceAddComponentRemovedDelegate(int thisHandle, int param0); + public static SystemComponentModelDesignIComponentChangeServiceAddComponentRemovedDelegate SystemComponentModelDesignIComponentChangeServiceAddComponentRemoved; + + public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemovedDelegate(int thisHandle, int param0); + public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemovedDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoved; + + public delegate void SystemComponentModelDesignIComponentChangeServiceAddComponentRemovingDelegate(int thisHandle, int param0); + public static SystemComponentModelDesignIComponentChangeServiceAddComponentRemovingDelegate SystemComponentModelDesignIComponentChangeServiceAddComponentRemoving; + + public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemovingDelegate(int thisHandle, int param0); + public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemovingDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving; + + public delegate void SystemComponentModelDesignIComponentChangeServiceAddComponentRenameDelegate(int thisHandle, int param0); + public static SystemComponentModelDesignIComponentChangeServiceAddComponentRenameDelegate SystemComponentModelDesignIComponentChangeServiceAddComponentRename; + + public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRenameDelegate(int thisHandle, int param0); + public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentRenameDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename; + public delegate void MyGameMonoBehavioursTestScriptAwakeDelegate(int thisHandle); public static MyGameMonoBehavioursTestScriptAwakeDelegate MyGameMonoBehavioursTestScriptAwake; @@ -602,6 +667,18 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc public delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvokeDelegate(int thisHandle, UnityEngine.SceneManagement.Scene param0, UnityEngine.SceneManagement.LoadSceneMode param1); public static UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvokeDelegate UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke; + public delegate void SystemComponentModelDesignComponentEventHandlerNativeInvokeDelegate(int thisHandle, int param0, int param1); + public static SystemComponentModelDesignComponentEventHandlerNativeInvokeDelegate SystemComponentModelDesignComponentEventHandlerNativeInvoke; + + public delegate void SystemComponentModelDesignComponentChangingEventHandlerNativeInvokeDelegate(int thisHandle, int param0, int param1); + public static SystemComponentModelDesignComponentChangingEventHandlerNativeInvokeDelegate SystemComponentModelDesignComponentChangingEventHandlerNativeInvoke; + + public delegate void SystemComponentModelDesignComponentChangedEventHandlerNativeInvokeDelegate(int thisHandle, int param0, int param1); + public static SystemComponentModelDesignComponentChangedEventHandlerNativeInvokeDelegate SystemComponentModelDesignComponentChangedEventHandlerNativeInvoke; + + public delegate void SystemComponentModelDesignComponentRenameEventHandlerNativeInvokeDelegate(int thisHandle, int param0, int param1); + public static SystemComponentModelDesignComponentRenameEventHandlerNativeInvokeDelegate SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke; + public delegate void SetCsharpExceptionSystemNullReferenceExceptionDelegate(int param0); public static SetCsharpExceptionSystemNullReferenceExceptionDelegate SetCsharpExceptionSystemNullReferenceException; /*END MONOBEHAVIOUR DELEGATES*/ @@ -808,14 +885,14 @@ static extern void Init( IntPtr systemCollectionsGenericIComparerSystemStringConstructor, IntPtr releaseSystemStringComparer, IntPtr systemStringComparerConstructor, - IntPtr releaseSystemEventArgs, - IntPtr systemEventArgsConstructor, IntPtr releaseSystemCollectionsICollection, IntPtr systemCollectionsICollectionConstructor, IntPtr releaseSystemCollectionsIList, IntPtr systemCollectionsIListConstructor, IntPtr releaseSystemCollectionsQueue, IntPtr systemCollectionsQueueConstructor, + IntPtr releaseSystemComponentModelDesignIComponentChangeService, + IntPtr systemComponentModelDesignIComponentChangeServiceConstructor, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -905,7 +982,27 @@ static extern void Init( IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor, IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd, IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove, - IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke + IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke, + IntPtr releaseSystemComponentModelDesignComponentEventHandler, + IntPtr systemComponentModelDesignComponentEventHandlerConstructor, + IntPtr systemComponentModelDesignComponentEventHandlerAdd, + IntPtr systemComponentModelDesignComponentEventHandlerRemove, + IntPtr systemComponentModelDesignComponentEventHandlerInvoke, + IntPtr releaseSystemComponentModelDesignComponentChangingEventHandler, + IntPtr systemComponentModelDesignComponentChangingEventHandlerConstructor, + IntPtr systemComponentModelDesignComponentChangingEventHandlerAdd, + IntPtr systemComponentModelDesignComponentChangingEventHandlerRemove, + IntPtr systemComponentModelDesignComponentChangingEventHandlerInvoke, + IntPtr releaseSystemComponentModelDesignComponentChangedEventHandler, + IntPtr systemComponentModelDesignComponentChangedEventHandlerConstructor, + IntPtr systemComponentModelDesignComponentChangedEventHandlerAdd, + IntPtr systemComponentModelDesignComponentChangedEventHandlerRemove, + IntPtr systemComponentModelDesignComponentChangedEventHandlerInvoke, + IntPtr releaseSystemComponentModelDesignComponentRenameEventHandler, + IntPtr systemComponentModelDesignComponentRenameEventHandlerConstructor, + IntPtr systemComponentModelDesignComponentRenameEventHandlerAdd, + IntPtr systemComponentModelDesignComponentRenameEventHandlerRemove, + IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke /*END INIT PARAMS*/); [DllImport(PluginName)] @@ -927,9 +1024,6 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc [DllImport(Constants.PluginName)] public static extern void SystemStringComparerGetHashCode(int thisHandle, int param0); - [DllImport(Constants.PluginName)] - public static extern void SystemEventArgsToString(int thisHandle); - [DllImport(Constants.PluginName)] public static extern void SystemCollectionsICollectionCopyTo(int thisHandle, int param0, int param1); @@ -996,6 +1090,54 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc [DllImport(Constants.PluginName)] public static extern void SystemCollectionsQueueGetCount(int thisHandle); + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceOnComponentChanged(int thisHandle, int param0, int param1, int param2, int param3); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceOnComponentChanging(int thisHandle, int param0, int param1); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceAddComponentAdded(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceAddComponentAdding(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceAddComponentChanged(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanged(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceAddComponentChanging(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanging(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceAddComponentRemoved(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoved(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceAddComponentRemoving(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceAddComponentRename(int thisHandle, int param0); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename(int thisHandle, int param0); + [DllImport(Constants.PluginName)] public static extern void MyGameMonoBehavioursTestScriptAwake(int thisHandle); @@ -1032,6 +1174,18 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc [DllImport(Constants.PluginName)] public static extern void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(int thisHandle, UnityEngine.SceneManagement.Scene param0, int param1); + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignComponentEventHandlerNativeInvoke(int thisHandle, int param0, int param1); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignComponentChangingEventHandlerNativeInvoke(int thisHandle, int param0, int param1); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignComponentChangedEventHandlerNativeInvoke(int thisHandle, int param0, int param1); + + [DllImport(Constants.PluginName)] + public static extern void SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke(int thisHandle, int param0, int param1); + [DllImport(Constants.PluginName)] public static extern void SetCsharpExceptionSystemNullReferenceException(int thisHandle, int param0); /*END MONOBEHAVIOUR IMPORTS*/ @@ -1148,14 +1302,14 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc delegate void ReleaseSystemCollectionsGenericIComparerSystemStringDelegate(int handle); delegate void SystemStringComparerConstructorDelegate(int cppHandle, ref int handle); delegate void ReleaseSystemStringComparerDelegate(int handle); - delegate void SystemEventArgsConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemEventArgsDelegate(int handle); delegate void SystemCollectionsICollectionConstructorDelegate(int cppHandle, ref int handle); delegate void ReleaseSystemCollectionsICollectionDelegate(int handle); delegate void SystemCollectionsIListConstructorDelegate(int cppHandle, ref int handle); delegate void ReleaseSystemCollectionsIListDelegate(int handle); delegate void SystemCollectionsQueueConstructorDelegate(int cppHandle, ref int handle); delegate void ReleaseSystemCollectionsQueueDelegate(int handle); + delegate void SystemComponentModelDesignIComponentChangeServiceConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemComponentModelDesignIComponentChangeServiceDelegate(int handle); delegate int BoxBooleanDelegate(bool val); delegate bool UnboxBooleanDelegate(int valHandle); delegate int BoxSByteDelegate(sbyte val); @@ -1246,6 +1400,26 @@ IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSc delegate void ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeDelegate(int handle, int classHandle); delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAddDelegate(int thisHandle, int delHandle); delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemoveDelegate(int thisHandle, int delHandle); + delegate void SystemComponentModelDesignComponentEventHandlerInvokeDelegate(int thisHandle, int senderHandle, int eHandle); + delegate void SystemComponentModelDesignComponentEventHandlerConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); + delegate void ReleaseSystemComponentModelDesignComponentEventHandlerDelegate(int handle, int classHandle); + delegate void SystemComponentModelDesignComponentEventHandlerAddDelegate(int thisHandle, int delHandle); + delegate void SystemComponentModelDesignComponentEventHandlerRemoveDelegate(int thisHandle, int delHandle); + delegate void SystemComponentModelDesignComponentChangingEventHandlerInvokeDelegate(int thisHandle, int senderHandle, int eHandle); + delegate void SystemComponentModelDesignComponentChangingEventHandlerConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); + delegate void ReleaseSystemComponentModelDesignComponentChangingEventHandlerDelegate(int handle, int classHandle); + delegate void SystemComponentModelDesignComponentChangingEventHandlerAddDelegate(int thisHandle, int delHandle); + delegate void SystemComponentModelDesignComponentChangingEventHandlerRemoveDelegate(int thisHandle, int delHandle); + delegate void SystemComponentModelDesignComponentChangedEventHandlerInvokeDelegate(int thisHandle, int senderHandle, int eHandle); + delegate void SystemComponentModelDesignComponentChangedEventHandlerConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); + delegate void ReleaseSystemComponentModelDesignComponentChangedEventHandlerDelegate(int handle, int classHandle); + delegate void SystemComponentModelDesignComponentChangedEventHandlerAddDelegate(int thisHandle, int delHandle); + delegate void SystemComponentModelDesignComponentChangedEventHandlerRemoveDelegate(int thisHandle, int delHandle); + delegate void SystemComponentModelDesignComponentRenameEventHandlerInvokeDelegate(int thisHandle, int senderHandle, int eHandle); + delegate void SystemComponentModelDesignComponentRenameEventHandlerConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); + delegate void ReleaseSystemComponentModelDesignComponentRenameEventHandlerDelegate(int handle, int classHandle); + delegate void SystemComponentModelDesignComponentRenameEventHandlerAddDelegate(int thisHandle, int delHandle); + delegate void SystemComponentModelDesignComponentRenameEventHandlerRemoveDelegate(int thisHandle, int delHandle); /*END DELEGATE TYPES*/ public static Exception UnhandledCppException; @@ -1285,7 +1459,6 @@ public static void Open( SystemStringComparerCompare = GetDelegate(libraryHandle, "SystemStringComparerCompare"); SystemStringComparerEquals = GetDelegate(libraryHandle, "SystemStringComparerEquals"); SystemStringComparerGetHashCode = GetDelegate(libraryHandle, "SystemStringComparerGetHashCode"); - SystemEventArgsToString = GetDelegate(libraryHandle, "SystemEventArgsToString"); SystemCollectionsICollectionCopyTo = GetDelegate(libraryHandle, "SystemCollectionsICollectionCopyTo"); SystemCollectionsICollectionGetEnumerator = GetDelegate(libraryHandle, "SystemCollectionsICollectionGetEnumerator"); SystemCollectionsICollectionGetCount = GetDelegate(libraryHandle, "SystemCollectionsICollectionGetCount"); @@ -1308,6 +1481,22 @@ public static void Open( SystemCollectionsIListGetIsSynchronized = GetDelegate(libraryHandle, "SystemCollectionsIListGetIsSynchronized"); SystemCollectionsIListGetSyncRoot = GetDelegate(libraryHandle, "SystemCollectionsIListGetSyncRoot"); SystemCollectionsQueueGetCount = GetDelegate(libraryHandle, "SystemCollectionsQueueGetCount"); + SystemComponentModelDesignIComponentChangeServiceOnComponentChanged = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceOnComponentChanged"); + SystemComponentModelDesignIComponentChangeServiceOnComponentChanging = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceOnComponentChanging"); + SystemComponentModelDesignIComponentChangeServiceAddComponentAdded = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentAdded"); + SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded"); + SystemComponentModelDesignIComponentChangeServiceAddComponentAdding = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentAdding"); + SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding"); + SystemComponentModelDesignIComponentChangeServiceAddComponentChanged = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentChanged"); + SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanged = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanged"); + SystemComponentModelDesignIComponentChangeServiceAddComponentChanging = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentChanging"); + SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanging = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanging"); + SystemComponentModelDesignIComponentChangeServiceAddComponentRemoved = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentRemoved"); + SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoved = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoved"); + SystemComponentModelDesignIComponentChangeServiceAddComponentRemoving = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentRemoving"); + SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving"); + SystemComponentModelDesignIComponentChangeServiceAddComponentRename = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentRename"); + SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename"); MyGameMonoBehavioursTestScriptAwake = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptAwake"); MyGameMonoBehavioursTestScriptOnAnimatorIK = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptOnAnimatorIK"); MyGameMonoBehavioursTestScriptOnCollisionEnter = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptOnCollisionEnter"); @@ -1320,6 +1509,10 @@ public static void Open( SystemAppDomainInitializerNativeInvoke = GetDelegate(libraryHandle, "SystemAppDomainInitializerNativeInvoke"); UnityEngineEventsUnityActionNativeInvoke = GetDelegate(libraryHandle, "UnityEngineEventsUnityActionNativeInvoke"); UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke = GetDelegate(libraryHandle, "UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke"); + SystemComponentModelDesignComponentEventHandlerNativeInvoke = GetDelegate(libraryHandle, "SystemComponentModelDesignComponentEventHandlerNativeInvoke"); + SystemComponentModelDesignComponentChangingEventHandlerNativeInvoke = GetDelegate(libraryHandle, "SystemComponentModelDesignComponentChangingEventHandlerNativeInvoke"); + SystemComponentModelDesignComponentChangedEventHandlerNativeInvoke = GetDelegate(libraryHandle, "SystemComponentModelDesignComponentChangedEventHandlerNativeInvoke"); + SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke = GetDelegate(libraryHandle, "SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke"); SetCsharpExceptionSystemNullReferenceException = GetDelegate(libraryHandle, "SetCsharpExceptionSystemNullReferenceException"); /*END MONOBEHAVIOUR GETDELEGATE CALLS*/ @@ -1438,14 +1631,14 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIComparerSystemStringConstructorDelegate(SystemCollectionsGenericIComparerSystemStringConstructor)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemStringComparerDelegate(ReleaseSystemStringComparer)), Marshal.GetFunctionPointerForDelegate(new SystemStringComparerConstructorDelegate(SystemStringComparerConstructor)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemEventArgsDelegate(ReleaseSystemEventArgs)), - Marshal.GetFunctionPointerForDelegate(new SystemEventArgsConstructorDelegate(SystemEventArgsConstructor)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsICollectionDelegate(ReleaseSystemCollectionsICollection)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsICollectionConstructorDelegate(SystemCollectionsICollectionConstructor)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsIListDelegate(ReleaseSystemCollectionsIList)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIListConstructorDelegate(SystemCollectionsIListConstructor)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsQueueDelegate(ReleaseSystemCollectionsQueue)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsQueueConstructorDelegate(SystemCollectionsQueueConstructor)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemComponentModelDesignIComponentChangeServiceDelegate(ReleaseSystemComponentModelDesignIComponentChangeService)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignIComponentChangeServiceConstructorDelegate(SystemComponentModelDesignIComponentChangeServiceConstructor)), Marshal.GetFunctionPointerForDelegate(new BoxBooleanDelegate(BoxBoolean)), Marshal.GetFunctionPointerForDelegate(new UnboxBooleanDelegate(UnboxBoolean)), Marshal.GetFunctionPointerForDelegate(new BoxSByteDelegate(BoxSByte)), @@ -1535,7 +1728,27 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructorDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)), Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAddDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)), Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemoveDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)) + Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemComponentModelDesignComponentEventHandlerDelegate(ReleaseSystemComponentModelDesignComponentEventHandler)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentEventHandlerConstructorDelegate(SystemComponentModelDesignComponentEventHandlerConstructor)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentEventHandlerAddDelegate(SystemComponentModelDesignComponentEventHandlerAdd)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentEventHandlerRemoveDelegate(SystemComponentModelDesignComponentEventHandlerRemove)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentEventHandlerInvokeDelegate(SystemComponentModelDesignComponentEventHandlerInvoke)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemComponentModelDesignComponentChangingEventHandlerDelegate(ReleaseSystemComponentModelDesignComponentChangingEventHandler)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangingEventHandlerConstructorDelegate(SystemComponentModelDesignComponentChangingEventHandlerConstructor)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangingEventHandlerAddDelegate(SystemComponentModelDesignComponentChangingEventHandlerAdd)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangingEventHandlerRemoveDelegate(SystemComponentModelDesignComponentChangingEventHandlerRemove)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangingEventHandlerInvokeDelegate(SystemComponentModelDesignComponentChangingEventHandlerInvoke)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemComponentModelDesignComponentChangedEventHandlerDelegate(ReleaseSystemComponentModelDesignComponentChangedEventHandler)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangedEventHandlerConstructorDelegate(SystemComponentModelDesignComponentChangedEventHandlerConstructor)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangedEventHandlerAddDelegate(SystemComponentModelDesignComponentChangedEventHandlerAdd)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangedEventHandlerRemoveDelegate(SystemComponentModelDesignComponentChangedEventHandlerRemove)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangedEventHandlerInvokeDelegate(SystemComponentModelDesignComponentChangedEventHandlerInvoke)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemComponentModelDesignComponentRenameEventHandlerDelegate(ReleaseSystemComponentModelDesignComponentRenameEventHandler)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentRenameEventHandlerConstructorDelegate(SystemComponentModelDesignComponentRenameEventHandlerConstructor)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentRenameEventHandlerAddDelegate(SystemComponentModelDesignComponentRenameEventHandlerAdd)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentRenameEventHandlerRemoveDelegate(SystemComponentModelDesignComponentRenameEventHandlerRemove)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentRenameEventHandlerInvokeDelegate(SystemComponentModelDesignComponentRenameEventHandlerInvoke)) /*END INIT CALL*/ ); if (UnhandledCppException != null) @@ -1717,34 +1930,6 @@ public override int GetHashCode(string obj) } - class SystemEventArgs : System.EventArgs - { - public int CppHandle; - - public SystemEventArgs(int cppHandle) - { - CppHandle = cppHandle; - } - - public override string ToString() - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemEventArgsToString(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return (string)NativeScript.Bindings.ObjectStore.Get(returnVal); - } - return default(string); - } - - } - class SystemCollectionsICollection : System.Collections.ICollection { public int CppHandle; @@ -2175,23 +2360,25 @@ public override int Count } - class SystemAction + class SystemComponentModelDesignIComponentChangeService : System.ComponentModel.Design.IComponentChangeService { public int CppHandle; - public System.Action Delegate; - public SystemAction(int cppHandle) + public SystemComponentModelDesignIComponentChangeService(int cppHandle) { CppHandle = cppHandle; - Delegate = NativeInvoke; } - public void NativeInvoke() + public void OnComponentChanged(object component, System.ComponentModel.MemberDescriptor member, object oldValue, object newValue) { if (CppHandle != 0) { int thisHandle = CppHandle; - NativeScript.Bindings.SystemActionNativeInvoke(thisHandle); + int componentHandle = NativeScript.Bindings.ObjectStore.GetHandle(component); + int memberHandle = NativeScript.Bindings.ObjectStore.GetHandle(member); + int oldValueHandle = NativeScript.Bindings.ObjectStore.GetHandle(oldValue); + int newValueHandle = NativeScript.Bindings.ObjectStore.GetHandle(newValue); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceOnComponentChanged(thisHandle, componentHandle, memberHandle, oldValueHandle, newValueHandle); if (NativeScript.Bindings.UnhandledCppException != null) { Exception ex = NativeScript.Bindings.UnhandledCppException; @@ -2201,25 +2388,14 @@ public void NativeInvoke() } } - } - - class SystemActionSystemSingle - { - public int CppHandle; - public System.Action Delegate; - - public SystemActionSystemSingle(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public void NativeInvoke(float obj) + public void OnComponentChanging(object component, System.ComponentModel.MemberDescriptor member) { if (CppHandle != 0) { int thisHandle = CppHandle; - NativeScript.Bindings.SystemActionSystemSingleNativeInvoke(thisHandle, obj); + int componentHandle = NativeScript.Bindings.ObjectStore.GetHandle(component); + int memberHandle = NativeScript.Bindings.ObjectStore.GetHandle(member); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceOnComponentChanging(thisHandle, componentHandle, memberHandle); if (NativeScript.Bindings.UnhandledCppException != null) { Exception ex = NativeScript.Bindings.UnhandledCppException; @@ -2229,142 +2405,584 @@ public void NativeInvoke(float obj) } } - } - - class SystemActionSystemSingle_SystemSingle - { - public int CppHandle; - public System.Action Delegate; - - public SystemActionSystemSingle_SystemSingle(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public void NativeInvoke(float arg1, float arg2) + public event System.ComponentModel.Design.ComponentEventHandler ComponentAdded { - if (CppHandle != 0) + add { - int thisHandle = CppHandle; - NativeScript.Bindings.SystemActionSystemSingle_SystemSingleNativeInvoke(thisHandle, arg1, arg2); - if (NativeScript.Bindings.UnhandledCppException != null) + if (CppHandle != 0) { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentAdded(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } } } - } - - } - - class SystemFuncSystemInt32_SystemSingle_SystemDouble - { - public int CppHandle; - public System.Func Delegate; - - public SystemFuncSystemInt32_SystemSingle_SystemDouble(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public double NativeInvoke(int arg1, float arg2) - { - if (CppHandle != 0) + remove { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke(thisHandle, arg1, arg2); - if (NativeScript.Bindings.UnhandledCppException != null) + if (CppHandle != 0) { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } } - return returnVal; } - return default(double); - } - - } - - class SystemFuncSystemInt16_SystemInt32_SystemString - { - public int CppHandle; - public System.Func Delegate; - - public SystemFuncSystemInt16_SystemInt32_SystemString(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; } - public string NativeInvoke(short arg1, int arg2) + public event System.ComponentModel.Design.ComponentEventHandler ComponentAdding { - if (CppHandle != 0) + add { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke(thisHandle, arg1, arg2); - if (NativeScript.Bindings.UnhandledCppException != null) + if (CppHandle != 0) { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentAdding(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } } - return (string)NativeScript.Bindings.ObjectStore.Get(returnVal); } - return default(string); - } - - } - - class SystemAppDomainInitializer - { - public int CppHandle; - public System.AppDomainInitializer Delegate; - - public SystemAppDomainInitializer(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public void NativeInvoke(string[] args) - { - if (CppHandle != 0) + remove { - int thisHandle = CppHandle; - int argsHandle = NativeScript.Bindings.ObjectStore.GetHandle(args); - NativeScript.Bindings.SystemAppDomainInitializerNativeInvoke(thisHandle, argsHandle); - if (NativeScript.Bindings.UnhandledCppException != null) + if (CppHandle != 0) { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } } } } - } - - class UnityEngineEventsUnityAction - { - public int CppHandle; - public UnityEngine.Events.UnityAction Delegate; - - public UnityEngineEventsUnityAction(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public void NativeInvoke() + public event System.ComponentModel.Design.ComponentChangedEventHandler ComponentChanged { - if (CppHandle != 0) + add { - int thisHandle = CppHandle; - NativeScript.Bindings.UnityEngineEventsUnityActionNativeInvoke(thisHandle); + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentChanged(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + remove + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanged(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } + + public event System.ComponentModel.Design.ComponentChangingEventHandler ComponentChanging + { + add + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentChanging(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + remove + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanging(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } + + public event System.ComponentModel.Design.ComponentEventHandler ComponentRemoved + { + add + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentRemoved(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + remove + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoved(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } + + public event System.ComponentModel.Design.ComponentEventHandler ComponentRemoving + { + add + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentRemoving(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + remove + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } + + public event System.ComponentModel.Design.ComponentRenameEventHandler ComponentRename + { + add + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentRename(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + remove + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } + + } + + class SystemAction + { + public int CppHandle; + public System.Action Delegate; + + public SystemAction(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke() + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.SystemActionNativeInvoke(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + } + + class SystemActionSystemSingle + { + public int CppHandle; + public System.Action Delegate; + + public SystemActionSystemSingle(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke(float obj) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.SystemActionSystemSingleNativeInvoke(thisHandle, obj); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + } + + class SystemActionSystemSingle_SystemSingle + { + public int CppHandle; + public System.Action Delegate; + + public SystemActionSystemSingle_SystemSingle(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke(float arg1, float arg2) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.SystemActionSystemSingle_SystemSingleNativeInvoke(thisHandle, arg1, arg2); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + } + + class SystemFuncSystemInt32_SystemSingle_SystemDouble + { + public int CppHandle; + public System.Func Delegate; + + public SystemFuncSystemInt32_SystemSingle_SystemDouble(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public double NativeInvoke(int arg1, float arg2) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke(thisHandle, arg1, arg2); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(double); + } + + } + + class SystemFuncSystemInt16_SystemInt32_SystemString + { + public int CppHandle; + public System.Func Delegate; + + public SystemFuncSystemInt16_SystemInt32_SystemString(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public string NativeInvoke(short arg1, int arg2) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke(thisHandle, arg1, arg2); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return (string)NativeScript.Bindings.ObjectStore.Get(returnVal); + } + return default(string); + } + + } + + class SystemAppDomainInitializer + { + public int CppHandle; + public System.AppDomainInitializer Delegate; + + public SystemAppDomainInitializer(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke(string[] args) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int argsHandle = NativeScript.Bindings.ObjectStore.GetHandle(args); + NativeScript.Bindings.SystemAppDomainInitializerNativeInvoke(thisHandle, argsHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + } + + class UnityEngineEventsUnityAction + { + public int CppHandle; + public UnityEngine.Events.UnityAction Delegate; + + public UnityEngineEventsUnityAction(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke() + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.UnityEngineEventsUnityActionNativeInvoke(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + } + + class UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode + { + public int CppHandle; + public UnityEngine.Events.UnityAction Delegate; + + public UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(thisHandle, arg0, arg1); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + } + + class SystemComponentModelDesignComponentEventHandler + { + public int CppHandle; + public System.ComponentModel.Design.ComponentEventHandler Delegate; + + public SystemComponentModelDesignComponentEventHandler(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke(object sender, System.ComponentModel.Design.ComponentEventArgs e) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int senderHandle = NativeScript.Bindings.ObjectStore.GetHandle(sender); + int eHandle = NativeScript.Bindings.ObjectStore.GetHandle(e); + NativeScript.Bindings.SystemComponentModelDesignComponentEventHandlerNativeInvoke(thisHandle, senderHandle, eHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + } + + class SystemComponentModelDesignComponentChangingEventHandler + { + public int CppHandle; + public System.ComponentModel.Design.ComponentChangingEventHandler Delegate; + + public SystemComponentModelDesignComponentChangingEventHandler(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke(object sender, System.ComponentModel.Design.ComponentChangingEventArgs e) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int senderHandle = NativeScript.Bindings.ObjectStore.GetHandle(sender); + int eHandle = NativeScript.Bindings.ObjectStore.GetHandle(e); + NativeScript.Bindings.SystemComponentModelDesignComponentChangingEventHandlerNativeInvoke(thisHandle, senderHandle, eHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + } + + class SystemComponentModelDesignComponentChangedEventHandler + { + public int CppHandle; + public System.ComponentModel.Design.ComponentChangedEventHandler Delegate; + + public SystemComponentModelDesignComponentChangedEventHandler(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke(object sender, System.ComponentModel.Design.ComponentChangedEventArgs e) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int senderHandle = NativeScript.Bindings.ObjectStore.GetHandle(sender); + int eHandle = NativeScript.Bindings.ObjectStore.GetHandle(e); + NativeScript.Bindings.SystemComponentModelDesignComponentChangedEventHandlerNativeInvoke(thisHandle, senderHandle, eHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + } + + class SystemComponentModelDesignComponentRenameEventHandler + { + public int CppHandle; + public System.ComponentModel.Design.ComponentRenameEventHandler Delegate; + + public SystemComponentModelDesignComponentRenameEventHandler(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke(object sender, System.ComponentModel.Design.ComponentRenameEventArgs e) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int senderHandle = NativeScript.Bindings.ObjectStore.GetHandle(sender); + int eHandle = NativeScript.Bindings.ObjectStore.GetHandle(e); + NativeScript.Bindings.SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke(thisHandle, senderHandle, eHandle); if (NativeScript.Bindings.UnhandledCppException != null) { Exception ex = NativeScript.Bindings.UnhandledCppException; @@ -2373,46 +2991,286 @@ public void NativeInvoke() } } } - + + } + /*END BASE TYPES*/ + + /*BEGIN FUNCTIONS*/ + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchConstructorDelegate))] + static int SystemDiagnosticsStopwatchConstructor() + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Diagnostics.Stopwatch()); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate))] + static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHandle) + { + try + { + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.ElapsedMilliseconds; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(long); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(long); + } + } + + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodStartDelegate))] + static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) + { + try + { + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Start(); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodResetDelegate))] + static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) + { + try + { + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Reset(); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineObjectPropertyGetNameDelegate))] + static int UnityEngineObjectPropertyGetName(int thisHandle) + { + try + { + var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.name; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineObjectPropertySetNameDelegate))] + static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) + { + try + { + var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.name = value; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObjectDelegate))] + static bool UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject(int xHandle, int yHandle) + { + try + { + var x = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(xHandle); + var y = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(yHandle); + var returnValue = x == y; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineObjectMethodop_ImplicitUnityEngineObjectDelegate))] + static bool UnityEngineObjectMethodop_ImplicitUnityEngineObject(int existsHandle) + { + try + { + var exists = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(existsHandle); + var returnValue = exists; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorDelegate))] + static int UnityEngineGameObjectConstructor() + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject()); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorSystemStringDelegate))] + static int UnityEngineGameObjectConstructorSystemString(int nameHandle) + { + try + { + var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject(name)); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGameObjectPropertyGetTransformDelegate))] + static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) + { + try + { + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } } - class UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate))] + static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(int thisHandle) { - public int CppHandle; - public UnityEngine.Events.UnityAction Delegate; - - public UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int cppHandle) + try { - CppHandle = cppHandle; - Delegate = NativeInvoke; + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.AddComponent(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } - - public void NativeInvoke(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1) + catch (System.NullReferenceException ex) { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - NativeScript.Bindings.UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(thisHandle, arg0, arg1); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } - } - /*END BASE TYPES*/ - /*BEGIN FUNCTIONS*/ - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchConstructorDelegate))] - static int SystemDiagnosticsStopwatchConstructor() + [MonoPInvokeCallback(typeof(UnityEngineComponentPropertyGetTransformDelegate))] + static int UnityEngineComponentPropertyGetTransform(int thisHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Diagnostics.Stopwatch()); - return returnValue; + var thiz = (UnityEngine.Component)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -2428,36 +3286,36 @@ static int SystemDiagnosticsStopwatchConstructor() } } - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate))] - static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineTransformPropertyGetPositionDelegate))] + static UnityEngine.Vector3 UnityEngineTransformPropertyGetPosition(int thisHandle) { try { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.ElapsedMilliseconds; + var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.position; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(long); + return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(long); + return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodStartDelegate))] - static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineTransformPropertySetPositionDelegate))] + static void UnityEngineTransformPropertySetPosition(int thisHandle, ref UnityEngine.Vector3 value) { try { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Start(); + var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.position = value; } catch (System.NullReferenceException ex) { @@ -2471,57 +3329,219 @@ static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) } } - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodResetDelegate))] - static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineDebugMethodLogSystemObjectDelegate))] + static void UnityEngineDebugMethodLogSystemObject(int messageHandle) { try { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Reset(); + var message = NativeScript.Bindings.ObjectStore.Get(messageHandle); + UnityEngine.Debug.Log(message); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldGetRaiseExceptionsDelegate))] + static bool UnityEngineAssertionsAssertFieldGetRaiseExceptions() + { + try + { + var returnValue = UnityEngine.Assertions.Assert.raiseExceptions; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldSetRaiseExceptionsDelegate))] + static void UnityEngineAssertionsAssertFieldSetRaiseExceptions(bool value) + { + try + { + UnityEngine.Assertions.Assert.raiseExceptions = value; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemStringDelegate))] + static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(int expectedHandle, int actualHandle) + { + try + { + var expected = (string)NativeScript.Bindings.ObjectStore.Get(expectedHandle); + var actual = (string)NativeScript.Bindings.ObjectStore.Get(actualHandle); + UnityEngine.Assertions.Assert.AreEqual(expected, actual); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObjectDelegate))] + static void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(int expectedHandle, int actualHandle) + { + try + { + var expected = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(expectedHandle); + var actual = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(actualHandle); + UnityEngine.Assertions.Assert.AreEqual(expected, actual); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate))] + static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(ref int bufferLength, ref int numBuffers) + { + try + { + UnityEngine.AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate))] + static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(int hostId, ref int addressHandle, ref int port, ref byte error) + { + try + { + var address = (string)NativeScript.Bindings.ObjectStore.Get(addressHandle); + UnityEngine.Networking.NetworkTransport.GetBroadcastConnectionInfo(hostId, out address, out port, out error); + int addressHandleNew = NativeScript.Bindings.ObjectStore.GetHandle(address); + addressHandle = addressHandleNew; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodInitDelegate))] + static void UnityEngineNetworkingNetworkTransportMethodInit() + { + try + { + UnityEngine.Networking.NetworkTransport.Init(); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate))] + static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(float x, float y, float z) + { + try + { + var returnValue = new UnityEngine.Vector3(x, y, z); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(UnityEngineObjectPropertyGetNameDelegate))] - static int UnityEngineObjectPropertyGetName(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineVector3PropertyGetMagnitudeDelegate))] + static float UnityEngineVector3PropertyGetMagnitude(ref UnityEngine.Vector3 thiz) { try { - var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.name; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = thiz.magnitude; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } } - [MonoPInvokeCallback(typeof(UnityEngineObjectPropertySetNameDelegate))] - static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingleDelegate))] + static void UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(ref UnityEngine.Vector3 thiz, float newX, float newY, float newZ) { try { - var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.name = value; + thiz.Set(newX, newY, newZ); } catch (System.NullReferenceException ex) { @@ -2535,59 +3555,56 @@ static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObjectDelegate))] - static bool UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject(int xHandle, int yHandle) + [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate))] + static UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 a, ref UnityEngine.Vector3 b) { try { - var x = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(xHandle); - var y = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(yHandle); - var returnValue = x == y; + var returnValue = a + b; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); + return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); + return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(UnityEngineObjectMethodop_ImplicitUnityEngineObjectDelegate))] - static bool UnityEngineObjectMethodop_ImplicitUnityEngineObject(int existsHandle) + [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3Delegate))] + static UnityEngine.Vector3 UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3(ref UnityEngine.Vector3 a) { try { - var exists = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(existsHandle); - var returnValue = exists; + var returnValue = -a; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); + return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); + return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorDelegate))] - static int UnityEngineGameObjectConstructor() + [MonoPInvokeCallback(typeof(BoxVector3Delegate))] + static int BoxVector3(ref UnityEngine.Vector3 val) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject()); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } catch (System.NullReferenceException ex) @@ -2604,83 +3621,77 @@ static int UnityEngineGameObjectConstructor() } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorSystemStringDelegate))] - static int UnityEngineGameObjectConstructorSystemString(int nameHandle) + [MonoPInvokeCallback(typeof(UnboxVector3Delegate))] + static UnityEngine.Vector3 UnboxVector3(int valHandle) { try { - var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject(name)); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Vector3)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectPropertyGetTransformDelegate))] - static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertyGetItemDelegate))] + static float UnityEngineMatrix4x4PropertyGetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column) { try { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = thiz[row, row]; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate))] - static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertySetItemDelegate))] + static void UnityEngineMatrix4x4PropertySetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column, float value) { try { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.AddComponent(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + thiz[row, column] = column; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineComponentPropertyGetTransformDelegate))] - static int UnityEngineComponentPropertyGetTransform(int thisHandle) + [MonoPInvokeCallback(typeof(BoxMatrix4x4Delegate))] + static int BoxMatrix4x4(ref UnityEngine.Matrix4x4 val) { try { - var thiz = (UnityEngine.Component)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -2696,36 +3707,38 @@ static int UnityEngineComponentPropertyGetTransform(int thisHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineTransformPropertyGetPositionDelegate))] - static UnityEngine.Vector3 UnityEngineTransformPropertyGetPosition(int thisHandle) + [MonoPInvokeCallback(typeof(UnboxMatrix4x4Delegate))] + static UnityEngine.Matrix4x4 UnboxMatrix4x4(int valHandle) { try { - var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.position; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Matrix4x4)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(UnityEngine.Matrix4x4); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(UnityEngine.Matrix4x4); } } - [MonoPInvokeCallback(typeof(UnityEngineTransformPropertySetPositionDelegate))] - static void UnityEngineTransformPropertySetPosition(int thisHandle, ref UnityEngine.Vector3 value) + [MonoPInvokeCallback(typeof(ReleaseUnityEngineRaycastHitDelegate))] + static void ReleaseUnityEngineRaycastHit(int handle) { try { - var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.position = value; + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } } catch (System.NullReferenceException ex) { @@ -2739,156 +3752,173 @@ static void UnityEngineTransformPropertySetPosition(int thisHandle, ref UnityEng } } - [MonoPInvokeCallback(typeof(UnityEngineDebugMethodLogSystemObjectDelegate))] - static void UnityEngineDebugMethodLogSystemObject(int messageHandle) + [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertyGetPointDelegate))] + static UnityEngine.Vector3 UnityEngineRaycastHitPropertyGetPoint(int thisHandle) { try { - var message = NativeScript.Bindings.ObjectStore.Get(messageHandle); - UnityEngine.Debug.Log(message); + var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); + var returnValue = thiz.point; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldGetRaiseExceptionsDelegate))] - static bool UnityEngineAssertionsAssertFieldGetRaiseExceptions() + [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertySetPointDelegate))] + static void UnityEngineRaycastHitPropertySetPoint(int thisHandle, ref UnityEngine.Vector3 value) { try { - var returnValue = UnityEngine.Assertions.Assert.raiseExceptions; - return returnValue; + var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); + thiz.point = value; + NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); } } - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldSetRaiseExceptionsDelegate))] - static void UnityEngineAssertionsAssertFieldSetRaiseExceptions(bool value) + [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertyGetTransformDelegate))] + static int UnityEngineRaycastHitPropertyGetTransform(int thisHandle) { try { - UnityEngine.Assertions.Assert.raiseExceptions = value; + var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemStringDelegate))] - static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(int expectedHandle, int actualHandle) + [MonoPInvokeCallback(typeof(BoxRaycastHitDelegate))] + static int BoxRaycastHit(int valHandle) { try { - var expected = (string)NativeScript.Bindings.ObjectStore.Get(expectedHandle); - var actual = (string)NativeScript.Bindings.ObjectStore.Get(actualHandle); - UnityEngine.Assertions.Assert.AreEqual(expected, actual); + var val = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObjectDelegate))] - static void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(int expectedHandle, int actualHandle) + [MonoPInvokeCallback(typeof(UnboxRaycastHitDelegate))] + static int UnboxRaycastHit(int valHandle) { try { - var expected = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(expectedHandle); - var actual = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(actualHandle); - UnityEngine.Assertions.Assert.AreEqual(expected, actual); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.RaycastHit)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate))] - static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(ref int bufferLength, ref int numBuffers) + [MonoPInvokeCallback(typeof(BoxQueryTriggerInteractionDelegate))] + static int BoxQueryTriggerInteraction(UnityEngine.QueryTriggerInteraction val) { try { - UnityEngine.AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate))] - static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(int hostId, ref int addressHandle, ref int port, ref byte error) + [MonoPInvokeCallback(typeof(UnboxQueryTriggerInteractionDelegate))] + static UnityEngine.QueryTriggerInteraction UnboxQueryTriggerInteraction(int valHandle) { try { - var address = (string)NativeScript.Bindings.ObjectStore.Get(addressHandle); - UnityEngine.Networking.NetworkTransport.GetBroadcastConnectionInfo(hostId, out address, out port, out error); - int addressHandleNew = NativeScript.Bindings.ObjectStore.GetHandle(address); - addressHandle = addressHandleNew; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.QueryTriggerInteraction)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.QueryTriggerInteraction); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.QueryTriggerInteraction); } } - [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodInitDelegate))] - static void UnityEngineNetworkingNetworkTransportMethodInit() + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate))] + static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int handle) { try { - UnityEngine.Networking.NetworkTransport.Init(); + if (handle != 0) + { + NativeScript.Bindings.StructStore>.Remove(handle); + } } catch (System.NullReferenceException ex) { @@ -2902,119 +3932,127 @@ static void UnityEngineNetworkingNetworkTransportMethodInit() } } - [MonoPInvokeCallback(typeof(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate))] - static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(float x, float y, float z) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate))] + static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(int keyHandle, double value) { try { - var returnValue = new UnityEngine.Vector3(x, y, z); + var key = (string)NativeScript.Bindings.ObjectStore.Get(keyHandle); + var returnValue = NativeScript.Bindings.StructStore>.Store(new System.Collections.Generic.KeyValuePair(key, value)); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineVector3PropertyGetMagnitudeDelegate))] - static float UnityEngineVector3PropertyGetMagnitude(ref UnityEngine.Vector3 thiz) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate))] + static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(int thisHandle) { try { - var returnValue = thiz.magnitude; - return returnValue; + var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); + var returnValue = thiz.Key; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingleDelegate))] - static void UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(ref UnityEngine.Vector3 thiz, float newX, float newY, float newZ) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate))] + static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(int thisHandle) { try { - thiz.Set(newX, newY, newZ); + var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); + var returnValue = thiz.Value; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(double); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(double); } } - [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate))] - static UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 a, ref UnityEngine.Vector3 b) + [MonoPInvokeCallback(typeof(BoxKeyValuePairSystemString_SystemDoubleDelegate))] + static int BoxKeyValuePairSystemString_SystemDouble(int valHandle) { try { - var returnValue = a + b; + var val = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3Delegate))] - static UnityEngine.Vector3 UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3(ref UnityEngine.Vector3 a) + [MonoPInvokeCallback(typeof(UnboxKeyValuePairSystemString_SystemDoubleDelegate))] + static int UnboxKeyValuePairSystemString_SystemDouble(int valHandle) { try { - var returnValue = -a; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore>.Store((System.Collections.Generic.KeyValuePair)val); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxVector3Delegate))] - static int BoxVector3(ref UnityEngine.Vector3 val) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringConstructorDelegate))] + static int SystemCollectionsGenericListSystemStringConstructor() { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); return returnValue; } catch (System.NullReferenceException ex) @@ -3031,57 +4069,58 @@ static int BoxVector3(ref UnityEngine.Vector3 val) } } - [MonoPInvokeCallback(typeof(UnboxVector3Delegate))] - static UnityEngine.Vector3 UnboxVector3(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertyGetItemDelegate))] + static int SystemCollectionsGenericListSystemStringPropertyGetItem(int thisHandle, int index) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Vector3)val; - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index]; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertyGetItemDelegate))] - static float UnityEngineMatrix4x4PropertyGetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertySetItemDelegate))] + static void SystemCollectionsGenericListSystemStringPropertySetItem(int thisHandle, int index, int valueHandle) { try { - var returnValue = thiz[row, row]; - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz[index] = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); } } - [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertySetItemDelegate))] - static void UnityEngineMatrix4x4PropertySetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column, float value) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate))] + static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int thisHandle, int itemHandle) { try { - thiz[row, column] = column; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); + thiz.Add(item); } catch (System.NullReferenceException ex) { @@ -3095,104 +4134,99 @@ static void UnityEngineMatrix4x4PropertySetItem(ref UnityEngine.Matrix4x4 thiz, } } - [MonoPInvokeCallback(typeof(BoxMatrix4x4Delegate))] - static int BoxMatrix4x4(ref UnityEngine.Matrix4x4 val) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate))] + static void SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); + thiz.Sort(comparer); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxMatrix4x4Delegate))] - static UnityEngine.Matrix4x4 UnboxMatrix4x4(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32ConstructorDelegate))] + static int SystemCollectionsGenericListSystemInt32Constructor() { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Matrix4x4)val; + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Matrix4x4); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Matrix4x4); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseUnityEngineRaycastHitDelegate))] - static void ReleaseUnityEngineRaycastHit(int handle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate))] + static int SystemCollectionsGenericListSystemInt32PropertyGetItem(int thisHandle, int index) { try { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index]; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertyGetPointDelegate))] - static UnityEngine.Vector3 UnityEngineRaycastHitPropertyGetPoint(int thisHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertySetItemDelegate))] + static void SystemCollectionsGenericListSystemInt32PropertySetItem(int thisHandle, int index, int value) { try { - var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.point; - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz[index] = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertySetPointDelegate))] - static void UnityEngineRaycastHitPropertySetPoint(int thisHandle, ref UnityEngine.Vector3 value) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate))] + static void SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(int thisHandle, int item) { try { - var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); - thiz.point = value; - NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Add(item); } catch (System.NullReferenceException ex) { @@ -3206,36 +4240,34 @@ static void UnityEngineRaycastHitPropertySetPoint(int thisHandle, ref UnityEngin } } - [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertyGetTransformDelegate))] - static int UnityEngineRaycastHitPropertyGetTransform(int thisHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate))] + static void SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) { try { - var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); + thiz.Sort(comparer); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(BoxRaycastHitDelegate))] - static int BoxRaycastHit(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate))] + static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(int valueHandle) { try { - var val = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.LinkedListNode(value)); return returnValue; } catch (System.NullReferenceException ex) @@ -3252,14 +4284,14 @@ static int BoxRaycastHit(int valHandle) } } - [MonoPInvokeCallback(typeof(UnboxRaycastHitDelegate))] - static int UnboxRaycastHit(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate))] + static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(int thisHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.RaycastHit)val); - return returnValue; + var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Value; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -3275,104 +4307,102 @@ static int UnboxRaycastHit(int valHandle) } } - [MonoPInvokeCallback(typeof(BoxQueryTriggerInteractionDelegate))] - static int BoxQueryTriggerInteraction(UnityEngine.QueryTriggerInteraction val) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate))] + static void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(int thisHandle, int valueHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.Value = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxQueryTriggerInteractionDelegate))] - static UnityEngine.QueryTriggerInteraction UnboxQueryTriggerInteraction(int valHandle) + [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate))] + static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(int valueHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.QueryTriggerInteraction)val; + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Runtime.CompilerServices.StrongBox(value)); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.QueryTriggerInteraction); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.QueryTriggerInteraction); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate))] - static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int handle) + [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate))] + static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int thisHandle) { try { - if (handle != 0) - { - NativeScript.Bindings.StructStore>.Remove(handle); - } + var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Value; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate))] - static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(int keyHandle, double value) + [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate))] + static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int thisHandle, int valueHandle) { try { - var key = (string)NativeScript.Bindings.ObjectStore.Get(keyHandle); - var returnValue = NativeScript.Bindings.StructStore>.Store(new System.Collections.Generic.KeyValuePair(key, value)); - return returnValue; + var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.Value = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate))] - static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(int thisHandle) + [MonoPInvokeCallback(typeof(SystemExceptionConstructorSystemStringDelegate))] + static int SystemExceptionConstructorSystemString(int messageHandle) { try { - var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); - var returnValue = thiz.Key; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var message = (string)NativeScript.Bindings.ObjectStore.Get(messageHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Exception(message)); + return returnValue; } catch (System.NullReferenceException ex) { @@ -3388,59 +4418,53 @@ static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleProperty } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate))] - static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetWidthDelegate))] + static int UnityEngineResolutionPropertyGetWidth(ref UnityEngine.Resolution thiz) { try { - var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); - var returnValue = thiz.Value; + var returnValue = thiz.width; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxKeyValuePairSystemString_SystemDoubleDelegate))] - static int BoxKeyValuePairSystemString_SystemDouble(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetWidthDelegate))] + static void UnityEngineResolutionPropertySetWidth(ref UnityEngine.Resolution thiz, int value) { try { - var val = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + thiz.width = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxKeyValuePairSystemString_SystemDoubleDelegate))] - static int UnboxKeyValuePairSystemString_SystemDouble(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetHeightDelegate))] + static int UnityEngineResolutionPropertyGetHeight(ref UnityEngine.Resolution thiz) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore>.Store((System.Collections.Generic.KeyValuePair)val); + var returnValue = thiz.height; return returnValue; } catch (System.NullReferenceException ex) @@ -3457,36 +4481,32 @@ static int UnboxKeyValuePairSystemString_SystemDouble(int valHandle) } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringConstructorDelegate))] - static int SystemCollectionsGenericListSystemStringConstructor() + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetHeightDelegate))] + static void UnityEngineResolutionPropertySetHeight(ref UnityEngine.Resolution thiz, int value) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); - return returnValue; + thiz.height = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertyGetItemDelegate))] - static int SystemCollectionsGenericListSystemStringPropertyGetItem(int thisHandle, int index) + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetRefreshRateDelegate))] + static int UnityEngineResolutionPropertyGetRefreshRate(ref UnityEngine.Resolution thiz) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index]; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = thiz.refreshRate; + return returnValue; } catch (System.NullReferenceException ex) { @@ -3502,14 +4522,12 @@ static int SystemCollectionsGenericListSystemStringPropertyGetItem(int thisHandl } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertySetItemDelegate))] - static void SystemCollectionsGenericListSystemStringPropertySetItem(int thisHandle, int index, int valueHandle) + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetRefreshRateDelegate))] + static void UnityEngineResolutionPropertySetRefreshRate(ref UnityEngine.Resolution thiz, int value) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz[index] = value; + thiz.refreshRate = value; } catch (System.NullReferenceException ex) { @@ -3523,55 +4541,58 @@ static void SystemCollectionsGenericListSystemStringPropertySetItem(int thisHand } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate))] - static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int thisHandle, int itemHandle) + [MonoPInvokeCallback(typeof(BoxResolutionDelegate))] + static int BoxResolution(ref UnityEngine.Resolution val) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); - thiz.Add(item); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate))] - static void SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) + + [MonoPInvokeCallback(typeof(UnboxResolutionDelegate))] + static UnityEngine.Resolution UnboxResolution(int valHandle) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); - thiz.Sort(comparer); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Resolution)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Resolution); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Resolution); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32ConstructorDelegate))] - static int SystemCollectionsGenericListSystemInt32Constructor() + [MonoPInvokeCallback(typeof(UnityEngineScreenPropertyGetResolutionsDelegate))] + static int UnityEngineScreenPropertyGetResolutions() { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); - return returnValue; + var returnValue = UnityEngine.Screen.resolutions; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -3587,98 +4608,103 @@ static int SystemCollectionsGenericListSystemInt32Constructor() } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate))] - static int SystemCollectionsGenericListSystemInt32PropertyGetItem(int thisHandle, int index) + [MonoPInvokeCallback(typeof(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate))] + static UnityEngine.Ray UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index]; + var returnValue = new UnityEngine.Ray(origin, direction); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Ray); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Ray); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertySetItemDelegate))] - static void SystemCollectionsGenericListSystemInt32PropertySetItem(int thisHandle, int index, int value) + [MonoPInvokeCallback(typeof(BoxRayDelegate))] + static int BoxRay(ref UnityEngine.Ray val) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz[index] = value; + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate))] - static void SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(int thisHandle, int item) + [MonoPInvokeCallback(typeof(UnboxRayDelegate))] + static UnityEngine.Ray UnboxRay(int valHandle) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Add(item); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Ray)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Ray); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Ray); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate))] - static void SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) + [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitDelegate))] + static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit(ref UnityEngine.Ray ray, int resultsHandle) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); - thiz.Sort(comparer); + var results = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(resultsHandle); + var returnValue = UnityEngine.Physics.RaycastNonAlloc(ray, results); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate))] - static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(int valueHandle) + [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate))] + static int UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ref UnityEngine.Ray ray) { try { - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.LinkedListNode(value)); - return returnValue; + var returnValue = UnityEngine.Physics.RaycastAll(ray); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -3694,14 +4720,13 @@ static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemSt } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate))] - static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(int thisHandle) + [MonoPInvokeCallback(typeof(BoxColorDelegate))] + static int BoxColor(ref UnityEngine.Color val) { try { - var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Value; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -3717,34 +4742,35 @@ static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(in } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate))] - static void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(UnboxColorDelegate))] + static UnityEngine.Color UnboxColor(int valHandle) { try { - var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.Value = value; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Color)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Color); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Color); } } - [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate))] - static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(int valueHandle) + [MonoPInvokeCallback(typeof(BoxGradientColorKeyDelegate))] + static int BoxGradientColorKey(ref UnityEngine.GradientColorKey val) { try { - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Runtime.CompilerServices.StrongBox(value)); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } catch (System.NullReferenceException ex) @@ -3761,58 +4787,59 @@ static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemSt } } - [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate))] - static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int thisHandle) + [MonoPInvokeCallback(typeof(UnboxGradientColorKeyDelegate))] + static UnityEngine.GradientColorKey UnboxGradientColorKey(int valHandle) { try { - var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Value; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.GradientColorKey)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.GradientColorKey); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.GradientColorKey); } } - [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate))] - static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(UnityEngineGradientConstructorDelegate))] + static int UnityEngineGradientConstructor() { try { - var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.Value = value; + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.Gradient()); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemExceptionConstructorSystemStringDelegate))] - static int SystemExceptionConstructorSystemString(int messageHandle) + [MonoPInvokeCallback(typeof(UnityEngineGradientPropertyGetColorKeysDelegate))] + static int UnityEngineGradientPropertyGetColorKeys(int thisHandle) { try { - var message = (string)NativeScript.Bindings.ObjectStore.Get(messageHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Exception(message)); - return returnValue; + var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.colorKeys; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -3828,54 +4855,57 @@ static int SystemExceptionConstructorSystemString(int messageHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetWidthDelegate))] - static int UnityEngineResolutionPropertyGetWidth(ref UnityEngine.Resolution thiz) + [MonoPInvokeCallback(typeof(UnityEngineGradientPropertySetColorKeysDelegate))] + static void UnityEngineGradientPropertySetColorKeys(int thisHandle, int valueHandle) { try { - var returnValue = thiz.width; - return returnValue; + var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.colorKeys = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetWidthDelegate))] - static void UnityEngineResolutionPropertySetWidth(ref UnityEngine.Resolution thiz, int value) + [MonoPInvokeCallback(typeof(SystemAppDomainSetupConstructorDelegate))] + static int SystemAppDomainSetupConstructor() { try { - thiz.width = value; + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.AppDomainSetup()); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetHeightDelegate))] - static int UnityEngineResolutionPropertyGetHeight(ref UnityEngine.Resolution thiz) + [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertyGetAppDomainInitializerDelegate))] + static int SystemAppDomainSetupPropertyGetAppDomainInitializer(int thisHandle) { try { - var returnValue = thiz.height; - return returnValue; + var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.AppDomainInitializer; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -3891,12 +4921,14 @@ static int UnityEngineResolutionPropertyGetHeight(ref UnityEngine.Resolution thi } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetHeightDelegate))] - static void UnityEngineResolutionPropertySetHeight(ref UnityEngine.Resolution thiz, int value) + [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertySetAppDomainInitializerDelegate))] + static void SystemAppDomainSetupPropertySetAppDomainInitializer(int thisHandle, int valueHandle) { try { - thiz.height = value; + var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.AppDomainInitializer = value; } catch (System.NullReferenceException ex) { @@ -3910,34 +4942,33 @@ static void UnityEngineResolutionPropertySetHeight(ref UnityEngine.Resolution th } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetRefreshRateDelegate))] - static int UnityEngineResolutionPropertyGetRefreshRate(ref UnityEngine.Resolution thiz) + [MonoPInvokeCallback(typeof(UnityEngineApplicationAddEventOnBeforeRenderDelegate))] + static void UnityEngineApplicationAddEventOnBeforeRender(int delHandle) { try { - var returnValue = thiz.refreshRate; - return returnValue; + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.Application.onBeforeRender += del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetRefreshRateDelegate))] - static void UnityEngineResolutionPropertySetRefreshRate(ref UnityEngine.Resolution thiz, int value) + [MonoPInvokeCallback(typeof(UnityEngineApplicationRemoveEventOnBeforeRenderDelegate))] + static void UnityEngineApplicationRemoveEventOnBeforeRender(int delHandle) { try { - thiz.refreshRate = value; + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.Application.onBeforeRender += del; } catch (System.NullReferenceException ex) { @@ -3951,58 +4982,53 @@ static void UnityEngineResolutionPropertySetRefreshRate(ref UnityEngine.Resoluti } } - [MonoPInvokeCallback(typeof(BoxResolutionDelegate))] - static int BoxResolution(ref UnityEngine.Resolution val) + [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate))] + static void UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(int delHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxResolutionDelegate))] - static UnityEngine.Resolution UnboxResolution(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate))] + static void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(int delHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Resolution)val; - return returnValue; + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Resolution); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Resolution); } } - [MonoPInvokeCallback(typeof(UnityEngineScreenPropertyGetResolutionsDelegate))] - static int UnityEngineScreenPropertyGetResolutions() + [MonoPInvokeCallback(typeof(BoxSceneDelegate))] + static int BoxScene(ref UnityEngine.SceneManagement.Scene val) { try { - var returnValue = UnityEngine.Screen.resolutions; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -4018,30 +5044,31 @@ static int UnityEngineScreenPropertyGetResolutions() } } - [MonoPInvokeCallback(typeof(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate))] - static UnityEngine.Ray UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction) + [MonoPInvokeCallback(typeof(UnboxSceneDelegate))] + static UnityEngine.SceneManagement.Scene UnboxScene(int valHandle) { try { - var returnValue = new UnityEngine.Ray(origin, direction); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.SceneManagement.Scene)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Ray); + return default(UnityEngine.SceneManagement.Scene); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Ray); + return default(UnityEngine.SceneManagement.Scene); } } - [MonoPInvokeCallback(typeof(BoxRayDelegate))] - static int BoxRay(ref UnityEngine.Ray val) + [MonoPInvokeCallback(typeof(BoxLoadSceneModeDelegate))] + static int BoxLoadSceneMode(UnityEngine.SceneManagement.LoadSceneMode val) { try { @@ -4062,37 +5089,37 @@ static int BoxRay(ref UnityEngine.Ray val) } } - [MonoPInvokeCallback(typeof(UnboxRayDelegate))] - static UnityEngine.Ray UnboxRay(int valHandle) + [MonoPInvokeCallback(typeof(UnboxLoadSceneModeDelegate))] + static UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneMode(int valHandle) { try { var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Ray)val; + var returnValue = (UnityEngine.SceneManagement.LoadSceneMode)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Ray); + return default(UnityEngine.SceneManagement.LoadSceneMode); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Ray); + return default(UnityEngine.SceneManagement.LoadSceneMode); } } - [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitDelegate))] - static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit(ref UnityEngine.Ray ray, int resultsHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorPropertyGetCurrentDelegate))] + static int SystemCollectionsIEnumeratorPropertyGetCurrent(int thisHandle) { try { - var results = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(resultsHandle); - var returnValue = UnityEngine.Physics.RaycastNonAlloc(ray, results); - return returnValue; + var thiz = (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -4108,171 +5135,153 @@ static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRayc } } - [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate))] - static int UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ref UnityEngine.Ray ray) + [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorMethodMoveNextDelegate))] + static bool SystemCollectionsIEnumeratorMethodMoveNext(int thisHandle) { try { - var returnValue = UnityEngine.Physics.RaycastAll(ray); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.MoveNext(); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(bool); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(bool); } } - [MonoPInvokeCallback(typeof(BoxColorDelegate))] - static int BoxColor(ref UnityEngine.Color val) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate))] + static void SystemCollectionsGenericIComparerSystemInt32Constructor(int cppHandle, ref int handle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = new SystemCollectionsGenericIComparerSystemInt32(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxColorDelegate))] - static UnityEngine.Color UnboxColor(int valHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericIComparerSystemInt32Delegate))] + static void ReleaseSystemCollectionsGenericIComparerSystemInt32(int handle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Color)val; - return returnValue; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Color); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Color); } } - [MonoPInvokeCallback(typeof(BoxGradientColorKeyDelegate))] - static int BoxGradientColorKey(ref UnityEngine.GradientColorKey val) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIComparerSystemStringConstructorDelegate))] + static void SystemCollectionsGenericIComparerSystemStringConstructor(int cppHandle, ref int handle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = new SystemCollectionsGenericIComparerSystemString(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxGradientColorKeyDelegate))] - static UnityEngine.GradientColorKey UnboxGradientColorKey(int valHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericIComparerSystemStringDelegate))] + static void ReleaseSystemCollectionsGenericIComparerSystemString(int handle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.GradientColorKey)val; - return returnValue; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); } } - [MonoPInvokeCallback(typeof(UnityEngineGradientConstructorDelegate))] - static int UnityEngineGradientConstructor() + [MonoPInvokeCallback(typeof(SystemStringComparerConstructorDelegate))] + static void SystemStringComparerConstructor(int cppHandle, ref int handle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.Gradient()); - return returnValue; + var thiz = new SystemStringComparer(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineGradientPropertyGetColorKeysDelegate))] - static int UnityEngineGradientPropertyGetColorKeys(int thisHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemStringComparerDelegate))] + static void ReleaseSystemStringComparer(int handle) { try { - var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.colorKeys; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineGradientPropertySetColorKeysDelegate))] - static void UnityEngineGradientPropertySetColorKeys(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsICollectionConstructorDelegate))] + static void SystemCollectionsICollectionConstructor(int cppHandle, ref int handle) { try { - var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.colorKeys = value; + var thiz = new SystemCollectionsICollection(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { @@ -4286,59 +5295,51 @@ static void UnityEngineGradientPropertySetColorKeys(int thisHandle, int valueHan } } - [MonoPInvokeCallback(typeof(SystemAppDomainSetupConstructorDelegate))] - static int SystemAppDomainSetupConstructor() + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsICollectionDelegate))] + static void ReleaseSystemCollectionsICollection(int handle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.AppDomainSetup()); - return returnValue; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertyGetAppDomainInitializerDelegate))] - static int SystemAppDomainSetupPropertyGetAppDomainInitializer(int thisHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsIListConstructorDelegate))] + static void SystemCollectionsIListConstructor(int cppHandle, ref int handle) { try { - var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.AppDomainInitializer; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = new SystemCollectionsIList(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertySetAppDomainInitializerDelegate))] - static void SystemAppDomainSetupPropertySetAppDomainInitializer(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsIListDelegate))] + static void ReleaseSystemCollectionsIList(int handle) { try { - var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.AppDomainInitializer = value; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -4352,13 +5353,13 @@ static void SystemAppDomainSetupPropertySetAppDomainInitializer(int thisHandle, } } - [MonoPInvokeCallback(typeof(UnityEngineApplicationAddEventOnBeforeRenderDelegate))] - static void UnityEngineApplicationAddEventOnBeforeRender(int delHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsQueueConstructorDelegate))] + static void SystemCollectionsQueueConstructor(int cppHandle, ref int handle) { try { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.Application.onBeforeRender += del; + var thiz = new SystemCollectionsQueue(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { @@ -4372,13 +5373,12 @@ static void UnityEngineApplicationAddEventOnBeforeRender(int delHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineApplicationRemoveEventOnBeforeRenderDelegate))] - static void UnityEngineApplicationRemoveEventOnBeforeRender(int delHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsQueueDelegate))] + static void ReleaseSystemCollectionsQueue(int handle) { try { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.Application.onBeforeRender += del; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -4392,13 +5392,13 @@ static void UnityEngineApplicationRemoveEventOnBeforeRender(int delHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate))] - static void UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(int delHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignIComponentChangeServiceConstructorDelegate))] + static void SystemComponentModelDesignIComponentChangeServiceConstructor(int cppHandle, ref int handle) { try { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; + var thiz = new SystemComponentModelDesignIComponentChangeService(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { @@ -4412,13 +5412,12 @@ static void UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(int delHan } } - [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate))] - static void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(int delHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemComponentModelDesignIComponentChangeServiceDelegate))] + static void ReleaseSystemComponentModelDesignIComponentChangeService(int handle) { try { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -4432,8 +5431,8 @@ static void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(int del } } - [MonoPInvokeCallback(typeof(BoxSceneDelegate))] - static int BoxScene(ref UnityEngine.SceneManagement.Scene val) + [MonoPInvokeCallback(typeof(BoxBooleanDelegate))] + static int BoxBoolean(bool val) { try { @@ -4454,31 +5453,31 @@ static int BoxScene(ref UnityEngine.SceneManagement.Scene val) } } - [MonoPInvokeCallback(typeof(UnboxSceneDelegate))] - static UnityEngine.SceneManagement.Scene UnboxScene(int valHandle) + [MonoPInvokeCallback(typeof(UnboxBooleanDelegate))] + static bool UnboxBoolean(int valHandle) { try { var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.SceneManagement.Scene)val; + var returnValue = (bool)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.SceneManagement.Scene); + return default(bool); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.SceneManagement.Scene); + return default(bool); } } - [MonoPInvokeCallback(typeof(BoxLoadSceneModeDelegate))] - static int BoxLoadSceneMode(UnityEngine.SceneManagement.LoadSceneMode val) + [MonoPInvokeCallback(typeof(BoxSByteDelegate))] + static int BoxSByte(sbyte val) { try { @@ -4499,37 +5498,36 @@ static int BoxLoadSceneMode(UnityEngine.SceneManagement.LoadSceneMode val) } } - [MonoPInvokeCallback(typeof(UnboxLoadSceneModeDelegate))] - static UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneMode(int valHandle) + [MonoPInvokeCallback(typeof(UnboxSByteDelegate))] + static sbyte UnboxSByte(int valHandle) { try { var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.SceneManagement.LoadSceneMode)val; + var returnValue = (sbyte)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.SceneManagement.LoadSceneMode); + return default(sbyte); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.SceneManagement.LoadSceneMode); + return default(sbyte); } } - [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorPropertyGetCurrentDelegate))] - static int SystemCollectionsIEnumeratorPropertyGetCurrent(int thisHandle) + [MonoPInvokeCallback(typeof(BoxByteDelegate))] + static int BoxByte(byte val) { try { - var thiz = (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -4545,304 +5543,346 @@ static int SystemCollectionsIEnumeratorPropertyGetCurrent(int thisHandle) } } - [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorMethodMoveNextDelegate))] - static bool SystemCollectionsIEnumeratorMethodMoveNext(int thisHandle) + [MonoPInvokeCallback(typeof(UnboxByteDelegate))] + static byte UnboxByte(int valHandle) { try { - var thiz = (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.MoveNext(); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (byte)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); + return default(byte); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); + return default(byte); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate))] - static void SystemCollectionsGenericIComparerSystemInt32Constructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(BoxInt16Delegate))] + static int BoxInt16(short val) { try { - var thiz = new SystemCollectionsGenericIComparerSystemInt32(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericIComparerSystemInt32Delegate))] - static void ReleaseSystemCollectionsGenericIComparerSystemInt32(int handle) + [MonoPInvokeCallback(typeof(UnboxInt16Delegate))] + static short UnboxInt16(int valHandle) { try { - NativeScript.Bindings.ObjectStore.Remove(handle); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (short)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(short); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(short); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIComparerSystemStringConstructorDelegate))] - static void SystemCollectionsGenericIComparerSystemStringConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(BoxUInt16Delegate))] + static int BoxUInt16(ushort val) { try { - var thiz = new SystemCollectionsGenericIComparerSystemString(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericIComparerSystemStringDelegate))] - static void ReleaseSystemCollectionsGenericIComparerSystemString(int handle) + [MonoPInvokeCallback(typeof(UnboxUInt16Delegate))] + static ushort UnboxUInt16(int valHandle) { try { - NativeScript.Bindings.ObjectStore.Remove(handle); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (ushort)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(ushort); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(ushort); } } - [MonoPInvokeCallback(typeof(SystemStringComparerConstructorDelegate))] - static void SystemStringComparerConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(BoxInt32Delegate))] + static int BoxInt32(int val) { try { - var thiz = new SystemStringComparer(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemStringComparerDelegate))] - static void ReleaseSystemStringComparer(int handle) + [MonoPInvokeCallback(typeof(UnboxInt32Delegate))] + static int UnboxInt32(int valHandle) { try { - NativeScript.Bindings.ObjectStore.Remove(handle); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (int)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemEventArgsConstructorDelegate))] - static void SystemEventArgsConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(BoxUInt32Delegate))] + static int BoxUInt32(uint val) { try { - var thiz = new SystemEventArgs(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemEventArgsDelegate))] - static void ReleaseSystemEventArgs(int handle) + [MonoPInvokeCallback(typeof(UnboxUInt32Delegate))] + static uint UnboxUInt32(int valHandle) { try { - NativeScript.Bindings.ObjectStore.Remove(handle); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (uint)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(uint); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(uint); } } - [MonoPInvokeCallback(typeof(SystemCollectionsICollectionConstructorDelegate))] - static void SystemCollectionsICollectionConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(BoxInt64Delegate))] + static int BoxInt64(long val) { try { - var thiz = new SystemCollectionsICollection(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsICollectionDelegate))] - static void ReleaseSystemCollectionsICollection(int handle) + [MonoPInvokeCallback(typeof(UnboxInt64Delegate))] + static long UnboxInt64(int valHandle) { try { - NativeScript.Bindings.ObjectStore.Remove(handle); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (long)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(long); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(long); } } - [MonoPInvokeCallback(typeof(SystemCollectionsIListConstructorDelegate))] - static void SystemCollectionsIListConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(BoxUInt64Delegate))] + static int BoxUInt64(ulong val) { try { - var thiz = new SystemCollectionsIList(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsIListDelegate))] - static void ReleaseSystemCollectionsIList(int handle) + [MonoPInvokeCallback(typeof(UnboxUInt64Delegate))] + static ulong UnboxUInt64(int valHandle) { try { - NativeScript.Bindings.ObjectStore.Remove(handle); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (ulong)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(ulong); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(ulong); } } - [MonoPInvokeCallback(typeof(SystemCollectionsQueueConstructorDelegate))] - static void SystemCollectionsQueueConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(BoxCharDelegate))] + static int BoxChar(char val) { try { - var thiz = new SystemCollectionsQueue(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsQueueDelegate))] - static void ReleaseSystemCollectionsQueue(int handle) + [MonoPInvokeCallback(typeof(UnboxCharDelegate))] + static char UnboxChar(int valHandle) { try { - NativeScript.Bindings.ObjectStore.Remove(handle); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (char)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(char); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(char); } } - [MonoPInvokeCallback(typeof(BoxBooleanDelegate))] - static int BoxBoolean(bool val) + [MonoPInvokeCallback(typeof(BoxSingleDelegate))] + static int BoxSingle(float val) { try { @@ -4863,31 +5903,31 @@ static int BoxBoolean(bool val) } } - [MonoPInvokeCallback(typeof(UnboxBooleanDelegate))] - static bool UnboxBoolean(int valHandle) + [MonoPInvokeCallback(typeof(UnboxSingleDelegate))] + static float UnboxSingle(int valHandle) { try { var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (bool)val; + var returnValue = (float)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); + return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); + return default(float); } } - [MonoPInvokeCallback(typeof(BoxSByteDelegate))] - static int BoxSByte(sbyte val) + [MonoPInvokeCallback(typeof(BoxDoubleDelegate))] + static int BoxDouble(double val) { try { @@ -4908,35 +5948,35 @@ static int BoxSByte(sbyte val) } } - [MonoPInvokeCallback(typeof(UnboxSByteDelegate))] - static sbyte UnboxSByte(int valHandle) + [MonoPInvokeCallback(typeof(UnboxDoubleDelegate))] + static double UnboxDouble(int valHandle) { try { var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (sbyte)val; + var returnValue = (double)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(sbyte); + return default(double); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(sbyte); + return default(double); } } - [MonoPInvokeCallback(typeof(BoxByteDelegate))] - static int BoxByte(byte val) + [MonoPInvokeCallback(typeof(SystemSystemInt32Array1Constructor1Delegate))] + static int SystemSystemInt32Array1Constructor1(int length0) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new int[length0]); return returnValue; } catch (System.NullReferenceException ex) @@ -4953,125 +5993,120 @@ static int BoxByte(byte val) } } - [MonoPInvokeCallback(typeof(UnboxByteDelegate))] - static byte UnboxByte(int valHandle) + [MonoPInvokeCallback(typeof(SystemInt32Array1GetItem1Delegate))] + static int SystemInt32Array1GetItem1(int thisHandle, int index0) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (byte)val; + var thiz = (int[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index0]; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(byte); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(byte); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxInt16Delegate))] - static int BoxInt16(short val) + [MonoPInvokeCallback(typeof(SystemInt32Array1SetItem1Delegate))] + static void SystemInt32Array1SetItem1(int thisHandle, int index0, int item) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = (int[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz[index0] = item; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxInt16Delegate))] - static short UnboxInt16(int valHandle) + [MonoPInvokeCallback(typeof(SystemSystemSingleArray1Constructor1Delegate))] + static int SystemSystemSingleArray1Constructor1(int length0) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (short)val; + var returnValue = NativeScript.Bindings.ObjectStore.Store(new float[length0]); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(short); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(short); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxUInt16Delegate))] - static int BoxUInt16(ushort val) + [MonoPInvokeCallback(typeof(SystemSingleArray1GetItem1Delegate))] + static float SystemSingleArray1GetItem1(int thisHandle, int index0) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var thiz = (float[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index0]; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } } - [MonoPInvokeCallback(typeof(UnboxUInt16Delegate))] - static ushort UnboxUInt16(int valHandle) + [MonoPInvokeCallback(typeof(SystemSingleArray1SetItem1Delegate))] + static void SystemSingleArray1SetItem1(int thisHandle, int index0, float item) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (ushort)val; - return returnValue; + var thiz = (float[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz[index0] = item; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(ushort); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(ushort); } } - [MonoPInvokeCallback(typeof(BoxInt32Delegate))] - static int BoxInt32(int val) + [MonoPInvokeCallback(typeof(SystemSystemSingleArray2Constructor2Delegate))] + static int SystemSystemSingleArray2Constructor2(int length0, int length1) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new float[length0, length1]); return returnValue; } catch (System.NullReferenceException ex) @@ -5088,13 +6123,13 @@ static int BoxInt32(int val) } } - [MonoPInvokeCallback(typeof(UnboxInt32Delegate))] - static int UnboxInt32(int valHandle) + [MonoPInvokeCallback(typeof(SystemSystemSingleArray2GetLength2Delegate))] + static int SystemSystemSingleArray2GetLength2(int thisHandle, int dimension) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (int)val; + var thiz = (float[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetLength(dimension); return returnValue; } catch (System.NullReferenceException ex) @@ -5111,57 +6146,55 @@ static int UnboxInt32(int valHandle) } } - [MonoPInvokeCallback(typeof(BoxUInt32Delegate))] - static int BoxUInt32(uint val) + [MonoPInvokeCallback(typeof(SystemSingleArray2GetItem2Delegate))] + static float SystemSingleArray2GetItem2(int thisHandle, int index0, int index1) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var thiz = (float[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index0, index1]; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } } - [MonoPInvokeCallback(typeof(UnboxUInt32Delegate))] - static uint UnboxUInt32(int valHandle) + [MonoPInvokeCallback(typeof(SystemSingleArray2SetItem2Delegate))] + static void SystemSingleArray2SetItem2(int thisHandle, int index0, int index1, float item) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (uint)val; - return returnValue; + var thiz = (float[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz[index0, index1] = item; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(uint); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(uint); } } - [MonoPInvokeCallback(typeof(BoxInt64Delegate))] - static int BoxInt64(long val) + [MonoPInvokeCallback(typeof(SystemSystemSingleArray3Constructor3Delegate))] + static int SystemSystemSingleArray3Constructor3(int length0, int length1, int length2) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new float[length0, length1, length2]); return returnValue; } catch (System.NullReferenceException ex) @@ -5178,80 +6211,78 @@ static int BoxInt64(long val) } } - [MonoPInvokeCallback(typeof(UnboxInt64Delegate))] - static long UnboxInt64(int valHandle) + [MonoPInvokeCallback(typeof(SystemSystemSingleArray3GetLength3Delegate))] + static int SystemSystemSingleArray3GetLength3(int thisHandle, int dimension) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (long)val; + var thiz = (float[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetLength(dimension); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(long); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(long); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxUInt64Delegate))] - static int BoxUInt64(ulong val) + [MonoPInvokeCallback(typeof(SystemSingleArray3GetItem3Delegate))] + static float SystemSingleArray3GetItem3(int thisHandle, int index0, int index1, int index2) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var thiz = (float[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index0, index1, index2]; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } } - [MonoPInvokeCallback(typeof(UnboxUInt64Delegate))] - static ulong UnboxUInt64(int valHandle) + [MonoPInvokeCallback(typeof(SystemSingleArray3SetItem3Delegate))] + static void SystemSingleArray3SetItem3(int thisHandle, int index0, int index1, int index2, float item) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (ulong)val; - return returnValue; + var thiz = (float[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz[index0, index1, index2] = item; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(ulong); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(ulong); } } - [MonoPInvokeCallback(typeof(BoxCharDelegate))] - static int BoxChar(char val) + [MonoPInvokeCallback(typeof(SystemSystemStringArray1Constructor1Delegate))] + static int SystemSystemStringArray1Constructor1(int length0) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new string[length0]); return returnValue; } catch (System.NullReferenceException ex) @@ -5268,125 +6299,121 @@ static int BoxChar(char val) } } - [MonoPInvokeCallback(typeof(UnboxCharDelegate))] - static char UnboxChar(int valHandle) + [MonoPInvokeCallback(typeof(SystemStringArray1GetItem1Delegate))] + static int SystemStringArray1GetItem1(int thisHandle, int index0) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (char)val; - return returnValue; + var thiz = (string[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index0]; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(char); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(char); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxSingleDelegate))] - static int BoxSingle(float val) + [MonoPInvokeCallback(typeof(SystemStringArray1SetItem1Delegate))] + static void SystemStringArray1SetItem1(int thisHandle, int index0, int itemHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = (string[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); + thiz[index0] = item; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxSingleDelegate))] - static float UnboxSingle(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineUnityEngineResolutionArray1Constructor1Delegate))] + static int UnityEngineUnityEngineResolutionArray1Constructor1(int length0) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (float)val; + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.Resolution[length0]); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxDoubleDelegate))] - static int BoxDouble(double val) + [MonoPInvokeCallback(typeof(UnityEngineResolutionArray1GetItem1Delegate))] + static UnityEngine.Resolution UnityEngineResolutionArray1GetItem1(int thisHandle, int index0) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var thiz = (UnityEngine.Resolution[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index0]; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Resolution); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Resolution); } } - [MonoPInvokeCallback(typeof(UnboxDoubleDelegate))] - static double UnboxDouble(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineResolutionArray1SetItem1Delegate))] + static void UnityEngineResolutionArray1SetItem1(int thisHandle, int index0, ref UnityEngine.Resolution item) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (double)val; - return returnValue; + var thiz = (UnityEngine.Resolution[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz[index0] = item; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); } } - [MonoPInvokeCallback(typeof(SystemSystemInt32Array1Constructor1Delegate))] - static int SystemSystemInt32Array1Constructor1(int length0) + [MonoPInvokeCallback(typeof(UnityEngineUnityEngineRaycastHitArray1Constructor1Delegate))] + static int UnityEngineUnityEngineRaycastHitArray1Constructor1(int length0) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new int[length0]); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.RaycastHit[length0]); return returnValue; } catch (System.NullReferenceException ex) @@ -5403,14 +6430,14 @@ static int SystemSystemInt32Array1Constructor1(int length0) } } - [MonoPInvokeCallback(typeof(SystemInt32Array1GetItem1Delegate))] - static int SystemInt32Array1GetItem1(int thisHandle, int index0) + [MonoPInvokeCallback(typeof(UnityEngineRaycastHitArray1GetItem1Delegate))] + static int UnityEngineRaycastHitArray1GetItem1(int thisHandle, int index0) { try { - var thiz = (int[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz[index0]; - return returnValue; + return NativeScript.Bindings.StructStore.Store(returnValue); } catch (System.NullReferenceException ex) { @@ -5426,12 +6453,13 @@ static int SystemInt32Array1GetItem1(int thisHandle, int index0) } } - [MonoPInvokeCallback(typeof(SystemInt32Array1SetItem1Delegate))] - static void SystemInt32Array1SetItem1(int thisHandle, int index0, int item) + [MonoPInvokeCallback(typeof(UnityEngineRaycastHitArray1SetItem1Delegate))] + static void UnityEngineRaycastHitArray1SetItem1(int thisHandle, int index0, int itemHandle) { try { - var thiz = (int[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var item = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(itemHandle); thiz[index0] = item; } catch (System.NullReferenceException ex) @@ -5446,12 +6474,12 @@ static void SystemInt32Array1SetItem1(int thisHandle, int index0, int item) } } - [MonoPInvokeCallback(typeof(SystemSystemSingleArray1Constructor1Delegate))] - static int SystemSystemSingleArray1Constructor1(int length0) + [MonoPInvokeCallback(typeof(UnityEngineUnityEngineGradientColorKeyArray1Constructor1Delegate))] + static int UnityEngineUnityEngineGradientColorKeyArray1Constructor1(int length0) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new float[length0]); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GradientColorKey[length0]); return returnValue; } catch (System.NullReferenceException ex) @@ -5468,12 +6496,12 @@ static int SystemSystemSingleArray1Constructor1(int length0) } } - [MonoPInvokeCallback(typeof(SystemSingleArray1GetItem1Delegate))] - static float SystemSingleArray1GetItem1(int thisHandle, int index0) + [MonoPInvokeCallback(typeof(UnityEngineGradientColorKeyArray1GetItem1Delegate))] + static UnityEngine.GradientColorKey UnityEngineGradientColorKeyArray1GetItem1(int thisHandle, int index0) { try { - var thiz = (float[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz[index0]; return returnValue; } @@ -5481,22 +6509,22 @@ static float SystemSingleArray1GetItem1(int thisHandle, int index0) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); + return default(UnityEngine.GradientColorKey); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); + return default(UnityEngine.GradientColorKey); } } - [MonoPInvokeCallback(typeof(SystemSingleArray1SetItem1Delegate))] - static void SystemSingleArray1SetItem1(int thisHandle, int index0, float item) + [MonoPInvokeCallback(typeof(UnityEngineGradientColorKeyArray1SetItem1Delegate))] + static void UnityEngineGradientColorKeyArray1SetItem1(int thisHandle, int index0, ref UnityEngine.GradientColorKey item) { try { - var thiz = (float[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(thisHandle); thiz[index0] = item; } catch (System.NullReferenceException ex) @@ -5511,81 +6539,77 @@ static void SystemSingleArray1SetItem1(int thisHandle, int index0, float item) } } - [MonoPInvokeCallback(typeof(SystemSystemSingleArray2Constructor2Delegate))] - static int SystemSystemSingleArray2Constructor2(int length0, int length1) + [MonoPInvokeCallback(typeof(SystemActionInvokeDelegate))] + static void SystemActionInvoke(int thisHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new float[length0, length1]); - return returnValue; + ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemSystemSingleArray2GetLength2Delegate))] - static int SystemSystemSingleArray2GetLength2(int thisHandle, int dimension) + [MonoPInvokeCallback(typeof(SystemActionConstructorDelegate))] + static void SystemActionConstructor(int cppHandle, ref int handle, ref int classHandle) { try { - var thiz = (float[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetLength(dimension); - return returnValue; + var thiz = new SystemAction(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemSingleArray2GetItem2Delegate))] - static float SystemSingleArray2GetItem2(int thisHandle, int index0, int index1) + [MonoPInvokeCallback(typeof(ReleaseSystemActionDelegate))] + static void ReleaseSystemAction(int handle, int classHandle) { try { - var thiz = (float[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index0, index1]; - return returnValue; + if (classHandle != 0) + { + var thiz = (SystemAction)NativeScript.Bindings.ObjectStore.Remove(classHandle); + thiz.CppHandle = 0; + } + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); } } - [MonoPInvokeCallback(typeof(SystemSingleArray2SetItem2Delegate))] - static void SystemSingleArray2SetItem2(int thisHandle, int index0, int index1, float item) + [MonoPInvokeCallback(typeof(SystemActionAddDelegate))] + static void SystemActionAdd(int thisHandle, int delHandle) { try { - var thiz = (float[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz[index0, index1] = item; + var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz += del; } catch (System.NullReferenceException ex) { @@ -5599,81 +6623,77 @@ static void SystemSingleArray2SetItem2(int thisHandle, int index0, int index1, f } } - [MonoPInvokeCallback(typeof(SystemSystemSingleArray3Constructor3Delegate))] - static int SystemSystemSingleArray3Constructor3(int length0, int length1, int length2) + [MonoPInvokeCallback(typeof(SystemActionRemoveDelegate))] + static void SystemActionRemove(int thisHandle, int delHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new float[length0, length1, length2]); - return returnValue; + var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz -= del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemSystemSingleArray3GetLength3Delegate))] - static int SystemSystemSingleArray3GetLength3(int thisHandle, int dimension) + [MonoPInvokeCallback(typeof(SystemActionSystemSingleInvokeDelegate))] + static void SystemActionSystemSingleInvoke(int thisHandle, float obj) { try { - var thiz = (float[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetLength(dimension); - return returnValue; + ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(obj); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemSingleArray3GetItem3Delegate))] - static float SystemSingleArray3GetItem3(int thisHandle, int index0, int index1, int index2) + [MonoPInvokeCallback(typeof(SystemActionSystemSingleConstructorDelegate))] + static void SystemActionSystemSingleConstructor(int cppHandle, ref int handle, ref int classHandle) { try { - var thiz = (float[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index0, index1, index2]; - return returnValue; + var thiz = new SystemActionSystemSingle(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); } } - [MonoPInvokeCallback(typeof(SystemSingleArray3SetItem3Delegate))] - static void SystemSingleArray3SetItem3(int thisHandle, int index0, int index1, int index2, float item) + [MonoPInvokeCallback(typeof(ReleaseSystemActionSystemSingleDelegate))] + static void ReleaseSystemActionSystemSingle(int handle, int classHandle) { try { - var thiz = (float[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz[index0, index1, index2] = item; + if (classHandle != 0) + { + var thiz = (SystemActionSystemSingle)NativeScript.Bindings.ObjectStore.Remove(classHandle); + thiz.CppHandle = 0; + } + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -5687,59 +6707,54 @@ static void SystemSingleArray3SetItem3(int thisHandle, int index0, int index1, i } } - [MonoPInvokeCallback(typeof(SystemSystemStringArray1Constructor1Delegate))] - static int SystemSystemStringArray1Constructor1(int length0) + [MonoPInvokeCallback(typeof(SystemActionSystemSingleAddDelegate))] + static void SystemActionSystemSingleAdd(int thisHandle, int delHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new string[length0]); - return returnValue; + var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz += del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemStringArray1GetItem1Delegate))] - static int SystemStringArray1GetItem1(int thisHandle, int index0) + [MonoPInvokeCallback(typeof(SystemActionSystemSingleRemoveDelegate))] + static void SystemActionSystemSingleRemove(int thisHandle, int delHandle) { try { - var thiz = (string[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index0]; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz -= del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemStringArray1SetItem1Delegate))] - static void SystemStringArray1SetItem1(int thisHandle, int index0, int itemHandle) + [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleInvokeDelegate))] + static void SystemActionSystemSingle_SystemSingleInvoke(int thisHandle, float arg1, float arg2) { try { - var thiz = (string[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); - thiz[index0] = item; + ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); } catch (System.NullReferenceException ex) { @@ -5753,58 +6768,58 @@ static void SystemStringArray1SetItem1(int thisHandle, int index0, int itemHandl } } - [MonoPInvokeCallback(typeof(UnityEngineUnityEngineResolutionArray1Constructor1Delegate))] - static int UnityEngineUnityEngineResolutionArray1Constructor1(int length0) + [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleConstructorDelegate))] + static void SystemActionSystemSingle_SystemSingleConstructor(int cppHandle, ref int handle, ref int classHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.Resolution[length0]); - return returnValue; + var thiz = new SystemActionSystemSingle_SystemSingle(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionArray1GetItem1Delegate))] - static UnityEngine.Resolution UnityEngineResolutionArray1GetItem1(int thisHandle, int index0) + [MonoPInvokeCallback(typeof(ReleaseSystemActionSystemSingle_SystemSingleDelegate))] + static void ReleaseSystemActionSystemSingle_SystemSingle(int handle, int classHandle) { try { - var thiz = (UnityEngine.Resolution[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index0]; - return returnValue; + if (classHandle != 0) + { + var thiz = (SystemActionSystemSingle_SystemSingle)NativeScript.Bindings.ObjectStore.Remove(classHandle); + thiz.CppHandle = 0; + } + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Resolution); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Resolution); } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionArray1SetItem1Delegate))] - static void UnityEngineResolutionArray1SetItem1(int thisHandle, int index0, ref UnityEngine.Resolution item) + [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleAddDelegate))] + static void SystemActionSystemSingle_SystemSingleAdd(int thisHandle, int delHandle) { try { - var thiz = (UnityEngine.Resolution[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz[index0] = item; + var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz += del; } catch (System.NullReferenceException ex) { @@ -5818,59 +6833,56 @@ static void UnityEngineResolutionArray1SetItem1(int thisHandle, int index0, ref } } - [MonoPInvokeCallback(typeof(UnityEngineUnityEngineRaycastHitArray1Constructor1Delegate))] - static int UnityEngineUnityEngineRaycastHitArray1Constructor1(int length0) + [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleRemoveDelegate))] + static void SystemActionSystemSingle_SystemSingleRemove(int thisHandle, int delHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.RaycastHit[length0]); - return returnValue; + var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz -= del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineRaycastHitArray1GetItem1Delegate))] - static int UnityEngineRaycastHitArray1GetItem1(int thisHandle, int index0) + [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleInvokeDelegate))] + static double SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(int thisHandle, int arg1, float arg2) { try { - var thiz = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index0]; - return NativeScript.Bindings.StructStore.Store(returnValue); + var returnValue = ((System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(double); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(double); } } - [MonoPInvokeCallback(typeof(UnityEngineRaycastHitArray1SetItem1Delegate))] - static void UnityEngineRaycastHitArray1SetItem1(int thisHandle, int index0, int itemHandle) + [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructorDelegate))] + static void SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(int cppHandle, ref int handle, ref int classHandle) { try { - var thiz = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var item = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(itemHandle); - thiz[index0] = item; + var thiz = new SystemFuncSystemInt32_SystemSingle_SystemDouble(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { @@ -5884,58 +6896,59 @@ static void UnityEngineRaycastHitArray1SetItem1(int thisHandle, int index0, int } } - [MonoPInvokeCallback(typeof(UnityEngineUnityEngineGradientColorKeyArray1Constructor1Delegate))] - static int UnityEngineUnityEngineGradientColorKeyArray1Constructor1(int length0) + [MonoPInvokeCallback(typeof(ReleaseSystemFuncSystemInt32_SystemSingle_SystemDoubleDelegate))] + static void ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(int handle, int classHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GradientColorKey[length0]); - return returnValue; + if (classHandle != 0) + { + var thiz = (SystemFuncSystemInt32_SystemSingle_SystemDouble)NativeScript.Bindings.ObjectStore.Remove(classHandle); + thiz.CppHandle = 0; + } + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineGradientColorKeyArray1GetItem1Delegate))] - static UnityEngine.GradientColorKey UnityEngineGradientColorKeyArray1GetItem1(int thisHandle, int index0) + [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleAddDelegate))] + static void SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(int thisHandle, int delHandle) { try { - var thiz = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index0]; - return returnValue; + var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz += del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); } } - [MonoPInvokeCallback(typeof(UnityEngineGradientColorKeyArray1SetItem1Delegate))] - static void UnityEngineGradientColorKeyArray1SetItem1(int thisHandle, int index0, ref UnityEngine.GradientColorKey item) + [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleRemoveDelegate))] + static void SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(int thisHandle, int delHandle) { try { - var thiz = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz[index0] = item; + var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); + thiz -= del; } catch (System.NullReferenceException ex) { @@ -5949,31 +6962,34 @@ static void UnityEngineGradientColorKeyArray1SetItem1(int thisHandle, int index0 } } - [MonoPInvokeCallback(typeof(SystemActionInvokeDelegate))] - static void SystemActionInvoke(int thisHandle) + [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringInvokeDelegate))] + static int SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(int thisHandle, short arg1, int arg2) { try { - ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(); + var returnValue = ((System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemActionConstructorDelegate))] - static void SystemActionConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringConstructorDelegate))] + static void SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(int cppHandle, ref int handle, ref int classHandle) { try { - var thiz = new SystemAction(cppHandle); + var thiz = new SystemFuncSystemInt16_SystemInt32_SystemString(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -5988,14 +7004,14 @@ static void SystemActionConstructor(int cppHandle, ref int handle, ref int class } } - [MonoPInvokeCallback(typeof(ReleaseSystemActionDelegate))] - static void ReleaseSystemAction(int handle, int classHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemFuncSystemInt16_SystemInt32_SystemStringDelegate))] + static void ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(int handle, int classHandle) { try { if (classHandle != 0) { - var thiz = (SystemAction)NativeScript.Bindings.ObjectStore.Remove(classHandle); + var thiz = (SystemFuncSystemInt16_SystemInt32_SystemString)NativeScript.Bindings.ObjectStore.Remove(classHandle); thiz.CppHandle = 0; } NativeScript.Bindings.ObjectStore.Remove(handle); @@ -6012,13 +7028,13 @@ static void ReleaseSystemAction(int handle, int classHandle) } } - [MonoPInvokeCallback(typeof(SystemActionAddDelegate))] - static void SystemActionAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringAddDelegate))] + static void SystemFuncSystemInt16_SystemInt32_SystemStringAdd(int thisHandle, int delHandle) { try { - var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz += del; } catch (System.NullReferenceException ex) @@ -6033,13 +7049,13 @@ static void SystemActionAdd(int thisHandle, int delHandle) } } - [MonoPInvokeCallback(typeof(SystemActionRemoveDelegate))] - static void SystemActionRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringRemoveDelegate))] + static void SystemFuncSystemInt16_SystemInt32_SystemStringRemove(int thisHandle, int delHandle) { try { - var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz -= del; } catch (System.NullReferenceException ex) @@ -6054,12 +7070,13 @@ static void SystemActionRemove(int thisHandle, int delHandle) } } - [MonoPInvokeCallback(typeof(SystemActionSystemSingleInvokeDelegate))] - static void SystemActionSystemSingleInvoke(int thisHandle, float obj) + [MonoPInvokeCallback(typeof(SystemAppDomainInitializerInvokeDelegate))] + static void SystemAppDomainInitializerInvoke(int thisHandle, int argsHandle) { try { - ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(obj); + var args = (string[])NativeScript.Bindings.ObjectStore.Get(argsHandle); + ((System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle))(args); } catch (System.NullReferenceException ex) { @@ -6073,12 +7090,12 @@ static void SystemActionSystemSingleInvoke(int thisHandle, float obj) } } - [MonoPInvokeCallback(typeof(SystemActionSystemSingleConstructorDelegate))] - static void SystemActionSystemSingleConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(SystemAppDomainInitializerConstructorDelegate))] + static void SystemAppDomainInitializerConstructor(int cppHandle, ref int handle, ref int classHandle) { try { - var thiz = new SystemActionSystemSingle(cppHandle); + var thiz = new SystemAppDomainInitializer(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -6093,14 +7110,14 @@ static void SystemActionSystemSingleConstructor(int cppHandle, ref int handle, r } } - [MonoPInvokeCallback(typeof(ReleaseSystemActionSystemSingleDelegate))] - static void ReleaseSystemActionSystemSingle(int handle, int classHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemAppDomainInitializerDelegate))] + static void ReleaseSystemAppDomainInitializer(int handle, int classHandle) { try { if (classHandle != 0) { - var thiz = (SystemActionSystemSingle)NativeScript.Bindings.ObjectStore.Remove(classHandle); + var thiz = (SystemAppDomainInitializer)NativeScript.Bindings.ObjectStore.Remove(classHandle); thiz.CppHandle = 0; } NativeScript.Bindings.ObjectStore.Remove(handle); @@ -6117,13 +7134,13 @@ static void ReleaseSystemActionSystemSingle(int handle, int classHandle) } } - [MonoPInvokeCallback(typeof(SystemActionSystemSingleAddDelegate))] - static void SystemActionSystemSingleAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemAppDomainInitializerAddDelegate))] + static void SystemAppDomainInitializerAdd(int thisHandle, int delHandle) { try { - var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz += del; } catch (System.NullReferenceException ex) @@ -6138,13 +7155,13 @@ static void SystemActionSystemSingleAdd(int thisHandle, int delHandle) } } - [MonoPInvokeCallback(typeof(SystemActionSystemSingleRemoveDelegate))] - static void SystemActionSystemSingleRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemAppDomainInitializerRemoveDelegate))] + static void SystemAppDomainInitializerRemove(int thisHandle, int delHandle) { try { - var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz -= del; } catch (System.NullReferenceException ex) @@ -6159,12 +7176,12 @@ static void SystemActionSystemSingleRemove(int thisHandle, int delHandle) } } - [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleInvokeDelegate))] - static void SystemActionSystemSingle_SystemSingleInvoke(int thisHandle, float arg1, float arg2) + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionInvokeDelegate))] + static void UnityEngineEventsUnityActionInvoke(int thisHandle) { try { - ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); + ((UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle))(); } catch (System.NullReferenceException ex) { @@ -6178,12 +7195,12 @@ static void SystemActionSystemSingle_SystemSingleInvoke(int thisHandle, float ar } } - [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleConstructorDelegate))] - static void SystemActionSystemSingle_SystemSingleConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionConstructorDelegate))] + static void UnityEngineEventsUnityActionConstructor(int cppHandle, ref int handle, ref int classHandle) { try { - var thiz = new SystemActionSystemSingle_SystemSingle(cppHandle); + var thiz = new UnityEngineEventsUnityAction(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -6198,14 +7215,14 @@ static void SystemActionSystemSingle_SystemSingleConstructor(int cppHandle, ref } } - [MonoPInvokeCallback(typeof(ReleaseSystemActionSystemSingle_SystemSingleDelegate))] - static void ReleaseSystemActionSystemSingle_SystemSingle(int handle, int classHandle) + [MonoPInvokeCallback(typeof(ReleaseUnityEngineEventsUnityActionDelegate))] + static void ReleaseUnityEngineEventsUnityAction(int handle, int classHandle) { try { if (classHandle != 0) { - var thiz = (SystemActionSystemSingle_SystemSingle)NativeScript.Bindings.ObjectStore.Remove(classHandle); + var thiz = (UnityEngineEventsUnityAction)NativeScript.Bindings.ObjectStore.Remove(classHandle); thiz.CppHandle = 0; } NativeScript.Bindings.ObjectStore.Remove(handle); @@ -6222,13 +7239,13 @@ static void ReleaseSystemActionSystemSingle_SystemSingle(int handle, int classHa } } - [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleAddDelegate))] - static void SystemActionSystemSingle_SystemSingleAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionAddDelegate))] + static void UnityEngineEventsUnityActionAdd(int thisHandle, int delHandle) { try { - var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz += del; } catch (System.NullReferenceException ex) @@ -6243,13 +7260,13 @@ static void SystemActionSystemSingle_SystemSingleAdd(int thisHandle, int delHand } } - [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleRemoveDelegate))] - static void SystemActionSystemSingle_SystemSingleRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionRemoveDelegate))] + static void UnityEngineEventsUnityActionRemove(int thisHandle, int delHandle) { try { - var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz -= del; } catch (System.NullReferenceException ex) @@ -6264,34 +7281,31 @@ static void SystemActionSystemSingle_SystemSingleRemove(int thisHandle, int delH } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleInvokeDelegate))] - static double SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(int thisHandle, int arg1, float arg2) + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate))] + static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(int thisHandle, ref UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1) { try { - var returnValue = ((System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); - return returnValue; + ((UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg0, arg1); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructorDelegate))] - static void SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructorDelegate))] + static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor(int cppHandle, ref int handle, ref int classHandle) { try { - var thiz = new SystemFuncSystemInt32_SystemSingle_SystemDouble(cppHandle); + var thiz = new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -6306,14 +7320,14 @@ static void SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(int cppHa } } - [MonoPInvokeCallback(typeof(ReleaseSystemFuncSystemInt32_SystemSingle_SystemDoubleDelegate))] - static void ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(int handle, int classHandle) + [MonoPInvokeCallback(typeof(ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeDelegate))] + static void ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int handle, int classHandle) { try { if (classHandle != 0) { - var thiz = (SystemFuncSystemInt32_SystemSingle_SystemDouble)NativeScript.Bindings.ObjectStore.Remove(classHandle); + var thiz = (UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode)NativeScript.Bindings.ObjectStore.Remove(classHandle); thiz.CppHandle = 0; } NativeScript.Bindings.ObjectStore.Remove(handle); @@ -6330,13 +7344,13 @@ static void ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(int handle, i } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleAddDelegate))] - static void SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAddDelegate))] + static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd(int thisHandle, int delHandle) { try { - var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz += del; } catch (System.NullReferenceException ex) @@ -6351,13 +7365,13 @@ static void SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(int thisHandle, i } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleRemoveDelegate))] - static void SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemoveDelegate))] + static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove(int thisHandle, int delHandle) { try { - var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz -= del; } catch (System.NullReferenceException ex) @@ -6372,34 +7386,33 @@ static void SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(int thisHandle } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringInvokeDelegate))] - static int SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(int thisHandle, short arg1, int arg2) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentEventHandlerInvokeDelegate))] + static void SystemComponentModelDesignComponentEventHandlerInvoke(int thisHandle, int senderHandle, int eHandle) { try { - var returnValue = ((System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var sender = NativeScript.Bindings.ObjectStore.Get(senderHandle); + var e = (System.ComponentModel.Design.ComponentEventArgs)NativeScript.Bindings.ObjectStore.Get(eHandle); + ((System.ComponentModel.Design.ComponentEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle))(sender, e); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringConstructorDelegate))] - static void SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentEventHandlerConstructorDelegate))] + static void SystemComponentModelDesignComponentEventHandlerConstructor(int cppHandle, ref int handle, ref int classHandle) { try { - var thiz = new SystemFuncSystemInt16_SystemInt32_SystemString(cppHandle); + var thiz = new SystemComponentModelDesignComponentEventHandler(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -6414,14 +7427,14 @@ static void SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(int cppHan } } - [MonoPInvokeCallback(typeof(ReleaseSystemFuncSystemInt16_SystemInt32_SystemStringDelegate))] - static void ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(int handle, int classHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemComponentModelDesignComponentEventHandlerDelegate))] + static void ReleaseSystemComponentModelDesignComponentEventHandler(int handle, int classHandle) { try { if (classHandle != 0) { - var thiz = (SystemFuncSystemInt16_SystemInt32_SystemString)NativeScript.Bindings.ObjectStore.Remove(classHandle); + var thiz = (SystemComponentModelDesignComponentEventHandler)NativeScript.Bindings.ObjectStore.Remove(classHandle); thiz.CppHandle = 0; } NativeScript.Bindings.ObjectStore.Remove(handle); @@ -6438,13 +7451,13 @@ static void ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(int handle, in } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringAddDelegate))] - static void SystemFuncSystemInt16_SystemInt32_SystemStringAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentEventHandlerAddDelegate))] + static void SystemComponentModelDesignComponentEventHandlerAdd(int thisHandle, int delHandle) { try { - var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (System.ComponentModel.Design.ComponentEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.ComponentModel.Design.ComponentEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz += del; } catch (System.NullReferenceException ex) @@ -6459,13 +7472,13 @@ static void SystemFuncSystemInt16_SystemInt32_SystemStringAdd(int thisHandle, in } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringRemoveDelegate))] - static void SystemFuncSystemInt16_SystemInt32_SystemStringRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentEventHandlerRemoveDelegate))] + static void SystemComponentModelDesignComponentEventHandlerRemove(int thisHandle, int delHandle) { try { - var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (System.ComponentModel.Design.ComponentEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.ComponentModel.Design.ComponentEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz -= del; } catch (System.NullReferenceException ex) @@ -6480,13 +7493,14 @@ static void SystemFuncSystemInt16_SystemInt32_SystemStringRemove(int thisHandle, } } - [MonoPInvokeCallback(typeof(SystemAppDomainInitializerInvokeDelegate))] - static void SystemAppDomainInitializerInvoke(int thisHandle, int argsHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangingEventHandlerInvokeDelegate))] + static void SystemComponentModelDesignComponentChangingEventHandlerInvoke(int thisHandle, int senderHandle, int eHandle) { try { - var args = (string[])NativeScript.Bindings.ObjectStore.Get(argsHandle); - ((System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle))(args); + var sender = NativeScript.Bindings.ObjectStore.Get(senderHandle); + var e = (System.ComponentModel.Design.ComponentChangingEventArgs)NativeScript.Bindings.ObjectStore.Get(eHandle); + ((System.ComponentModel.Design.ComponentChangingEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle))(sender, e); } catch (System.NullReferenceException ex) { @@ -6500,12 +7514,12 @@ static void SystemAppDomainInitializerInvoke(int thisHandle, int argsHandle) } } - [MonoPInvokeCallback(typeof(SystemAppDomainInitializerConstructorDelegate))] - static void SystemAppDomainInitializerConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangingEventHandlerConstructorDelegate))] + static void SystemComponentModelDesignComponentChangingEventHandlerConstructor(int cppHandle, ref int handle, ref int classHandle) { try { - var thiz = new SystemAppDomainInitializer(cppHandle); + var thiz = new SystemComponentModelDesignComponentChangingEventHandler(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -6520,14 +7534,14 @@ static void SystemAppDomainInitializerConstructor(int cppHandle, ref int handle, } } - [MonoPInvokeCallback(typeof(ReleaseSystemAppDomainInitializerDelegate))] - static void ReleaseSystemAppDomainInitializer(int handle, int classHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemComponentModelDesignComponentChangingEventHandlerDelegate))] + static void ReleaseSystemComponentModelDesignComponentChangingEventHandler(int handle, int classHandle) { try { if (classHandle != 0) { - var thiz = (SystemAppDomainInitializer)NativeScript.Bindings.ObjectStore.Remove(classHandle); + var thiz = (SystemComponentModelDesignComponentChangingEventHandler)NativeScript.Bindings.ObjectStore.Remove(classHandle); thiz.CppHandle = 0; } NativeScript.Bindings.ObjectStore.Remove(handle); @@ -6544,13 +7558,13 @@ static void ReleaseSystemAppDomainInitializer(int handle, int classHandle) } } - [MonoPInvokeCallback(typeof(SystemAppDomainInitializerAddDelegate))] - static void SystemAppDomainInitializerAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangingEventHandlerAddDelegate))] + static void SystemComponentModelDesignComponentChangingEventHandlerAdd(int thisHandle, int delHandle) { try { - var thiz = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (System.ComponentModel.Design.ComponentChangingEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.ComponentModel.Design.ComponentChangingEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz += del; } catch (System.NullReferenceException ex) @@ -6565,13 +7579,13 @@ static void SystemAppDomainInitializerAdd(int thisHandle, int delHandle) } } - [MonoPInvokeCallback(typeof(SystemAppDomainInitializerRemoveDelegate))] - static void SystemAppDomainInitializerRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangingEventHandlerRemoveDelegate))] + static void SystemComponentModelDesignComponentChangingEventHandlerRemove(int thisHandle, int delHandle) { try { - var thiz = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (System.ComponentModel.Design.ComponentChangingEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.ComponentModel.Design.ComponentChangingEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz -= del; } catch (System.NullReferenceException ex) @@ -6586,12 +7600,14 @@ static void SystemAppDomainInitializerRemove(int thisHandle, int delHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionInvokeDelegate))] - static void UnityEngineEventsUnityActionInvoke(int thisHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangedEventHandlerInvokeDelegate))] + static void SystemComponentModelDesignComponentChangedEventHandlerInvoke(int thisHandle, int senderHandle, int eHandle) { try { - ((UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle))(); + var sender = NativeScript.Bindings.ObjectStore.Get(senderHandle); + var e = (System.ComponentModel.Design.ComponentChangedEventArgs)NativeScript.Bindings.ObjectStore.Get(eHandle); + ((System.ComponentModel.Design.ComponentChangedEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle))(sender, e); } catch (System.NullReferenceException ex) { @@ -6605,12 +7621,12 @@ static void UnityEngineEventsUnityActionInvoke(int thisHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionConstructorDelegate))] - static void UnityEngineEventsUnityActionConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangedEventHandlerConstructorDelegate))] + static void SystemComponentModelDesignComponentChangedEventHandlerConstructor(int cppHandle, ref int handle, ref int classHandle) { try { - var thiz = new UnityEngineEventsUnityAction(cppHandle); + var thiz = new SystemComponentModelDesignComponentChangedEventHandler(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -6625,14 +7641,14 @@ static void UnityEngineEventsUnityActionConstructor(int cppHandle, ref int handl } } - [MonoPInvokeCallback(typeof(ReleaseUnityEngineEventsUnityActionDelegate))] - static void ReleaseUnityEngineEventsUnityAction(int handle, int classHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemComponentModelDesignComponentChangedEventHandlerDelegate))] + static void ReleaseSystemComponentModelDesignComponentChangedEventHandler(int handle, int classHandle) { try { if (classHandle != 0) { - var thiz = (UnityEngineEventsUnityAction)NativeScript.Bindings.ObjectStore.Remove(classHandle); + var thiz = (SystemComponentModelDesignComponentChangedEventHandler)NativeScript.Bindings.ObjectStore.Remove(classHandle); thiz.CppHandle = 0; } NativeScript.Bindings.ObjectStore.Remove(handle); @@ -6649,13 +7665,13 @@ static void ReleaseUnityEngineEventsUnityAction(int handle, int classHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionAddDelegate))] - static void UnityEngineEventsUnityActionAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangedEventHandlerAddDelegate))] + static void SystemComponentModelDesignComponentChangedEventHandlerAdd(int thisHandle, int delHandle) { try { - var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (System.ComponentModel.Design.ComponentChangedEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.ComponentModel.Design.ComponentChangedEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz += del; } catch (System.NullReferenceException ex) @@ -6670,13 +7686,13 @@ static void UnityEngineEventsUnityActionAdd(int thisHandle, int delHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionRemoveDelegate))] - static void UnityEngineEventsUnityActionRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangedEventHandlerRemoveDelegate))] + static void SystemComponentModelDesignComponentChangedEventHandlerRemove(int thisHandle, int delHandle) { try { - var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (System.ComponentModel.Design.ComponentChangedEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.ComponentModel.Design.ComponentChangedEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz -= del; } catch (System.NullReferenceException ex) @@ -6691,12 +7707,14 @@ static void UnityEngineEventsUnityActionRemove(int thisHandle, int delHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate))] - static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(int thisHandle, ref UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentRenameEventHandlerInvokeDelegate))] + static void SystemComponentModelDesignComponentRenameEventHandlerInvoke(int thisHandle, int senderHandle, int eHandle) { try { - ((UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg0, arg1); + var sender = NativeScript.Bindings.ObjectStore.Get(senderHandle); + var e = (System.ComponentModel.Design.ComponentRenameEventArgs)NativeScript.Bindings.ObjectStore.Get(eHandle); + ((System.ComponentModel.Design.ComponentRenameEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle))(sender, e); } catch (System.NullReferenceException ex) { @@ -6710,12 +7728,12 @@ static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEng } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructorDelegate))] - static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentRenameEventHandlerConstructorDelegate))] + static void SystemComponentModelDesignComponentRenameEventHandlerConstructor(int cppHandle, ref int handle, ref int classHandle) { try { - var thiz = new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(cppHandle); + var thiz = new SystemComponentModelDesignComponentRenameEventHandler(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -6730,14 +7748,14 @@ static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEng } } - [MonoPInvokeCallback(typeof(ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeDelegate))] - static void ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int handle, int classHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemComponentModelDesignComponentRenameEventHandlerDelegate))] + static void ReleaseSystemComponentModelDesignComponentRenameEventHandler(int handle, int classHandle) { try { if (classHandle != 0) { - var thiz = (UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode)NativeScript.Bindings.ObjectStore.Remove(classHandle); + var thiz = (SystemComponentModelDesignComponentRenameEventHandler)NativeScript.Bindings.ObjectStore.Remove(classHandle); thiz.CppHandle = 0; } NativeScript.Bindings.ObjectStore.Remove(handle); @@ -6754,13 +7772,13 @@ static void ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_U } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAddDelegate))] - static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentRenameEventHandlerAddDelegate))] + static void SystemComponentModelDesignComponentRenameEventHandlerAdd(int thisHandle, int delHandle) { try { - var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (System.ComponentModel.Design.ComponentRenameEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.ComponentModel.Design.ComponentRenameEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz += del; } catch (System.NullReferenceException ex) @@ -6775,13 +7793,13 @@ static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEng } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemoveDelegate))] - static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentRenameEventHandlerRemoveDelegate))] + static void SystemComponentModelDesignComponentRenameEventHandlerRemove(int thisHandle, int delHandle) { try { - var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + var thiz = (System.ComponentModel.Design.ComponentRenameEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var del = (System.ComponentModel.Design.ComponentRenameEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); thiz -= del; } catch (System.NullReferenceException ex) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 888569b..1f8ce78 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -102,6 +102,7 @@ class JsonBaseType public int MaxSimultaneous; public JsonMethod[] OverrideMethods; public JsonProperty[] OverrideProperties; + public JsonEvent[] OverrideEvents; } [Serializable] @@ -6821,6 +6822,115 @@ static void AppendBaseType( } } + // All abstract events + foreach (EventInfo eventInfo in type.GetEvents()) + { + MethodInfo addMethodInfo = eventInfo.GetAddMethod(); + MethodInfo removeMethodInfo = eventInfo.GetRemoveMethod(); + if ((addMethodInfo == null || !addMethodInfo.IsAbstract) && + (removeMethodInfo == null || !removeMethodInfo.IsAbstract)) + { + continue; + } + AppendBaseTypeEvent( + type, + typeName, + cppTypeName, + typeParams, + eventInfo, + addMethodInfo, + removeMethodInfo, + indent, + builders); + } + + // All interface events + if (type.IsInterface) + { + foreach (Type interfaceType in type.GetInterfaces()) + { + foreach (EventInfo eventInfo in interfaceType.GetEvents()) + { + MethodInfo addMethodInfo = eventInfo.GetAddMethod(); + MethodInfo removeMethodInfo = eventInfo.GetRemoveMethod(); + if ((addMethodInfo == null || !addMethodInfo.IsAbstract) && + (removeMethodInfo == null || !removeMethodInfo.IsAbstract)) + { + continue; + } + AppendBaseTypeEvent( + type, + typeName, + cppTypeName, + typeParams, + eventInfo, + addMethodInfo, + removeMethodInfo, + indent, + builders); + } + } + } + + // Specified virtual events + if (jsonBaseType.OverrideEvents != null) + { + EventInfo[] events = type.GetEvents(); + foreach (JsonEvent jsonEvent in jsonBaseType.OverrideEvents) + { + EventInfo eventInfo = null; + foreach (EventInfo curEventInfo in events) + { + if (curEventInfo.Name == jsonEvent.Name) + { + eventInfo = curEventInfo; + break; + } + } + if (eventInfo == null) + { + // Throw an exception so the user knows what to fix in the JSON + StringBuilder errorBuilder = new StringBuilder(1024); + errorBuilder.Append("Event \""); + AppendCsharpTypeName( + type, + errorBuilder); + errorBuilder.Append('.'); + errorBuilder.Append(jsonEvent.Name); + errorBuilder.Append(")\" not found"); + throw new Exception(errorBuilder.ToString()); + } + + MethodInfo addMethodInfo = eventInfo.GetAddMethod(); + MethodInfo removeMethodInfo = eventInfo.GetRemoveMethod(); + if ((addMethodInfo == null || !addMethodInfo.IsVirtual) && + (removeMethodInfo == null || !removeMethodInfo.IsVirtual)) + { + // Throw an exception so the user knows what to fix in the JSON + StringBuilder errorBuilder = new StringBuilder(1024); + errorBuilder.Append("Event \""); + AppendCsharpTypeName( + type, + errorBuilder); + errorBuilder.Append('.'); + errorBuilder.Append(jsonEvent.Name); + errorBuilder.Append( + ")\" doesn't have either a virtual 'add' or 'remove' to override"); + throw new Exception(errorBuilder.ToString()); + } + AppendBaseTypeEvent( + type, + typeName, + cppTypeName, + typeParams, + eventInfo, + addMethodInfo, + removeMethodInfo, + indent, + builders); + } + } + // C# class (ending) builders.CsharpBaseTypes.Append("\t\t}\n"); builders.CsharpBaseTypes.Append("\t\t\n"); @@ -6929,14 +7039,18 @@ static void AppendBaseTypeProperty( builders.CsharpBaseTypes.Append('\n'); builders.CsharpBaseTypes.Append("\t\t\t{\n"); + TypeKind propertyTypeKind = GetTypeKind( + propertyInfo.PropertyType); + if (getMethodInfo != null && getMethodInfo.IsVirtual) { - AppendBaseTypeNativeProperty( + AppendBaseTypeNativePropertyOrEvent( type, typeName, typeParams, cppTypeName, - propertyInfo, + propertyInfo.Name, + propertyTypeKind, getMethodInfo, "Get", isOverride, @@ -6946,12 +7060,13 @@ static void AppendBaseTypeProperty( if (setMethodInfo != null && setMethodInfo.IsVirtual) { - AppendBaseTypeNativeProperty( + AppendBaseTypeNativePropertyOrEvent( type, typeName, typeParams, cppTypeName, - propertyInfo, + propertyInfo.Name, + propertyTypeKind, setMethodInfo, "Set", isOverride, @@ -6963,12 +7078,79 @@ static void AppendBaseTypeProperty( builders.CsharpBaseTypes.Append("\t\t\t\n"); } - static void AppendBaseTypeNativeProperty( + static void AppendBaseTypeEvent( + Type type, + string typeName, + string cppTypeName, + Type[] typeParams, + EventInfo eventInfo, + MethodInfo addMethodInfo, + MethodInfo removeMethodInfo, + int indent, + StringBuilders builders) + { + bool isOverride = IsNonDelegateClass(type); + + builders.CsharpBaseTypes.Append("\t\t\tpublic "); + if (isOverride) + { + builders.CsharpBaseTypes.Append("override "); + } + builders.CsharpBaseTypes.Append("event "); + AppendCsharpTypeName( + eventInfo.EventHandlerType, + builders.CsharpBaseTypes); + builders.CsharpBaseTypes.Append(' '); + builders.CsharpBaseTypes.Append(eventInfo.Name); + builders.CsharpBaseTypes.Append('\n'); + builders.CsharpBaseTypes.Append("\t\t\t{\n"); + + TypeKind eventHandlerTypeKind = GetTypeKind( + eventInfo.EventHandlerType); + + if (addMethodInfo != null && addMethodInfo.IsVirtual) + { + AppendBaseTypeNativePropertyOrEvent( + type, + typeName, + typeParams, + cppTypeName, + eventInfo.Name, + eventHandlerTypeKind, + addMethodInfo, + "Add", + isOverride, + indent, + builders); + } + + if (removeMethodInfo != null && removeMethodInfo.IsVirtual) + { + AppendBaseTypeNativePropertyOrEvent( + type, + typeName, + typeParams, + cppTypeName, + eventInfo.Name, + eventHandlerTypeKind, + removeMethodInfo, + "Remove", + isOverride, + indent, + builders); + } + + builders.CsharpBaseTypes.Append("\t\t\t}\n"); + builders.CsharpBaseTypes.Append("\t\t\t\n"); + } + + static void AppendBaseTypeNativePropertyOrEvent( Type type, string typeName, Type[] typeParams, string cppTypeName, - PropertyInfo propertyInfo, + string propertyOrEventName, + TypeKind propertyOrEventTypeKind, MethodInfo methodInfo, string operationType, bool isOverride, @@ -6977,7 +7159,7 @@ static void AppendBaseTypeNativeProperty( { builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append(operationType); - builders.TempStrBuilder.Append(propertyInfo.Name); + builders.TempStrBuilder.Append(propertyOrEventName); string funcName = builders.TempStrBuilder.ToString(); AppendCsharpGetDelegateCall( @@ -7012,8 +7194,6 @@ static void AppendBaseTypeNativeProperty( // C# method that calls the C++ binding function ParameterInfo[] invokeParamsWithThis = PrependThisParameter( invokeParams); - TypeKind invokeReturnTypeKind = GetTypeKind( - propertyInfo.PropertyType); builders.CsharpBaseTypes.Append("\t\t\t\t"); builders.CsharpBaseTypes.Append(char.ToLower(operationType[0])); builders.CsharpBaseTypes.Append( @@ -7026,7 +7206,7 @@ static void AppendBaseTypeNativeProperty( methodInfo, nativeInvokeFuncName, invokeParamsWithThis, - invokeReturnTypeKind, + propertyOrEventTypeKind, 5, builders.CsharpBaseTypes); builders.CsharpBaseTypes.Append("\t\t\t\t}\n"); diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 35a3cb7..fa0d271 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -554,6 +554,24 @@ "Set": {} } ] + }, + { + "Name": "System.EventArgs" + }, + { + "Name": "System.ComponentModel.Design.ComponentEventArgs" + }, + { + "Name": "System.ComponentModel.Design.ComponentChangingEventArgs" + }, + { + "Name": "System.ComponentModel.Design.ComponentChangedEventArgs" + }, + { + "Name": "System.ComponentModel.Design.ComponentRenameEventArgs" + }, + { + "Name": "System.ComponentModel.MemberDescriptor" } ], "BaseTypes": [ @@ -575,15 +593,6 @@ { "Name": "System.StringComparer" }, - { - "Name": "System.EventArgs", - "OverrideMethods": [ - { - "Name": "ToString", - "ParamTypes": [] - } - ] - }, { "Name": "System.Collections.ICollection" }, @@ -599,6 +608,9 @@ "Set": {} } ] + }, + { + "Name": "System.ComponentModel.Design.IComponentChangeService" } ], "MonoBehaviours": [ @@ -697,6 +709,18 @@ "MaxSimultaneous": 10 } ] + }, + { + "Type": "System.ComponentModel.Design.ComponentEventHandler" + }, + { + "Type": "System.ComponentModel.Design.ComponentChangingEventHandler" + }, + { + "Type": "System.ComponentModel.Design.ComponentChangedEventHandler" + }, + { + "Type": "System.ComponentModel.Design.ComponentRenameEventHandler" } ] } \ No newline at end of file diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index d6a52cc..c99a94c 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -145,14 +145,14 @@ namespace Plugin void (*SystemCollectionsGenericIComparerSystemStringConstructor)(int32_t cppHandle, int32_t* handle); void (*ReleaseSystemStringComparer)(int32_t handle); void (*SystemStringComparerConstructor)(int32_t cppHandle, int32_t* handle); - void (*ReleaseSystemEventArgs)(int32_t handle); - void (*SystemEventArgsConstructor)(int32_t cppHandle, int32_t* handle); void (*ReleaseSystemCollectionsICollection)(int32_t handle); void (*SystemCollectionsICollectionConstructor)(int32_t cppHandle, int32_t* handle); void (*ReleaseSystemCollectionsIList)(int32_t handle); void (*SystemCollectionsIListConstructor)(int32_t cppHandle, int32_t* handle); void (*ReleaseSystemCollectionsQueue)(int32_t handle); void (*SystemCollectionsQueueConstructor)(int32_t cppHandle, int32_t* handle); + void (*ReleaseSystemComponentModelDesignIComponentChangeService)(int32_t handle); + void (*SystemComponentModelDesignIComponentChangeServiceConstructor)(int32_t cppHandle, int32_t* handle); int32_t (*BoxBoolean)(System::Boolean val); System::Boolean (*UnboxBoolean)(int32_t valHandle); int32_t (*BoxSByte)(int8_t val); @@ -243,6 +243,26 @@ namespace Plugin void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)(int32_t thisHandle, int32_t delHandle); void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle); void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); + void (*ReleaseSystemComponentModelDesignComponentEventHandler)(int32_t handle, int32_t classHandle); + void (*SystemComponentModelDesignComponentEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); + void (*SystemComponentModelDesignComponentEventHandlerAdd)(int32_t thisHandle, int32_t delHandle); + void (*SystemComponentModelDesignComponentEventHandlerRemove)(int32_t thisHandle, int32_t delHandle); + void (*SystemComponentModelDesignComponentEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle); + void (*ReleaseSystemComponentModelDesignComponentChangingEventHandler)(int32_t handle, int32_t classHandle); + void (*SystemComponentModelDesignComponentChangingEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); + void (*SystemComponentModelDesignComponentChangingEventHandlerAdd)(int32_t thisHandle, int32_t delHandle); + void (*SystemComponentModelDesignComponentChangingEventHandlerRemove)(int32_t thisHandle, int32_t delHandle); + void (*SystemComponentModelDesignComponentChangingEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle); + void (*ReleaseSystemComponentModelDesignComponentChangedEventHandler)(int32_t handle, int32_t classHandle); + void (*SystemComponentModelDesignComponentChangedEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); + void (*SystemComponentModelDesignComponentChangedEventHandlerAdd)(int32_t thisHandle, int32_t delHandle); + void (*SystemComponentModelDesignComponentChangedEventHandlerRemove)(int32_t thisHandle, int32_t delHandle); + void (*SystemComponentModelDesignComponentChangedEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle); + void (*ReleaseSystemComponentModelDesignComponentRenameEventHandler)(int32_t handle, int32_t classHandle); + void (*SystemComponentModelDesignComponentRenameEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); + void (*SystemComponentModelDesignComponentRenameEventHandlerAdd)(int32_t thisHandle, int32_t delHandle); + void (*SystemComponentModelDesignComponentRenameEventHandlerRemove)(int32_t thisHandle, int32_t delHandle); + void (*SystemComponentModelDesignComponentRenameEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle); /*END FUNCTION POINTERS*/ } @@ -417,31 +437,6 @@ namespace Plugin *pRelease = (System::StringComparer*)NextFreeSystemStringComparer; NextFreeSystemStringComparer = pRelease; } - int32_t SystemEventArgsFreeListSize; - System::EventArgs** SystemEventArgsFreeList; - System::EventArgs** NextFreeSystemEventArgs; - - int32_t StoreSystemEventArgs(System::EventArgs* del) - { - assert(NextFreeSystemEventArgs != nullptr); - System::EventArgs** pNext = NextFreeSystemEventArgs; - NextFreeSystemEventArgs = (System::EventArgs**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemEventArgsFreeList); - } - - System::EventArgs* GetSystemEventArgs(int32_t handle) - { - assert(handle >= 0 && handle < SystemEventArgsFreeListSize); - return SystemEventArgsFreeList[handle]; - } - - void RemoveSystemEventArgs(int32_t handle) - { - System::EventArgs** pRelease = SystemEventArgsFreeList + handle; - *pRelease = (System::EventArgs*)NextFreeSystemEventArgs; - NextFreeSystemEventArgs = pRelease; - } int32_t SystemCollectionsICollectionFreeListSize; System::Collections::ICollection** SystemCollectionsICollectionFreeList; System::Collections::ICollection** NextFreeSystemCollectionsICollection; @@ -517,6 +512,31 @@ namespace Plugin *pRelease = (System::Collections::Queue*)NextFreeSystemCollectionsQueue; NextFreeSystemCollectionsQueue = pRelease; } + int32_t SystemComponentModelDesignIComponentChangeServiceFreeListSize; + System::ComponentModel::Design::IComponentChangeService** SystemComponentModelDesignIComponentChangeServiceFreeList; + System::ComponentModel::Design::IComponentChangeService** NextFreeSystemComponentModelDesignIComponentChangeService; + + int32_t StoreSystemComponentModelDesignIComponentChangeService(System::ComponentModel::Design::IComponentChangeService* del) + { + assert(NextFreeSystemComponentModelDesignIComponentChangeService != nullptr); + System::ComponentModel::Design::IComponentChangeService** pNext = NextFreeSystemComponentModelDesignIComponentChangeService; + NextFreeSystemComponentModelDesignIComponentChangeService = (System::ComponentModel::Design::IComponentChangeService**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemComponentModelDesignIComponentChangeServiceFreeList); + } + + System::ComponentModel::Design::IComponentChangeService* GetSystemComponentModelDesignIComponentChangeService(int32_t handle) + { + assert(handle >= 0 && handle < SystemComponentModelDesignIComponentChangeServiceFreeListSize); + return SystemComponentModelDesignIComponentChangeServiceFreeList[handle]; + } + + void RemoveSystemComponentModelDesignIComponentChangeService(int32_t handle) + { + System::ComponentModel::Design::IComponentChangeService** pRelease = SystemComponentModelDesignIComponentChangeServiceFreeList + handle; + *pRelease = (System::ComponentModel::Design::IComponentChangeService*)NextFreeSystemComponentModelDesignIComponentChangeService; + NextFreeSystemComponentModelDesignIComponentChangeService = pRelease; + } int32_t SystemActionFreeListSize; System::Action** SystemActionFreeList; System::Action** NextFreeSystemAction; @@ -717,6 +737,106 @@ namespace Plugin *pRelease = (UnityEngine::Events::UnityAction2*)NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = pRelease; } + int32_t SystemComponentModelDesignComponentEventHandlerFreeListSize; + System::ComponentModel::Design::ComponentEventHandler** SystemComponentModelDesignComponentEventHandlerFreeList; + System::ComponentModel::Design::ComponentEventHandler** NextFreeSystemComponentModelDesignComponentEventHandler; + + int32_t StoreSystemComponentModelDesignComponentEventHandler(System::ComponentModel::Design::ComponentEventHandler* del) + { + assert(NextFreeSystemComponentModelDesignComponentEventHandler != nullptr); + System::ComponentModel::Design::ComponentEventHandler** pNext = NextFreeSystemComponentModelDesignComponentEventHandler; + NextFreeSystemComponentModelDesignComponentEventHandler = (System::ComponentModel::Design::ComponentEventHandler**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemComponentModelDesignComponentEventHandlerFreeList); + } + + System::ComponentModel::Design::ComponentEventHandler* GetSystemComponentModelDesignComponentEventHandler(int32_t handle) + { + assert(handle >= 0 && handle < SystemComponentModelDesignComponentEventHandlerFreeListSize); + return SystemComponentModelDesignComponentEventHandlerFreeList[handle]; + } + + void RemoveSystemComponentModelDesignComponentEventHandler(int32_t handle) + { + System::ComponentModel::Design::ComponentEventHandler** pRelease = SystemComponentModelDesignComponentEventHandlerFreeList + handle; + *pRelease = (System::ComponentModel::Design::ComponentEventHandler*)NextFreeSystemComponentModelDesignComponentEventHandler; + NextFreeSystemComponentModelDesignComponentEventHandler = pRelease; + } + int32_t SystemComponentModelDesignComponentChangingEventHandlerFreeListSize; + System::ComponentModel::Design::ComponentChangingEventHandler** SystemComponentModelDesignComponentChangingEventHandlerFreeList; + System::ComponentModel::Design::ComponentChangingEventHandler** NextFreeSystemComponentModelDesignComponentChangingEventHandler; + + int32_t StoreSystemComponentModelDesignComponentChangingEventHandler(System::ComponentModel::Design::ComponentChangingEventHandler* del) + { + assert(NextFreeSystemComponentModelDesignComponentChangingEventHandler != nullptr); + System::ComponentModel::Design::ComponentChangingEventHandler** pNext = NextFreeSystemComponentModelDesignComponentChangingEventHandler; + NextFreeSystemComponentModelDesignComponentChangingEventHandler = (System::ComponentModel::Design::ComponentChangingEventHandler**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemComponentModelDesignComponentChangingEventHandlerFreeList); + } + + System::ComponentModel::Design::ComponentChangingEventHandler* GetSystemComponentModelDesignComponentChangingEventHandler(int32_t handle) + { + assert(handle >= 0 && handle < SystemComponentModelDesignComponentChangingEventHandlerFreeListSize); + return SystemComponentModelDesignComponentChangingEventHandlerFreeList[handle]; + } + + void RemoveSystemComponentModelDesignComponentChangingEventHandler(int32_t handle) + { + System::ComponentModel::Design::ComponentChangingEventHandler** pRelease = SystemComponentModelDesignComponentChangingEventHandlerFreeList + handle; + *pRelease = (System::ComponentModel::Design::ComponentChangingEventHandler*)NextFreeSystemComponentModelDesignComponentChangingEventHandler; + NextFreeSystemComponentModelDesignComponentChangingEventHandler = pRelease; + } + int32_t SystemComponentModelDesignComponentChangedEventHandlerFreeListSize; + System::ComponentModel::Design::ComponentChangedEventHandler** SystemComponentModelDesignComponentChangedEventHandlerFreeList; + System::ComponentModel::Design::ComponentChangedEventHandler** NextFreeSystemComponentModelDesignComponentChangedEventHandler; + + int32_t StoreSystemComponentModelDesignComponentChangedEventHandler(System::ComponentModel::Design::ComponentChangedEventHandler* del) + { + assert(NextFreeSystemComponentModelDesignComponentChangedEventHandler != nullptr); + System::ComponentModel::Design::ComponentChangedEventHandler** pNext = NextFreeSystemComponentModelDesignComponentChangedEventHandler; + NextFreeSystemComponentModelDesignComponentChangedEventHandler = (System::ComponentModel::Design::ComponentChangedEventHandler**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemComponentModelDesignComponentChangedEventHandlerFreeList); + } + + System::ComponentModel::Design::ComponentChangedEventHandler* GetSystemComponentModelDesignComponentChangedEventHandler(int32_t handle) + { + assert(handle >= 0 && handle < SystemComponentModelDesignComponentChangedEventHandlerFreeListSize); + return SystemComponentModelDesignComponentChangedEventHandlerFreeList[handle]; + } + + void RemoveSystemComponentModelDesignComponentChangedEventHandler(int32_t handle) + { + System::ComponentModel::Design::ComponentChangedEventHandler** pRelease = SystemComponentModelDesignComponentChangedEventHandlerFreeList + handle; + *pRelease = (System::ComponentModel::Design::ComponentChangedEventHandler*)NextFreeSystemComponentModelDesignComponentChangedEventHandler; + NextFreeSystemComponentModelDesignComponentChangedEventHandler = pRelease; + } + int32_t SystemComponentModelDesignComponentRenameEventHandlerFreeListSize; + System::ComponentModel::Design::ComponentRenameEventHandler** SystemComponentModelDesignComponentRenameEventHandlerFreeList; + System::ComponentModel::Design::ComponentRenameEventHandler** NextFreeSystemComponentModelDesignComponentRenameEventHandler; + + int32_t StoreSystemComponentModelDesignComponentRenameEventHandler(System::ComponentModel::Design::ComponentRenameEventHandler* del) + { + assert(NextFreeSystemComponentModelDesignComponentRenameEventHandler != nullptr); + System::ComponentModel::Design::ComponentRenameEventHandler** pNext = NextFreeSystemComponentModelDesignComponentRenameEventHandler; + NextFreeSystemComponentModelDesignComponentRenameEventHandler = (System::ComponentModel::Design::ComponentRenameEventHandler**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemComponentModelDesignComponentRenameEventHandlerFreeList); + } + + System::ComponentModel::Design::ComponentRenameEventHandler* GetSystemComponentModelDesignComponentRenameEventHandler(int32_t handle) + { + assert(handle >= 0 && handle < SystemComponentModelDesignComponentRenameEventHandlerFreeListSize); + return SystemComponentModelDesignComponentRenameEventHandlerFreeList[handle]; + } + + void RemoveSystemComponentModelDesignComponentRenameEventHandler(int32_t handle) + { + System::ComponentModel::Design::ComponentRenameEventHandler** pRelease = SystemComponentModelDesignComponentRenameEventHandlerFreeList + handle; + *pRelease = (System::ComponentModel::Design::ComponentRenameEventHandler*)NextFreeSystemComponentModelDesignComponentRenameEventHandler; + NextFreeSystemComponentModelDesignComponentRenameEventHandler = pRelease; + } /*END GLOBAL STATE AND FUNCTIONS*/ } @@ -4740,90 +4860,127 @@ namespace System namespace System { - namespace Collections + EventArgs::EventArgs(decltype(nullptr) n) + : EventArgs(Plugin::InternalUse::Only, 0) { - namespace Generic + } + + EventArgs::EventArgs(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) { - IComparer::IComparer() - : System::Object(nullptr) - { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); - Plugin::SystemCollectionsGenericIComparerSystemInt32Constructor(CppHandle, &Handle); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemCollectionsGenericIComparerSystemInt32(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - IComparer::IComparer(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) + Plugin::ReferenceManagedClass(handle); + } + } + + EventArgs::EventArgs(const EventArgs& other) + : EventArgs(Plugin::InternalUse::Only, other.Handle) + { + } + + EventArgs::EventArgs(EventArgs&& other) + : EventArgs(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + EventArgs::~EventArgs() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + EventArgs& EventArgs::operator=(const EventArgs& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + EventArgs& EventArgs::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + EventArgs& EventArgs::operator=(EventArgs&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool EventArgs::operator==(const EventArgs& other) const + { + return Handle == other.Handle; + } + + bool EventArgs::operator!=(const EventArgs& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + ComponentEventArgs::ComponentEventArgs(decltype(nullptr) n) + : ComponentEventArgs(Plugin::InternalUse::Only, 0) { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); } - IComparer::IComparer(const IComparer& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + ComponentEventArgs::ComponentEventArgs(Plugin::InternalUse iu, int32_t handle) + : System::EventArgs(iu, handle) { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); - if (Handle) + if (handle) { - Plugin::ReferenceManagedClass(Handle); + Plugin::ReferenceManagedClass(handle); } } - IComparer::IComparer(IComparer&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + ComponentEventArgs::ComponentEventArgs(const ComponentEventArgs& other) + : ComponentEventArgs(Plugin::InternalUse::Only, other.Handle) { - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; } - IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + ComponentEventArgs::ComponentEventArgs(ComponentEventArgs&& other) + : ComponentEventArgs(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } + other.Handle = 0; } - IComparer::~IComparer() + ComponentEventArgs::~ComponentEventArgs() { - Plugin::RemoveSystemCollectionsGenericIComparerSystemInt32(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; + Plugin::DereferenceManagedClass(Handle); Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericIComparerSystemInt32(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } } - IComparer& IComparer::operator=(const IComparer& other) + ComponentEventArgs& ComponentEventArgs::operator=(const ComponentEventArgs& other) { if (this->Handle) { @@ -4837,177 +4994,169 @@ namespace System return *this; } - IComparer& IComparer::operator=(decltype(nullptr) other) + ComponentEventArgs& ComponentEventArgs::operator=(decltype(nullptr) other) { if (Handle) { - int32_t handle = Handle; + Plugin::DereferenceManagedClass(Handle); Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericIComparerSystemInt32(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } - Handle = 0; return *this; } - IComparer& IComparer::operator=(IComparer&& other) + ComponentEventArgs& ComponentEventArgs::operator=(ComponentEventArgs&& other) { - Plugin::RemoveSystemCollectionsGenericIComparerSystemInt32(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericIComparerSystemInt32(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool IComparer::operator==(const IComparer& other) const + bool ComponentEventArgs::operator==(const ComponentEventArgs& other) const { return Handle == other.Handle; } - bool IComparer::operator!=(const IComparer& other) const + bool ComponentEventArgs::operator!=(const ComponentEventArgs& other) const { return Handle != other.Handle; } - - int32_t IComparer::Compare(int32_t x, int32_t y) + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + ComponentChangingEventArgs::ComponentChangingEventArgs(decltype(nullptr) n) + : ComponentChangingEventArgs(Plugin::InternalUse::Only, 0) { - return {}; } - DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemInt32Compare(int32_t cppHandle, int32_t x, int32_t y) + ComponentChangingEventArgs::ComponentChangingEventArgs(Plugin::InternalUse iu, int32_t handle) + : System::EventArgs(iu, handle) { - try + if (handle) { - return Plugin::GetSystemCollectionsGenericIComparerSystemInt32(cppHandle)->Compare(x, y); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + Plugin::ReferenceManagedClass(handle); } } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IComparer::IComparer() - : System::Object(nullptr) + + ComponentChangingEventArgs::ComponentChangingEventArgs(const ComponentChangingEventArgs& other) + : ComponentChangingEventArgs(Plugin::InternalUse::Only, other.Handle) + { + } + + ComponentChangingEventArgs::ComponentChangingEventArgs(ComponentChangingEventArgs&& other) + : ComponentChangingEventArgs(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ComponentChangingEventArgs::~ComponentChangingEventArgs() { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); - Plugin::SystemCollectionsGenericIComparerSystemStringConstructor(CppHandle, &Handle); if (Handle) { - Plugin::ReferenceManagedClass(Handle); + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - else + } + + ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(const ComponentChangingEventArgs& other) + { + if (this->Handle) { - Plugin::RemoveSystemCollectionsGenericIComparerSystemString(CppHandle); - CppHandle = 0; + Plugin::DereferenceManagedClass(this->Handle); } - if (Plugin::unhandledCsharpException) + this->Handle = other.Handle; + if (this->Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } - IComparer::IComparer(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) + ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(decltype(nullptr) other) { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - IComparer::IComparer(const IComparer& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(ComponentChangingEventArgs&& other) { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); if (Handle) { - Plugin::ReferenceManagedClass(Handle); + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; } - IComparer::IComparer(IComparer&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + bool ComponentChangingEventArgs::operator==(const ComponentChangingEventArgs& other) const { - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; + return Handle == other.Handle; } - IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + bool ComponentChangingEventArgs::operator!=(const ComponentChangingEventArgs& other) const { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); - if (Handle) + return Handle != other.Handle; + } + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + ComponentChangedEventArgs::ComponentChangedEventArgs(decltype(nullptr) n) + : ComponentChangedEventArgs(Plugin::InternalUse::Only, 0) + { + } + + ComponentChangedEventArgs::ComponentChangedEventArgs(Plugin::InternalUse iu, int32_t handle) + : System::EventArgs(iu, handle) + { + if (handle) { - Plugin::ReferenceManagedClass(Handle); + Plugin::ReferenceManagedClass(handle); } } - IComparer::~IComparer() + ComponentChangedEventArgs::ComponentChangedEventArgs(const ComponentChangedEventArgs& other) + : ComponentChangedEventArgs(Plugin::InternalUse::Only, other.Handle) + { + } + + ComponentChangedEventArgs::ComponentChangedEventArgs(ComponentChangedEventArgs&& other) + : ComponentChangedEventArgs(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ComponentChangedEventArgs::~ComponentChangedEventArgs() { - Plugin::RemoveSystemCollectionsGenericIComparerSystemString(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; + Plugin::DereferenceManagedClass(Handle); Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericIComparerSystemString(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } } - IComparer& IComparer::operator=(const IComparer& other) + ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(const ComponentChangedEventArgs& other) { if (this->Handle) { @@ -5021,88 +5170,123 @@ namespace System return *this; } - IComparer& IComparer::operator=(decltype(nullptr) other) + ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(decltype(nullptr) other) { if (Handle) { - int32_t handle = Handle; + Plugin::DereferenceManagedClass(Handle); Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericIComparerSystemString(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } - Handle = 0; return *this; } - IComparer& IComparer::operator=(IComparer&& other) + ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(ComponentChangedEventArgs&& other) { - Plugin::RemoveSystemCollectionsGenericIComparerSystemString(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericIComparerSystemString(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool IComparer::operator==(const IComparer& other) const + bool ComponentChangedEventArgs::operator==(const ComponentChangedEventArgs& other) const { return Handle == other.Handle; } - bool IComparer::operator!=(const IComparer& other) const + bool ComponentChangedEventArgs::operator!=(const ComponentChangedEventArgs& other) const { return Handle != other.Handle; } + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + ComponentRenameEventArgs::ComponentRenameEventArgs(decltype(nullptr) n) + : ComponentRenameEventArgs(Plugin::InternalUse::Only, 0) + { + } - int32_t IComparer::Compare(System::String& x, System::String& y) + ComponentRenameEventArgs::ComponentRenameEventArgs(Plugin::InternalUse iu, int32_t handle) + : System::EventArgs(iu, handle) { - return {}; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemStringCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + ComponentRenameEventArgs::ComponentRenameEventArgs(const ComponentRenameEventArgs& other) + : ComponentRenameEventArgs(Plugin::InternalUse::Only, other.Handle) { - try + } + + ComponentRenameEventArgs::ComponentRenameEventArgs(ComponentRenameEventArgs&& other) + : ComponentRenameEventArgs(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ComponentRenameEventArgs::~ComponentRenameEventArgs() + { + if (Handle) { - auto param0 = System::String(Plugin::InternalUse::Only, xHandle); - auto param1 = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemCollectionsGenericIComparerSystemString(cppHandle)->Compare(param0, param1); + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - catch (System::Exception ex) + } + + ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(const ComponentRenameEventArgs& other) + { + if (this->Handle) { - Plugin::SetException(ex.Handle); - return {}; + Plugin::DereferenceManagedClass(this->Handle); } - catch (...) + this->Handle = other.Handle; + if (this->Handle) { - System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(ComponentRenameEventArgs&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ComponentRenameEventArgs::operator==(const ComponentRenameEventArgs& other) const + { + return Handle == other.Handle; + } + + bool ComponentRenameEventArgs::operator!=(const ComponentRenameEventArgs& other) const + { + return Handle != other.Handle; } } } @@ -5110,108 +5294,109 @@ namespace System namespace System { - StringComparer::StringComparer() - : System::Object(nullptr) + namespace ComponentModel { - CppHandle = Plugin::StoreSystemStringComparer(this); - Plugin::SystemStringComparerConstructor(CppHandle, &Handle); - if (Handle) + MemberDescriptor::MemberDescriptor(decltype(nullptr) n) + : MemberDescriptor(Plugin::InternalUse::Only, 0) { - Plugin::ReferenceManagedClass(Handle); } - else + + MemberDescriptor::MemberDescriptor(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { - Plugin::RemoveSystemStringComparer(CppHandle); - CppHandle = 0; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - if (Plugin::unhandledCsharpException) + + MemberDescriptor::MemberDescriptor(const MemberDescriptor& other) + : MemberDescriptor(Plugin::InternalUse::Only, other.Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } - } - - StringComparer::StringComparer(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) - { - CppHandle = Plugin::StoreSystemStringComparer(this); - } - - StringComparer::StringComparer(const StringComparer& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = Plugin::StoreSystemStringComparer(this); - if (Handle) + + MemberDescriptor::MemberDescriptor(MemberDescriptor&& other) + : MemberDescriptor(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(Handle); + other.Handle = 0; } - } - - StringComparer::StringComparer(StringComparer&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - StringComparer::StringComparer(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - CppHandle = Plugin::StoreSystemStringComparer(this); - if (Handle) + + MemberDescriptor::~MemberDescriptor() { - Plugin::ReferenceManagedClass(Handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - } - - StringComparer::~StringComparer() - { - Plugin::RemoveSystemStringComparer(CppHandle); - CppHandle = 0; - if (Handle) + + MemberDescriptor& MemberDescriptor::operator=(const MemberDescriptor& other) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + if (this->Handle) { - Plugin::ReleaseSystemStringComparer(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } - } - - StringComparer& StringComparer::operator=(const StringComparer& other) - { - if (this->Handle) + + MemberDescriptor& MemberDescriptor::operator=(decltype(nullptr) other) { - Plugin::DereferenceManagedClass(this->Handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - this->Handle = other.Handle; - if (this->Handle) + + MemberDescriptor& MemberDescriptor::operator=(MemberDescriptor&& other) { - Plugin::ReferenceManagedClass(this->Handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool MemberDescriptor::operator==(const MemberDescriptor& other) const + { + return Handle == other.Handle; + } + + bool MemberDescriptor::operator!=(const MemberDescriptor& other) const + { + return Handle != other.Handle; } - return *this; } - - StringComparer& StringComparer::operator=(decltype(nullptr) other) +} + +namespace System +{ + namespace Collections { - if (Handle) + namespace Generic { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + IComparer::IComparer() + : System::Object(nullptr) { - Plugin::ReleaseSystemStringComparer(handle); + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); + Plugin::SystemCollectionsGenericIComparerSystemInt32Constructor(CppHandle, &Handle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemCollectionsGenericIComparerSystemInt32(CppHandle); + CppHandle = 0; + } if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5220,255 +5405,182 @@ namespace System delete ex; } } - } - Handle = 0; - return *this; - } - - StringComparer& StringComparer::operator=(StringComparer&& other) - { - Plugin::RemoveSystemStringComparer(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + + IComparer::IComparer(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) { - Plugin::ReleaseSystemStringComparer(handle); - if (Plugin::unhandledCsharpException) + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); + } + + IComparer::IComparer(const IComparer& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(Handle); } } - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool StringComparer::operator==(const StringComparer& other) const - { - return Handle == other.Handle; - } - - bool StringComparer::operator!=(const StringComparer& other) const - { - return Handle != other.Handle; - } - - int32_t StringComparer::Compare(System::String& x, System::String& y) - { - return {}; - } - - DLLEXPORT int32_t SystemStringComparerCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) - { - try - { - auto param0 = System::String(Plugin::InternalUse::Only, xHandle); - auto param1 = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemStringComparer(cppHandle)->Compare(param0, param1); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::StringComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } - - System::Boolean StringComparer::Equals(System::String& x, System::String& y) - { - return {}; - } - - DLLEXPORT int32_t SystemStringComparerEquals(int32_t cppHandle, int32_t xHandle, int32_t yHandle) - { - try - { - auto param0 = System::String(Plugin::InternalUse::Only, xHandle); - auto param1 = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemStringComparer(cppHandle)->Equals(param0, param1); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::StringComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } - - int32_t StringComparer::GetHashCode(System::String& obj) - { - return {}; - } - - DLLEXPORT int32_t SystemStringComparerGetHashCode(int32_t cppHandle, int32_t objHandle) - { - try - { - auto param0 = System::String(Plugin::InternalUse::Only, objHandle); - return Plugin::GetSystemStringComparer(cppHandle)->GetHashCode(param0); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::StringComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } -} - -namespace System -{ - EventArgs::EventArgs() - : System::Object(nullptr) - { - CppHandle = Plugin::StoreSystemEventArgs(this); - Plugin::SystemEventArgsConstructor(CppHandle, &Handle); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemEventArgs(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - EventArgs::EventArgs(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) - { - CppHandle = Plugin::StoreSystemEventArgs(this); - } - - EventArgs::EventArgs(const EventArgs& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = Plugin::StoreSystemEventArgs(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - EventArgs::EventArgs(EventArgs&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - EventArgs::EventArgs(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - CppHandle = Plugin::StoreSystemEventArgs(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - EventArgs::~EventArgs() - { - Plugin::RemoveSystemEventArgs(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + + IComparer::IComparer(IComparer&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReleaseSystemEventArgs(handle); - if (Plugin::unhandledCsharpException) + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(Handle); } } - } - } - - EventArgs& EventArgs::operator=(const EventArgs& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - EventArgs& EventArgs::operator=(decltype(nullptr) other) - { - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + + IComparer::~IComparer() { - Plugin::ReleaseSystemEventArgs(handle); - if (Plugin::unhandledCsharpException) + Plugin::RemoveSystemCollectionsGenericIComparerSystemInt32(CppHandle); + CppHandle = 0; + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericIComparerSystemInt32(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + IComparer& IComparer::operator=(const IComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparer& IComparer::operator=(decltype(nullptr) other) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericIComparerSystemInt32(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + IComparer& IComparer::operator=(IComparer&& other) + { + Plugin::RemoveSystemCollectionsGenericIComparerSystemInt32(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericIComparerSystemInt32(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparer::operator==(const IComparer& other) const + { + return Handle == other.Handle; + } + + bool IComparer::operator!=(const IComparer& other) const + { + return Handle != other.Handle; + } + + int32_t IComparer::Compare(int32_t x, int32_t y) + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemInt32Compare(int32_t cppHandle, int32_t x, int32_t y) + { + try + { + return Plugin::GetSystemCollectionsGenericIComparerSystemInt32(cppHandle)->Compare(x, y); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; } } } - Handle = 0; - return *this; } - - EventArgs& EventArgs::operator=(EventArgs&& other) +} + +namespace System +{ + namespace Collections { - Plugin::RemoveSystemEventArgs(CppHandle); - CppHandle = 0; - if (Handle) + namespace Generic { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + IComparer::IComparer() + : System::Object(nullptr) { - Plugin::ReleaseSystemEventArgs(handle); + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); + Plugin::SystemCollectionsGenericIComparerSystemStringConstructor(CppHandle, &Handle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemCollectionsGenericIComparerSystemString(CppHandle); + CppHandle = 0; + } if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5477,391 +5589,461 @@ namespace System delete ex; } } - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool EventArgs::operator==(const EventArgs& other) const - { - return Handle == other.Handle; - } - - bool EventArgs::operator!=(const EventArgs& other) const - { - return Handle != other.Handle; - } - - System::String EventArgs::ToString() - { - return nullptr; - } - - DLLEXPORT int32_t SystemEventArgsToString(int32_t cppHandle) - { - try - { - return Plugin::GetSystemEventArgs(cppHandle)->ToString().Handle; - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::EventArgs"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } -} - -namespace System -{ - namespace Collections - { - ICollection::ICollection() - : System::Object(nullptr) - { - CppHandle = Plugin::StoreSystemCollectionsICollection(this); - Plugin::SystemCollectionsICollectionConstructor(CppHandle, &Handle); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else + + IComparer::IComparer(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) { - Plugin::RemoveSystemCollectionsICollection(CppHandle); - CppHandle = 0; + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); } - if (Plugin::unhandledCsharpException) + + IComparer::IComparer(const IComparer& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } - } - - ICollection::ICollection(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) - { - CppHandle = Plugin::StoreSystemCollectionsICollection(this); - } - - ICollection::ICollection(const ICollection& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = Plugin::StoreSystemCollectionsICollection(this); - if (Handle) + + IComparer::IComparer(IComparer&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(Handle); + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; } - } - - ICollection::ICollection(ICollection&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - CppHandle = Plugin::StoreSystemCollectionsICollection(this); - if (Handle) + + IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { - Plugin::ReferenceManagedClass(Handle); + CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } - } - - ICollection::~ICollection() - { - Plugin::RemoveSystemCollectionsICollection(CppHandle); - CppHandle = 0; - if (Handle) + + IComparer::~IComparer() { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + Plugin::RemoveSystemCollectionsGenericIComparerSystemString(CppHandle); + CppHandle = 0; + if (Handle) { - Plugin::ReleaseSystemCollectionsICollection(handle); - if (Plugin::unhandledCsharpException) + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReleaseSystemCollectionsGenericIComparerSystemString(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } } - } - - ICollection& ICollection::operator=(const ICollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + + IComparer& IComparer::operator=(const IComparer& other) { - Plugin::ReferenceManagedClass(this->Handle); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - return *this; - } - - ICollection& ICollection::operator=(decltype(nullptr) other) - { - if (Handle) + + IComparer& IComparer::operator=(decltype(nullptr) other) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + if (Handle) { - Plugin::ReleaseSystemCollectionsICollection(handle); - if (Plugin::unhandledCsharpException) + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReleaseSystemCollectionsGenericIComparerSystemString(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } + Handle = 0; + return *this; } - Handle = 0; - return *this; - } - - ICollection& ICollection::operator=(ICollection&& other) - { - Plugin::RemoveSystemCollectionsICollection(CppHandle); - CppHandle = 0; - if (Handle) + + IComparer& IComparer::operator=(IComparer&& other) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + Plugin::RemoveSystemCollectionsGenericIComparerSystemString(CppHandle); + CppHandle = 0; + if (Handle) { - Plugin::ReleaseSystemCollectionsICollection(handle); - if (Plugin::unhandledCsharpException) + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReleaseSystemCollectionsGenericIComparerSystemString(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } + Handle = other.Handle; + other.Handle = 0; + return *this; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ICollection::operator==(const ICollection& other) const - { - return Handle == other.Handle; - } - - bool ICollection::operator!=(const ICollection& other) const - { - return Handle != other.Handle; - } - - void ICollection::CopyTo(System::Array& array, int32_t index) - { - } - - DLLEXPORT void SystemCollectionsICollectionCopyTo(int32_t cppHandle, int32_t arrayHandle, int32_t index) - { - try + + bool IComparer::operator==(const IComparer& other) const { - auto param0 = System::Array(Plugin::InternalUse::Only, arrayHandle); - Plugin::GetSystemCollectionsICollection(cppHandle)->CopyTo(param0, index); + return Handle == other.Handle; } - catch (System::Exception ex) + + bool IComparer::operator!=(const IComparer& other) const { - Plugin::SetException(ex.Handle); + return Handle != other.Handle; } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::ICollection"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - System::Collections::IEnumerator ICollection::GetEnumerator() - { - return nullptr; - } - - DLLEXPORT int32_t SystemCollectionsICollectionGetEnumerator(int32_t cppHandle) - { - try - { - return Plugin::GetSystemCollectionsICollection(cppHandle)->GetEnumerator().Handle; - } - catch (System::Exception ex) + + int32_t IComparer::Compare(System::String& x, System::String& y) { - Plugin::SetException(ex.Handle); return {}; } - catch (...) + + DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemStringCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) { - System::String msg = "Unhandled exception invoking System::Collections::ICollection"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + try + { + auto param0 = System::String(Plugin::InternalUse::Only, xHandle); + auto param1 = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemCollectionsGenericIComparerSystemString(cppHandle)->Compare(param0, param1); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } } } - - int32_t ICollection::GetCount() + } +} + +namespace System +{ + StringComparer::StringComparer() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemStringComparer(this); + Plugin::SystemStringComparerConstructor(CppHandle, &Handle); + if (Handle) { - return {}; + Plugin::ReferenceManagedClass(Handle); } - - DLLEXPORT int32_t SystemCollectionsICollectionGetCount(int32_t cppHandle) + else { - try - { - return Plugin::GetSystemCollectionsICollection(cppHandle)->GetCount(); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::ICollection"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } + Plugin::RemoveSystemStringComparer(CppHandle); + CppHandle = 0; } - - System::Boolean ICollection::GetIsSynchronized() + if (Plugin::unhandledCsharpException) { - return {}; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - DLLEXPORT int32_t SystemCollectionsICollectionGetIsSynchronized(int32_t cppHandle) + } + + StringComparer::StringComparer(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) + { + CppHandle = Plugin::StoreSystemStringComparer(this); + } + + StringComparer::StringComparer(const StringComparer& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreSystemStringComparer(this); + if (Handle) { - try - { - return Plugin::GetSystemCollectionsICollection(cppHandle)->GetIsSynchronized(); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::ICollection"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } + Plugin::ReferenceManagedClass(Handle); } - - System::Object ICollection::GetSyncRoot() + } + + StringComparer::StringComparer(StringComparer&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + StringComparer::StringComparer(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemStringComparer(this); + if (Handle) { - return nullptr; + Plugin::ReferenceManagedClass(Handle); } - - DLLEXPORT int32_t SystemCollectionsICollectionGetSyncRoot(int32_t cppHandle) + } + + StringComparer::~StringComparer() + { + Plugin::RemoveSystemStringComparer(CppHandle); + CppHandle = 0; + if (Handle) { - try - { - return Plugin::GetSystemCollectionsICollection(cppHandle)->GetSyncRoot().Handle; - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::String msg = "Unhandled exception invoking System::Collections::ICollection"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + Plugin::ReleaseSystemStringComparer(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } } -} - -namespace System -{ - namespace Collections + + StringComparer& StringComparer::operator=(const StringComparer& other) { - IList::IList() - : System::Object(nullptr) + if (this->Handle) { - CppHandle = Plugin::StoreSystemCollectionsIList(this); - Plugin::SystemCollectionsIListConstructor(CppHandle, &Handle); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemCollectionsIList(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + Plugin::DereferenceManagedClass(this->Handle); } - - IList::IList(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) + this->Handle = other.Handle; + if (this->Handle) { - CppHandle = Plugin::StoreSystemCollectionsIList(this); + Plugin::ReferenceManagedClass(this->Handle); } - - IList::IList(const IList& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + return *this; + } + + StringComparer& StringComparer::operator=(decltype(nullptr) other) + { + if (Handle) { - CppHandle = Plugin::StoreSystemCollectionsIList(this); - if (Handle) + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReferenceManagedClass(Handle); + Plugin::ReleaseSystemStringComparer(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } - - IList::IList(IList&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - IList::IList(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + Handle = 0; + return *this; + } + + StringComparer& StringComparer::operator=(StringComparer&& other) + { + Plugin::RemoveSystemStringComparer(CppHandle); + CppHandle = 0; + if (Handle) { - CppHandle = Plugin::StoreSystemCollectionsIList(this); + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemStringComparer(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool StringComparer::operator==(const StringComparer& other) const + { + return Handle == other.Handle; + } + + bool StringComparer::operator!=(const StringComparer& other) const + { + return Handle != other.Handle; + } + + int32_t StringComparer::Compare(System::String& x, System::String& y) + { + return {}; + } + + DLLEXPORT int32_t SystemStringComparerCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + { + try + { + auto param0 = System::String(Plugin::InternalUse::Only, xHandle); + auto param1 = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemStringComparer(cppHandle)->Compare(param0, param1); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::StringComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + System::Boolean StringComparer::Equals(System::String& x, System::String& y) + { + return {}; + } + + DLLEXPORT int32_t SystemStringComparerEquals(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + { + try + { + auto param0 = System::String(Plugin::InternalUse::Only, xHandle); + auto param1 = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemStringComparer(cppHandle)->Equals(param0, param1); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::StringComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + int32_t StringComparer::GetHashCode(System::String& obj) + { + return {}; + } + + DLLEXPORT int32_t SystemStringComparerGetHashCode(int32_t cppHandle, int32_t objHandle) + { + try + { + auto param0 = System::String(Plugin::InternalUse::Only, objHandle); + return Plugin::GetSystemStringComparer(cppHandle)->GetHashCode(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::StringComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } +} + +namespace System +{ + namespace Collections + { + ICollection::ICollection() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemCollectionsICollection(this); + Plugin::SystemCollectionsICollectionConstructor(CppHandle, &Handle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemCollectionsICollection(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + ICollection::ICollection(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) + { + CppHandle = Plugin::StoreSystemCollectionsICollection(this); + } + + ICollection::ICollection(const ICollection& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreSystemCollectionsICollection(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - IList::~IList() + ICollection::ICollection(ICollection&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - Plugin::RemoveSystemCollectionsIList(CppHandle); + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemCollectionsICollection(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + ICollection::~ICollection() + { + Plugin::RemoveSystemCollectionsICollection(CppHandle); CppHandle = 0; if (Handle) { @@ -5869,7 +6051,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsIList(handle); + Plugin::ReleaseSystemCollectionsICollection(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5881,7 +6063,7 @@ namespace System } } - IList& IList::operator=(const IList& other) + ICollection& ICollection::operator=(const ICollection& other) { if (this->Handle) { @@ -5895,7 +6077,7 @@ namespace System return *this; } - IList& IList::operator=(decltype(nullptr) other) + ICollection& ICollection::operator=(decltype(nullptr) other) { if (Handle) { @@ -5903,7 +6085,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsIList(handle); + Plugin::ReleaseSystemCollectionsICollection(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5917,9 +6099,9 @@ namespace System return *this; } - IList& IList::operator=(IList&& other) + ICollection& ICollection::operator=(ICollection&& other) { - Plugin::RemoveSystemCollectionsIList(CppHandle); + Plugin::RemoveSystemCollectionsICollection(CppHandle); CppHandle = 0; if (Handle) { @@ -5927,7 +6109,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsIList(handle); + Plugin::ReleaseSystemCollectionsICollection(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5942,75 +6124,74 @@ namespace System return *this; } - bool IList::operator==(const IList& other) const + bool ICollection::operator==(const ICollection& other) const { return Handle == other.Handle; } - bool IList::operator!=(const IList& other) const + bool ICollection::operator!=(const ICollection& other) const { return Handle != other.Handle; } - int32_t IList::Add(System::Object& value) + void ICollection::CopyTo(System::Array& array, int32_t index) { - return {}; } - DLLEXPORT int32_t SystemCollectionsIListAdd(int32_t cppHandle, int32_t valueHandle) + DLLEXPORT void SystemCollectionsICollectionCopyTo(int32_t cppHandle, int32_t arrayHandle, int32_t index) { try { - auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); - return Plugin::GetSystemCollectionsIList(cppHandle)->Add(param0); + auto param0 = System::Array(Plugin::InternalUse::Only, arrayHandle); + Plugin::GetSystemCollectionsICollection(cppHandle)->CopyTo(param0, index); } catch (System::Exception ex) { Plugin::SetException(ex.Handle); - return {}; } catch (...) { - System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::String msg = "Unhandled exception invoking System::Collections::ICollection"; System::Exception ex(msg); Plugin::SetException(ex.Handle); - return {}; } } - void IList::Clear() + System::Collections::IEnumerator ICollection::GetEnumerator() { + return nullptr; } - DLLEXPORT void SystemCollectionsIListClear(int32_t cppHandle) + DLLEXPORT int32_t SystemCollectionsICollectionGetEnumerator(int32_t cppHandle) { try { - Plugin::GetSystemCollectionsIList(cppHandle)->Clear(); + return Plugin::GetSystemCollectionsICollection(cppHandle)->GetEnumerator().Handle; } catch (System::Exception ex) { Plugin::SetException(ex.Handle); + return {}; } catch (...) { - System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::String msg = "Unhandled exception invoking System::Collections::ICollection"; System::Exception ex(msg); Plugin::SetException(ex.Handle); + return {}; } } - System::Boolean IList::Contains(System::Object& value) + int32_t ICollection::GetCount() { return {}; } - DLLEXPORT int32_t SystemCollectionsIListContains(int32_t cppHandle, int32_t valueHandle) + DLLEXPORT int32_t SystemCollectionsICollectionGetCount(int32_t cppHandle) { try { - auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); - return Plugin::GetSystemCollectionsIList(cppHandle)->Contains(param0); + return Plugin::GetSystemCollectionsICollection(cppHandle)->GetCount(); } catch (System::Exception ex) { @@ -6019,24 +6200,23 @@ namespace System } catch (...) { - System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::String msg = "Unhandled exception invoking System::Collections::ICollection"; System::Exception ex(msg); Plugin::SetException(ex.Handle); return {}; } } - int32_t IList::IndexOf(System::Object& value) + System::Boolean ICollection::GetIsSynchronized() { return {}; } - DLLEXPORT int32_t SystemCollectionsIListIndexOf(int32_t cppHandle, int32_t valueHandle) + DLLEXPORT int32_t SystemCollectionsICollectionGetIsSynchronized(int32_t cppHandle) { try { - auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); - return Plugin::GetSystemCollectionsIList(cppHandle)->IndexOf(param0); + return Plugin::GetSystemCollectionsICollection(cppHandle)->GetIsSynchronized(); } catch (System::Exception ex) { @@ -6045,68 +6225,229 @@ namespace System } catch (...) { - System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::String msg = "Unhandled exception invoking System::Collections::ICollection"; System::Exception ex(msg); Plugin::SetException(ex.Handle); return {}; } } - void IList::Insert(int32_t index, System::Object& value) + System::Object ICollection::GetSyncRoot() { + return nullptr; } - DLLEXPORT void SystemCollectionsIListInsert(int32_t cppHandle, int32_t index, int32_t valueHandle) + DLLEXPORT int32_t SystemCollectionsICollectionGetSyncRoot(int32_t cppHandle) { try { - auto param1 = System::Object(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemCollectionsIList(cppHandle)->Insert(index, param1); + return Plugin::GetSystemCollectionsICollection(cppHandle)->GetSyncRoot().Handle; } catch (System::Exception ex) { Plugin::SetException(ex.Handle); + return {}; } catch (...) { - System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::String msg = "Unhandled exception invoking System::Collections::ICollection"; System::Exception ex(msg); Plugin::SetException(ex.Handle); + return {}; } } - - void IList::Remove(System::Object& value) - { - } - - DLLEXPORT void SystemCollectionsIListRemove(int32_t cppHandle, int32_t valueHandle) + } +} + +namespace System +{ + namespace Collections + { + IList::IList() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemCollectionsIList(this); + Plugin::SystemCollectionsIListConstructor(CppHandle, &Handle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemCollectionsIList(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + IList::IList(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) + { + CppHandle = Plugin::StoreSystemCollectionsIList(this); + } + + IList::IList(const IList& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreSystemCollectionsIList(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + IList::IList(IList&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + IList::IList(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemCollectionsIList(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + IList::~IList() + { + Plugin::RemoveSystemCollectionsIList(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsIList(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + IList& IList::operator=(const IList& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IList& IList::operator=(decltype(nullptr) other) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsIList(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + IList& IList::operator=(IList&& other) + { + Plugin::RemoveSystemCollectionsIList(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsIList(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IList::operator==(const IList& other) const + { + return Handle == other.Handle; + } + + bool IList::operator!=(const IList& other) const + { + return Handle != other.Handle; + } + + int32_t IList::Add(System::Object& value) + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsIListAdd(int32_t cppHandle, int32_t valueHandle) { try { auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemCollectionsIList(cppHandle)->Remove(param0); + return Plugin::GetSystemCollectionsIList(cppHandle)->Add(param0); } catch (System::Exception ex) { Plugin::SetException(ex.Handle); + return {}; } catch (...) { System::String msg = "Unhandled exception invoking System::Collections::IList"; System::Exception ex(msg); Plugin::SetException(ex.Handle); + return {}; } } - void IList::RemoveAt(int32_t index) + void IList::Clear() { } - DLLEXPORT void SystemCollectionsIListRemoveAt(int32_t cppHandle, int32_t index) + DLLEXPORT void SystemCollectionsIListClear(int32_t cppHandle) { try { - Plugin::GetSystemCollectionsIList(cppHandle)->RemoveAt(index); + Plugin::GetSystemCollectionsIList(cppHandle)->Clear(); } catch (System::Exception ex) { @@ -6120,16 +6461,17 @@ namespace System } } - System::Collections::IEnumerator IList::GetEnumerator() + System::Boolean IList::Contains(System::Object& value) { - return nullptr; + return {}; } - DLLEXPORT int32_t SystemCollectionsIListGetEnumerator(int32_t cppHandle) + DLLEXPORT int32_t SystemCollectionsIListContains(int32_t cppHandle, int32_t valueHandle) { try { - return Plugin::GetSystemCollectionsIList(cppHandle)->GetEnumerator().Handle; + auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); + return Plugin::GetSystemCollectionsIList(cppHandle)->Contains(param0); } catch (System::Exception ex) { @@ -6145,162 +6487,158 @@ namespace System } } - void IList::CopyTo(System::Array& array, int32_t index) + int32_t IList::IndexOf(System::Object& value) { + return {}; } - DLLEXPORT void SystemCollectionsIListCopyTo(int32_t cppHandle, int32_t arrayHandle, int32_t index) + DLLEXPORT int32_t SystemCollectionsIListIndexOf(int32_t cppHandle, int32_t valueHandle) { try { - auto param0 = System::Array(Plugin::InternalUse::Only, arrayHandle); - Plugin::GetSystemCollectionsIList(cppHandle)->CopyTo(param0, index); + auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); + return Plugin::GetSystemCollectionsIList(cppHandle)->IndexOf(param0); } catch (System::Exception ex) { Plugin::SetException(ex.Handle); + return {}; } catch (...) { System::String msg = "Unhandled exception invoking System::Collections::IList"; System::Exception ex(msg); Plugin::SetException(ex.Handle); + return {}; } } - System::Boolean IList::GetIsFixedSize() + void IList::Insert(int32_t index, System::Object& value) { - return {}; } - DLLEXPORT int32_t SystemCollectionsIListGetIsFixedSize(int32_t cppHandle) + DLLEXPORT void SystemCollectionsIListInsert(int32_t cppHandle, int32_t index, int32_t valueHandle) { try { - return Plugin::GetSystemCollectionsIList(cppHandle)->GetIsFixedSize(); + auto param1 = System::Object(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemCollectionsIList(cppHandle)->Insert(index, param1); } catch (System::Exception ex) { Plugin::SetException(ex.Handle); - return {}; } catch (...) { System::String msg = "Unhandled exception invoking System::Collections::IList"; System::Exception ex(msg); Plugin::SetException(ex.Handle); - return {}; } } - System::Boolean IList::GetIsReadOnly() + void IList::Remove(System::Object& value) { - return {}; } - DLLEXPORT int32_t SystemCollectionsIListGetIsReadOnly(int32_t cppHandle) + DLLEXPORT void SystemCollectionsIListRemove(int32_t cppHandle, int32_t valueHandle) { try { - return Plugin::GetSystemCollectionsIList(cppHandle)->GetIsReadOnly(); + auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemCollectionsIList(cppHandle)->Remove(param0); } catch (System::Exception ex) { Plugin::SetException(ex.Handle); - return {}; } catch (...) { System::String msg = "Unhandled exception invoking System::Collections::IList"; System::Exception ex(msg); Plugin::SetException(ex.Handle); - return {}; } } - System::Object IList::GetItem(int32_t index) + void IList::RemoveAt(int32_t index) { - return nullptr; } - DLLEXPORT int32_t SystemCollectionsIListGetItem(int32_t cppHandle, int32_t index) + DLLEXPORT void SystemCollectionsIListRemoveAt(int32_t cppHandle, int32_t index) { try { - return Plugin::GetSystemCollectionsIList(cppHandle)->GetItem(index).Handle; + Plugin::GetSystemCollectionsIList(cppHandle)->RemoveAt(index); } catch (System::Exception ex) { Plugin::SetException(ex.Handle); - return {}; } catch (...) { System::String msg = "Unhandled exception invoking System::Collections::IList"; System::Exception ex(msg); Plugin::SetException(ex.Handle); - return {}; } } - void IList::SetItem(int32_t index, System::Object& value) + System::Collections::IEnumerator IList::GetEnumerator() { + return nullptr; } - DLLEXPORT void SystemCollectionsIListSetItem(int32_t cppHandle, int32_t index, int32_t valueHandle) + DLLEXPORT int32_t SystemCollectionsIListGetEnumerator(int32_t cppHandle) { try { - auto param1 = System::Object(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemCollectionsIList(cppHandle)->SetItem(index, param1); + return Plugin::GetSystemCollectionsIList(cppHandle)->GetEnumerator().Handle; } catch (System::Exception ex) { Plugin::SetException(ex.Handle); + return {}; } catch (...) { System::String msg = "Unhandled exception invoking System::Collections::IList"; System::Exception ex(msg); Plugin::SetException(ex.Handle); + return {}; } } - int32_t IList::GetCount() + void IList::CopyTo(System::Array& array, int32_t index) { - return {}; } - DLLEXPORT int32_t SystemCollectionsIListGetCount(int32_t cppHandle) + DLLEXPORT void SystemCollectionsIListCopyTo(int32_t cppHandle, int32_t arrayHandle, int32_t index) { try { - return Plugin::GetSystemCollectionsIList(cppHandle)->GetCount(); + auto param0 = System::Array(Plugin::InternalUse::Only, arrayHandle); + Plugin::GetSystemCollectionsIList(cppHandle)->CopyTo(param0, index); } catch (System::Exception ex) { Plugin::SetException(ex.Handle); - return {}; } catch (...) { System::String msg = "Unhandled exception invoking System::Collections::IList"; System::Exception ex(msg); Plugin::SetException(ex.Handle); - return {}; } } - System::Boolean IList::GetIsSynchronized() + System::Boolean IList::GetIsFixedSize() { return {}; } - DLLEXPORT int32_t SystemCollectionsIListGetIsSynchronized(int32_t cppHandle) + DLLEXPORT int32_t SystemCollectionsIListGetIsFixedSize(int32_t cppHandle) { try { - return Plugin::GetSystemCollectionsIList(cppHandle)->GetIsSynchronized(); + return Plugin::GetSystemCollectionsIList(cppHandle)->GetIsFixedSize(); } catch (System::Exception ex) { @@ -6316,16 +6654,16 @@ namespace System } } - System::Object IList::GetSyncRoot() + System::Boolean IList::GetIsReadOnly() { - return nullptr; + return {}; } - DLLEXPORT int32_t SystemCollectionsIListGetSyncRoot(int32_t cppHandle) + DLLEXPORT int32_t SystemCollectionsIListGetIsReadOnly(int32_t cppHandle) { try { - return Plugin::GetSystemCollectionsIList(cppHandle)->GetSyncRoot().Handle; + return Plugin::GetSystemCollectionsIList(cppHandle)->GetIsReadOnly(); } catch (System::Exception ex) { @@ -6340,15 +6678,138 @@ namespace System return {}; } } - } -} - -namespace System -{ - namespace Collections - { - Queue::Queue() - : System::Object(nullptr) + + System::Object IList::GetItem(int32_t index) + { + return nullptr; + } + + DLLEXPORT int32_t SystemCollectionsIListGetItem(int32_t cppHandle, int32_t index) + { + try + { + return Plugin::GetSystemCollectionsIList(cppHandle)->GetItem(index).Handle; + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + void IList::SetItem(int32_t index, System::Object& value) + { + } + + DLLEXPORT void SystemCollectionsIListSetItem(int32_t cppHandle, int32_t index, int32_t valueHandle) + { + try + { + auto param1 = System::Object(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemCollectionsIList(cppHandle)->SetItem(index, param1); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + int32_t IList::GetCount() + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsIListGetCount(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsIList(cppHandle)->GetCount(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + System::Boolean IList::GetIsSynchronized() + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsIListGetIsSynchronized(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsIList(cppHandle)->GetIsSynchronized(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + System::Object IList::GetSyncRoot() + { + return nullptr; + } + + DLLEXPORT int32_t SystemCollectionsIListGetSyncRoot(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsIList(cppHandle)->GetSyncRoot().Handle; + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + } +} + +namespace System +{ + namespace Collections + { + Queue::Queue() + : System::Object(nullptr) { CppHandle = Plugin::StoreSystemCollectionsQueue(this); Plugin::SystemCollectionsQueueConstructor(CppHandle, &Handle); @@ -6526,141 +6987,1027 @@ namespace System namespace System { - Object::Object(System::Boolean val) - { - int32_t handle = Plugin::BoxBoolean(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator System::Boolean() - { - System::Boolean returnVal(Plugin::UnboxBoolean(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::Object(int8_t val) - { - int32_t handle = Plugin::BoxSByte(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator int8_t() - { - int8_t returnVal(Plugin::UnboxSByte(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::Object(uint8_t val) - { - int32_t handle = Plugin::BoxByte(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator uint8_t() - { - uint8_t returnVal(Plugin::UnboxByte(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::Object(int16_t val) - { - int32_t handle = Plugin::BoxInt16(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator int16_t() + namespace ComponentModel { - int16_t returnVal(Plugin::UnboxInt16(Handle)); - if (Plugin::unhandledCsharpException) + namespace Design { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + IComponentChangeService::IComponentChangeService() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreSystemComponentModelDesignIComponentChangeService(this); + Plugin::SystemComponentModelDesignIComponentChangeServiceConstructor(CppHandle, &Handle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemComponentModelDesignIComponentChangeService(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + IComponentChangeService::IComponentChangeService(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) + { + CppHandle = Plugin::StoreSystemComponentModelDesignIComponentChangeService(this); + } + + IComponentChangeService::IComponentChangeService(const IComponentChangeService& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreSystemComponentModelDesignIComponentChangeService(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + IComponentChangeService::IComponentChangeService(IComponentChangeService&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + IComponentChangeService::IComponentChangeService(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemComponentModelDesignIComponentChangeService(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + IComponentChangeService::~IComponentChangeService() + { + Plugin::RemoveSystemComponentModelDesignIComponentChangeService(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemComponentModelDesignIComponentChangeService(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + IComponentChangeService& IComponentChangeService::operator=(const IComponentChangeService& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComponentChangeService& IComponentChangeService::operator=(decltype(nullptr) other) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemComponentModelDesignIComponentChangeService(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + IComponentChangeService& IComponentChangeService::operator=(IComponentChangeService&& other) + { + Plugin::RemoveSystemComponentModelDesignIComponentChangeService(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemComponentModelDesignIComponentChangeService(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComponentChangeService::operator==(const IComponentChangeService& other) const + { + return Handle == other.Handle; + } + + bool IComponentChangeService::operator!=(const IComponentChangeService& other) const + { + return Handle != other.Handle; + } + + void IComponentChangeService::OnComponentChanged(System::Object& component, System::ComponentModel::MemberDescriptor& member, System::Object& oldValue, System::Object& newValue) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceOnComponentChanged(int32_t cppHandle, int32_t componentHandle, int32_t memberHandle, int32_t oldValueHandle, int32_t newValueHandle) + { + try + { + auto param0 = System::Object(Plugin::InternalUse::Only, componentHandle); + auto param1 = System::ComponentModel::MemberDescriptor(Plugin::InternalUse::Only, memberHandle); + auto param2 = System::Object(Plugin::InternalUse::Only, oldValueHandle); + auto param3 = System::Object(Plugin::InternalUse::Only, newValueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->OnComponentChanged(param0, param1, param2, param3); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::OnComponentChanging(System::Object& component, System::ComponentModel::MemberDescriptor& member) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceOnComponentChanging(int32_t cppHandle, int32_t componentHandle, int32_t memberHandle) + { + try + { + auto param0 = System::Object(Plugin::InternalUse::Only, componentHandle); + auto param1 = System::ComponentModel::MemberDescriptor(Plugin::InternalUse::Only, memberHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->OnComponentChanging(param0, param1); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::AddComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentAdded(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentAdded(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::RemoveComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentAdded(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::AddComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentAdding(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentAdding(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::RemoveComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentAdding(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::AddComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentChanged(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::ComponentModel::Design::ComponentChangedEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentChanged(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::RemoveComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanged(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::ComponentModel::Design::ComponentChangedEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentChanged(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::AddComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentChanging(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::ComponentModel::Design::ComponentChangingEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentChanging(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::RemoveComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanging(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::ComponentModel::Design::ComponentChangingEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentChanging(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::AddComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentRemoved(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentRemoved(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::RemoveComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoved(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentRemoved(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::AddComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentRemoving(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentRemoving(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::RemoveComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentRemoving(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::AddComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentRename(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::ComponentModel::Design::ComponentRenameEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentRename(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void IComponentChangeService::RemoveComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto param0 = System::ComponentModel::Design::ComponentRenameEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentRename(param0); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + } + } +} + +namespace System +{ + Object::Object(System::Boolean val) + { + int32_t handle = Plugin::BoxBoolean(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator System::Boolean() + { + System::Boolean returnVal(Plugin::UnboxBoolean(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(int8_t val) + { + int32_t handle = Plugin::BoxSByte(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator int8_t() + { + int8_t returnVal(Plugin::UnboxSByte(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(uint8_t val) + { + int32_t handle = Plugin::BoxByte(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator uint8_t() + { + uint8_t returnVal(Plugin::UnboxByte(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(int16_t val) + { + int32_t handle = Plugin::BoxInt16(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator int16_t() + { + int16_t returnVal(Plugin::UnboxInt16(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(uint16_t val) + { + int32_t handle = Plugin::BoxUInt16(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator uint16_t() + { + uint16_t returnVal(Plugin::UnboxUInt16(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(int32_t val) + { + int32_t handle = Plugin::BoxInt32(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator int32_t() + { + int32_t returnVal(Plugin::UnboxInt32(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(uint32_t val) + { + int32_t handle = Plugin::BoxUInt32(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator uint32_t() + { + uint32_t returnVal(Plugin::UnboxUInt32(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(int64_t val) + { + int32_t handle = Plugin::BoxInt64(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator int64_t() + { + int64_t returnVal(Plugin::UnboxInt64(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(uint64_t val) + { + int32_t handle = Plugin::BoxUInt64(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator uint64_t() + { + uint64_t returnVal(Plugin::UnboxUInt64(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(System::Char val) + { + int32_t handle = Plugin::BoxChar(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator System::Char() + { + System::Char returnVal(Plugin::UnboxChar(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(float val) + { + int32_t handle = Plugin::BoxSingle(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator float() + { + float returnVal(Plugin::UnboxSingle(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(double val) + { + int32_t handle = Plugin::BoxDouble(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator double() + { + double returnVal(Plugin::UnboxDouble(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } return returnVal; } } -namespace System +namespace MyGame +{ + namespace MonoBehaviours + { + TestScript::TestScript(decltype(nullptr) n) + : TestScript(Plugin::InternalUse::Only, 0) + { + } + + TestScript::TestScript(Plugin::InternalUse iu, int32_t handle) + : UnityEngine::MonoBehaviour(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + TestScript::TestScript(const TestScript& other) + : TestScript(Plugin::InternalUse::Only, other.Handle) + { + } + + TestScript::TestScript(TestScript&& other) + : TestScript(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + TestScript::~TestScript() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + TestScript& TestScript::operator=(const TestScript& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + TestScript& TestScript::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + TestScript& TestScript::operator=(TestScript&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool TestScript::operator==(const TestScript& other) const + { + return Handle == other.Handle; + } + + bool TestScript::operator!=(const TestScript& other) const + { + return Handle != other.Handle; + } + } +} + +namespace Plugin { - Object::Object(uint16_t val) + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) { - int32_t handle = Plugin::BoxUInt16(val); + Handle = handle; + Index0 = index0; + } + + void ArrayElementProxy1_1::operator=(int32_t item) + { + Plugin::SystemInt32Array1SetItem1(Handle, Index0, item); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6668,16 +8015,11 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } } - Object::operator uint16_t() + ArrayElementProxy1_1::operator int32_t() { - uint16_t returnVal(Plugin::UnboxUInt16(Handle)); + auto returnValue = Plugin::SystemInt32Array1GetItem1(Handle, Index0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6685,81 +8027,103 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return returnVal; + return returnValue; } } namespace System { - Object::Object(int32_t val) + Array1::Array1(decltype(nullptr) n) + : Array1(Plugin::InternalUse::Only, 0) + { + this->InternalLength = 0; + } + + Array1::Array1(Plugin::InternalUse iu, int32_t handle) + : System::Array(iu, handle) { - int32_t handle = Plugin::BoxInt32(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } if (handle) { Plugin::ReferenceManagedClass(handle); - Handle = handle; } + this->InternalLength = 0; } - Object::operator int32_t() + Array1::Array1(const Array1& other) + : Array1(Plugin::InternalUse::Only, other.Handle) { - int32_t returnVal(Plugin::UnboxInt32(Handle)); - if (Plugin::unhandledCsharpException) + InternalLength = other.InternalLength; + } + + Array1::Array1(Array1&& other) + : Array1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + InternalLength = other.InternalLength; + other.InternalLength = 0; + } + + Array1::~Array1() + { + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - return returnVal; } -} - -namespace System -{ - Object::Object(uint32_t val) + + Array1& Array1::operator=(const Array1& other) { - int32_t handle = Plugin::BoxUInt32(val); - if (Plugin::unhandledCsharpException) + if (this->Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(this->Handle); } - if (handle) + this->Handle = other.Handle; + if (this->Handle) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + Plugin::ReferenceManagedClass(this->Handle); } + InternalLength = other.InternalLength; + return *this; } - Object::operator uint32_t() + Array1& Array1::operator=(decltype(nullptr) other) { - uint32_t returnVal(Plugin::UnboxUInt32(Handle)); - if (Plugin::unhandledCsharpException) + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - return returnVal; + return *this; } -} - -namespace System -{ - Object::Object(int64_t val) + + Array1& Array1::operator=(Array1&& other) { - int32_t handle = Plugin::BoxInt64(val); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + InternalLength = other.InternalLength; + other.Handle = 0; + other.InternalLength = 0; + return *this; + } + + bool Array1::operator==(const Array1& other) const + { + return Handle == other.Handle; + } + + bool Array1::operator!=(const Array1& other) const + { + return Handle != other.Handle; + } + + Array1::Array1(int32_t length0) + : System::Array(nullptr) + { + auto returnValue = Plugin::SystemSystemInt32Array1Constructor1(length0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6767,32 +8131,47 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - if (handle) + Handle = returnValue; + if (returnValue) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + Plugin::ReferenceManagedClass(returnValue); + InternalLength = length0; } } - Object::operator int64_t() + int32_t Array1::GetLength() { - int64_t returnVal(Plugin::UnboxInt64(Handle)); - if (Plugin::unhandledCsharpException) + int32_t returnVal = InternalLength; + if (returnVal == 0) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + returnVal = Array::GetLength(); + InternalLength = returnVal; + }; return returnVal; } + + int32_t Array1::GetRank() + { + return 1; + } + + Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) + { + return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); + } } -namespace System +namespace Plugin { - Object::Object(uint64_t val) + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) { - int32_t handle = Plugin::BoxUInt64(val); + Handle = handle; + Index0 = index0; + } + + void ArrayElementProxy1_1::operator=(float item) + { + Plugin::SystemSingleArray1SetItem1(Handle, Index0, item); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6800,16 +8179,11 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } } - Object::operator uint64_t() + ArrayElementProxy1_1::operator float() { - uint64_t returnVal(Plugin::UnboxUInt64(Handle)); + auto returnValue = Plugin::SystemSingleArray1GetItem1(Handle, Index0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6817,48 +8191,36 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return returnVal; + return returnValue; } } -namespace System +namespace Plugin { - Object::Object(System::Char val) + ArrayElementProxy1_2::ArrayElementProxy1_2(Plugin::InternalUse iu, int32_t handle, int32_t index0) { - int32_t handle = Plugin::BoxChar(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } + Handle = handle; + Index0 = index0; } - Object::operator System::Char() + Plugin::ArrayElementProxy2_2 Plugin::ArrayElementProxy1_2::operator[](int32_t index) { - System::Char returnVal(Plugin::UnboxChar(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; + return Plugin::ArrayElementProxy2_2(Plugin::InternalUse::Only, Handle, Index0, index); } } -namespace System +namespace Plugin { - Object::Object(float val) + ArrayElementProxy2_2::ArrayElementProxy2_2(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1) + { + Handle = handle; + Index0 = index0; + Index1 = index1; + } + + void ArrayElementProxy2_2::operator=(float item) { - int32_t handle = Plugin::BoxSingle(val); + Plugin::SystemSingleArray2SetItem2(Handle, Index0, Index1, item); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6866,16 +8228,11 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } } - Object::operator float() + ArrayElementProxy2_2::operator float() { - float returnVal(Plugin::UnboxSingle(Handle)); + auto returnValue = Plugin::SystemSingleArray2GetItem2(Handle, Index0, Index1); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6883,15 +8240,52 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return returnVal; + return returnValue; } } -namespace System +namespace Plugin { - Object::Object(double val) + ArrayElementProxy1_3::ArrayElementProxy1_3(Plugin::InternalUse iu, int32_t handle, int32_t index0) { - int32_t handle = Plugin::BoxDouble(val); + Handle = handle; + Index0 = index0; + } + + Plugin::ArrayElementProxy2_3 Plugin::ArrayElementProxy1_3::operator[](int32_t index) + { + return Plugin::ArrayElementProxy2_3(Plugin::InternalUse::Only, Handle, Index0, index); + } +} + +namespace Plugin +{ + ArrayElementProxy2_3::ArrayElementProxy2_3(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1) + { + Handle = handle; + Index0 = index0; + Index1 = index1; + } + + Plugin::ArrayElementProxy3_3 Plugin::ArrayElementProxy2_3::operator[](int32_t index) + { + return Plugin::ArrayElementProxy3_3(Plugin::InternalUse::Only, Handle, Index0, Index1, index); + } +} + +namespace Plugin +{ + ArrayElementProxy3_3::ArrayElementProxy3_3(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1, int32_t index2) + { + Handle = handle; + Index0 = index0; + Index1 = index1; + Index2 = index2; + } + + void ArrayElementProxy3_3::operator=(float item) + { + Plugin::SystemSingleArray3SetItem3(Handle, Index0, Index1, Index2, item); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6899,16 +8293,11 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } } - Object::operator double() + ArrayElementProxy3_3::operator float() { - double returnVal(Plugin::UnboxDouble(Handle)); + auto returnValue = Plugin::SystemSingleArray3GetItem3(Handle, Index0, Index1, Index2); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6916,106 +8305,103 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return returnVal; + return returnValue; } } -namespace MyGame +namespace System { - namespace MonoBehaviours + Array1::Array1(decltype(nullptr) n) + : Array1(Plugin::InternalUse::Only, 0) { - TestScript::TestScript(decltype(nullptr) n) - : TestScript(Plugin::InternalUse::Only, 0) - { - } - - TestScript::TestScript(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::MonoBehaviour(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - TestScript::TestScript(const TestScript& other) - : TestScript(Plugin::InternalUse::Only, other.Handle) - { - } - - TestScript::TestScript(TestScript&& other) - : TestScript(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - TestScript::~TestScript() + this->InternalLength = 0; + } + + Array1::Array1(Plugin::InternalUse iu, int32_t handle) + : System::Array(iu, handle) + { + if (handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } + Plugin::ReferenceManagedClass(handle); } - - TestScript& TestScript::operator=(const TestScript& other) + this->InternalLength = 0; + } + + Array1::Array1(const Array1& other) + : Array1(Plugin::InternalUse::Only, other.Handle) + { + InternalLength = other.InternalLength; + } + + Array1::Array1(Array1&& other) + : Array1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + InternalLength = other.InternalLength; + other.InternalLength = 0; + } + + Array1::~Array1() + { + if (Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - TestScript& TestScript::operator=(decltype(nullptr) other) + } + + Array1& Array1::operator=(const Array1& other) + { + if (this->Handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; + Plugin::DereferenceManagedClass(this->Handle); } - - TestScript& TestScript::operator=(TestScript&& other) + this->Handle = other.Handle; + if (this->Handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; + Plugin::ReferenceManagedClass(this->Handle); } - - bool TestScript::operator==(const TestScript& other) const + InternalLength = other.InternalLength; + return *this; + } + + Array1& Array1::operator=(decltype(nullptr) other) + { + if (Handle) { - return Handle == other.Handle; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - bool TestScript::operator!=(const TestScript& other) const + return *this; + } + + Array1& Array1::operator=(Array1&& other) + { + if (Handle) { - return Handle != other.Handle; + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + InternalLength = other.InternalLength; + other.Handle = 0; + other.InternalLength = 0; + return *this; } -} - -namespace Plugin -{ - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + + bool Array1::operator==(const Array1& other) const { - Handle = handle; - Index0 = index0; + return Handle == other.Handle; } - void ArrayElementProxy1_1::operator=(int32_t item) + bool Array1::operator!=(const Array1& other) const { - Plugin::SystemInt32Array1SetItem1(Handle, Index0, item); + return Handle != other.Handle; + } + + Array1::Array1(int32_t length0) + : System::Array(nullptr) + { + auto returnValue = Plugin::SystemSystemSingleArray1Constructor1(length0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7023,31 +8409,47 @@ namespace Plugin ex->ThrowReferenceToThis(); delete ex; } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + InternalLength = length0; + } } - ArrayElementProxy1_1::operator int32_t() + int32_t Array1::GetLength() { - auto returnValue = Plugin::SystemInt32Array1GetItem1(Handle, Index0); - if (Plugin::unhandledCsharpException) + int32_t returnVal = InternalLength; + if (returnVal == 0) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; + returnVal = Array::GetLength(); + InternalLength = returnVal; + }; + return returnVal; + } + + int32_t Array1::GetRank() + { + return 1; + } + + Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) + { + return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); } } namespace System { - Array1::Array1(decltype(nullptr) n) - : Array1(Plugin::InternalUse::Only, 0) + Array2::Array2(decltype(nullptr) n) + : Array2(Plugin::InternalUse::Only, 0) { this->InternalLength = 0; + this->InternalLengths[0] = 0; + this->InternalLengths[1] = 0; } - Array1::Array1(Plugin::InternalUse iu, int32_t handle) + Array2::Array2(Plugin::InternalUse iu, int32_t handle) : System::Array(iu, handle) { if (handle) @@ -7055,23 +8457,31 @@ namespace System Plugin::ReferenceManagedClass(handle); } this->InternalLength = 0; + this->InternalLengths[0] = 0; + this->InternalLengths[1] = 0; } - Array1::Array1(const Array1& other) - : Array1(Plugin::InternalUse::Only, other.Handle) + Array2::Array2(const Array2& other) + : Array2(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; } - Array1::Array1(Array1&& other) - : Array1(Plugin::InternalUse::Only, other.Handle) + Array2::Array2(Array2&& other) + : Array2(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; InternalLength = other.InternalLength; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; other.InternalLength = 0; + other.InternalLengths[0] = 0; + other.InternalLengths[1] = 0; } - Array1::~Array1() + Array2::~Array2() { if (Handle) { @@ -7080,7 +8490,7 @@ namespace System } } - Array1& Array1::operator=(const Array1& other) + Array2& Array2::operator=(const Array2& other) { if (this->Handle) { @@ -7092,10 +8502,12 @@ namespace System Plugin::ReferenceManagedClass(this->Handle); } InternalLength = other.InternalLength; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; return *this; } - Array1& Array1::operator=(decltype(nullptr) other) + Array2& Array2::operator=(decltype(nullptr) other) { if (Handle) { @@ -7105,7 +8517,7 @@ namespace System return *this; } - Array1& Array1::operator=(Array1&& other) + Array2& Array2::operator=(Array2&& other) { if (Handle) { @@ -7113,25 +8525,29 @@ namespace System } Handle = other.Handle; InternalLength = other.InternalLength; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; other.Handle = 0; other.InternalLength = 0; + other.InternalLengths[0] = 0; + other.InternalLengths[1] = 0; return *this; } - bool Array1::operator==(const Array1& other) const + bool Array2::operator==(const Array2& other) const { return Handle == other.Handle; } - bool Array1::operator!=(const Array1& other) const + bool Array2::operator!=(const Array2& other) const { return Handle != other.Handle; } - Array1::Array1(int32_t length0) + Array2::Array2(int32_t length0, int32_t length1) : System::Array(nullptr) { - auto returnValue = Plugin::SystemSystemInt32Array1Constructor1(length0); + auto returnValue = Plugin::SystemSystemSingleArray2Constructor2(length0, length1); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7143,11 +8559,13 @@ namespace System if (returnValue) { Plugin::ReferenceManagedClass(returnValue); - InternalLength = length0; + InternalLength = length0 * length1; + InternalLengths[0] = length0; + InternalLengths[1] = length1; } } - int32_t Array1::GetLength() + int32_t Array2::GetLength() { int32_t returnVal = InternalLength; if (returnVal == 0) @@ -7158,77 +8576,154 @@ namespace System return returnVal; } - int32_t Array1::GetRank() + int32_t Array2::GetLength(int32_t dimension) { - return 1; + assert(dimension >= 0 && dimension < 2); + int32_t length = InternalLengths[dimension]; + if (length) + { + return length; + } + auto returnValue = Plugin::SystemSystemSingleArray2GetLength2(Handle, dimension); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + InternalLengths[dimension] = returnValue; + return returnValue; } - Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) + int32_t Array2::GetRank() { - return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); + return 2; + } + + Plugin::ArrayElementProxy1_2 System::Array2::operator[](int32_t index) + { + return Plugin::ArrayElementProxy1_2(Plugin::InternalUse::Only, Handle, index); } } -namespace Plugin +namespace System { - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + Array3::Array3(decltype(nullptr) n) + : Array3(Plugin::InternalUse::Only, 0) { - Handle = handle; - Index0 = index0; + this->InternalLength = 0; + this->InternalLengths[0] = 0; + this->InternalLengths[1] = 0; + this->InternalLengths[2] = 0; } - void ArrayElementProxy1_1::operator=(float item) + Array3::Array3(Plugin::InternalUse iu, int32_t handle) + : System::Array(iu, handle) { - Plugin::SystemSingleArray1SetItem1(Handle, Index0, item); - if (Plugin::unhandledCsharpException) + if (handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(handle); } + this->InternalLength = 0; + this->InternalLengths[0] = 0; + this->InternalLengths[1] = 0; + this->InternalLengths[2] = 0; } - ArrayElementProxy1_1::operator float() + Array3::Array3(const Array3& other) + : Array3(Plugin::InternalUse::Only, other.Handle) { - auto returnValue = Plugin::SystemSingleArray1GetItem1(Handle, Index0); - if (Plugin::unhandledCsharpException) + InternalLength = other.InternalLength; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; + InternalLengths[2] = other.InternalLengths[2]; + } + + Array3::Array3(Array3&& other) + : Array3(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + InternalLength = other.InternalLength; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; + InternalLengths[2] = other.InternalLengths[2]; + other.InternalLength = 0; + other.InternalLengths[0] = 0; + other.InternalLengths[1] = 0; + other.InternalLengths[2] = 0; + } + + Array3::~Array3() + { + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - return returnValue; } -} - -namespace Plugin -{ - ArrayElementProxy1_2::ArrayElementProxy1_2(Plugin::InternalUse iu, int32_t handle, int32_t index0) + + Array3& Array3::operator=(const Array3& other) { - Handle = handle; - Index0 = index0; + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + InternalLength = other.InternalLength; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; + InternalLengths[2] = other.InternalLengths[2]; + return *this; } - Plugin::ArrayElementProxy2_2 Plugin::ArrayElementProxy1_2::operator[](int32_t index) + Array3& Array3::operator=(decltype(nullptr) other) { - return Plugin::ArrayElementProxy2_2(Plugin::InternalUse::Only, Handle, Index0, index); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } -} - -namespace Plugin -{ - ArrayElementProxy2_2::ArrayElementProxy2_2(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1) + + Array3& Array3::operator=(Array3&& other) { - Handle = handle; - Index0 = index0; - Index1 = index1; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + InternalLength = other.InternalLength; + InternalLengths[0] = other.InternalLengths[0]; + InternalLengths[1] = other.InternalLengths[1]; + InternalLengths[2] = other.InternalLengths[2]; + other.Handle = 0; + other.InternalLength = 0; + other.InternalLengths[0] = 0; + other.InternalLengths[1] = 0; + other.InternalLengths[2] = 0; + return *this; } - void ArrayElementProxy2_2::operator=(float item) + bool Array3::operator==(const Array3& other) const { - Plugin::SystemSingleArray2SetItem2(Handle, Index0, Index1, item); + return Handle == other.Handle; + } + + bool Array3::operator!=(const Array3& other) const + { + return Handle != other.Handle; + } + + Array3::Array3(int32_t length0, int32_t length1, int32_t length2) + : System::Array(nullptr) + { + auto returnValue = Plugin::SystemSystemSingleArray3Constructor3(length0, length1, length2); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7236,64 +8731,70 @@ namespace Plugin ex->ThrowReferenceToThis(); delete ex; } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + InternalLength = length0 * length1 * length2; + InternalLengths[0] = length0; + InternalLengths[1] = length1; + InternalLengths[2] = length2; + } } - ArrayElementProxy2_2::operator float() + int32_t Array3::GetLength() { - auto returnValue = Plugin::SystemSingleArray2GetItem2(Handle, Index0, Index1); - if (Plugin::unhandledCsharpException) + int32_t returnVal = InternalLength; + if (returnVal == 0) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; + returnVal = Array::GetLength(); + InternalLength = returnVal; + }; + return returnVal; } -} - -namespace Plugin -{ - ArrayElementProxy1_3::ArrayElementProxy1_3(Plugin::InternalUse iu, int32_t handle, int32_t index0) + + int32_t Array3::GetLength(int32_t dimension) { - Handle = handle; - Index0 = index0; + assert(dimension >= 0 && dimension < 3); + int32_t length = InternalLengths[dimension]; + if (length) + { + return length; + } + auto returnValue = Plugin::SystemSystemSingleArray3GetLength3(Handle, dimension); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + InternalLengths[dimension] = returnValue; + return returnValue; } - Plugin::ArrayElementProxy2_3 Plugin::ArrayElementProxy1_3::operator[](int32_t index) - { - return Plugin::ArrayElementProxy2_3(Plugin::InternalUse::Only, Handle, Index0, index); - } -} - -namespace Plugin -{ - ArrayElementProxy2_3::ArrayElementProxy2_3(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1) + int32_t Array3::GetRank() { - Handle = handle; - Index0 = index0; - Index1 = index1; + return 3; } - Plugin::ArrayElementProxy3_3 Plugin::ArrayElementProxy2_3::operator[](int32_t index) + Plugin::ArrayElementProxy1_3 System::Array3::operator[](int32_t index) { - return Plugin::ArrayElementProxy3_3(Plugin::InternalUse::Only, Handle, Index0, Index1, index); + return Plugin::ArrayElementProxy1_3(Plugin::InternalUse::Only, Handle, index); } } namespace Plugin { - ArrayElementProxy3_3::ArrayElementProxy3_3(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1, int32_t index2) + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) { Handle = handle; Index0 = index0; - Index1 = index1; - Index2 = index2; } - void ArrayElementProxy3_3::operator=(float item) + void ArrayElementProxy1_1::operator=(System::String item) { - Plugin::SystemSingleArray3SetItem3(Handle, Index0, Index1, Index2, item); + Plugin::SystemStringArray1SetItem1(Handle, Index0, item.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7303,9 +8804,9 @@ namespace Plugin } } - ArrayElementProxy3_3::operator float() + ArrayElementProxy1_1::operator System::String() { - auto returnValue = Plugin::SystemSingleArray3GetItem3(Handle, Index0, Index1, Index2); + auto returnValue = Plugin::SystemStringArray1GetItem1(Handle, Index0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7313,19 +8814,19 @@ namespace Plugin ex->ThrowReferenceToThis(); delete ex; } - return returnValue; + return System::String(Plugin::InternalUse::Only, returnValue); } } namespace System { - Array1::Array1(decltype(nullptr) n) + Array1::Array1(decltype(nullptr) n) : Array1(Plugin::InternalUse::Only, 0) { this->InternalLength = 0; } - Array1::Array1(Plugin::InternalUse iu, int32_t handle) + Array1::Array1(Plugin::InternalUse iu, int32_t handle) : System::Array(iu, handle) { if (handle) @@ -7335,13 +8836,13 @@ namespace System this->InternalLength = 0; } - Array1::Array1(const Array1& other) + Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; } - Array1::Array1(Array1&& other) + Array1::Array1(Array1&& other) : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; @@ -7349,7 +8850,7 @@ namespace System other.InternalLength = 0; } - Array1::~Array1() + Array1::~Array1() { if (Handle) { @@ -7358,7 +8859,7 @@ namespace System } } - Array1& Array1::operator=(const Array1& other) + Array1& Array1::operator=(const Array1& other) { if (this->Handle) { @@ -7373,7 +8874,7 @@ namespace System return *this; } - Array1& Array1::operator=(decltype(nullptr) other) + Array1& Array1::operator=(decltype(nullptr) other) { if (Handle) { @@ -7383,7 +8884,7 @@ namespace System return *this; } - Array1& Array1::operator=(Array1&& other) + Array1& Array1::operator=(Array1&& other) { if (Handle) { @@ -7396,20 +8897,20 @@ namespace System return *this; } - bool Array1::operator==(const Array1& other) const + bool Array1::operator==(const Array1& other) const { return Handle == other.Handle; } - bool Array1::operator!=(const Array1& other) const + bool Array1::operator!=(const Array1& other) const { return Handle != other.Handle; } - Array1::Array1(int32_t length0) + Array1::Array1(int32_t length0) : System::Array(nullptr) { - auto returnValue = Plugin::SystemSystemSingleArray1Constructor1(length0); + auto returnValue = Plugin::SystemSystemStringArray1Constructor1(length0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7425,7 +8926,7 @@ namespace System } } - int32_t Array1::GetLength() + int32_t Array1::GetLength() { int32_t returnVal = InternalLength; if (returnVal == 0) @@ -7436,28 +8937,60 @@ namespace System return returnVal; } - int32_t Array1::GetRank() + int32_t Array1::GetRank() { return 1; } - Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) + Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) { - return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); + return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); + } +} + +namespace Plugin +{ + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + { + Handle = handle; + Index0 = index0; + } + + void ArrayElementProxy1_1::operator=(UnityEngine::Resolution item) + { + Plugin::UnityEngineResolutionArray1SetItem1(Handle, Index0, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + ArrayElementProxy1_1::operator UnityEngine::Resolution() + { + auto returnValue = Plugin::UnityEngineResolutionArray1GetItem1(Handle, Index0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; } } namespace System { - Array2::Array2(decltype(nullptr) n) - : Array2(Plugin::InternalUse::Only, 0) + Array1::Array1(decltype(nullptr) n) + : Array1(Plugin::InternalUse::Only, 0) { this->InternalLength = 0; - this->InternalLengths[0] = 0; - this->InternalLengths[1] = 0; } - Array2::Array2(Plugin::InternalUse iu, int32_t handle) + Array1::Array1(Plugin::InternalUse iu, int32_t handle) : System::Array(iu, handle) { if (handle) @@ -7465,31 +8998,23 @@ namespace System Plugin::ReferenceManagedClass(handle); } this->InternalLength = 0; - this->InternalLengths[0] = 0; - this->InternalLengths[1] = 0; } - Array2::Array2(const Array2& other) - : Array2(Plugin::InternalUse::Only, other.Handle) + Array1::Array1(const Array1& other) + : Array1(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; } - Array2::Array2(Array2&& other) - : Array2(Plugin::InternalUse::Only, other.Handle) + Array1::Array1(Array1&& other) + : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; other.InternalLength = 0; - other.InternalLengths[0] = 0; - other.InternalLengths[1] = 0; } - Array2::~Array2() + Array1::~Array1() { if (Handle) { @@ -7498,7 +9023,7 @@ namespace System } } - Array2& Array2::operator=(const Array2& other) + Array1& Array1::operator=(const Array1& other) { if (this->Handle) { @@ -7510,12 +9035,10 @@ namespace System Plugin::ReferenceManagedClass(this->Handle); } InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; return *this; } - Array2& Array2::operator=(decltype(nullptr) other) + Array1& Array1::operator=(decltype(nullptr) other) { if (Handle) { @@ -7525,7 +9048,7 @@ namespace System return *this; } - Array2& Array2::operator=(Array2&& other) + Array1& Array1::operator=(Array1&& other) { if (Handle) { @@ -7533,29 +9056,25 @@ namespace System } Handle = other.Handle; InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; other.Handle = 0; other.InternalLength = 0; - other.InternalLengths[0] = 0; - other.InternalLengths[1] = 0; return *this; } - bool Array2::operator==(const Array2& other) const + bool Array1::operator==(const Array1& other) const { return Handle == other.Handle; } - bool Array2::operator!=(const Array2& other) const + bool Array1::operator!=(const Array1& other) const { return Handle != other.Handle; } - Array2::Array2(int32_t length0, int32_t length1) + Array1::Array1(int32_t length0) : System::Array(nullptr) { - auto returnValue = Plugin::SystemSystemSingleArray2Constructor2(length0, length1); + auto returnValue = Plugin::UnityEngineUnityEngineResolutionArray1Constructor1(length0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7567,13 +9086,11 @@ namespace System if (returnValue) { Plugin::ReferenceManagedClass(returnValue); - InternalLength = length0 * length1; - InternalLengths[0] = length0; - InternalLengths[1] = length1; + InternalLength = length0; } } - int32_t Array2::GetLength() + int32_t Array1::GetLength() { int32_t returnVal = InternalLength; if (returnVal == 0) @@ -7584,15 +9101,28 @@ namespace System return returnVal; } - int32_t Array2::GetLength(int32_t dimension) + int32_t Array1::GetRank() { - assert(dimension >= 0 && dimension < 2); - int32_t length = InternalLengths[dimension]; - if (length) - { - return length; - } - auto returnValue = Plugin::SystemSystemSingleArray2GetLength2(Handle, dimension); + return 1; + } + + Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) + { + return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); + } +} + +namespace Plugin +{ + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + { + Handle = handle; + Index0 = index0; + } + + void ArrayElementProxy1_1::operator=(UnityEngine::RaycastHit item) + { + Plugin::UnityEngineRaycastHitArray1SetItem1(Handle, Index0, item.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7600,33 +9130,31 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - InternalLengths[dimension] = returnValue; - return returnValue; - } - - int32_t Array2::GetRank() - { - return 2; } - Plugin::ArrayElementProxy1_2 System::Array2::operator[](int32_t index) + ArrayElementProxy1_1::operator UnityEngine::RaycastHit() { - return Plugin::ArrayElementProxy1_2(Plugin::InternalUse::Only, Handle, index); + auto returnValue = Plugin::UnityEngineRaycastHitArray1GetItem1(Handle, Index0); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::RaycastHit(Plugin::InternalUse::Only, returnValue); } } namespace System { - Array3::Array3(decltype(nullptr) n) - : Array3(Plugin::InternalUse::Only, 0) + Array1::Array1(decltype(nullptr) n) + : Array1(Plugin::InternalUse::Only, 0) { this->InternalLength = 0; - this->InternalLengths[0] = 0; - this->InternalLengths[1] = 0; - this->InternalLengths[2] = 0; } - Array3::Array3(Plugin::InternalUse iu, int32_t handle) + Array1::Array1(Plugin::InternalUse iu, int32_t handle) : System::Array(iu, handle) { if (handle) @@ -7634,35 +9162,23 @@ namespace System Plugin::ReferenceManagedClass(handle); } this->InternalLength = 0; - this->InternalLengths[0] = 0; - this->InternalLengths[1] = 0; - this->InternalLengths[2] = 0; } - Array3::Array3(const Array3& other) - : Array3(Plugin::InternalUse::Only, other.Handle) + Array1::Array1(const Array1& other) + : Array1(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; - InternalLengths[2] = other.InternalLengths[2]; } - Array3::Array3(Array3&& other) - : Array3(Plugin::InternalUse::Only, other.Handle) + Array1::Array1(Array1&& other) + : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; - InternalLengths[2] = other.InternalLengths[2]; other.InternalLength = 0; - other.InternalLengths[0] = 0; - other.InternalLengths[1] = 0; - other.InternalLengths[2] = 0; } - Array3::~Array3() + Array1::~Array1() { if (Handle) { @@ -7671,7 +9187,7 @@ namespace System } } - Array3& Array3::operator=(const Array3& other) + Array1& Array1::operator=(const Array1& other) { if (this->Handle) { @@ -7683,13 +9199,10 @@ namespace System Plugin::ReferenceManagedClass(this->Handle); } InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; - InternalLengths[2] = other.InternalLengths[2]; return *this; } - Array3& Array3::operator=(decltype(nullptr) other) + Array1& Array1::operator=(decltype(nullptr) other) { if (Handle) { @@ -7699,7 +9212,7 @@ namespace System return *this; } - Array3& Array3::operator=(Array3&& other) + Array1& Array1::operator=(Array1&& other) { if (Handle) { @@ -7707,31 +9220,25 @@ namespace System } Handle = other.Handle; InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; - InternalLengths[2] = other.InternalLengths[2]; other.Handle = 0; other.InternalLength = 0; - other.InternalLengths[0] = 0; - other.InternalLengths[1] = 0; - other.InternalLengths[2] = 0; return *this; } - bool Array3::operator==(const Array3& other) const + bool Array1::operator==(const Array1& other) const { return Handle == other.Handle; } - bool Array3::operator!=(const Array3& other) const + bool Array1::operator!=(const Array1& other) const { return Handle != other.Handle; } - Array3::Array3(int32_t length0, int32_t length1, int32_t length2) + Array1::Array1(int32_t length0) : System::Array(nullptr) { - auto returnValue = Plugin::SystemSystemSingleArray3Constructor3(length0, length1, length2); + auto returnValue = Plugin::UnityEngineUnityEngineRaycastHitArray1Constructor1(length0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7743,14 +9250,11 @@ namespace System if (returnValue) { Plugin::ReferenceManagedClass(returnValue); - InternalLength = length0 * length1 * length2; - InternalLengths[0] = length0; - InternalLengths[1] = length1; - InternalLengths[2] = length2; + InternalLength = length0; } } - int32_t Array3::GetLength() + int32_t Array1::GetLength() { int32_t returnVal = InternalLength; if (returnVal == 0) @@ -7761,48 +9265,28 @@ namespace System return returnVal; } - int32_t Array3::GetLength(int32_t dimension) - { - assert(dimension >= 0 && dimension < 3); - int32_t length = InternalLengths[dimension]; - if (length) - { - return length; - } - auto returnValue = Plugin::SystemSystemSingleArray3GetLength3(Handle, dimension); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - InternalLengths[dimension] = returnValue; - return returnValue; - } - - int32_t Array3::GetRank() + int32_t Array1::GetRank() { - return 3; + return 1; } - Plugin::ArrayElementProxy1_3 System::Array3::operator[](int32_t index) + Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) { - return Plugin::ArrayElementProxy1_3(Plugin::InternalUse::Only, Handle, index); + return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); } } namespace Plugin { - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) { Handle = handle; Index0 = index0; } - void ArrayElementProxy1_1::operator=(System::String item) + void ArrayElementProxy1_1::operator=(UnityEngine::GradientColorKey item) { - Plugin::SystemStringArray1SetItem1(Handle, Index0, item.Handle); + Plugin::UnityEngineGradientColorKeyArray1SetItem1(Handle, Index0, item); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7812,9 +9296,9 @@ namespace Plugin } } - ArrayElementProxy1_1::operator System::String() + ArrayElementProxy1_1::operator UnityEngine::GradientColorKey() { - auto returnValue = Plugin::SystemStringArray1GetItem1(Handle, Index0); + auto returnValue = Plugin::UnityEngineGradientColorKeyArray1GetItem1(Handle, Index0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7822,19 +9306,19 @@ namespace Plugin ex->ThrowReferenceToThis(); delete ex; } - return System::String(Plugin::InternalUse::Only, returnValue); + return returnValue; } } namespace System { - Array1::Array1(decltype(nullptr) n) + Array1::Array1(decltype(nullptr) n) : Array1(Plugin::InternalUse::Only, 0) { this->InternalLength = 0; } - Array1::Array1(Plugin::InternalUse iu, int32_t handle) + Array1::Array1(Plugin::InternalUse iu, int32_t handle) : System::Array(iu, handle) { if (handle) @@ -7844,13 +9328,13 @@ namespace System this->InternalLength = 0; } - Array1::Array1(const Array1& other) + Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; } - Array1::Array1(Array1&& other) + Array1::Array1(Array1&& other) : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; @@ -7858,7 +9342,7 @@ namespace System other.InternalLength = 0; } - Array1::~Array1() + Array1::~Array1() { if (Handle) { @@ -7867,7 +9351,7 @@ namespace System } } - Array1& Array1::operator=(const Array1& other) + Array1& Array1::operator=(const Array1& other) { if (this->Handle) { @@ -7882,7 +9366,7 @@ namespace System return *this; } - Array1& Array1::operator=(decltype(nullptr) other) + Array1& Array1::operator=(decltype(nullptr) other) { if (Handle) { @@ -7892,7 +9376,7 @@ namespace System return *this; } - Array1& Array1::operator=(Array1&& other) + Array1& Array1::operator=(Array1&& other) { if (Handle) { @@ -7905,20 +9389,20 @@ namespace System return *this; } - bool Array1::operator==(const Array1& other) const + bool Array1::operator==(const Array1& other) const { return Handle == other.Handle; } - bool Array1::operator!=(const Array1& other) const + bool Array1::operator!=(const Array1& other) const { return Handle != other.Handle; } - Array1::Array1(int32_t length0) + Array1::Array1(int32_t length0) : System::Array(nullptr) { - auto returnValue = Plugin::SystemSystemStringArray1Constructor1(length0); + auto returnValue = Plugin::UnityEngineUnityEngineGradientColorKeyArray1Constructor1(length0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7934,7 +9418,7 @@ namespace System } } - int32_t Array1::GetLength() + int32_t Array1::GetLength() { int32_t returnVal = InternalLength; if (returnVal == 0) @@ -7945,40 +9429,34 @@ namespace System return returnVal; } - int32_t Array1::GetRank() + int32_t Array1::GetRank() { return 1; } - Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) + Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) { - return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); + return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); } } -namespace Plugin +namespace System { - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) - { - Handle = handle; - Index0 = index0; - } - - void ArrayElementProxy1_1::operator=(UnityEngine::Resolution item) + Action::Action() + : System::Object(nullptr) { - Plugin::UnityEngineResolutionArray1SetItem1(Handle, Index0, item); - if (Plugin::unhandledCsharpException) + CppHandle = Plugin::StoreSystemAction(this); + Plugin::SystemActionConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemAction(CppHandle); + ClassHandle = 0; + CppHandle = 0; } - } - - ArrayElementProxy1_1::operator UnityEngine::Resolution() - { - auto returnValue = Plugin::UnityEngineResolutionArray1GetItem1(Handle, Index0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7986,52 +9464,72 @@ namespace Plugin ex->ThrowReferenceToThis(); delete ex; } - return returnValue; } -} - -namespace System -{ - Array1::Array1(decltype(nullptr) n) - : Array1(Plugin::InternalUse::Only, 0) + + Action::Action(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) { - this->InternalLength = 0; + CppHandle = Plugin::StoreSystemAction(this); + ClassHandle = 0; } - Array1::Array1(Plugin::InternalUse iu, int32_t handle) - : System::Array(iu, handle) + Action::Action(const Action& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - if (handle) + CppHandle = Plugin::StoreSystemAction(this); + if (Handle) { - Plugin::ReferenceManagedClass(handle); + Plugin::ReferenceManagedClass(Handle); } - this->InternalLength = 0; + ClassHandle = other.ClassHandle; } - Array1::Array1(const Array1& other) - : Array1(Plugin::InternalUse::Only, other.Handle) + Action::Action(Action&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - InternalLength = other.InternalLength; + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; + other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; } - Array1::Array1(Array1&& other) - : Array1(Plugin::InternalUse::Only, other.Handle) + Action::Action(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { - other.Handle = 0; - InternalLength = other.InternalLength; - other.InternalLength = 0; + CppHandle = Plugin::StoreSystemAction(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = 0; } - Array1::~Array1() + Action::~Action() { + Plugin::RemoveSystemAction(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemAction(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } } - Array1& Array1::operator=(const Array1& other) + Action& Action::operator=(const Action& other) { if (this->Handle) { @@ -8042,95 +9540,123 @@ namespace System { Plugin::ReferenceManagedClass(this->Handle); } - InternalLength = other.InternalLength; + ClassHandle = other.ClassHandle; return *this; } - Array1& Array1::operator=(decltype(nullptr) other) + Action& Action::operator=(decltype(nullptr) other) { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemAction(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = 0; + Handle = 0; return *this; } - Array1& Array1::operator=(Array1&& other) + Action& Action::operator=(Action&& other) { + Plugin::RemoveSystemAction(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemAction(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; Handle = other.Handle; - InternalLength = other.InternalLength; other.Handle = 0; - other.InternalLength = 0; return *this; } - bool Array1::operator==(const Array1& other) const + bool Action::operator==(const Action& other) const { return Handle == other.Handle; } - bool Array1::operator!=(const Array1& other) const + bool Action::operator!=(const Action& other) const { return Handle != other.Handle; } - Array1::Array1(int32_t length0) - : System::Array(nullptr) + void Action::operator+=(System::Action& del) { - auto returnValue = Plugin::UnityEngineUnityEngineResolutionArray1Constructor1(length0); + Plugin::SystemActionAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - InternalLength = length0; - } - } - - int32_t Array1::GetLength() - { - int32_t returnVal = InternalLength; - if (returnVal == 0) - { - returnVal = Array::GetLength(); - InternalLength = returnVal; - }; - return returnVal; + ex->ThrowReferenceToThis(); + delete ex; + } } - int32_t Array1::GetRank() + void Action::operator-=(System::Action& del) { - return 1; + Plugin::SystemActionRemove(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) + void Action::operator()() { - return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); } -} - -namespace Plugin -{ - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + + DLLEXPORT void SystemActionNativeInvoke(int32_t cppHandle) { - Handle = handle; - Index0 = index0; + try + { + Plugin::GetSystemAction(cppHandle)->operator()(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Action"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } } - void ArrayElementProxy1_1::operator=(UnityEngine::RaycastHit item) + void Action::Invoke() { - Plugin::UnityEngineRaycastHitArray1SetItem1(Handle, Index0, item.Handle); + Plugin::SystemActionInvoke(Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8139,10 +9665,25 @@ namespace Plugin delete ex; } } - - ArrayElementProxy1_1::operator UnityEngine::RaycastHit() +} + +namespace System +{ + Action1::Action1() + : System::Object(nullptr) { - auto returnValue = Plugin::UnityEngineRaycastHitArray1GetItem1(Handle, Index0); + CppHandle = Plugin::StoreSystemActionSystemSingle(this); + Plugin::SystemActionSystemSingleConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemActionSystemSingle(CppHandle); + ClassHandle = 0; + CppHandle = 0; + } if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8150,52 +9691,72 @@ namespace Plugin ex->ThrowReferenceToThis(); delete ex; } - return UnityEngine::RaycastHit(Plugin::InternalUse::Only, returnValue); } -} - -namespace System -{ - Array1::Array1(decltype(nullptr) n) - : Array1(Plugin::InternalUse::Only, 0) + + Action1::Action1(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) { - this->InternalLength = 0; + CppHandle = Plugin::StoreSystemActionSystemSingle(this); + ClassHandle = 0; } - Array1::Array1(Plugin::InternalUse iu, int32_t handle) - : System::Array(iu, handle) + Action1::Action1(const Action1& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - if (handle) + CppHandle = Plugin::StoreSystemActionSystemSingle(this); + if (Handle) { - Plugin::ReferenceManagedClass(handle); + Plugin::ReferenceManagedClass(Handle); } - this->InternalLength = 0; + ClassHandle = other.ClassHandle; } - Array1::Array1(const Array1& other) - : Array1(Plugin::InternalUse::Only, other.Handle) + Action1::Action1(Action1&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - InternalLength = other.InternalLength; + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; + other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; } - Array1::Array1(Array1&& other) - : Array1(Plugin::InternalUse::Only, other.Handle) + Action1::Action1(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { - other.Handle = 0; - InternalLength = other.InternalLength; - other.InternalLength = 0; + CppHandle = Plugin::StoreSystemActionSystemSingle(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = 0; } - Array1::~Array1() + Action1::~Action1() { + Plugin::RemoveSystemActionSystemSingle(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemActionSystemSingle(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } } - Array1& Array1::operator=(const Array1& other) + Action1& Action1::operator=(const Action1& other) { if (this->Handle) { @@ -8206,47 +9767,77 @@ namespace System { Plugin::ReferenceManagedClass(this->Handle); } - InternalLength = other.InternalLength; + ClassHandle = other.ClassHandle; return *this; } - Array1& Array1::operator=(decltype(nullptr) other) + Action1& Action1::operator=(decltype(nullptr) other) { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemActionSystemSingle(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = 0; + Handle = 0; return *this; } - Array1& Array1::operator=(Array1&& other) + Action1& Action1::operator=(Action1&& other) { + Plugin::RemoveSystemActionSystemSingle(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemActionSystemSingle(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; Handle = other.Handle; - InternalLength = other.InternalLength; other.Handle = 0; - other.InternalLength = 0; return *this; } - bool Array1::operator==(const Array1& other) const + bool Action1::operator==(const Action1& other) const { return Handle == other.Handle; } - bool Array1::operator!=(const Array1& other) const + bool Action1::operator!=(const Action1& other) const { return Handle != other.Handle; } - Array1::Array1(int32_t length0) - : System::Array(nullptr) + void Action1::operator+=(System::Action1& del) { - auto returnValue = Plugin::UnityEngineUnityEngineRaycastHitArray1Constructor1(length0); + Plugin::SystemActionSystemSingleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8254,59 +9845,72 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - Handle = returnValue; - if (returnValue) + } + + void Action1::operator-=(System::Action1& del) + { + Plugin::SystemActionSystemSingleRemove(Handle, del.Handle); + if (Plugin::unhandledCsharpException) { - Plugin::ReferenceManagedClass(returnValue); - InternalLength = length0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } } - int32_t Array1::GetLength() + void Action1::operator()(float obj) { - int32_t returnVal = InternalLength; - if (returnVal == 0) - { - returnVal = Array::GetLength(); - InternalLength = returnVal; - }; - return returnVal; } - int32_t Array1::GetRank() + DLLEXPORT void SystemActionSystemSingleNativeInvoke(int32_t cppHandle, float obj) { - return 1; + try + { + Plugin::GetSystemActionSystemSingle(cppHandle)->operator()(obj); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Action1"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } } - Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) + void Action1::Invoke(float obj) { - return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); + Plugin::SystemActionSystemSingleInvoke(Handle, obj); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } -namespace Plugin +namespace System { - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) - { - Handle = handle; - Index0 = index0; - } - - void ArrayElementProxy1_1::operator=(UnityEngine::GradientColorKey item) + Action2::Action2() + : System::Object(nullptr) { - Plugin::UnityEngineGradientColorKeyArray1SetItem1(Handle, Index0, item); - if (Plugin::unhandledCsharpException) + CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); + Plugin::SystemActionSystemSingle_SystemSingleConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); + ClassHandle = 0; + CppHandle = 0; } - } - - ArrayElementProxy1_1::operator UnityEngine::GradientColorKey() - { - auto returnValue = Plugin::UnityEngineGradientColorKeyArray1GetItem1(Handle, Index0); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8314,52 +9918,72 @@ namespace Plugin ex->ThrowReferenceToThis(); delete ex; } - return returnValue; } -} - -namespace System -{ - Array1::Array1(decltype(nullptr) n) - : Array1(Plugin::InternalUse::Only, 0) + + Action2::Action2(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) { - this->InternalLength = 0; + CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); + ClassHandle = 0; } - Array1::Array1(Plugin::InternalUse iu, int32_t handle) - : System::Array(iu, handle) + Action2::Action2(const Action2& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - if (handle) + CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); + if (Handle) { - Plugin::ReferenceManagedClass(handle); + Plugin::ReferenceManagedClass(Handle); } - this->InternalLength = 0; + ClassHandle = other.ClassHandle; } - Array1::Array1(const Array1& other) - : Array1(Plugin::InternalUse::Only, other.Handle) + Action2::Action2(Action2&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - InternalLength = other.InternalLength; + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; + other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; } - Array1::Array1(Array1&& other) - : Array1(Plugin::InternalUse::Only, other.Handle) + Action2::Action2(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { - other.Handle = 0; - InternalLength = other.InternalLength; - other.InternalLength = 0; + CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = 0; } - Array1::~Array1() + Action2::~Action2() { + Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemActionSystemSingle_SystemSingle(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } } - Array1& Array1::operator=(const Array1& other) + Action2& Action2::operator=(const Action2& other) { if (this->Handle) { @@ -8370,47 +9994,77 @@ namespace System { Plugin::ReferenceManagedClass(this->Handle); } - InternalLength = other.InternalLength; + ClassHandle = other.ClassHandle; return *this; } - Array1& Array1::operator=(decltype(nullptr) other) + Action2& Action2::operator=(decltype(nullptr) other) { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemActionSystemSingle_SystemSingle(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = 0; + Handle = 0; return *this; } - Array1& Array1::operator=(Array1&& other) + Action2& Action2::operator=(Action2&& other) { + Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::DereferenceManagedClass(Handle); + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemActionSystemSingle_SystemSingle(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; Handle = other.Handle; - InternalLength = other.InternalLength; other.Handle = 0; - other.InternalLength = 0; return *this; } - bool Array1::operator==(const Array1& other) const + bool Action2::operator==(const Action2& other) const { return Handle == other.Handle; } - bool Array1::operator!=(const Array1& other) const + bool Action2::operator!=(const Action2& other) const { return Handle != other.Handle; } - Array1::Array1(int32_t length0) - : System::Array(nullptr) + void Action2::operator+=(System::Action2& del) { - auto returnValue = Plugin::UnityEngineUnityEngineGradientColorKeyArray1Constructor1(length0); + Plugin::SystemActionSystemSingle_SystemSingleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8418,50 +10072,69 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - Handle = returnValue; - if (returnValue) + } + + void Action2::operator-=(System::Action2& del) + { + Plugin::SystemActionSystemSingle_SystemSingleRemove(Handle, del.Handle); + if (Plugin::unhandledCsharpException) { - Plugin::ReferenceManagedClass(returnValue); - InternalLength = length0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } } - int32_t Array1::GetLength() + void Action2::operator()(float arg1, float arg2) { - int32_t returnVal = InternalLength; - if (returnVal == 0) - { - returnVal = Array::GetLength(); - InternalLength = returnVal; - }; - return returnVal; } - int32_t Array1::GetRank() + DLLEXPORT void SystemActionSystemSingle_SystemSingleNativeInvoke(int32_t cppHandle, float arg1, float arg2) { - return 1; + try + { + Plugin::GetSystemActionSystemSingle_SystemSingle(cppHandle)->operator()(arg1, arg2); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Action2"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } } - Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) + void Action2::Invoke(float arg1, float arg2) { - return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); + Plugin::SystemActionSystemSingle_SystemSingleInvoke(Handle, arg1, arg2); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } namespace System { - Action::Action() + Func3::Func3() : System::Object(nullptr) { - CppHandle = Plugin::StoreSystemAction(this); - Plugin::SystemActionConstructor(CppHandle, &Handle, &ClassHandle); + CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(CppHandle, &Handle, &ClassHandle); if (Handle) { Plugin::ReferenceManagedClass(Handle); } else { - Plugin::RemoveSystemAction(CppHandle); + Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); ClassHandle = 0; CppHandle = 0; } @@ -8474,17 +10147,17 @@ namespace System } } - Action::Action(decltype(nullptr) n) + Func3::Func3(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { - CppHandle = Plugin::StoreSystemAction(this); + CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); ClassHandle = 0; } - Action::Action(const Action& other) + Func3::Func3(const Func3& other) : System::Object(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemAction(this); + CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -8492,7 +10165,7 @@ namespace System ClassHandle = other.ClassHandle; } - Action::Action(Action&& other) + Func3::Func3(Func3&& other) : System::Object(Plugin::InternalUse::Only, other.Handle) { CppHandle = other.CppHandle; @@ -8502,10 +10175,10 @@ namespace System other.ClassHandle = 0; } - Action::Action(Plugin::InternalUse iu, int32_t handle) + Func3::Func3(Plugin::InternalUse iu, int32_t handle) : System::Object(iu, handle) { - CppHandle = Plugin::StoreSystemAction(this); + CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -8513,9 +10186,9 @@ namespace System ClassHandle = 0; } - Action::~Action() + Func3::~Func3() { - Plugin::RemoveSystemAction(CppHandle); + Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); CppHandle = 0; if (Handle) { @@ -8525,7 +10198,7 @@ namespace System ClassHandle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemAction(handle, classHandle); + Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(handle, classHandle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8537,7 +10210,7 @@ namespace System } } - Action& Action::operator=(const Action& other) + Func3& Func3::operator=(const Func3& other) { if (this->Handle) { @@ -8552,7 +10225,7 @@ namespace System return *this; } - Action& Action::operator=(decltype(nullptr) other) + Func3& Func3::operator=(decltype(nullptr) other) { if (Handle) { @@ -8562,7 +10235,7 @@ namespace System ClassHandle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemAction(handle, classHandle); + Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(handle, classHandle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8577,9 +10250,9 @@ namespace System return *this; } - Action& Action::operator=(Action&& other) + Func3& Func3::operator=(Func3&& other) { - Plugin::RemoveSystemAction(CppHandle); + Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); CppHandle = 0; if (Handle) { @@ -8589,7 +10262,7 @@ namespace System ClassHandle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemAction(handle, classHandle); + Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(handle, classHandle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8606,19 +10279,19 @@ namespace System return *this; } - bool Action::operator==(const Action& other) const + bool Func3::operator==(const Func3& other) const { return Handle == other.Handle; } - bool Action::operator!=(const Action& other) const + bool Func3::operator!=(const Func3& other) const { return Handle != other.Handle; } - void Action::operator+=(System::Action& del) + void Func3::operator+=(System::Func3& del) { - Plugin::SystemActionAdd(Handle, del.Handle); + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8628,9 +10301,9 @@ namespace System } } - void Action::operator-=(System::Action& del) + void Func3::operator-=(System::Func3& del) { - Plugin::SystemActionRemove(Handle, del.Handle); + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8640,31 +10313,34 @@ namespace System } } - void Action::operator()() + double Func3::operator()(int32_t arg1, float arg2) { + return {}; } - DLLEXPORT void SystemActionNativeInvoke(int32_t cppHandle) + DLLEXPORT double SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke(int32_t cppHandle, int32_t arg1, float arg2) { try { - Plugin::GetSystemAction(cppHandle)->operator()(); + return Plugin::GetSystemFuncSystemInt32_SystemSingle_SystemDouble(cppHandle)->operator()(arg1, arg2); } catch (System::Exception ex) { Plugin::SetException(ex.Handle); + return {}; } catch (...) { - System::String msg = "Unhandled exception invoking System::Action"; + System::String msg = "Unhandled exception invoking System::Func3"; System::Exception ex(msg); Plugin::SetException(ex.Handle); + return {}; } } - void Action::Invoke() + double Func3::Invoke(int32_t arg1, float arg2) { - Plugin::SystemActionInvoke(Handle); + auto returnValue = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(Handle, arg1, arg2); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8672,23 +10348,24 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } + return returnValue; } } namespace System { - Action1::Action1() + Func3::Func3() : System::Object(nullptr) { - CppHandle = Plugin::StoreSystemActionSystemSingle(this); - Plugin::SystemActionSystemSingleConstructor(CppHandle, &Handle, &ClassHandle); + CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(CppHandle, &Handle, &ClassHandle); if (Handle) { Plugin::ReferenceManagedClass(Handle); } else { - Plugin::RemoveSystemActionSystemSingle(CppHandle); + Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); ClassHandle = 0; CppHandle = 0; } @@ -8701,17 +10378,17 @@ namespace System } } - Action1::Action1(decltype(nullptr) n) + Func3::Func3(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { - CppHandle = Plugin::StoreSystemActionSystemSingle(this); + CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); ClassHandle = 0; } - Action1::Action1(const Action1& other) + Func3::Func3(const Func3& other) : System::Object(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemActionSystemSingle(this); + CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -8719,7 +10396,7 @@ namespace System ClassHandle = other.ClassHandle; } - Action1::Action1(Action1&& other) + Func3::Func3(Func3&& other) : System::Object(Plugin::InternalUse::Only, other.Handle) { CppHandle = other.CppHandle; @@ -8729,10 +10406,10 @@ namespace System other.ClassHandle = 0; } - Action1::Action1(Plugin::InternalUse iu, int32_t handle) + Func3::Func3(Plugin::InternalUse iu, int32_t handle) : System::Object(iu, handle) { - CppHandle = Plugin::StoreSystemActionSystemSingle(this); + CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -8740,9 +10417,9 @@ namespace System ClassHandle = 0; } - Action1::~Action1() + Func3::~Func3() { - Plugin::RemoveSystemActionSystemSingle(CppHandle); + Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); CppHandle = 0; if (Handle) { @@ -8752,7 +10429,7 @@ namespace System ClassHandle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemActionSystemSingle(handle, classHandle); + Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(handle, classHandle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8764,7 +10441,7 @@ namespace System } } - Action1& Action1::operator=(const Action1& other) + Func3& Func3::operator=(const Func3& other) { if (this->Handle) { @@ -8779,7 +10456,7 @@ namespace System return *this; } - Action1& Action1::operator=(decltype(nullptr) other) + Func3& Func3::operator=(decltype(nullptr) other) { if (Handle) { @@ -8789,7 +10466,7 @@ namespace System ClassHandle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemActionSystemSingle(handle, classHandle); + Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(handle, classHandle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8804,9 +10481,9 @@ namespace System return *this; } - Action1& Action1::operator=(Action1&& other) + Func3& Func3::operator=(Func3&& other) { - Plugin::RemoveSystemActionSystemSingle(CppHandle); + Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); CppHandle = 0; if (Handle) { @@ -8816,7 +10493,7 @@ namespace System ClassHandle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemActionSystemSingle(handle, classHandle); + Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(handle, classHandle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8833,19 +10510,19 @@ namespace System return *this; } - bool Action1::operator==(const Action1& other) const + bool Func3::operator==(const Func3& other) const { return Handle == other.Handle; } - bool Action1::operator!=(const Action1& other) const + bool Func3::operator!=(const Func3& other) const { return Handle != other.Handle; } - void Action1::operator+=(System::Action1& del) + void Func3::operator+=(System::Func3& del) { - Plugin::SystemActionSystemSingleAdd(Handle, del.Handle); + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8855,9 +10532,9 @@ namespace System } } - void Action1::operator-=(System::Action1& del) + void Func3::operator-=(System::Func3& del) { - Plugin::SystemActionSystemSingleRemove(Handle, del.Handle); + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8867,31 +10544,34 @@ namespace System } } - void Action1::operator()(float obj) + System::String Func3::operator()(int16_t arg1, int32_t arg2) { + return nullptr; } - DLLEXPORT void SystemActionSystemSingleNativeInvoke(int32_t cppHandle, float obj) + DLLEXPORT int32_t SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke(int32_t cppHandle, int16_t arg1, int32_t arg2) { try { - Plugin::GetSystemActionSystemSingle(cppHandle)->operator()(obj); + return Plugin::GetSystemFuncSystemInt16_SystemInt32_SystemString(cppHandle)->operator()(arg1, arg2).Handle; } catch (System::Exception ex) { Plugin::SetException(ex.Handle); + return {}; } catch (...) { - System::String msg = "Unhandled exception invoking System::Action1"; + System::String msg = "Unhandled exception invoking System::Func3"; System::Exception ex(msg); Plugin::SetException(ex.Handle); + return {}; } } - void Action1::Invoke(float obj) + System::String Func3::Invoke(int16_t arg1, int32_t arg2) { - Plugin::SystemActionSystemSingleInvoke(Handle, obj); + auto returnValue = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(Handle, arg1, arg2); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8899,23 +10579,24 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } + return System::String(Plugin::InternalUse::Only, returnValue); } } namespace System { - Action2::Action2() + AppDomainInitializer::AppDomainInitializer() : System::Object(nullptr) { - CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); - Plugin::SystemActionSystemSingle_SystemSingleConstructor(CppHandle, &Handle, &ClassHandle); + CppHandle = Plugin::StoreSystemAppDomainInitializer(this); + Plugin::SystemAppDomainInitializerConstructor(CppHandle, &Handle, &ClassHandle); if (Handle) { Plugin::ReferenceManagedClass(Handle); } else { - Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); + Plugin::RemoveSystemAppDomainInitializer(CppHandle); ClassHandle = 0; CppHandle = 0; } @@ -8928,17 +10609,17 @@ namespace System } } - Action2::Action2(decltype(nullptr) n) + AppDomainInitializer::AppDomainInitializer(decltype(nullptr) n) : System::Object(Plugin::InternalUse::Only, 0) { - CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); + CppHandle = Plugin::StoreSystemAppDomainInitializer(this); ClassHandle = 0; } - Action2::Action2(const Action2& other) + AppDomainInitializer::AppDomainInitializer(const AppDomainInitializer& other) : System::Object(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); + CppHandle = Plugin::StoreSystemAppDomainInitializer(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -8946,7 +10627,7 @@ namespace System ClassHandle = other.ClassHandle; } - Action2::Action2(Action2&& other) + AppDomainInitializer::AppDomainInitializer(AppDomainInitializer&& other) : System::Object(Plugin::InternalUse::Only, other.Handle) { CppHandle = other.CppHandle; @@ -8956,10 +10637,10 @@ namespace System other.ClassHandle = 0; } - Action2::Action2(Plugin::InternalUse iu, int32_t handle) + AppDomainInitializer::AppDomainInitializer(Plugin::InternalUse iu, int32_t handle) : System::Object(iu, handle) { - CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); + CppHandle = Plugin::StoreSystemAppDomainInitializer(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -8967,9 +10648,9 @@ namespace System ClassHandle = 0; } - Action2::~Action2() + AppDomainInitializer::~AppDomainInitializer() { - Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); + Plugin::RemoveSystemAppDomainInitializer(CppHandle); CppHandle = 0; if (Handle) { @@ -8979,7 +10660,7 @@ namespace System ClassHandle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemActionSystemSingle_SystemSingle(handle, classHandle); + Plugin::ReleaseSystemAppDomainInitializer(handle, classHandle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8991,7 +10672,7 @@ namespace System } } - Action2& Action2::operator=(const Action2& other) + AppDomainInitializer& AppDomainInitializer::operator=(const AppDomainInitializer& other) { if (this->Handle) { @@ -9006,7 +10687,7 @@ namespace System return *this; } - Action2& Action2::operator=(decltype(nullptr) other) + AppDomainInitializer& AppDomainInitializer::operator=(decltype(nullptr) other) { if (Handle) { @@ -9016,7 +10697,7 @@ namespace System ClassHandle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemActionSystemSingle_SystemSingle(handle, classHandle); + Plugin::ReleaseSystemAppDomainInitializer(handle, classHandle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9031,9 +10712,9 @@ namespace System return *this; } - Action2& Action2::operator=(Action2&& other) + AppDomainInitializer& AppDomainInitializer::operator=(AppDomainInitializer&& other) { - Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); + Plugin::RemoveSystemAppDomainInitializer(CppHandle); CppHandle = 0; if (Handle) { @@ -9043,7 +10724,7 @@ namespace System ClassHandle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemActionSystemSingle_SystemSingle(handle, classHandle); + Plugin::ReleaseSystemAppDomainInitializer(handle, classHandle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9060,19 +10741,19 @@ namespace System return *this; } - bool Action2::operator==(const Action2& other) const + bool AppDomainInitializer::operator==(const AppDomainInitializer& other) const { return Handle == other.Handle; } - bool Action2::operator!=(const Action2& other) const + bool AppDomainInitializer::operator!=(const AppDomainInitializer& other) const { return Handle != other.Handle; } - void Action2::operator+=(System::Action2& del) + void AppDomainInitializer::operator+=(System::AppDomainInitializer& del) { - Plugin::SystemActionSystemSingle_SystemSingleAdd(Handle, del.Handle); + Plugin::SystemAppDomainInitializerAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9082,9 +10763,9 @@ namespace System } } - void Action2::operator-=(System::Action2& del) + void AppDomainInitializer::operator-=(System::AppDomainInitializer& del) { - Plugin::SystemActionSystemSingle_SystemSingleRemove(Handle, del.Handle); + Plugin::SystemAppDomainInitializerRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9094,15 +10775,16 @@ namespace System } } - void Action2::operator()(float arg1, float arg2) + void AppDomainInitializer::operator()(System::Array1& args) { } - DLLEXPORT void SystemActionSystemSingle_SystemSingleNativeInvoke(int32_t cppHandle, float arg1, float arg2) + DLLEXPORT void SystemAppDomainInitializerNativeInvoke(int32_t cppHandle, int32_t argsHandle) { try { - Plugin::GetSystemActionSystemSingle_SystemSingle(cppHandle)->operator()(arg1, arg2); + auto param0 = System::Array1(Plugin::InternalUse::Only, argsHandle); + Plugin::GetSystemAppDomainInitializer(cppHandle)->operator()(param0); } catch (System::Exception ex) { @@ -9110,15 +10792,15 @@ namespace System } catch (...) { - System::String msg = "Unhandled exception invoking System::Action2"; + System::String msg = "Unhandled exception invoking System::AppDomainInitializer"; System::Exception ex(msg); Plugin::SetException(ex.Handle); } } - void Action2::Invoke(float arg1, float arg2) + void AppDomainInitializer::Invoke(System::Array1& args) { - Plugin::SystemActionSystemSingle_SystemSingleInvoke(Handle, arg1, arg2); + Plugin::SystemAppDomainInitializerInvoke(Handle, args.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9129,352 +10811,487 @@ namespace System } } -namespace System +namespace UnityEngine { - Func3::Func3() - : System::Object(nullptr) + namespace Events { - CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(CppHandle, &Handle, &ClassHandle); - if (Handle) + UnityAction::UnityAction() + : System::Object(nullptr) { - Plugin::ReferenceManagedClass(Handle); + CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); + Plugin::UnityEngineEventsUnityActionConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveUnityEngineEventsUnityAction(CppHandle); + ClassHandle = 0; + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - else + + UnityAction::UnityAction(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) { - Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); + CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); ClassHandle = 0; - CppHandle = 0; } - if (Plugin::unhandledCsharpException) + + UnityAction::UnityAction(const UnityAction& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = other.ClassHandle; } - } - - Func3::Func3(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) - { - CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); - ClassHandle = 0; - } - - Func3::Func3(const Func3& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); - if (Handle) + + UnityAction::UnityAction(UnityAction&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(Handle); + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; + other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; } - ClassHandle = other.ClassHandle; - } - - Func3::Func3(Func3&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - Func3::Func3(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); - if (Handle) + + UnityAction::UnityAction(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = 0; + } + + UnityAction::~UnityAction() + { + Plugin::RemoveUnityEngineEventsUnityAction(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseUnityEngineEventsUnityAction(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + UnityAction& UnityAction::operator=(const UnityAction& other) { - Plugin::ReferenceManagedClass(Handle); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + ClassHandle = other.ClassHandle; + return *this; } - ClassHandle = 0; - } - - Func3::~Func3() - { - Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); - CppHandle = 0; - if (Handle) + + UnityAction& UnityAction::operator=(decltype(nullptr) other) { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseUnityEngineEventsUnityAction(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + Handle = 0; + return *this; + } + + UnityAction& UnityAction::operator=(UnityAction&& other) + { + Plugin::RemoveUnityEngineEventsUnityAction(CppHandle); + CppHandle = 0; + if (Handle) { - Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(handle, classHandle); - if (Plugin::unhandledCsharpException) + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReleaseUnityEngineEventsUnityAction(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; + Handle = other.Handle; + other.Handle = 0; + return *this; } - } - - Func3& Func3::operator=(const Func3& other) - { - if (this->Handle) + + bool UnityAction::operator==(const UnityAction& other) const { - Plugin::DereferenceManagedClass(this->Handle); + return Handle == other.Handle; } - this->Handle = other.Handle; - if (this->Handle) + + bool UnityAction::operator!=(const UnityAction& other) const { - Plugin::ReferenceManagedClass(this->Handle); + return Handle != other.Handle; } - ClassHandle = other.ClassHandle; - return *this; - } - - Func3& Func3::operator=(decltype(nullptr) other) - { - if (Handle) + + void UnityAction::operator+=(UnityEngine::Events::UnityAction& del) { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + Plugin::UnityEngineEventsUnityActionAdd(Handle, del.Handle); + if (Plugin::unhandledCsharpException) { - Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } } - ClassHandle = 0; - Handle = 0; - return *this; - } - - Func3& Func3::operator=(Func3&& other) - { - Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); - CppHandle = 0; - if (Handle) + + void UnityAction::operator-=(UnityEngine::Events::UnityAction& del) { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + Plugin::UnityEngineEventsUnityActionRemove(Handle, del.Handle); + if (Plugin::unhandledCsharpException) { - Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Func3::operator==(const Func3& other) const - { - return Handle == other.Handle; - } - - bool Func3::operator!=(const Func3& other) const - { - return Handle != other.Handle; - } - - void Func3::operator+=(System::Func3& del) - { - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) + + void UnityAction::operator()() { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } - } - - void Func3::operator-=(System::Func3& del) - { - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) + + DLLEXPORT void UnityEngineEventsUnityActionNativeInvoke(int32_t cppHandle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + try + { + Plugin::GetUnityEngineEventsUnityAction(cppHandle)->operator()(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking UnityEngine::Events::UnityAction"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void UnityAction::Invoke() + { + Plugin::UnityEngineEventsUnityActionInvoke(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } - - double Func3::operator()(int32_t arg1, float arg2) - { - return {}; - } - - DLLEXPORT double SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke(int32_t cppHandle, int32_t arg1, float arg2) +} + +namespace UnityEngine +{ + namespace Events { - try + UnityAction2::UnityAction2() + : System::Object(nullptr) + { + CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(CppHandle); + ClassHandle = 0; + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + UnityAction2::UnityAction2(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) { - return Plugin::GetSystemFuncSystemInt32_SystemSingle_SystemDouble(cppHandle)->operator()(arg1, arg2); + CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); + ClassHandle = 0; } - catch (System::Exception ex) + + UnityAction2::UnityAction2(const UnityAction2& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - Plugin::SetException(ex.Handle); - return {}; + CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = other.ClassHandle; } - catch (...) + + UnityAction2::UnityAction2(UnityAction2&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - System::String msg = "Unhandled exception invoking System::Func3"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; + other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; } - } - - double Func3::Invoke(int32_t arg1, float arg2) - { - auto returnValue = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(Handle, arg1, arg2); - if (Plugin::unhandledCsharpException) + + UnityAction2::UnityAction2(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = 0; } - return returnValue; - } -} - -namespace System -{ - Func3::Func3() - : System::Object(nullptr) - { - CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(CppHandle, &Handle, &ClassHandle); - if (Handle) + + UnityAction2::~UnityAction2() { - Plugin::ReferenceManagedClass(Handle); + Plugin::RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } } - else + + UnityAction2& UnityAction2::operator=(const UnityAction2& other) { - Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + ClassHandle = other.ClassHandle; + return *this; + } + + UnityAction2& UnityAction2::operator=(decltype(nullptr) other) + { + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } ClassHandle = 0; + Handle = 0; + return *this; + } + + UnityAction2& UnityAction2::operator=(UnityAction2&& other) + { + Plugin::RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(CppHandle); CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; + Handle = other.Handle; + other.Handle = 0; + return *this; } - if (Plugin::unhandledCsharpException) + + bool UnityAction2::operator==(const UnityAction2& other) const { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Handle == other.Handle; } - } - - Func3::Func3(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) - { - CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); - ClassHandle = 0; - } - - Func3::Func3(const Func3& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); - if (Handle) + + bool UnityAction2::operator!=(const UnityAction2& other) const { - Plugin::ReferenceManagedClass(Handle); + return Handle != other.Handle; } - ClassHandle = other.ClassHandle; - } - - Func3::Func3(Func3&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - Func3::Func3(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); - if (Handle) + + void UnityAction2::operator+=(UnityEngine::Events::UnityAction2& del) { - Plugin::ReferenceManagedClass(Handle); + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - ClassHandle = 0; - } - - Func3::~Func3() - { - Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); - CppHandle = 0; - if (Handle) + + void UnityAction2::operator-=(UnityEngine::Events::UnityAction2& del) { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove(Handle, del.Handle); + if (Plugin::unhandledCsharpException) { - Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } } - } - - Func3& Func3::operator=(const Func3& other) - { - if (this->Handle) + + void UnityAction2::operator()(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) { - Plugin::DereferenceManagedClass(this->Handle); } - this->Handle = other.Handle; - if (this->Handle) + + DLLEXPORT void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(int32_t cppHandle, UnityEngine::SceneManagement::Scene arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + { + try + { + Plugin::GetUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(cppHandle)->operator()(arg0, arg1); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking UnityEngine::Events::UnityAction2"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void UnityAction2::Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) { - Plugin::ReferenceManagedClass(this->Handle); + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(Handle, arg0, arg1); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - ClassHandle = other.ClassHandle; - return *this; } - - Func3& Func3::operator=(decltype(nullptr) other) +} + +namespace System +{ + namespace ComponentModel { - if (Handle) + namespace Design { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + ComponentEventHandler::ComponentEventHandler() + : System::Object(nullptr) { - Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(handle, classHandle); + CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); + Plugin::SystemComponentModelDesignComponentEventHandlerConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemComponentModelDesignComponentEventHandler(CppHandle); + ClassHandle = 0; + CppHandle = 0; + } if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9483,25 +11300,200 @@ namespace System delete ex; } } - } - ClassHandle = 0; - Handle = 0; - return *this; - } - - Func3& Func3::operator=(Func3&& other) - { - Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + + ComponentEventHandler::ComponentEventHandler(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) { - Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(handle, classHandle); + CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); + ClassHandle = 0; + } + + ComponentEventHandler::ComponentEventHandler(const ComponentEventHandler& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = other.ClassHandle; + } + + ComponentEventHandler::ComponentEventHandler(ComponentEventHandler&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; + other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; + } + + ComponentEventHandler::ComponentEventHandler(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = 0; + } + + ComponentEventHandler::~ComponentEventHandler() + { + Plugin::RemoveSystemComponentModelDesignComponentEventHandler(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemComponentModelDesignComponentEventHandler(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + ComponentEventHandler& ComponentEventHandler::operator=(const ComponentEventHandler& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + ClassHandle = other.ClassHandle; + return *this; + } + + ComponentEventHandler& ComponentEventHandler::operator=(decltype(nullptr) other) + { + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemComponentModelDesignComponentEventHandler(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + ClassHandle = 0; + Handle = 0; + return *this; + } + + ComponentEventHandler& ComponentEventHandler::operator=(ComponentEventHandler&& other) + { + Plugin::RemoveSystemComponentModelDesignComponentEventHandler(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemComponentModelDesignComponentEventHandler(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ComponentEventHandler::operator==(const ComponentEventHandler& other) const + { + return Handle == other.Handle; + } + + bool ComponentEventHandler::operator!=(const ComponentEventHandler& other) const + { + return Handle != other.Handle; + } + + void ComponentEventHandler::operator+=(System::ComponentModel::Design::ComponentEventHandler& del) + { + Plugin::SystemComponentModelDesignComponentEventHandlerAdd(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void ComponentEventHandler::operator-=(System::ComponentModel::Design::ComponentEventHandler& del) + { + Plugin::SystemComponentModelDesignComponentEventHandlerRemove(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void ComponentEventHandler::operator()(System::Object& sender, System::ComponentModel::Design::ComponentEventArgs& e) + { + } + + DLLEXPORT void SystemComponentModelDesignComponentEventHandlerNativeInvoke(int32_t cppHandle, int32_t senderHandle, int32_t eHandle) + { + try + { + auto param0 = System::Object(Plugin::InternalUse::Only, senderHandle); + auto param1 = System::ComponentModel::Design::ComponentEventArgs(Plugin::InternalUse::Only, eHandle); + Plugin::GetSystemComponentModelDesignComponentEventHandler(cppHandle)->operator()(param0, param1); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::ComponentEventHandler"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void ComponentEventHandler::Invoke(System::Object& sender, System::ComponentModel::Design::ComponentEventArgs& e) + { + Plugin::SystemComponentModelDesignComponentEventHandlerInvoke(Handle, sender.Handle, e.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9511,164 +11503,30 @@ namespace System } } } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Func3::operator==(const Func3& other) const - { - return Handle == other.Handle; - } - - bool Func3::operator!=(const Func3& other) const - { - return Handle != other.Handle; - } - - void Func3::operator+=(System::Func3& del) - { - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void Func3::operator-=(System::Func3& del) - { - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - System::String Func3::operator()(int16_t arg1, int32_t arg2) - { - return nullptr; - } - - DLLEXPORT int32_t SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke(int32_t cppHandle, int16_t arg1, int32_t arg2) - { - try - { - return Plugin::GetSystemFuncSystemInt16_SystemInt32_SystemString(cppHandle)->operator()(arg1, arg2).Handle; - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Func3"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } - - System::String Func3::Invoke(int16_t arg1, int32_t arg2) - { - auto returnValue = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(Handle, arg1, arg2); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); } } namespace System { - AppDomainInitializer::AppDomainInitializer() - : System::Object(nullptr) - { - CppHandle = Plugin::StoreSystemAppDomainInitializer(this); - Plugin::SystemAppDomainInitializerConstructor(CppHandle, &Handle, &ClassHandle); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemAppDomainInitializer(CppHandle); - ClassHandle = 0; - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - AppDomainInitializer::AppDomainInitializer(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) - { - CppHandle = Plugin::StoreSystemAppDomainInitializer(this); - ClassHandle = 0; - } - - AppDomainInitializer::AppDomainInitializer(const AppDomainInitializer& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = Plugin::StoreSystemAppDomainInitializer(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = other.ClassHandle; - } - - AppDomainInitializer::AppDomainInitializer(AppDomainInitializer&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - AppDomainInitializer::AppDomainInitializer(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - CppHandle = Plugin::StoreSystemAppDomainInitializer(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = 0; - } - - AppDomainInitializer::~AppDomainInitializer() + namespace ComponentModel { - Plugin::RemoveSystemAppDomainInitializer(CppHandle); - CppHandle = 0; - if (Handle) + namespace Design { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + ComponentChangingEventHandler::ComponentChangingEventHandler() + : System::Object(nullptr) { - Plugin::ReleaseSystemAppDomainInitializer(handle, classHandle); + CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); + Plugin::SystemComponentModelDesignComponentChangingEventHandlerConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemComponentModelDesignComponentChangingEventHandler(CppHandle); + ClassHandle = 0; + CppHandle = 0; + } if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9677,35 +11535,152 @@ namespace System delete ex; } } - } - } - - AppDomainInitializer& AppDomainInitializer::operator=(const AppDomainInitializer& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - ClassHandle = other.ClassHandle; - return *this; - } - - AppDomainInitializer& AppDomainInitializer::operator=(decltype(nullptr) other) - { - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + + ComponentChangingEventHandler::ComponentChangingEventHandler(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) + { + CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); + ClassHandle = 0; + } + + ComponentChangingEventHandler::ComponentChangingEventHandler(const ComponentChangingEventHandler& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = other.ClassHandle; + } + + ComponentChangingEventHandler::ComponentChangingEventHandler(ComponentChangingEventHandler&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; + other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; + } + + ComponentChangingEventHandler::ComponentChangingEventHandler(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = 0; + } + + ComponentChangingEventHandler::~ComponentChangingEventHandler() + { + Plugin::RemoveSystemComponentModelDesignComponentChangingEventHandler(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemComponentModelDesignComponentChangingEventHandler(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + ComponentChangingEventHandler& ComponentChangingEventHandler::operator=(const ComponentChangingEventHandler& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + ClassHandle = other.ClassHandle; + return *this; + } + + ComponentChangingEventHandler& ComponentChangingEventHandler::operator=(decltype(nullptr) other) + { + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemComponentModelDesignComponentChangingEventHandler(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + ClassHandle = 0; + Handle = 0; + return *this; + } + + ComponentChangingEventHandler& ComponentChangingEventHandler::operator=(ComponentChangingEventHandler&& other) + { + Plugin::RemoveSystemComponentModelDesignComponentChangingEventHandler(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemComponentModelDesignComponentChangingEventHandler(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ComponentChangingEventHandler::operator==(const ComponentChangingEventHandler& other) const + { + return Handle == other.Handle; + } + + bool ComponentChangingEventHandler::operator!=(const ComponentChangingEventHandler& other) const + { + return Handle != other.Handle; + } + + void ComponentChangingEventHandler::operator+=(System::ComponentModel::Design::ComponentChangingEventHandler& del) { - Plugin::ReleaseSystemAppDomainInitializer(handle, classHandle); + Plugin::SystemComponentModelDesignComponentChangingEventHandlerAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9714,25 +11689,46 @@ namespace System delete ex; } } - } - ClassHandle = 0; - Handle = 0; - return *this; - } - - AppDomainInitializer& AppDomainInitializer::operator=(AppDomainInitializer&& other) - { - Plugin::RemoveSystemAppDomainInitializer(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + + void ComponentChangingEventHandler::operator-=(System::ComponentModel::Design::ComponentChangingEventHandler& del) { - Plugin::ReleaseSystemAppDomainInitializer(handle, classHandle); + Plugin::SystemComponentModelDesignComponentChangingEventHandlerRemove(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void ComponentChangingEventHandler::operator()(System::Object& sender, System::ComponentModel::Design::ComponentChangingEventArgs& e) + { + } + + DLLEXPORT void SystemComponentModelDesignComponentChangingEventHandlerNativeInvoke(int32_t cppHandle, int32_t senderHandle, int32_t eHandle) + { + try + { + auto param0 = System::Object(Plugin::InternalUse::Only, senderHandle); + auto param1 = System::ComponentModel::Design::ComponentChangingEventArgs(Plugin::InternalUse::Only, eHandle); + Plugin::GetSystemComponentModelDesignComponentChangingEventHandler(cppHandle)->operator()(param0, param1); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::ComponentChangingEventHandler"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void ComponentChangingEventHandler::Invoke(System::Object& sender, System::ComponentModel::Design::ComponentChangingEventArgs& e) + { + Plugin::SystemComponentModelDesignComponentChangingEventHandlerInvoke(Handle, sender.Handle, e.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9741,539 +11737,475 @@ namespace System delete ex; } } - } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool AppDomainInitializer::operator==(const AppDomainInitializer& other) const - { - return Handle == other.Handle; - } - - bool AppDomainInitializer::operator!=(const AppDomainInitializer& other) const - { - return Handle != other.Handle; - } - - void AppDomainInitializer::operator+=(System::AppDomainInitializer& del) - { - Plugin::SystemAppDomainInitializerAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void AppDomainInitializer::operator-=(System::AppDomainInitializer& del) - { - Plugin::SystemAppDomainInitializerRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void AppDomainInitializer::operator()(System::Array1& args) - { - } - - DLLEXPORT void SystemAppDomainInitializerNativeInvoke(int32_t cppHandle, int32_t argsHandle) - { - try - { - auto param0 = System::Array1(Plugin::InternalUse::Only, argsHandle); - Plugin::GetSystemAppDomainInitializer(cppHandle)->operator()(param0); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::AppDomainInitializer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void AppDomainInitializer::Invoke(System::Array1& args) - { - Plugin::SystemAppDomainInitializerInvoke(Handle, args.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } } } -namespace UnityEngine +namespace System { - namespace Events + namespace ComponentModel { - UnityAction::UnityAction() - : System::Object(nullptr) + namespace Design { - CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); - Plugin::UnityEngineEventsUnityActionConstructor(CppHandle, &Handle, &ClassHandle); - if (Handle) + ComponentChangedEventHandler::ComponentChangedEventHandler() + : System::Object(nullptr) { - Plugin::ReferenceManagedClass(Handle); + CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); + Plugin::SystemComponentModelDesignComponentChangedEventHandlerConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemComponentModelDesignComponentChangedEventHandler(CppHandle); + ClassHandle = 0; + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - else + + ComponentChangedEventHandler::ComponentChangedEventHandler(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) { - Plugin::RemoveUnityEngineEventsUnityAction(CppHandle); + CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); ClassHandle = 0; - CppHandle = 0; } - if (Plugin::unhandledCsharpException) + + ComponentChangedEventHandler::ComponentChangedEventHandler(const ComponentChangedEventHandler& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = other.ClassHandle; } - } - - UnityAction::UnityAction(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) - { - CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); - ClassHandle = 0; - } - - UnityAction::UnityAction(const UnityAction& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); - if (Handle) + + ComponentChangedEventHandler::ComponentChangedEventHandler(ComponentChangedEventHandler&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(Handle); + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; + other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; } - ClassHandle = other.ClassHandle; - } - - UnityAction::UnityAction(UnityAction&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - UnityAction::UnityAction(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); - if (Handle) + + ComponentChangedEventHandler::ComponentChangedEventHandler(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { - Plugin::ReferenceManagedClass(Handle); + CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = 0; } - ClassHandle = 0; - } - - UnityAction::~UnityAction() - { - Plugin::RemoveUnityEngineEventsUnityAction(CppHandle); - CppHandle = 0; - if (Handle) + + ComponentChangedEventHandler::~ComponentChangedEventHandler() { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + Plugin::RemoveSystemComponentModelDesignComponentChangedEventHandler(CppHandle); + CppHandle = 0; + if (Handle) { - Plugin::ReleaseUnityEngineEventsUnityAction(handle, classHandle); - if (Plugin::unhandledCsharpException) + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReleaseSystemComponentModelDesignComponentChangedEventHandler(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } } - } - - UnityAction& UnityAction::operator=(const UnityAction& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + + ComponentChangedEventHandler& ComponentChangedEventHandler::operator=(const ComponentChangedEventHandler& other) { - Plugin::ReferenceManagedClass(this->Handle); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + ClassHandle = other.ClassHandle; + return *this; } - ClassHandle = other.ClassHandle; - return *this; - } - - UnityAction& UnityAction::operator=(decltype(nullptr) other) - { - if (Handle) + + ComponentChangedEventHandler& ComponentChangedEventHandler::operator=(decltype(nullptr) other) { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + if (Handle) { - Plugin::ReleaseUnityEngineEventsUnityAction(handle, classHandle); - if (Plugin::unhandledCsharpException) + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReleaseSystemComponentModelDesignComponentChangedEventHandler(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } + ClassHandle = 0; + Handle = 0; + return *this; } - ClassHandle = 0; - Handle = 0; - return *this; - } - - UnityAction& UnityAction::operator=(UnityAction&& other) - { - Plugin::RemoveUnityEngineEventsUnityAction(CppHandle); - CppHandle = 0; - if (Handle) + + ComponentChangedEventHandler& ComponentChangedEventHandler::operator=(ComponentChangedEventHandler&& other) { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + Plugin::RemoveSystemComponentModelDesignComponentChangedEventHandler(CppHandle); + CppHandle = 0; + if (Handle) { - Plugin::ReleaseUnityEngineEventsUnityAction(handle, classHandle); - if (Plugin::unhandledCsharpException) + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReleaseSystemComponentModelDesignComponentChangedEventHandler(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; + Handle = other.Handle; + other.Handle = 0; + return *this; } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool UnityAction::operator==(const UnityAction& other) const - { - return Handle == other.Handle; - } - - bool UnityAction::operator!=(const UnityAction& other) const - { - return Handle != other.Handle; - } - - void UnityAction::operator+=(UnityEngine::Events::UnityAction& del) - { - Plugin::UnityEngineEventsUnityActionAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) + + bool ComponentChangedEventHandler::operator==(const ComponentChangedEventHandler& other) const { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Handle == other.Handle; } - } - - void UnityAction::operator-=(UnityEngine::Events::UnityAction& del) - { - Plugin::UnityEngineEventsUnityActionRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) + + bool ComponentChangedEventHandler::operator!=(const ComponentChangedEventHandler& other) const { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Handle != other.Handle; } - } - - void UnityAction::operator()() - { - } - - DLLEXPORT void UnityEngineEventsUnityActionNativeInvoke(int32_t cppHandle) - { - try + + void ComponentChangedEventHandler::operator+=(System::ComponentModel::Design::ComponentChangedEventHandler& del) { - Plugin::GetUnityEngineEventsUnityAction(cppHandle)->operator()(); + Plugin::SystemComponentModelDesignComponentChangedEventHandlerAdd(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - catch (System::Exception ex) + + void ComponentChangedEventHandler::operator-=(System::ComponentModel::Design::ComponentChangedEventHandler& del) { - Plugin::SetException(ex.Handle); + Plugin::SystemComponentModelDesignComponentChangedEventHandlerRemove(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - catch (...) + + void ComponentChangedEventHandler::operator()(System::Object& sender, System::ComponentModel::Design::ComponentChangedEventArgs& e) { - System::String msg = "Unhandled exception invoking UnityEngine::Events::UnityAction"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); } - } - - void UnityAction::Invoke() - { - Plugin::UnityEngineEventsUnityActionInvoke(Handle); - if (Plugin::unhandledCsharpException) + + DLLEXPORT void SystemComponentModelDesignComponentChangedEventHandlerNativeInvoke(int32_t cppHandle, int32_t senderHandle, int32_t eHandle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + try + { + auto param0 = System::Object(Plugin::InternalUse::Only, senderHandle); + auto param1 = System::ComponentModel::Design::ComponentChangedEventArgs(Plugin::InternalUse::Only, eHandle); + Plugin::GetSystemComponentModelDesignComponentChangedEventHandler(cppHandle)->operator()(param0, param1); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::ComponentChangedEventHandler"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void ComponentChangedEventHandler::Invoke(System::Object& sender, System::ComponentModel::Design::ComponentChangedEventArgs& e) + { + Plugin::SystemComponentModelDesignComponentChangedEventHandlerInvoke(Handle, sender.Handle, e.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } } } -namespace UnityEngine +namespace System { - namespace Events + namespace ComponentModel { - UnityAction2::UnityAction2() - : System::Object(nullptr) + namespace Design { - CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor(CppHandle, &Handle, &ClassHandle); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(CppHandle); - ClassHandle = 0; - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) + ComponentRenameEventHandler::ComponentRenameEventHandler() + : System::Object(nullptr) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); + Plugin::SystemComponentModelDesignComponentRenameEventHandlerConstructor(CppHandle, &Handle, &ClassHandle); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemComponentModelDesignComponentRenameEventHandler(CppHandle); + ClassHandle = 0; + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - } - - UnityAction2::UnityAction2(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) - { - CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); - ClassHandle = 0; - } - - UnityAction2::UnityAction2(const UnityAction2& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); - if (Handle) + + ComponentRenameEventHandler::ComponentRenameEventHandler(decltype(nullptr) n) + : System::Object(Plugin::InternalUse::Only, 0) { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = other.ClassHandle; - } - - UnityAction2::UnityAction2(UnityAction2&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - UnityAction2::UnityAction2(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); - if (Handle) + CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); + ClassHandle = 0; + } + + ComponentRenameEventHandler::ComponentRenameEventHandler(const ComponentRenameEventHandler& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(Handle); + CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + ClassHandle = other.ClassHandle; } - ClassHandle = 0; - } - - UnityAction2::~UnityAction2() - { - Plugin::RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(CppHandle); - CppHandle = 0; - if (Handle) + + ComponentRenameEventHandler::ComponentRenameEventHandler(ComponentRenameEventHandler&& other) + : System::Object(Plugin::InternalUse::Only, other.Handle) { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; + CppHandle = other.CppHandle; + ClassHandle = other.ClassHandle; + other.Handle = 0; + other.CppHandle = 0; + other.ClassHandle = 0; + } + + ComponentRenameEventHandler::ComponentRenameEventHandler(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + } + + ComponentRenameEventHandler::~ComponentRenameEventHandler() + { + Plugin::RemoveSystemComponentModelDesignComponentRenameEventHandler(CppHandle); + CppHandle = 0; + if (Handle) { - Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(handle, classHandle); - if (Plugin::unhandledCsharpException) + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReleaseSystemComponentModelDesignComponentRenameEventHandler(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } } - } - - UnityAction2& UnityAction2::operator=(const UnityAction2& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + + ComponentRenameEventHandler& ComponentRenameEventHandler::operator=(const ComponentRenameEventHandler& other) { - Plugin::ReferenceManagedClass(this->Handle); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + ClassHandle = other.ClassHandle; + return *this; } - ClassHandle = other.ClassHandle; - return *this; - } - - UnityAction2& UnityAction2::operator=(decltype(nullptr) other) - { - if (Handle) + + ComponentRenameEventHandler& ComponentRenameEventHandler::operator=(decltype(nullptr) other) { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + if (Handle) { - Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(handle, classHandle); - if (Plugin::unhandledCsharpException) + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReleaseSystemComponentModelDesignComponentRenameEventHandler(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } + ClassHandle = 0; + Handle = 0; + return *this; } - ClassHandle = 0; - Handle = 0; - return *this; - } - - UnityAction2& UnityAction2::operator=(UnityAction2&& other) - { - Plugin::RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(CppHandle); - CppHandle = 0; - if (Handle) + + ComponentRenameEventHandler& ComponentRenameEventHandler::operator=(ComponentRenameEventHandler&& other) { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + Plugin::RemoveSystemComponentModelDesignComponentRenameEventHandler(CppHandle); + CppHandle = 0; + if (Handle) { - Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(handle, classHandle); - if (Plugin::unhandledCsharpException) + int32_t handle = Handle; + int32_t classHandle = ClassHandle; + Handle = 0; + ClassHandle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReleaseSystemComponentModelDesignComponentRenameEventHandler(handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } + ClassHandle = other.ClassHandle; + other.ClassHandle = 0; + Handle = other.Handle; + other.Handle = 0; + return *this; } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool UnityAction2::operator==(const UnityAction2& other) const - { - return Handle == other.Handle; - } - - bool UnityAction2::operator!=(const UnityAction2& other) const - { - return Handle != other.Handle; - } - - void UnityAction2::operator+=(UnityEngine::Events::UnityAction2& del) - { - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) + + bool ComponentRenameEventHandler::operator==(const ComponentRenameEventHandler& other) const { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Handle == other.Handle; } - } - - void UnityAction2::operator-=(UnityEngine::Events::UnityAction2& del) - { - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) + + bool ComponentRenameEventHandler::operator!=(const ComponentRenameEventHandler& other) const { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Handle != other.Handle; } - } - - void UnityAction2::operator()(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) - { - } - - DLLEXPORT void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(int32_t cppHandle, UnityEngine::SceneManagement::Scene arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) - { - try + + void ComponentRenameEventHandler::operator+=(System::ComponentModel::Design::ComponentRenameEventHandler& del) { - Plugin::GetUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(cppHandle)->operator()(arg0, arg1); + Plugin::SystemComponentModelDesignComponentRenameEventHandlerAdd(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - catch (System::Exception ex) + + void ComponentRenameEventHandler::operator-=(System::ComponentModel::Design::ComponentRenameEventHandler& del) { - Plugin::SetException(ex.Handle); + Plugin::SystemComponentModelDesignComponentRenameEventHandlerRemove(Handle, del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - catch (...) + + void ComponentRenameEventHandler::operator()(System::Object& sender, System::ComponentModel::Design::ComponentRenameEventArgs& e) { - System::String msg = "Unhandled exception invoking UnityEngine::Events::UnityAction2"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); } - } - - void UnityAction2::Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) - { - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(Handle, arg0, arg1); - if (Plugin::unhandledCsharpException) + + DLLEXPORT void SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke(int32_t cppHandle, int32_t senderHandle, int32_t eHandle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + try + { + auto param0 = System::Object(Plugin::InternalUse::Only, senderHandle); + auto param1 = System::ComponentModel::Design::ComponentRenameEventArgs(Plugin::InternalUse::Only, eHandle); + Plugin::GetSystemComponentModelDesignComponentRenameEventHandler(cppHandle)->operator()(param0, param1); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::ComponentRenameEventHandler"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void ComponentRenameEventHandler::Invoke(System::Object& sender, System::ComponentModel::Design::ComponentRenameEventArgs& e) + { + Plugin::SystemComponentModelDesignComponentRenameEventHandlerInvoke(Handle, sender.Handle, e.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } } @@ -10426,14 +12358,14 @@ DLLEXPORT void Init( void (*systemCollectionsGenericIComparerSystemStringConstructor)(int32_t cppHandle, int32_t* handle), void (*releaseSystemStringComparer)(int32_t handle), void (*systemStringComparerConstructor)(int32_t cppHandle, int32_t* handle), - void (*releaseSystemEventArgs)(int32_t handle), - void (*systemEventArgsConstructor)(int32_t cppHandle, int32_t* handle), void (*releaseSystemCollectionsICollection)(int32_t handle), void (*systemCollectionsICollectionConstructor)(int32_t cppHandle, int32_t* handle), void (*releaseSystemCollectionsIList)(int32_t handle), void (*systemCollectionsIListConstructor)(int32_t cppHandle, int32_t* handle), void (*releaseSystemCollectionsQueue)(int32_t handle), void (*systemCollectionsQueueConstructor)(int32_t cppHandle, int32_t* handle), + void (*releaseSystemComponentModelDesignIComponentChangeService)(int32_t handle), + void (*systemComponentModelDesignIComponentChangeServiceConstructor)(int32_t cppHandle, int32_t* handle), int32_t (*boxBoolean)(System::Boolean val), System::Boolean (*unboxBoolean)(int32_t valHandle), int32_t (*boxSByte)(int8_t val), @@ -10523,7 +12455,27 @@ DLLEXPORT void Init( void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)(int32_t thisHandle, int32_t delHandle), void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle), - void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1), + void (*releaseSystemComponentModelDesignComponentEventHandler)(int32_t handle, int32_t classHandle), + void (*systemComponentModelDesignComponentEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), + void (*systemComponentModelDesignComponentEventHandlerAdd)(int32_t thisHandle, int32_t delHandle), + void (*systemComponentModelDesignComponentEventHandlerRemove)(int32_t thisHandle, int32_t delHandle), + void (*systemComponentModelDesignComponentEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle), + void (*releaseSystemComponentModelDesignComponentChangingEventHandler)(int32_t handle, int32_t classHandle), + void (*systemComponentModelDesignComponentChangingEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), + void (*systemComponentModelDesignComponentChangingEventHandlerAdd)(int32_t thisHandle, int32_t delHandle), + void (*systemComponentModelDesignComponentChangingEventHandlerRemove)(int32_t thisHandle, int32_t delHandle), + void (*systemComponentModelDesignComponentChangingEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle), + void (*releaseSystemComponentModelDesignComponentChangedEventHandler)(int32_t handle, int32_t classHandle), + void (*systemComponentModelDesignComponentChangedEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), + void (*systemComponentModelDesignComponentChangedEventHandlerAdd)(int32_t thisHandle, int32_t delHandle), + void (*systemComponentModelDesignComponentChangedEventHandlerRemove)(int32_t thisHandle, int32_t delHandle), + void (*systemComponentModelDesignComponentChangedEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle), + void (*releaseSystemComponentModelDesignComponentRenameEventHandler)(int32_t handle, int32_t classHandle), + void (*systemComponentModelDesignComponentRenameEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), + void (*systemComponentModelDesignComponentRenameEventHandlerAdd)(int32_t thisHandle, int32_t delHandle), + void (*systemComponentModelDesignComponentRenameEventHandlerRemove)(int32_t thisHandle, int32_t delHandle), + void (*systemComponentModelDesignComponentRenameEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle) /*END INIT PARAMS*/) { using namespace Plugin; @@ -10669,16 +12621,6 @@ DLLEXPORT void Init( NextFreeSystemStringComparer = SystemStringComparerFreeList + 1; Plugin::ReleaseSystemStringComparer = releaseSystemStringComparer; Plugin::SystemStringComparerConstructor = systemStringComparerConstructor; - SystemEventArgsFreeListSize = maxManagedObjects; - SystemEventArgsFreeList = new System::EventArgs*[SystemEventArgsFreeListSize]; - for (int32_t i = 0, end = SystemEventArgsFreeListSize - 1; i < end; ++i) - { - SystemEventArgsFreeList[i] = (System::EventArgs*)(SystemEventArgsFreeList + i + 1); - } - SystemEventArgsFreeList[SystemEventArgsFreeListSize - 1] = nullptr; - NextFreeSystemEventArgs = SystemEventArgsFreeList + 1; - Plugin::ReleaseSystemEventArgs = releaseSystemEventArgs; - Plugin::SystemEventArgsConstructor = systemEventArgsConstructor; SystemCollectionsICollectionFreeListSize = maxManagedObjects; SystemCollectionsICollectionFreeList = new System::Collections::ICollection*[SystemCollectionsICollectionFreeListSize]; for (int32_t i = 0, end = SystemCollectionsICollectionFreeListSize - 1; i < end; ++i) @@ -10709,6 +12651,16 @@ DLLEXPORT void Init( NextFreeSystemCollectionsQueue = SystemCollectionsQueueFreeList + 1; Plugin::ReleaseSystemCollectionsQueue = releaseSystemCollectionsQueue; Plugin::SystemCollectionsQueueConstructor = systemCollectionsQueueConstructor; + SystemComponentModelDesignIComponentChangeServiceFreeListSize = maxManagedObjects; + SystemComponentModelDesignIComponentChangeServiceFreeList = new System::ComponentModel::Design::IComponentChangeService*[SystemComponentModelDesignIComponentChangeServiceFreeListSize]; + for (int32_t i = 0, end = SystemComponentModelDesignIComponentChangeServiceFreeListSize - 1; i < end; ++i) + { + SystemComponentModelDesignIComponentChangeServiceFreeList[i] = (System::ComponentModel::Design::IComponentChangeService*)(SystemComponentModelDesignIComponentChangeServiceFreeList + i + 1); + } + SystemComponentModelDesignIComponentChangeServiceFreeList[SystemComponentModelDesignIComponentChangeServiceFreeListSize - 1] = nullptr; + NextFreeSystemComponentModelDesignIComponentChangeService = SystemComponentModelDesignIComponentChangeServiceFreeList + 1; + Plugin::ReleaseSystemComponentModelDesignIComponentChangeService = releaseSystemComponentModelDesignIComponentChangeService; + Plugin::SystemComponentModelDesignIComponentChangeServiceConstructor = systemComponentModelDesignIComponentChangeServiceConstructor; Plugin::BoxBoolean = boxBoolean; Plugin::UnboxBoolean = unboxBoolean; Plugin::BoxSByte = boxSByte; @@ -10863,6 +12815,58 @@ DLLEXPORT void Init( Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd; Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove; Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke; + SystemComponentModelDesignComponentEventHandlerFreeListSize = maxManagedObjects; + SystemComponentModelDesignComponentEventHandlerFreeList = new System::ComponentModel::Design::ComponentEventHandler*[SystemComponentModelDesignComponentEventHandlerFreeListSize]; + for (int32_t i = 0, end = SystemComponentModelDesignComponentEventHandlerFreeListSize - 1; i < end; ++i) + { + SystemComponentModelDesignComponentEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentEventHandler*)(SystemComponentModelDesignComponentEventHandlerFreeList + i + 1); + } + SystemComponentModelDesignComponentEventHandlerFreeList[SystemComponentModelDesignComponentEventHandlerFreeListSize - 1] = nullptr; + NextFreeSystemComponentModelDesignComponentEventHandler = SystemComponentModelDesignComponentEventHandlerFreeList + 1; + Plugin::ReleaseSystemComponentModelDesignComponentEventHandler = releaseSystemComponentModelDesignComponentEventHandler; + Plugin::SystemComponentModelDesignComponentEventHandlerConstructor = systemComponentModelDesignComponentEventHandlerConstructor; + Plugin::SystemComponentModelDesignComponentEventHandlerAdd = systemComponentModelDesignComponentEventHandlerAdd; + Plugin::SystemComponentModelDesignComponentEventHandlerRemove = systemComponentModelDesignComponentEventHandlerRemove; + Plugin::SystemComponentModelDesignComponentEventHandlerInvoke = systemComponentModelDesignComponentEventHandlerInvoke; + SystemComponentModelDesignComponentChangingEventHandlerFreeListSize = maxManagedObjects; + SystemComponentModelDesignComponentChangingEventHandlerFreeList = new System::ComponentModel::Design::ComponentChangingEventHandler*[SystemComponentModelDesignComponentChangingEventHandlerFreeListSize]; + for (int32_t i = 0, end = SystemComponentModelDesignComponentChangingEventHandlerFreeListSize - 1; i < end; ++i) + { + SystemComponentModelDesignComponentChangingEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentChangingEventHandler*)(SystemComponentModelDesignComponentChangingEventHandlerFreeList + i + 1); + } + SystemComponentModelDesignComponentChangingEventHandlerFreeList[SystemComponentModelDesignComponentChangingEventHandlerFreeListSize - 1] = nullptr; + NextFreeSystemComponentModelDesignComponentChangingEventHandler = SystemComponentModelDesignComponentChangingEventHandlerFreeList + 1; + Plugin::ReleaseSystemComponentModelDesignComponentChangingEventHandler = releaseSystemComponentModelDesignComponentChangingEventHandler; + Plugin::SystemComponentModelDesignComponentChangingEventHandlerConstructor = systemComponentModelDesignComponentChangingEventHandlerConstructor; + Plugin::SystemComponentModelDesignComponentChangingEventHandlerAdd = systemComponentModelDesignComponentChangingEventHandlerAdd; + Plugin::SystemComponentModelDesignComponentChangingEventHandlerRemove = systemComponentModelDesignComponentChangingEventHandlerRemove; + Plugin::SystemComponentModelDesignComponentChangingEventHandlerInvoke = systemComponentModelDesignComponentChangingEventHandlerInvoke; + SystemComponentModelDesignComponentChangedEventHandlerFreeListSize = maxManagedObjects; + SystemComponentModelDesignComponentChangedEventHandlerFreeList = new System::ComponentModel::Design::ComponentChangedEventHandler*[SystemComponentModelDesignComponentChangedEventHandlerFreeListSize]; + for (int32_t i = 0, end = SystemComponentModelDesignComponentChangedEventHandlerFreeListSize - 1; i < end; ++i) + { + SystemComponentModelDesignComponentChangedEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentChangedEventHandler*)(SystemComponentModelDesignComponentChangedEventHandlerFreeList + i + 1); + } + SystemComponentModelDesignComponentChangedEventHandlerFreeList[SystemComponentModelDesignComponentChangedEventHandlerFreeListSize - 1] = nullptr; + NextFreeSystemComponentModelDesignComponentChangedEventHandler = SystemComponentModelDesignComponentChangedEventHandlerFreeList + 1; + Plugin::ReleaseSystemComponentModelDesignComponentChangedEventHandler = releaseSystemComponentModelDesignComponentChangedEventHandler; + Plugin::SystemComponentModelDesignComponentChangedEventHandlerConstructor = systemComponentModelDesignComponentChangedEventHandlerConstructor; + Plugin::SystemComponentModelDesignComponentChangedEventHandlerAdd = systemComponentModelDesignComponentChangedEventHandlerAdd; + Plugin::SystemComponentModelDesignComponentChangedEventHandlerRemove = systemComponentModelDesignComponentChangedEventHandlerRemove; + Plugin::SystemComponentModelDesignComponentChangedEventHandlerInvoke = systemComponentModelDesignComponentChangedEventHandlerInvoke; + SystemComponentModelDesignComponentRenameEventHandlerFreeListSize = maxManagedObjects; + SystemComponentModelDesignComponentRenameEventHandlerFreeList = new System::ComponentModel::Design::ComponentRenameEventHandler*[SystemComponentModelDesignComponentRenameEventHandlerFreeListSize]; + for (int32_t i = 0, end = SystemComponentModelDesignComponentRenameEventHandlerFreeListSize - 1; i < end; ++i) + { + SystemComponentModelDesignComponentRenameEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentRenameEventHandler*)(SystemComponentModelDesignComponentRenameEventHandlerFreeList + i + 1); + } + SystemComponentModelDesignComponentRenameEventHandlerFreeList[SystemComponentModelDesignComponentRenameEventHandlerFreeListSize - 1] = nullptr; + NextFreeSystemComponentModelDesignComponentRenameEventHandler = SystemComponentModelDesignComponentRenameEventHandlerFreeList + 1; + Plugin::ReleaseSystemComponentModelDesignComponentRenameEventHandler = releaseSystemComponentModelDesignComponentRenameEventHandler; + Plugin::SystemComponentModelDesignComponentRenameEventHandlerConstructor = systemComponentModelDesignComponentRenameEventHandlerConstructor; + Plugin::SystemComponentModelDesignComponentRenameEventHandlerAdd = systemComponentModelDesignComponentRenameEventHandlerAdd; + Plugin::SystemComponentModelDesignComponentRenameEventHandlerRemove = systemComponentModelDesignComponentRenameEventHandlerRemove; + Plugin::SystemComponentModelDesignComponentRenameEventHandlerInvoke = systemComponentModelDesignComponentRenameEventHandlerInvoke; /*END INIT BODY*/ try diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index fbf5e52..890fbc6 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -543,6 +543,63 @@ namespace System } } +namespace System +{ + struct EventArgs; +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentEventArgs; + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentChangingEventArgs; + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentChangedEventArgs; + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentRenameEventArgs; + } + } +} + +namespace System +{ + namespace ComponentModel + { + struct MemberDescriptor; + } +} + namespace System { namespace Collections @@ -581,11 +638,6 @@ namespace System struct StringComparer; } -namespace System -{ - struct EventArgs; -} - namespace System { namespace Collections @@ -610,6 +662,17 @@ namespace System } } +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct IComponentChangeService; + } + } +} + namespace MyGame { namespace MonoBehaviours @@ -786,6 +849,50 @@ namespace UnityEngine template<> struct UnityAction2; } } + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentEventHandler; + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentChangingEventHandler; + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentChangedEventHandler; + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentRenameEventHandler; + } + } +} /*END TYPE DECLARATIONS*/ //////////////////////////////////////////////////////////////// @@ -1607,6 +1714,135 @@ namespace System } } +namespace System +{ + struct EventArgs : System::Object + { + EventArgs(decltype(nullptr) n); + EventArgs(Plugin::InternalUse iu, int32_t handle); + EventArgs(const EventArgs& other); + EventArgs(EventArgs&& other); + virtual ~EventArgs(); + EventArgs& operator=(const EventArgs& other); + EventArgs& operator=(decltype(nullptr) other); + EventArgs& operator=(EventArgs&& other); + bool operator==(const EventArgs& other) const; + bool operator!=(const EventArgs& other) const; + }; +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentEventArgs : System::EventArgs + { + ComponentEventArgs(decltype(nullptr) n); + ComponentEventArgs(Plugin::InternalUse iu, int32_t handle); + ComponentEventArgs(const ComponentEventArgs& other); + ComponentEventArgs(ComponentEventArgs&& other); + virtual ~ComponentEventArgs(); + ComponentEventArgs& operator=(const ComponentEventArgs& other); + ComponentEventArgs& operator=(decltype(nullptr) other); + ComponentEventArgs& operator=(ComponentEventArgs&& other); + bool operator==(const ComponentEventArgs& other) const; + bool operator!=(const ComponentEventArgs& other) const; + }; + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentChangingEventArgs : System::EventArgs + { + ComponentChangingEventArgs(decltype(nullptr) n); + ComponentChangingEventArgs(Plugin::InternalUse iu, int32_t handle); + ComponentChangingEventArgs(const ComponentChangingEventArgs& other); + ComponentChangingEventArgs(ComponentChangingEventArgs&& other); + virtual ~ComponentChangingEventArgs(); + ComponentChangingEventArgs& operator=(const ComponentChangingEventArgs& other); + ComponentChangingEventArgs& operator=(decltype(nullptr) other); + ComponentChangingEventArgs& operator=(ComponentChangingEventArgs&& other); + bool operator==(const ComponentChangingEventArgs& other) const; + bool operator!=(const ComponentChangingEventArgs& other) const; + }; + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentChangedEventArgs : System::EventArgs + { + ComponentChangedEventArgs(decltype(nullptr) n); + ComponentChangedEventArgs(Plugin::InternalUse iu, int32_t handle); + ComponentChangedEventArgs(const ComponentChangedEventArgs& other); + ComponentChangedEventArgs(ComponentChangedEventArgs&& other); + virtual ~ComponentChangedEventArgs(); + ComponentChangedEventArgs& operator=(const ComponentChangedEventArgs& other); + ComponentChangedEventArgs& operator=(decltype(nullptr) other); + ComponentChangedEventArgs& operator=(ComponentChangedEventArgs&& other); + bool operator==(const ComponentChangedEventArgs& other) const; + bool operator!=(const ComponentChangedEventArgs& other) const; + }; + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentRenameEventArgs : System::EventArgs + { + ComponentRenameEventArgs(decltype(nullptr) n); + ComponentRenameEventArgs(Plugin::InternalUse iu, int32_t handle); + ComponentRenameEventArgs(const ComponentRenameEventArgs& other); + ComponentRenameEventArgs(ComponentRenameEventArgs&& other); + virtual ~ComponentRenameEventArgs(); + ComponentRenameEventArgs& operator=(const ComponentRenameEventArgs& other); + ComponentRenameEventArgs& operator=(decltype(nullptr) other); + ComponentRenameEventArgs& operator=(ComponentRenameEventArgs&& other); + bool operator==(const ComponentRenameEventArgs& other) const; + bool operator!=(const ComponentRenameEventArgs& other) const; + }; + } + } +} + +namespace System +{ + namespace ComponentModel + { + struct MemberDescriptor : System::Object + { + MemberDescriptor(decltype(nullptr) n); + MemberDescriptor(Plugin::InternalUse iu, int32_t handle); + MemberDescriptor(const MemberDescriptor& other); + MemberDescriptor(MemberDescriptor&& other); + virtual ~MemberDescriptor(); + MemberDescriptor& operator=(const MemberDescriptor& other); + MemberDescriptor& operator=(decltype(nullptr) other); + MemberDescriptor& operator=(MemberDescriptor&& other); + bool operator==(const MemberDescriptor& other) const; + bool operator!=(const MemberDescriptor& other) const; + }; + } +} + namespace System { namespace Collections @@ -1681,26 +1917,6 @@ namespace System }; } -namespace System -{ - struct EventArgs : System::Object - { - EventArgs(decltype(nullptr) n); - EventArgs(Plugin::InternalUse iu, int32_t handle); - EventArgs(const EventArgs& other); - EventArgs(EventArgs&& other); - virtual ~EventArgs(); - EventArgs& operator=(const EventArgs& other); - EventArgs& operator=(decltype(nullptr) other); - EventArgs& operator=(EventArgs&& other); - bool operator==(const EventArgs& other) const; - bool operator!=(const EventArgs& other) const; - int32_t CppHandle; - EventArgs(); - virtual System::String ToString(); - }; -} - namespace System { namespace Collections @@ -1789,6 +2005,47 @@ namespace System } } +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct IComponentChangeService : System::Object + { + IComponentChangeService(decltype(nullptr) n); + IComponentChangeService(Plugin::InternalUse iu, int32_t handle); + IComponentChangeService(const IComponentChangeService& other); + IComponentChangeService(IComponentChangeService&& other); + virtual ~IComponentChangeService(); + IComponentChangeService& operator=(const IComponentChangeService& other); + IComponentChangeService& operator=(decltype(nullptr) other); + IComponentChangeService& operator=(IComponentChangeService&& other); + bool operator==(const IComponentChangeService& other) const; + bool operator!=(const IComponentChangeService& other) const; + int32_t CppHandle; + IComponentChangeService(); + virtual void OnComponentChanged(System::Object& component, System::ComponentModel::MemberDescriptor& member, System::Object& oldValue, System::Object& newValue); + virtual void OnComponentChanging(System::Object& component, System::ComponentModel::MemberDescriptor& member); + virtual void AddComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void RemoveComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void AddComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void RemoveComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void AddComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value); + virtual void RemoveComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value); + virtual void AddComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value); + virtual void RemoveComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value); + virtual void AddComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void RemoveComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void AddComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void RemoveComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void AddComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value); + virtual void RemoveComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value); + }; + } + } +} + namespace MyGame { namespace MonoBehaviours @@ -2323,4 +2580,124 @@ namespace UnityEngine }; } } + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentEventHandler : System::Object + { + ComponentEventHandler(decltype(nullptr) n); + ComponentEventHandler(Plugin::InternalUse iu, int32_t handle); + ComponentEventHandler(const ComponentEventHandler& other); + ComponentEventHandler(ComponentEventHandler&& other); + virtual ~ComponentEventHandler(); + ComponentEventHandler& operator=(const ComponentEventHandler& other); + ComponentEventHandler& operator=(decltype(nullptr) other); + ComponentEventHandler& operator=(ComponentEventHandler&& other); + bool operator==(const ComponentEventHandler& other) const; + bool operator!=(const ComponentEventHandler& other) const; + int32_t CppHandle; + int32_t ClassHandle; + ComponentEventHandler(); + void operator+=(System::ComponentModel::Design::ComponentEventHandler& del); + void operator-=(System::ComponentModel::Design::ComponentEventHandler& del); + virtual void operator()(System::Object& sender, System::ComponentModel::Design::ComponentEventArgs& e); + void Invoke(System::Object& sender, System::ComponentModel::Design::ComponentEventArgs& e); + }; + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentChangingEventHandler : System::Object + { + ComponentChangingEventHandler(decltype(nullptr) n); + ComponentChangingEventHandler(Plugin::InternalUse iu, int32_t handle); + ComponentChangingEventHandler(const ComponentChangingEventHandler& other); + ComponentChangingEventHandler(ComponentChangingEventHandler&& other); + virtual ~ComponentChangingEventHandler(); + ComponentChangingEventHandler& operator=(const ComponentChangingEventHandler& other); + ComponentChangingEventHandler& operator=(decltype(nullptr) other); + ComponentChangingEventHandler& operator=(ComponentChangingEventHandler&& other); + bool operator==(const ComponentChangingEventHandler& other) const; + bool operator!=(const ComponentChangingEventHandler& other) const; + int32_t CppHandle; + int32_t ClassHandle; + ComponentChangingEventHandler(); + void operator+=(System::ComponentModel::Design::ComponentChangingEventHandler& del); + void operator-=(System::ComponentModel::Design::ComponentChangingEventHandler& del); + virtual void operator()(System::Object& sender, System::ComponentModel::Design::ComponentChangingEventArgs& e); + void Invoke(System::Object& sender, System::ComponentModel::Design::ComponentChangingEventArgs& e); + }; + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentChangedEventHandler : System::Object + { + ComponentChangedEventHandler(decltype(nullptr) n); + ComponentChangedEventHandler(Plugin::InternalUse iu, int32_t handle); + ComponentChangedEventHandler(const ComponentChangedEventHandler& other); + ComponentChangedEventHandler(ComponentChangedEventHandler&& other); + virtual ~ComponentChangedEventHandler(); + ComponentChangedEventHandler& operator=(const ComponentChangedEventHandler& other); + ComponentChangedEventHandler& operator=(decltype(nullptr) other); + ComponentChangedEventHandler& operator=(ComponentChangedEventHandler&& other); + bool operator==(const ComponentChangedEventHandler& other) const; + bool operator!=(const ComponentChangedEventHandler& other) const; + int32_t CppHandle; + int32_t ClassHandle; + ComponentChangedEventHandler(); + void operator+=(System::ComponentModel::Design::ComponentChangedEventHandler& del); + void operator-=(System::ComponentModel::Design::ComponentChangedEventHandler& del); + virtual void operator()(System::Object& sender, System::ComponentModel::Design::ComponentChangedEventArgs& e); + void Invoke(System::Object& sender, System::ComponentModel::Design::ComponentChangedEventArgs& e); + }; + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct ComponentRenameEventHandler : System::Object + { + ComponentRenameEventHandler(decltype(nullptr) n); + ComponentRenameEventHandler(Plugin::InternalUse iu, int32_t handle); + ComponentRenameEventHandler(const ComponentRenameEventHandler& other); + ComponentRenameEventHandler(ComponentRenameEventHandler&& other); + virtual ~ComponentRenameEventHandler(); + ComponentRenameEventHandler& operator=(const ComponentRenameEventHandler& other); + ComponentRenameEventHandler& operator=(decltype(nullptr) other); + ComponentRenameEventHandler& operator=(ComponentRenameEventHandler&& other); + bool operator==(const ComponentRenameEventHandler& other) const; + bool operator!=(const ComponentRenameEventHandler& other) const; + int32_t CppHandle; + int32_t ClassHandle; + ComponentRenameEventHandler(); + void operator+=(System::ComponentModel::Design::ComponentRenameEventHandler& del); + void operator-=(System::ComponentModel::Design::ComponentRenameEventHandler& del); + virtual void operator()(System::Object& sender, System::ComponentModel::Design::ComponentRenameEventArgs& e); + void Invoke(System::Object& sender, System::ComponentModel::Design::ComponentRenameEventArgs& e); + }; + } + } +} /*END TYPE DEFINITIONS*/ From 754c23a41fe222c65a4772c76d4caa33d2b7d12a Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 3 Dec 2017 14:01:33 -0800 Subject: [PATCH 45/95] Fix generic method declarations Add another example MonoBehaviour --- Unity/Assets/NativeScript/Bindings.cs | 205 ++++++++++++ Unity/Assets/NativeScript/BootScene.unity | 108 +++--- .../NativeScript/Editor/GenerateBindings.cs | 110 +++++-- Unity/Assets/NativeScriptTypes.json | 40 ++- Unity/CppSource/Game/Game.cpp | 34 ++ Unity/CppSource/NativeScript/Bindings.cpp | 310 ++++++++++++++++++ Unity/CppSource/NativeScript/Bindings.h | 99 +++++- 7 files changed, 816 insertions(+), 90 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index b6fd6c0..c180649 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -286,6 +286,8 @@ delegate void InitDelegate( IntPtr unityEngineGameObjectConstructorSystemString, IntPtr unityEngineGameObjectPropertyGetTransform, IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript, + IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript, + IntPtr unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType, IntPtr unityEngineComponentPropertyGetTransform, IntPtr unityEngineTransformPropertyGetPosition, IntPtr unityEngineTransformPropertySetPosition, @@ -294,6 +296,7 @@ delegate void InitDelegate( IntPtr unityEngineAssertionsAssertFieldSetRaiseExceptions, IntPtr unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString, IntPtr unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject, + IntPtr unityEngineMonoBehaviourPropertyGetTransform, IntPtr unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32, IntPtr unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte, IntPtr unityEngineNetworkingNetworkTransportMethodInit, @@ -373,6 +376,9 @@ delegate void InitDelegate( IntPtr unboxLoadSceneMode, IntPtr systemCollectionsIEnumeratorPropertyGetCurrent, IntPtr systemCollectionsIEnumeratorMethodMoveNext, + IntPtr boxPrimitiveType, + IntPtr unboxPrimitiveType, + IntPtr unityEngineTimePropertyGetDeltaTime, IntPtr releaseSystemCollectionsGenericIComparerSystemInt32, IntPtr systemCollectionsGenericIComparerSystemInt32Constructor, IntPtr releaseSystemCollectionsGenericIComparerSystemString, @@ -643,6 +649,12 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke public delegate void MyGameMonoBehavioursTestScriptUpdateDelegate(int thisHandle); public static MyGameMonoBehavioursTestScriptUpdateDelegate MyGameMonoBehavioursTestScriptUpdate; + public delegate void MyGameMonoBehavioursAnotherScriptAwakeDelegate(int thisHandle); + public static MyGameMonoBehavioursAnotherScriptAwakeDelegate MyGameMonoBehavioursAnotherScriptAwake; + + public delegate void MyGameMonoBehavioursAnotherScriptUpdateDelegate(int thisHandle); + public static MyGameMonoBehavioursAnotherScriptUpdateDelegate MyGameMonoBehavioursAnotherScriptUpdate; + public delegate void SystemActionNativeInvokeDelegate(int thisHandle); public static SystemActionNativeInvokeDelegate SystemActionNativeInvoke; @@ -792,6 +804,8 @@ static extern void Init( IntPtr unityEngineGameObjectConstructorSystemString, IntPtr unityEngineGameObjectPropertyGetTransform, IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript, + IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript, + IntPtr unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType, IntPtr unityEngineComponentPropertyGetTransform, IntPtr unityEngineTransformPropertyGetPosition, IntPtr unityEngineTransformPropertySetPosition, @@ -800,6 +814,7 @@ static extern void Init( IntPtr unityEngineAssertionsAssertFieldSetRaiseExceptions, IntPtr unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString, IntPtr unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject, + IntPtr unityEngineMonoBehaviourPropertyGetTransform, IntPtr unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32, IntPtr unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte, IntPtr unityEngineNetworkingNetworkTransportMethodInit, @@ -879,6 +894,9 @@ static extern void Init( IntPtr unboxLoadSceneMode, IntPtr systemCollectionsIEnumeratorPropertyGetCurrent, IntPtr systemCollectionsIEnumeratorMethodMoveNext, + IntPtr boxPrimitiveType, + IntPtr unboxPrimitiveType, + IntPtr unityEngineTimePropertyGetDeltaTime, IntPtr releaseSystemCollectionsGenericIComparerSystemInt32, IntPtr systemCollectionsGenericIComparerSystemInt32Constructor, IntPtr releaseSystemCollectionsGenericIComparerSystemString, @@ -1150,6 +1168,12 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke [DllImport(Constants.PluginName)] public static extern void MyGameMonoBehavioursTestScriptUpdate(int thisHandle); + [DllImport(Constants.PluginName)] + public static extern void MyGameMonoBehavioursAnotherScriptAwake(int thisHandle); + + [DllImport(Constants.PluginName)] + public static extern void MyGameMonoBehavioursAnotherScriptUpdate(int thisHandle); + [DllImport(Constants.PluginName)] public static extern void SystemActionNativeInvoke(int thisHandle); @@ -1209,6 +1233,8 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate int UnityEngineGameObjectConstructorSystemStringDelegate(int nameHandle); delegate int UnityEngineGameObjectPropertyGetTransformDelegate(int thisHandle); delegate int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate(int thisHandle); + delegate int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScriptDelegate(int thisHandle); + delegate int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate(UnityEngine.PrimitiveType type); delegate int UnityEngineComponentPropertyGetTransformDelegate(int thisHandle); delegate UnityEngine.Vector3 UnityEngineTransformPropertyGetPositionDelegate(int thisHandle); delegate void UnityEngineTransformPropertySetPositionDelegate(int thisHandle, ref UnityEngine.Vector3 value); @@ -1217,6 +1243,7 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate void UnityEngineAssertionsAssertFieldSetRaiseExceptionsDelegate(bool value); delegate void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemStringDelegate(int expectedHandle, int actualHandle); delegate void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObjectDelegate(int expectedHandle, int actualHandle); + delegate int UnityEngineMonoBehaviourPropertyGetTransformDelegate(int thisHandle); 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(); @@ -1296,6 +1323,9 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneModeDelegate(int valHandle); delegate int SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(int thisHandle); delegate bool SystemCollectionsIEnumeratorMethodMoveNextDelegate(int thisHandle); + delegate int BoxPrimitiveTypeDelegate(UnityEngine.PrimitiveType val); + delegate UnityEngine.PrimitiveType UnboxPrimitiveTypeDelegate(int valHandle); + delegate float UnityEngineTimePropertyGetDeltaTimeDelegate(); delegate void SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate(int cppHandle, ref int handle); delegate void ReleaseSystemCollectionsGenericIComparerSystemInt32Delegate(int handle); delegate void SystemCollectionsGenericIComparerSystemStringConstructorDelegate(int cppHandle, ref int handle); @@ -1501,6 +1531,8 @@ public static void Open( MyGameMonoBehavioursTestScriptOnAnimatorIK = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptOnAnimatorIK"); MyGameMonoBehavioursTestScriptOnCollisionEnter = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptOnCollisionEnter"); MyGameMonoBehavioursTestScriptUpdate = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptUpdate"); + MyGameMonoBehavioursAnotherScriptAwake = GetDelegate(libraryHandle, "MyGameMonoBehavioursAnotherScriptAwake"); + MyGameMonoBehavioursAnotherScriptUpdate = GetDelegate(libraryHandle, "MyGameMonoBehavioursAnotherScriptUpdate"); SystemActionNativeInvoke = GetDelegate(libraryHandle, "SystemActionNativeInvoke"); SystemActionSystemSingleNativeInvoke = GetDelegate(libraryHandle, "SystemActionSystemSingleNativeInvoke"); SystemActionSystemSingle_SystemSingleNativeInvoke = GetDelegate(libraryHandle, "SystemActionSystemSingle_SystemSingleNativeInvoke"); @@ -1538,6 +1570,8 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectConstructorSystemStringDelegate(UnityEngineGameObjectConstructorSystemString)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectPropertyGetTransformDelegate(UnityEngineGameObjectPropertyGetTransform)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScriptDelegate(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)), Marshal.GetFunctionPointerForDelegate(new UnityEngineComponentPropertyGetTransformDelegate(UnityEngineComponentPropertyGetTransform)), Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformPropertyGetPositionDelegate(UnityEngineTransformPropertyGetPosition)), Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformPropertySetPositionDelegate(UnityEngineTransformPropertySetPosition)), @@ -1546,6 +1580,7 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnityEngineAssertionsAssertFieldSetRaiseExceptionsDelegate(UnityEngineAssertionsAssertFieldSetRaiseExceptions)), Marshal.GetFunctionPointerForDelegate(new UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemStringDelegate(UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString)), Marshal.GetFunctionPointerForDelegate(new UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObjectDelegate(UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineMonoBehaviourPropertyGetTransformDelegate(UnityEngineMonoBehaviourPropertyGetTransform)), Marshal.GetFunctionPointerForDelegate(new UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate(UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)), Marshal.GetFunctionPointerForDelegate(new UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate(UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)), Marshal.GetFunctionPointerForDelegate(new UnityEngineNetworkingNetworkTransportMethodInitDelegate(UnityEngineNetworkingNetworkTransportMethodInit)), @@ -1625,6 +1660,9 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnboxLoadSceneModeDelegate(UnboxLoadSceneMode)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(SystemCollectionsIEnumeratorPropertyGetCurrent)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIEnumeratorMethodMoveNextDelegate(SystemCollectionsIEnumeratorMethodMoveNext)), + Marshal.GetFunctionPointerForDelegate(new BoxPrimitiveTypeDelegate(BoxPrimitiveType)), + Marshal.GetFunctionPointerForDelegate(new UnboxPrimitiveTypeDelegate(UnboxPrimitiveType)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineTimePropertyGetDeltaTimeDelegate(UnityEngineTimePropertyGetDeltaTime)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericIComparerSystemInt32Delegate(ReleaseSystemCollectionsGenericIComparerSystemInt32)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate(SystemCollectionsGenericIComparerSystemInt32Constructor)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericIComparerSystemStringDelegate(ReleaseSystemCollectionsGenericIComparerSystemString)), @@ -3263,6 +3301,51 @@ static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript } } + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScriptDelegate))] + static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript(int thisHandle) + { + try + { + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.AddComponent(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate))] + static int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(UnityEngine.PrimitiveType type) + { + try + { + var returnValue = UnityEngine.GameObject.CreatePrimitive(type); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + [MonoPInvokeCallback(typeof(UnityEngineComponentPropertyGetTransformDelegate))] static int UnityEngineComponentPropertyGetTransform(int thisHandle) { @@ -3432,6 +3515,29 @@ static void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityE } } + [MonoPInvokeCallback(typeof(UnityEngineMonoBehaviourPropertyGetTransformDelegate))] + static int UnityEngineMonoBehaviourPropertyGetTransform(int thisHandle) + { + try + { + var thiz = (UnityEngine.MonoBehaviour)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + [MonoPInvokeCallback(typeof(UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate))] static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(ref int bufferLength, ref int numBuffers) { @@ -5158,6 +5264,73 @@ static bool SystemCollectionsIEnumeratorMethodMoveNext(int thisHandle) } } + [MonoPInvokeCallback(typeof(BoxPrimitiveTypeDelegate))] + static int BoxPrimitiveType(UnityEngine.PrimitiveType val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxPrimitiveTypeDelegate))] + static UnityEngine.PrimitiveType UnboxPrimitiveType(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.PrimitiveType)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.PrimitiveType); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.PrimitiveType); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineTimePropertyGetDeltaTimeDelegate))] + static float UnityEngineTimePropertyGetDeltaTime() + { + try + { + var returnValue = UnityEngine.Time.deltaTime; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + } + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate))] static void SystemCollectionsGenericIComparerSystemInt32Constructor(int cppHandle, ref int handle) { @@ -7875,4 +8048,36 @@ public void Update() } } } +namespace MyGame +{ + namespace MonoBehaviours + { + public class AnotherScript : UnityEngine.MonoBehaviour + { + public void Awake() + { + int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); + NativeScript.Bindings.MyGameMonoBehavioursAnotherScriptAwake(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + + public void Update() + { + int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); + NativeScript.Bindings.MyGameMonoBehavioursAnotherScriptUpdate(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + } +} /*END MONOBEHAVIOURS*/ \ No newline at end of file diff --git a/Unity/Assets/NativeScript/BootScene.unity b/Unity/Assets/NativeScript/BootScene.unity index 49ab8b7..c38824f 100644 --- a/Unity/Assets/NativeScript/BootScene.unity +++ b/Unity/Assets/NativeScript/BootScene.unity @@ -77,15 +77,17 @@ LightmapSettings: m_PVRDirectSampleCount: 32 m_PVRSampleCount: 500 m_PVRBounces: 2 - m_PVRFiltering: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 m_PVRFilteringMode: 1 m_PVRCulling: 1 m_PVRFilteringGaussRadiusDirect: 1 m_PVRFilteringGaussRadiusIndirect: 5 m_PVRFilteringGaussRadiusAO: 2 - m_PVRFilteringAtrousColorSigma: 1 - m_PVRFilteringAtrousNormalSigma: 1 - m_PVRFilteringAtrousPositionSigma: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 m_LightingDataAsset: {fileID: 0} m_UseShadowmask: 1 --- !u!196 &4 @@ -107,6 +109,8 @@ NavMeshSettings: manualTileSize: 0 tileSize: 256 accuratePlacement: 0 + debug: + m_Flags: 0 m_NavMeshData: {fileID: 0} --- !u!1 &643357608 GameObject: @@ -149,83 +153,81 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1 &1835393739 +--- !u!1 &1667680821 GameObject: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} serializedVersion: 5 m_Component: - - component: {fileID: 1835393743} - - component: {fileID: 1835393742} - - component: {fileID: 1835393741} - - component: {fileID: 1835393740} + - component: {fileID: 1667680825} + - component: {fileID: 1667680824} + - component: {fileID: 1667680823} + - component: {fileID: 1667680822} m_Layer: 0 - m_Name: Sphere + m_Name: Camera m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!23 &1835393740 -MeshRenderer: +--- !u!81 &1667680822 +AudioListener: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1835393739} + m_GameObject: {fileID: 1667680821} m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_PreserveUVs: 1 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 ---- !u!135 &1835393741 -SphereCollider: +--- !u!124 &1667680823 +Behaviour: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1835393739} - m_Material: {fileID: 0} - m_IsTrigger: 0 + m_GameObject: {fileID: 1667680821} m_Enabled: 1 - serializedVersion: 2 - m_Radius: 0.5 - m_Center: {x: 0, y: 0, z: 0} ---- !u!33 &1835393742 -MeshFilter: +--- !u!20 &1667680824 +Camera: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1835393739} - m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} ---- !u!4 &1835393743 + m_GameObject: {fileID: 1667680821} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1667680825 Transform: m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 1835393739} + m_GameObject: {fileID: 1667680821} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: -2} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 1f8ce78..8fd346d 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -1111,6 +1111,13 @@ static bool IsFullValueType(Type type) return true; } + static int ArrayIndexOf(T[] array, T value) + { + return array != null ? + Array.IndexOf(array, value) : + -1; + } + static void AppendTypeNameWithoutGenericSuffix( string typeName, StringBuilder output) @@ -1945,6 +1952,7 @@ static void AppendBoxingUnboxing( false, false, null, + typeParams, null, boxParams, builders.CppBoxingMethodDeclarations); @@ -1957,6 +1965,7 @@ static void AppendBoxingUnboxing( false, false, null, + typeParams, null, unboxCppParams, builders.CppBoxingMethodDeclarations); @@ -2296,6 +2305,7 @@ static void AppendConstructor( false, false, null, + enclosingTypeParams, null, parameters, builders.CppTypeDefinitions); @@ -2849,6 +2859,7 @@ static void AppendEventAddRemoveMethod( false, cppMethodIsStatic, cppReturnType, + typeTypeParams, null, cppParameters, builders.CppTypeDefinitions); @@ -3039,6 +3050,7 @@ static void AppendMethod( if (jsonMethod.GenericParams != null) { // Generate for each set of generic types + bool generateDeclaration = true; foreach (JsonGenericParams jsonGenericParams in jsonMethod.GenericParams) { @@ -3062,9 +3074,11 @@ static void AppendMethod( typeTypeParams, methodTypeParams, parameters, + generateDeclaration, indent, exceptionTypes, builders); + generateDeclaration = false; } } else @@ -3085,6 +3099,7 @@ static void AppendMethod( typeTypeParams, null, parameters, + true, indent, exceptionTypes, builders); @@ -3160,6 +3175,7 @@ static void AppendMethod( Type[] enclosingTypeParams, Type[] methodTypeParams, ParameterInfo[] parameters, + bool generateDeclaration, int indent, Type[] exceptionTypes, StringBuilders builders) @@ -3534,18 +3550,22 @@ static void AppendMethod( cppParameters = parameters; cppCallParameters = parameters; } - AppendIndent( - indent + 1, - builders.CppTypeDefinitions); - AppendCppMethodDeclaration( - cppMethodName, - enclosingTypeIsStatic, - false, - cppMethodIsStatic, - cppReturnType, - methodTypeParams, - cppParameters, - builders.CppTypeDefinitions); + if (generateDeclaration) + { + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + cppMethodName, + enclosingTypeIsStatic, + false, + cppMethodIsStatic, + cppReturnType, + enclosingTypeParams, + methodTypeParams, + cppParameters, + builders.CppTypeDefinitions); + } // C++ method definition AppendCppMethodDefinitionBegin( @@ -3750,6 +3770,7 @@ static void AppendMonoBehaviour( false, typeof(void), null, + null, parameters, builders.CppTypeDefinitions); @@ -4946,6 +4967,7 @@ static void AppendArrayConstructor( false, null, null, + null, parameters, builders.CppTypeDefinitions); @@ -5080,6 +5102,7 @@ static void AppendArrayCppGetLengthFunction( false, typeof(int), null, + null, parameters, builders.CppTypeDefinitions); @@ -5158,6 +5181,7 @@ static void AppendArrayCppGetRankFunction( false, typeof(int), null, + null, parameters, builders.CppTypeDefinitions); @@ -5305,6 +5329,7 @@ static void AppendArrayMultidimensionalGetLength( false, typeof(int), null, + null, parameters, builders.CppTypeDefinitions); @@ -5833,6 +5858,7 @@ static void AppendDelegate( false, false, null, + typeParams, null, new ParameterInfo[0], builders.CppTypeDefinitions); @@ -5845,6 +5871,7 @@ static void AppendDelegate( false, false, typeof(void), + typeParams, null, addRemoveParams, builders.CppTypeDefinitions); @@ -5857,6 +5884,7 @@ static void AppendDelegate( false, false, typeof(void), + typeParams, null, addRemoveParams, builders.CppTypeDefinitions); @@ -6429,6 +6457,7 @@ static void AppendBaseType( false, false, null, + typeParams, null, new ParameterInfo[0], builders.CppTypeDefinitions); @@ -7263,6 +7292,7 @@ static void AppendBaseTypeMethodCallsCsharpMethod( false, false, methodInfo.ReturnType, + typeParams, null, invokeParams, builders.CppTypeDefinitions); @@ -7483,6 +7513,7 @@ static ParameterInfo[] AppendBaseTypeCppNativeInvokeCall( true, false, invokeMethod.ReturnType, + typeParams, null, invokeParams, builders.CppTypeDefinitions); @@ -9586,6 +9617,7 @@ static void AppendGetter( false, methodIsStatic, fieldType, + enclosingTypeParams, null, parameters, builders.CppTypeDefinitions); @@ -9778,6 +9810,7 @@ static void AppendSetter( false, methodIsStatic, typeof(void), + enclosingTypeParams, null, parameters, builders.CppTypeDefinitions); @@ -9867,6 +9900,7 @@ static void AppendCppTemplateDeclaration( output); AppendCppTemplateTypenames( numTypeParameters, + 'T', output); output.Append("struct "); AppendTypeNameWithoutGenericSuffix( @@ -11187,15 +11221,29 @@ static void AppendCsharpBindingParameterDeclaration( static void AppendCppParameterDeclaration( ParameterInfo[] parameters, + Type[] typeTypeParameters, + Type[] methodTypeParameters, StringBuilder output) { for (int i = 0; i < parameters.Length; ++i) { ParameterInfo param = parameters[i]; + Type paramType = param.DereferencedParameterType; - AppendCppTypeName( - param.DereferencedParameterType, - output); + int typeParamIndex = ArrayIndexOf( + methodTypeParameters, + paramType); + if (typeParamIndex >= 0) + { + output.Append("MT"); + output.Append(typeParamIndex); + } + else + { + AppendCppTypeName( + paramType, + output); + } // Pointer (*) or reference (&) suffix if necessary if (param.IsOut || param.IsRef) @@ -11287,6 +11335,8 @@ static void AppendCppMethodDefinitionBegin( output.Append('('); AppendCppParameterDeclaration( parameters, + null, // don't substitute type type params + null, // don't substitute method type params output); output.Append(")\n"); } @@ -11598,6 +11648,7 @@ static void AppendCppFunctionPointer( static void AppendCppTemplateTypenames( int numTypeParameters, + char prefix, StringBuilder output) { if (numTypeParameters > 0) @@ -11605,7 +11656,9 @@ static void AppendCppTemplateTypenames( output.Append("template<"); for (int i = 0; i < numTypeParameters; ++i) { - output.Append("typename T"); + output.Append("typename "); + output.Append(prefix); + output.Append('T'); output.Append(i); if (i != numTypeParameters - 1) { @@ -11622,12 +11675,14 @@ static void AppendCppMethodDeclaration( bool methodIsVirtual, bool methodIsStatic, Type returnType, - Type[] typeParameters, + Type[] typeTypeParameters, + Type[] methodTypeParameters, ParameterInfo[] parameters, StringBuilder output) { AppendCppTemplateTypenames( - typeParameters == null ? 0 : typeParameters.Length, + methodTypeParameters == null ? 0 : methodTypeParameters.Length, + 'M', output); if (!enclosingTypeIsStatic && methodIsStatic) @@ -11643,9 +11698,20 @@ static void AppendCppMethodDeclaration( // Return type if (returnType != null) { - AppendCppTypeName( - returnType, - output); + int typeParamIndex = ArrayIndexOf( + methodTypeParameters, + returnType); + if (typeParamIndex >= 0) + { + output.Append("MT"); + output.Append(typeParamIndex); + } + else + { + AppendCppTypeName( + returnType, + output); + } output.Append(' '); } @@ -11659,6 +11725,8 @@ static void AppendCppMethodDeclaration( output.Append('('); AppendCppParameterDeclaration( parameters, + typeTypeParameters, + methodTypeParameters, output); output.Append(')'); diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index fa0d271..d60a4df 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -73,11 +73,22 @@ "Types": [ "MyGame.MonoBehaviours.TestScript" ] + }, + { + "Types": [ + "MyGame.MonoBehaviours.AnotherScript" + ] } ], "Exceptions": [ "System.NullReferenceException" ] + }, + { + "Name": "CreatePrimitive", + "ParamTypes": [ + "UnityEngine.PrimitiveType" + ] } ], "Properties": [ @@ -159,7 +170,14 @@ "Name": "UnityEngine.Behaviour" }, { - "Name": "UnityEngine.MonoBehaviour" + "Name": "UnityEngine.MonoBehaviour", + "Properties": [ + { + "Name": "transform", + "Get": {}, + "Set": {} + } + ] }, { "Name": "UnityEngine.AudioSettings", @@ -572,6 +590,19 @@ }, { "Name": "System.ComponentModel.MemberDescriptor" + }, + { + "Name": "UnityEngine.PrimitiveType" + }, + { + "Name": "UnityEngine.Time", + "Properties": [ + { + "Name": "deltaTime", + "Get": {}, + "Set": {} + } + ] } ], "BaseTypes": [ @@ -622,6 +653,13 @@ "OnCollisionEnter", "Update" ] + }, + { + "Name": "MyGame.MonoBehaviours.AnotherScript", + "Messages": [ + "Awake", + "Update" + ] } ], "Arrays": [ diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index 8526d53..f7caf26 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -58,6 +58,40 @@ void MyGame::MonoBehaviours::TestScript::Update() { String message("Done spawning game objects"); Debug::Log(message); + + GameObject go = GameObject::CreatePrimitive(PrimitiveType::Sphere); + String name("GameObject with an AnotherScript"); + go.SetName(name); + go.AddComponent(); } } } + +void MyGame::MonoBehaviours::AnotherScript::Awake() +{ + String message("C++ AnotherScript Awake"); + Debug::Log(message); +} + +void MyGame::MonoBehaviours::AnotherScript::Update() +{ + Transform transform = GetTransform(); + Vector3 pos = transform.GetPosition(); + const float speed = 1.2f; + static float dir = 1.0f; + static float min = -1.5f; + static float max = 1.5f; + Vector3 offset(Time::GetDeltaTime() * speed * dir, 0, 0); + Vector3 newPos = pos + offset; + if (newPos.x > max) + { + dir = -dir; + newPos.x = max - (newPos.x - max); + } + else if (newPos.x < min) + { + dir = -dir; + newPos.x = min + (min - newPos.x); + } + transform.SetPosition(newPos); +} diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index c99a94c..9127c40 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -52,6 +52,8 @@ namespace Plugin int32_t (*UnityEngineGameObjectConstructorSystemString)(int32_t nameHandle); int32_t (*UnityEngineGameObjectPropertyGetTransform)(int32_t thisHandle); int32_t (*UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle); + int32_t (*UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript)(int32_t thisHandle); + int32_t (*UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)(UnityEngine::PrimitiveType type); int32_t (*UnityEngineComponentPropertyGetTransform)(int32_t thisHandle); UnityEngine::Vector3 (*UnityEngineTransformPropertyGetPosition)(int32_t thisHandle); void (*UnityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value); @@ -60,6 +62,7 @@ namespace Plugin void (*UnityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value); void (*UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString)(int32_t expectedHandle, int32_t actualHandle); void (*UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject)(int32_t expectedHandle, int32_t actualHandle); + int32_t (*UnityEngineMonoBehaviourPropertyGetTransform)(int32_t thisHandle); void (*UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)(int32_t* bufferLength, int32_t* numBuffers); void (*UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)(int32_t hostId, int32_t* addressHandle, int32_t* port, uint8_t* error); void (*UnityEngineNetworkingNetworkTransportMethodInit)(); @@ -139,6 +142,9 @@ namespace Plugin UnityEngine::SceneManagement::LoadSceneMode (*UnboxLoadSceneMode)(int32_t valHandle); int32_t (*SystemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle); System::Boolean (*SystemCollectionsIEnumeratorMethodMoveNext)(int32_t thisHandle); + int32_t (*BoxPrimitiveType)(UnityEngine::PrimitiveType val); + UnityEngine::PrimitiveType (*UnboxPrimitiveType)(int32_t valHandle); + float (*UnityEngineTimePropertyGetDeltaTime)(); void (*ReleaseSystemCollectionsGenericIComparerSystemInt32)(int32_t handle); void (*SystemCollectionsGenericIComparerSystemInt32Constructor)(int32_t cppHandle, int32_t* handle); void (*ReleaseSystemCollectionsGenericIComparerSystemString)(int32_t handle); @@ -1411,6 +1417,32 @@ namespace UnityEngine } return MyGame::MonoBehaviours::TestScript(Plugin::InternalUse::Only, returnValue); } + + template<> MyGame::MonoBehaviours::AnotherScript GameObject::AddComponent() + { + auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return MyGame::MonoBehaviours::AnotherScript(Plugin::InternalUse::Only, returnValue); + } + + UnityEngine::GameObject GameObject::CreatePrimitive(UnityEngine::PrimitiveType type) + { + auto returnValue = Plugin::UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(type); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::GameObject(Plugin::InternalUse::Only, returnValue); + } } namespace UnityEngine @@ -2008,6 +2040,19 @@ namespace UnityEngine { return Handle != other.Handle; } + + UnityEngine::Transform MonoBehaviour::GetTransform() + { + auto returnValue = Plugin::UnityEngineMonoBehaviourPropertyGetTransform(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); + } } namespace UnityEngine @@ -5377,6 +5422,134 @@ namespace System } } +namespace System +{ + Object::Object(UnityEngine::PrimitiveType val) + { + int32_t handle = Plugin::BoxPrimitiveType(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::PrimitiveType() + { + UnityEngine::PrimitiveType returnVal(Plugin::UnboxPrimitiveType(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace UnityEngine +{ + Time::Time(decltype(nullptr) n) + : Time(Plugin::InternalUse::Only, 0) + { + } + + Time::Time(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Time::Time(const Time& other) + : Time(Plugin::InternalUse::Only, other.Handle) + { + } + + Time::Time(Time&& other) + : Time(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Time::~Time() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Time& Time::operator=(const Time& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Time& Time::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Time& Time::operator=(Time&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Time::operator==(const Time& other) const + { + return Handle == other.Handle; + } + + bool Time::operator!=(const Time& other) const + { + return Handle != other.Handle; + } + + float Time::GetDeltaTime() + { + auto returnValue = Plugin::UnityEngineTimePropertyGetDeltaTime(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } +} + namespace System { namespace Collections @@ -7997,6 +8170,91 @@ namespace MyGame } } +namespace MyGame +{ + namespace MonoBehaviours + { + AnotherScript::AnotherScript(decltype(nullptr) n) + : AnotherScript(Plugin::InternalUse::Only, 0) + { + } + + AnotherScript::AnotherScript(Plugin::InternalUse iu, int32_t handle) + : UnityEngine::MonoBehaviour(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + AnotherScript::AnotherScript(const AnotherScript& other) + : AnotherScript(Plugin::InternalUse::Only, other.Handle) + { + } + + AnotherScript::AnotherScript(AnotherScript&& other) + : AnotherScript(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + AnotherScript::~AnotherScript() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + AnotherScript& AnotherScript::operator=(const AnotherScript& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + AnotherScript& AnotherScript::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + AnotherScript& AnotherScript::operator=(AnotherScript&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool AnotherScript::operator==(const AnotherScript& other) const + { + return Handle == other.Handle; + } + + bool AnotherScript::operator!=(const AnotherScript& other) const + { + return Handle != other.Handle; + } + } +} + namespace Plugin { ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) @@ -12265,6 +12523,8 @@ DLLEXPORT void Init( int32_t (*unityEngineGameObjectConstructorSystemString)(int32_t nameHandle), int32_t (*unityEngineGameObjectPropertyGetTransform)(int32_t thisHandle), int32_t (*unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle), + int32_t (*unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript)(int32_t thisHandle), + int32_t (*unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)(UnityEngine::PrimitiveType type), int32_t (*unityEngineComponentPropertyGetTransform)(int32_t thisHandle), UnityEngine::Vector3 (*unityEngineTransformPropertyGetPosition)(int32_t thisHandle), void (*unityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value), @@ -12273,6 +12533,7 @@ DLLEXPORT void Init( void (*unityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value), void (*unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString)(int32_t expectedHandle, int32_t actualHandle), void (*unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject)(int32_t expectedHandle, int32_t actualHandle), + int32_t (*unityEngineMonoBehaviourPropertyGetTransform)(int32_t thisHandle), void (*unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)(int32_t* bufferLength, int32_t* numBuffers), void (*unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)(int32_t hostId, int32_t* addressHandle, int32_t* port, uint8_t* error), void (*unityEngineNetworkingNetworkTransportMethodInit)(), @@ -12352,6 +12613,9 @@ DLLEXPORT void Init( UnityEngine::SceneManagement::LoadSceneMode (*unboxLoadSceneMode)(int32_t valHandle), int32_t (*systemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle), System::Boolean (*systemCollectionsIEnumeratorMethodMoveNext)(int32_t thisHandle), + int32_t (*boxPrimitiveType)(UnityEngine::PrimitiveType val), + UnityEngine::PrimitiveType (*unboxPrimitiveType)(int32_t valHandle), + float (*unityEngineTimePropertyGetDeltaTime)(), void (*releaseSystemCollectionsGenericIComparerSystemInt32)(int32_t handle), void (*systemCollectionsGenericIComparerSystemInt32Constructor)(int32_t cppHandle, int32_t* handle), void (*releaseSystemCollectionsGenericIComparerSystemString)(int32_t handle), @@ -12502,6 +12766,8 @@ DLLEXPORT void Init( Plugin::UnityEngineGameObjectConstructorSystemString = unityEngineGameObjectConstructorSystemString; Plugin::UnityEngineGameObjectPropertyGetTransform = unityEngineGameObjectPropertyGetTransform; Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript = unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript; + Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript = unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript; + Plugin::UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType = unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType; Plugin::UnityEngineComponentPropertyGetTransform = unityEngineComponentPropertyGetTransform; Plugin::UnityEngineTransformPropertyGetPosition = unityEngineTransformPropertyGetPosition; Plugin::UnityEngineTransformPropertySetPosition = unityEngineTransformPropertySetPosition; @@ -12510,6 +12776,7 @@ DLLEXPORT void Init( Plugin::UnityEngineAssertionsAssertFieldSetRaiseExceptions = unityEngineAssertionsAssertFieldSetRaiseExceptions; Plugin::UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString = unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString; Plugin::UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject = unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject; + Plugin::UnityEngineMonoBehaviourPropertyGetTransform = unityEngineMonoBehaviourPropertyGetTransform; Plugin::UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32 = unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32; Plugin::UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte = unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte; Plugin::UnityEngineNetworkingNetworkTransportMethodInit = unityEngineNetworkingNetworkTransportMethodInit; @@ -12591,6 +12858,9 @@ DLLEXPORT void Init( Plugin::UnboxLoadSceneMode = unboxLoadSceneMode; Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent = systemCollectionsIEnumeratorPropertyGetCurrent; Plugin::SystemCollectionsIEnumeratorMethodMoveNext = systemCollectionsIEnumeratorMethodMoveNext; + Plugin::BoxPrimitiveType = boxPrimitiveType; + Plugin::UnboxPrimitiveType = unboxPrimitiveType; + Plugin::UnityEngineTimePropertyGetDeltaTime = unityEngineTimePropertyGetDeltaTime; SystemCollectionsGenericIComparerSystemInt32FreeListSize = maxManagedObjects; SystemCollectionsGenericIComparerSystemInt32FreeList = new System::Collections::Generic::IComparer*[SystemCollectionsGenericIComparerSystemInt32FreeListSize]; for (int32_t i = 0, end = SystemCollectionsGenericIComparerSystemInt32FreeListSize - 1; i < end; ++i) @@ -12973,4 +13243,44 @@ DLLEXPORT void MyGameMonoBehavioursTestScriptUpdate(int32_t thisHandle) Plugin::SetException(ex.Handle); } } + + +DLLEXPORT void MyGameMonoBehavioursAnotherScriptAwake(int32_t thisHandle) +{ + MyGame::MonoBehaviours::AnotherScript thiz(Plugin::InternalUse::Only, thisHandle); + try + { + thiz.Awake(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception in MyGame::MonoBehaviours::AnotherScript::Awake"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } +} + + +DLLEXPORT void MyGameMonoBehavioursAnotherScriptUpdate(int32_t thisHandle) +{ + MyGame::MonoBehaviours::AnotherScript thiz(Plugin::InternalUse::Only, thisHandle); + try + { + thiz.Update(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception in MyGame::MonoBehaviours::AnotherScript::Update"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } +} /*END MONOBEHAVIOUR MESSAGES*/ diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 890fbc6..d6005b8 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -310,7 +310,7 @@ namespace System { namespace Generic { - template struct KeyValuePair; + template struct KeyValuePair; } } } @@ -332,7 +332,7 @@ namespace System { namespace Generic { - template struct List; + template struct List; } } } @@ -365,7 +365,7 @@ namespace System { namespace Generic { - template struct LinkedListNode; + template struct LinkedListNode; } } } @@ -387,7 +387,7 @@ namespace System { namespace CompilerServices { - template struct StrongBox; + template struct StrongBox; } } } @@ -409,7 +409,7 @@ namespace System { namespace ObjectModel { - template struct Collection; + template struct Collection; } } } @@ -431,7 +431,7 @@ namespace System { namespace ObjectModel { - template struct KeyedCollection; + template struct KeyedCollection; } } } @@ -600,13 +600,31 @@ namespace System } } +namespace UnityEngine +{ + enum struct PrimitiveType : int32_t + { + Sphere = 0, + Capsule = 1, + Cylinder = 2, + Cube = 3, + Plane = 4, + Quad = 5 + }; +} + +namespace UnityEngine +{ + struct Time; +} + namespace System { namespace Collections { namespace Generic { - template struct IComparer; + template struct IComparer; } } } @@ -681,6 +699,14 @@ namespace MyGame } } +namespace MyGame +{ + namespace MonoBehaviours + { + struct AnotherScript; + } +} + namespace Plugin { template<> struct ArrayElementProxy1_1; @@ -783,7 +809,7 @@ namespace System namespace System { - template struct Action1; + template struct Action1; } namespace System @@ -793,7 +819,7 @@ namespace System namespace System { - template struct Action2; + template struct Action2; } namespace System @@ -803,12 +829,12 @@ namespace System namespace System { - template struct Func3; + template struct Func3; } namespace System { - template struct Func3; + template struct Func3; } namespace System @@ -838,7 +864,7 @@ namespace UnityEngine { namespace Events { - template struct UnityAction2; + template struct UnityAction2; } } @@ -934,6 +960,8 @@ namespace System explicit operator UnityEngine::SceneManagement::Scene(); Object(UnityEngine::SceneManagement::LoadSceneMode val); explicit operator UnityEngine::SceneManagement::LoadSceneMode(); + Object(UnityEngine::PrimitiveType val); + explicit operator UnityEngine::PrimitiveType(); Object(System::Boolean val); explicit operator System::Boolean(); Object(int8_t val); @@ -1054,7 +1082,8 @@ namespace UnityEngine GameObject(); GameObject(System::String& name); UnityEngine::Transform GetTransform(); - template MyGame::MonoBehaviours::TestScript AddComponent(); + template MT0 AddComponent(); + static UnityEngine::GameObject CreatePrimitive(UnityEngine::PrimitiveType type); }; } @@ -1121,8 +1150,7 @@ namespace UnityEngine { System::Boolean GetRaiseExceptions(); void SetRaiseExceptions(System::Boolean value); - template void AreEqual(System::String& expected, System::String& actual); - template void AreEqual(UnityEngine::GameObject& expected, UnityEngine::GameObject& actual); + template void AreEqual(MT0& expected, MT0& actual); } } } @@ -1175,6 +1203,7 @@ namespace UnityEngine MonoBehaviour& operator=(MonoBehaviour&& other); bool operator==(const MonoBehaviour& other) const; bool operator!=(const MonoBehaviour& other) const; + UnityEngine::Transform GetTransform(); }; } @@ -1843,6 +1872,24 @@ namespace System } } +namespace UnityEngine +{ + struct Time : System::Object + { + Time(decltype(nullptr) n); + Time(Plugin::InternalUse iu, int32_t handle); + Time(const Time& other); + Time(Time&& other); + virtual ~Time(); + Time& operator=(const Time& other); + Time& operator=(decltype(nullptr) other); + Time& operator=(Time&& other); + bool operator==(const Time& other) const; + bool operator!=(const Time& other) const; + static float GetDeltaTime(); + }; +} + namespace System { namespace Collections @@ -2070,6 +2117,28 @@ namespace MyGame } } +namespace MyGame +{ + namespace MonoBehaviours + { + struct AnotherScript : UnityEngine::MonoBehaviour + { + AnotherScript(decltype(nullptr) n); + AnotherScript(Plugin::InternalUse iu, int32_t handle); + AnotherScript(const AnotherScript& other); + AnotherScript(AnotherScript&& other); + virtual ~AnotherScript(); + AnotherScript& operator=(const AnotherScript& other); + AnotherScript& operator=(decltype(nullptr) other); + AnotherScript& operator=(AnotherScript&& other); + bool operator==(const AnotherScript& other) const; + bool operator!=(const AnotherScript& other) const; + void Awake(); + void Update(); + }; + } +} + namespace Plugin { template<> struct ArrayElementProxy1_1 From 2042b07e0715058de4ea8174dab667bfc98a5118 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 3 Dec 2017 14:01:57 -0800 Subject: [PATCH 46/95] Support deriving from classes that don't have a default constructor --- README.md | 1 - Unity/Assets/NativeScript/Bindings.cs | 142 +++ .../NativeScript/Editor/GenerateBindings.cs | 551 ++++++++---- Unity/Assets/NativeScriptTypes.json | 28 + Unity/CppSource/NativeScript/Bindings.cpp | 807 +++++++++++++++--- Unity/CppSource/NativeScript/Bindings.h | 99 +++ 6 files changed, 1358 insertions(+), 270 deletions(-) diff --git a/README.md b/README.md index 5280b7a..632dcf4 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,6 @@ Note that the code generator does not support (yet): * `Array` methods (e.g. `IndexOf`) * `string` methods (e.g. `Substring`) * Default parameters -* Deriving from classes without a default constructor * `decimal` * C# pointers diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index c180649..6dbbc70 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -379,6 +379,8 @@ delegate void InitDelegate( IntPtr boxPrimitiveType, IntPtr unboxPrimitiveType, IntPtr unityEngineTimePropertyGetDeltaTime, + IntPtr boxFileMode, + IntPtr unboxFileMode, IntPtr releaseSystemCollectionsGenericIComparerSystemInt32, IntPtr systemCollectionsGenericIComparerSystemInt32Constructor, IntPtr releaseSystemCollectionsGenericIComparerSystemString, @@ -393,6 +395,8 @@ delegate void InitDelegate( IntPtr systemCollectionsQueueConstructor, IntPtr releaseSystemComponentModelDesignIComponentChangeService, IntPtr systemComponentModelDesignIComponentChangeServiceConstructor, + IntPtr releaseSystemIOFileStream, + IntPtr systemIOFileStreamConstructorSystemString_SystemIOFileMode, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -637,6 +641,9 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRenameDelegate(int thisHandle, int param0); public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentRenameDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename; + public delegate void SystemIOFileStreamWriteByteDelegate(int thisHandle, byte param0); + public static SystemIOFileStreamWriteByteDelegate SystemIOFileStreamWriteByte; + public delegate void MyGameMonoBehavioursTestScriptAwakeDelegate(int thisHandle); public static MyGameMonoBehavioursTestScriptAwakeDelegate MyGameMonoBehavioursTestScriptAwake; @@ -897,6 +904,8 @@ static extern void Init( IntPtr boxPrimitiveType, IntPtr unboxPrimitiveType, IntPtr unityEngineTimePropertyGetDeltaTime, + IntPtr boxFileMode, + IntPtr unboxFileMode, IntPtr releaseSystemCollectionsGenericIComparerSystemInt32, IntPtr systemCollectionsGenericIComparerSystemInt32Constructor, IntPtr releaseSystemCollectionsGenericIComparerSystemString, @@ -911,6 +920,8 @@ static extern void Init( IntPtr systemCollectionsQueueConstructor, IntPtr releaseSystemComponentModelDesignIComponentChangeService, IntPtr systemComponentModelDesignIComponentChangeServiceConstructor, + IntPtr releaseSystemIOFileStream, + IntPtr systemIOFileStreamConstructorSystemString_SystemIOFileMode, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -1156,6 +1167,9 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke [DllImport(Constants.PluginName)] public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename(int thisHandle, int param0); + [DllImport(Constants.PluginName)] + public static extern void SystemIOFileStreamWriteByte(int thisHandle, int param0); + [DllImport(Constants.PluginName)] public static extern void MyGameMonoBehavioursTestScriptAwake(int thisHandle); @@ -1326,6 +1340,8 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate int BoxPrimitiveTypeDelegate(UnityEngine.PrimitiveType val); delegate UnityEngine.PrimitiveType UnboxPrimitiveTypeDelegate(int valHandle); delegate float UnityEngineTimePropertyGetDeltaTimeDelegate(); + delegate int BoxFileModeDelegate(System.IO.FileMode val); + delegate System.IO.FileMode UnboxFileModeDelegate(int valHandle); delegate void SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate(int cppHandle, ref int handle); delegate void ReleaseSystemCollectionsGenericIComparerSystemInt32Delegate(int handle); delegate void SystemCollectionsGenericIComparerSystemStringConstructorDelegate(int cppHandle, ref int handle); @@ -1340,6 +1356,8 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate void ReleaseSystemCollectionsQueueDelegate(int handle); delegate void SystemComponentModelDesignIComponentChangeServiceConstructorDelegate(int cppHandle, ref int handle); delegate void ReleaseSystemComponentModelDesignIComponentChangeServiceDelegate(int handle); + delegate void SystemIOFileStreamConstructorSystemString_SystemIOFileModeDelegate(int cppHandle, ref int handle, int pathHandle, System.IO.FileMode mode); + delegate void ReleaseSystemIOFileStreamDelegate(int handle); delegate int BoxBooleanDelegate(bool val); delegate bool UnboxBooleanDelegate(int valHandle); delegate int BoxSByteDelegate(sbyte val); @@ -1527,6 +1545,7 @@ public static void Open( SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving"); SystemComponentModelDesignIComponentChangeServiceAddComponentRename = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentRename"); SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename"); + SystemIOFileStreamWriteByte = GetDelegate(libraryHandle, "SystemIOFileStreamWriteByte"); MyGameMonoBehavioursTestScriptAwake = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptAwake"); MyGameMonoBehavioursTestScriptOnAnimatorIK = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptOnAnimatorIK"); MyGameMonoBehavioursTestScriptOnCollisionEnter = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptOnCollisionEnter"); @@ -1663,6 +1682,8 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new BoxPrimitiveTypeDelegate(BoxPrimitiveType)), Marshal.GetFunctionPointerForDelegate(new UnboxPrimitiveTypeDelegate(UnboxPrimitiveType)), Marshal.GetFunctionPointerForDelegate(new UnityEngineTimePropertyGetDeltaTimeDelegate(UnityEngineTimePropertyGetDeltaTime)), + Marshal.GetFunctionPointerForDelegate(new BoxFileModeDelegate(BoxFileMode)), + Marshal.GetFunctionPointerForDelegate(new UnboxFileModeDelegate(UnboxFileMode)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericIComparerSystemInt32Delegate(ReleaseSystemCollectionsGenericIComparerSystemInt32)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate(SystemCollectionsGenericIComparerSystemInt32Constructor)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericIComparerSystemStringDelegate(ReleaseSystemCollectionsGenericIComparerSystemString)), @@ -1677,6 +1698,8 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new SystemCollectionsQueueConstructorDelegate(SystemCollectionsQueueConstructor)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemComponentModelDesignIComponentChangeServiceDelegate(ReleaseSystemComponentModelDesignIComponentChangeService)), Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignIComponentChangeServiceConstructorDelegate(SystemComponentModelDesignIComponentChangeServiceConstructor)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemIOFileStreamDelegate(ReleaseSystemIOFileStream)), + Marshal.GetFunctionPointerForDelegate(new SystemIOFileStreamConstructorSystemString_SystemIOFileModeDelegate(SystemIOFileStreamConstructorSystemString_SystemIOFileMode)), Marshal.GetFunctionPointerForDelegate(new BoxBooleanDelegate(BoxBoolean)), Marshal.GetFunctionPointerForDelegate(new UnboxBooleanDelegate(UnboxBoolean)), Marshal.GetFunctionPointerForDelegate(new BoxSByteDelegate(BoxSByte)), @@ -1848,6 +1871,7 @@ class SystemCollectionsGenericIComparerSystemInt32 : System.Collections.Generic. public int CppHandle; public SystemCollectionsGenericIComparerSystemInt32(int cppHandle) + : base() { CppHandle = cppHandle; } @@ -1876,6 +1900,7 @@ class SystemCollectionsGenericIComparerSystemString : System.Collections.Generic public int CppHandle; public SystemCollectionsGenericIComparerSystemString(int cppHandle) + : base() { CppHandle = cppHandle; } @@ -1906,6 +1931,7 @@ class SystemStringComparer : System.StringComparer public int CppHandle; public SystemStringComparer(int cppHandle) + : base() { CppHandle = cppHandle; } @@ -1973,6 +1999,7 @@ class SystemCollectionsICollection : System.Collections.ICollection public int CppHandle; public SystemCollectionsICollection(int cppHandle) + : base() { CppHandle = cppHandle; } @@ -2077,6 +2104,7 @@ class SystemCollectionsIList : System.Collections.IList public int CppHandle; public SystemCollectionsIList(int cppHandle) + : base() { CppHandle = cppHandle; } @@ -2372,6 +2400,7 @@ class SystemCollectionsQueue : System.Collections.Queue public int CppHandle; public SystemCollectionsQueue(int cppHandle) + : base() { CppHandle = cppHandle; } @@ -2403,6 +2432,7 @@ class SystemComponentModelDesignIComponentChangeService : System.ComponentModel. public int CppHandle; public SystemComponentModelDesignIComponentChangeService(int cppHandle) + : base() { CppHandle = cppHandle; } @@ -2683,6 +2713,33 @@ public event System.ComponentModel.Design.ComponentRenameEventHandler ComponentR } + class SystemIOFileStream : System.IO.FileStream + { + public int CppHandle; + + public SystemIOFileStream(int cppHandle, string path, System.IO.FileMode mode) + : base(path, mode) + { + CppHandle = cppHandle; + } + + public override void WriteByte(byte value) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + NativeScript.Bindings.SystemIOFileStreamWriteByte(thisHandle, value); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + } + class SystemAction { public int CppHandle; @@ -5331,6 +5388,51 @@ static float UnityEngineTimePropertyGetDeltaTime() } } + [MonoPInvokeCallback(typeof(BoxFileModeDelegate))] + static int BoxFileMode(System.IO.FileMode val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxFileModeDelegate))] + static System.IO.FileMode UnboxFileMode(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (System.IO.FileMode)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(System.IO.FileMode); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(System.IO.FileMode); + } + } + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate))] static void SystemCollectionsGenericIComparerSystemInt32Constructor(int cppHandle, ref int handle) { @@ -5604,6 +5706,46 @@ static void ReleaseSystemComponentModelDesignIComponentChangeService(int handle) } } + [MonoPInvokeCallback(typeof(SystemIOFileStreamConstructorSystemString_SystemIOFileModeDelegate))] + static void SystemIOFileStreamConstructorSystemString_SystemIOFileMode(int cppHandle, ref int handle, int pathHandle, System.IO.FileMode mode) + { + try + { + var path = (string)NativeScript.Bindings.ObjectStore.Get(pathHandle); + var thiz = new SystemIOFileStream(cppHandle, path, mode); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(ReleaseSystemIOFileStreamDelegate))] + static void ReleaseSystemIOFileStream(int handle) + { + try + { + NativeScript.Bindings.ObjectStore.Remove(handle); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + [MonoPInvokeCallback(typeof(BoxBooleanDelegate))] static int BoxBoolean(bool val) { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 8fd346d..272f160 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -100,6 +100,7 @@ class JsonBaseType public string Name; public JsonGenericParams[] GenericParams; public int MaxSimultaneous; + public JsonConstructor[] Constructors; public JsonMethod[] OverrideMethods; public JsonProperty[] OverrideProperties; public JsonEvent[] OverrideEvents; @@ -785,6 +786,7 @@ static TypeKind GetTypeKind(Type type) static ParameterInfo[] GetConstructorParameters( Type type, + bool allowDefault, string[] paramTypeNames) { foreach (ConstructorInfo ctor in type.GetConstructors()) @@ -799,6 +801,11 @@ System.Reflection.ParameterInfo[] reflectionParams } } + if (allowDefault) + { + return new ParameterInfo[0]; + } + // Throw an exception so the user knows what to fix in the JSON StringBuilder errorBuilder = new StringBuilder(1024); errorBuilder.Append("Constructor \""); @@ -949,14 +956,14 @@ static void AppendParameterTypeNames( } static void AppendTypeNames( - Type[] typeParams, + Type[] typeNames, StringBuilder output) { - if (typeParams != null) + if (typeNames != null) { - for (int i = 0, len = typeParams.Length; i < len; ++i) + for (int i = 0, len = typeNames.Length; i < len; ++i) { - Type curType = typeParams[i]; + Type curType = typeNames[i]; AppendNamespace( curType.Namespace, string.Empty, @@ -1657,6 +1664,7 @@ static void AppendBaseType( type.Name, typeParams, maxSimultaneous, + assemblies, builders); } } @@ -1671,6 +1679,7 @@ static void AppendBaseType( type.Name, null, maxSimultaneous, + assemblies, builders); } } @@ -2169,6 +2178,7 @@ static void AppendConstructor( } parameters = GetConstructorParameters( enclosingType, + false, constructorParamTypeNames); } @@ -2241,10 +2251,11 @@ static void AppendConstructor( AppendCsharpTypeName( enclosingType, builders.CsharpFunctions); + builders.CsharpFunctions.Append('('); AppendCsharpFunctionCallParameters( parameters, builders.CsharpFunctions); - builders.CsharpFunctions.Append(";"); + builders.CsharpFunctions.Append(");"); AppendCsharpFunctionReturn( parameters, enclosingType, @@ -2271,10 +2282,11 @@ static void AppendConstructor( AppendCsharpTypeName( enclosingType, builders.CsharpFunctions); + builders.CsharpFunctions.Append('('); AppendCsharpFunctionCallParameters( parameters, builders.CsharpFunctions); - builders.CsharpFunctions.Append(");"); + builders.CsharpFunctions.Append("));"); AppendCsharpFunctionReturn( parameters, typeof(int), @@ -3359,9 +3371,11 @@ static void AppendMethod( AppendCSharpTypeParameters( methodTypeParams, builders.CsharpFunctions); + builders.CsharpFunctions.Append('('); AppendCsharpFunctionCallParameters( parameters, builders.CsharpFunctions); + builders.CsharpFunctions.Append(')'); } builders.CsharpFunctions.Append(';'); if (!isReadOnly @@ -5707,11 +5721,11 @@ static void AppendDelegate( AppendTypeNames( typeParams, builders.TempStrBuilder); - string typeName = builders.TempStrBuilder.ToString(); + string bindingTypeName = builders.TempStrBuilder.ToString(); builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("Release"); - builders.TempStrBuilder.Append(typeName); + builders.TempStrBuilder.Append(bindingTypeName); string releaseFuncName = builders.TempStrBuilder.ToString(); builders.TempStrBuilder[0] = char.ToLower( @@ -5719,7 +5733,7 @@ static void AppendDelegate( string releaseFuncNameLower = builders.TempStrBuilder.ToString(); builders.TempStrBuilder.Length = 0; - builders.TempStrBuilder.Append(typeName); + builders.TempStrBuilder.Append(bindingTypeName); builders.TempStrBuilder.Append("Constructor"); string constructorFuncName = builders.TempStrBuilder.ToString(); @@ -5728,7 +5742,7 @@ static void AppendDelegate( string constructorFuncNameLower = builders.TempStrBuilder.ToString(); builders.TempStrBuilder.Length = 0; - builders.TempStrBuilder.Append(typeName); + builders.TempStrBuilder.Append(bindingTypeName); builders.TempStrBuilder.Append("Add"); string addFuncName = builders.TempStrBuilder.ToString(); @@ -5737,7 +5751,7 @@ static void AppendDelegate( string addFuncNameLower = builders.TempStrBuilder.ToString(); builders.TempStrBuilder.Length = 0; - builders.TempStrBuilder.Append(typeName); + builders.TempStrBuilder.Append(bindingTypeName); builders.TempStrBuilder.Append("Remove"); string removeFuncName = builders.TempStrBuilder.ToString(); @@ -5816,13 +5830,13 @@ static void AppendDelegate( AppendCppFreeListStateAndFunctions( type, - typeName, + bindingTypeName, builders.CppGlobalStateAndFunctions); AppendCppFreeListInit( type, maxSimultaneous, - typeName, + bindingTypeName, builders.CppInitBody); // C++ type definition (begin) @@ -6012,27 +6026,37 @@ static void AppendDelegate( type.Namespace, builders.CppMethodDefinitions); - AppendCppBaseTypeDefaultConstructor( - typeName, + AppendCppBaseTypeConstructor( + bindingTypeName, + type.Name, + type.Namespace, + TypeKind.Class, cppTypeName, + typeof(object), typeParams, + new ParameterInfo[0], + constructorParams, true, constructorFuncName, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeNullptrConstructor( - typeName, + bindingTypeName, cppTypeName, typeParams, + "Object", + "System", true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeCopyConstructor( - typeName, + bindingTypeName, cppTypeName, typeParams, + "Object", + "System", true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6040,20 +6064,24 @@ static void AppendDelegate( AppendCppBaseTypeMoveConstructor( cppTypeName, typeParams, + "Object", + "System", true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeHandleConstructor( - typeName, + bindingTypeName, cppTypeName, typeParams, + "Object", + "System", true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeDestructor( - typeName, + bindingTypeName, cppTypeName, typeParams, true, @@ -6078,7 +6106,7 @@ static void AppendDelegate( builders.CppMethodDefinitions); AppendCppBaseTypeMoveAssignmentOperator( - typeName, + bindingTypeName, cppTypeName, typeParams, true, @@ -6172,7 +6200,7 @@ static void AppendDelegate( // C# class (beginning) builders.CsharpBaseTypes.Append("\t\tclass "); - builders.CsharpBaseTypes.Append(typeName); + builders.CsharpBaseTypes.Append(bindingTypeName); builders.CsharpBaseTypes.Append("\n"); builders.CsharpBaseTypes.Append("\t\t{\n"); @@ -6187,7 +6215,7 @@ static void AppendDelegate( // C# class constructor builders.CsharpBaseTypes.Append("\t\t\tpublic "); - builders.CsharpBaseTypes.Append(typeName); + builders.CsharpBaseTypes.Append(bindingTypeName); builders.CsharpBaseTypes.Append("(int cppHandle)\n"); builders.CsharpBaseTypes.Append("\t\t\t{\n"); builders.CsharpBaseTypes.Append("\t\t\t\tCppHandle = cppHandle;\n"); @@ -6208,7 +6236,7 @@ static void AppendDelegate( MethodInfo invokeMethod = type.GetMethod("Invoke"); AppendBaseTypeCppMethodCall( type, - typeName, + bindingTypeName, cppTypeName, typeParams, invokeMethod, @@ -6226,7 +6254,7 @@ static void AppendDelegate( // Invoke() is how C++ invokes the delegate AppendBaseTypeMethodCallsCsharpMethod( type, - typeName, + bindingTypeName, cppTypeName, typeParams, invokeMethod, @@ -6247,10 +6275,11 @@ static void AppendDelegate( AppendCsharpBaseTypeConstructorFunction( type, - typeName, + bindingTypeName, false, constructorFuncName, constructorParams, + new ParameterInfo[0], builders.CsharpFunctions); // C# release delegate type @@ -6265,7 +6294,7 @@ static void AppendDelegate( AppendCsharpBaseTypeReleaseFunction( type, - typeName, + bindingTypeName, true, releaseFuncName, releaseParams, @@ -6345,6 +6374,7 @@ static void AppendBaseType( string cppTypeName, Type[] typeParams, int? maxSimultaneous, + Assembly[] assemblies, StringBuilders builders) { builders.TempStrBuilder.Length = 0; @@ -6358,84 +6388,148 @@ static void AppendBaseType( AppendTypeNames( typeParams, builders.TempStrBuilder); - string typeName = builders.TempStrBuilder.ToString(); + string bindingTypeName = builders.TempStrBuilder.ToString(); builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("Release"); - builders.TempStrBuilder.Append(typeName); + builders.TempStrBuilder.Append(bindingTypeName); string releaseFuncName = builders.TempStrBuilder.ToString(); builders.TempStrBuilder[0] = char.ToLower( builders.TempStrBuilder[0]); string releaseFuncNameLower = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder.Length = 0; - builders.TempStrBuilder.Append(typeName); - builders.TempStrBuilder.Append("Constructor"); - string constructorFuncName = builders.TempStrBuilder.ToString(); - - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string constructorFuncNameLower = builders.TempStrBuilder.ToString(); - - // C++ type declaration - int indent = AppendCppTypeDeclaration( - type.Namespace, - cppTypeName, - false, - typeParams, - builders.CppTypeDeclarations); + // Either use specified constructors or the default constructor + JsonConstructor[] jsonConstructors = jsonBaseType.Constructors; + if (jsonConstructors == null) + { + // Base classes must have a default constructor or no + // constructors at all + if (type.IsClass && + (type.GetConstructor(new Type[0]) == null && + type.GetConstructors().Length != 0)) + { + // Throw an exception so the user knows what to fix in the JSON + StringBuilder errorBuilder = new StringBuilder(1024); + errorBuilder.Append("Base type \""); + AppendCsharpTypeName( + type, + errorBuilder); + errorBuilder.Append( + ")\" doesn't have any specified constructors or a default constructor"); + throw new Exception(errorBuilder.ToString()); + } + + jsonConstructors = new JsonConstructor[] + { + new JsonConstructor + { + ParamTypes = new string[0] + } + }; + } - ParameterInfo[] releaseParams = { - new ParameterInfo + // Build constructor function names and parameter lists + int numConstructors = jsonConstructors.Length; + string[] constructorFuncNames = new string[numConstructors]; + string[] constructorFuncNameLowers = new string[numConstructors]; + ParameterInfo[][] cppConstructorParams = new ParameterInfo[numConstructors][]; + ParameterInfo[][] constructorParams = new ParameterInfo[numConstructors][]; + for (int i = 0; i < numConstructors; ++i) + { + JsonConstructor jsonCtor = jsonConstructors[i]; + Type[] paramTypes = GetTypes( + jsonCtor.ParamTypes, + assemblies); + + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append(bindingTypeName); + builders.TempStrBuilder.Append("Constructor"); + AppendTypeNames( + paramTypes, + builders.TempStrBuilder); + string constructorFuncName = builders.TempStrBuilder.ToString(); + + builders.TempStrBuilder[0] = char.ToLower( + builders.TempStrBuilder[0]); + string constructorFuncNameLower = builders.TempStrBuilder.ToString(); + + ParameterInfo[] parameters = GetConstructorParameters( + type, + true, + jsonCtor.ParamTypes); + int numParams = parameters.Length; + ParameterInfo[] fullParams = new ParameterInfo[numParams + 2]; + fullParams[0] = new ParameterInfo { - Name = "handle", + Name = "cppHandle", ParameterType = typeof(int), DereferencedParameterType = typeof(int), IsOut = false, IsRef = false, Kind = TypeKind.Primitive - }}; - - ParameterInfo[] constructorParams = { - new ParameterInfo + }; + fullParams[1] = new ParameterInfo { - Name = "cppHandle", + Name = "handle", ParameterType = typeof(int), DereferencedParameterType = typeof(int), - IsOut = false, + IsOut = true, IsRef = false, Kind = TypeKind.Primitive - }, + }; + Array.Copy( + parameters, + 0, + fullParams, + 2, + numParams); + + constructorFuncNames[i] = constructorFuncName; + constructorFuncNameLowers[i] = constructorFuncNameLower; + cppConstructorParams[i] = parameters; + constructorParams[i] = fullParams; + } + + // C++ type declaration + int indent = AppendCppTypeDeclaration( + type.Namespace, + cppTypeName, + false, + typeParams, + builders.CppTypeDeclarations); + + ParameterInfo[] releaseParams = { new ParameterInfo { Name = "handle", ParameterType = typeof(int), DereferencedParameterType = typeof(int), - IsOut = true, + IsOut = false, IsRef = false, Kind = TypeKind.Primitive }}; AppendCppFreeListStateAndFunctions( type, - typeName, + bindingTypeName, builders.CppGlobalStateAndFunctions); AppendCppFreeListInit( type, maxSimultaneous, - typeName, + bindingTypeName, builders.CppInitBody); // C++ type definition (begin) + Type baseType = type.BaseType ?? typeof(object); AppendCppTypeDefinitionBegin( cppTypeName, type.Namespace, TypeKind.Class, typeParams, - "Object", - "System", + baseType.Name, + baseType.Namespace, null, false, indent, @@ -6447,20 +6541,23 @@ static void AppendBaseType( builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append("int32_t CppHandle;\n"); - // C++ method declarations - AppendIndent( - indent + 1, - builders.CppTypeDefinitions); - AppendCppMethodDeclaration( - cppTypeName, - false, - false, - false, - null, - typeParams, - null, - new ParameterInfo[0], - builders.CppTypeDefinitions); + // C++ constructor declarations + for (int i = 0; i < numConstructors; ++i) + { + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + AppendCppMethodDeclaration( + cppTypeName, + false, + false, + false, + null, + typeParams, + null, + cppConstructorParams[i], + builders.CppTypeDefinitions); + } // C++ function pointers AppendCppFunctionPointerDefinition( @@ -6472,15 +6569,18 @@ static void AppendBaseType( releaseParams, typeof(void), builders.CppFunctionPointers); - AppendCppFunctionPointerDefinition( - constructorFuncName, - true, - null, - null, - TypeKind.None, - constructorParams, - typeof(void), - builders.CppFunctionPointers); + for (int i = 0; i < numConstructors; ++i) + { + AppendCppFunctionPointerDefinition( + constructorFuncNames[i], + true, + null, + null, + TypeKind.None, + constructorParams[i], + typeof(void), + builders.CppFunctionPointers); + } // C++ init params AppendCppInitParam( @@ -6492,64 +6592,85 @@ static void AppendBaseType( releaseParams, typeof(void), builders.CppInitParams); - AppendCppInitParam( - constructorFuncNameLower, - true, - null, - null, - TypeKind.None, - constructorParams, - typeof(void), - builders.CppInitParams); + for (int i = 0; i < numConstructors; ++i) + { + AppendCppInitParam( + constructorFuncNameLowers[i], + true, + null, + null, + TypeKind.None, + constructorParams[i], + typeof(void), + builders.CppInitParams); + } // C++ and C# init params AppendCppInitBody( releaseFuncName, releaseFuncNameLower, builders.CppInitBody); - AppendCppInitBody( - constructorFuncName, - constructorFuncNameLower, - builders.CppInitBody); AppendCsharpInitParam( releaseFuncNameLower, builders.CsharpInitParams); - AppendCsharpInitParam( - constructorFuncNameLower, - builders.CsharpInitParams); AppendCsharpInitCallArg( releaseFuncName, builders.CsharpInitCall); - AppendCsharpInitCallArg( - constructorFuncName, - builders.CsharpInitCall); + for (int i = 0; i < numConstructors; ++i) + { + string funcName = constructorFuncNames[i]; + string funcNameLower = constructorFuncNameLowers[i]; + AppendCppInitBody( + funcName, + funcNameLower, + builders.CppInitBody); + AppendCsharpInitParam( + funcNameLower, + builders.CsharpInitParams); + AppendCsharpInitCallArg( + funcName, + builders.CsharpInitCall); + } // C++ method definitions (end) int cppMethodDefinitionsIndent = AppendNamespaceBeginning( type.Namespace, builders.CppMethodDefinitions); - AppendCppBaseTypeDefaultConstructor( - typeName, - cppTypeName, - typeParams, - false, - constructorFuncName, - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); + for (int i = 0; i < numConstructors; ++i) + { + AppendCppBaseTypeConstructor( + bindingTypeName, + type.Name, + type.Namespace, + TypeKind.Class, + cppTypeName, + type.BaseType, + typeParams, + cppConstructorParams[i], + constructorParams[i], + false, + constructorFuncNames[i], + cppMethodDefinitionsIndent, + builders.CppMethodDefinitions); + } AppendCppBaseTypeNullptrConstructor( - typeName, + bindingTypeName, cppTypeName, typeParams, + baseType.Name, + baseType.Namespace, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeCopyConstructor( - typeName, + bindingTypeName, cppTypeName, typeParams, + baseType.Name, + baseType.Namespace, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6557,20 +6678,24 @@ static void AppendBaseType( AppendCppBaseTypeMoveConstructor( cppTypeName, typeParams, + baseType.Name, + baseType.Namespace, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeHandleConstructor( - typeName, + bindingTypeName, cppTypeName, typeParams, + baseType.Name, + baseType.Namespace, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeDestructor( - typeName, + bindingTypeName, cppTypeName, typeParams, false, @@ -6595,7 +6720,7 @@ static void AppendBaseType( builders.CppMethodDefinitions); AppendCppBaseTypeMoveAssignmentOperator( - typeName, + bindingTypeName, cppTypeName, typeParams, false, @@ -6617,7 +6742,7 @@ static void AppendBaseType( // C# class (beginning) builders.CsharpBaseTypes.Append("\t\tclass "); - builders.CsharpBaseTypes.Append(typeName); + builders.CsharpBaseTypes.Append(bindingTypeName); if (jsonBaseType != null) { builders.CsharpBaseTypes.Append(" : "); @@ -6633,31 +6758,55 @@ static void AppendBaseType( builders.CsharpBaseTypes.Append("\t\t\t\n"); // C# class constructor - builders.CsharpBaseTypes.Append("\t\t\tpublic "); - builders.CsharpBaseTypes.Append(typeName); - builders.CsharpBaseTypes.Append("(int cppHandle)\n"); - builders.CsharpBaseTypes.Append("\t\t\t{\n"); - builders.CsharpBaseTypes.Append("\t\t\t\tCppHandle = cppHandle;\n"); - builders.CsharpBaseTypes.Append("\t\t\t}\n"); - builders.CsharpBaseTypes.Append("\t\t\t\n"); + for (int i = 0; i < numConstructors; ++i) + { + builders.CsharpBaseTypes.Append("\t\t\tpublic "); + builders.CsharpBaseTypes.Append(bindingTypeName); + builders.CsharpBaseTypes.Append("(int cppHandle"); + ParameterInfo[] parameters = cppConstructorParams[i]; + if (parameters.Length > 0) + { + builders.CsharpBaseTypes.Append(", "); + AppendCsharpParams( + parameters, + builders.CsharpBaseTypes); + } + builders.CsharpBaseTypes.Append(")\n"); + builders.CsharpBaseTypes.Append("\t\t\t\t: base("); + AppendCsharpFunctionCallParameters( + parameters, + builders.CsharpBaseTypes); + builders.CsharpBaseTypes.Append(")\n"); + builders.CsharpBaseTypes.Append("\t\t\t{\n"); + builders.CsharpBaseTypes.Append("\t\t\t\tCppHandle = cppHandle;\n"); + builders.CsharpBaseTypes.Append("\t\t\t}\n"); + builders.CsharpBaseTypes.Append("\t\t\t\n"); + } // C# constructor delegate type - AppendCsharpDelegateType( - constructorFuncName, - true, - type, - TypeKind.Class, - typeof(void), - constructorParams, - builders.CsharpDelegateTypes); + for (int i = 0; i < numConstructors; ++i) + { + AppendCsharpDelegateType( + constructorFuncNames[i], + true, + type, + TypeKind.Class, + typeof(void), + constructorParams[i], + builders.CsharpDelegateTypes); + } - AppendCsharpBaseTypeConstructorFunction( - type, - typeName, - false, - constructorFuncName, - constructorParams, - builders.CsharpFunctions); + for (int i = 0; i < numConstructors; ++i) + { + AppendCsharpBaseTypeConstructorFunction( + type, + bindingTypeName, + false, + constructorFuncNames[i], + constructorParams[i], + cppConstructorParams[i], + builders.CsharpFunctions); + } // C# release delegate type AppendCsharpDelegateType( @@ -6671,7 +6820,7 @@ static void AppendBaseType( AppendCsharpBaseTypeReleaseFunction( type, - typeName, + bindingTypeName, false, releaseFuncName, releaseParams, @@ -6685,7 +6834,7 @@ static void AppendBaseType( { AppendBaseTypeNativeMethod( type, - typeName, + bindingTypeName, typeParams, cppTypeName, methodInfo, @@ -6706,7 +6855,7 @@ static void AppendBaseType( { AppendBaseTypeNativeMethod( type, - typeName, + bindingTypeName, typeParams, cppTypeName, methodInfo, @@ -6732,7 +6881,7 @@ static void AppendBaseType( methods); AppendBaseTypeNativeMethod( type, - typeName, + bindingTypeName, typeParams, cppTypeName, methodInfo, @@ -6753,7 +6902,7 @@ static void AppendBaseType( } AppendBaseTypeProperty( type, - typeName, + bindingTypeName, cppTypeName, typeParams, propertyInfo, @@ -6780,7 +6929,7 @@ static void AppendBaseType( } AppendBaseTypeProperty( type, - typeName, + bindingTypeName, cppTypeName, typeParams, propertyInfo, @@ -6840,7 +6989,7 @@ static void AppendBaseType( } AppendBaseTypeProperty( type, - typeName, + bindingTypeName, cppTypeName, typeParams, propertyInfo, @@ -6863,7 +7012,7 @@ static void AppendBaseType( } AppendBaseTypeEvent( type, - typeName, + bindingTypeName, cppTypeName, typeParams, eventInfo, @@ -6889,7 +7038,7 @@ static void AppendBaseType( } AppendBaseTypeEvent( type, - typeName, + bindingTypeName, cppTypeName, typeParams, eventInfo, @@ -6949,7 +7098,7 @@ static void AppendBaseType( } AppendBaseTypeEvent( type, - typeName, + bindingTypeName, cppTypeName, typeParams, eventInfo, @@ -7414,10 +7563,11 @@ static void AppendBaseTypeMethodCallsCsharpMethod( builders.CsharpFunctions.Append('.'); builders.CsharpFunctions.Append(csharpMethodName); } + builders.CsharpFunctions.Append('('); AppendCsharpFunctionCallParameters( invokeParams, builders.CsharpFunctions); - builders.CsharpFunctions.Append(';'); + builders.CsharpFunctions.Append(");"); AppendCsharpFunctionReturn( invokeParams, methodInfo.ReturnType, @@ -7770,6 +7920,7 @@ private static void AppendCsharpBaseTypeConstructorFunction( bool typeIsDelegate, string constructorFuncName, ParameterInfo[] constructorParams, + ParameterInfo[] cppConstructorParams, StringBuilder output) { AppendCsharpFunctionBeginning( @@ -7782,7 +7933,15 @@ private static void AppendCsharpBaseTypeConstructorFunction( output); output.Append("var thiz = new "); output.Append(typeName); - output.Append("(cppHandle);\n"); + output.Append("(cppHandle"); + if (cppConstructorParams.Length > 0) + { + output.Append(", "); + AppendCsharpFunctionCallParameters( + cppConstructorParams, + output); + } + output.Append(");\n"); if (typeIsDelegate) { output.Append( @@ -7907,8 +8066,8 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( AppendIndent( indent + 2, output); - output.Append("auto param"); - output.Append(i); + output.Append("auto "); + output.Append(parameter.Name); output.Append(" = "); AppendCppTypeName( parameter.ParameterType, @@ -7936,8 +8095,7 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( if (parameter.Kind == TypeKind.Class || parameter.Kind == TypeKind.ManagedStruct) { - output.Append("param"); - output.Append(i); + output.Append(parameter.Name); } else { @@ -8559,6 +8717,8 @@ static void AppendCppBaseTypeHandleConstructor( string typeName, string cppTypeName, Type[] typeParams, + string baseTypeName, + string baseTypeNamespace, bool typeIsDelegate, int cppMethodDefinitionsIndent, StringBuilder output) @@ -8581,8 +8741,12 @@ static void AppendCppBaseTypeHandleConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append( - "\t: System::Object(iu, handle)\n"); + output.Append("\t: "); + AppendCppTypeName( + baseTypeNamespace, + baseTypeName, + output); + output.Append("(iu, handle)\n"); AppendIndent( cppMethodDefinitionsIndent, output); @@ -8631,6 +8795,8 @@ static void AppendCppBaseTypeHandleConstructor( static void AppendCppBaseTypeMoveConstructor( string cppTypeName, Type[] typeParams, + string baseTypeName, + string baseTypeNamespace, bool typeIsDelegate, int cppMethodDefinitionsIndent, StringBuilder output) @@ -8659,8 +8825,12 @@ static void AppendCppBaseTypeMoveConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append( - "\t: System::Object(Plugin::InternalUse::Only, other.Handle)\n"); + output.Append("\t: "); + AppendCppTypeName( + baseTypeNamespace, + baseTypeName, + output); + output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent( cppMethodDefinitionsIndent, output); @@ -8707,6 +8877,8 @@ static void AppendCppBaseTypeCopyConstructor( string typeName, string cppTypeName, Type[] typeParams, + string baseTypeName, + string baseTypeNamespace, bool typeIsDelegate, int cppMethodDefinitionsIndent, StringBuilder output) @@ -8735,8 +8907,12 @@ static void AppendCppBaseTypeCopyConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append( - "\t: System::Object(Plugin::InternalUse::Only, other.Handle)\n"); + output.Append("\t: "); + AppendCppTypeName( + baseTypeNamespace, + baseTypeName, + output); + output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent( cppMethodDefinitionsIndent, output); @@ -8786,6 +8962,8 @@ static void AppendCppBaseTypeNullptrConstructor( string typeName, string cppTypeName, Type[] typeParams, + string baseTypeName, + string baseTypeNamespace, bool typeIsDelegate, int cppMethodDefinitionsIndent, StringBuilder output) @@ -8807,8 +8985,12 @@ static void AppendCppBaseTypeNullptrConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append( - "\t: System::Object(Plugin::InternalUse::Only, 0)\n"); + output.Append("\t: "); + AppendCppTypeName( + baseTypeNamespace, + baseTypeName, + output); + output.Append("(Plugin::InternalUse::Only, 0)\n"); AppendIndent( cppMethodDefinitionsIndent, output); @@ -8836,10 +9018,16 @@ static void AppendCppBaseTypeNullptrConstructor( output.Append("\n"); } - static void AppendCppBaseTypeDefaultConstructor( + static void AppendCppBaseTypeConstructor( + string bindingTypeName, string typeName, + string typeNamespace, + TypeKind typeKind, string cppTypeName, + Type baseType, Type[] typeParams, + ParameterInfo[] cppParameters, + ParameterInfo[] parameters, bool typeIsDelegate, string constructorFuncName, int cppMethodDefinitionsIndent, @@ -8851,13 +9039,17 @@ static void AppendCppBaseTypeDefaultConstructor( cppTypeName, typeParams, null, - new ParameterInfo[0], + cppParameters, cppMethodDefinitionsIndent, output); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append(" : System::Object(nullptr)\n"); + output.Append(" : "); + AppendCppTypeName( + baseType ?? typeof(object), + output); + output.Append("(nullptr)\n"); AppendIndent( cppMethodDefinitionsIndent, output); @@ -8866,19 +9058,34 @@ static void AppendCppBaseTypeDefaultConstructor( cppMethodDefinitionsIndent + 1, output); output.Append("CppHandle = Plugin::Store"); - output.Append(typeName); + output.Append(bindingTypeName); output.Append("(this);\n"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("Plugin::"); - output.Append(constructorFuncName); - output.Append("(CppHandle, &Handle"); + output.Append("int32_t* handle = &Handle;\n"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("int32_t cppHandle = CppHandle;\n"); if (typeIsDelegate) { - output.Append(", &ClassHandle"); + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("int32_t* classHandle = &ClassHandle;\n"); } - output.Append(");\n"); + AppendCppPluginFunctionCall( + true, + bindingTypeName, + typeNamespace, + typeKind, + typeParams, + null, + constructorFuncName, + parameters, + cppMethodDefinitionsIndent + 1, + output); AppendIndent( cppMethodDefinitionsIndent + 1, output); @@ -8908,7 +9115,7 @@ static void AppendCppBaseTypeDefaultConstructor( cppMethodDefinitionsIndent + 2, output); output.Append("Plugin::Remove"); - output.Append(typeName); + output.Append(bindingTypeName); output.Append("(CppHandle);\n"); if (typeIsDelegate) { @@ -10951,7 +11158,6 @@ static void AppendCsharpFunctionCallParameters( ParameterInfo[] parameters, StringBuilder output) { - output.Append('('); for (int i = 0; i < parameters.Length; ++i) { ParameterInfo param = parameters[i]; @@ -10969,7 +11175,6 @@ static void AppendCsharpFunctionCallParameters( output.Append(", "); } } - output.Append(')'); } static void AppendStructStoreReplace( diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index d60a4df..0545f4d 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -603,6 +603,15 @@ "Set": {} } ] + }, + { + "Name": "System.IO.FileMode" + }, + { + "Name": "System.MarshalByRefObject" + }, + { + "Name": "System.IO.Stream" } ], "BaseTypes": [ @@ -642,6 +651,25 @@ }, { "Name": "System.ComponentModel.Design.IComponentChangeService" + }, + { + "Name": "System.IO.FileStream", + "OverrideMethods": [ + { + "Name": "WriteByte", + "ParamTypes": [ + "System.Byte" + ] + } + ], + "Constructors": [ + { + "ParamTypes": [ + "System.String", + "System.IO.FileMode" + ] + } + ] } ], "MonoBehaviours": [ diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 9127c40..cd6802c 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -145,6 +145,8 @@ namespace Plugin int32_t (*BoxPrimitiveType)(UnityEngine::PrimitiveType val); UnityEngine::PrimitiveType (*UnboxPrimitiveType)(int32_t valHandle); float (*UnityEngineTimePropertyGetDeltaTime)(); + int32_t (*BoxFileMode)(System::IO::FileMode val); + System::IO::FileMode (*UnboxFileMode)(int32_t valHandle); void (*ReleaseSystemCollectionsGenericIComparerSystemInt32)(int32_t handle); void (*SystemCollectionsGenericIComparerSystemInt32Constructor)(int32_t cppHandle, int32_t* handle); void (*ReleaseSystemCollectionsGenericIComparerSystemString)(int32_t handle); @@ -159,6 +161,8 @@ namespace Plugin void (*SystemCollectionsQueueConstructor)(int32_t cppHandle, int32_t* handle); void (*ReleaseSystemComponentModelDesignIComponentChangeService)(int32_t handle); void (*SystemComponentModelDesignIComponentChangeServiceConstructor)(int32_t cppHandle, int32_t* handle); + void (*ReleaseSystemIOFileStream)(int32_t handle); + void (*SystemIOFileStreamConstructorSystemString_SystemIOFileMode)(int32_t cppHandle, int32_t* handle, int32_t pathHandle, System::IO::FileMode mode); int32_t (*BoxBoolean)(System::Boolean val); System::Boolean (*UnboxBoolean)(int32_t valHandle); int32_t (*BoxSByte)(int8_t val); @@ -543,6 +547,31 @@ namespace Plugin *pRelease = (System::ComponentModel::Design::IComponentChangeService*)NextFreeSystemComponentModelDesignIComponentChangeService; NextFreeSystemComponentModelDesignIComponentChangeService = pRelease; } + int32_t SystemIOFileStreamFreeListSize; + System::IO::FileStream** SystemIOFileStreamFreeList; + System::IO::FileStream** NextFreeSystemIOFileStream; + + int32_t StoreSystemIOFileStream(System::IO::FileStream* del) + { + assert(NextFreeSystemIOFileStream != nullptr); + System::IO::FileStream** pNext = NextFreeSystemIOFileStream; + NextFreeSystemIOFileStream = (System::IO::FileStream**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemIOFileStreamFreeList); + } + + System::IO::FileStream* GetSystemIOFileStream(int32_t handle) + { + assert(handle >= 0 && handle < SystemIOFileStreamFreeListSize); + return SystemIOFileStreamFreeList[handle]; + } + + void RemoveSystemIOFileStream(int32_t handle) + { + System::IO::FileStream** pRelease = SystemIOFileStreamFreeList + handle; + *pRelease = (System::IO::FileStream*)NextFreeSystemIOFileStream; + NextFreeSystemIOFileStream = pRelease; + } int32_t SystemActionFreeListSize; System::Action** SystemActionFreeList; System::Action** NextFreeSystemAction; @@ -5550,6 +5579,206 @@ namespace UnityEngine } } +namespace System +{ + Object::Object(System::IO::FileMode val) + { + int32_t handle = Plugin::BoxFileMode(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator System::IO::FileMode() + { + System::IO::FileMode returnVal(Plugin::UnboxFileMode(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + MarshalByRefObject::MarshalByRefObject(decltype(nullptr) n) + : MarshalByRefObject(Plugin::InternalUse::Only, 0) + { + } + + MarshalByRefObject::MarshalByRefObject(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + MarshalByRefObject::MarshalByRefObject(const MarshalByRefObject& other) + : MarshalByRefObject(Plugin::InternalUse::Only, other.Handle) + { + } + + MarshalByRefObject::MarshalByRefObject(MarshalByRefObject&& other) + : MarshalByRefObject(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + MarshalByRefObject::~MarshalByRefObject() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + MarshalByRefObject& MarshalByRefObject::operator=(const MarshalByRefObject& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + MarshalByRefObject& MarshalByRefObject::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + MarshalByRefObject& MarshalByRefObject::operator=(MarshalByRefObject&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool MarshalByRefObject::operator==(const MarshalByRefObject& other) const + { + return Handle == other.Handle; + } + + bool MarshalByRefObject::operator!=(const MarshalByRefObject& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + namespace IO + { + Stream::Stream(decltype(nullptr) n) + : Stream(Plugin::InternalUse::Only, 0) + { + } + + Stream::Stream(Plugin::InternalUse iu, int32_t handle) + : System::MarshalByRefObject(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Stream::Stream(const Stream& other) + : Stream(Plugin::InternalUse::Only, other.Handle) + { + } + + Stream::Stream(Stream&& other) + : Stream(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Stream::~Stream() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Stream& Stream::operator=(const Stream& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Stream& Stream::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Stream& Stream::operator=(Stream&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Stream::operator==(const Stream& other) const + { + return Handle == other.Handle; + } + + bool Stream::operator!=(const Stream& other) const + { + return Handle != other.Handle; + } + } +} + namespace System { namespace Collections @@ -5560,7 +5789,16 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); - Plugin::SystemCollectionsGenericIComparerSystemInt32Constructor(CppHandle, &Handle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemCollectionsGenericIComparerSystemInt32Constructor(cppHandle, handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -5744,7 +5982,16 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); - Plugin::SystemCollectionsGenericIComparerSystemStringConstructor(CppHandle, &Handle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemCollectionsGenericIComparerSystemStringConstructor(cppHandle, handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -5899,9 +6146,9 @@ namespace System { try { - auto param0 = System::String(Plugin::InternalUse::Only, xHandle); - auto param1 = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemCollectionsGenericIComparerSystemString(cppHandle)->Compare(param0, param1); + auto x = System::String(Plugin::InternalUse::Only, xHandle); + auto y = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemCollectionsGenericIComparerSystemString(cppHandle)->Compare(x, y); } catch (System::Exception ex) { @@ -5926,7 +6173,16 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemStringComparer(this); - Plugin::SystemStringComparerConstructor(CppHandle, &Handle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemStringComparerConstructor(cppHandle, handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -6081,9 +6337,9 @@ namespace System { try { - auto param0 = System::String(Plugin::InternalUse::Only, xHandle); - auto param1 = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemStringComparer(cppHandle)->Compare(param0, param1); + auto x = System::String(Plugin::InternalUse::Only, xHandle); + auto y = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemStringComparer(cppHandle)->Compare(x, y); } catch (System::Exception ex) { @@ -6108,9 +6364,9 @@ namespace System { try { - auto param0 = System::String(Plugin::InternalUse::Only, xHandle); - auto param1 = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemStringComparer(cppHandle)->Equals(param0, param1); + auto x = System::String(Plugin::InternalUse::Only, xHandle); + auto y = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemStringComparer(cppHandle)->Equals(x, y); } catch (System::Exception ex) { @@ -6135,8 +6391,8 @@ namespace System { try { - auto param0 = System::String(Plugin::InternalUse::Only, objHandle); - return Plugin::GetSystemStringComparer(cppHandle)->GetHashCode(param0); + auto obj = System::String(Plugin::InternalUse::Only, objHandle); + return Plugin::GetSystemStringComparer(cppHandle)->GetHashCode(obj); } catch (System::Exception ex) { @@ -6161,7 +6417,16 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemCollectionsICollection(this); - Plugin::SystemCollectionsICollectionConstructor(CppHandle, &Handle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemCollectionsICollectionConstructor(cppHandle, handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -6315,8 +6580,8 @@ namespace System { try { - auto param0 = System::Array(Plugin::InternalUse::Only, arrayHandle); - Plugin::GetSystemCollectionsICollection(cppHandle)->CopyTo(param0, index); + auto array = System::Array(Plugin::InternalUse::Only, arrayHandle); + Plugin::GetSystemCollectionsICollection(cppHandle)->CopyTo(array, index); } catch (System::Exception ex) { @@ -6440,7 +6705,16 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemCollectionsIList(this); - Plugin::SystemCollectionsIListConstructor(CppHandle, &Handle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemCollectionsIListConstructor(cppHandle, handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -6595,8 +6869,8 @@ namespace System { try { - auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); - return Plugin::GetSystemCollectionsIList(cppHandle)->Add(param0); + auto value = System::Object(Plugin::InternalUse::Only, valueHandle); + return Plugin::GetSystemCollectionsIList(cppHandle)->Add(value); } catch (System::Exception ex) { @@ -6643,8 +6917,8 @@ namespace System { try { - auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); - return Plugin::GetSystemCollectionsIList(cppHandle)->Contains(param0); + auto value = System::Object(Plugin::InternalUse::Only, valueHandle); + return Plugin::GetSystemCollectionsIList(cppHandle)->Contains(value); } catch (System::Exception ex) { @@ -6669,8 +6943,8 @@ namespace System { try { - auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); - return Plugin::GetSystemCollectionsIList(cppHandle)->IndexOf(param0); + auto value = System::Object(Plugin::InternalUse::Only, valueHandle); + return Plugin::GetSystemCollectionsIList(cppHandle)->IndexOf(value); } catch (System::Exception ex) { @@ -6694,8 +6968,8 @@ namespace System { try { - auto param1 = System::Object(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemCollectionsIList(cppHandle)->Insert(index, param1); + auto value = System::Object(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemCollectionsIList(cppHandle)->Insert(index, value); } catch (System::Exception ex) { @@ -6717,8 +6991,8 @@ namespace System { try { - auto param0 = System::Object(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemCollectionsIList(cppHandle)->Remove(param0); + auto value = System::Object(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemCollectionsIList(cppHandle)->Remove(value); } catch (System::Exception ex) { @@ -6787,8 +7061,8 @@ namespace System { try { - auto param0 = System::Array(Plugin::InternalUse::Only, arrayHandle); - Plugin::GetSystemCollectionsIList(cppHandle)->CopyTo(param0, index); + auto array = System::Array(Plugin::InternalUse::Only, arrayHandle); + Plugin::GetSystemCollectionsIList(cppHandle)->CopyTo(array, index); } catch (System::Exception ex) { @@ -6885,8 +7159,8 @@ namespace System { try { - auto param1 = System::Object(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemCollectionsIList(cppHandle)->SetItem(index, param1); + auto value = System::Object(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemCollectionsIList(cppHandle)->SetItem(index, value); } catch (System::Exception ex) { @@ -6985,7 +7259,16 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemCollectionsQueue(this); - Plugin::SystemCollectionsQueueConstructor(CppHandle, &Handle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemCollectionsQueueConstructor(cppHandle, handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -7168,7 +7451,16 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemComponentModelDesignIComponentChangeService(this); - Plugin::SystemComponentModelDesignIComponentChangeServiceConstructor(CppHandle, &Handle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemComponentModelDesignIComponentChangeServiceConstructor(cppHandle, handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -7322,11 +7614,11 @@ namespace System { try { - auto param0 = System::Object(Plugin::InternalUse::Only, componentHandle); - auto param1 = System::ComponentModel::MemberDescriptor(Plugin::InternalUse::Only, memberHandle); - auto param2 = System::Object(Plugin::InternalUse::Only, oldValueHandle); - auto param3 = System::Object(Plugin::InternalUse::Only, newValueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->OnComponentChanged(param0, param1, param2, param3); + auto component = System::Object(Plugin::InternalUse::Only, componentHandle); + auto member = System::ComponentModel::MemberDescriptor(Plugin::InternalUse::Only, memberHandle); + auto oldValue = System::Object(Plugin::InternalUse::Only, oldValueHandle); + auto newValue = System::Object(Plugin::InternalUse::Only, newValueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->OnComponentChanged(component, member, oldValue, newValue); } catch (System::Exception ex) { @@ -7348,9 +7640,9 @@ namespace System { try { - auto param0 = System::Object(Plugin::InternalUse::Only, componentHandle); - auto param1 = System::ComponentModel::MemberDescriptor(Plugin::InternalUse::Only, memberHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->OnComponentChanging(param0, param1); + auto component = System::Object(Plugin::InternalUse::Only, componentHandle); + auto member = System::ComponentModel::MemberDescriptor(Plugin::InternalUse::Only, memberHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->OnComponentChanging(component, member); } catch (System::Exception ex) { @@ -7372,8 +7664,8 @@ namespace System { try { - auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentAdded(param0); + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentAdded(value); } catch (System::Exception ex) { @@ -7395,8 +7687,8 @@ namespace System { try { - auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentAdded(param0); + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentAdded(value); } catch (System::Exception ex) { @@ -7418,8 +7710,8 @@ namespace System { try { - auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentAdding(param0); + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentAdding(value); } catch (System::Exception ex) { @@ -7441,8 +7733,8 @@ namespace System { try { - auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentAdding(param0); + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentAdding(value); } catch (System::Exception ex) { @@ -7464,8 +7756,8 @@ namespace System { try { - auto param0 = System::ComponentModel::Design::ComponentChangedEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentChanged(param0); + auto value = System::ComponentModel::Design::ComponentChangedEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentChanged(value); } catch (System::Exception ex) { @@ -7487,8 +7779,8 @@ namespace System { try { - auto param0 = System::ComponentModel::Design::ComponentChangedEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentChanged(param0); + auto value = System::ComponentModel::Design::ComponentChangedEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentChanged(value); } catch (System::Exception ex) { @@ -7510,8 +7802,8 @@ namespace System { try { - auto param0 = System::ComponentModel::Design::ComponentChangingEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentChanging(param0); + auto value = System::ComponentModel::Design::ComponentChangingEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentChanging(value); } catch (System::Exception ex) { @@ -7533,8 +7825,8 @@ namespace System { try { - auto param0 = System::ComponentModel::Design::ComponentChangingEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentChanging(param0); + auto value = System::ComponentModel::Design::ComponentChangingEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentChanging(value); } catch (System::Exception ex) { @@ -7556,8 +7848,8 @@ namespace System { try { - auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentRemoved(param0); + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentRemoved(value); } catch (System::Exception ex) { @@ -7579,8 +7871,8 @@ namespace System { try { - auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentRemoved(param0); + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentRemoved(value); } catch (System::Exception ex) { @@ -7602,8 +7894,8 @@ namespace System { try { - auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentRemoving(param0); + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentRemoving(value); } catch (System::Exception ex) { @@ -7625,8 +7917,8 @@ namespace System { try { - auto param0 = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentRemoving(param0); + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentRemoving(value); } catch (System::Exception ex) { @@ -7648,8 +7940,8 @@ namespace System { try { - auto param0 = System::ComponentModel::Design::ComponentRenameEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentRename(param0); + auto value = System::ComponentModel::Design::ComponentRenameEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentRename(value); } catch (System::Exception ex) { @@ -7671,8 +7963,8 @@ namespace System { try { - auto param0 = System::ComponentModel::Design::ComponentRenameEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentRename(param0); + auto value = System::ComponentModel::Design::ComponentRenameEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentRename(value); } catch (System::Exception ex) { @@ -7689,6 +7981,193 @@ namespace System } } +namespace System +{ + namespace IO + { + FileStream::FileStream(System::String& path, System::IO::FileMode mode) + : System::IO::Stream(nullptr) + { + CppHandle = Plugin::StoreSystemIOFileStream(this); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemIOFileStreamConstructorSystemString_SystemIOFileMode(cppHandle, handle, path.Handle, mode); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemIOFileStream(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + FileStream::FileStream(decltype(nullptr) n) + : System::IO::Stream(Plugin::InternalUse::Only, 0) + { + CppHandle = Plugin::StoreSystemIOFileStream(this); + } + + FileStream::FileStream(const FileStream& other) + : System::IO::Stream(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = Plugin::StoreSystemIOFileStream(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + FileStream::FileStream(FileStream&& other) + : System::IO::Stream(Plugin::InternalUse::Only, other.Handle) + { + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + FileStream::FileStream(Plugin::InternalUse iu, int32_t handle) + : System::IO::Stream(iu, handle) + { + CppHandle = Plugin::StoreSystemIOFileStream(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + FileStream::~FileStream() + { + Plugin::RemoveSystemIOFileStream(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemIOFileStream(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + FileStream& FileStream::operator=(const FileStream& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + FileStream& FileStream::operator=(decltype(nullptr) other) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemIOFileStream(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + FileStream& FileStream::operator=(FileStream&& other) + { + Plugin::RemoveSystemIOFileStream(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemIOFileStream(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool FileStream::operator==(const FileStream& other) const + { + return Handle == other.Handle; + } + + bool FileStream::operator!=(const FileStream& other) const + { + return Handle != other.Handle; + } + + void FileStream::WriteByte(uint8_t value) + { + } + + DLLEXPORT void SystemIOFileStreamWriteByte(int32_t cppHandle, uint8_t value) + { + try + { + Plugin::GetSystemIOFileStream(cppHandle)->WriteByte(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::IO::FileStream"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + } +} + namespace System { Object::Object(System::Boolean val) @@ -9704,7 +10183,17 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemAction(this); - Plugin::SystemActionConstructor(CppHandle, &Handle, &ClassHandle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + int32_t* classHandle = &ClassHandle; + Plugin::SystemActionConstructor(cppHandle, handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -9931,7 +10420,17 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemActionSystemSingle(this); - Plugin::SystemActionSystemSingleConstructor(CppHandle, &Handle, &ClassHandle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + int32_t* classHandle = &ClassHandle; + Plugin::SystemActionSystemSingleConstructor(cppHandle, handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -10158,7 +10657,17 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); - Plugin::SystemActionSystemSingle_SystemSingleConstructor(CppHandle, &Handle, &ClassHandle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + int32_t* classHandle = &ClassHandle; + Plugin::SystemActionSystemSingle_SystemSingleConstructor(cppHandle, handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -10385,7 +10894,17 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(CppHandle, &Handle, &ClassHandle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + int32_t* classHandle = &ClassHandle; + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(cppHandle, handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -10616,7 +11135,17 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(CppHandle, &Handle, &ClassHandle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + int32_t* classHandle = &ClassHandle; + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(cppHandle, handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -10847,7 +11376,17 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemAppDomainInitializer(this); - Plugin::SystemAppDomainInitializerConstructor(CppHandle, &Handle, &ClassHandle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + int32_t* classHandle = &ClassHandle; + Plugin::SystemAppDomainInitializerConstructor(cppHandle, handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -11041,8 +11580,8 @@ namespace System { try { - auto param0 = System::Array1(Plugin::InternalUse::Only, argsHandle); - Plugin::GetSystemAppDomainInitializer(cppHandle)->operator()(param0); + auto args = System::Array1(Plugin::InternalUse::Only, argsHandle); + Plugin::GetSystemAppDomainInitializer(cppHandle)->operator()(args); } catch (System::Exception ex) { @@ -11077,7 +11616,17 @@ namespace UnityEngine : System::Object(nullptr) { CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); - Plugin::UnityEngineEventsUnityActionConstructor(CppHandle, &Handle, &ClassHandle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + int32_t* classHandle = &ClassHandle; + Plugin::UnityEngineEventsUnityActionConstructor(cppHandle, handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -11307,7 +11856,17 @@ namespace UnityEngine : System::Object(nullptr) { CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor(CppHandle, &Handle, &ClassHandle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + int32_t* classHandle = &ClassHandle; + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor(cppHandle, handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -11539,7 +12098,17 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); - Plugin::SystemComponentModelDesignComponentEventHandlerConstructor(CppHandle, &Handle, &ClassHandle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + int32_t* classHandle = &ClassHandle; + Plugin::SystemComponentModelDesignComponentEventHandlerConstructor(cppHandle, handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -11733,9 +12302,9 @@ namespace System { try { - auto param0 = System::Object(Plugin::InternalUse::Only, senderHandle); - auto param1 = System::ComponentModel::Design::ComponentEventArgs(Plugin::InternalUse::Only, eHandle); - Plugin::GetSystemComponentModelDesignComponentEventHandler(cppHandle)->operator()(param0, param1); + auto sender = System::Object(Plugin::InternalUse::Only, senderHandle); + auto e = System::ComponentModel::Design::ComponentEventArgs(Plugin::InternalUse::Only, eHandle); + Plugin::GetSystemComponentModelDesignComponentEventHandler(cppHandle)->operator()(sender, e); } catch (System::Exception ex) { @@ -11774,7 +12343,17 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); - Plugin::SystemComponentModelDesignComponentChangingEventHandlerConstructor(CppHandle, &Handle, &ClassHandle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + int32_t* classHandle = &ClassHandle; + Plugin::SystemComponentModelDesignComponentChangingEventHandlerConstructor(cppHandle, handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -11968,9 +12547,9 @@ namespace System { try { - auto param0 = System::Object(Plugin::InternalUse::Only, senderHandle); - auto param1 = System::ComponentModel::Design::ComponentChangingEventArgs(Plugin::InternalUse::Only, eHandle); - Plugin::GetSystemComponentModelDesignComponentChangingEventHandler(cppHandle)->operator()(param0, param1); + auto sender = System::Object(Plugin::InternalUse::Only, senderHandle); + auto e = System::ComponentModel::Design::ComponentChangingEventArgs(Plugin::InternalUse::Only, eHandle); + Plugin::GetSystemComponentModelDesignComponentChangingEventHandler(cppHandle)->operator()(sender, e); } catch (System::Exception ex) { @@ -12009,7 +12588,17 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); - Plugin::SystemComponentModelDesignComponentChangedEventHandlerConstructor(CppHandle, &Handle, &ClassHandle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + int32_t* classHandle = &ClassHandle; + Plugin::SystemComponentModelDesignComponentChangedEventHandlerConstructor(cppHandle, handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -12203,9 +12792,9 @@ namespace System { try { - auto param0 = System::Object(Plugin::InternalUse::Only, senderHandle); - auto param1 = System::ComponentModel::Design::ComponentChangedEventArgs(Plugin::InternalUse::Only, eHandle); - Plugin::GetSystemComponentModelDesignComponentChangedEventHandler(cppHandle)->operator()(param0, param1); + auto sender = System::Object(Plugin::InternalUse::Only, senderHandle); + auto e = System::ComponentModel::Design::ComponentChangedEventArgs(Plugin::InternalUse::Only, eHandle); + Plugin::GetSystemComponentModelDesignComponentChangedEventHandler(cppHandle)->operator()(sender, e); } catch (System::Exception ex) { @@ -12244,7 +12833,17 @@ namespace System : System::Object(nullptr) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); - Plugin::SystemComponentModelDesignComponentRenameEventHandlerConstructor(CppHandle, &Handle, &ClassHandle); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + int32_t* classHandle = &ClassHandle; + Plugin::SystemComponentModelDesignComponentRenameEventHandlerConstructor(cppHandle, handle, classHandle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (Handle) { Plugin::ReferenceManagedClass(Handle); @@ -12438,9 +13037,9 @@ namespace System { try { - auto param0 = System::Object(Plugin::InternalUse::Only, senderHandle); - auto param1 = System::ComponentModel::Design::ComponentRenameEventArgs(Plugin::InternalUse::Only, eHandle); - Plugin::GetSystemComponentModelDesignComponentRenameEventHandler(cppHandle)->operator()(param0, param1); + auto sender = System::Object(Plugin::InternalUse::Only, senderHandle); + auto e = System::ComponentModel::Design::ComponentRenameEventArgs(Plugin::InternalUse::Only, eHandle); + Plugin::GetSystemComponentModelDesignComponentRenameEventHandler(cppHandle)->operator()(sender, e); } catch (System::Exception ex) { @@ -12616,6 +13215,8 @@ DLLEXPORT void Init( int32_t (*boxPrimitiveType)(UnityEngine::PrimitiveType val), UnityEngine::PrimitiveType (*unboxPrimitiveType)(int32_t valHandle), float (*unityEngineTimePropertyGetDeltaTime)(), + int32_t (*boxFileMode)(System::IO::FileMode val), + System::IO::FileMode (*unboxFileMode)(int32_t valHandle), void (*releaseSystemCollectionsGenericIComparerSystemInt32)(int32_t handle), void (*systemCollectionsGenericIComparerSystemInt32Constructor)(int32_t cppHandle, int32_t* handle), void (*releaseSystemCollectionsGenericIComparerSystemString)(int32_t handle), @@ -12630,6 +13231,8 @@ DLLEXPORT void Init( void (*systemCollectionsQueueConstructor)(int32_t cppHandle, int32_t* handle), void (*releaseSystemComponentModelDesignIComponentChangeService)(int32_t handle), void (*systemComponentModelDesignIComponentChangeServiceConstructor)(int32_t cppHandle, int32_t* handle), + void (*releaseSystemIOFileStream)(int32_t handle), + void (*systemIOFileStreamConstructorSystemString_SystemIOFileMode)(int32_t cppHandle, int32_t* handle, int32_t pathHandle, System::IO::FileMode mode), int32_t (*boxBoolean)(System::Boolean val), System::Boolean (*unboxBoolean)(int32_t valHandle), int32_t (*boxSByte)(int8_t val), @@ -12861,6 +13464,8 @@ DLLEXPORT void Init( Plugin::BoxPrimitiveType = boxPrimitiveType; Plugin::UnboxPrimitiveType = unboxPrimitiveType; Plugin::UnityEngineTimePropertyGetDeltaTime = unityEngineTimePropertyGetDeltaTime; + Plugin::BoxFileMode = boxFileMode; + Plugin::UnboxFileMode = unboxFileMode; SystemCollectionsGenericIComparerSystemInt32FreeListSize = maxManagedObjects; SystemCollectionsGenericIComparerSystemInt32FreeList = new System::Collections::Generic::IComparer*[SystemCollectionsGenericIComparerSystemInt32FreeListSize]; for (int32_t i = 0, end = SystemCollectionsGenericIComparerSystemInt32FreeListSize - 1; i < end; ++i) @@ -12931,6 +13536,16 @@ DLLEXPORT void Init( NextFreeSystemComponentModelDesignIComponentChangeService = SystemComponentModelDesignIComponentChangeServiceFreeList + 1; Plugin::ReleaseSystemComponentModelDesignIComponentChangeService = releaseSystemComponentModelDesignIComponentChangeService; Plugin::SystemComponentModelDesignIComponentChangeServiceConstructor = systemComponentModelDesignIComponentChangeServiceConstructor; + SystemIOFileStreamFreeListSize = maxManagedObjects; + SystemIOFileStreamFreeList = new System::IO::FileStream*[SystemIOFileStreamFreeListSize]; + for (int32_t i = 0, end = SystemIOFileStreamFreeListSize - 1; i < end; ++i) + { + SystemIOFileStreamFreeList[i] = (System::IO::FileStream*)(SystemIOFileStreamFreeList + i + 1); + } + SystemIOFileStreamFreeList[SystemIOFileStreamFreeListSize - 1] = nullptr; + NextFreeSystemIOFileStream = SystemIOFileStreamFreeList + 1; + Plugin::ReleaseSystemIOFileStream = releaseSystemIOFileStream; + Plugin::SystemIOFileStreamConstructorSystemString_SystemIOFileMode = systemIOFileStreamConstructorSystemString_SystemIOFileMode; Plugin::BoxBoolean = boxBoolean; Plugin::UnboxBoolean = unboxBoolean; Plugin::BoxSByte = boxSByte; diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index d6005b8..5954582 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -618,6 +618,35 @@ namespace UnityEngine struct Time; } +namespace System +{ + namespace IO + { + enum struct FileMode : int32_t + { + CreateNew = 1, + Create = 2, + Open = 3, + OpenOrCreate = 4, + Truncate = 5, + Append = 6 + }; + } +} + +namespace System +{ + struct MarshalByRefObject; +} + +namespace System +{ + namespace IO + { + struct Stream; + } +} + namespace System { namespace Collections @@ -691,6 +720,14 @@ namespace System } } +namespace System +{ + namespace IO + { + struct FileStream; + } +} + namespace MyGame { namespace MonoBehaviours @@ -962,6 +999,8 @@ namespace System explicit operator UnityEngine::SceneManagement::LoadSceneMode(); Object(UnityEngine::PrimitiveType val); explicit operator UnityEngine::PrimitiveType(); + Object(System::IO::FileMode val); + explicit operator System::IO::FileMode(); Object(System::Boolean val); explicit operator System::Boolean(); Object(int8_t val); @@ -1890,6 +1929,43 @@ namespace UnityEngine }; } +namespace System +{ + struct MarshalByRefObject : System::Object + { + MarshalByRefObject(decltype(nullptr) n); + MarshalByRefObject(Plugin::InternalUse iu, int32_t handle); + MarshalByRefObject(const MarshalByRefObject& other); + MarshalByRefObject(MarshalByRefObject&& other); + virtual ~MarshalByRefObject(); + MarshalByRefObject& operator=(const MarshalByRefObject& other); + MarshalByRefObject& operator=(decltype(nullptr) other); + MarshalByRefObject& operator=(MarshalByRefObject&& other); + bool operator==(const MarshalByRefObject& other) const; + bool operator!=(const MarshalByRefObject& other) const; + }; +} + +namespace System +{ + namespace IO + { + struct Stream : System::MarshalByRefObject + { + Stream(decltype(nullptr) n); + Stream(Plugin::InternalUse iu, int32_t handle); + Stream(const Stream& other); + Stream(Stream&& other); + virtual ~Stream(); + Stream& operator=(const Stream& other); + Stream& operator=(decltype(nullptr) other); + Stream& operator=(Stream&& other); + bool operator==(const Stream& other) const; + bool operator!=(const Stream& other) const; + }; + } +} + namespace System { namespace Collections @@ -2093,6 +2169,29 @@ namespace System } } +namespace System +{ + namespace IO + { + struct FileStream : System::IO::Stream + { + FileStream(decltype(nullptr) n); + FileStream(Plugin::InternalUse iu, int32_t handle); + FileStream(const FileStream& other); + FileStream(FileStream&& other); + virtual ~FileStream(); + FileStream& operator=(const FileStream& other); + FileStream& operator=(decltype(nullptr) other); + FileStream& operator=(FileStream&& other); + bool operator==(const FileStream& other) const; + bool operator!=(const FileStream& other) const; + int32_t CppHandle; + FileStream(System::String& path, System::IO::FileMode mode); + virtual void WriteByte(uint8_t value); + }; + } +} + namespace MyGame { namespace MonoBehaviours From 666b53ea37b809d183cb305266e5f518c31d7532 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 10 Dec 2017 23:02:19 -0800 Subject: [PATCH 47/95] Insert base types into the type hierarchy --- Unity/Assets/NativeScript/Bindings.cs | 310 ++- .../NativeScript/Editor/GenerateBindings.cs | 194 +- Unity/Assets/NativeScriptTypes.json | 86 +- Unity/CppSource/NativeScript/Bindings.cpp | 1862 ++++++++++++----- Unity/CppSource/NativeScript/Bindings.h | 270 ++- 5 files changed, 1968 insertions(+), 754 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 6dbbc70..bbff41a 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -381,22 +381,25 @@ delegate void InitDelegate( IntPtr unityEngineTimePropertyGetDeltaTime, IntPtr boxFileMode, IntPtr unboxFileMode, - IntPtr releaseSystemCollectionsGenericIComparerSystemInt32, - IntPtr systemCollectionsGenericIComparerSystemInt32Constructor, - IntPtr releaseSystemCollectionsGenericIComparerSystemString, - IntPtr systemCollectionsGenericIComparerSystemStringConstructor, - IntPtr releaseSystemStringComparer, - IntPtr systemStringComparerConstructor, - IntPtr releaseSystemCollectionsICollection, - IntPtr systemCollectionsICollectionConstructor, - IntPtr releaseSystemCollectionsIList, - IntPtr systemCollectionsIListConstructor, - IntPtr releaseSystemCollectionsQueue, - IntPtr systemCollectionsQueueConstructor, - IntPtr releaseSystemComponentModelDesignIComponentChangeService, - IntPtr systemComponentModelDesignIComponentChangeServiceConstructor, - IntPtr releaseSystemIOFileStream, + IntPtr releaseSystemCollectionsGenericBaseIComparerSystemInt32, + IntPtr systemCollectionsGenericBaseIComparerSystemInt32Constructor, + IntPtr releaseSystemCollectionsGenericBaseIComparerSystemString, + IntPtr systemCollectionsGenericBaseIComparerSystemStringConstructor, + IntPtr releaseSystemBaseStringComparer, + IntPtr systemBaseStringComparerConstructor, + IntPtr releaseSystemCollectionsBaseICollection, + IntPtr systemCollectionsBaseICollectionConstructor, + IntPtr releaseSystemCollectionsBaseIList, + IntPtr systemCollectionsBaseIListConstructor, + IntPtr systemCollectionsQueuePropertyGetCount, + IntPtr releaseSystemCollectionsBaseQueue, + IntPtr systemCollectionsBaseQueueConstructor, + IntPtr releaseSystemComponentModelDesignBaseIComponentChangeService, + IntPtr systemComponentModelDesignBaseIComponentChangeServiceConstructor, IntPtr systemIOFileStreamConstructorSystemString_SystemIOFileMode, + IntPtr systemIOFileStreamMethodWriteByteSystemByte, + IntPtr releaseSystemIOBaseFileStream, + IntPtr systemIOBaseFileStreamConstructorSystemString_SystemIOFileMode, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -906,22 +909,25 @@ static extern void Init( IntPtr unityEngineTimePropertyGetDeltaTime, IntPtr boxFileMode, IntPtr unboxFileMode, - IntPtr releaseSystemCollectionsGenericIComparerSystemInt32, - IntPtr systemCollectionsGenericIComparerSystemInt32Constructor, - IntPtr releaseSystemCollectionsGenericIComparerSystemString, - IntPtr systemCollectionsGenericIComparerSystemStringConstructor, - IntPtr releaseSystemStringComparer, - IntPtr systemStringComparerConstructor, - IntPtr releaseSystemCollectionsICollection, - IntPtr systemCollectionsICollectionConstructor, - IntPtr releaseSystemCollectionsIList, - IntPtr systemCollectionsIListConstructor, - IntPtr releaseSystemCollectionsQueue, - IntPtr systemCollectionsQueueConstructor, - IntPtr releaseSystemComponentModelDesignIComponentChangeService, - IntPtr systemComponentModelDesignIComponentChangeServiceConstructor, - IntPtr releaseSystemIOFileStream, + IntPtr releaseSystemCollectionsGenericBaseIComparerSystemInt32, + IntPtr systemCollectionsGenericBaseIComparerSystemInt32Constructor, + IntPtr releaseSystemCollectionsGenericBaseIComparerSystemString, + IntPtr systemCollectionsGenericBaseIComparerSystemStringConstructor, + IntPtr releaseSystemBaseStringComparer, + IntPtr systemBaseStringComparerConstructor, + IntPtr releaseSystemCollectionsBaseICollection, + IntPtr systemCollectionsBaseICollectionConstructor, + IntPtr releaseSystemCollectionsBaseIList, + IntPtr systemCollectionsBaseIListConstructor, + IntPtr systemCollectionsQueuePropertyGetCount, + IntPtr releaseSystemCollectionsBaseQueue, + IntPtr systemCollectionsBaseQueueConstructor, + IntPtr releaseSystemComponentModelDesignBaseIComponentChangeService, + IntPtr systemComponentModelDesignBaseIComponentChangeServiceConstructor, IntPtr systemIOFileStreamConstructorSystemString_SystemIOFileMode, + IntPtr systemIOFileStreamMethodWriteByteSystemByte, + IntPtr releaseSystemIOBaseFileStream, + IntPtr systemIOBaseFileStreamConstructorSystemString_SystemIOFileMode, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -1342,22 +1348,25 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate float UnityEngineTimePropertyGetDeltaTimeDelegate(); delegate int BoxFileModeDelegate(System.IO.FileMode val); delegate System.IO.FileMode UnboxFileModeDelegate(int valHandle); - delegate void SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemCollectionsGenericIComparerSystemInt32Delegate(int handle); - delegate void SystemCollectionsGenericIComparerSystemStringConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemCollectionsGenericIComparerSystemStringDelegate(int handle); - delegate void SystemStringComparerConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemStringComparerDelegate(int handle); - delegate void SystemCollectionsICollectionConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemCollectionsICollectionDelegate(int handle); - delegate void SystemCollectionsIListConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemCollectionsIListDelegate(int handle); - delegate void SystemCollectionsQueueConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemCollectionsQueueDelegate(int handle); - delegate void SystemComponentModelDesignIComponentChangeServiceConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemComponentModelDesignIComponentChangeServiceDelegate(int handle); - delegate void SystemIOFileStreamConstructorSystemString_SystemIOFileModeDelegate(int cppHandle, ref int handle, int pathHandle, System.IO.FileMode mode); - delegate void ReleaseSystemIOFileStreamDelegate(int handle); + delegate void SystemCollectionsGenericBaseIComparerSystemInt32ConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemCollectionsGenericBaseIComparerSystemInt32Delegate(int handle); + delegate void SystemCollectionsGenericBaseIComparerSystemStringConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemCollectionsGenericBaseIComparerSystemStringDelegate(int handle); + delegate void SystemBaseStringComparerConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemBaseStringComparerDelegate(int handle); + delegate void SystemCollectionsBaseICollectionConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemCollectionsBaseICollectionDelegate(int handle); + delegate void SystemCollectionsBaseIListConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemCollectionsBaseIListDelegate(int handle); + delegate int SystemCollectionsQueuePropertyGetCountDelegate(int thisHandle); + delegate void SystemCollectionsBaseQueueConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemCollectionsBaseQueueDelegate(int handle); + delegate void SystemComponentModelDesignBaseIComponentChangeServiceConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseSystemComponentModelDesignBaseIComponentChangeServiceDelegate(int handle); + delegate int SystemIOFileStreamConstructorSystemString_SystemIOFileModeDelegate(int pathHandle, System.IO.FileMode mode); + delegate void SystemIOFileStreamMethodWriteByteSystemByteDelegate(int thisHandle, byte value); + delegate void SystemIOBaseFileStreamConstructorSystemString_SystemIOFileModeDelegate(int cppHandle, ref int handle, int pathHandle, System.IO.FileMode mode); + delegate void ReleaseSystemIOBaseFileStreamDelegate(int handle); delegate int BoxBooleanDelegate(bool val); delegate bool UnboxBooleanDelegate(int valHandle); delegate int BoxSByteDelegate(sbyte val); @@ -1684,22 +1693,25 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnityEngineTimePropertyGetDeltaTimeDelegate(UnityEngineTimePropertyGetDeltaTime)), Marshal.GetFunctionPointerForDelegate(new BoxFileModeDelegate(BoxFileMode)), Marshal.GetFunctionPointerForDelegate(new UnboxFileModeDelegate(UnboxFileMode)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericIComparerSystemInt32Delegate(ReleaseSystemCollectionsGenericIComparerSystemInt32)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate(SystemCollectionsGenericIComparerSystemInt32Constructor)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericIComparerSystemStringDelegate(ReleaseSystemCollectionsGenericIComparerSystemString)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIComparerSystemStringConstructorDelegate(SystemCollectionsGenericIComparerSystemStringConstructor)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemStringComparerDelegate(ReleaseSystemStringComparer)), - Marshal.GetFunctionPointerForDelegate(new SystemStringComparerConstructorDelegate(SystemStringComparerConstructor)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsICollectionDelegate(ReleaseSystemCollectionsICollection)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsICollectionConstructorDelegate(SystemCollectionsICollectionConstructor)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsIListDelegate(ReleaseSystemCollectionsIList)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIListConstructorDelegate(SystemCollectionsIListConstructor)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsQueueDelegate(ReleaseSystemCollectionsQueue)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsQueueConstructorDelegate(SystemCollectionsQueueConstructor)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemComponentModelDesignIComponentChangeServiceDelegate(ReleaseSystemComponentModelDesignIComponentChangeService)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignIComponentChangeServiceConstructorDelegate(SystemComponentModelDesignIComponentChangeServiceConstructor)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemIOFileStreamDelegate(ReleaseSystemIOFileStream)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericBaseIComparerSystemInt32Delegate(ReleaseSystemCollectionsGenericBaseIComparerSystemInt32)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericBaseIComparerSystemInt32ConstructorDelegate(SystemCollectionsGenericBaseIComparerSystemInt32Constructor)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericBaseIComparerSystemStringDelegate(ReleaseSystemCollectionsGenericBaseIComparerSystemString)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericBaseIComparerSystemStringConstructorDelegate(SystemCollectionsGenericBaseIComparerSystemStringConstructor)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemBaseStringComparerDelegate(ReleaseSystemBaseStringComparer)), + Marshal.GetFunctionPointerForDelegate(new SystemBaseStringComparerConstructorDelegate(SystemBaseStringComparerConstructor)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsBaseICollectionDelegate(ReleaseSystemCollectionsBaseICollection)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsBaseICollectionConstructorDelegate(SystemCollectionsBaseICollectionConstructor)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsBaseIListDelegate(ReleaseSystemCollectionsBaseIList)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsBaseIListConstructorDelegate(SystemCollectionsBaseIListConstructor)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsQueuePropertyGetCountDelegate(SystemCollectionsQueuePropertyGetCount)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsBaseQueueDelegate(ReleaseSystemCollectionsBaseQueue)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsBaseQueueConstructorDelegate(SystemCollectionsBaseQueueConstructor)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemComponentModelDesignBaseIComponentChangeServiceDelegate(ReleaseSystemComponentModelDesignBaseIComponentChangeService)), + Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignBaseIComponentChangeServiceConstructorDelegate(SystemComponentModelDesignBaseIComponentChangeServiceConstructor)), Marshal.GetFunctionPointerForDelegate(new SystemIOFileStreamConstructorSystemString_SystemIOFileModeDelegate(SystemIOFileStreamConstructorSystemString_SystemIOFileMode)), + Marshal.GetFunctionPointerForDelegate(new SystemIOFileStreamMethodWriteByteSystemByteDelegate(SystemIOFileStreamMethodWriteByteSystemByte)), + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemIOBaseFileStreamDelegate(ReleaseSystemIOBaseFileStream)), + Marshal.GetFunctionPointerForDelegate(new SystemIOBaseFileStreamConstructorSystemString_SystemIOFileModeDelegate(SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode)), Marshal.GetFunctionPointerForDelegate(new BoxBooleanDelegate(BoxBoolean)), Marshal.GetFunctionPointerForDelegate(new UnboxBooleanDelegate(UnboxBoolean)), Marshal.GetFunctionPointerForDelegate(new BoxSByteDelegate(BoxSByte)), @@ -1866,11 +1878,11 @@ static int ArrayGetLength(int handle) } /*BEGIN BASE TYPES*/ - class SystemCollectionsGenericIComparerSystemInt32 : System.Collections.Generic.IComparer + class SystemCollectionsGenericBaseIComparerSystemInt32 : System.Collections.Generic.IComparer { public int CppHandle; - public SystemCollectionsGenericIComparerSystemInt32(int cppHandle) + public SystemCollectionsGenericBaseIComparerSystemInt32(int cppHandle) : base() { CppHandle = cppHandle; @@ -1895,11 +1907,11 @@ public int Compare(int x, int y) } - class SystemCollectionsGenericIComparerSystemString : System.Collections.Generic.IComparer + class SystemCollectionsGenericBaseIComparerSystemString : System.Collections.Generic.IComparer { public int CppHandle; - public SystemCollectionsGenericIComparerSystemString(int cppHandle) + public SystemCollectionsGenericBaseIComparerSystemString(int cppHandle) : base() { CppHandle = cppHandle; @@ -1926,11 +1938,11 @@ public int Compare(string x, string y) } - class SystemStringComparer : System.StringComparer + class SystemBaseStringComparer : System.StringComparer { public int CppHandle; - public SystemStringComparer(int cppHandle) + public SystemBaseStringComparer(int cppHandle) : base() { CppHandle = cppHandle; @@ -1994,11 +2006,11 @@ public override int GetHashCode(string obj) } - class SystemCollectionsICollection : System.Collections.ICollection + class SystemCollectionsBaseICollection : System.Collections.ICollection { public int CppHandle; - public SystemCollectionsICollection(int cppHandle) + public SystemCollectionsBaseICollection(int cppHandle) : base() { CppHandle = cppHandle; @@ -2099,11 +2111,11 @@ public object SyncRoot } - class SystemCollectionsIList : System.Collections.IList + class SystemCollectionsBaseIList : System.Collections.IList { public int CppHandle; - public SystemCollectionsIList(int cppHandle) + public SystemCollectionsBaseIList(int cppHandle) : base() { CppHandle = cppHandle; @@ -2395,11 +2407,11 @@ public object SyncRoot } - class SystemCollectionsQueue : System.Collections.Queue + class SystemCollectionsBaseQueue : System.Collections.Queue { public int CppHandle; - public SystemCollectionsQueue(int cppHandle) + public SystemCollectionsBaseQueue(int cppHandle) : base() { CppHandle = cppHandle; @@ -2427,11 +2439,11 @@ public override int Count } - class SystemComponentModelDesignIComponentChangeService : System.ComponentModel.Design.IComponentChangeService + class SystemComponentModelDesignBaseIComponentChangeService : System.ComponentModel.Design.IComponentChangeService { public int CppHandle; - public SystemComponentModelDesignIComponentChangeService(int cppHandle) + public SystemComponentModelDesignBaseIComponentChangeService(int cppHandle) : base() { CppHandle = cppHandle; @@ -2713,11 +2725,11 @@ public event System.ComponentModel.Design.ComponentRenameEventHandler ComponentR } - class SystemIOFileStream : System.IO.FileStream + class SystemIOBaseFileStream : System.IO.FileStream { public int CppHandle; - public SystemIOFileStream(int cppHandle, string path, System.IO.FileMode mode) + public SystemIOBaseFileStream(int cppHandle, string path, System.IO.FileMode mode) : base(path, mode) { CppHandle = cppHandle; @@ -5433,12 +5445,12 @@ static System.IO.FileMode UnboxFileMode(int valHandle) } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIComparerSystemInt32ConstructorDelegate))] - static void SystemCollectionsGenericIComparerSystemInt32Constructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericBaseIComparerSystemInt32ConstructorDelegate))] + static void SystemCollectionsGenericBaseIComparerSystemInt32Constructor(int cppHandle, ref int handle) { try { - var thiz = new SystemCollectionsGenericIComparerSystemInt32(cppHandle); + var thiz = new SystemCollectionsGenericBaseIComparerSystemInt32(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -5453,8 +5465,8 @@ static void SystemCollectionsGenericIComparerSystemInt32Constructor(int cppHandl } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericIComparerSystemInt32Delegate))] - static void ReleaseSystemCollectionsGenericIComparerSystemInt32(int handle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericBaseIComparerSystemInt32Delegate))] + static void ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(int handle) { try { @@ -5472,12 +5484,12 @@ static void ReleaseSystemCollectionsGenericIComparerSystemInt32(int handle) } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIComparerSystemStringConstructorDelegate))] - static void SystemCollectionsGenericIComparerSystemStringConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericBaseIComparerSystemStringConstructorDelegate))] + static void SystemCollectionsGenericBaseIComparerSystemStringConstructor(int cppHandle, ref int handle) { try { - var thiz = new SystemCollectionsGenericIComparerSystemString(cppHandle); + var thiz = new SystemCollectionsGenericBaseIComparerSystemString(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -5492,8 +5504,8 @@ static void SystemCollectionsGenericIComparerSystemStringConstructor(int cppHand } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericIComparerSystemStringDelegate))] - static void ReleaseSystemCollectionsGenericIComparerSystemString(int handle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericBaseIComparerSystemStringDelegate))] + static void ReleaseSystemCollectionsGenericBaseIComparerSystemString(int handle) { try { @@ -5511,12 +5523,12 @@ static void ReleaseSystemCollectionsGenericIComparerSystemString(int handle) } } - [MonoPInvokeCallback(typeof(SystemStringComparerConstructorDelegate))] - static void SystemStringComparerConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(SystemBaseStringComparerConstructorDelegate))] + static void SystemBaseStringComparerConstructor(int cppHandle, ref int handle) { try { - var thiz = new SystemStringComparer(cppHandle); + var thiz = new SystemBaseStringComparer(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -5531,8 +5543,8 @@ static void SystemStringComparerConstructor(int cppHandle, ref int handle) } } - [MonoPInvokeCallback(typeof(ReleaseSystemStringComparerDelegate))] - static void ReleaseSystemStringComparer(int handle) + [MonoPInvokeCallback(typeof(ReleaseSystemBaseStringComparerDelegate))] + static void ReleaseSystemBaseStringComparer(int handle) { try { @@ -5550,12 +5562,12 @@ static void ReleaseSystemStringComparer(int handle) } } - [MonoPInvokeCallback(typeof(SystemCollectionsICollectionConstructorDelegate))] - static void SystemCollectionsICollectionConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(SystemCollectionsBaseICollectionConstructorDelegate))] + static void SystemCollectionsBaseICollectionConstructor(int cppHandle, ref int handle) { try { - var thiz = new SystemCollectionsICollection(cppHandle); + var thiz = new SystemCollectionsBaseICollection(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -5570,8 +5582,8 @@ static void SystemCollectionsICollectionConstructor(int cppHandle, ref int handl } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsICollectionDelegate))] - static void ReleaseSystemCollectionsICollection(int handle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsBaseICollectionDelegate))] + static void ReleaseSystemCollectionsBaseICollection(int handle) { try { @@ -5589,12 +5601,12 @@ static void ReleaseSystemCollectionsICollection(int handle) } } - [MonoPInvokeCallback(typeof(SystemCollectionsIListConstructorDelegate))] - static void SystemCollectionsIListConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(SystemCollectionsBaseIListConstructorDelegate))] + static void SystemCollectionsBaseIListConstructor(int cppHandle, ref int handle) { try { - var thiz = new SystemCollectionsIList(cppHandle); + var thiz = new SystemCollectionsBaseIList(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -5609,8 +5621,8 @@ static void SystemCollectionsIListConstructor(int cppHandle, ref int handle) } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsIListDelegate))] - static void ReleaseSystemCollectionsIList(int handle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsBaseIListDelegate))] + static void ReleaseSystemCollectionsBaseIList(int handle) { try { @@ -5628,12 +5640,35 @@ static void ReleaseSystemCollectionsIList(int handle) } } - [MonoPInvokeCallback(typeof(SystemCollectionsQueueConstructorDelegate))] - static void SystemCollectionsQueueConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(SystemCollectionsQueuePropertyGetCountDelegate))] + static int SystemCollectionsQueuePropertyGetCount(int thisHandle) { try { - var thiz = new SystemCollectionsQueue(cppHandle); + var thiz = (System.Collections.Queue)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Count; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsBaseQueueConstructorDelegate))] + static void SystemCollectionsBaseQueueConstructor(int cppHandle, ref int handle) + { + try + { + var thiz = new SystemCollectionsBaseQueue(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -5648,8 +5683,8 @@ static void SystemCollectionsQueueConstructor(int cppHandle, ref int handle) } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsQueueDelegate))] - static void ReleaseSystemCollectionsQueue(int handle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsBaseQueueDelegate))] + static void ReleaseSystemCollectionsBaseQueue(int handle) { try { @@ -5667,12 +5702,12 @@ static void ReleaseSystemCollectionsQueue(int handle) } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignIComponentChangeServiceConstructorDelegate))] - static void SystemComponentModelDesignIComponentChangeServiceConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignBaseIComponentChangeServiceConstructorDelegate))] + static void SystemComponentModelDesignBaseIComponentChangeServiceConstructor(int cppHandle, ref int handle) { try { - var thiz = new SystemComponentModelDesignIComponentChangeService(cppHandle); + var thiz = new SystemComponentModelDesignBaseIComponentChangeService(cppHandle); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -5687,8 +5722,8 @@ static void SystemComponentModelDesignIComponentChangeServiceConstructor(int cpp } } - [MonoPInvokeCallback(typeof(ReleaseSystemComponentModelDesignIComponentChangeServiceDelegate))] - static void ReleaseSystemComponentModelDesignIComponentChangeService(int handle) + [MonoPInvokeCallback(typeof(ReleaseSystemComponentModelDesignBaseIComponentChangeServiceDelegate))] + static void ReleaseSystemComponentModelDesignBaseIComponentChangeService(int handle) { try { @@ -5707,12 +5742,55 @@ static void ReleaseSystemComponentModelDesignIComponentChangeService(int handle) } [MonoPInvokeCallback(typeof(SystemIOFileStreamConstructorSystemString_SystemIOFileModeDelegate))] - static void SystemIOFileStreamConstructorSystemString_SystemIOFileMode(int cppHandle, ref int handle, int pathHandle, System.IO.FileMode mode) + static int SystemIOFileStreamConstructorSystemString_SystemIOFileMode(int pathHandle, System.IO.FileMode mode) + { + try + { + var path = (string)NativeScript.Bindings.ObjectStore.Get(pathHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.IO.FileStream(path, mode)); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemIOFileStreamMethodWriteByteSystemByteDelegate))] + static void SystemIOFileStreamMethodWriteByteSystemByte(int thisHandle, byte value) + { + try + { + var thiz = (System.IO.FileStream)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.WriteByte(value); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemIOBaseFileStreamConstructorSystemString_SystemIOFileModeDelegate))] + static void SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode(int cppHandle, ref int handle, int pathHandle, System.IO.FileMode mode) { try { var path = (string)NativeScript.Bindings.ObjectStore.Get(pathHandle); - var thiz = new SystemIOFileStream(cppHandle, path, mode); + var thiz = new SystemIOBaseFileStream(cppHandle, path, mode); handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) @@ -5727,8 +5805,8 @@ static void SystemIOFileStreamConstructorSystemString_SystemIOFileMode(int cppHa } } - [MonoPInvokeCallback(typeof(ReleaseSystemIOFileStreamDelegate))] - static void ReleaseSystemIOFileStream(int handle) + [MonoPInvokeCallback(typeof(ReleaseSystemIOBaseFileStreamDelegate))] + static void ReleaseSystemIOBaseFileStream(int handle) { try { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 272f160..da95a3e 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -92,12 +92,12 @@ class JsonType public JsonEvent[] Events; public JsonGenericParams[] GenericParams; public int MaxSimultaneous; + public JsonBaseType[] BaseTypes; } [Serializable] class JsonBaseType { - public string Name; public JsonGenericParams[] GenericParams; public int MaxSimultaneous; public JsonConstructor[] Constructors; @@ -133,7 +133,6 @@ class JsonDocument { public string[] Assemblies; public JsonType[] Types; - public JsonBaseType[] BaseTypes; public JsonMonoBehaviour[] MonoBehaviours; public JsonArray[] Arrays; public JsonDelegate[] Delegates; @@ -519,18 +518,18 @@ static void DoPostCompileWork(bool canRefreshAssetDb) jsonType, assemblies, builders); - } - } - - // Generate base types - if (doc.BaseTypes != null) - { - foreach (JsonBaseType jsonBaseType in doc.BaseTypes) - { - AppendBaseType( - jsonBaseType, - assemblies, - builders); + + if (jsonType.BaseTypes != null) + { + foreach (JsonBaseType jsonBaseType in jsonType.BaseTypes) + { + AppendBaseType( + jsonType.Name, + jsonBaseType, + assemblies, + builders); + } + } } } @@ -1629,18 +1628,20 @@ static void AppendType( } static void AppendBaseType( + string typeName, JsonBaseType jsonBaseType, Assembly[] assemblies, StringBuilders builders) { - Type type = GetType(jsonBaseType.Name, assemblies); + Type type = GetType(typeName, assemblies); + string cppTypeName = "Base" + type.Name; Type[] genericArgTypes = type.GetGenericArguments(); if (jsonBaseType.GenericParams != null) { if (!IsStatic(type)) { AppendCppTemplateDeclaration( - type.Name, + cppTypeName, type.Namespace, genericArgTypes.Length, builders.CppTypeDeclarations); @@ -1661,7 +1662,7 @@ static void AppendBaseType( AppendBaseType( genericType, jsonBaseType, - type.Name, + cppTypeName, typeParams, maxSimultaneous, assemblies, @@ -1676,7 +1677,7 @@ static void AppendBaseType( AppendBaseType( type, jsonBaseType, - type.Name, + cppTypeName, null, maxSimultaneous, assemblies, @@ -5830,11 +5831,15 @@ static void AppendDelegate( AppendCppFreeListStateAndFunctions( type, + typeParams, + cppTypeName, bindingTypeName, builders.CppGlobalStateAndFunctions); AppendCppFreeListInit( type, + typeParams, + cppTypeName, maxSimultaneous, bindingTypeName, builders.CppInitBody); @@ -6034,6 +6039,7 @@ static void AppendDelegate( cppTypeName, typeof(object), typeParams, + null, new ParameterInfo[0], constructorParams, true, @@ -6047,6 +6053,7 @@ static void AppendDelegate( typeParams, "Object", "System", + null, true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6057,6 +6064,7 @@ static void AppendDelegate( typeParams, "Object", "System", + null, true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6066,6 +6074,7 @@ static void AppendDelegate( typeParams, "Object", "System", + null, true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6076,6 +6085,7 @@ static void AppendDelegate( typeParams, "Object", "System", + null, true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6382,6 +6392,7 @@ static void AppendBaseType( type.Namespace, string.Empty, builders.TempStrBuilder); + builders.TempStrBuilder.Append("Base"); AppendTypeNameWithoutSuffixes( type.Name, builders.TempStrBuilder); @@ -6512,25 +6523,28 @@ static void AppendBaseType( AppendCppFreeListStateAndFunctions( type, + typeParams, + cppTypeName, bindingTypeName, builders.CppGlobalStateAndFunctions); AppendCppFreeListInit( type, + typeParams, + cppTypeName, maxSimultaneous, bindingTypeName, builders.CppInitBody); // C++ type definition (begin) - Type baseType = type.BaseType ?? typeof(object); AppendCppTypeDefinitionBegin( cppTypeName, type.Namespace, TypeKind.Class, typeParams, - baseType.Name, - baseType.Namespace, - null, + type.Name, + type.Namespace, + typeParams, false, indent, builders.CppTypeDefinitions); @@ -6645,7 +6659,8 @@ static void AppendBaseType( type.Namespace, TypeKind.Class, cppTypeName, - type.BaseType, + type, + typeParams, typeParams, cppConstructorParams[i], constructorParams[i], @@ -6659,8 +6674,9 @@ static void AppendBaseType( bindingTypeName, cppTypeName, typeParams, - baseType.Name, - baseType.Namespace, + type.Name, + type.Namespace, + typeParams, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6669,8 +6685,9 @@ static void AppendBaseType( bindingTypeName, cppTypeName, typeParams, - baseType.Name, - baseType.Namespace, + type.Name, + type.Namespace, + typeParams, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6678,8 +6695,9 @@ static void AppendBaseType( AppendCppBaseTypeMoveConstructor( cppTypeName, typeParams, - baseType.Name, - baseType.Namespace, + type.Name, + type.Namespace, + typeParams, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6688,8 +6706,9 @@ static void AppendBaseType( bindingTypeName, cppTypeName, typeParams, - baseType.Name, - baseType.Namespace, + type.Name, + type.Namespace, + typeParams, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -8719,6 +8738,7 @@ static void AppendCppBaseTypeHandleConstructor( Type[] typeParams, string baseTypeName, string baseTypeNamespace, + Type[] baseTypeParams, bool typeIsDelegate, int cppMethodDefinitionsIndent, StringBuilder output) @@ -8746,6 +8766,9 @@ static void AppendCppBaseTypeHandleConstructor( baseTypeNamespace, baseTypeName, output); + AppendCppTypeParameters( + baseTypeParams, + output); output.Append("(iu, handle)\n"); AppendIndent( cppMethodDefinitionsIndent, @@ -8797,6 +8820,7 @@ static void AppendCppBaseTypeMoveConstructor( Type[] typeParams, string baseTypeName, string baseTypeNamespace, + Type[] baseTypeParams, bool typeIsDelegate, int cppMethodDefinitionsIndent, StringBuilder output) @@ -8830,6 +8854,9 @@ static void AppendCppBaseTypeMoveConstructor( baseTypeNamespace, baseTypeName, output); + AppendCppTypeParameters( + baseTypeParams, + output); output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent( cppMethodDefinitionsIndent, @@ -8879,6 +8906,7 @@ static void AppendCppBaseTypeCopyConstructor( Type[] typeParams, string baseTypeName, string baseTypeNamespace, + Type[] baseTypeParams, bool typeIsDelegate, int cppMethodDefinitionsIndent, StringBuilder output) @@ -8912,6 +8940,9 @@ static void AppendCppBaseTypeCopyConstructor( baseTypeNamespace, baseTypeName, output); + AppendCppTypeParameters( + baseTypeParams, + output); output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent( cppMethodDefinitionsIndent, @@ -8964,6 +8995,7 @@ static void AppendCppBaseTypeNullptrConstructor( Type[] typeParams, string baseTypeName, string baseTypeNamespace, + Type[] baseTypeParams, bool typeIsDelegate, int cppMethodDefinitionsIndent, StringBuilder output) @@ -8990,6 +9022,9 @@ static void AppendCppBaseTypeNullptrConstructor( baseTypeNamespace, baseTypeName, output); + AppendCppTypeParameters( + baseTypeParams, + output); output.Append("(Plugin::InternalUse::Only, 0)\n"); AppendIndent( cppMethodDefinitionsIndent, @@ -9026,6 +9061,7 @@ static void AppendCppBaseTypeConstructor( string cppTypeName, Type baseType, Type[] typeParams, + Type[] baseTypeParams, ParameterInfo[] cppParameters, ParameterInfo[] parameters, bool typeIsDelegate, @@ -9147,6 +9183,8 @@ static void AppendCppBaseTypeConstructor( static void AppendCppFreeListInit( Type type, + Type[] typeParams, + string cppTypeName, int? maxSimultaneous, string typeName, StringBuilder output) @@ -9167,7 +9205,11 @@ static void AppendCppFreeListInit( output.Append(typeName); output.Append("FreeList = new "); AppendCppTypeName( - type, + type.Namespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, output); output.Append("*["); output.Append(typeName); @@ -9180,7 +9222,11 @@ static void AppendCppFreeListInit( output.Append(typeName); output.Append("FreeList[i] = ("); AppendCppTypeName( - type, + type.Namespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, output); output.Append("*)("); output.Append(typeName); @@ -9200,95 +9246,129 @@ static void AppendCppFreeListInit( static void AppendCppFreeListStateAndFunctions( Type type, - string typeName, + Type[] typeParams, + string cppTypeName, + string bindingTypeName, StringBuilder output) { output.Append("\tint32_t "); - output.Append(typeName); + output.Append(bindingTypeName); output.Append("FreeListSize;\n"); output.Append('\t'); AppendCppTypeName( - type, + type.Namespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, output); output.Append("** "); - output.Append(typeName); + output.Append(bindingTypeName); output.Append("FreeList;\n"); output.Append('\t'); AppendCppTypeName( - type, + type.Namespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, output); output.Append("** NextFree"); - output.Append(typeName); + output.Append(bindingTypeName); output.Append(";\n"); output.Append("\t\n"); output.Append("\tint32_t Store"); - output.Append(typeName); + output.Append(bindingTypeName); output.Append('('); AppendCppTypeName( - type, + type.Namespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, output); output.Append("* del)\n"); output.Append("\t{\n"); output.Append("\t\tassert(NextFree"); - output.Append(typeName); + output.Append(bindingTypeName); output.Append(" != nullptr);\n"); output.Append("\t\t"); AppendCppTypeName( - type, + type.Namespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, output); output.Append("** pNext = NextFree"); - output.Append(typeName); + output.Append(bindingTypeName); output.Append(";\n"); output.Append("\t\tNextFree"); - output.Append(typeName); + output.Append(bindingTypeName); output.Append(" = ("); AppendCppTypeName( - type, + type.Namespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, output); output.Append("**)*pNext;\n"); output.Append("\t\t*pNext = del;\n"); output.Append("\t\treturn (int32_t)(pNext - "); - output.Append(typeName); + output.Append(bindingTypeName); output.Append("FreeList);\n"); output.Append("\t}\n"); output.Append("\t\n"); output.Append('\t'); AppendCppTypeName( - type, + type.Namespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, output); output.Append("* Get"); - output.Append(typeName); + output.Append(bindingTypeName); output.Append("(int32_t handle)\n"); output.Append("\t{\n"); output.Append( "\t\tassert(handle >= 0 && handle < "); - output.Append(typeName); + output.Append(bindingTypeName); output.Append("FreeListSize);\n"); output.Append("\t\treturn "); - output.Append(typeName); + output.Append(bindingTypeName); output.Append("FreeList[handle];\n"); output.Append("\t}\n"); output.Append("\t\n"); output.Append("\tvoid Remove"); - output.Append(typeName); + output.Append(bindingTypeName); output.Append("(int32_t handle)\n"); output.Append("\t{\n"); output.Append("\t\t"); AppendCppTypeName( - type, + type.Namespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, output); output.Append("** pRelease = "); - output.Append(typeName); + output.Append(bindingTypeName); output.Append("FreeList + handle;\n"); output.Append("\t\t*pRelease = ("); AppendCppTypeName( - type, + type.Namespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, output); output.Append("*)NextFree"); - output.Append(typeName); + output.Append(bindingTypeName); output.Append(";\n"); output.Append("\t\tNextFree"); - output.Append(typeName); + output.Append(bindingTypeName); output.Append(" = pRelease;\n"); output.Append("\t}\n"); } diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 0545f4d..56d156e 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -612,9 +612,7 @@ }, { "Name": "System.IO.Stream" - } - ], - "BaseTypes": [ + }, { "Name": "System.Collections.Generic.IComparer`1", "GenericParams": [ @@ -628,33 +626,82 @@ "System.String" ] } + ], + "BaseTypes": [ + { + "Name": "System.Collections.Generic.IComparer`1", + "GenericParams": [ + { + "Types": [ + "System.Int32" + ] + }, + { + "Types": [ + "System.String" + ] + } + ] + } ] }, { - "Name": "System.StringComparer" + "Name": "System.StringComparer", + "BaseTypes": [ + { + "Name": "System.StringComparer" + } + ] }, { - "Name": "System.Collections.ICollection" + "Name": "System.Collections.ICollection", + "BaseTypes": [ + { + "Name": "System.Collections.ICollection" + } + ] }, { - "Name": "System.Collections.IList" + "Name": "System.Collections.IList", + "BaseTypes": [ + { + "Name": "System.Collections.IList" + } + ] }, { "Name": "System.Collections.Queue", - "OverrideProperties": [ + "Properties": [ { "Name": "Count", "Get": {}, "Set": {} } + ], + "BaseTypes": [ + { + "Name": "System.Collections.Queue", + "OverrideProperties": [ + { + "Name": "Count", + "Get": {}, + "Set": {} + } + ] + } ] }, { - "Name": "System.ComponentModel.Design.IComponentChangeService" + "Name": "System.ComponentModel.Design.IComponentChangeService", + "BaseTypes": [ + { + "Name": "System.ComponentModel.Design.IComponentChangeService" + } + ] }, { "Name": "System.IO.FileStream", - "OverrideMethods": [ + "Methods": [ { "Name": "WriteByte", "ParamTypes": [ @@ -669,6 +716,27 @@ "System.IO.FileMode" ] } + ], + "BaseTypes": [ + { + "Name": "System.IO.FileStream", + "OverrideMethods": [ + { + "Name": "WriteByte", + "ParamTypes": [ + "System.Byte" + ] + } + ], + "Constructors": [ + { + "ParamTypes": [ + "System.String", + "System.IO.FileMode" + ] + } + ] + } ] } ], diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index cd6802c..2f9c286 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -147,22 +147,25 @@ namespace Plugin float (*UnityEngineTimePropertyGetDeltaTime)(); int32_t (*BoxFileMode)(System::IO::FileMode val); System::IO::FileMode (*UnboxFileMode)(int32_t valHandle); - void (*ReleaseSystemCollectionsGenericIComparerSystemInt32)(int32_t handle); - void (*SystemCollectionsGenericIComparerSystemInt32Constructor)(int32_t cppHandle, int32_t* handle); - void (*ReleaseSystemCollectionsGenericIComparerSystemString)(int32_t handle); - void (*SystemCollectionsGenericIComparerSystemStringConstructor)(int32_t cppHandle, int32_t* handle); - void (*ReleaseSystemStringComparer)(int32_t handle); - void (*SystemStringComparerConstructor)(int32_t cppHandle, int32_t* handle); - void (*ReleaseSystemCollectionsICollection)(int32_t handle); - void (*SystemCollectionsICollectionConstructor)(int32_t cppHandle, int32_t* handle); - void (*ReleaseSystemCollectionsIList)(int32_t handle); - void (*SystemCollectionsIListConstructor)(int32_t cppHandle, int32_t* handle); - void (*ReleaseSystemCollectionsQueue)(int32_t handle); - void (*SystemCollectionsQueueConstructor)(int32_t cppHandle, int32_t* handle); - void (*ReleaseSystemComponentModelDesignIComponentChangeService)(int32_t handle); - void (*SystemComponentModelDesignIComponentChangeServiceConstructor)(int32_t cppHandle, int32_t* handle); - void (*ReleaseSystemIOFileStream)(int32_t handle); - void (*SystemIOFileStreamConstructorSystemString_SystemIOFileMode)(int32_t cppHandle, int32_t* handle, int32_t pathHandle, System::IO::FileMode mode); + void (*ReleaseSystemCollectionsGenericBaseIComparerSystemInt32)(int32_t handle); + void (*SystemCollectionsGenericBaseIComparerSystemInt32Constructor)(int32_t cppHandle, int32_t* handle); + void (*ReleaseSystemCollectionsGenericBaseIComparerSystemString)(int32_t handle); + void (*SystemCollectionsGenericBaseIComparerSystemStringConstructor)(int32_t cppHandle, int32_t* handle); + void (*ReleaseSystemBaseStringComparer)(int32_t handle); + void (*SystemBaseStringComparerConstructor)(int32_t cppHandle, int32_t* handle); + void (*ReleaseSystemCollectionsBaseICollection)(int32_t handle); + void (*SystemCollectionsBaseICollectionConstructor)(int32_t cppHandle, int32_t* handle); + void (*ReleaseSystemCollectionsBaseIList)(int32_t handle); + void (*SystemCollectionsBaseIListConstructor)(int32_t cppHandle, int32_t* handle); + int32_t (*SystemCollectionsQueuePropertyGetCount)(int32_t thisHandle); + void (*ReleaseSystemCollectionsBaseQueue)(int32_t handle); + void (*SystemCollectionsBaseQueueConstructor)(int32_t cppHandle, int32_t* handle); + void (*ReleaseSystemComponentModelDesignBaseIComponentChangeService)(int32_t handle); + void (*SystemComponentModelDesignBaseIComponentChangeServiceConstructor)(int32_t cppHandle, int32_t* handle); + int32_t (*SystemIOFileStreamConstructorSystemString_SystemIOFileMode)(int32_t pathHandle, System::IO::FileMode mode); + void (*SystemIOFileStreamMethodWriteByteSystemByte)(int32_t thisHandle, uint8_t value); + void (*ReleaseSystemIOBaseFileStream)(int32_t handle); + void (*SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode)(int32_t cppHandle, int32_t* handle, int32_t pathHandle, System::IO::FileMode mode); int32_t (*BoxBoolean)(System::Boolean val); System::Boolean (*UnboxBoolean)(int32_t valHandle); int32_t (*BoxSByte)(int8_t val); @@ -372,205 +375,205 @@ namespace Plugin } } - int32_t SystemCollectionsGenericIComparerSystemInt32FreeListSize; - System::Collections::Generic::IComparer** SystemCollectionsGenericIComparerSystemInt32FreeList; - System::Collections::Generic::IComparer** NextFreeSystemCollectionsGenericIComparerSystemInt32; + int32_t SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize; + System::Collections::Generic::BaseIComparer** SystemCollectionsGenericBaseIComparerSystemInt32FreeList; + System::Collections::Generic::BaseIComparer** NextFreeSystemCollectionsGenericBaseIComparerSystemInt32; - int32_t StoreSystemCollectionsGenericIComparerSystemInt32(System::Collections::Generic::IComparer* del) + int32_t StoreSystemCollectionsGenericBaseIComparerSystemInt32(System::Collections::Generic::BaseIComparer* del) { - assert(NextFreeSystemCollectionsGenericIComparerSystemInt32 != nullptr); - System::Collections::Generic::IComparer** pNext = NextFreeSystemCollectionsGenericIComparerSystemInt32; - NextFreeSystemCollectionsGenericIComparerSystemInt32 = (System::Collections::Generic::IComparer**)*pNext; + assert(NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 != nullptr); + System::Collections::Generic::BaseIComparer** pNext = NextFreeSystemCollectionsGenericBaseIComparerSystemInt32; + NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 = (System::Collections::Generic::BaseIComparer**)*pNext; *pNext = del; - return (int32_t)(pNext - SystemCollectionsGenericIComparerSystemInt32FreeList); + return (int32_t)(pNext - SystemCollectionsGenericBaseIComparerSystemInt32FreeList); } - System::Collections::Generic::IComparer* GetSystemCollectionsGenericIComparerSystemInt32(int32_t handle) + System::Collections::Generic::BaseIComparer* GetSystemCollectionsGenericBaseIComparerSystemInt32(int32_t handle) { - assert(handle >= 0 && handle < SystemCollectionsGenericIComparerSystemInt32FreeListSize); - return SystemCollectionsGenericIComparerSystemInt32FreeList[handle]; + assert(handle >= 0 && handle < SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize); + return SystemCollectionsGenericBaseIComparerSystemInt32FreeList[handle]; } - void RemoveSystemCollectionsGenericIComparerSystemInt32(int32_t handle) + void RemoveSystemCollectionsGenericBaseIComparerSystemInt32(int32_t handle) { - System::Collections::Generic::IComparer** pRelease = SystemCollectionsGenericIComparerSystemInt32FreeList + handle; - *pRelease = (System::Collections::Generic::IComparer*)NextFreeSystemCollectionsGenericIComparerSystemInt32; - NextFreeSystemCollectionsGenericIComparerSystemInt32 = pRelease; + System::Collections::Generic::BaseIComparer** pRelease = SystemCollectionsGenericBaseIComparerSystemInt32FreeList + handle; + *pRelease = (System::Collections::Generic::BaseIComparer*)NextFreeSystemCollectionsGenericBaseIComparerSystemInt32; + NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 = pRelease; } - int32_t SystemCollectionsGenericIComparerSystemStringFreeListSize; - System::Collections::Generic::IComparer** SystemCollectionsGenericIComparerSystemStringFreeList; - System::Collections::Generic::IComparer** NextFreeSystemCollectionsGenericIComparerSystemString; + int32_t SystemCollectionsGenericBaseIComparerSystemStringFreeListSize; + System::Collections::Generic::BaseIComparer** SystemCollectionsGenericBaseIComparerSystemStringFreeList; + System::Collections::Generic::BaseIComparer** NextFreeSystemCollectionsGenericBaseIComparerSystemString; - int32_t StoreSystemCollectionsGenericIComparerSystemString(System::Collections::Generic::IComparer* del) + int32_t StoreSystemCollectionsGenericBaseIComparerSystemString(System::Collections::Generic::BaseIComparer* del) { - assert(NextFreeSystemCollectionsGenericIComparerSystemString != nullptr); - System::Collections::Generic::IComparer** pNext = NextFreeSystemCollectionsGenericIComparerSystemString; - NextFreeSystemCollectionsGenericIComparerSystemString = (System::Collections::Generic::IComparer**)*pNext; + assert(NextFreeSystemCollectionsGenericBaseIComparerSystemString != nullptr); + System::Collections::Generic::BaseIComparer** pNext = NextFreeSystemCollectionsGenericBaseIComparerSystemString; + NextFreeSystemCollectionsGenericBaseIComparerSystemString = (System::Collections::Generic::BaseIComparer**)*pNext; *pNext = del; - return (int32_t)(pNext - SystemCollectionsGenericIComparerSystemStringFreeList); + return (int32_t)(pNext - SystemCollectionsGenericBaseIComparerSystemStringFreeList); } - System::Collections::Generic::IComparer* GetSystemCollectionsGenericIComparerSystemString(int32_t handle) + System::Collections::Generic::BaseIComparer* GetSystemCollectionsGenericBaseIComparerSystemString(int32_t handle) { - assert(handle >= 0 && handle < SystemCollectionsGenericIComparerSystemStringFreeListSize); - return SystemCollectionsGenericIComparerSystemStringFreeList[handle]; + assert(handle >= 0 && handle < SystemCollectionsGenericBaseIComparerSystemStringFreeListSize); + return SystemCollectionsGenericBaseIComparerSystemStringFreeList[handle]; } - void RemoveSystemCollectionsGenericIComparerSystemString(int32_t handle) + void RemoveSystemCollectionsGenericBaseIComparerSystemString(int32_t handle) { - System::Collections::Generic::IComparer** pRelease = SystemCollectionsGenericIComparerSystemStringFreeList + handle; - *pRelease = (System::Collections::Generic::IComparer*)NextFreeSystemCollectionsGenericIComparerSystemString; - NextFreeSystemCollectionsGenericIComparerSystemString = pRelease; + System::Collections::Generic::BaseIComparer** pRelease = SystemCollectionsGenericBaseIComparerSystemStringFreeList + handle; + *pRelease = (System::Collections::Generic::BaseIComparer*)NextFreeSystemCollectionsGenericBaseIComparerSystemString; + NextFreeSystemCollectionsGenericBaseIComparerSystemString = pRelease; } - int32_t SystemStringComparerFreeListSize; - System::StringComparer** SystemStringComparerFreeList; - System::StringComparer** NextFreeSystemStringComparer; + int32_t SystemBaseStringComparerFreeListSize; + System::BaseStringComparer** SystemBaseStringComparerFreeList; + System::BaseStringComparer** NextFreeSystemBaseStringComparer; - int32_t StoreSystemStringComparer(System::StringComparer* del) + int32_t StoreSystemBaseStringComparer(System::BaseStringComparer* del) { - assert(NextFreeSystemStringComparer != nullptr); - System::StringComparer** pNext = NextFreeSystemStringComparer; - NextFreeSystemStringComparer = (System::StringComparer**)*pNext; + assert(NextFreeSystemBaseStringComparer != nullptr); + System::BaseStringComparer** pNext = NextFreeSystemBaseStringComparer; + NextFreeSystemBaseStringComparer = (System::BaseStringComparer**)*pNext; *pNext = del; - return (int32_t)(pNext - SystemStringComparerFreeList); + return (int32_t)(pNext - SystemBaseStringComparerFreeList); } - System::StringComparer* GetSystemStringComparer(int32_t handle) + System::BaseStringComparer* GetSystemBaseStringComparer(int32_t handle) { - assert(handle >= 0 && handle < SystemStringComparerFreeListSize); - return SystemStringComparerFreeList[handle]; + assert(handle >= 0 && handle < SystemBaseStringComparerFreeListSize); + return SystemBaseStringComparerFreeList[handle]; } - void RemoveSystemStringComparer(int32_t handle) + void RemoveSystemBaseStringComparer(int32_t handle) { - System::StringComparer** pRelease = SystemStringComparerFreeList + handle; - *pRelease = (System::StringComparer*)NextFreeSystemStringComparer; - NextFreeSystemStringComparer = pRelease; + System::BaseStringComparer** pRelease = SystemBaseStringComparerFreeList + handle; + *pRelease = (System::BaseStringComparer*)NextFreeSystemBaseStringComparer; + NextFreeSystemBaseStringComparer = pRelease; } - int32_t SystemCollectionsICollectionFreeListSize; - System::Collections::ICollection** SystemCollectionsICollectionFreeList; - System::Collections::ICollection** NextFreeSystemCollectionsICollection; + int32_t SystemCollectionsBaseICollectionFreeListSize; + System::Collections::BaseICollection** SystemCollectionsBaseICollectionFreeList; + System::Collections::BaseICollection** NextFreeSystemCollectionsBaseICollection; - int32_t StoreSystemCollectionsICollection(System::Collections::ICollection* del) + int32_t StoreSystemCollectionsBaseICollection(System::Collections::BaseICollection* del) { - assert(NextFreeSystemCollectionsICollection != nullptr); - System::Collections::ICollection** pNext = NextFreeSystemCollectionsICollection; - NextFreeSystemCollectionsICollection = (System::Collections::ICollection**)*pNext; + assert(NextFreeSystemCollectionsBaseICollection != nullptr); + System::Collections::BaseICollection** pNext = NextFreeSystemCollectionsBaseICollection; + NextFreeSystemCollectionsBaseICollection = (System::Collections::BaseICollection**)*pNext; *pNext = del; - return (int32_t)(pNext - SystemCollectionsICollectionFreeList); + return (int32_t)(pNext - SystemCollectionsBaseICollectionFreeList); } - System::Collections::ICollection* GetSystemCollectionsICollection(int32_t handle) + System::Collections::BaseICollection* GetSystemCollectionsBaseICollection(int32_t handle) { - assert(handle >= 0 && handle < SystemCollectionsICollectionFreeListSize); - return SystemCollectionsICollectionFreeList[handle]; + assert(handle >= 0 && handle < SystemCollectionsBaseICollectionFreeListSize); + return SystemCollectionsBaseICollectionFreeList[handle]; } - void RemoveSystemCollectionsICollection(int32_t handle) + void RemoveSystemCollectionsBaseICollection(int32_t handle) { - System::Collections::ICollection** pRelease = SystemCollectionsICollectionFreeList + handle; - *pRelease = (System::Collections::ICollection*)NextFreeSystemCollectionsICollection; - NextFreeSystemCollectionsICollection = pRelease; + System::Collections::BaseICollection** pRelease = SystemCollectionsBaseICollectionFreeList + handle; + *pRelease = (System::Collections::BaseICollection*)NextFreeSystemCollectionsBaseICollection; + NextFreeSystemCollectionsBaseICollection = pRelease; } - int32_t SystemCollectionsIListFreeListSize; - System::Collections::IList** SystemCollectionsIListFreeList; - System::Collections::IList** NextFreeSystemCollectionsIList; + int32_t SystemCollectionsBaseIListFreeListSize; + System::Collections::BaseIList** SystemCollectionsBaseIListFreeList; + System::Collections::BaseIList** NextFreeSystemCollectionsBaseIList; - int32_t StoreSystemCollectionsIList(System::Collections::IList* del) + int32_t StoreSystemCollectionsBaseIList(System::Collections::BaseIList* del) { - assert(NextFreeSystemCollectionsIList != nullptr); - System::Collections::IList** pNext = NextFreeSystemCollectionsIList; - NextFreeSystemCollectionsIList = (System::Collections::IList**)*pNext; + assert(NextFreeSystemCollectionsBaseIList != nullptr); + System::Collections::BaseIList** pNext = NextFreeSystemCollectionsBaseIList; + NextFreeSystemCollectionsBaseIList = (System::Collections::BaseIList**)*pNext; *pNext = del; - return (int32_t)(pNext - SystemCollectionsIListFreeList); + return (int32_t)(pNext - SystemCollectionsBaseIListFreeList); } - System::Collections::IList* GetSystemCollectionsIList(int32_t handle) + System::Collections::BaseIList* GetSystemCollectionsBaseIList(int32_t handle) { - assert(handle >= 0 && handle < SystemCollectionsIListFreeListSize); - return SystemCollectionsIListFreeList[handle]; + assert(handle >= 0 && handle < SystemCollectionsBaseIListFreeListSize); + return SystemCollectionsBaseIListFreeList[handle]; } - void RemoveSystemCollectionsIList(int32_t handle) + void RemoveSystemCollectionsBaseIList(int32_t handle) { - System::Collections::IList** pRelease = SystemCollectionsIListFreeList + handle; - *pRelease = (System::Collections::IList*)NextFreeSystemCollectionsIList; - NextFreeSystemCollectionsIList = pRelease; + System::Collections::BaseIList** pRelease = SystemCollectionsBaseIListFreeList + handle; + *pRelease = (System::Collections::BaseIList*)NextFreeSystemCollectionsBaseIList; + NextFreeSystemCollectionsBaseIList = pRelease; } - int32_t SystemCollectionsQueueFreeListSize; - System::Collections::Queue** SystemCollectionsQueueFreeList; - System::Collections::Queue** NextFreeSystemCollectionsQueue; + int32_t SystemCollectionsBaseQueueFreeListSize; + System::Collections::BaseQueue** SystemCollectionsBaseQueueFreeList; + System::Collections::BaseQueue** NextFreeSystemCollectionsBaseQueue; - int32_t StoreSystemCollectionsQueue(System::Collections::Queue* del) + int32_t StoreSystemCollectionsBaseQueue(System::Collections::BaseQueue* del) { - assert(NextFreeSystemCollectionsQueue != nullptr); - System::Collections::Queue** pNext = NextFreeSystemCollectionsQueue; - NextFreeSystemCollectionsQueue = (System::Collections::Queue**)*pNext; + assert(NextFreeSystemCollectionsBaseQueue != nullptr); + System::Collections::BaseQueue** pNext = NextFreeSystemCollectionsBaseQueue; + NextFreeSystemCollectionsBaseQueue = (System::Collections::BaseQueue**)*pNext; *pNext = del; - return (int32_t)(pNext - SystemCollectionsQueueFreeList); + return (int32_t)(pNext - SystemCollectionsBaseQueueFreeList); } - System::Collections::Queue* GetSystemCollectionsQueue(int32_t handle) + System::Collections::BaseQueue* GetSystemCollectionsBaseQueue(int32_t handle) { - assert(handle >= 0 && handle < SystemCollectionsQueueFreeListSize); - return SystemCollectionsQueueFreeList[handle]; + assert(handle >= 0 && handle < SystemCollectionsBaseQueueFreeListSize); + return SystemCollectionsBaseQueueFreeList[handle]; } - void RemoveSystemCollectionsQueue(int32_t handle) + void RemoveSystemCollectionsBaseQueue(int32_t handle) { - System::Collections::Queue** pRelease = SystemCollectionsQueueFreeList + handle; - *pRelease = (System::Collections::Queue*)NextFreeSystemCollectionsQueue; - NextFreeSystemCollectionsQueue = pRelease; + System::Collections::BaseQueue** pRelease = SystemCollectionsBaseQueueFreeList + handle; + *pRelease = (System::Collections::BaseQueue*)NextFreeSystemCollectionsBaseQueue; + NextFreeSystemCollectionsBaseQueue = pRelease; } - int32_t SystemComponentModelDesignIComponentChangeServiceFreeListSize; - System::ComponentModel::Design::IComponentChangeService** SystemComponentModelDesignIComponentChangeServiceFreeList; - System::ComponentModel::Design::IComponentChangeService** NextFreeSystemComponentModelDesignIComponentChangeService; + int32_t SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize; + System::ComponentModel::Design::BaseIComponentChangeService** SystemComponentModelDesignBaseIComponentChangeServiceFreeList; + System::ComponentModel::Design::BaseIComponentChangeService** NextFreeSystemComponentModelDesignBaseIComponentChangeService; - int32_t StoreSystemComponentModelDesignIComponentChangeService(System::ComponentModel::Design::IComponentChangeService* del) + int32_t StoreSystemComponentModelDesignBaseIComponentChangeService(System::ComponentModel::Design::BaseIComponentChangeService* del) { - assert(NextFreeSystemComponentModelDesignIComponentChangeService != nullptr); - System::ComponentModel::Design::IComponentChangeService** pNext = NextFreeSystemComponentModelDesignIComponentChangeService; - NextFreeSystemComponentModelDesignIComponentChangeService = (System::ComponentModel::Design::IComponentChangeService**)*pNext; + assert(NextFreeSystemComponentModelDesignBaseIComponentChangeService != nullptr); + System::ComponentModel::Design::BaseIComponentChangeService** pNext = NextFreeSystemComponentModelDesignBaseIComponentChangeService; + NextFreeSystemComponentModelDesignBaseIComponentChangeService = (System::ComponentModel::Design::BaseIComponentChangeService**)*pNext; *pNext = del; - return (int32_t)(pNext - SystemComponentModelDesignIComponentChangeServiceFreeList); + return (int32_t)(pNext - SystemComponentModelDesignBaseIComponentChangeServiceFreeList); } - System::ComponentModel::Design::IComponentChangeService* GetSystemComponentModelDesignIComponentChangeService(int32_t handle) + System::ComponentModel::Design::BaseIComponentChangeService* GetSystemComponentModelDesignBaseIComponentChangeService(int32_t handle) { - assert(handle >= 0 && handle < SystemComponentModelDesignIComponentChangeServiceFreeListSize); - return SystemComponentModelDesignIComponentChangeServiceFreeList[handle]; + assert(handle >= 0 && handle < SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize); + return SystemComponentModelDesignBaseIComponentChangeServiceFreeList[handle]; } - void RemoveSystemComponentModelDesignIComponentChangeService(int32_t handle) + void RemoveSystemComponentModelDesignBaseIComponentChangeService(int32_t handle) { - System::ComponentModel::Design::IComponentChangeService** pRelease = SystemComponentModelDesignIComponentChangeServiceFreeList + handle; - *pRelease = (System::ComponentModel::Design::IComponentChangeService*)NextFreeSystemComponentModelDesignIComponentChangeService; - NextFreeSystemComponentModelDesignIComponentChangeService = pRelease; + System::ComponentModel::Design::BaseIComponentChangeService** pRelease = SystemComponentModelDesignBaseIComponentChangeServiceFreeList + handle; + *pRelease = (System::ComponentModel::Design::BaseIComponentChangeService*)NextFreeSystemComponentModelDesignBaseIComponentChangeService; + NextFreeSystemComponentModelDesignBaseIComponentChangeService = pRelease; } - int32_t SystemIOFileStreamFreeListSize; - System::IO::FileStream** SystemIOFileStreamFreeList; - System::IO::FileStream** NextFreeSystemIOFileStream; + int32_t SystemIOBaseFileStreamFreeListSize; + System::IO::BaseFileStream** SystemIOBaseFileStreamFreeList; + System::IO::BaseFileStream** NextFreeSystemIOBaseFileStream; - int32_t StoreSystemIOFileStream(System::IO::FileStream* del) + int32_t StoreSystemIOBaseFileStream(System::IO::BaseFileStream* del) { - assert(NextFreeSystemIOFileStream != nullptr); - System::IO::FileStream** pNext = NextFreeSystemIOFileStream; - NextFreeSystemIOFileStream = (System::IO::FileStream**)*pNext; + assert(NextFreeSystemIOBaseFileStream != nullptr); + System::IO::BaseFileStream** pNext = NextFreeSystemIOBaseFileStream; + NextFreeSystemIOBaseFileStream = (System::IO::BaseFileStream**)*pNext; *pNext = del; - return (int32_t)(pNext - SystemIOFileStreamFreeList); + return (int32_t)(pNext - SystemIOBaseFileStreamFreeList); } - System::IO::FileStream* GetSystemIOFileStream(int32_t handle) + System::IO::BaseFileStream* GetSystemIOBaseFileStream(int32_t handle) { - assert(handle >= 0 && handle < SystemIOFileStreamFreeListSize); - return SystemIOFileStreamFreeList[handle]; + assert(handle >= 0 && handle < SystemIOBaseFileStreamFreeListSize); + return SystemIOBaseFileStreamFreeList[handle]; } - void RemoveSystemIOFileStream(int32_t handle) + void RemoveSystemIOBaseFileStream(int32_t handle) { - System::IO::FileStream** pRelease = SystemIOFileStreamFreeList + handle; - *pRelease = (System::IO::FileStream*)NextFreeSystemIOFileStream; - NextFreeSystemIOFileStream = pRelease; + System::IO::BaseFileStream** pRelease = SystemIOBaseFileStreamFreeList + handle; + *pRelease = (System::IO::BaseFileStream*)NextFreeSystemIOBaseFileStream; + NextFreeSystemIOBaseFileStream = pRelease; } int32_t SystemActionFreeListSize; System::Action** SystemActionFreeList; @@ -5785,13 +5788,189 @@ namespace System { namespace Generic { - IComparer::IComparer() - : System::Object(nullptr) + IComparer::IComparer(decltype(nullptr) n) + : IComparer(Plugin::InternalUse::Only, 0) + { + } + + IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparer::IComparer(const IComparer& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparer::IComparer(IComparer&& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparer::~IComparer() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparer& IComparer::operator=(const IComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparer& IComparer::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparer& IComparer::operator=(IComparer&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparer::operator==(const IComparer& other) const + { + return Handle == other.Handle; + } + + bool IComparer::operator!=(const IComparer& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + IComparer::IComparer(decltype(nullptr) n) + : IComparer(Plugin::InternalUse::Only, 0) + { + } + + IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparer::IComparer(const IComparer& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparer::IComparer(IComparer&& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparer::~IComparer() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparer& IComparer::operator=(const IComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparer& IComparer::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparer& IComparer::operator=(IComparer&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparer::operator==(const IComparer& other) const + { + return Handle == other.Handle; + } + + bool IComparer::operator!=(const IComparer& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + BaseIComparer::BaseIComparer() + : System::Collections::Generic::IComparer(nullptr) + { + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); int32_t* handle = &Handle; int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsGenericIComparerSystemInt32Constructor(cppHandle, handle); + Plugin::SystemCollectionsGenericBaseIComparerSystemInt32Constructor(cppHandle, handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5805,7 +5984,7 @@ namespace System } else { - Plugin::RemoveSystemCollectionsGenericIComparerSystemInt32(CppHandle); + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); CppHandle = 0; } if (Plugin::unhandledCsharpException) @@ -5817,43 +5996,43 @@ namespace System } } - IComparer::IComparer(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) + BaseIComparer::BaseIComparer(decltype(nullptr) n) + : System::Collections::Generic::IComparer(Plugin::InternalUse::Only, 0) { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); } - IComparer::IComparer(const IComparer& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + BaseIComparer::BaseIComparer(const BaseIComparer& other) + : System::Collections::Generic::IComparer(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - IComparer::IComparer(IComparer&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + BaseIComparer::BaseIComparer(BaseIComparer&& other) + : System::Collections::Generic::IComparer(Plugin::InternalUse::Only, other.Handle) { CppHandle = other.CppHandle; other.Handle = 0; other.CppHandle = 0; } - IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + BaseIComparer::BaseIComparer(Plugin::InternalUse iu, int32_t handle) + : System::Collections::Generic::IComparer(iu, handle) { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemInt32(this); + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - IComparer::~IComparer() + BaseIComparer::~BaseIComparer() { - Plugin::RemoveSystemCollectionsGenericIComparerSystemInt32(CppHandle); + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); CppHandle = 0; if (Handle) { @@ -5861,7 +6040,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsGenericIComparerSystemInt32(handle); + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5873,7 +6052,7 @@ namespace System } } - IComparer& IComparer::operator=(const IComparer& other) + BaseIComparer& BaseIComparer::operator=(const BaseIComparer& other) { if (this->Handle) { @@ -5887,7 +6066,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(decltype(nullptr) other) + BaseIComparer& BaseIComparer::operator=(decltype(nullptr) other) { if (Handle) { @@ -5895,7 +6074,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsGenericIComparerSystemInt32(handle); + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5909,9 +6088,9 @@ namespace System return *this; } - IComparer& IComparer::operator=(IComparer&& other) + BaseIComparer& BaseIComparer::operator=(BaseIComparer&& other) { - Plugin::RemoveSystemCollectionsGenericIComparerSystemInt32(CppHandle); + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); CppHandle = 0; if (Handle) { @@ -5919,7 +6098,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsGenericIComparerSystemInt32(handle); + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5934,17 +6113,17 @@ namespace System return *this; } - bool IComparer::operator==(const IComparer& other) const + bool BaseIComparer::operator==(const BaseIComparer& other) const { return Handle == other.Handle; } - bool IComparer::operator!=(const IComparer& other) const + bool BaseIComparer::operator!=(const BaseIComparer& other) const { return Handle != other.Handle; } - int32_t IComparer::Compare(int32_t x, int32_t y) + int32_t BaseIComparer::Compare(int32_t x, int32_t y) { return {}; } @@ -5953,7 +6132,7 @@ namespace System { try { - return Plugin::GetSystemCollectionsGenericIComparerSystemInt32(cppHandle)->Compare(x, y); + return Plugin::GetSystemCollectionsGenericBaseIComparerSystemInt32(cppHandle)->Compare(x, y); } catch (System::Exception ex) { @@ -5978,13 +6157,13 @@ namespace System { namespace Generic { - IComparer::IComparer() - : System::Object(nullptr) + BaseIComparer::BaseIComparer() + : System::Collections::Generic::IComparer(nullptr) { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); int32_t* handle = &Handle; int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsGenericIComparerSystemStringConstructor(cppHandle, handle); + Plugin::SystemCollectionsGenericBaseIComparerSystemStringConstructor(cppHandle, handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5998,7 +6177,7 @@ namespace System } else { - Plugin::RemoveSystemCollectionsGenericIComparerSystemString(CppHandle); + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); CppHandle = 0; } if (Plugin::unhandledCsharpException) @@ -6010,43 +6189,43 @@ namespace System } } - IComparer::IComparer(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) + BaseIComparer::BaseIComparer(decltype(nullptr) n) + : System::Collections::Generic::IComparer(Plugin::InternalUse::Only, 0) { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); } - IComparer::IComparer(const IComparer& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + BaseIComparer::BaseIComparer(const BaseIComparer& other) + : System::Collections::Generic::IComparer(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - IComparer::IComparer(IComparer&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + BaseIComparer::BaseIComparer(BaseIComparer&& other) + : System::Collections::Generic::IComparer(Plugin::InternalUse::Only, other.Handle) { CppHandle = other.CppHandle; other.Handle = 0; other.CppHandle = 0; } - IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + BaseIComparer::BaseIComparer(Plugin::InternalUse iu, int32_t handle) + : System::Collections::Generic::IComparer(iu, handle) { - CppHandle = Plugin::StoreSystemCollectionsGenericIComparerSystemString(this); + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - IComparer::~IComparer() + BaseIComparer::~BaseIComparer() { - Plugin::RemoveSystemCollectionsGenericIComparerSystemString(CppHandle); + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); CppHandle = 0; if (Handle) { @@ -6054,7 +6233,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsGenericIComparerSystemString(handle); + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6066,7 +6245,7 @@ namespace System } } - IComparer& IComparer::operator=(const IComparer& other) + BaseIComparer& BaseIComparer::operator=(const BaseIComparer& other) { if (this->Handle) { @@ -6080,7 +6259,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(decltype(nullptr) other) + BaseIComparer& BaseIComparer::operator=(decltype(nullptr) other) { if (Handle) { @@ -6088,7 +6267,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsGenericIComparerSystemString(handle); + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6102,9 +6281,9 @@ namespace System return *this; } - IComparer& IComparer::operator=(IComparer&& other) + BaseIComparer& BaseIComparer::operator=(BaseIComparer&& other) { - Plugin::RemoveSystemCollectionsGenericIComparerSystemString(CppHandle); + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); CppHandle = 0; if (Handle) { @@ -6112,7 +6291,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsGenericIComparerSystemString(handle); + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6127,17 +6306,17 @@ namespace System return *this; } - bool IComparer::operator==(const IComparer& other) const + bool BaseIComparer::operator==(const BaseIComparer& other) const { return Handle == other.Handle; } - bool IComparer::operator!=(const IComparer& other) const + bool BaseIComparer::operator!=(const BaseIComparer& other) const { return Handle != other.Handle; } - int32_t IComparer::Compare(System::String& x, System::String& y) + int32_t BaseIComparer::Compare(System::String& x, System::String& y) { return {}; } @@ -6148,7 +6327,7 @@ namespace System { auto x = System::String(Plugin::InternalUse::Only, xHandle); auto y = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemCollectionsGenericIComparerSystemString(cppHandle)->Compare(x, y); + return Plugin::GetSystemCollectionsGenericBaseIComparerSystemString(cppHandle)->Compare(x, y); } catch (System::Exception ex) { @@ -6169,13 +6348,95 @@ namespace System namespace System { - StringComparer::StringComparer() - : System::Object(nullptr) + StringComparer::StringComparer(decltype(nullptr) n) + : StringComparer(Plugin::InternalUse::Only, 0) + { + } + + StringComparer::StringComparer(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + StringComparer::StringComparer(const StringComparer& other) + : StringComparer(Plugin::InternalUse::Only, other.Handle) + { + } + + StringComparer::StringComparer(StringComparer&& other) + : StringComparer(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemStringComparer(this); + other.Handle = 0; + } + + StringComparer::~StringComparer() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + StringComparer& StringComparer::operator=(const StringComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + StringComparer& StringComparer::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + StringComparer& StringComparer::operator=(StringComparer&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool StringComparer::operator==(const StringComparer& other) const + { + return Handle == other.Handle; + } + + bool StringComparer::operator!=(const StringComparer& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + BaseStringComparer::BaseStringComparer() + : System::StringComparer(nullptr) + { + CppHandle = Plugin::StoreSystemBaseStringComparer(this); int32_t* handle = &Handle; int32_t cppHandle = CppHandle; - Plugin::SystemStringComparerConstructor(cppHandle, handle); + Plugin::SystemBaseStringComparerConstructor(cppHandle, handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6189,7 +6450,7 @@ namespace System } else { - Plugin::RemoveSystemStringComparer(CppHandle); + Plugin::RemoveSystemBaseStringComparer(CppHandle); CppHandle = 0; } if (Plugin::unhandledCsharpException) @@ -6201,43 +6462,43 @@ namespace System } } - StringComparer::StringComparer(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) + BaseStringComparer::BaseStringComparer(decltype(nullptr) n) + : System::StringComparer(Plugin::InternalUse::Only, 0) { - CppHandle = Plugin::StoreSystemStringComparer(this); + CppHandle = Plugin::StoreSystemBaseStringComparer(this); } - StringComparer::StringComparer(const StringComparer& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + BaseStringComparer::BaseStringComparer(const BaseStringComparer& other) + : System::StringComparer(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemStringComparer(this); + CppHandle = Plugin::StoreSystemBaseStringComparer(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - StringComparer::StringComparer(StringComparer&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + BaseStringComparer::BaseStringComparer(BaseStringComparer&& other) + : System::StringComparer(Plugin::InternalUse::Only, other.Handle) { CppHandle = other.CppHandle; other.Handle = 0; other.CppHandle = 0; } - StringComparer::StringComparer(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + BaseStringComparer::BaseStringComparer(Plugin::InternalUse iu, int32_t handle) + : System::StringComparer(iu, handle) { - CppHandle = Plugin::StoreSystemStringComparer(this); + CppHandle = Plugin::StoreSystemBaseStringComparer(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - StringComparer::~StringComparer() + BaseStringComparer::~BaseStringComparer() { - Plugin::RemoveSystemStringComparer(CppHandle); + Plugin::RemoveSystemBaseStringComparer(CppHandle); CppHandle = 0; if (Handle) { @@ -6245,7 +6506,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemStringComparer(handle); + Plugin::ReleaseSystemBaseStringComparer(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6257,7 +6518,7 @@ namespace System } } - StringComparer& StringComparer::operator=(const StringComparer& other) + BaseStringComparer& BaseStringComparer::operator=(const BaseStringComparer& other) { if (this->Handle) { @@ -6271,7 +6532,7 @@ namespace System return *this; } - StringComparer& StringComparer::operator=(decltype(nullptr) other) + BaseStringComparer& BaseStringComparer::operator=(decltype(nullptr) other) { if (Handle) { @@ -6279,7 +6540,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemStringComparer(handle); + Plugin::ReleaseSystemBaseStringComparer(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6293,9 +6554,9 @@ namespace System return *this; } - StringComparer& StringComparer::operator=(StringComparer&& other) + BaseStringComparer& BaseStringComparer::operator=(BaseStringComparer&& other) { - Plugin::RemoveSystemStringComparer(CppHandle); + Plugin::RemoveSystemBaseStringComparer(CppHandle); CppHandle = 0; if (Handle) { @@ -6303,7 +6564,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemStringComparer(handle); + Plugin::ReleaseSystemBaseStringComparer(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6318,17 +6579,17 @@ namespace System return *this; } - bool StringComparer::operator==(const StringComparer& other) const + bool BaseStringComparer::operator==(const BaseStringComparer& other) const { return Handle == other.Handle; } - bool StringComparer::operator!=(const StringComparer& other) const + bool BaseStringComparer::operator!=(const BaseStringComparer& other) const { return Handle != other.Handle; } - int32_t StringComparer::Compare(System::String& x, System::String& y) + int32_t BaseStringComparer::Compare(System::String& x, System::String& y) { return {}; } @@ -6339,7 +6600,7 @@ namespace System { auto x = System::String(Plugin::InternalUse::Only, xHandle); auto y = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemStringComparer(cppHandle)->Compare(x, y); + return Plugin::GetSystemBaseStringComparer(cppHandle)->Compare(x, y); } catch (System::Exception ex) { @@ -6355,7 +6616,7 @@ namespace System } } - System::Boolean StringComparer::Equals(System::String& x, System::String& y) + System::Boolean BaseStringComparer::Equals(System::String& x, System::String& y) { return {}; } @@ -6366,45 +6627,130 @@ namespace System { auto x = System::String(Plugin::InternalUse::Only, xHandle); auto y = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemStringComparer(cppHandle)->Equals(x, y); + return Plugin::GetSystemBaseStringComparer(cppHandle)->Equals(x, y); } catch (System::Exception ex) { - Plugin::SetException(ex.Handle); - return {}; + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::StringComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + int32_t BaseStringComparer::GetHashCode(System::String& obj) + { + return {}; + } + + DLLEXPORT int32_t SystemStringComparerGetHashCode(int32_t cppHandle, int32_t objHandle) + { + try + { + auto obj = System::String(Plugin::InternalUse::Only, objHandle); + return Plugin::GetSystemBaseStringComparer(cppHandle)->GetHashCode(obj); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::StringComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } +} + +namespace System +{ + namespace Collections + { + ICollection::ICollection(decltype(nullptr) n) + : ICollection(Plugin::InternalUse::Only, 0) + { + } + + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + } + + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ICollection::~ICollection() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ICollection& ICollection::operator=(const ICollection& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - catch (...) + + ICollection& ICollection::operator=(decltype(nullptr) other) { - System::String msg = "Unhandled exception invoking System::StringComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - } - - int32_t StringComparer::GetHashCode(System::String& obj) - { - return {}; - } - - DLLEXPORT int32_t SystemStringComparerGetHashCode(int32_t cppHandle, int32_t objHandle) - { - try + + ICollection& ICollection::operator=(ICollection&& other) { - auto obj = System::String(Plugin::InternalUse::Only, objHandle); - return Plugin::GetSystemStringComparer(cppHandle)->GetHashCode(obj); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - catch (System::Exception ex) + + bool ICollection::operator==(const ICollection& other) const { - Plugin::SetException(ex.Handle); - return {}; + return Handle == other.Handle; } - catch (...) + + bool ICollection::operator!=(const ICollection& other) const { - System::String msg = "Unhandled exception invoking System::StringComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + return Handle != other.Handle; } } } @@ -6413,13 +6759,13 @@ namespace System { namespace Collections { - ICollection::ICollection() - : System::Object(nullptr) + BaseICollection::BaseICollection() + : System::Collections::ICollection(nullptr) { - CppHandle = Plugin::StoreSystemCollectionsICollection(this); + CppHandle = Plugin::StoreSystemCollectionsBaseICollection(this); int32_t* handle = &Handle; int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsICollectionConstructor(cppHandle, handle); + Plugin::SystemCollectionsBaseICollectionConstructor(cppHandle, handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6433,7 +6779,7 @@ namespace System } else { - Plugin::RemoveSystemCollectionsICollection(CppHandle); + Plugin::RemoveSystemCollectionsBaseICollection(CppHandle); CppHandle = 0; } if (Plugin::unhandledCsharpException) @@ -6445,43 +6791,43 @@ namespace System } } - ICollection::ICollection(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) + BaseICollection::BaseICollection(decltype(nullptr) n) + : System::Collections::ICollection(Plugin::InternalUse::Only, 0) { - CppHandle = Plugin::StoreSystemCollectionsICollection(this); + CppHandle = Plugin::StoreSystemCollectionsBaseICollection(this); } - ICollection::ICollection(const ICollection& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + BaseICollection::BaseICollection(const BaseICollection& other) + : System::Collections::ICollection(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemCollectionsICollection(this); + CppHandle = Plugin::StoreSystemCollectionsBaseICollection(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - ICollection::ICollection(ICollection&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + BaseICollection::BaseICollection(BaseICollection&& other) + : System::Collections::ICollection(Plugin::InternalUse::Only, other.Handle) { CppHandle = other.CppHandle; other.Handle = 0; other.CppHandle = 0; } - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + BaseICollection::BaseICollection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::ICollection(iu, handle) { - CppHandle = Plugin::StoreSystemCollectionsICollection(this); + CppHandle = Plugin::StoreSystemCollectionsBaseICollection(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - ICollection::~ICollection() + BaseICollection::~BaseICollection() { - Plugin::RemoveSystemCollectionsICollection(CppHandle); + Plugin::RemoveSystemCollectionsBaseICollection(CppHandle); CppHandle = 0; if (Handle) { @@ -6489,7 +6835,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsICollection(handle); + Plugin::ReleaseSystemCollectionsBaseICollection(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6501,7 +6847,7 @@ namespace System } } - ICollection& ICollection::operator=(const ICollection& other) + BaseICollection& BaseICollection::operator=(const BaseICollection& other) { if (this->Handle) { @@ -6515,7 +6861,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(decltype(nullptr) other) + BaseICollection& BaseICollection::operator=(decltype(nullptr) other) { if (Handle) { @@ -6523,7 +6869,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsICollection(handle); + Plugin::ReleaseSystemCollectionsBaseICollection(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6537,9 +6883,9 @@ namespace System return *this; } - ICollection& ICollection::operator=(ICollection&& other) + BaseICollection& BaseICollection::operator=(BaseICollection&& other) { - Plugin::RemoveSystemCollectionsICollection(CppHandle); + Plugin::RemoveSystemCollectionsBaseICollection(CppHandle); CppHandle = 0; if (Handle) { @@ -6547,7 +6893,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsICollection(handle); + Plugin::ReleaseSystemCollectionsBaseICollection(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6562,17 +6908,17 @@ namespace System return *this; } - bool ICollection::operator==(const ICollection& other) const + bool BaseICollection::operator==(const BaseICollection& other) const { return Handle == other.Handle; } - bool ICollection::operator!=(const ICollection& other) const + bool BaseICollection::operator!=(const BaseICollection& other) const { return Handle != other.Handle; } - void ICollection::CopyTo(System::Array& array, int32_t index) + void BaseICollection::CopyTo(System::Array& array, int32_t index) { } @@ -6581,7 +6927,7 @@ namespace System try { auto array = System::Array(Plugin::InternalUse::Only, arrayHandle); - Plugin::GetSystemCollectionsICollection(cppHandle)->CopyTo(array, index); + Plugin::GetSystemCollectionsBaseICollection(cppHandle)->CopyTo(array, index); } catch (System::Exception ex) { @@ -6595,7 +6941,7 @@ namespace System } } - System::Collections::IEnumerator ICollection::GetEnumerator() + System::Collections::IEnumerator BaseICollection::GetEnumerator() { return nullptr; } @@ -6604,7 +6950,7 @@ namespace System { try { - return Plugin::GetSystemCollectionsICollection(cppHandle)->GetEnumerator().Handle; + return Plugin::GetSystemCollectionsBaseICollection(cppHandle)->GetEnumerator().Handle; } catch (System::Exception ex) { @@ -6620,7 +6966,7 @@ namespace System } } - int32_t ICollection::GetCount() + int32_t BaseICollection::GetCount() { return {}; } @@ -6629,7 +6975,7 @@ namespace System { try { - return Plugin::GetSystemCollectionsICollection(cppHandle)->GetCount(); + return Plugin::GetSystemCollectionsBaseICollection(cppHandle)->GetCount(); } catch (System::Exception ex) { @@ -6645,7 +6991,7 @@ namespace System } } - System::Boolean ICollection::GetIsSynchronized() + System::Boolean BaseICollection::GetIsSynchronized() { return {}; } @@ -6654,7 +7000,7 @@ namespace System { try { - return Plugin::GetSystemCollectionsICollection(cppHandle)->GetIsSynchronized(); + return Plugin::GetSystemCollectionsBaseICollection(cppHandle)->GetIsSynchronized(); } catch (System::Exception ex) { @@ -6670,7 +7016,7 @@ namespace System } } - System::Object ICollection::GetSyncRoot() + System::Object BaseICollection::GetSyncRoot() { return nullptr; } @@ -6679,7 +7025,7 @@ namespace System { try { - return Plugin::GetSystemCollectionsICollection(cppHandle)->GetSyncRoot().Handle; + return Plugin::GetSystemCollectionsBaseICollection(cppHandle)->GetSyncRoot().Handle; } catch (System::Exception ex) { @@ -6701,13 +7047,98 @@ namespace System { namespace Collections { - IList::IList() - : System::Object(nullptr) + IList::IList(decltype(nullptr) n) + : IList(Plugin::InternalUse::Only, 0) + { + } + + IList::IList(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IList::IList(const IList& other) + : IList(Plugin::InternalUse::Only, other.Handle) + { + } + + IList::IList(IList&& other) + : IList(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IList::~IList() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IList& IList::operator=(const IList& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IList& IList::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IList& IList::operator=(IList&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IList::operator==(const IList& other) const + { + return Handle == other.Handle; + } + + bool IList::operator!=(const IList& other) const + { + return Handle != other.Handle; + } + } +} + +namespace System +{ + namespace Collections + { + BaseIList::BaseIList() + : System::Collections::IList(nullptr) { - CppHandle = Plugin::StoreSystemCollectionsIList(this); + CppHandle = Plugin::StoreSystemCollectionsBaseIList(this); int32_t* handle = &Handle; int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsIListConstructor(cppHandle, handle); + Plugin::SystemCollectionsBaseIListConstructor(cppHandle, handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6721,7 +7152,7 @@ namespace System } else { - Plugin::RemoveSystemCollectionsIList(CppHandle); + Plugin::RemoveSystemCollectionsBaseIList(CppHandle); CppHandle = 0; } if (Plugin::unhandledCsharpException) @@ -6733,43 +7164,43 @@ namespace System } } - IList::IList(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) + BaseIList::BaseIList(decltype(nullptr) n) + : System::Collections::IList(Plugin::InternalUse::Only, 0) { - CppHandle = Plugin::StoreSystemCollectionsIList(this); + CppHandle = Plugin::StoreSystemCollectionsBaseIList(this); } - IList::IList(const IList& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + BaseIList::BaseIList(const BaseIList& other) + : System::Collections::IList(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemCollectionsIList(this); + CppHandle = Plugin::StoreSystemCollectionsBaseIList(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - IList::IList(IList&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + BaseIList::BaseIList(BaseIList&& other) + : System::Collections::IList(Plugin::InternalUse::Only, other.Handle) { CppHandle = other.CppHandle; other.Handle = 0; other.CppHandle = 0; } - IList::IList(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + BaseIList::BaseIList(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IList(iu, handle) { - CppHandle = Plugin::StoreSystemCollectionsIList(this); + CppHandle = Plugin::StoreSystemCollectionsBaseIList(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - IList::~IList() + BaseIList::~BaseIList() { - Plugin::RemoveSystemCollectionsIList(CppHandle); + Plugin::RemoveSystemCollectionsBaseIList(CppHandle); CppHandle = 0; if (Handle) { @@ -6777,7 +7208,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsIList(handle); + Plugin::ReleaseSystemCollectionsBaseIList(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6789,7 +7220,7 @@ namespace System } } - IList& IList::operator=(const IList& other) + BaseIList& BaseIList::operator=(const BaseIList& other) { if (this->Handle) { @@ -6803,7 +7234,7 @@ namespace System return *this; } - IList& IList::operator=(decltype(nullptr) other) + BaseIList& BaseIList::operator=(decltype(nullptr) other) { if (Handle) { @@ -6811,7 +7242,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsIList(handle); + Plugin::ReleaseSystemCollectionsBaseIList(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6825,9 +7256,9 @@ namespace System return *this; } - IList& IList::operator=(IList&& other) + BaseIList& BaseIList::operator=(BaseIList&& other) { - Plugin::RemoveSystemCollectionsIList(CppHandle); + Plugin::RemoveSystemCollectionsBaseIList(CppHandle); CppHandle = 0; if (Handle) { @@ -6835,7 +7266,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsIList(handle); + Plugin::ReleaseSystemCollectionsBaseIList(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6850,17 +7281,17 @@ namespace System return *this; } - bool IList::operator==(const IList& other) const + bool BaseIList::operator==(const BaseIList& other) const { return Handle == other.Handle; } - bool IList::operator!=(const IList& other) const + bool BaseIList::operator!=(const BaseIList& other) const { return Handle != other.Handle; } - int32_t IList::Add(System::Object& value) + int32_t BaseIList::Add(System::Object& value) { return {}; } @@ -6870,7 +7301,7 @@ namespace System try { auto value = System::Object(Plugin::InternalUse::Only, valueHandle); - return Plugin::GetSystemCollectionsIList(cppHandle)->Add(value); + return Plugin::GetSystemCollectionsBaseIList(cppHandle)->Add(value); } catch (System::Exception ex) { @@ -6886,7 +7317,7 @@ namespace System } } - void IList::Clear() + void BaseIList::Clear() { } @@ -6894,7 +7325,7 @@ namespace System { try { - Plugin::GetSystemCollectionsIList(cppHandle)->Clear(); + Plugin::GetSystemCollectionsBaseIList(cppHandle)->Clear(); } catch (System::Exception ex) { @@ -6908,7 +7339,7 @@ namespace System } } - System::Boolean IList::Contains(System::Object& value) + System::Boolean BaseIList::Contains(System::Object& value) { return {}; } @@ -6918,7 +7349,7 @@ namespace System try { auto value = System::Object(Plugin::InternalUse::Only, valueHandle); - return Plugin::GetSystemCollectionsIList(cppHandle)->Contains(value); + return Plugin::GetSystemCollectionsBaseIList(cppHandle)->Contains(value); } catch (System::Exception ex) { @@ -6934,7 +7365,7 @@ namespace System } } - int32_t IList::IndexOf(System::Object& value) + int32_t BaseIList::IndexOf(System::Object& value) { return {}; } @@ -6944,7 +7375,7 @@ namespace System try { auto value = System::Object(Plugin::InternalUse::Only, valueHandle); - return Plugin::GetSystemCollectionsIList(cppHandle)->IndexOf(value); + return Plugin::GetSystemCollectionsBaseIList(cppHandle)->IndexOf(value); } catch (System::Exception ex) { @@ -6960,7 +7391,7 @@ namespace System } } - void IList::Insert(int32_t index, System::Object& value) + void BaseIList::Insert(int32_t index, System::Object& value) { } @@ -6969,7 +7400,7 @@ namespace System try { auto value = System::Object(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemCollectionsIList(cppHandle)->Insert(index, value); + Plugin::GetSystemCollectionsBaseIList(cppHandle)->Insert(index, value); } catch (System::Exception ex) { @@ -6983,7 +7414,7 @@ namespace System } } - void IList::Remove(System::Object& value) + void BaseIList::Remove(System::Object& value) { } @@ -6992,7 +7423,7 @@ namespace System try { auto value = System::Object(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemCollectionsIList(cppHandle)->Remove(value); + Plugin::GetSystemCollectionsBaseIList(cppHandle)->Remove(value); } catch (System::Exception ex) { @@ -7006,7 +7437,7 @@ namespace System } } - void IList::RemoveAt(int32_t index) + void BaseIList::RemoveAt(int32_t index) { } @@ -7014,7 +7445,7 @@ namespace System { try { - Plugin::GetSystemCollectionsIList(cppHandle)->RemoveAt(index); + Plugin::GetSystemCollectionsBaseIList(cppHandle)->RemoveAt(index); } catch (System::Exception ex) { @@ -7028,7 +7459,7 @@ namespace System } } - System::Collections::IEnumerator IList::GetEnumerator() + System::Collections::IEnumerator BaseIList::GetEnumerator() { return nullptr; } @@ -7037,7 +7468,7 @@ namespace System { try { - return Plugin::GetSystemCollectionsIList(cppHandle)->GetEnumerator().Handle; + return Plugin::GetSystemCollectionsBaseIList(cppHandle)->GetEnumerator().Handle; } catch (System::Exception ex) { @@ -7053,7 +7484,7 @@ namespace System } } - void IList::CopyTo(System::Array& array, int32_t index) + void BaseIList::CopyTo(System::Array& array, int32_t index) { } @@ -7062,7 +7493,7 @@ namespace System try { auto array = System::Array(Plugin::InternalUse::Only, arrayHandle); - Plugin::GetSystemCollectionsIList(cppHandle)->CopyTo(array, index); + Plugin::GetSystemCollectionsBaseIList(cppHandle)->CopyTo(array, index); } catch (System::Exception ex) { @@ -7076,7 +7507,7 @@ namespace System } } - System::Boolean IList::GetIsFixedSize() + System::Boolean BaseIList::GetIsFixedSize() { return {}; } @@ -7085,7 +7516,7 @@ namespace System { try { - return Plugin::GetSystemCollectionsIList(cppHandle)->GetIsFixedSize(); + return Plugin::GetSystemCollectionsBaseIList(cppHandle)->GetIsFixedSize(); } catch (System::Exception ex) { @@ -7101,7 +7532,7 @@ namespace System } } - System::Boolean IList::GetIsReadOnly() + System::Boolean BaseIList::GetIsReadOnly() { return {}; } @@ -7110,7 +7541,7 @@ namespace System { try { - return Plugin::GetSystemCollectionsIList(cppHandle)->GetIsReadOnly(); + return Plugin::GetSystemCollectionsBaseIList(cppHandle)->GetIsReadOnly(); } catch (System::Exception ex) { @@ -7126,7 +7557,7 @@ namespace System } } - System::Object IList::GetItem(int32_t index) + System::Object BaseIList::GetItem(int32_t index) { return nullptr; } @@ -7135,7 +7566,7 @@ namespace System { try { - return Plugin::GetSystemCollectionsIList(cppHandle)->GetItem(index).Handle; + return Plugin::GetSystemCollectionsBaseIList(cppHandle)->GetItem(index).Handle; } catch (System::Exception ex) { @@ -7151,7 +7582,7 @@ namespace System } } - void IList::SetItem(int32_t index, System::Object& value) + void BaseIList::SetItem(int32_t index, System::Object& value) { } @@ -7160,7 +7591,7 @@ namespace System try { auto value = System::Object(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemCollectionsIList(cppHandle)->SetItem(index, value); + Plugin::GetSystemCollectionsBaseIList(cppHandle)->SetItem(index, value); } catch (System::Exception ex) { @@ -7174,7 +7605,7 @@ namespace System } } - int32_t IList::GetCount() + int32_t BaseIList::GetCount() { return {}; } @@ -7183,7 +7614,7 @@ namespace System { try { - return Plugin::GetSystemCollectionsIList(cppHandle)->GetCount(); + return Plugin::GetSystemCollectionsBaseIList(cppHandle)->GetCount(); } catch (System::Exception ex) { @@ -7199,7 +7630,7 @@ namespace System } } - System::Boolean IList::GetIsSynchronized() + System::Boolean BaseIList::GetIsSynchronized() { return {}; } @@ -7208,7 +7639,7 @@ namespace System { try { - return Plugin::GetSystemCollectionsIList(cppHandle)->GetIsSynchronized(); + return Plugin::GetSystemCollectionsBaseIList(cppHandle)->GetIsSynchronized(); } catch (System::Exception ex) { @@ -7224,7 +7655,7 @@ namespace System } } - System::Object IList::GetSyncRoot() + System::Object BaseIList::GetSyncRoot() { return nullptr; } @@ -7233,7 +7664,7 @@ namespace System { try { - return Plugin::GetSystemCollectionsIList(cppHandle)->GetSyncRoot().Handle; + return Plugin::GetSystemCollectionsBaseIList(cppHandle)->GetSyncRoot().Handle; } catch (System::Exception ex) { @@ -7242,11 +7673,109 @@ namespace System } catch (...) { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + System::String msg = "Unhandled exception invoking System::Collections::IList"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + } +} + +namespace System +{ + namespace Collections + { + Queue::Queue(decltype(nullptr) n) + : Queue(Plugin::InternalUse::Only, 0) + { + } + + Queue::Queue(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Queue::Queue(const Queue& other) + : Queue(Plugin::InternalUse::Only, other.Handle) + { + } + + Queue::Queue(Queue&& other) + : Queue(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Queue::~Queue() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Queue& Queue::operator=(const Queue& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Queue& Queue::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Queue& Queue::operator=(Queue&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Queue::operator==(const Queue& other) const + { + return Handle == other.Handle; + } + + bool Queue::operator!=(const Queue& other) const + { + return Handle != other.Handle; + } + + int32_t Queue::GetCount() + { + auto returnValue = Plugin::SystemCollectionsQueuePropertyGetCount(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnValue; } } } @@ -7255,13 +7784,13 @@ namespace System { namespace Collections { - Queue::Queue() - : System::Object(nullptr) + BaseQueue::BaseQueue() + : System::Collections::Queue(nullptr) { - CppHandle = Plugin::StoreSystemCollectionsQueue(this); + CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); int32_t* handle = &Handle; int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsQueueConstructor(cppHandle, handle); + Plugin::SystemCollectionsBaseQueueConstructor(cppHandle, handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7275,7 +7804,7 @@ namespace System } else { - Plugin::RemoveSystemCollectionsQueue(CppHandle); + Plugin::RemoveSystemCollectionsBaseQueue(CppHandle); CppHandle = 0; } if (Plugin::unhandledCsharpException) @@ -7287,43 +7816,43 @@ namespace System } } - Queue::Queue(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) + BaseQueue::BaseQueue(decltype(nullptr) n) + : System::Collections::Queue(Plugin::InternalUse::Only, 0) { - CppHandle = Plugin::StoreSystemCollectionsQueue(this); + CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); } - Queue::Queue(const Queue& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + BaseQueue::BaseQueue(const BaseQueue& other) + : System::Collections::Queue(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemCollectionsQueue(this); + CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - Queue::Queue(Queue&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + BaseQueue::BaseQueue(BaseQueue&& other) + : System::Collections::Queue(Plugin::InternalUse::Only, other.Handle) { CppHandle = other.CppHandle; other.Handle = 0; other.CppHandle = 0; } - Queue::Queue(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + BaseQueue::BaseQueue(Plugin::InternalUse iu, int32_t handle) + : System::Collections::Queue(iu, handle) { - CppHandle = Plugin::StoreSystemCollectionsQueue(this); + CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - Queue::~Queue() + BaseQueue::~BaseQueue() { - Plugin::RemoveSystemCollectionsQueue(CppHandle); + Plugin::RemoveSystemCollectionsBaseQueue(CppHandle); CppHandle = 0; if (Handle) { @@ -7331,7 +7860,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsQueue(handle); + Plugin::ReleaseSystemCollectionsBaseQueue(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7343,7 +7872,7 @@ namespace System } } - Queue& Queue::operator=(const Queue& other) + BaseQueue& BaseQueue::operator=(const BaseQueue& other) { if (this->Handle) { @@ -7357,7 +7886,7 @@ namespace System return *this; } - Queue& Queue::operator=(decltype(nullptr) other) + BaseQueue& BaseQueue::operator=(decltype(nullptr) other) { if (Handle) { @@ -7365,7 +7894,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsQueue(handle); + Plugin::ReleaseSystemCollectionsBaseQueue(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7379,9 +7908,9 @@ namespace System return *this; } - Queue& Queue::operator=(Queue&& other) + BaseQueue& BaseQueue::operator=(BaseQueue&& other) { - Plugin::RemoveSystemCollectionsQueue(CppHandle); + Plugin::RemoveSystemCollectionsBaseQueue(CppHandle); CppHandle = 0; if (Handle) { @@ -7389,7 +7918,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemCollectionsQueue(handle); + Plugin::ReleaseSystemCollectionsBaseQueue(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7404,17 +7933,17 @@ namespace System return *this; } - bool Queue::operator==(const Queue& other) const + bool BaseQueue::operator==(const BaseQueue& other) const { return Handle == other.Handle; } - bool Queue::operator!=(const Queue& other) const + bool BaseQueue::operator!=(const BaseQueue& other) const { return Handle != other.Handle; } - int32_t Queue::GetCount() + int32_t BaseQueue::GetCount() { return {}; } @@ -7423,7 +7952,7 @@ namespace System { try { - return Plugin::GetSystemCollectionsQueue(cppHandle)->GetCount(); + return Plugin::GetSystemCollectionsBaseQueue(cppHandle)->GetCount(); } catch (System::Exception ex) { @@ -7447,13 +7976,101 @@ namespace System { namespace Design { - IComponentChangeService::IComponentChangeService() - : System::Object(nullptr) + IComponentChangeService::IComponentChangeService(decltype(nullptr) n) + : IComponentChangeService(Plugin::InternalUse::Only, 0) + { + } + + IComponentChangeService::IComponentChangeService(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComponentChangeService::IComponentChangeService(const IComponentChangeService& other) + : IComponentChangeService(Plugin::InternalUse::Only, other.Handle) + { + } + + IComponentChangeService::IComponentChangeService(IComponentChangeService&& other) + : IComponentChangeService(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComponentChangeService::~IComponentChangeService() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComponentChangeService& IComponentChangeService::operator=(const IComponentChangeService& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComponentChangeService& IComponentChangeService::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComponentChangeService& IComponentChangeService::operator=(IComponentChangeService&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComponentChangeService::operator==(const IComponentChangeService& other) const + { + return Handle == other.Handle; + } + + bool IComponentChangeService::operator!=(const IComponentChangeService& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + BaseIComponentChangeService::BaseIComponentChangeService() + : System::ComponentModel::Design::IComponentChangeService(nullptr) { - CppHandle = Plugin::StoreSystemComponentModelDesignIComponentChangeService(this); + CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); int32_t* handle = &Handle; int32_t cppHandle = CppHandle; - Plugin::SystemComponentModelDesignIComponentChangeServiceConstructor(cppHandle, handle); + Plugin::SystemComponentModelDesignBaseIComponentChangeServiceConstructor(cppHandle, handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7467,7 +8084,7 @@ namespace System } else { - Plugin::RemoveSystemComponentModelDesignIComponentChangeService(CppHandle); + Plugin::RemoveSystemComponentModelDesignBaseIComponentChangeService(CppHandle); CppHandle = 0; } if (Plugin::unhandledCsharpException) @@ -7479,43 +8096,43 @@ namespace System } } - IComponentChangeService::IComponentChangeService(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) + BaseIComponentChangeService::BaseIComponentChangeService(decltype(nullptr) n) + : System::ComponentModel::Design::IComponentChangeService(Plugin::InternalUse::Only, 0) { - CppHandle = Plugin::StoreSystemComponentModelDesignIComponentChangeService(this); + CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); } - IComponentChangeService::IComponentChangeService(const IComponentChangeService& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + BaseIComponentChangeService::BaseIComponentChangeService(const BaseIComponentChangeService& other) + : System::ComponentModel::Design::IComponentChangeService(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemComponentModelDesignIComponentChangeService(this); + CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - IComponentChangeService::IComponentChangeService(IComponentChangeService&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) + BaseIComponentChangeService::BaseIComponentChangeService(BaseIComponentChangeService&& other) + : System::ComponentModel::Design::IComponentChangeService(Plugin::InternalUse::Only, other.Handle) { CppHandle = other.CppHandle; other.Handle = 0; other.CppHandle = 0; } - IComponentChangeService::IComponentChangeService(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + BaseIComponentChangeService::BaseIComponentChangeService(Plugin::InternalUse iu, int32_t handle) + : System::ComponentModel::Design::IComponentChangeService(iu, handle) { - CppHandle = Plugin::StoreSystemComponentModelDesignIComponentChangeService(this); + CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - IComponentChangeService::~IComponentChangeService() + BaseIComponentChangeService::~BaseIComponentChangeService() { - Plugin::RemoveSystemComponentModelDesignIComponentChangeService(CppHandle); + Plugin::RemoveSystemComponentModelDesignBaseIComponentChangeService(CppHandle); CppHandle = 0; if (Handle) { @@ -7523,7 +8140,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemComponentModelDesignIComponentChangeService(handle); + Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7535,7 +8152,7 @@ namespace System } } - IComponentChangeService& IComponentChangeService::operator=(const IComponentChangeService& other) + BaseIComponentChangeService& BaseIComponentChangeService::operator=(const BaseIComponentChangeService& other) { if (this->Handle) { @@ -7549,7 +8166,7 @@ namespace System return *this; } - IComponentChangeService& IComponentChangeService::operator=(decltype(nullptr) other) + BaseIComponentChangeService& BaseIComponentChangeService::operator=(decltype(nullptr) other) { if (Handle) { @@ -7557,7 +8174,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemComponentModelDesignIComponentChangeService(handle); + Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7571,9 +8188,9 @@ namespace System return *this; } - IComponentChangeService& IComponentChangeService::operator=(IComponentChangeService&& other) + BaseIComponentChangeService& BaseIComponentChangeService::operator=(BaseIComponentChangeService&& other) { - Plugin::RemoveSystemComponentModelDesignIComponentChangeService(CppHandle); + Plugin::RemoveSystemComponentModelDesignBaseIComponentChangeService(CppHandle); CppHandle = 0; if (Handle) { @@ -7581,7 +8198,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemComponentModelDesignIComponentChangeService(handle); + Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7596,17 +8213,17 @@ namespace System return *this; } - bool IComponentChangeService::operator==(const IComponentChangeService& other) const + bool BaseIComponentChangeService::operator==(const BaseIComponentChangeService& other) const { return Handle == other.Handle; } - bool IComponentChangeService::operator!=(const IComponentChangeService& other) const + bool BaseIComponentChangeService::operator!=(const BaseIComponentChangeService& other) const { return Handle != other.Handle; } - void IComponentChangeService::OnComponentChanged(System::Object& component, System::ComponentModel::MemberDescriptor& member, System::Object& oldValue, System::Object& newValue) + void BaseIComponentChangeService::OnComponentChanged(System::Object& component, System::ComponentModel::MemberDescriptor& member, System::Object& oldValue, System::Object& newValue) { } @@ -7618,7 +8235,7 @@ namespace System auto member = System::ComponentModel::MemberDescriptor(Plugin::InternalUse::Only, memberHandle); auto oldValue = System::Object(Plugin::InternalUse::Only, oldValueHandle); auto newValue = System::Object(Plugin::InternalUse::Only, newValueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->OnComponentChanged(component, member, oldValue, newValue); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->OnComponentChanged(component, member, oldValue, newValue); } catch (System::Exception ex) { @@ -7632,7 +8249,7 @@ namespace System } } - void IComponentChangeService::OnComponentChanging(System::Object& component, System::ComponentModel::MemberDescriptor& member) + void BaseIComponentChangeService::OnComponentChanging(System::Object& component, System::ComponentModel::MemberDescriptor& member) { } @@ -7642,7 +8259,7 @@ namespace System { auto component = System::Object(Plugin::InternalUse::Only, componentHandle); auto member = System::ComponentModel::MemberDescriptor(Plugin::InternalUse::Only, memberHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->OnComponentChanging(component, member); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->OnComponentChanging(component, member); } catch (System::Exception ex) { @@ -7656,7 +8273,7 @@ namespace System } } - void IComponentChangeService::AddComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value) + void BaseIComponentChangeService::AddComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value) { } @@ -7665,7 +8282,7 @@ namespace System try { auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentAdded(value); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentAdded(value); } catch (System::Exception ex) { @@ -7679,7 +8296,7 @@ namespace System } } - void IComponentChangeService::RemoveComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value) + void BaseIComponentChangeService::RemoveComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value) { } @@ -7688,7 +8305,7 @@ namespace System try { auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentAdded(value); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentAdded(value); } catch (System::Exception ex) { @@ -7702,7 +8319,7 @@ namespace System } } - void IComponentChangeService::AddComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value) + void BaseIComponentChangeService::AddComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value) { } @@ -7711,7 +8328,7 @@ namespace System try { auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentAdding(value); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentAdding(value); } catch (System::Exception ex) { @@ -7725,7 +8342,7 @@ namespace System } } - void IComponentChangeService::RemoveComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value) + void BaseIComponentChangeService::RemoveComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value) { } @@ -7734,7 +8351,7 @@ namespace System try { auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentAdding(value); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentAdding(value); } catch (System::Exception ex) { @@ -7748,7 +8365,7 @@ namespace System } } - void IComponentChangeService::AddComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value) + void BaseIComponentChangeService::AddComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value) { } @@ -7757,7 +8374,7 @@ namespace System try { auto value = System::ComponentModel::Design::ComponentChangedEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentChanged(value); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentChanged(value); } catch (System::Exception ex) { @@ -7771,7 +8388,7 @@ namespace System } } - void IComponentChangeService::RemoveComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value) + void BaseIComponentChangeService::RemoveComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value) { } @@ -7780,7 +8397,7 @@ namespace System try { auto value = System::ComponentModel::Design::ComponentChangedEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentChanged(value); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentChanged(value); } catch (System::Exception ex) { @@ -7794,7 +8411,7 @@ namespace System } } - void IComponentChangeService::AddComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value) + void BaseIComponentChangeService::AddComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value) { } @@ -7803,7 +8420,7 @@ namespace System try { auto value = System::ComponentModel::Design::ComponentChangingEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentChanging(value); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentChanging(value); } catch (System::Exception ex) { @@ -7817,7 +8434,7 @@ namespace System } } - void IComponentChangeService::RemoveComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value) + void BaseIComponentChangeService::RemoveComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value) { } @@ -7826,7 +8443,7 @@ namespace System try { auto value = System::ComponentModel::Design::ComponentChangingEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentChanging(value); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentChanging(value); } catch (System::Exception ex) { @@ -7840,7 +8457,7 @@ namespace System } } - void IComponentChangeService::AddComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value) + void BaseIComponentChangeService::AddComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value) { } @@ -7849,7 +8466,7 @@ namespace System try { auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentRemoved(value); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentRemoved(value); } catch (System::Exception ex) { @@ -7863,7 +8480,7 @@ namespace System } } - void IComponentChangeService::RemoveComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value) + void BaseIComponentChangeService::RemoveComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value) { } @@ -7872,7 +8489,7 @@ namespace System try { auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentRemoved(value); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentRemoved(value); } catch (System::Exception ex) { @@ -7886,7 +8503,7 @@ namespace System } } - void IComponentChangeService::AddComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value) + void BaseIComponentChangeService::AddComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value) { } @@ -7895,7 +8512,7 @@ namespace System try { auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentRemoving(value); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentRemoving(value); } catch (System::Exception ex) { @@ -7909,7 +8526,7 @@ namespace System } } - void IComponentChangeService::RemoveComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value) + void BaseIComponentChangeService::RemoveComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value) { } @@ -7918,7 +8535,7 @@ namespace System try { auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentRemoving(value); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentRemoving(value); } catch (System::Exception ex) { @@ -7932,7 +8549,7 @@ namespace System } } - void IComponentChangeService::AddComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value) + void BaseIComponentChangeService::AddComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value) { } @@ -7941,7 +8558,7 @@ namespace System try { auto value = System::ComponentModel::Design::ComponentRenameEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->AddComponentRename(value); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentRename(value); } catch (System::Exception ex) { @@ -7955,7 +8572,7 @@ namespace System } } - void IComponentChangeService::RemoveComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value) + void BaseIComponentChangeService::RemoveComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value) { } @@ -7964,7 +8581,7 @@ namespace System try { auto value = System::ComponentModel::Design::ComponentRenameEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignIComponentChangeService(cppHandle)->RemoveComponentRename(value); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentRename(value); } catch (System::Exception ex) { @@ -7985,13 +8602,128 @@ namespace System { namespace IO { + FileStream::FileStream(decltype(nullptr) n) + : FileStream(Plugin::InternalUse::Only, 0) + { + } + + FileStream::FileStream(Plugin::InternalUse iu, int32_t handle) + : System::IO::Stream(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + FileStream::FileStream(const FileStream& other) + : FileStream(Plugin::InternalUse::Only, other.Handle) + { + } + + FileStream::FileStream(FileStream&& other) + : FileStream(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + FileStream::~FileStream() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + FileStream& FileStream::operator=(const FileStream& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + FileStream& FileStream::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + FileStream& FileStream::operator=(FileStream&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool FileStream::operator==(const FileStream& other) const + { + return Handle == other.Handle; + } + + bool FileStream::operator!=(const FileStream& other) const + { + return Handle != other.Handle; + } + FileStream::FileStream(System::String& path, System::IO::FileMode mode) : System::IO::Stream(nullptr) { - CppHandle = Plugin::StoreSystemIOFileStream(this); + auto returnValue = Plugin::SystemIOFileStreamConstructorSystemString_SystemIOFileMode(path.Handle, mode); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + void FileStream::WriteByte(uint8_t value) + { + Plugin::SystemIOFileStreamMethodWriteByteSystemByte(Handle, value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } +} + +namespace System +{ + namespace IO + { + BaseFileStream::BaseFileStream(System::String& path, System::IO::FileMode mode) + : System::IO::FileStream(nullptr) + { + CppHandle = Plugin::StoreSystemIOBaseFileStream(this); int32_t* handle = &Handle; int32_t cppHandle = CppHandle; - Plugin::SystemIOFileStreamConstructorSystemString_SystemIOFileMode(cppHandle, handle, path.Handle, mode); + Plugin::SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode(cppHandle, handle, path.Handle, mode); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8005,7 +8737,7 @@ namespace System } else { - Plugin::RemoveSystemIOFileStream(CppHandle); + Plugin::RemoveSystemIOBaseFileStream(CppHandle); CppHandle = 0; } if (Plugin::unhandledCsharpException) @@ -8017,43 +8749,43 @@ namespace System } } - FileStream::FileStream(decltype(nullptr) n) - : System::IO::Stream(Plugin::InternalUse::Only, 0) + BaseFileStream::BaseFileStream(decltype(nullptr) n) + : System::IO::FileStream(Plugin::InternalUse::Only, 0) { - CppHandle = Plugin::StoreSystemIOFileStream(this); + CppHandle = Plugin::StoreSystemIOBaseFileStream(this); } - FileStream::FileStream(const FileStream& other) - : System::IO::Stream(Plugin::InternalUse::Only, other.Handle) + BaseFileStream::BaseFileStream(const BaseFileStream& other) + : System::IO::FileStream(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemIOFileStream(this); + CppHandle = Plugin::StoreSystemIOBaseFileStream(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - FileStream::FileStream(FileStream&& other) - : System::IO::Stream(Plugin::InternalUse::Only, other.Handle) + BaseFileStream::BaseFileStream(BaseFileStream&& other) + : System::IO::FileStream(Plugin::InternalUse::Only, other.Handle) { CppHandle = other.CppHandle; other.Handle = 0; other.CppHandle = 0; } - FileStream::FileStream(Plugin::InternalUse iu, int32_t handle) - : System::IO::Stream(iu, handle) + BaseFileStream::BaseFileStream(Plugin::InternalUse iu, int32_t handle) + : System::IO::FileStream(iu, handle) { - CppHandle = Plugin::StoreSystemIOFileStream(this); + CppHandle = Plugin::StoreSystemIOBaseFileStream(this); if (Handle) { Plugin::ReferenceManagedClass(Handle); } } - FileStream::~FileStream() + BaseFileStream::~BaseFileStream() { - Plugin::RemoveSystemIOFileStream(CppHandle); + Plugin::RemoveSystemIOBaseFileStream(CppHandle); CppHandle = 0; if (Handle) { @@ -8061,7 +8793,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemIOFileStream(handle); + Plugin::ReleaseSystemIOBaseFileStream(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8073,7 +8805,7 @@ namespace System } } - FileStream& FileStream::operator=(const FileStream& other) + BaseFileStream& BaseFileStream::operator=(const BaseFileStream& other) { if (this->Handle) { @@ -8087,7 +8819,7 @@ namespace System return *this; } - FileStream& FileStream::operator=(decltype(nullptr) other) + BaseFileStream& BaseFileStream::operator=(decltype(nullptr) other) { if (Handle) { @@ -8095,7 +8827,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemIOFileStream(handle); + Plugin::ReleaseSystemIOBaseFileStream(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8109,9 +8841,9 @@ namespace System return *this; } - FileStream& FileStream::operator=(FileStream&& other) + BaseFileStream& BaseFileStream::operator=(BaseFileStream&& other) { - Plugin::RemoveSystemIOFileStream(CppHandle); + Plugin::RemoveSystemIOBaseFileStream(CppHandle); CppHandle = 0; if (Handle) { @@ -8119,7 +8851,7 @@ namespace System Handle = 0; if (Plugin::DereferenceManagedClassNoRelease(handle)) { - Plugin::ReleaseSystemIOFileStream(handle); + Plugin::ReleaseSystemIOBaseFileStream(handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8134,17 +8866,17 @@ namespace System return *this; } - bool FileStream::operator==(const FileStream& other) const + bool BaseFileStream::operator==(const BaseFileStream& other) const { return Handle == other.Handle; } - bool FileStream::operator!=(const FileStream& other) const + bool BaseFileStream::operator!=(const BaseFileStream& other) const { return Handle != other.Handle; } - void FileStream::WriteByte(uint8_t value) + void BaseFileStream::WriteByte(uint8_t value) { } @@ -8152,7 +8884,7 @@ namespace System { try { - Plugin::GetSystemIOFileStream(cppHandle)->WriteByte(value); + Plugin::GetSystemIOBaseFileStream(cppHandle)->WriteByte(value); } catch (System::Exception ex) { @@ -13217,22 +13949,25 @@ DLLEXPORT void Init( float (*unityEngineTimePropertyGetDeltaTime)(), int32_t (*boxFileMode)(System::IO::FileMode val), System::IO::FileMode (*unboxFileMode)(int32_t valHandle), - void (*releaseSystemCollectionsGenericIComparerSystemInt32)(int32_t handle), - void (*systemCollectionsGenericIComparerSystemInt32Constructor)(int32_t cppHandle, int32_t* handle), - void (*releaseSystemCollectionsGenericIComparerSystemString)(int32_t handle), - void (*systemCollectionsGenericIComparerSystemStringConstructor)(int32_t cppHandle, int32_t* handle), - void (*releaseSystemStringComparer)(int32_t handle), - void (*systemStringComparerConstructor)(int32_t cppHandle, int32_t* handle), - void (*releaseSystemCollectionsICollection)(int32_t handle), - void (*systemCollectionsICollectionConstructor)(int32_t cppHandle, int32_t* handle), - void (*releaseSystemCollectionsIList)(int32_t handle), - void (*systemCollectionsIListConstructor)(int32_t cppHandle, int32_t* handle), - void (*releaseSystemCollectionsQueue)(int32_t handle), - void (*systemCollectionsQueueConstructor)(int32_t cppHandle, int32_t* handle), - void (*releaseSystemComponentModelDesignIComponentChangeService)(int32_t handle), - void (*systemComponentModelDesignIComponentChangeServiceConstructor)(int32_t cppHandle, int32_t* handle), - void (*releaseSystemIOFileStream)(int32_t handle), - void (*systemIOFileStreamConstructorSystemString_SystemIOFileMode)(int32_t cppHandle, int32_t* handle, int32_t pathHandle, System::IO::FileMode mode), + void (*releaseSystemCollectionsGenericBaseIComparerSystemInt32)(int32_t handle), + void (*systemCollectionsGenericBaseIComparerSystemInt32Constructor)(int32_t cppHandle, int32_t* handle), + void (*releaseSystemCollectionsGenericBaseIComparerSystemString)(int32_t handle), + void (*systemCollectionsGenericBaseIComparerSystemStringConstructor)(int32_t cppHandle, int32_t* handle), + void (*releaseSystemBaseStringComparer)(int32_t handle), + void (*systemBaseStringComparerConstructor)(int32_t cppHandle, int32_t* handle), + void (*releaseSystemCollectionsBaseICollection)(int32_t handle), + void (*systemCollectionsBaseICollectionConstructor)(int32_t cppHandle, int32_t* handle), + void (*releaseSystemCollectionsBaseIList)(int32_t handle), + void (*systemCollectionsBaseIListConstructor)(int32_t cppHandle, int32_t* handle), + int32_t (*systemCollectionsQueuePropertyGetCount)(int32_t thisHandle), + void (*releaseSystemCollectionsBaseQueue)(int32_t handle), + void (*systemCollectionsBaseQueueConstructor)(int32_t cppHandle, int32_t* handle), + void (*releaseSystemComponentModelDesignBaseIComponentChangeService)(int32_t handle), + void (*systemComponentModelDesignBaseIComponentChangeServiceConstructor)(int32_t cppHandle, int32_t* handle), + int32_t (*systemIOFileStreamConstructorSystemString_SystemIOFileMode)(int32_t pathHandle, System::IO::FileMode mode), + void (*systemIOFileStreamMethodWriteByteSystemByte)(int32_t thisHandle, uint8_t value), + void (*releaseSystemIOBaseFileStream)(int32_t handle), + void (*systemIOBaseFileStreamConstructorSystemString_SystemIOFileMode)(int32_t cppHandle, int32_t* handle, int32_t pathHandle, System::IO::FileMode mode), int32_t (*boxBoolean)(System::Boolean val), System::Boolean (*unboxBoolean)(int32_t valHandle), int32_t (*boxSByte)(int8_t val), @@ -13466,86 +14201,89 @@ DLLEXPORT void Init( Plugin::UnityEngineTimePropertyGetDeltaTime = unityEngineTimePropertyGetDeltaTime; Plugin::BoxFileMode = boxFileMode; Plugin::UnboxFileMode = unboxFileMode; - SystemCollectionsGenericIComparerSystemInt32FreeListSize = maxManagedObjects; - SystemCollectionsGenericIComparerSystemInt32FreeList = new System::Collections::Generic::IComparer*[SystemCollectionsGenericIComparerSystemInt32FreeListSize]; - for (int32_t i = 0, end = SystemCollectionsGenericIComparerSystemInt32FreeListSize - 1; i < end; ++i) - { - SystemCollectionsGenericIComparerSystemInt32FreeList[i] = (System::Collections::Generic::IComparer*)(SystemCollectionsGenericIComparerSystemInt32FreeList + i + 1); - } - SystemCollectionsGenericIComparerSystemInt32FreeList[SystemCollectionsGenericIComparerSystemInt32FreeListSize - 1] = nullptr; - NextFreeSystemCollectionsGenericIComparerSystemInt32 = SystemCollectionsGenericIComparerSystemInt32FreeList + 1; - Plugin::ReleaseSystemCollectionsGenericIComparerSystemInt32 = releaseSystemCollectionsGenericIComparerSystemInt32; - Plugin::SystemCollectionsGenericIComparerSystemInt32Constructor = systemCollectionsGenericIComparerSystemInt32Constructor; - SystemCollectionsGenericIComparerSystemStringFreeListSize = maxManagedObjects; - SystemCollectionsGenericIComparerSystemStringFreeList = new System::Collections::Generic::IComparer*[SystemCollectionsGenericIComparerSystemStringFreeListSize]; - for (int32_t i = 0, end = SystemCollectionsGenericIComparerSystemStringFreeListSize - 1; i < end; ++i) - { - SystemCollectionsGenericIComparerSystemStringFreeList[i] = (System::Collections::Generic::IComparer*)(SystemCollectionsGenericIComparerSystemStringFreeList + i + 1); - } - SystemCollectionsGenericIComparerSystemStringFreeList[SystemCollectionsGenericIComparerSystemStringFreeListSize - 1] = nullptr; - NextFreeSystemCollectionsGenericIComparerSystemString = SystemCollectionsGenericIComparerSystemStringFreeList + 1; - Plugin::ReleaseSystemCollectionsGenericIComparerSystemString = releaseSystemCollectionsGenericIComparerSystemString; - Plugin::SystemCollectionsGenericIComparerSystemStringConstructor = systemCollectionsGenericIComparerSystemStringConstructor; - SystemStringComparerFreeListSize = maxManagedObjects; - SystemStringComparerFreeList = new System::StringComparer*[SystemStringComparerFreeListSize]; - for (int32_t i = 0, end = SystemStringComparerFreeListSize - 1; i < end; ++i) - { - SystemStringComparerFreeList[i] = (System::StringComparer*)(SystemStringComparerFreeList + i + 1); - } - SystemStringComparerFreeList[SystemStringComparerFreeListSize - 1] = nullptr; - NextFreeSystemStringComparer = SystemStringComparerFreeList + 1; - Plugin::ReleaseSystemStringComparer = releaseSystemStringComparer; - Plugin::SystemStringComparerConstructor = systemStringComparerConstructor; - SystemCollectionsICollectionFreeListSize = maxManagedObjects; - SystemCollectionsICollectionFreeList = new System::Collections::ICollection*[SystemCollectionsICollectionFreeListSize]; - for (int32_t i = 0, end = SystemCollectionsICollectionFreeListSize - 1; i < end; ++i) - { - SystemCollectionsICollectionFreeList[i] = (System::Collections::ICollection*)(SystemCollectionsICollectionFreeList + i + 1); - } - SystemCollectionsICollectionFreeList[SystemCollectionsICollectionFreeListSize - 1] = nullptr; - NextFreeSystemCollectionsICollection = SystemCollectionsICollectionFreeList + 1; - Plugin::ReleaseSystemCollectionsICollection = releaseSystemCollectionsICollection; - Plugin::SystemCollectionsICollectionConstructor = systemCollectionsICollectionConstructor; - SystemCollectionsIListFreeListSize = maxManagedObjects; - SystemCollectionsIListFreeList = new System::Collections::IList*[SystemCollectionsIListFreeListSize]; - for (int32_t i = 0, end = SystemCollectionsIListFreeListSize - 1; i < end; ++i) - { - SystemCollectionsIListFreeList[i] = (System::Collections::IList*)(SystemCollectionsIListFreeList + i + 1); - } - SystemCollectionsIListFreeList[SystemCollectionsIListFreeListSize - 1] = nullptr; - NextFreeSystemCollectionsIList = SystemCollectionsIListFreeList + 1; - Plugin::ReleaseSystemCollectionsIList = releaseSystemCollectionsIList; - Plugin::SystemCollectionsIListConstructor = systemCollectionsIListConstructor; - SystemCollectionsQueueFreeListSize = maxManagedObjects; - SystemCollectionsQueueFreeList = new System::Collections::Queue*[SystemCollectionsQueueFreeListSize]; - for (int32_t i = 0, end = SystemCollectionsQueueFreeListSize - 1; i < end; ++i) - { - SystemCollectionsQueueFreeList[i] = (System::Collections::Queue*)(SystemCollectionsQueueFreeList + i + 1); - } - SystemCollectionsQueueFreeList[SystemCollectionsQueueFreeListSize - 1] = nullptr; - NextFreeSystemCollectionsQueue = SystemCollectionsQueueFreeList + 1; - Plugin::ReleaseSystemCollectionsQueue = releaseSystemCollectionsQueue; - Plugin::SystemCollectionsQueueConstructor = systemCollectionsQueueConstructor; - SystemComponentModelDesignIComponentChangeServiceFreeListSize = maxManagedObjects; - SystemComponentModelDesignIComponentChangeServiceFreeList = new System::ComponentModel::Design::IComponentChangeService*[SystemComponentModelDesignIComponentChangeServiceFreeListSize]; - for (int32_t i = 0, end = SystemComponentModelDesignIComponentChangeServiceFreeListSize - 1; i < end; ++i) - { - SystemComponentModelDesignIComponentChangeServiceFreeList[i] = (System::ComponentModel::Design::IComponentChangeService*)(SystemComponentModelDesignIComponentChangeServiceFreeList + i + 1); - } - SystemComponentModelDesignIComponentChangeServiceFreeList[SystemComponentModelDesignIComponentChangeServiceFreeListSize - 1] = nullptr; - NextFreeSystemComponentModelDesignIComponentChangeService = SystemComponentModelDesignIComponentChangeServiceFreeList + 1; - Plugin::ReleaseSystemComponentModelDesignIComponentChangeService = releaseSystemComponentModelDesignIComponentChangeService; - Plugin::SystemComponentModelDesignIComponentChangeServiceConstructor = systemComponentModelDesignIComponentChangeServiceConstructor; - SystemIOFileStreamFreeListSize = maxManagedObjects; - SystemIOFileStreamFreeList = new System::IO::FileStream*[SystemIOFileStreamFreeListSize]; - for (int32_t i = 0, end = SystemIOFileStreamFreeListSize - 1; i < end; ++i) - { - SystemIOFileStreamFreeList[i] = (System::IO::FileStream*)(SystemIOFileStreamFreeList + i + 1); - } - SystemIOFileStreamFreeList[SystemIOFileStreamFreeListSize - 1] = nullptr; - NextFreeSystemIOFileStream = SystemIOFileStreamFreeList + 1; - Plugin::ReleaseSystemIOFileStream = releaseSystemIOFileStream; + SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize = maxManagedObjects; + SystemCollectionsGenericBaseIComparerSystemInt32FreeList = new System::Collections::Generic::BaseIComparer*[SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize]; + for (int32_t i = 0, end = SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize - 1; i < end; ++i) + { + SystemCollectionsGenericBaseIComparerSystemInt32FreeList[i] = (System::Collections::Generic::BaseIComparer*)(SystemCollectionsGenericBaseIComparerSystemInt32FreeList + i + 1); + } + SystemCollectionsGenericBaseIComparerSystemInt32FreeList[SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize - 1] = nullptr; + NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 = SystemCollectionsGenericBaseIComparerSystemInt32FreeList + 1; + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32 = releaseSystemCollectionsGenericBaseIComparerSystemInt32; + Plugin::SystemCollectionsGenericBaseIComparerSystemInt32Constructor = systemCollectionsGenericBaseIComparerSystemInt32Constructor; + SystemCollectionsGenericBaseIComparerSystemStringFreeListSize = maxManagedObjects; + SystemCollectionsGenericBaseIComparerSystemStringFreeList = new System::Collections::Generic::BaseIComparer*[SystemCollectionsGenericBaseIComparerSystemStringFreeListSize]; + for (int32_t i = 0, end = SystemCollectionsGenericBaseIComparerSystemStringFreeListSize - 1; i < end; ++i) + { + SystemCollectionsGenericBaseIComparerSystemStringFreeList[i] = (System::Collections::Generic::BaseIComparer*)(SystemCollectionsGenericBaseIComparerSystemStringFreeList + i + 1); + } + SystemCollectionsGenericBaseIComparerSystemStringFreeList[SystemCollectionsGenericBaseIComparerSystemStringFreeListSize - 1] = nullptr; + NextFreeSystemCollectionsGenericBaseIComparerSystemString = SystemCollectionsGenericBaseIComparerSystemStringFreeList + 1; + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString = releaseSystemCollectionsGenericBaseIComparerSystemString; + Plugin::SystemCollectionsGenericBaseIComparerSystemStringConstructor = systemCollectionsGenericBaseIComparerSystemStringConstructor; + SystemBaseStringComparerFreeListSize = maxManagedObjects; + SystemBaseStringComparerFreeList = new System::BaseStringComparer*[SystemBaseStringComparerFreeListSize]; + for (int32_t i = 0, end = SystemBaseStringComparerFreeListSize - 1; i < end; ++i) + { + SystemBaseStringComparerFreeList[i] = (System::BaseStringComparer*)(SystemBaseStringComparerFreeList + i + 1); + } + SystemBaseStringComparerFreeList[SystemBaseStringComparerFreeListSize - 1] = nullptr; + NextFreeSystemBaseStringComparer = SystemBaseStringComparerFreeList + 1; + Plugin::ReleaseSystemBaseStringComparer = releaseSystemBaseStringComparer; + Plugin::SystemBaseStringComparerConstructor = systemBaseStringComparerConstructor; + SystemCollectionsBaseICollectionFreeListSize = maxManagedObjects; + SystemCollectionsBaseICollectionFreeList = new System::Collections::BaseICollection*[SystemCollectionsBaseICollectionFreeListSize]; + for (int32_t i = 0, end = SystemCollectionsBaseICollectionFreeListSize - 1; i < end; ++i) + { + SystemCollectionsBaseICollectionFreeList[i] = (System::Collections::BaseICollection*)(SystemCollectionsBaseICollectionFreeList + i + 1); + } + SystemCollectionsBaseICollectionFreeList[SystemCollectionsBaseICollectionFreeListSize - 1] = nullptr; + NextFreeSystemCollectionsBaseICollection = SystemCollectionsBaseICollectionFreeList + 1; + Plugin::ReleaseSystemCollectionsBaseICollection = releaseSystemCollectionsBaseICollection; + Plugin::SystemCollectionsBaseICollectionConstructor = systemCollectionsBaseICollectionConstructor; + SystemCollectionsBaseIListFreeListSize = maxManagedObjects; + SystemCollectionsBaseIListFreeList = new System::Collections::BaseIList*[SystemCollectionsBaseIListFreeListSize]; + for (int32_t i = 0, end = SystemCollectionsBaseIListFreeListSize - 1; i < end; ++i) + { + SystemCollectionsBaseIListFreeList[i] = (System::Collections::BaseIList*)(SystemCollectionsBaseIListFreeList + i + 1); + } + SystemCollectionsBaseIListFreeList[SystemCollectionsBaseIListFreeListSize - 1] = nullptr; + NextFreeSystemCollectionsBaseIList = SystemCollectionsBaseIListFreeList + 1; + Plugin::ReleaseSystemCollectionsBaseIList = releaseSystemCollectionsBaseIList; + Plugin::SystemCollectionsBaseIListConstructor = systemCollectionsBaseIListConstructor; + Plugin::SystemCollectionsQueuePropertyGetCount = systemCollectionsQueuePropertyGetCount; + SystemCollectionsBaseQueueFreeListSize = maxManagedObjects; + SystemCollectionsBaseQueueFreeList = new System::Collections::BaseQueue*[SystemCollectionsBaseQueueFreeListSize]; + for (int32_t i = 0, end = SystemCollectionsBaseQueueFreeListSize - 1; i < end; ++i) + { + SystemCollectionsBaseQueueFreeList[i] = (System::Collections::BaseQueue*)(SystemCollectionsBaseQueueFreeList + i + 1); + } + SystemCollectionsBaseQueueFreeList[SystemCollectionsBaseQueueFreeListSize - 1] = nullptr; + NextFreeSystemCollectionsBaseQueue = SystemCollectionsBaseQueueFreeList + 1; + Plugin::ReleaseSystemCollectionsBaseQueue = releaseSystemCollectionsBaseQueue; + Plugin::SystemCollectionsBaseQueueConstructor = systemCollectionsBaseQueueConstructor; + SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize = maxManagedObjects; + SystemComponentModelDesignBaseIComponentChangeServiceFreeList = new System::ComponentModel::Design::BaseIComponentChangeService*[SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize]; + for (int32_t i = 0, end = SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize - 1; i < end; ++i) + { + SystemComponentModelDesignBaseIComponentChangeServiceFreeList[i] = (System::ComponentModel::Design::BaseIComponentChangeService*)(SystemComponentModelDesignBaseIComponentChangeServiceFreeList + i + 1); + } + SystemComponentModelDesignBaseIComponentChangeServiceFreeList[SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize - 1] = nullptr; + NextFreeSystemComponentModelDesignBaseIComponentChangeService = SystemComponentModelDesignBaseIComponentChangeServiceFreeList + 1; + Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService = releaseSystemComponentModelDesignBaseIComponentChangeService; + Plugin::SystemComponentModelDesignBaseIComponentChangeServiceConstructor = systemComponentModelDesignBaseIComponentChangeServiceConstructor; Plugin::SystemIOFileStreamConstructorSystemString_SystemIOFileMode = systemIOFileStreamConstructorSystemString_SystemIOFileMode; + Plugin::SystemIOFileStreamMethodWriteByteSystemByte = systemIOFileStreamMethodWriteByteSystemByte; + SystemIOBaseFileStreamFreeListSize = maxManagedObjects; + SystemIOBaseFileStreamFreeList = new System::IO::BaseFileStream*[SystemIOBaseFileStreamFreeListSize]; + for (int32_t i = 0, end = SystemIOBaseFileStreamFreeListSize - 1; i < end; ++i) + { + SystemIOBaseFileStreamFreeList[i] = (System::IO::BaseFileStream*)(SystemIOBaseFileStreamFreeList + i + 1); + } + SystemIOBaseFileStreamFreeList[SystemIOBaseFileStreamFreeListSize - 1] = nullptr; + NextFreeSystemIOBaseFileStream = SystemIOBaseFileStreamFreeList + 1; + Plugin::ReleaseSystemIOBaseFileStream = releaseSystemIOBaseFileStream; + Plugin::SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode = systemIOBaseFileStreamConstructorSystemString_SystemIOFileMode; Plugin::BoxBoolean = boxBoolean; Plugin::UnboxBoolean = unboxBoolean; Plugin::BoxSByte = boxSByte; diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 5954582..b76735e 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -680,11 +680,49 @@ namespace System } } +namespace System +{ + namespace Collections + { + namespace Generic + { + template struct BaseIComparer; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct BaseIComparer; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct BaseIComparer; + } + } +} + namespace System { struct StringComparer; } +namespace System +{ + struct BaseStringComparer; +} + namespace System { namespace Collections @@ -693,6 +731,14 @@ namespace System } } +namespace System +{ + namespace Collections + { + struct BaseICollection; + } +} + namespace System { namespace Collections @@ -701,6 +747,14 @@ namespace System } } +namespace System +{ + namespace Collections + { + struct BaseIList; + } +} + namespace System { namespace Collections @@ -709,6 +763,14 @@ namespace System } } +namespace System +{ + namespace Collections + { + struct BaseQueue; + } +} + namespace System { namespace ComponentModel @@ -720,6 +782,17 @@ namespace System } } +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct BaseIComponentChangeService; + } + } +} + namespace System { namespace IO @@ -728,6 +801,14 @@ namespace System } } +namespace System +{ + namespace IO + { + struct BaseFileStream; + } +} + namespace MyGame { namespace MonoBehaviours @@ -1984,9 +2065,6 @@ namespace System IComparer& operator=(IComparer&& other); bool operator==(const IComparer& other) const; bool operator!=(const IComparer& other) const; - int32_t CppHandle; - IComparer(); - virtual int32_t Compare(int32_t x, int32_t y); }; } } @@ -2010,8 +2088,57 @@ namespace System IComparer& operator=(IComparer&& other); bool operator==(const IComparer& other) const; bool operator!=(const IComparer& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct BaseIComparer : System::Collections::Generic::IComparer + { + BaseIComparer(decltype(nullptr) n); + BaseIComparer(Plugin::InternalUse iu, int32_t handle); + BaseIComparer(const BaseIComparer& other); + BaseIComparer(BaseIComparer&& other); + virtual ~BaseIComparer(); + BaseIComparer& operator=(const BaseIComparer& other); + BaseIComparer& operator=(decltype(nullptr) other); + BaseIComparer& operator=(BaseIComparer&& other); + bool operator==(const BaseIComparer& other) const; + bool operator!=(const BaseIComparer& other) const; + int32_t CppHandle; + BaseIComparer(); + virtual int32_t Compare(int32_t x, int32_t y); + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct BaseIComparer : System::Collections::Generic::IComparer + { + BaseIComparer(decltype(nullptr) n); + BaseIComparer(Plugin::InternalUse iu, int32_t handle); + BaseIComparer(const BaseIComparer& other); + BaseIComparer(BaseIComparer&& other); + virtual ~BaseIComparer(); + BaseIComparer& operator=(const BaseIComparer& other); + BaseIComparer& operator=(decltype(nullptr) other); + BaseIComparer& operator=(BaseIComparer&& other); + bool operator==(const BaseIComparer& other) const; + bool operator!=(const BaseIComparer& other) const; int32_t CppHandle; - IComparer(); + BaseIComparer(); virtual int32_t Compare(System::String& x, System::String& y); }; } @@ -2032,8 +2159,25 @@ namespace System StringComparer& operator=(StringComparer&& other); bool operator==(const StringComparer& other) const; bool operator!=(const StringComparer& other) const; + }; +} + +namespace System +{ + struct BaseStringComparer : System::StringComparer + { + BaseStringComparer(decltype(nullptr) n); + BaseStringComparer(Plugin::InternalUse iu, int32_t handle); + BaseStringComparer(const BaseStringComparer& other); + BaseStringComparer(BaseStringComparer&& other); + virtual ~BaseStringComparer(); + BaseStringComparer& operator=(const BaseStringComparer& other); + BaseStringComparer& operator=(decltype(nullptr) other); + BaseStringComparer& operator=(BaseStringComparer&& other); + bool operator==(const BaseStringComparer& other) const; + bool operator!=(const BaseStringComparer& other) const; int32_t CppHandle; - StringComparer(); + BaseStringComparer(); virtual int32_t Compare(System::String& x, System::String& y); virtual System::Boolean Equals(System::String& x, System::String& y); virtual int32_t GetHashCode(System::String& obj); @@ -2056,8 +2200,28 @@ namespace System ICollection& operator=(ICollection&& other); bool operator==(const ICollection& other) const; bool operator!=(const ICollection& other) const; + }; + } +} + +namespace System +{ + namespace Collections + { + struct BaseICollection : System::Collections::ICollection + { + BaseICollection(decltype(nullptr) n); + BaseICollection(Plugin::InternalUse iu, int32_t handle); + BaseICollection(const BaseICollection& other); + BaseICollection(BaseICollection&& other); + virtual ~BaseICollection(); + BaseICollection& operator=(const BaseICollection& other); + BaseICollection& operator=(decltype(nullptr) other); + BaseICollection& operator=(BaseICollection&& other); + bool operator==(const BaseICollection& other) const; + bool operator!=(const BaseICollection& other) const; int32_t CppHandle; - ICollection(); + BaseICollection(); virtual void CopyTo(System::Array& array, int32_t index); virtual System::Collections::IEnumerator GetEnumerator(); virtual int32_t GetCount(); @@ -2083,8 +2247,28 @@ namespace System IList& operator=(IList&& other); bool operator==(const IList& other) const; bool operator!=(const IList& other) const; + }; + } +} + +namespace System +{ + namespace Collections + { + struct BaseIList : System::Collections::IList + { + BaseIList(decltype(nullptr) n); + BaseIList(Plugin::InternalUse iu, int32_t handle); + BaseIList(const BaseIList& other); + BaseIList(BaseIList&& other); + virtual ~BaseIList(); + BaseIList& operator=(const BaseIList& other); + BaseIList& operator=(decltype(nullptr) other); + BaseIList& operator=(BaseIList&& other); + bool operator==(const BaseIList& other) const; + bool operator!=(const BaseIList& other) const; int32_t CppHandle; - IList(); + BaseIList(); virtual int32_t Add(System::Object& value); virtual void Clear(); virtual System::Boolean Contains(System::Object& value); @@ -2121,8 +2305,29 @@ namespace System Queue& operator=(Queue&& other); bool operator==(const Queue& other) const; bool operator!=(const Queue& other) const; + int32_t GetCount(); + }; + } +} + +namespace System +{ + namespace Collections + { + struct BaseQueue : System::Collections::Queue + { + BaseQueue(decltype(nullptr) n); + BaseQueue(Plugin::InternalUse iu, int32_t handle); + BaseQueue(const BaseQueue& other); + BaseQueue(BaseQueue&& other); + virtual ~BaseQueue(); + BaseQueue& operator=(const BaseQueue& other); + BaseQueue& operator=(decltype(nullptr) other); + BaseQueue& operator=(BaseQueue&& other); + bool operator==(const BaseQueue& other) const; + bool operator!=(const BaseQueue& other) const; int32_t CppHandle; - Queue(); + BaseQueue(); virtual int32_t GetCount(); }; } @@ -2146,8 +2351,31 @@ namespace System IComponentChangeService& operator=(IComponentChangeService&& other); bool operator==(const IComponentChangeService& other) const; bool operator!=(const IComponentChangeService& other) const; + }; + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + struct BaseIComponentChangeService : System::ComponentModel::Design::IComponentChangeService + { + BaseIComponentChangeService(decltype(nullptr) n); + BaseIComponentChangeService(Plugin::InternalUse iu, int32_t handle); + BaseIComponentChangeService(const BaseIComponentChangeService& other); + BaseIComponentChangeService(BaseIComponentChangeService&& other); + virtual ~BaseIComponentChangeService(); + BaseIComponentChangeService& operator=(const BaseIComponentChangeService& other); + BaseIComponentChangeService& operator=(decltype(nullptr) other); + BaseIComponentChangeService& operator=(BaseIComponentChangeService&& other); + bool operator==(const BaseIComponentChangeService& other) const; + bool operator!=(const BaseIComponentChangeService& other) const; int32_t CppHandle; - IComponentChangeService(); + BaseIComponentChangeService(); virtual void OnComponentChanged(System::Object& component, System::ComponentModel::MemberDescriptor& member, System::Object& oldValue, System::Object& newValue); virtual void OnComponentChanging(System::Object& component, System::ComponentModel::MemberDescriptor& member); virtual void AddComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value); @@ -2185,8 +2413,30 @@ namespace System FileStream& operator=(FileStream&& other); bool operator==(const FileStream& other) const; bool operator!=(const FileStream& other) const; - int32_t CppHandle; FileStream(System::String& path, System::IO::FileMode mode); + void WriteByte(uint8_t value); + }; + } +} + +namespace System +{ + namespace IO + { + struct BaseFileStream : System::IO::FileStream + { + BaseFileStream(decltype(nullptr) n); + BaseFileStream(Plugin::InternalUse iu, int32_t handle); + BaseFileStream(const BaseFileStream& other); + BaseFileStream(BaseFileStream&& other); + virtual ~BaseFileStream(); + BaseFileStream& operator=(const BaseFileStream& other); + BaseFileStream& operator=(decltype(nullptr) other); + BaseFileStream& operator=(BaseFileStream&& other); + bool operator==(const BaseFileStream& other) const; + bool operator!=(const BaseFileStream& other) const; + int32_t CppHandle; + BaseFileStream(System::String& path, System::IO::FileMode mode); virtual void WriteByte(uint8_t value); }; } From 9aef59458f3a6431f6d39f26276e1fcacbaaec8c Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 16 Dec 2017 10:36:08 -0800 Subject: [PATCH 48/95] Split generic parameters in base types --- .../NativeScript/Editor/GenerateBindings.cs | 143 +++++++++--------- Unity/Assets/NativeScriptTypes.json | 37 ++--- Unity/CppSource/NativeScript/Bindings.h | 11 ++ 3 files changed, 97 insertions(+), 94 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index da95a3e..5733e12 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -98,7 +98,7 @@ class JsonType [Serializable] class JsonBaseType { - public JsonGenericParams[] GenericParams; + public string[] GenericTypes; public int MaxSimultaneous; public JsonConstructor[] Constructors; public JsonMethod[] OverrideMethods; @@ -521,10 +521,34 @@ static void DoPostCompileWork(bool canRefreshAssetDb) if (jsonType.BaseTypes != null) { + // C++ template declaration if necessary + Type type = GetType( + jsonType.Name, + assemblies); + Type[] genericArgTypes = type.GetGenericArguments(); + string cppBaseTypeName = "Base" + type.Name; + if (!IsStatic(type)) + { + foreach (JsonBaseType jsonBaseType in jsonType.BaseTypes) + { + if (jsonBaseType.GenericTypes != null) + { + AppendCppTemplateDeclaration( + cppBaseTypeName, + type.Namespace, + genericArgTypes.Length, + builders.CppTypeDeclarations); + } + } + } + foreach (JsonBaseType jsonBaseType in jsonType.BaseTypes) { AppendBaseType( + type, + genericArgTypes, jsonType.Name, + cppBaseTypeName, jsonBaseType, assemblies, builders); @@ -1628,56 +1652,38 @@ static void AppendType( } static void AppendBaseType( + Type type, + Type[] genericArgTypes, string typeName, + string cppBaseTypeName, JsonBaseType jsonBaseType, Assembly[] assemblies, StringBuilders builders) { - Type type = GetType(typeName, assemblies); - string cppTypeName = "Base" + type.Name; - Type[] genericArgTypes = type.GetGenericArguments(); - if (jsonBaseType.GenericParams != null) + int? maxSimultaneous = jsonBaseType.MaxSimultaneous != 0 + ? jsonBaseType.MaxSimultaneous + : default(int?); + if (jsonBaseType.GenericTypes != null) { - if (!IsStatic(type)) - { - AppendCppTemplateDeclaration( - cppTypeName, - type.Namespace, - genericArgTypes.Length, - builders.CppTypeDeclarations); - } - - foreach (JsonGenericParams jsonGenericParams - in jsonBaseType.GenericParams) - { - Type[] typeParams = GetTypes( - jsonGenericParams.Types, - assemblies); - Type genericType = type.MakeGenericType(typeParams); - int? maxSimultaneous = jsonGenericParams.MaxSimultaneous != 0 - ? jsonGenericParams.MaxSimultaneous - : jsonBaseType.MaxSimultaneous != 0 - ? jsonBaseType.MaxSimultaneous - : default(int?); - AppendBaseType( - genericType, - jsonBaseType, - cppTypeName, - typeParams, - maxSimultaneous, - assemblies, - builders); - } + Type[] typeParams = GetTypes( + jsonBaseType.GenericTypes, + assemblies); + Type genericType = type.MakeGenericType(typeParams); + AppendBaseType( + genericType, + jsonBaseType, + cppBaseTypeName, + typeParams, + maxSimultaneous, + assemblies, + builders); } else { - int? maxSimultaneous = jsonBaseType.MaxSimultaneous != 0 - ? jsonBaseType.MaxSimultaneous - : default(int?); AppendBaseType( type, jsonBaseType, - cppTypeName, + cppBaseTypeName, null, maxSimultaneous, assemblies, @@ -6381,7 +6387,7 @@ static void AppendDelegate( static void AppendBaseType( Type type, JsonBaseType jsonBaseType, - string cppTypeName, + string cppBaseTypeName, Type[] typeParams, int? maxSimultaneous, Assembly[] assemblies, @@ -6410,7 +6416,8 @@ static void AppendBaseType( builders.TempStrBuilder[0]); string releaseFuncNameLower = builders.TempStrBuilder.ToString(); - // Either use specified constructors or the default constructor + // Either use specified constructors, the default constructor, or + // nothing in the case of MonoBehaviour (where you can't call 'new') JsonConstructor[] jsonConstructors = jsonBaseType.Constructors; if (jsonConstructors == null) { @@ -6505,7 +6512,7 @@ static void AppendBaseType( // C++ type declaration int indent = AppendCppTypeDeclaration( type.Namespace, - cppTypeName, + cppBaseTypeName, false, typeParams, builders.CppTypeDeclarations); @@ -6524,21 +6531,21 @@ static void AppendBaseType( AppendCppFreeListStateAndFunctions( type, typeParams, - cppTypeName, + cppBaseTypeName, bindingTypeName, builders.CppGlobalStateAndFunctions); AppendCppFreeListInit( type, typeParams, - cppTypeName, + cppBaseTypeName, maxSimultaneous, bindingTypeName, builders.CppInitBody); // C++ type definition (begin) AppendCppTypeDefinitionBegin( - cppTypeName, + cppBaseTypeName, type.Namespace, TypeKind.Class, typeParams, @@ -6562,7 +6569,7 @@ static void AppendBaseType( indent + 1, builders.CppTypeDefinitions); AppendCppMethodDeclaration( - cppTypeName, + cppBaseTypeName, false, false, false, @@ -6658,7 +6665,7 @@ static void AppendBaseType( type.Name, type.Namespace, TypeKind.Class, - cppTypeName, + cppBaseTypeName, type, typeParams, typeParams, @@ -6672,7 +6679,7 @@ static void AppendBaseType( AppendCppBaseTypeNullptrConstructor( bindingTypeName, - cppTypeName, + cppBaseTypeName, typeParams, type.Name, type.Namespace, @@ -6683,7 +6690,7 @@ static void AppendBaseType( AppendCppBaseTypeCopyConstructor( bindingTypeName, - cppTypeName, + cppBaseTypeName, typeParams, type.Name, type.Namespace, @@ -6693,7 +6700,7 @@ static void AppendBaseType( builders.CppMethodDefinitions); AppendCppBaseTypeMoveConstructor( - cppTypeName, + cppBaseTypeName, typeParams, type.Name, type.Namespace, @@ -6704,7 +6711,7 @@ static void AppendBaseType( AppendCppBaseTypeHandleConstructor( bindingTypeName, - cppTypeName, + cppBaseTypeName, typeParams, type.Name, type.Namespace, @@ -6712,10 +6719,10 @@ static void AppendBaseType( false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - + AppendCppBaseTypeDestructor( bindingTypeName, - cppTypeName, + cppBaseTypeName, typeParams, false, releaseFuncName, @@ -6724,14 +6731,14 @@ static void AppendBaseType( AppendCppBaseTypeAssignmentOperatorSameType( type, - cppTypeName, + cppBaseTypeName, typeParams, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeAssignmentOperatorNullptr( - cppTypeName, + cppBaseTypeName, typeParams, false, releaseFuncName, @@ -6740,7 +6747,7 @@ static void AppendBaseType( AppendCppBaseTypeMoveAssignmentOperator( bindingTypeName, - cppTypeName, + cppBaseTypeName, typeParams, false, releaseFuncName, @@ -6748,13 +6755,13 @@ static void AppendBaseType( builders.CppMethodDefinitions); AppendCppBaseTypeEqualityOperator( - cppTypeName, + cppBaseTypeName, typeParams, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeInequalityOperator( - cppTypeName, + cppBaseTypeName, typeParams, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6855,7 +6862,7 @@ static void AppendBaseType( type, bindingTypeName, typeParams, - cppTypeName, + cppBaseTypeName, methodInfo, indent, builders); @@ -6876,7 +6883,7 @@ static void AppendBaseType( type, bindingTypeName, typeParams, - cppTypeName, + cppBaseTypeName, methodInfo, indent, builders); @@ -6902,7 +6909,7 @@ static void AppendBaseType( type, bindingTypeName, typeParams, - cppTypeName, + cppBaseTypeName, methodInfo, indent, builders); @@ -6922,7 +6929,7 @@ static void AppendBaseType( AppendBaseTypeProperty( type, bindingTypeName, - cppTypeName, + cppBaseTypeName, typeParams, propertyInfo, getMethodInfo, @@ -6949,7 +6956,7 @@ static void AppendBaseType( AppendBaseTypeProperty( type, bindingTypeName, - cppTypeName, + cppBaseTypeName, typeParams, propertyInfo, getMethodInfo, @@ -7009,7 +7016,7 @@ static void AppendBaseType( AppendBaseTypeProperty( type, bindingTypeName, - cppTypeName, + cppBaseTypeName, typeParams, propertyInfo, getMethodInfo, @@ -7032,7 +7039,7 @@ static void AppendBaseType( AppendBaseTypeEvent( type, bindingTypeName, - cppTypeName, + cppBaseTypeName, typeParams, eventInfo, addMethodInfo, @@ -7058,7 +7065,7 @@ static void AppendBaseType( AppendBaseTypeEvent( type, bindingTypeName, - cppTypeName, + cppBaseTypeName, typeParams, eventInfo, addMethodInfo, @@ -7118,7 +7125,7 @@ static void AppendBaseType( AppendBaseTypeEvent( type, bindingTypeName, - cppTypeName, + cppBaseTypeName, typeParams, eventInfo, addMethodInfo, @@ -8814,7 +8821,7 @@ static void AppendCppBaseTypeHandleConstructor( output); output.Append("\n"); } - + static void AppendCppBaseTypeMoveConstructor( string cppTypeName, Type[] typeParams, diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 56d156e..47aff03 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -629,18 +629,13 @@ ], "BaseTypes": [ { - "Name": "System.Collections.Generic.IComparer`1", - "GenericParams": [ - { - "Types": [ - "System.Int32" - ] - }, - { - "Types": [ - "System.String" - ] - } + "GenericTypes": [ + "System.Int32" + ] + }, + { + "GenericTypes": [ + "System.String" ] } ] @@ -648,25 +643,19 @@ { "Name": "System.StringComparer", "BaseTypes": [ - { - "Name": "System.StringComparer" - } + {} ] }, { "Name": "System.Collections.ICollection", "BaseTypes": [ - { - "Name": "System.Collections.ICollection" - } + {} ] }, { "Name": "System.Collections.IList", "BaseTypes": [ - { - "Name": "System.Collections.IList" - } + {} ] }, { @@ -680,7 +669,6 @@ ], "BaseTypes": [ { - "Name": "System.Collections.Queue", "OverrideProperties": [ { "Name": "Count", @@ -694,9 +682,7 @@ { "Name": "System.ComponentModel.Design.IComponentChangeService", "BaseTypes": [ - { - "Name": "System.ComponentModel.Design.IComponentChangeService" - } + {} ] }, { @@ -719,7 +705,6 @@ ], "BaseTypes": [ { - "Name": "System.IO.FileStream", "OverrideMethods": [ { "Name": "WriteByte", diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index b76735e..9049197 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -691,6 +691,17 @@ namespace System } } +namespace System +{ + namespace Collections + { + namespace Generic + { + template struct BaseIComparer; + } + } +} + namespace System { namespace Collections From 694e0817e330b68e7b291e57799d2dadc0f7d0df Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 16 Dec 2017 18:41:43 -0800 Subject: [PATCH 49/95] Support default parameters (except non-null strings and when there are var args) --- Unity/Assets/NativeScript/Bindings.cs | 886 ++++++++- .../NativeScript/Editor/GenerateBindings.cs | 253 ++- Unity/Assets/NativeScriptTypes.json | 67 + Unity/CppSource/NativeScript/Bindings.cpp | 1661 +++++++++++++++-- Unity/CppSource/NativeScript/Bindings.h | 351 +++- 5 files changed, 2939 insertions(+), 279 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index bbff41a..0f30704 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -307,6 +307,8 @@ delegate void InitDelegate( IntPtr unityEngineVector3Methodop_UnaryNegationUnityEngineVector3, IntPtr boxVector3, IntPtr unboxVector3, + IntPtr boxQuaternion, + IntPtr unboxQuaternion, IntPtr unityEngineMatrix4x4PropertyGetItem, IntPtr unityEngineMatrix4x4PropertySetItem, IntPtr boxMatrix4x4, @@ -342,6 +344,7 @@ delegate void InitDelegate( IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue, IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue, IntPtr systemExceptionConstructorSystemString, + IntPtr releaseUnityEngineResolution, IntPtr unityEngineResolutionPropertyGetWidth, IntPtr unityEngineResolutionPropertySetWidth, IntPtr unityEngineResolutionPropertyGetHeight, @@ -351,10 +354,11 @@ delegate void InitDelegate( IntPtr boxResolution, IntPtr unboxResolution, IntPtr unityEngineScreenPropertyGetResolutions, + IntPtr releaseUnityEngineRay, IntPtr unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3, IntPtr boxRay, IntPtr unboxRay, - IntPtr unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit, + IntPtr unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1, IntPtr unityEnginePhysicsMethodRaycastAllUnityEngineRay, IntPtr boxColor, IntPtr unboxColor, @@ -370,6 +374,7 @@ delegate void InitDelegate( IntPtr unityEngineApplicationRemoveEventOnBeforeRender, IntPtr unityEngineSceneManagementSceneManagerAddEventSceneLoaded, IntPtr unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded, + IntPtr releaseUnityEngineSceneManagementScene, IntPtr boxScene, IntPtr unboxScene, IntPtr boxLoadSceneMode, @@ -400,6 +405,26 @@ delegate void InitDelegate( IntPtr systemIOFileStreamMethodWriteByteSystemByte, IntPtr releaseSystemIOBaseFileStream, IntPtr systemIOBaseFileStreamConstructorSystemString_SystemIOFileMode, + IntPtr releaseUnityEnginePlayablesPlayableHandle, + IntPtr boxPlayableHandle, + IntPtr unboxPlayableHandle, + IntPtr releaseUnityEnginePlayablesPlayableGraph, + IntPtr boxPlayableGraph, + IntPtr unboxPlayableGraph, + IntPtr releaseUnityEngineAnimationsAnimationMixerPlayable, + IntPtr unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean, + IntPtr boxAnimationMixerPlayable, + IntPtr unboxAnimationMixerPlayable, + IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1, + IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString, + IntPtr boxInteractionSourcePositionAccuracy, + IntPtr unboxInteractionSourcePositionAccuracy, + IntPtr boxInteractionSourceNode, + IntPtr unboxInteractionSourceNode, + IntPtr releaseUnityEngineXRWSAInputInteractionSourcePose, + IntPtr unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode, + IntPtr boxInteractionSourcePose, + IntPtr unboxInteractionSourcePose, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -686,7 +711,7 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke public delegate void UnityEngineEventsUnityActionNativeInvokeDelegate(int thisHandle); public static UnityEngineEventsUnityActionNativeInvokeDelegate UnityEngineEventsUnityActionNativeInvoke; - public delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvokeDelegate(int thisHandle, UnityEngine.SceneManagement.Scene param0, UnityEngine.SceneManagement.LoadSceneMode param1); + public delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvokeDelegate(int thisHandle, int param0, UnityEngine.SceneManagement.LoadSceneMode param1); public static UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvokeDelegate UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke; public delegate void SystemComponentModelDesignComponentEventHandlerNativeInvokeDelegate(int thisHandle, int param0, int param1); @@ -835,6 +860,8 @@ static extern void Init( IntPtr unityEngineVector3Methodop_UnaryNegationUnityEngineVector3, IntPtr boxVector3, IntPtr unboxVector3, + IntPtr boxQuaternion, + IntPtr unboxQuaternion, IntPtr unityEngineMatrix4x4PropertyGetItem, IntPtr unityEngineMatrix4x4PropertySetItem, IntPtr boxMatrix4x4, @@ -870,6 +897,7 @@ static extern void Init( IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue, IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue, IntPtr systemExceptionConstructorSystemString, + IntPtr releaseUnityEngineResolution, IntPtr unityEngineResolutionPropertyGetWidth, IntPtr unityEngineResolutionPropertySetWidth, IntPtr unityEngineResolutionPropertyGetHeight, @@ -879,10 +907,11 @@ static extern void Init( IntPtr boxResolution, IntPtr unboxResolution, IntPtr unityEngineScreenPropertyGetResolutions, + IntPtr releaseUnityEngineRay, IntPtr unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3, IntPtr boxRay, IntPtr unboxRay, - IntPtr unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit, + IntPtr unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1, IntPtr unityEnginePhysicsMethodRaycastAllUnityEngineRay, IntPtr boxColor, IntPtr unboxColor, @@ -898,6 +927,7 @@ static extern void Init( IntPtr unityEngineApplicationRemoveEventOnBeforeRender, IntPtr unityEngineSceneManagementSceneManagerAddEventSceneLoaded, IntPtr unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded, + IntPtr releaseUnityEngineSceneManagementScene, IntPtr boxScene, IntPtr unboxScene, IntPtr boxLoadSceneMode, @@ -928,6 +958,26 @@ static extern void Init( IntPtr systemIOFileStreamMethodWriteByteSystemByte, IntPtr releaseSystemIOBaseFileStream, IntPtr systemIOBaseFileStreamConstructorSystemString_SystemIOFileMode, + IntPtr releaseUnityEnginePlayablesPlayableHandle, + IntPtr boxPlayableHandle, + IntPtr unboxPlayableHandle, + IntPtr releaseUnityEnginePlayablesPlayableGraph, + IntPtr boxPlayableGraph, + IntPtr unboxPlayableGraph, + IntPtr releaseUnityEngineAnimationsAnimationMixerPlayable, + IntPtr unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean, + IntPtr boxAnimationMixerPlayable, + IntPtr unboxAnimationMixerPlayable, + IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1, + IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString, + IntPtr boxInteractionSourcePositionAccuracy, + IntPtr unboxInteractionSourcePositionAccuracy, + IntPtr boxInteractionSourceNode, + IntPtr unboxInteractionSourceNode, + IntPtr releaseUnityEngineXRWSAInputInteractionSourcePose, + IntPtr unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode, + IntPtr boxInteractionSourcePose, + IntPtr unboxInteractionSourcePose, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -1216,7 +1266,7 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke public static extern void UnityEngineEventsUnityActionNativeInvoke(int thisHandle); [DllImport(Constants.PluginName)] - public static extern void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(int thisHandle, UnityEngine.SceneManagement.Scene param0, int param1); + public static extern void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(int thisHandle, int param0, int param1); [DllImport(Constants.PluginName)] public static extern void SystemComponentModelDesignComponentEventHandlerNativeInvoke(int thisHandle, int param0, int param1); @@ -1274,6 +1324,8 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate UnityEngine.Vector3 UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3Delegate(ref UnityEngine.Vector3 a); delegate int BoxVector3Delegate(ref UnityEngine.Vector3 val); delegate UnityEngine.Vector3 UnboxVector3Delegate(int valHandle); + delegate int BoxQuaternionDelegate(ref UnityEngine.Quaternion val); + delegate UnityEngine.Quaternion UnboxQuaternionDelegate(int valHandle); 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 int BoxMatrix4x4Delegate(ref UnityEngine.Matrix4x4 val); @@ -1309,20 +1361,22 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke 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 BoxResolutionDelegate(ref UnityEngine.Resolution val); - delegate UnityEngine.Resolution UnboxResolutionDelegate(int valHandle); + delegate void ReleaseUnityEngineResolutionDelegate(int handle); + delegate int UnityEngineResolutionPropertyGetWidthDelegate(int thisHandle); + delegate void UnityEngineResolutionPropertySetWidthDelegate(int thisHandle, int value); + delegate int UnityEngineResolutionPropertyGetHeightDelegate(int thisHandle); + delegate void UnityEngineResolutionPropertySetHeightDelegate(int thisHandle, int value); + delegate int UnityEngineResolutionPropertyGetRefreshRateDelegate(int thisHandle); + delegate void UnityEngineResolutionPropertySetRefreshRateDelegate(int thisHandle, int value); + delegate int BoxResolutionDelegate(int valHandle); + delegate int UnboxResolutionDelegate(int valHandle); delegate int UnityEngineScreenPropertyGetResolutionsDelegate(); - delegate UnityEngine.Ray UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction); - delegate int BoxRayDelegate(ref UnityEngine.Ray val); - delegate UnityEngine.Ray UnboxRayDelegate(int valHandle); - delegate int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitDelegate(ref UnityEngine.Ray ray, int resultsHandle); - delegate int UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate(ref UnityEngine.Ray ray); + delegate void ReleaseUnityEngineRayDelegate(int handle); + delegate int UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction); + delegate int BoxRayDelegate(int valHandle); + delegate int UnboxRayDelegate(int valHandle); + delegate int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1Delegate(int rayHandle, int resultsHandle); + delegate int UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate(int rayHandle); delegate int BoxColorDelegate(ref UnityEngine.Color val); delegate UnityEngine.Color UnboxColorDelegate(int valHandle); delegate int BoxGradientColorKeyDelegate(ref UnityEngine.GradientColorKey val); @@ -1337,8 +1391,9 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate void UnityEngineApplicationRemoveEventOnBeforeRenderDelegate(int delHandle); delegate void UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate(int delHandle); delegate void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate(int delHandle); - delegate int BoxSceneDelegate(ref UnityEngine.SceneManagement.Scene val); - delegate UnityEngine.SceneManagement.Scene UnboxSceneDelegate(int valHandle); + delegate void ReleaseUnityEngineSceneManagementSceneDelegate(int handle); + delegate int BoxSceneDelegate(int valHandle); + delegate int UnboxSceneDelegate(int valHandle); delegate int BoxLoadSceneModeDelegate(UnityEngine.SceneManagement.LoadSceneMode val); delegate UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneModeDelegate(int valHandle); delegate int SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(int thisHandle); @@ -1367,6 +1422,26 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate void SystemIOFileStreamMethodWriteByteSystemByteDelegate(int thisHandle, byte value); delegate void SystemIOBaseFileStreamConstructorSystemString_SystemIOFileModeDelegate(int cppHandle, ref int handle, int pathHandle, System.IO.FileMode mode); delegate void ReleaseSystemIOBaseFileStreamDelegate(int handle); + delegate void ReleaseUnityEnginePlayablesPlayableHandleDelegate(int handle); + delegate int BoxPlayableHandleDelegate(int valHandle); + delegate int UnboxPlayableHandleDelegate(int valHandle); + delegate void ReleaseUnityEnginePlayablesPlayableGraphDelegate(int handle); + delegate int BoxPlayableGraphDelegate(int valHandle); + delegate int UnboxPlayableGraphDelegate(int valHandle); + delegate void ReleaseUnityEngineAnimationsAnimationMixerPlayableDelegate(int handle); + delegate int UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBooleanDelegate(int graphHandle, int inputCount, bool normalizeWeights); + delegate int BoxAnimationMixerPlayableDelegate(int valHandle); + delegate int UnboxAnimationMixerPlayableDelegate(int valHandle); + delegate int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1Delegate(int eHandle, int nameHandle, int classesHandle); + delegate int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringDelegate(int eHandle, int nameHandle, int classNameHandle); + delegate int BoxInteractionSourcePositionAccuracyDelegate(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy val); + delegate UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy UnboxInteractionSourcePositionAccuracyDelegate(int valHandle); + delegate int BoxInteractionSourceNodeDelegate(UnityEngine.XR.WSA.Input.InteractionSourceNode val); + delegate UnityEngine.XR.WSA.Input.InteractionSourceNode UnboxInteractionSourceNodeDelegate(int valHandle); + delegate void ReleaseUnityEngineXRWSAInputInteractionSourcePoseDelegate(int handle); + delegate bool UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNodeDelegate(int thisHandle, out UnityEngine.Quaternion rotation, UnityEngine.XR.WSA.Input.InteractionSourceNode node); + delegate int BoxInteractionSourcePoseDelegate(int valHandle); + delegate int UnboxInteractionSourcePoseDelegate(int valHandle); delegate int BoxBooleanDelegate(bool val); delegate bool UnboxBooleanDelegate(int valHandle); delegate int BoxSByteDelegate(sbyte val); @@ -1409,8 +1484,8 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate int SystemStringArray1GetItem1Delegate(int thisHandle, int index0); delegate void SystemStringArray1SetItem1Delegate(int thisHandle, int index0, int itemHandle); delegate int UnityEngineUnityEngineResolutionArray1Constructor1Delegate(int length0); - delegate UnityEngine.Resolution UnityEngineResolutionArray1GetItem1Delegate(int thisHandle, int index0); - delegate void UnityEngineResolutionArray1SetItem1Delegate(int thisHandle, int index0, ref UnityEngine.Resolution item); + delegate int UnityEngineResolutionArray1GetItem1Delegate(int thisHandle, int index0); + delegate void UnityEngineResolutionArray1SetItem1Delegate(int thisHandle, int index0, int itemHandle); delegate int UnityEngineUnityEngineRaycastHitArray1Constructor1Delegate(int length0); delegate int UnityEngineRaycastHitArray1GetItem1Delegate(int thisHandle, int index0); delegate void UnityEngineRaycastHitArray1SetItem1Delegate(int thisHandle, int index0, int itemHandle); @@ -1452,7 +1527,7 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate void ReleaseUnityEngineEventsUnityActionDelegate(int handle, int classHandle); delegate void UnityEngineEventsUnityActionAddDelegate(int thisHandle, int delHandle); delegate void UnityEngineEventsUnityActionRemoveDelegate(int thisHandle, int delHandle); - delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate(int thisHandle, ref UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1); + delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate(int thisHandle, int arg0Handle, UnityEngine.SceneManagement.LoadSceneMode arg1); delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); delegate void ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeDelegate(int handle, int classHandle); delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAddDelegate(int thisHandle, int delHandle); @@ -1497,6 +1572,13 @@ public static void Open( /*BEGIN STRUCTSTORE INIT CALLS*/ NativeScript.Bindings.StructStore.Init(1000); NativeScript.Bindings.StructStore>.Init(maxManagedObjects); + NativeScript.Bindings.StructStore.Init(maxManagedObjects); + NativeScript.Bindings.StructStore.Init(maxManagedObjects); + NativeScript.Bindings.StructStore.Init(maxManagedObjects); + NativeScript.Bindings.StructStore.Init(maxManagedObjects); + NativeScript.Bindings.StructStore.Init(maxManagedObjects); + NativeScript.Bindings.StructStore.Init(maxManagedObjects); + NativeScript.Bindings.StructStore.Init(maxManagedObjects); /*END STRUCTSTORE INIT CALLS*/ #if UNITY_EDITOR @@ -1619,6 +1701,8 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3Delegate(UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3)), Marshal.GetFunctionPointerForDelegate(new BoxVector3Delegate(BoxVector3)), Marshal.GetFunctionPointerForDelegate(new UnboxVector3Delegate(UnboxVector3)), + Marshal.GetFunctionPointerForDelegate(new BoxQuaternionDelegate(BoxQuaternion)), + Marshal.GetFunctionPointerForDelegate(new UnboxQuaternionDelegate(UnboxQuaternion)), Marshal.GetFunctionPointerForDelegate(new UnityEngineMatrix4x4PropertyGetItemDelegate(UnityEngineMatrix4x4PropertyGetItem)), Marshal.GetFunctionPointerForDelegate(new UnityEngineMatrix4x4PropertySetItemDelegate(UnityEngineMatrix4x4PropertySetItem)), Marshal.GetFunctionPointerForDelegate(new BoxMatrix4x4Delegate(BoxMatrix4x4)), @@ -1654,6 +1738,7 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)), Marshal.GetFunctionPointerForDelegate(new SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)), Marshal.GetFunctionPointerForDelegate(new SystemExceptionConstructorSystemStringDelegate(SystemExceptionConstructorSystemString)), + Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineResolutionDelegate(ReleaseUnityEngineResolution)), Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertyGetWidthDelegate(UnityEngineResolutionPropertyGetWidth)), Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertySetWidthDelegate(UnityEngineResolutionPropertySetWidth)), Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertyGetHeightDelegate(UnityEngineResolutionPropertyGetHeight)), @@ -1663,10 +1748,11 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new BoxResolutionDelegate(BoxResolution)), Marshal.GetFunctionPointerForDelegate(new UnboxResolutionDelegate(UnboxResolution)), Marshal.GetFunctionPointerForDelegate(new UnityEngineScreenPropertyGetResolutionsDelegate(UnityEngineScreenPropertyGetResolutions)), + Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineRayDelegate(ReleaseUnityEngineRay)), Marshal.GetFunctionPointerForDelegate(new UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)), Marshal.GetFunctionPointerForDelegate(new BoxRayDelegate(BoxRay)), Marshal.GetFunctionPointerForDelegate(new UnboxRayDelegate(UnboxRay)), - Marshal.GetFunctionPointerForDelegate(new UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitDelegate(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)), + Marshal.GetFunctionPointerForDelegate(new UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1Delegate(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1)), Marshal.GetFunctionPointerForDelegate(new UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate(UnityEnginePhysicsMethodRaycastAllUnityEngineRay)), Marshal.GetFunctionPointerForDelegate(new BoxColorDelegate(BoxColor)), Marshal.GetFunctionPointerForDelegate(new UnboxColorDelegate(UnboxColor)), @@ -1682,6 +1768,7 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnityEngineApplicationRemoveEventOnBeforeRenderDelegate(UnityEngineApplicationRemoveEventOnBeforeRender)), Marshal.GetFunctionPointerForDelegate(new UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate(UnityEngineSceneManagementSceneManagerAddEventSceneLoaded)), Marshal.GetFunctionPointerForDelegate(new UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate(UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)), + Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineSceneManagementSceneDelegate(ReleaseUnityEngineSceneManagementScene)), Marshal.GetFunctionPointerForDelegate(new BoxSceneDelegate(BoxScene)), Marshal.GetFunctionPointerForDelegate(new UnboxSceneDelegate(UnboxScene)), Marshal.GetFunctionPointerForDelegate(new BoxLoadSceneModeDelegate(BoxLoadSceneMode)), @@ -1712,6 +1799,26 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new SystemIOFileStreamMethodWriteByteSystemByteDelegate(SystemIOFileStreamMethodWriteByteSystemByte)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemIOBaseFileStreamDelegate(ReleaseSystemIOBaseFileStream)), Marshal.GetFunctionPointerForDelegate(new SystemIOBaseFileStreamConstructorSystemString_SystemIOFileModeDelegate(SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode)), + Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEnginePlayablesPlayableHandleDelegate(ReleaseUnityEnginePlayablesPlayableHandle)), + Marshal.GetFunctionPointerForDelegate(new BoxPlayableHandleDelegate(BoxPlayableHandle)), + Marshal.GetFunctionPointerForDelegate(new UnboxPlayableHandleDelegate(UnboxPlayableHandle)), + Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEnginePlayablesPlayableGraphDelegate(ReleaseUnityEnginePlayablesPlayableGraph)), + Marshal.GetFunctionPointerForDelegate(new BoxPlayableGraphDelegate(BoxPlayableGraph)), + Marshal.GetFunctionPointerForDelegate(new UnboxPlayableGraphDelegate(UnboxPlayableGraph)), + Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineAnimationsAnimationMixerPlayableDelegate(ReleaseUnityEngineAnimationsAnimationMixerPlayable)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBooleanDelegate(UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)), + Marshal.GetFunctionPointerForDelegate(new BoxAnimationMixerPlayableDelegate(BoxAnimationMixerPlayable)), + Marshal.GetFunctionPointerForDelegate(new UnboxAnimationMixerPlayableDelegate(UnboxAnimationMixerPlayable)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1Delegate(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringDelegate(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString)), + Marshal.GetFunctionPointerForDelegate(new BoxInteractionSourcePositionAccuracyDelegate(BoxInteractionSourcePositionAccuracy)), + Marshal.GetFunctionPointerForDelegate(new UnboxInteractionSourcePositionAccuracyDelegate(UnboxInteractionSourcePositionAccuracy)), + Marshal.GetFunctionPointerForDelegate(new BoxInteractionSourceNodeDelegate(BoxInteractionSourceNode)), + Marshal.GetFunctionPointerForDelegate(new UnboxInteractionSourceNodeDelegate(UnboxInteractionSourceNode)), + Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineXRWSAInputInteractionSourcePoseDelegate(ReleaseUnityEngineXRWSAInputInteractionSourcePose)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNodeDelegate(UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode)), + Marshal.GetFunctionPointerForDelegate(new BoxInteractionSourcePoseDelegate(BoxInteractionSourcePose)), + Marshal.GetFunctionPointerForDelegate(new UnboxInteractionSourcePoseDelegate(UnboxInteractionSourcePose)), Marshal.GetFunctionPointerForDelegate(new BoxBooleanDelegate(BoxBoolean)), Marshal.GetFunctionPointerForDelegate(new UnboxBooleanDelegate(UnboxBoolean)), Marshal.GetFunctionPointerForDelegate(new BoxSByteDelegate(BoxSByte)), @@ -2969,7 +3076,8 @@ public void NativeInvoke(UnityEngine.SceneManagement.Scene arg0, UnityEngine.Sce if (CppHandle != 0) { int thisHandle = CppHandle; - NativeScript.Bindings.UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(thisHandle, arg0, arg1); + int arg0Handle = NativeScript.Bindings.StructStore.Store(arg0); + NativeScript.Bindings.UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(thisHandle, arg0Handle, arg1); if (NativeScript.Bindings.UnhandledCppException != null) { Exception ex = NativeScript.Bindings.UnhandledCppException; @@ -3618,11 +3726,15 @@ static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt3 { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + bufferLength = default(int); + numBuffers = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + bufferLength = default(int); + numBuffers = default(int); } } @@ -3640,11 +3752,17 @@ static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInf { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + addressHandle = default(int); + port = default(int); + error = default(byte); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + addressHandle = default(int); + port = default(int); + error = default(byte); } } @@ -3819,6 +3937,51 @@ static UnityEngine.Vector3 UnboxVector3(int valHandle) } } + [MonoPInvokeCallback(typeof(BoxQuaternionDelegate))] + static int BoxQuaternion(ref UnityEngine.Quaternion val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxQuaternionDelegate))] + static UnityEngine.Quaternion UnboxQuaternion(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Quaternion)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Quaternion); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Quaternion); + } + } + [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertyGetItemDelegate))] static float UnityEngineMatrix4x4PropertyGetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column) { @@ -4593,11 +4756,34 @@ static int SystemExceptionConstructorSystemString(int messageHandle) } } + [MonoPInvokeCallback(typeof(ReleaseUnityEngineResolutionDelegate))] + static void ReleaseUnityEngineResolution(int handle) + { + try + { + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetWidthDelegate))] - static int UnityEngineResolutionPropertyGetWidth(ref UnityEngine.Resolution thiz) + static int UnityEngineResolutionPropertyGetWidth(int thisHandle) { try { + var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); var returnValue = thiz.width; return returnValue; } @@ -4616,11 +4802,13 @@ static int UnityEngineResolutionPropertyGetWidth(ref UnityEngine.Resolution thiz } [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetWidthDelegate))] - static void UnityEngineResolutionPropertySetWidth(ref UnityEngine.Resolution thiz, int value) + static void UnityEngineResolutionPropertySetWidth(int thisHandle, int value) { try { + var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); thiz.width = value; + NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); } catch (System.NullReferenceException ex) { @@ -4635,10 +4823,11 @@ static void UnityEngineResolutionPropertySetWidth(ref UnityEngine.Resolution thi } [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetHeightDelegate))] - static int UnityEngineResolutionPropertyGetHeight(ref UnityEngine.Resolution thiz) + static int UnityEngineResolutionPropertyGetHeight(int thisHandle) { try { + var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); var returnValue = thiz.height; return returnValue; } @@ -4657,11 +4846,13 @@ static int UnityEngineResolutionPropertyGetHeight(ref UnityEngine.Resolution thi } [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetHeightDelegate))] - static void UnityEngineResolutionPropertySetHeight(ref UnityEngine.Resolution thiz, int value) + static void UnityEngineResolutionPropertySetHeight(int thisHandle, int value) { try { + var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); thiz.height = value; + NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); } catch (System.NullReferenceException ex) { @@ -4676,10 +4867,11 @@ static void UnityEngineResolutionPropertySetHeight(ref UnityEngine.Resolution th } [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetRefreshRateDelegate))] - static int UnityEngineResolutionPropertyGetRefreshRate(ref UnityEngine.Resolution thiz) + static int UnityEngineResolutionPropertyGetRefreshRate(int thisHandle) { try { + var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); var returnValue = thiz.refreshRate; return returnValue; } @@ -4698,11 +4890,13 @@ static int UnityEngineResolutionPropertyGetRefreshRate(ref UnityEngine.Resolutio } [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetRefreshRateDelegate))] - static void UnityEngineResolutionPropertySetRefreshRate(ref UnityEngine.Resolution thiz, int value) + static void UnityEngineResolutionPropertySetRefreshRate(int thisHandle, int value) { try { + var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); thiz.refreshRate = value; + NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); } catch (System.NullReferenceException ex) { @@ -4717,10 +4911,11 @@ static void UnityEngineResolutionPropertySetRefreshRate(ref UnityEngine.Resoluti } [MonoPInvokeCallback(typeof(BoxResolutionDelegate))] - static int BoxResolution(ref UnityEngine.Resolution val) + static int BoxResolution(int valHandle) { try { + var val = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(valHandle); var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } @@ -4739,25 +4934,25 @@ static int BoxResolution(ref UnityEngine.Resolution val) } [MonoPInvokeCallback(typeof(UnboxResolutionDelegate))] - static UnityEngine.Resolution UnboxResolution(int valHandle) + static int UnboxResolution(int valHandle) { try { var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Resolution)val; + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Resolution)val); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Resolution); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Resolution); + return default(int); } } @@ -4783,33 +4978,56 @@ static int UnityEngineScreenPropertyGetResolutions() } } + [MonoPInvokeCallback(typeof(ReleaseUnityEngineRayDelegate))] + static void ReleaseUnityEngineRay(int handle) + { + try + { + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + [MonoPInvokeCallback(typeof(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate))] - static UnityEngine.Ray UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction) + static int UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction) { try { - var returnValue = new UnityEngine.Ray(origin, direction); + var returnValue = NativeScript.Bindings.StructStore.Store(new UnityEngine.Ray(origin, direction)); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Ray); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Ray); + return default(int); } } [MonoPInvokeCallback(typeof(BoxRayDelegate))] - static int BoxRay(ref UnityEngine.Ray val) + static int BoxRay(int valHandle) { try { + var val = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(valHandle); var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } @@ -4828,33 +5046,34 @@ static int BoxRay(ref UnityEngine.Ray val) } [MonoPInvokeCallback(typeof(UnboxRayDelegate))] - static UnityEngine.Ray UnboxRay(int valHandle) + static int UnboxRay(int valHandle) { try { var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Ray)val; + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Ray)val); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Ray); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Ray); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitDelegate))] - static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit(ref UnityEngine.Ray ray, int resultsHandle) + [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1Delegate))] + static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1(int rayHandle, int resultsHandle) { try { + var ray = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(rayHandle); var results = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(resultsHandle); var returnValue = UnityEngine.Physics.RaycastNonAlloc(ray, results); return returnValue; @@ -4874,10 +5093,11 @@ static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRayc } [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate))] - static int UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ref UnityEngine.Ray ray) + static int UnityEnginePhysicsMethodRaycastAllUnityEngineRay(int rayHandle) { try { + var ray = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(rayHandle); var returnValue = UnityEngine.Physics.RaycastAll(ray); return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } @@ -5197,11 +5417,34 @@ static void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(int del } } + [MonoPInvokeCallback(typeof(ReleaseUnityEngineSceneManagementSceneDelegate))] + static void ReleaseUnityEngineSceneManagementScene(int handle) + { + try + { + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + [MonoPInvokeCallback(typeof(BoxSceneDelegate))] - static int BoxScene(ref UnityEngine.SceneManagement.Scene val) + static int BoxScene(int valHandle) { try { + var val = (UnityEngine.SceneManagement.Scene)NativeScript.Bindings.StructStore.Get(valHandle); var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } @@ -5220,25 +5463,25 @@ static int BoxScene(ref UnityEngine.SceneManagement.Scene val) } [MonoPInvokeCallback(typeof(UnboxSceneDelegate))] - static UnityEngine.SceneManagement.Scene UnboxScene(int valHandle) + static int UnboxScene(int valHandle) { try { var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.SceneManagement.Scene)val; + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.SceneManagement.Scene)val); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.SceneManagement.Scene); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.SceneManagement.Scene); + return default(int); } } @@ -5457,11 +5700,13 @@ static void SystemCollectionsGenericBaseIComparerSystemInt32Constructor(int cppH { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } } @@ -5496,11 +5741,13 @@ static void SystemCollectionsGenericBaseIComparerSystemStringConstructor(int cpp { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } } @@ -5535,11 +5782,13 @@ static void SystemBaseStringComparerConstructor(int cppHandle, ref int handle) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } } @@ -5574,11 +5823,13 @@ static void SystemCollectionsBaseICollectionConstructor(int cppHandle, ref int h { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } } @@ -5613,11 +5864,13 @@ static void SystemCollectionsBaseIListConstructor(int cppHandle, ref int handle) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } } @@ -5675,11 +5928,13 @@ static void SystemCollectionsBaseQueueConstructor(int cppHandle, ref int handle) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } } @@ -5714,11 +5969,13 @@ static void SystemComponentModelDesignBaseIComponentChangeServiceConstructor(int { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } } @@ -5797,11 +6054,13 @@ static void SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode(int c { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } } @@ -5824,6 +6083,467 @@ static void ReleaseSystemIOBaseFileStream(int handle) } } + [MonoPInvokeCallback(typeof(ReleaseUnityEnginePlayablesPlayableHandleDelegate))] + static void ReleaseUnityEnginePlayablesPlayableHandle(int handle) + { + try + { + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(BoxPlayableHandleDelegate))] + static int BoxPlayableHandle(int valHandle) + { + try + { + var val = (UnityEngine.Playables.PlayableHandle)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxPlayableHandleDelegate))] + static int UnboxPlayableHandle(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Playables.PlayableHandle)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(ReleaseUnityEnginePlayablesPlayableGraphDelegate))] + static void ReleaseUnityEnginePlayablesPlayableGraph(int handle) + { + try + { + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(BoxPlayableGraphDelegate))] + static int BoxPlayableGraph(int valHandle) + { + try + { + var val = (UnityEngine.Playables.PlayableGraph)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxPlayableGraphDelegate))] + static int UnboxPlayableGraph(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Playables.PlayableGraph)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(ReleaseUnityEngineAnimationsAnimationMixerPlayableDelegate))] + static void ReleaseUnityEngineAnimationsAnimationMixerPlayable(int handle) + { + try + { + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBooleanDelegate))] + static int UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean(int graphHandle, int inputCount, bool normalizeWeights) + { + try + { + var graph = (UnityEngine.Playables.PlayableGraph)NativeScript.Bindings.StructStore.Get(graphHandle); + var returnValue = UnityEngine.Animations.AnimationMixerPlayable.Create(graph, inputCount, normalizeWeights); + return NativeScript.Bindings.StructStore.Store(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(BoxAnimationMixerPlayableDelegate))] + static int BoxAnimationMixerPlayable(int valHandle) + { + try + { + var val = (UnityEngine.Animations.AnimationMixerPlayable)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxAnimationMixerPlayableDelegate))] + static int UnboxAnimationMixerPlayable(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Animations.AnimationMixerPlayable)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1Delegate))] + static int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1(int eHandle, int nameHandle, int classesHandle) + { + try + { + var e = (UnityEngine.Experimental.UIElements.VisualElement)NativeScript.Bindings.ObjectStore.Get(eHandle); + var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); + var classes = (string[])NativeScript.Bindings.ObjectStore.Get(classesHandle); + var returnValue = UnityEngine.Experimental.UIElements.UQueryExtensions.Q(e, name, classes); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringDelegate))] + static int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString(int eHandle, int nameHandle, int classNameHandle) + { + try + { + var e = (UnityEngine.Experimental.UIElements.VisualElement)NativeScript.Bindings.ObjectStore.Get(eHandle); + var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); + var className = (string)NativeScript.Bindings.ObjectStore.Get(classNameHandle); + var returnValue = UnityEngine.Experimental.UIElements.UQueryExtensions.Q(e, name, className); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(BoxInteractionSourcePositionAccuracyDelegate))] + static int BoxInteractionSourcePositionAccuracy(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxInteractionSourcePositionAccuracyDelegate))] + static UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy UnboxInteractionSourcePositionAccuracy(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy); + } + } + + [MonoPInvokeCallback(typeof(BoxInteractionSourceNodeDelegate))] + static int BoxInteractionSourceNode(UnityEngine.XR.WSA.Input.InteractionSourceNode val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxInteractionSourceNodeDelegate))] + static UnityEngine.XR.WSA.Input.InteractionSourceNode UnboxInteractionSourceNode(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.XR.WSA.Input.InteractionSourceNode)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.XR.WSA.Input.InteractionSourceNode); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.XR.WSA.Input.InteractionSourceNode); + } + } + + [MonoPInvokeCallback(typeof(ReleaseUnityEngineXRWSAInputInteractionSourcePoseDelegate))] + static void ReleaseUnityEngineXRWSAInputInteractionSourcePose(int handle) + { + try + { + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNodeDelegate))] + static bool UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode(int thisHandle, out UnityEngine.Quaternion rotation, UnityEngine.XR.WSA.Input.InteractionSourceNode node) + { + try + { + var thiz = (UnityEngine.XR.WSA.Input.InteractionSourcePose)NativeScript.Bindings.StructStore.Get(thisHandle); + var returnValue = thiz.TryGetRotation(out rotation, node); + NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + rotation = default(UnityEngine.Quaternion); + return default(bool); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + rotation = default(UnityEngine.Quaternion); + return default(bool); + } + } + + [MonoPInvokeCallback(typeof(BoxInteractionSourcePoseDelegate))] + static int BoxInteractionSourcePose(int valHandle) + { + try + { + var val = (UnityEngine.XR.WSA.Input.InteractionSourcePose)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxInteractionSourcePoseDelegate))] + static int UnboxInteractionSourcePose(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.XR.WSA.Input.InteractionSourcePose)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + [MonoPInvokeCallback(typeof(BoxBooleanDelegate))] static int BoxBoolean(bool val) { @@ -6759,34 +7479,35 @@ static int UnityEngineUnityEngineResolutionArray1Constructor1(int length0) } [MonoPInvokeCallback(typeof(UnityEngineResolutionArray1GetItem1Delegate))] - static UnityEngine.Resolution UnityEngineResolutionArray1GetItem1(int thisHandle, int index0) + static int UnityEngineResolutionArray1GetItem1(int thisHandle, int index0) { try { var thiz = (UnityEngine.Resolution[])NativeScript.Bindings.ObjectStore.Get(thisHandle); var returnValue = thiz[index0]; - return returnValue; + return NativeScript.Bindings.StructStore.Store(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Resolution); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Resolution); + return default(int); } } [MonoPInvokeCallback(typeof(UnityEngineResolutionArray1SetItem1Delegate))] - static void UnityEngineResolutionArray1SetItem1(int thisHandle, int index0, ref UnityEngine.Resolution item) + static void UnityEngineResolutionArray1SetItem1(int thisHandle, int index0, int itemHandle) { try { var thiz = (UnityEngine.Resolution[])NativeScript.Bindings.ObjectStore.Get(thisHandle); + var item = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(itemHandle); thiz[index0] = item; } catch (System.NullReferenceException ex) @@ -6963,11 +7684,15 @@ static void SystemActionConstructor(int cppHandle, ref int handle, ref int class { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } } @@ -7068,11 +7793,15 @@ static void SystemActionSystemSingleConstructor(int cppHandle, ref int handle, r { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } } @@ -7173,11 +7902,15 @@ static void SystemActionSystemSingle_SystemSingleConstructor(int cppHandle, ref { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } } @@ -7281,11 +8014,15 @@ static void SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(int cppHa { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } } @@ -7389,11 +8126,15 @@ static void SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(int cppHan { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } } @@ -7495,11 +8236,15 @@ static void SystemAppDomainInitializerConstructor(int cppHandle, ref int handle, { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } } @@ -7600,11 +8345,15 @@ static void UnityEngineEventsUnityActionConstructor(int cppHandle, ref int handl { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } } @@ -7675,10 +8424,11 @@ static void UnityEngineEventsUnityActionRemove(int thisHandle, int delHandle) } [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate))] - static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(int thisHandle, ref UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1) + static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(int thisHandle, int arg0Handle, UnityEngine.SceneManagement.LoadSceneMode arg1) { try { + var arg0 = (UnityEngine.SceneManagement.Scene)NativeScript.Bindings.StructStore.Get(arg0Handle); ((UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg0, arg1); } catch (System.NullReferenceException ex) @@ -7705,11 +8455,15 @@ static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEng { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } } @@ -7812,11 +8566,15 @@ static void SystemComponentModelDesignComponentEventHandlerConstructor(int cppHa { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } } @@ -7919,11 +8677,15 @@ static void SystemComponentModelDesignComponentChangingEventHandlerConstructor(i { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } } @@ -8026,11 +8788,15 @@ static void SystemComponentModelDesignComponentChangedEventHandlerConstructor(in { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } } @@ -8133,11 +8899,15 @@ static void SystemComponentModelDesignComponentRenameEventHandlerConstructor(int { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); + classHandle = default(int); } } diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 5733e12..e846bac 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -180,6 +180,8 @@ class StringBuilders new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppBoxingMethodDeclarations = new StringBuilder(InitialStringBuilderCapacity); + public readonly StringBuilder CppStringDefaultParams = + new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder TempStrBuilder = new StringBuilder(InitialStringBuilderCapacity); } @@ -193,6 +195,9 @@ class ParameterInfo public bool IsRef; public TypeKind Kind; public bool IsVirtual; + public bool HasDefault; + public object DefaultValue; + public bool IsVarArg; } enum TypeKind @@ -850,7 +855,8 @@ static MethodInfo GetMethod( Type type, MethodInfo[] methods, string methodName, - string[] paramTypeNames) + string[] paramTypeNames, + string[] genericTypeNames) { foreach (MethodInfo method in methods) { @@ -861,9 +867,17 @@ static MethodInfo GetMethod( } // All parameters must match - if (CheckParametersMatch( + if (!CheckParametersMatch( paramTypeNames, method.GetParameters())) + { + continue; + } + + // Generic arg count must match + Type[] methodGenericArgs = method.GetGenericArguments(); + int numGenericTypeNames = genericTypeNames == null ? 0 : genericTypeNames.Length; + if (methodGenericArgs.Length == numGenericTypeNames) { return method; } @@ -971,6 +985,11 @@ static void AppendParameterTypeNames( AppendTypeNameWithoutSuffixes( type.Name, output); + if (type.IsArray) + { + output.Append("Array"); + output.Append(type.GetArrayRank()); + } if (i != len - 1) { output.Append('_'); @@ -1049,7 +1068,8 @@ static ParameterInfo[] ConvertParameters( ParameterInfo[] parameters = new ParameterInfo[num]; for (int i = start; i < num; ++i) { - var reflectionInfo = reflectionParameters[i]; + System.Reflection.ParameterInfo reflectionInfo = + reflectionParameters[i]; ParameterInfo info = new ParameterInfo(); info.Name = reflectionInfo.Name; info.ParameterType = reflectionInfo.ParameterType; @@ -1059,6 +1079,13 @@ static ParameterInfo[] ConvertParameters( reflectionInfo); info.Kind = GetTypeKind( info.DereferencedParameterType); + info.HasDefault = (reflectionInfo.Attributes & + ParameterAttributes.HasDefault) == + ParameterAttributes.HasDefault; + info.DefaultValue = reflectionInfo.DefaultValue; + info.IsVarArg = reflectionInfo.IsDefined( + typeof(ParamArrayAttribute), + false); parameters[i - start] = info; } return parameters; @@ -1122,7 +1149,7 @@ static bool IsFullValueType(Type type) { return false; } - if (type.IsPrimitive || type.IsEnum) + if (type.IsPrimitive || type.IsEnum || type == typeof(void)) { return true; } @@ -1132,8 +1159,9 @@ static bool IsFullValueType(Type type) | BindingFlags.Public; foreach (FieldInfo field in type.GetFields(bindingFlags)) { - if (!field.IsStatic - && !IsFullValueType(field.FieldType)) + if (!field.IsPublic + || (!field.IsStatic + && !IsFullValueType(field.FieldType))) { return false; } @@ -1398,6 +1426,7 @@ static void AppendType( AppendCsharpFunctionEnd( typeof(void), new Type[0], + parameters, builders.CsharpFunctions); // C++ function pointer definition @@ -2850,6 +2879,7 @@ static void AppendEventAddRemoveMethod( AppendCsharpFunctionEnd( typeof(void), null, + methodParams, builders.CsharpFunctions); // C++ function pointer @@ -2936,7 +2966,8 @@ static MethodInfo GetMethod( Type enclosingType, Type[] typeTypeParams, Type[] genericArgTypes, - MethodInfo[] methods) + MethodInfo[] methods, + string[] methodGenericTypeNames) { // Map convenience method names to actual method names switch (jsonMethod.Name) @@ -3031,7 +3062,8 @@ static MethodInfo GetMethod( enclosingType, methods, jsonMethod.Name, - overriddenParamTypeNames); + overriddenParamTypeNames, + methodGenericTypeNames); } else { @@ -3039,7 +3071,8 @@ static MethodInfo GetMethod( enclosingType, methods, jsonMethod.Name, - jsonMethod.ParamTypes); + jsonMethod.ParamTypes, + methodGenericTypeNames); } } @@ -3055,13 +3088,6 @@ static void AppendMethod( int indent, StringBuilders builders) { - MethodInfo method = GetMethod( - jsonMethod, - enclosingType, - typeTypeParams, - genericArgTypes, - methods); - Type[] exceptionTypes = GetTypes( jsonMethod.Exceptions, assemblies); @@ -3073,6 +3099,13 @@ static void AppendMethod( foreach (JsonGenericParams jsonGenericParams in jsonMethod.GenericParams) { + MethodInfo method = GetMethod( + jsonMethod, + enclosingType, + typeTypeParams, + genericArgTypes, + methods, + jsonGenericParams.Types); Type[] methodTypeParams = GetTypes( jsonGenericParams.Types, assemblies); @@ -3102,6 +3135,13 @@ static void AppendMethod( } else { + MethodInfo method = GetMethod( + jsonMethod, + enclosingType, + typeTypeParams, + genericArgTypes, + methods, + null); ParameterInfo[] parameters = ConvertParameters( method.GetParameters()); Type returnType = method.ReturnType; @@ -3386,6 +3426,7 @@ static void AppendMethod( } builders.CsharpFunctions.Append(';'); if (!isReadOnly + && !methodIsStatic && enclosingTypeKind == TypeKind.ManagedStruct) { AppendStructStoreReplace( @@ -6899,20 +6940,46 @@ static void AppendBaseType( Type[] genericArgTypes = type.GetGenericArguments(); foreach (JsonMethod jsonMethod in jsonBaseType.OverrideMethods) { - MethodInfo methodInfo = GetMethod( - jsonMethod, - type, - typeParams, - genericArgTypes, - methods); - AppendBaseTypeNativeMethod( - type, - bindingTypeName, - typeParams, - cppBaseTypeName, - methodInfo, - indent, - builders); + if (jsonMethod.GenericParams != null) + { + foreach (JsonGenericParams jsonGenericParams in + jsonMethod.GenericParams) + { + MethodInfo methodInfo = GetMethod( + jsonMethod, + type, + typeParams, + genericArgTypes, + methods, + jsonGenericParams.Types); + AppendBaseTypeNativeMethod( + type, + bindingTypeName, + typeParams, + cppBaseTypeName, + methodInfo, + indent, + builders); + } + } + else + { + MethodInfo methodInfo = GetMethod( + jsonMethod, + type, + typeParams, + genericArgTypes, + methods, + null); + AppendBaseTypeNativeMethod( + type, + bindingTypeName, + typeParams, + cppBaseTypeName, + methodInfo, + indent, + builders); + } } } @@ -9876,6 +9943,7 @@ static void AppendGetter( } builders.CsharpFunctions.Append(';'); if (!isReadOnly + && !methodIsStatic && enclosingTypeKind == TypeKind.ManagedStruct) { AppendStructStoreReplace( @@ -10069,6 +10137,7 @@ static void AppendSetter( } builders.CsharpFunctions.Append(';'); if (!isReadOnly + && !methodIsStatic && enclosingTypeKind == TypeKind.ManagedStruct) { AppendStructStoreReplace( @@ -11356,12 +11425,14 @@ static void AppendCsharpFunctionReturn( AppendCsharpFunctionEnd( returnType, exceptionTypes, + parameters, output); } static void AppendCsharpFunctionEnd( Type returnType, Type[] exceptionTypes, + ParameterInfo[] parameters, StringBuilder output) { output.Append('\n'); @@ -11374,6 +11445,7 @@ static void AppendCsharpFunctionEnd( AppendCsharpCatchException( typeof(NullReferenceException), returnType, + parameters, output); } if (exceptionTypes != null) @@ -11383,12 +11455,14 @@ static void AppendCsharpFunctionEnd( AppendCsharpCatchException( exceptionType, returnType, + parameters, output); } } AppendCsharpCatchException( typeof(Exception), returnType, + parameters, output); output.Append("\t\t}\n"); output.Append("\t\t\n"); @@ -11397,6 +11471,7 @@ static void AppendCsharpFunctionEnd( static void AppendCsharpCatchException( Type exceptionType, Type returnType, + ParameterInfo[] parameters, StringBuilder output) { output.Append("\t\t\tcatch ("); @@ -11411,6 +11486,27 @@ static void AppendCsharpCatchException( exceptionType, output); output.Append("(NativeScript.Bindings.ObjectStore.Store(ex));\n"); + foreach (ParameterInfo param in parameters) + { + if (param.IsOut) + { + output.Append("\t\t\t\t"); + output.Append(param.Name); + if (param.Kind == TypeKind.Class + || param.Kind == TypeKind.ManagedStruct) + { + output.Append("Handle = default(int);\n"); + } + else + { + output.Append(" = default("); + AppendCsharpTypeName( + param.DereferencedParameterType, + output); + output.Append(");\n"); + } + } + } if (returnType != typeof(void)) { output.Append("\t\t\t\treturn default("); @@ -11515,8 +11611,11 @@ static void AppendCppParameterDeclaration( ParameterInfo[] parameters, Type[] typeTypeParameters, Type[] methodTypeParameters, + bool includeDefaults, StringBuilder output) { + bool hasVarArgs = parameters.Length > 0 && + parameters[parameters.Length-1].IsVarArg; for (int i = 0; i < parameters.Length; ++i) { ParameterInfo param = parameters[i]; @@ -11555,12 +11654,92 @@ static void AppendCppParameterDeclaration( output.Append(' '); output.Append(param.Name); + // Default if desired, present, and the method has no var args + if (includeDefaults && param.HasDefault && !hasVarArgs) + { + output.Append(" = "); + if (param.DereferencedParameterType == typeof(string)) + { + if (param.DefaultValue != null) + { + throw new Exception( + "Non-null string default parameters aren't supported"); + } + output.Append("Plugin::NullString"); + } + else if (object.ReferenceEquals(param.DefaultValue, null)) + { + output.Append("nullptr"); + } + else + { + if ((param.DefaultValue is sbyte) || + (param.DefaultValue is byte) || + (param.DefaultValue is short) || + (param.DefaultValue is ushort) || + (param.DefaultValue is int) || + (param.DefaultValue is uint) || + (param.DefaultValue is long) || + (param.DefaultValue is ulong)) + { + output.Append(param.DefaultValue); + } + else if (param.DefaultValue is bool) + { + bool val = (bool)param.DefaultValue; + output.Append(val ? "true" : "false"); + } + else if (param.DefaultValue is char) + { + char val = (char)param.DefaultValue; + output.Append('\''); + output.Append(val); + output.Append('\''); + } + else + { + Type type = param.DefaultValue.GetType(); + if (type.IsEnum) + { + AppendCppTypeName( + type, + output); + output.Append("::"); + output.Append(param.DefaultValue); + } + else + { + StringBuilder error = new StringBuilder(); + error.Append("Default parameter type ("); + AppendCsharpTypeName( + param.DefaultValue.GetType(), + error); + error.Append(") not supported"); + throw new Exception(error.ToString()); + } + } + } + } + if (i != parameters.Length - 1) { output.Append(", "); } } } + + static void AppendDefaultStringParamName( + string str, + StringBuilder output) + { + foreach (char c in str) + { + if (char.IsLetterOrDigit(c)) + { + output.Append(c); + } + } + } static void AppendCppInitBody( string globalVariableName, @@ -11629,6 +11808,7 @@ static void AppendCppMethodDefinitionBegin( parameters, null, // don't substitute type type params null, // don't substitute method type params + false, output); output.Append(")\n"); } @@ -12019,6 +12199,7 @@ static void AppendCppMethodDeclaration( parameters, typeTypeParameters, methodTypeParameters, + true, output); output.Append(')'); @@ -12172,6 +12353,10 @@ static void AppendCppTypeName( { output.Append("System::String"); } + else if (type == typeof(IntPtr)) + { + output.Append("void*"); + } else if (type.IsArray) { int rank = type.GetArrayRank(); @@ -12253,6 +12438,7 @@ static void RemoveTrailingChars( RemoveTrailingChars(builders.CppMonoBehaviourMessages); RemoveTrailingChars(builders.CppGlobalStateAndFunctions); RemoveTrailingChars(builders.CppBoxingMethodDeclarations); + RemoveTrailingChars(builders.CppStringDefaultParams); } // Remove trailing chars (e.g. commas) for last elements @@ -12380,9 +12566,14 @@ static void InjectBuilders( builders.CppGlobalStateAndFunctions.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "*BEGIN BOXING METHOD DECLARATIONS*/\n", + "/*BEGIN BOXING METHOD DECLARATIONS*/\n", "\n\t\t/*END BOXING METHOD DECLARATIONS*/", builders.CppBoxingMethodDeclarations.ToString()); + cppHeaderContents = InjectIntoString( + cppHeaderContents, + "/*BEGIN STRING DEFAULT PARAMETERS*/\n", + "\n\t/*END STRING DEFAULT PARAMETERS*/", + builders.CppStringDefaultParams.ToString()); File.WriteAllText(CsharpPath, csharpContents); File.WriteAllText(CppHeaderPath, cppHeaderContents); diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 47aff03..7c09fbb 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -250,6 +250,9 @@ } ] }, + { + "Name": "UnityEngine.Quaternion" + }, { "Name": "UnityEngine.Matrix4x4", "Properties": [ @@ -723,6 +726,70 @@ ] } ] + }, + { + "Name": "UnityEngine.Playables.PlayableHandle" + }, + { + "Name": "UnityEngine.Playables.PlayableGraph" + }, + { + "Name": "UnityEngine.Animations.AnimationMixerPlayable", + "Methods": [ + { + "Name": "Create", + "ParamTypes": [ + "UnityEngine.Playables.PlayableGraph", + "System.Int32", + "System.Boolean" + ] + } + ] + }, + { + "Name": "UnityEngine.Experimental.UIElements.CallbackEventHandler" + }, + { + "Name": "UnityEngine.Experimental.UIElements.VisualElement" + }, + { + "Name": "UnityEngine.Experimental.UIElements.UQueryExtensions", + "Methods": [ + { + "Name": "Q", + "ParamTypes": [ + "UnityEngine.Experimental.UIElements.VisualElement", + "System.String", + "System.String[]" + ] + }, + { + "Name": "Q", + "ParamTypes": [ + "UnityEngine.Experimental.UIElements.VisualElement", + "System.String", + "System.String" + ] + } + ] + }, + { + "Name": "UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy" + }, + { + "Name": "UnityEngine.XR.WSA.Input.InteractionSourceNode" + }, + { + "Name": "UnityEngine.XR.WSA.Input.InteractionSourcePose", + "Methods": [ + { + "Name": "TryGetRotation", + "ParamTypes": [ + "UnityEngine.Quaternion", + "UnityEngine.XR.WSA.Input.InteractionSourceNode" + ] + } + ] } ], "MonoBehaviours": [ diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 2f9c286..e2ce580 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -28,6 +28,15 @@ #define DLLEXPORT extern "C" #endif +//////////////////////////////////////////////////////////////// +// Global variables +//////////////////////////////////////////////////////////////// + +namespace Plugin +{ + System::String NullString(nullptr); +} + //////////////////////////////////////////////////////////////// // C# functions for C++ to call //////////////////////////////////////////////////////////////// @@ -73,6 +82,8 @@ namespace Plugin UnityEngine::Vector3 (*UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a); int32_t (*BoxVector3)(UnityEngine::Vector3& val); UnityEngine::Vector3 (*UnboxVector3)(int32_t valHandle); + int32_t (*BoxQuaternion)(UnityEngine::Quaternion& val); + UnityEngine::Quaternion (*UnboxQuaternion)(int32_t valHandle); float (*UnityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column); void (*UnityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value); int32_t (*BoxMatrix4x4)(UnityEngine::Matrix4x4& val); @@ -108,20 +119,22 @@ namespace Plugin int32_t (*SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)(int32_t thisHandle); void (*SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)(int32_t thisHandle, int32_t valueHandle); int32_t (*SystemExceptionConstructorSystemString)(int32_t messageHandle); - int32_t (*UnityEngineResolutionPropertyGetWidth)(UnityEngine::Resolution* thiz); - void (*UnityEngineResolutionPropertySetWidth)(UnityEngine::Resolution* thiz, int32_t value); - int32_t (*UnityEngineResolutionPropertyGetHeight)(UnityEngine::Resolution* thiz); - void (*UnityEngineResolutionPropertySetHeight)(UnityEngine::Resolution* thiz, int32_t value); - int32_t (*UnityEngineResolutionPropertyGetRefreshRate)(UnityEngine::Resolution* thiz); - void (*UnityEngineResolutionPropertySetRefreshRate)(UnityEngine::Resolution* thiz, int32_t value); - int32_t (*BoxResolution)(UnityEngine::Resolution& val); - UnityEngine::Resolution (*UnboxResolution)(int32_t valHandle); + void (*ReleaseUnityEngineResolution)(int32_t handle); + int32_t (*UnityEngineResolutionPropertyGetWidth)(int32_t thisHandle); + void (*UnityEngineResolutionPropertySetWidth)(int32_t thisHandle, int32_t value); + int32_t (*UnityEngineResolutionPropertyGetHeight)(int32_t thisHandle); + void (*UnityEngineResolutionPropertySetHeight)(int32_t thisHandle, int32_t value); + int32_t (*UnityEngineResolutionPropertyGetRefreshRate)(int32_t thisHandle); + void (*UnityEngineResolutionPropertySetRefreshRate)(int32_t thisHandle, int32_t value); + int32_t (*BoxResolution)(int32_t valHandle); + int32_t (*UnboxResolution)(int32_t valHandle); int32_t (*UnityEngineScreenPropertyGetResolutions)(); - UnityEngine::Ray (*UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); - int32_t (*BoxRay)(UnityEngine::Ray& val); - UnityEngine::Ray (*UnboxRay)(int32_t valHandle); - int32_t (*UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)(UnityEngine::Ray& ray, int32_t resultsHandle); - int32_t (*UnityEnginePhysicsMethodRaycastAllUnityEngineRay)(UnityEngine::Ray& ray); + void (*ReleaseUnityEngineRay)(int32_t handle); + int32_t (*UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); + int32_t (*BoxRay)(int32_t valHandle); + int32_t (*UnboxRay)(int32_t valHandle); + int32_t (*UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1)(int32_t rayHandle, int32_t resultsHandle); + int32_t (*UnityEnginePhysicsMethodRaycastAllUnityEngineRay)(int32_t rayHandle); int32_t (*BoxColor)(UnityEngine::Color& val); UnityEngine::Color (*UnboxColor)(int32_t valHandle); int32_t (*BoxGradientColorKey)(UnityEngine::GradientColorKey& val); @@ -136,8 +149,9 @@ namespace Plugin void (*UnityEngineApplicationRemoveEventOnBeforeRender)(int32_t delHandle); void (*UnityEngineSceneManagementSceneManagerAddEventSceneLoaded)(int32_t delHandle); void (*UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)(int32_t delHandle); - int32_t (*BoxScene)(UnityEngine::SceneManagement::Scene& val); - UnityEngine::SceneManagement::Scene (*UnboxScene)(int32_t valHandle); + void (*ReleaseUnityEngineSceneManagementScene)(int32_t handle); + int32_t (*BoxScene)(int32_t valHandle); + int32_t (*UnboxScene)(int32_t valHandle); int32_t (*BoxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val); UnityEngine::SceneManagement::LoadSceneMode (*UnboxLoadSceneMode)(int32_t valHandle); int32_t (*SystemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle); @@ -166,6 +180,26 @@ namespace Plugin void (*SystemIOFileStreamMethodWriteByteSystemByte)(int32_t thisHandle, uint8_t value); void (*ReleaseSystemIOBaseFileStream)(int32_t handle); void (*SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode)(int32_t cppHandle, int32_t* handle, int32_t pathHandle, System::IO::FileMode mode); + void (*ReleaseUnityEnginePlayablesPlayableHandle)(int32_t handle); + int32_t (*BoxPlayableHandle)(int32_t valHandle); + int32_t (*UnboxPlayableHandle)(int32_t valHandle); + void (*ReleaseUnityEnginePlayablesPlayableGraph)(int32_t handle); + int32_t (*BoxPlayableGraph)(int32_t valHandle); + int32_t (*UnboxPlayableGraph)(int32_t valHandle); + void (*ReleaseUnityEngineAnimationsAnimationMixerPlayable)(int32_t handle); + int32_t (*UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)(int32_t graphHandle, int32_t inputCount, System::Boolean normalizeWeights); + int32_t (*BoxAnimationMixerPlayable)(int32_t valHandle); + int32_t (*UnboxAnimationMixerPlayable)(int32_t valHandle); + int32_t (*UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1)(int32_t eHandle, int32_t nameHandle, int32_t classesHandle); + int32_t (*UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString)(int32_t eHandle, int32_t nameHandle, int32_t classNameHandle); + int32_t (*BoxInteractionSourcePositionAccuracy)(UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy val); + UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy (*UnboxInteractionSourcePositionAccuracy)(int32_t valHandle); + int32_t (*BoxInteractionSourceNode)(UnityEngine::XR::WSA::Input::InteractionSourceNode val); + UnityEngine::XR::WSA::Input::InteractionSourceNode (*UnboxInteractionSourceNode)(int32_t valHandle); + void (*ReleaseUnityEngineXRWSAInputInteractionSourcePose)(int32_t handle); + System::Boolean (*UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode)(int32_t thisHandle, UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node); + int32_t (*BoxInteractionSourcePose)(int32_t valHandle); + int32_t (*UnboxInteractionSourcePose)(int32_t valHandle); int32_t (*BoxBoolean)(System::Boolean val); System::Boolean (*UnboxBoolean)(int32_t valHandle); int32_t (*BoxSByte)(int8_t val); @@ -208,8 +242,8 @@ namespace Plugin int32_t (*SystemStringArray1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*SystemStringArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle); int32_t (*UnityEngineUnityEngineResolutionArray1Constructor1)(int32_t length0); - UnityEngine::Resolution (*UnityEngineResolutionArray1GetItem1)(int32_t thisHandle, int32_t index0); - int32_t (*UnityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::Resolution& item); + int32_t (*UnityEngineResolutionArray1GetItem1)(int32_t thisHandle, int32_t index0); + int32_t (*UnityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle); int32_t (*UnityEngineUnityEngineRaycastHitArray1Constructor1)(int32_t length0); int32_t (*UnityEngineRaycastHitArray1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*UnityEngineRaycastHitArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle); @@ -255,7 +289,7 @@ namespace Plugin void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)(int32_t thisHandle, int32_t delHandle); void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle); - void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); + void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, int32_t arg0Handle, UnityEngine::SceneManagement::LoadSceneMode arg1); void (*ReleaseSystemComponentModelDesignComponentEventHandler)(int32_t handle, int32_t classHandle); void (*SystemComponentModelDesignComponentEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); void (*SystemComponentModelDesignComponentEventHandlerAdd)(int32_t thisHandle, int32_t delHandle); @@ -375,6 +409,81 @@ namespace Plugin } } + int32_t RefCountsLenUnityEngineResolution; + int32_t* RefCountsUnityEngineResolution; + + void ReferenceManagedUnityEngineResolution(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineResolution); + if (handle != 0) + { + RefCountsUnityEngineResolution[handle]++; + } + } + + void DereferenceManagedUnityEngineResolution(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineResolution); + if (handle != 0) + { + int32_t numRemain = --RefCountsUnityEngineResolution[handle]; + if (numRemain == 0) + { + ReleaseUnityEngineResolution(handle); + } + } + } + + int32_t RefCountsLenUnityEngineRay; + int32_t* RefCountsUnityEngineRay; + + void ReferenceManagedUnityEngineRay(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineRay); + if (handle != 0) + { + RefCountsUnityEngineRay[handle]++; + } + } + + void DereferenceManagedUnityEngineRay(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineRay); + if (handle != 0) + { + int32_t numRemain = --RefCountsUnityEngineRay[handle]; + if (numRemain == 0) + { + ReleaseUnityEngineRay(handle); + } + } + } + + int32_t RefCountsLenUnityEngineSceneManagementScene; + int32_t* RefCountsUnityEngineSceneManagementScene; + + void ReferenceManagedUnityEngineSceneManagementScene(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineSceneManagementScene); + if (handle != 0) + { + RefCountsUnityEngineSceneManagementScene[handle]++; + } + } + + void DereferenceManagedUnityEngineSceneManagementScene(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineSceneManagementScene); + if (handle != 0) + { + int32_t numRemain = --RefCountsUnityEngineSceneManagementScene[handle]; + if (numRemain == 0) + { + ReleaseUnityEngineSceneManagementScene(handle); + } + } + } + int32_t SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize; System::Collections::Generic::BaseIComparer** SystemCollectionsGenericBaseIComparerSystemInt32FreeList; System::Collections::Generic::BaseIComparer** NextFreeSystemCollectionsGenericBaseIComparerSystemInt32; @@ -575,6 +684,106 @@ namespace Plugin *pRelease = (System::IO::BaseFileStream*)NextFreeSystemIOBaseFileStream; NextFreeSystemIOBaseFileStream = pRelease; } + int32_t RefCountsLenUnityEnginePlayablesPlayableHandle; + int32_t* RefCountsUnityEnginePlayablesPlayableHandle; + + void ReferenceManagedUnityEnginePlayablesPlayableHandle(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableHandle); + if (handle != 0) + { + RefCountsUnityEnginePlayablesPlayableHandle[handle]++; + } + } + + void DereferenceManagedUnityEnginePlayablesPlayableHandle(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableHandle); + if (handle != 0) + { + int32_t numRemain = --RefCountsUnityEnginePlayablesPlayableHandle[handle]; + if (numRemain == 0) + { + ReleaseUnityEnginePlayablesPlayableHandle(handle); + } + } + } + + int32_t RefCountsLenUnityEnginePlayablesPlayableGraph; + int32_t* RefCountsUnityEnginePlayablesPlayableGraph; + + void ReferenceManagedUnityEnginePlayablesPlayableGraph(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableGraph); + if (handle != 0) + { + RefCountsUnityEnginePlayablesPlayableGraph[handle]++; + } + } + + void DereferenceManagedUnityEnginePlayablesPlayableGraph(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableGraph); + if (handle != 0) + { + int32_t numRemain = --RefCountsUnityEnginePlayablesPlayableGraph[handle]; + if (numRemain == 0) + { + ReleaseUnityEnginePlayablesPlayableGraph(handle); + } + } + } + + int32_t RefCountsLenUnityEngineAnimationsAnimationMixerPlayable; + int32_t* RefCountsUnityEngineAnimationsAnimationMixerPlayable; + + void ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineAnimationsAnimationMixerPlayable); + if (handle != 0) + { + RefCountsUnityEngineAnimationsAnimationMixerPlayable[handle]++; + } + } + + void DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineAnimationsAnimationMixerPlayable); + if (handle != 0) + { + int32_t numRemain = --RefCountsUnityEngineAnimationsAnimationMixerPlayable[handle]; + if (numRemain == 0) + { + ReleaseUnityEngineAnimationsAnimationMixerPlayable(handle); + } + } + } + + int32_t RefCountsLenUnityEngineXRWSAInputInteractionSourcePose; + int32_t* RefCountsUnityEngineXRWSAInputInteractionSourcePose; + + void ReferenceManagedUnityEngineXRWSAInputInteractionSourcePose(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineXRWSAInputInteractionSourcePose); + if (handle != 0) + { + RefCountsUnityEngineXRWSAInputInteractionSourcePose[handle]++; + } + } + + void DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineXRWSAInputInteractionSourcePose); + if (handle != 0) + { + int32_t numRemain = --RefCountsUnityEngineXRWSAInputInteractionSourcePose[handle]; + if (numRemain == 0) + { + ReleaseUnityEngineXRWSAInputInteractionSourcePose(handle); + } + } + } + int32_t SystemActionFreeListSize; System::Action** SystemActionFreeList; System::Action** NextFreeSystemAction; @@ -1002,11 +1211,6 @@ namespace System return *this; } - String::String() - : Object(nullptr) - { - } - String::String(const char* chars) : Object(Plugin::InternalUse::Only, Plugin::StringNew(chars)) { @@ -2404,6 +2608,46 @@ namespace System } } +namespace UnityEngine +{ + Quaternion::Quaternion() + { + } +} + +namespace System +{ + Object::Object(UnityEngine::Quaternion& val) + { + int32_t handle = Plugin::BoxQuaternion(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::Quaternion() + { + UnityEngine::Quaternion returnVal(Plugin::UnboxQuaternion(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + namespace UnityEngine { Matrix4x4::Matrix4x4() @@ -3834,13 +4078,88 @@ namespace System namespace UnityEngine { - Resolution::Resolution() + Resolution::Resolution(decltype(nullptr) n) + : Resolution(Plugin::InternalUse::Only, 0) + { + } + + Resolution::Resolution(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedUnityEngineResolution(Handle); + } + } + + Resolution::Resolution(const Resolution& other) + : Resolution(Plugin::InternalUse::Only, other.Handle) + { + } + + Resolution::Resolution(Resolution&& other) + : Resolution(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Resolution::~Resolution() + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineResolution(Handle); + Handle = 0; + } + } + + Resolution& Resolution::operator=(const Resolution& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedUnityEngineResolution(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEngineResolution(Handle); + } + return *this; + } + + Resolution& Resolution::operator=(decltype(nullptr) other) { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineResolution(Handle); + Handle = 0; + } + return *this; + } + + Resolution& Resolution::operator=(Resolution&& other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineResolution(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Resolution::operator==(const Resolution& other) const + { + return Handle == other.Handle; + } + + bool Resolution::operator!=(const Resolution& other) const + { + return Handle != other.Handle; } int32_t Resolution::GetWidth() { - auto returnValue = Plugin::UnityEngineResolutionPropertyGetWidth(this); + auto returnValue = Plugin::UnityEngineResolutionPropertyGetWidth(Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3853,7 +4172,7 @@ namespace UnityEngine void Resolution::SetWidth(int32_t value) { - Plugin::UnityEngineResolutionPropertySetWidth(this, value); + Plugin::UnityEngineResolutionPropertySetWidth(Handle, value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3865,7 +4184,7 @@ namespace UnityEngine int32_t Resolution::GetHeight() { - auto returnValue = Plugin::UnityEngineResolutionPropertyGetHeight(this); + auto returnValue = Plugin::UnityEngineResolutionPropertyGetHeight(Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3878,7 +4197,7 @@ namespace UnityEngine void Resolution::SetHeight(int32_t value) { - Plugin::UnityEngineResolutionPropertySetHeight(this, value); + Plugin::UnityEngineResolutionPropertySetHeight(Handle, value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3890,7 +4209,7 @@ namespace UnityEngine int32_t Resolution::GetRefreshRate() { - auto returnValue = Plugin::UnityEngineResolutionPropertyGetRefreshRate(this); + auto returnValue = Plugin::UnityEngineResolutionPropertyGetRefreshRate(Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3903,7 +4222,7 @@ namespace UnityEngine void Resolution::SetRefreshRate(int32_t value) { - Plugin::UnityEngineResolutionPropertySetRefreshRate(this, value); + Plugin::UnityEngineResolutionPropertySetRefreshRate(Handle, value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3918,7 +4237,7 @@ namespace System { Object::Object(UnityEngine::Resolution& val) { - int32_t handle = Plugin::BoxResolution(val); + int32_t handle = Plugin::BoxResolution(val.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3935,7 +4254,7 @@ namespace System Object::operator UnityEngine::Resolution() { - UnityEngine::Resolution returnVal(Plugin::UnboxResolution(Handle)); + UnityEngine::Resolution returnVal(Plugin::InternalUse::Only, Plugin::UnboxResolution(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4044,52 +4363,132 @@ namespace UnityEngine namespace UnityEngine { - Ray::Ray() + Ray::Ray(decltype(nullptr) n) + : Ray(Plugin::InternalUse::Only, 0) { } - Ray::Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction) + Ray::Ray(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(iu, handle) { - auto returnValue = Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(origin, direction); - if (Plugin::unhandledCsharpException) + if (handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedUnityEngineRay(Handle); } - *this = returnValue; } -} - -namespace System -{ - Object::Object(UnityEngine::Ray& val) + + Ray::Ray(const Ray& other) + : Ray(Plugin::InternalUse::Only, other.Handle) { - int32_t handle = Plugin::BoxRay(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) + } + + Ray::Ray(Ray&& other) + : Ray(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Ray::~Ray() + { + if (Handle) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + Plugin::DereferenceManagedUnityEngineRay(Handle); + Handle = 0; } } - Object::operator UnityEngine::Ray() + Ray& Ray::operator=(const Ray& other) { - UnityEngine::Ray returnVal(Plugin::UnboxRay(Handle)); - if (Plugin::unhandledCsharpException) + if (this->Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedUnityEngineRay(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEngineRay(Handle); + } + return *this; + } + + Ray& Ray::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineRay(Handle); + Handle = 0; + } + return *this; + } + + Ray& Ray::operator=(Ray&& other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineRay(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Ray::operator==(const Ray& other) const + { + return Handle == other.Handle; + } + + bool Ray::operator!=(const Ray& other) const + { + return Handle != other.Handle; + } + + Ray::Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction) + : System::ValueType(nullptr) + { + auto returnValue = Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(origin, direction); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedUnityEngineRay(Handle); + } + } +} + +namespace System +{ + Object::Object(UnityEngine::Ray& val) + { + int32_t handle = Plugin::BoxRay(val.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::Ray() + { + UnityEngine::Ray returnVal(Plugin::InternalUse::Only, Plugin::UnboxRay(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } return returnVal; } @@ -4178,7 +4577,7 @@ namespace UnityEngine int32_t Physics::RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1& results) { - auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit(ray, results.Handle); + auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1(ray.Handle, results.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4191,7 +4590,7 @@ namespace UnityEngine System::Array1 Physics::RaycastAll(UnityEngine::Ray& ray) { - auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ray); + auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ray.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4752,8 +5151,83 @@ namespace UnityEngine { namespace SceneManagement { - Scene::Scene() + Scene::Scene(decltype(nullptr) n) + : Scene(Plugin::InternalUse::Only, 0) + { + } + + Scene::Scene(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedUnityEngineSceneManagementScene(Handle); + } + } + + Scene::Scene(const Scene& other) + : Scene(Plugin::InternalUse::Only, other.Handle) + { + } + + Scene::Scene(Scene&& other) + : Scene(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Scene::~Scene() + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); + Handle = 0; + } + } + + Scene& Scene::operator=(const Scene& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEngineSceneManagementScene(Handle); + } + return *this; + } + + Scene& Scene::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); + Handle = 0; + } + return *this; + } + + Scene& Scene::operator=(Scene&& other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Scene::operator==(const Scene& other) const + { + return Handle == other.Handle; + } + + bool Scene::operator!=(const Scene& other) const { + return Handle != other.Handle; } } } @@ -4762,7 +5236,7 @@ namespace System { Object::Object(UnityEngine::SceneManagement::Scene& val) { - int32_t handle = Plugin::BoxScene(val); + int32_t handle = Plugin::BoxScene(val.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4779,7 +5253,7 @@ namespace System Object::operator UnityEngine::SceneManagement::Scene() { - UnityEngine::SceneManagement::Scene returnVal(Plugin::UnboxScene(Handle)); + UnityEngine::SceneManagement::Scene returnVal(Plugin::InternalUse::Only, Plugin::UnboxScene(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8900,110 +9374,96 @@ namespace System } } -namespace System +namespace UnityEngine { - Object::Object(System::Boolean val) + namespace Playables { - int32_t handle = Plugin::BoxBoolean(val); - if (Plugin::unhandledCsharpException) + PlayableHandle::PlayableHandle(decltype(nullptr) n) + : PlayableHandle(Plugin::InternalUse::Only, 0) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } - if (handle) + + PlayableHandle::PlayableHandle(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(iu, handle) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + if (handle) + { + Plugin::ReferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + } } - } - - Object::operator System::Boolean() - { - System::Boolean returnVal(Plugin::UnboxBoolean(Handle)); - if (Plugin::unhandledCsharpException) + + PlayableHandle::PlayableHandle(const PlayableHandle& other) + : PlayableHandle(Plugin::InternalUse::Only, other.Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } - return returnVal; - } -} - -namespace System -{ - Object::Object(int8_t val) - { - int32_t handle = Plugin::BoxSByte(val); - if (Plugin::unhandledCsharpException) + + PlayableHandle::PlayableHandle(PlayableHandle&& other) + : PlayableHandle(Plugin::InternalUse::Only, other.Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + other.Handle = 0; } - if (handle) + + PlayableHandle::~PlayableHandle() { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + if (Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + Handle = 0; + } } - } - - Object::operator int8_t() - { - int8_t returnVal(Plugin::UnboxSByte(Handle)); - if (Plugin::unhandledCsharpException) + + PlayableHandle& PlayableHandle::operator=(const PlayableHandle& other) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + if (this->Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + } + return *this; } - return returnVal; - } -} - -namespace System -{ - Object::Object(uint8_t val) - { - int32_t handle = Plugin::BoxByte(val); - if (Plugin::unhandledCsharpException) + + PlayableHandle& PlayableHandle::operator=(decltype(nullptr) other) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + if (Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + Handle = 0; + } + return *this; } - if (handle) + + PlayableHandle& PlayableHandle::operator=(PlayableHandle&& other) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + if (Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - } - - Object::operator uint8_t() - { - uint8_t returnVal(Plugin::UnboxByte(Handle)); - if (Plugin::unhandledCsharpException) + + bool PlayableHandle::operator==(const PlayableHandle& other) const { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Handle == other.Handle; + } + + bool PlayableHandle::operator!=(const PlayableHandle& other) const + { + return Handle != other.Handle; } - return returnVal; } } namespace System { - Object::Object(int16_t val) + Object::Object(UnityEngine::Playables::PlayableHandle& val) { - int32_t handle = Plugin::BoxInt16(val); + int32_t handle = Plugin::BoxPlayableHandle(val.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9018,9 +9478,9 @@ namespace System } } - Object::operator int16_t() + Object::operator UnityEngine::Playables::PlayableHandle() { - int16_t returnVal(Plugin::UnboxInt16(Handle)); + UnityEngine::Playables::PlayableHandle returnVal(Plugin::InternalUse::Only, Plugin::UnboxPlayableHandle(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9032,9 +9492,804 @@ namespace System } } -namespace System +namespace UnityEngine { - Object::Object(uint16_t val) + namespace Playables + { + PlayableGraph::PlayableGraph(decltype(nullptr) n) + : PlayableGraph(Plugin::InternalUse::Only, 0) + { + } + + PlayableGraph::PlayableGraph(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + } + } + + PlayableGraph::PlayableGraph(const PlayableGraph& other) + : PlayableGraph(Plugin::InternalUse::Only, other.Handle) + { + } + + PlayableGraph::PlayableGraph(PlayableGraph&& other) + : PlayableGraph(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + PlayableGraph::~PlayableGraph() + { + if (Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + Handle = 0; + } + } + + PlayableGraph& PlayableGraph::operator=(const PlayableGraph& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + } + return *this; + } + + PlayableGraph& PlayableGraph::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + Handle = 0; + } + return *this; + } + + PlayableGraph& PlayableGraph::operator=(PlayableGraph&& other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool PlayableGraph::operator==(const PlayableGraph& other) const + { + return Handle == other.Handle; + } + + bool PlayableGraph::operator!=(const PlayableGraph& other) const + { + return Handle != other.Handle; + } + } +} + +namespace System +{ + Object::Object(UnityEngine::Playables::PlayableGraph& val) + { + int32_t handle = Plugin::BoxPlayableGraph(val.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::Playables::PlayableGraph() + { + UnityEngine::Playables::PlayableGraph returnVal(Plugin::InternalUse::Only, Plugin::UnboxPlayableGraph(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace UnityEngine +{ + namespace Animations + { + AnimationMixerPlayable::AnimationMixerPlayable(decltype(nullptr) n) + : AnimationMixerPlayable(Plugin::InternalUse::Only, 0) + { + } + + AnimationMixerPlayable::AnimationMixerPlayable(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + } + } + + AnimationMixerPlayable::AnimationMixerPlayable(const AnimationMixerPlayable& other) + : AnimationMixerPlayable(Plugin::InternalUse::Only, other.Handle) + { + } + + AnimationMixerPlayable::AnimationMixerPlayable(AnimationMixerPlayable&& other) + : AnimationMixerPlayable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + AnimationMixerPlayable::~AnimationMixerPlayable() + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + Handle = 0; + } + } + + AnimationMixerPlayable& AnimationMixerPlayable::operator=(const AnimationMixerPlayable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + } + return *this; + } + + AnimationMixerPlayable& AnimationMixerPlayable::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + Handle = 0; + } + return *this; + } + + AnimationMixerPlayable& AnimationMixerPlayable::operator=(AnimationMixerPlayable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool AnimationMixerPlayable::operator==(const AnimationMixerPlayable& other) const + { + return Handle == other.Handle; + } + + bool AnimationMixerPlayable::operator!=(const AnimationMixerPlayable& other) const + { + return Handle != other.Handle; + } + + UnityEngine::Animations::AnimationMixerPlayable AnimationMixerPlayable::Create(UnityEngine::Playables::PlayableGraph& graph, int32_t inputCount, System::Boolean normalizeWeights) + { + auto returnValue = Plugin::UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean(graph.Handle, inputCount, normalizeWeights); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Animations::AnimationMixerPlayable(Plugin::InternalUse::Only, returnValue); + } + } +} + +namespace System +{ + Object::Object(UnityEngine::Animations::AnimationMixerPlayable& val) + { + int32_t handle = Plugin::BoxAnimationMixerPlayable(val.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::Animations::AnimationMixerPlayable() + { + UnityEngine::Animations::AnimationMixerPlayable returnVal(Plugin::InternalUse::Only, Plugin::UnboxAnimationMixerPlayable(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace UnityEngine +{ + namespace Experimental + { + namespace UIElements + { + CallbackEventHandler::CallbackEventHandler(decltype(nullptr) n) + : CallbackEventHandler(Plugin::InternalUse::Only, 0) + { + } + + CallbackEventHandler::CallbackEventHandler(Plugin::InternalUse iu, int32_t handle) + : System::Object(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + CallbackEventHandler::CallbackEventHandler(const CallbackEventHandler& other) + : CallbackEventHandler(Plugin::InternalUse::Only, other.Handle) + { + } + + CallbackEventHandler::CallbackEventHandler(CallbackEventHandler&& other) + : CallbackEventHandler(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + CallbackEventHandler::~CallbackEventHandler() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + CallbackEventHandler& CallbackEventHandler::operator=(const CallbackEventHandler& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + CallbackEventHandler& CallbackEventHandler::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + CallbackEventHandler& CallbackEventHandler::operator=(CallbackEventHandler&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool CallbackEventHandler::operator==(const CallbackEventHandler& other) const + { + return Handle == other.Handle; + } + + bool CallbackEventHandler::operator!=(const CallbackEventHandler& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace UnityEngine +{ + namespace Experimental + { + namespace UIElements + { + VisualElement::VisualElement(decltype(nullptr) n) + : VisualElement(Plugin::InternalUse::Only, 0) + { + } + + VisualElement::VisualElement(Plugin::InternalUse iu, int32_t handle) + : UnityEngine::Experimental::UIElements::CallbackEventHandler(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + VisualElement::VisualElement(const VisualElement& other) + : VisualElement(Plugin::InternalUse::Only, other.Handle) + { + } + + VisualElement::VisualElement(VisualElement&& other) + : VisualElement(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + VisualElement::~VisualElement() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + VisualElement& VisualElement::operator=(const VisualElement& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + VisualElement& VisualElement::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + VisualElement& VisualElement::operator=(VisualElement&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool VisualElement::operator==(const VisualElement& other) const + { + return Handle == other.Handle; + } + + bool VisualElement::operator!=(const VisualElement& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace UnityEngine +{ + namespace Experimental + { + namespace UIElements + { + UnityEngine::Experimental::UIElements::VisualElement UQueryExtensions::Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name, System::Array1& classes) + { + auto returnValue = Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1(e.Handle, name.Handle, classes.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Experimental::UIElements::VisualElement(Plugin::InternalUse::Only, returnValue); + } + + UnityEngine::Experimental::UIElements::VisualElement UQueryExtensions::Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name, System::String& className) + { + auto returnValue = Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString(e.Handle, name.Handle, className.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Experimental::UIElements::VisualElement(Plugin::InternalUse::Only, returnValue); + } + } + } +} + +namespace System +{ + Object::Object(UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy val) + { + int32_t handle = Plugin::BoxInteractionSourcePositionAccuracy(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy() + { + UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy returnVal(Plugin::UnboxInteractionSourcePositionAccuracy(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(UnityEngine::XR::WSA::Input::InteractionSourceNode val) + { + int32_t handle = Plugin::BoxInteractionSourceNode(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::XR::WSA::Input::InteractionSourceNode() + { + UnityEngine::XR::WSA::Input::InteractionSourceNode returnVal(Plugin::UnboxInteractionSourceNode(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace UnityEngine +{ + namespace XR + { + namespace WSA + { + namespace Input + { + InteractionSourcePose::InteractionSourcePose(decltype(nullptr) n) + : InteractionSourcePose(Plugin::InternalUse::Only, 0) + { + } + + InteractionSourcePose::InteractionSourcePose(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(iu, handle) + { + if (handle) + { + Plugin::ReferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); + } + } + + InteractionSourcePose::InteractionSourcePose(const InteractionSourcePose& other) + : InteractionSourcePose(Plugin::InternalUse::Only, other.Handle) + { + } + + InteractionSourcePose::InteractionSourcePose(InteractionSourcePose&& other) + : InteractionSourcePose(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + InteractionSourcePose::~InteractionSourcePose() + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); + Handle = 0; + } + } + + InteractionSourcePose& InteractionSourcePose::operator=(const InteractionSourcePose& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); + } + return *this; + } + + InteractionSourcePose& InteractionSourcePose::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); + Handle = 0; + } + return *this; + } + + InteractionSourcePose& InteractionSourcePose::operator=(InteractionSourcePose&& other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool InteractionSourcePose::operator==(const InteractionSourcePose& other) const + { + return Handle == other.Handle; + } + + bool InteractionSourcePose::operator!=(const InteractionSourcePose& other) const + { + return Handle != other.Handle; + } + + System::Boolean InteractionSourcePose::TryGetRotation(UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node) + { + auto returnValue = Plugin::UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode(Handle, rotation, node); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + } + } + } +} + +namespace System +{ + Object::Object(UnityEngine::XR::WSA::Input::InteractionSourcePose& val) + { + int32_t handle = Plugin::BoxInteractionSourcePose(val.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::XR::WSA::Input::InteractionSourcePose() + { + UnityEngine::XR::WSA::Input::InteractionSourcePose returnVal(Plugin::InternalUse::Only, Plugin::UnboxInteractionSourcePose(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(System::Boolean val) + { + int32_t handle = Plugin::BoxBoolean(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator System::Boolean() + { + System::Boolean returnVal(Plugin::UnboxBoolean(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(int8_t val) + { + int32_t handle = Plugin::BoxSByte(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator int8_t() + { + int8_t returnVal(Plugin::UnboxSByte(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(uint8_t val) + { + int32_t handle = Plugin::BoxByte(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator uint8_t() + { + uint8_t returnVal(Plugin::UnboxByte(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(int16_t val) + { + int32_t handle = Plugin::BoxInt16(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator int16_t() + { + int16_t returnVal(Plugin::UnboxInt16(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(uint16_t val) { int32_t handle = Plugin::BoxUInt16(val); if (Plugin::unhandledCsharpException) @@ -10427,7 +11682,7 @@ namespace Plugin void ArrayElementProxy1_1::operator=(UnityEngine::Resolution item) { - Plugin::UnityEngineResolutionArray1SetItem1(Handle, Index0, item); + Plugin::UnityEngineResolutionArray1SetItem1(Handle, Index0, item.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -10447,7 +11702,7 @@ namespace Plugin ex->ThrowReferenceToThis(); delete ex; } - return returnValue; + return UnityEngine::Resolution(Plugin::InternalUse::Only, returnValue); } } @@ -12788,10 +14043,11 @@ namespace UnityEngine { } - DLLEXPORT void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(int32_t cppHandle, UnityEngine::SceneManagement::Scene arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) + DLLEXPORT void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(int32_t cppHandle, int32_t arg0Handle, UnityEngine::SceneManagement::LoadSceneMode arg1) { try { + auto arg0 = UnityEngine::SceneManagement::Scene(Plugin::InternalUse::Only, arg0Handle); Plugin::GetUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(cppHandle)->operator()(arg0, arg1); } catch (System::Exception ex) @@ -12808,7 +14064,7 @@ namespace UnityEngine void UnityAction2::Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) { - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(Handle, arg0, arg1); + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(Handle, arg0.Handle, arg1); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -13875,6 +15131,8 @@ DLLEXPORT void Init( UnityEngine::Vector3 (*unityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a), int32_t (*boxVector3)(UnityEngine::Vector3& val), UnityEngine::Vector3 (*unboxVector3)(int32_t valHandle), + int32_t (*boxQuaternion)(UnityEngine::Quaternion& val), + UnityEngine::Quaternion (*unboxQuaternion)(int32_t valHandle), float (*unityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column), void (*unityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value), int32_t (*boxMatrix4x4)(UnityEngine::Matrix4x4& val), @@ -13910,20 +15168,22 @@ DLLEXPORT void Init( int32_t (*systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)(int32_t thisHandle), void (*systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)(int32_t thisHandle, int32_t valueHandle), int32_t (*systemExceptionConstructorSystemString)(int32_t messageHandle), - int32_t (*unityEngineResolutionPropertyGetWidth)(UnityEngine::Resolution* thiz), - void (*unityEngineResolutionPropertySetWidth)(UnityEngine::Resolution* thiz, int32_t value), - int32_t (*unityEngineResolutionPropertyGetHeight)(UnityEngine::Resolution* thiz), - void (*unityEngineResolutionPropertySetHeight)(UnityEngine::Resolution* thiz, int32_t value), - int32_t (*unityEngineResolutionPropertyGetRefreshRate)(UnityEngine::Resolution* thiz), - void (*unityEngineResolutionPropertySetRefreshRate)(UnityEngine::Resolution* thiz, int32_t value), - int32_t (*boxResolution)(UnityEngine::Resolution& val), - UnityEngine::Resolution (*unboxResolution)(int32_t valHandle), + void (*releaseUnityEngineResolution)(int32_t handle), + int32_t (*unityEngineResolutionPropertyGetWidth)(int32_t thisHandle), + void (*unityEngineResolutionPropertySetWidth)(int32_t thisHandle, int32_t value), + int32_t (*unityEngineResolutionPropertyGetHeight)(int32_t thisHandle), + void (*unityEngineResolutionPropertySetHeight)(int32_t thisHandle, int32_t value), + int32_t (*unityEngineResolutionPropertyGetRefreshRate)(int32_t thisHandle), + void (*unityEngineResolutionPropertySetRefreshRate)(int32_t thisHandle, int32_t value), + int32_t (*boxResolution)(int32_t valHandle), + int32_t (*unboxResolution)(int32_t valHandle), int32_t (*unityEngineScreenPropertyGetResolutions)(), - UnityEngine::Ray (*unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction), - int32_t (*boxRay)(UnityEngine::Ray& val), - UnityEngine::Ray (*unboxRay)(int32_t valHandle), - int32_t (*unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit)(UnityEngine::Ray& ray, int32_t resultsHandle), - int32_t (*unityEnginePhysicsMethodRaycastAllUnityEngineRay)(UnityEngine::Ray& ray), + void (*releaseUnityEngineRay)(int32_t handle), + int32_t (*unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction), + int32_t (*boxRay)(int32_t valHandle), + int32_t (*unboxRay)(int32_t valHandle), + int32_t (*unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1)(int32_t rayHandle, int32_t resultsHandle), + int32_t (*unityEnginePhysicsMethodRaycastAllUnityEngineRay)(int32_t rayHandle), int32_t (*boxColor)(UnityEngine::Color& val), UnityEngine::Color (*unboxColor)(int32_t valHandle), int32_t (*boxGradientColorKey)(UnityEngine::GradientColorKey& val), @@ -13938,8 +15198,9 @@ DLLEXPORT void Init( void (*unityEngineApplicationRemoveEventOnBeforeRender)(int32_t delHandle), void (*unityEngineSceneManagementSceneManagerAddEventSceneLoaded)(int32_t delHandle), void (*unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)(int32_t delHandle), - int32_t (*boxScene)(UnityEngine::SceneManagement::Scene& val), - UnityEngine::SceneManagement::Scene (*unboxScene)(int32_t valHandle), + void (*releaseUnityEngineSceneManagementScene)(int32_t handle), + int32_t (*boxScene)(int32_t valHandle), + int32_t (*unboxScene)(int32_t valHandle), int32_t (*boxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val), UnityEngine::SceneManagement::LoadSceneMode (*unboxLoadSceneMode)(int32_t valHandle), int32_t (*systemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle), @@ -13968,6 +15229,26 @@ DLLEXPORT void Init( void (*systemIOFileStreamMethodWriteByteSystemByte)(int32_t thisHandle, uint8_t value), void (*releaseSystemIOBaseFileStream)(int32_t handle), void (*systemIOBaseFileStreamConstructorSystemString_SystemIOFileMode)(int32_t cppHandle, int32_t* handle, int32_t pathHandle, System::IO::FileMode mode), + void (*releaseUnityEnginePlayablesPlayableHandle)(int32_t handle), + int32_t (*boxPlayableHandle)(int32_t valHandle), + int32_t (*unboxPlayableHandle)(int32_t valHandle), + void (*releaseUnityEnginePlayablesPlayableGraph)(int32_t handle), + int32_t (*boxPlayableGraph)(int32_t valHandle), + int32_t (*unboxPlayableGraph)(int32_t valHandle), + void (*releaseUnityEngineAnimationsAnimationMixerPlayable)(int32_t handle), + int32_t (*unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)(int32_t graphHandle, int32_t inputCount, System::Boolean normalizeWeights), + int32_t (*boxAnimationMixerPlayable)(int32_t valHandle), + int32_t (*unboxAnimationMixerPlayable)(int32_t valHandle), + int32_t (*unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1)(int32_t eHandle, int32_t nameHandle, int32_t classesHandle), + int32_t (*unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString)(int32_t eHandle, int32_t nameHandle, int32_t classNameHandle), + int32_t (*boxInteractionSourcePositionAccuracy)(UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy val), + UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy (*unboxInteractionSourcePositionAccuracy)(int32_t valHandle), + int32_t (*boxInteractionSourceNode)(UnityEngine::XR::WSA::Input::InteractionSourceNode val), + UnityEngine::XR::WSA::Input::InteractionSourceNode (*unboxInteractionSourceNode)(int32_t valHandle), + void (*releaseUnityEngineXRWSAInputInteractionSourcePose)(int32_t handle), + System::Boolean (*unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode)(int32_t thisHandle, UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node), + int32_t (*boxInteractionSourcePose)(int32_t valHandle), + int32_t (*unboxInteractionSourcePose)(int32_t valHandle), int32_t (*boxBoolean)(System::Boolean val), System::Boolean (*unboxBoolean)(int32_t valHandle), int32_t (*boxSByte)(int8_t val), @@ -14010,8 +15291,8 @@ DLLEXPORT void Init( int32_t (*systemStringArray1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*systemStringArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), int32_t (*unityEngineUnityEngineResolutionArray1Constructor1)(int32_t length0), - UnityEngine::Resolution (*unityEngineResolutionArray1GetItem1)(int32_t thisHandle, int32_t index0), - int32_t (*unityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::Resolution& item), + int32_t (*unityEngineResolutionArray1GetItem1)(int32_t thisHandle, int32_t index0), + int32_t (*unityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), int32_t (*unityEngineUnityEngineRaycastHitArray1Constructor1)(int32_t length0), int32_t (*unityEngineRaycastHitArray1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*unityEngineRaycastHitArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), @@ -14057,7 +15338,7 @@ DLLEXPORT void Init( void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)(int32_t thisHandle, int32_t delHandle), void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle), - void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1), + void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, int32_t arg0Handle, UnityEngine::SceneManagement::LoadSceneMode arg1), void (*releaseSystemComponentModelDesignComponentEventHandler)(int32_t handle, int32_t classHandle), void (*systemComponentModelDesignComponentEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), void (*systemComponentModelDesignComponentEventHandlerAdd)(int32_t thisHandle, int32_t delHandle), @@ -14125,6 +15406,8 @@ DLLEXPORT void Init( Plugin::UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3 = unityEngineVector3Methodop_UnaryNegationUnityEngineVector3; Plugin::BoxVector3 = boxVector3; Plugin::UnboxVector3 = unboxVector3; + Plugin::BoxQuaternion = boxQuaternion; + Plugin::UnboxQuaternion = unboxQuaternion; Plugin::UnityEngineMatrix4x4PropertyGetItem = unityEngineMatrix4x4PropertyGetItem; Plugin::UnityEngineMatrix4x4PropertySetItem = unityEngineMatrix4x4PropertySetItem; Plugin::BoxMatrix4x4 = boxMatrix4x4; @@ -14162,6 +15445,8 @@ DLLEXPORT void Init( Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue; Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue; Plugin::SystemExceptionConstructorSystemString = systemExceptionConstructorSystemString; + Plugin::ReleaseUnityEngineResolution = releaseUnityEngineResolution; + Plugin::RefCountsUnityEngineResolution = new int32_t[maxManagedObjects](); Plugin::UnityEngineResolutionPropertyGetWidth = unityEngineResolutionPropertyGetWidth; Plugin::UnityEngineResolutionPropertySetWidth = unityEngineResolutionPropertySetWidth; Plugin::UnityEngineResolutionPropertyGetHeight = unityEngineResolutionPropertyGetHeight; @@ -14171,10 +15456,12 @@ DLLEXPORT void Init( Plugin::BoxResolution = boxResolution; Plugin::UnboxResolution = unboxResolution; Plugin::UnityEngineScreenPropertyGetResolutions = unityEngineScreenPropertyGetResolutions; + Plugin::ReleaseUnityEngineRay = releaseUnityEngineRay; + Plugin::RefCountsUnityEngineRay = new int32_t[maxManagedObjects](); Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3 = unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3; Plugin::BoxRay = boxRay; Plugin::UnboxRay = unboxRay; - Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit = unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHit; + Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1 = unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1; Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay = unityEnginePhysicsMethodRaycastAllUnityEngineRay; Plugin::BoxColor = boxColor; Plugin::UnboxColor = unboxColor; @@ -14190,6 +15477,8 @@ DLLEXPORT void Init( Plugin::UnityEngineApplicationRemoveEventOnBeforeRender = unityEngineApplicationRemoveEventOnBeforeRender; Plugin::UnityEngineSceneManagementSceneManagerAddEventSceneLoaded = unityEngineSceneManagementSceneManagerAddEventSceneLoaded; Plugin::UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded = unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded; + Plugin::ReleaseUnityEngineSceneManagementScene = releaseUnityEngineSceneManagementScene; + Plugin::RefCountsUnityEngineSceneManagementScene = new int32_t[maxManagedObjects](); Plugin::BoxScene = boxScene; Plugin::UnboxScene = unboxScene; Plugin::BoxLoadSceneMode = boxLoadSceneMode; @@ -14284,6 +15573,30 @@ DLLEXPORT void Init( NextFreeSystemIOBaseFileStream = SystemIOBaseFileStreamFreeList + 1; Plugin::ReleaseSystemIOBaseFileStream = releaseSystemIOBaseFileStream; Plugin::SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode = systemIOBaseFileStreamConstructorSystemString_SystemIOFileMode; + Plugin::ReleaseUnityEnginePlayablesPlayableHandle = releaseUnityEnginePlayablesPlayableHandle; + Plugin::RefCountsUnityEnginePlayablesPlayableHandle = new int32_t[maxManagedObjects](); + Plugin::BoxPlayableHandle = boxPlayableHandle; + Plugin::UnboxPlayableHandle = unboxPlayableHandle; + Plugin::ReleaseUnityEnginePlayablesPlayableGraph = releaseUnityEnginePlayablesPlayableGraph; + Plugin::RefCountsUnityEnginePlayablesPlayableGraph = new int32_t[maxManagedObjects](); + Plugin::BoxPlayableGraph = boxPlayableGraph; + Plugin::UnboxPlayableGraph = unboxPlayableGraph; + Plugin::ReleaseUnityEngineAnimationsAnimationMixerPlayable = releaseUnityEngineAnimationsAnimationMixerPlayable; + Plugin::RefCountsUnityEngineAnimationsAnimationMixerPlayable = new int32_t[maxManagedObjects](); + Plugin::UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean = unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean; + Plugin::BoxAnimationMixerPlayable = boxAnimationMixerPlayable; + Plugin::UnboxAnimationMixerPlayable = unboxAnimationMixerPlayable; + Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1 = unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1; + Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString = unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString; + Plugin::BoxInteractionSourcePositionAccuracy = boxInteractionSourcePositionAccuracy; + Plugin::UnboxInteractionSourcePositionAccuracy = unboxInteractionSourcePositionAccuracy; + Plugin::BoxInteractionSourceNode = boxInteractionSourceNode; + Plugin::UnboxInteractionSourceNode = unboxInteractionSourceNode; + Plugin::ReleaseUnityEngineXRWSAInputInteractionSourcePose = releaseUnityEngineXRWSAInputInteractionSourcePose; + Plugin::RefCountsUnityEngineXRWSAInputInteractionSourcePose = new int32_t[maxManagedObjects](); + Plugin::UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode = unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode; + Plugin::BoxInteractionSourcePose = boxInteractionSourcePose; + Plugin::UnboxInteractionSourcePose = unboxInteractionSourcePose; Plugin::BoxBoolean = boxBoolean; Plugin::UnboxBoolean = unboxBoolean; Plugin::BoxSByte = boxSByte; diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 9049197..040361b 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -284,6 +284,11 @@ namespace UnityEngine struct Vector3; } +namespace UnityEngine +{ + struct Quaternion; +} + namespace UnityEngine { struct Matrix4x4; @@ -820,6 +825,116 @@ namespace System } } +namespace UnityEngine +{ + namespace Playables + { + struct PlayableHandle; + } +} + +namespace UnityEngine +{ + namespace Playables + { + struct PlayableGraph; + } +} + +namespace UnityEngine +{ + namespace Animations + { + struct AnimationMixerPlayable; + } +} + +namespace UnityEngine +{ + namespace Experimental + { + namespace UIElements + { + struct CallbackEventHandler; + } + } +} + +namespace UnityEngine +{ + namespace Experimental + { + namespace UIElements + { + struct VisualElement; + } + } +} + +namespace UnityEngine +{ + namespace Experimental + { + namespace UIElements + { + namespace UQueryExtensions + { + } + } + } +} + +namespace UnityEngine +{ + namespace XR + { + namespace WSA + { + namespace Input + { + enum struct InteractionSourcePositionAccuracy : int32_t + { + None = 0, + Approximate = 1, + High = 2 + }; + } + } + } +} + +namespace UnityEngine +{ + namespace XR + { + namespace WSA + { + namespace Input + { + enum struct InteractionSourceNode : int32_t + { + Grip = 0, + Pointer = 1 + }; + } + } + } +} + +namespace UnityEngine +{ + namespace XR + { + namespace WSA + { + namespace Input + { + struct InteractionSourcePose; + } + } + } +} + namespace MyGame { namespace MonoBehaviours @@ -1069,6 +1184,8 @@ namespace System /*BEGIN BOXING METHOD DECLARATIONS*/ Object(UnityEngine::Vector3& val); explicit operator UnityEngine::Vector3(); + Object(UnityEngine::Quaternion& val); + explicit operator UnityEngine::Quaternion(); Object(UnityEngine::Matrix4x4& val); explicit operator UnityEngine::Matrix4x4(); Object(UnityEngine::RaycastHit& val); @@ -1093,6 +1210,18 @@ namespace System explicit operator UnityEngine::PrimitiveType(); Object(System::IO::FileMode val); explicit operator System::IO::FileMode(); + Object(UnityEngine::Playables::PlayableHandle& val); + explicit operator UnityEngine::Playables::PlayableHandle(); + Object(UnityEngine::Playables::PlayableGraph& val); + explicit operator UnityEngine::Playables::PlayableGraph(); + Object(UnityEngine::Animations::AnimationMixerPlayable& val); + explicit operator UnityEngine::Animations::AnimationMixerPlayable(); + Object(UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy val); + explicit operator UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy(); + Object(UnityEngine::XR::WSA::Input::InteractionSourceNode val); + explicit operator UnityEngine::XR::WSA::Input::InteractionSourceNode(); + Object(UnityEngine::XR::WSA::Input::InteractionSourcePose& val); + explicit operator UnityEngine::XR::WSA::Input::InteractionSourcePose(); Object(System::Boolean val); explicit operator System::Boolean(); Object(int8_t val); @@ -1137,7 +1266,6 @@ namespace System String& operator=(const String& other); String& operator=(decltype(nullptr) other); String& operator=(String&& other); - String(); String(const char* chars); }; @@ -1150,6 +1278,15 @@ namespace System }; } +//////////////////////////////////////////////////////////////// +// Global variables +//////////////////////////////////////////////////////////////// + +namespace Plugin +{ + extern System::String NullString; +} + /*BEGIN TYPE DEFINITIONS*/ namespace System { @@ -1394,6 +1531,18 @@ namespace UnityEngine }; } +namespace UnityEngine +{ + struct Quaternion + { + Quaternion(); + float x; + float y; + float z; + float w; + }; +} + namespace UnityEngine { struct Matrix4x4 @@ -1674,18 +1823,24 @@ namespace System namespace UnityEngine { - struct Resolution - { - Resolution(); + struct Resolution : System::ValueType + { + Resolution(decltype(nullptr) n); + Resolution(Plugin::InternalUse iu, int32_t handle); + Resolution(const Resolution& other); + Resolution(Resolution&& other); + virtual ~Resolution(); + Resolution& operator=(const Resolution& other); + Resolution& operator=(decltype(nullptr) other); + Resolution& operator=(Resolution&& other); + bool operator==(const Resolution& other) const; + bool operator!=(const Resolution& other) const; int32_t GetWidth(); void SetWidth(int32_t value); int32_t GetHeight(); void SetHeight(int32_t value); int32_t GetRefreshRate(); void SetRefreshRate(int32_t value); - int32_t m_Width; - int32_t m_Height; - int32_t m_RefreshRate; }; } @@ -1709,12 +1864,19 @@ namespace UnityEngine namespace UnityEngine { - struct Ray - { - Ray(); + struct Ray : System::ValueType + { + Ray(decltype(nullptr) n); + Ray(Plugin::InternalUse iu, int32_t handle); + Ray(const Ray& other); + Ray(Ray&& other); + virtual ~Ray(); + Ray& operator=(const Ray& other); + Ray& operator=(decltype(nullptr) other); + Ray& operator=(Ray&& other); + bool operator==(const Ray& other) const; + bool operator!=(const Ray& other) const; Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); - UnityEngine::Vector3 m_Origin; - UnityEngine::Vector3 m_Direction; }; } @@ -1844,10 +2006,18 @@ namespace UnityEngine { namespace SceneManagement { - struct Scene - { - Scene(); - int32_t m_Handle; + struct Scene : System::ValueType + { + Scene(decltype(nullptr) n); + Scene(Plugin::InternalUse iu, int32_t handle); + Scene(const Scene& other); + Scene(Scene&& other); + virtual ~Scene(); + Scene& operator=(const Scene& other); + Scene& operator=(decltype(nullptr) other); + Scene& operator=(Scene&& other); + bool operator==(const Scene& other) const; + bool operator!=(const Scene& other) const; }; } } @@ -2453,6 +2623,155 @@ namespace System } } +namespace UnityEngine +{ + namespace Playables + { + struct PlayableHandle : System::ValueType + { + PlayableHandle(decltype(nullptr) n); + PlayableHandle(Plugin::InternalUse iu, int32_t handle); + PlayableHandle(const PlayableHandle& other); + PlayableHandle(PlayableHandle&& other); + virtual ~PlayableHandle(); + PlayableHandle& operator=(const PlayableHandle& other); + PlayableHandle& operator=(decltype(nullptr) other); + PlayableHandle& operator=(PlayableHandle&& other); + bool operator==(const PlayableHandle& other) const; + bool operator!=(const PlayableHandle& other) const; + }; + } +} + +namespace UnityEngine +{ + namespace Playables + { + struct PlayableGraph : System::ValueType + { + PlayableGraph(decltype(nullptr) n); + PlayableGraph(Plugin::InternalUse iu, int32_t handle); + PlayableGraph(const PlayableGraph& other); + PlayableGraph(PlayableGraph&& other); + virtual ~PlayableGraph(); + PlayableGraph& operator=(const PlayableGraph& other); + PlayableGraph& operator=(decltype(nullptr) other); + PlayableGraph& operator=(PlayableGraph&& other); + bool operator==(const PlayableGraph& other) const; + bool operator!=(const PlayableGraph& other) const; + }; + } +} + +namespace UnityEngine +{ + namespace Animations + { + struct AnimationMixerPlayable : System::ValueType + { + AnimationMixerPlayable(decltype(nullptr) n); + AnimationMixerPlayable(Plugin::InternalUse iu, int32_t handle); + AnimationMixerPlayable(const AnimationMixerPlayable& other); + AnimationMixerPlayable(AnimationMixerPlayable&& other); + virtual ~AnimationMixerPlayable(); + AnimationMixerPlayable& operator=(const AnimationMixerPlayable& other); + AnimationMixerPlayable& operator=(decltype(nullptr) other); + AnimationMixerPlayable& operator=(AnimationMixerPlayable&& other); + bool operator==(const AnimationMixerPlayable& other) const; + bool operator!=(const AnimationMixerPlayable& other) const; + static UnityEngine::Animations::AnimationMixerPlayable Create(UnityEngine::Playables::PlayableGraph& graph, int32_t inputCount = 0, System::Boolean normalizeWeights = false); + }; + } +} + +namespace UnityEngine +{ + namespace Experimental + { + namespace UIElements + { + struct CallbackEventHandler : System::Object + { + CallbackEventHandler(decltype(nullptr) n); + CallbackEventHandler(Plugin::InternalUse iu, int32_t handle); + CallbackEventHandler(const CallbackEventHandler& other); + CallbackEventHandler(CallbackEventHandler&& other); + virtual ~CallbackEventHandler(); + CallbackEventHandler& operator=(const CallbackEventHandler& other); + CallbackEventHandler& operator=(decltype(nullptr) other); + CallbackEventHandler& operator=(CallbackEventHandler&& other); + bool operator==(const CallbackEventHandler& other) const; + bool operator!=(const CallbackEventHandler& other) const; + }; + } + } +} + +namespace UnityEngine +{ + namespace Experimental + { + namespace UIElements + { + struct VisualElement : UnityEngine::Experimental::UIElements::CallbackEventHandler + { + VisualElement(decltype(nullptr) n); + VisualElement(Plugin::InternalUse iu, int32_t handle); + VisualElement(const VisualElement& other); + VisualElement(VisualElement&& other); + virtual ~VisualElement(); + VisualElement& operator=(const VisualElement& other); + VisualElement& operator=(decltype(nullptr) other); + VisualElement& operator=(VisualElement&& other); + bool operator==(const VisualElement& other) const; + bool operator!=(const VisualElement& other) const; + }; + } + } +} + +namespace UnityEngine +{ + namespace Experimental + { + namespace UIElements + { + namespace UQueryExtensions + { + UnityEngine::Experimental::UIElements::VisualElement Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name, System::Array1& classes); + UnityEngine::Experimental::UIElements::VisualElement Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name = Plugin::NullString, System::String& className = Plugin::NullString); + } + } + } +} + +namespace UnityEngine +{ + namespace XR + { + namespace WSA + { + namespace Input + { + struct InteractionSourcePose : System::ValueType + { + InteractionSourcePose(decltype(nullptr) n); + InteractionSourcePose(Plugin::InternalUse iu, int32_t handle); + InteractionSourcePose(const InteractionSourcePose& other); + InteractionSourcePose(InteractionSourcePose&& other); + virtual ~InteractionSourcePose(); + InteractionSourcePose& operator=(const InteractionSourcePose& other); + InteractionSourcePose& operator=(decltype(nullptr) other); + InteractionSourcePose& operator=(InteractionSourcePose&& other); + bool operator==(const InteractionSourcePose& other) const; + bool operator!=(const InteractionSourcePose& other) const; + System::Boolean TryGetRotation(UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node = UnityEngine::XR::WSA::Input::InteractionSourceNode::Grip); + }; + } + } + } +} + namespace MyGame { namespace MonoBehaviours From 6c31d40cf3f06e3d91bc53b90f9611aacfebe083 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 17 Dec 2017 18:21:29 -0800 Subject: [PATCH 50/95] Don't generate default paramters for non-string null values --- .../NativeScript/Editor/GenerateBindings.cs | 75 +++++++++---------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index e846bac..0080eed 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -11667,56 +11667,49 @@ static void AppendCppParameterDeclaration( } output.Append("Plugin::NullString"); } - else if (object.ReferenceEquals(param.DefaultValue, null)) + else if (param.DefaultValue is bool) { - output.Append("nullptr"); + bool val = (bool)param.DefaultValue; + output.Append(val ? "true" : "false"); + } + else if (param.DefaultValue is char) + { + char val = (char)param.DefaultValue; + output.Append('\''); + output.Append(val); + output.Append('\''); + } + else if ((param.DefaultValue is sbyte) || + (param.DefaultValue is byte) || + (param.DefaultValue is short) || + (param.DefaultValue is ushort) || + (param.DefaultValue is int) || + (param.DefaultValue is uint) || + (param.DefaultValue is long) || + (param.DefaultValue is ulong)) + { + output.Append(param.DefaultValue); } else { - if ((param.DefaultValue is sbyte) || - (param.DefaultValue is byte) || - (param.DefaultValue is short) || - (param.DefaultValue is ushort) || - (param.DefaultValue is int) || - (param.DefaultValue is uint) || - (param.DefaultValue is long) || - (param.DefaultValue is ulong)) + Type type = param.DefaultValue.GetType(); + if (type.IsEnum) { + AppendCppTypeName( + type, + output); + output.Append("::"); output.Append(param.DefaultValue); } - else if (param.DefaultValue is bool) - { - bool val = (bool)param.DefaultValue; - output.Append(val ? "true" : "false"); - } - else if (param.DefaultValue is char) - { - char val = (char)param.DefaultValue; - output.Append('\''); - output.Append(val); - output.Append('\''); - } else { - Type type = param.DefaultValue.GetType(); - if (type.IsEnum) - { - AppendCppTypeName( - type, - output); - output.Append("::"); - output.Append(param.DefaultValue); - } - else - { - StringBuilder error = new StringBuilder(); - error.Append("Default parameter type ("); - AppendCsharpTypeName( - param.DefaultValue.GetType(), - error); - error.Append(") not supported"); - throw new Exception(error.ToString()); - } + StringBuilder error = new StringBuilder(); + error.Append("Default parameter type ("); + AppendCsharpTypeName( + param.DefaultValue.GetType(), + error); + error.Append(") not supported"); + throw new Exception(error.ToString()); } } } From a4830d4be2c14e4094a8204428a405900f66369d Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 17 Dec 2017 18:47:52 -0800 Subject: [PATCH 51/95] Update README for default parameter support --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 632dcf4..3a766ab 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,9 @@ C++ is the standard language for video games as well as many other fields. By pr * Delegates * Events * Boxing and unboxing (e.g. boxing `int` to `object`, casting `object` to `int`) - * Implementing C# interfaces and deriving from C# classes with C++ classes + * Implementing C# interfaces with C++ classes + * Deriving from C# classes with C++ classes + * Default parameters # Performance @@ -199,9 +201,9 @@ To configure the code generator, open `NativeScriptTypes.json` and notice the ex Note that the code generator does not support (yet): * `MonoBehaviour` contents (e.g. fields) except for "message" functions -* `Array` methods (e.g. `IndexOf`) -* `string` methods (e.g. `Substring`) -* Default parameters +* `Array`, `string`, and `object` methods (e.g. `GetHashCode`) +* Non-null string default parameters and null non-string default parameters +* Implicit `params` parameter (a.k.a. "var args") passing * `decimal` * C# pointers From a978505f6dee95ae3ced50dec4355f48f6ebf2b6 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Fri, 5 Jan 2018 17:43:43 -0800 Subject: [PATCH 52/95] List all interfaces for C++ classes --- Unity/Assets/NativeScript/Bindings.cs | 2406 ++-- .../NativeScript/Editor/GenerateBindings.cs | 477 +- Unity/Assets/NativeScriptTypes.json | 426 +- Unity/CppSource/NativeScript/Bindings.cpp | 11561 +++++++++------- Unity/CppSource/NativeScript/Bindings.h | 2343 +++- 5 files changed, 9961 insertions(+), 7252 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 0f30704..51b1c0b 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -274,23 +274,56 @@ delegate void InitDelegate( IntPtr setException, IntPtr arrayGetLength, /*BEGIN INIT PARAMS*/ - IntPtr systemDiagnosticsStopwatchConstructor, - IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds, - IntPtr systemDiagnosticsStopwatchMethodStart, - IntPtr systemDiagnosticsStopwatchMethodReset, + IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, + IntPtr unityEngineVector3PropertyGetMagnitude, + IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, + IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, + IntPtr unityEngineVector3Methodop_UnaryNegationUnityEngineVector3, + IntPtr boxVector3, + IntPtr unboxVector3, IntPtr unityEngineObjectPropertyGetName, IntPtr unityEngineObjectPropertySetName, IntPtr unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject, IntPtr unityEngineObjectMethodop_ImplicitUnityEngineObject, + IntPtr unityEngineComponentPropertyGetTransform, + IntPtr unityEngineTransformPropertyGetPosition, + IntPtr unityEngineTransformPropertySetPosition, + IntPtr boxColor, + IntPtr unboxColor, + IntPtr boxGradientColorKey, + IntPtr unboxGradientColorKey, + IntPtr releaseUnityEngineResolution, + IntPtr unityEngineResolutionPropertyGetWidth, + IntPtr unityEngineResolutionPropertySetWidth, + IntPtr unityEngineResolutionPropertyGetHeight, + IntPtr unityEngineResolutionPropertySetHeight, + IntPtr unityEngineResolutionPropertyGetRefreshRate, + IntPtr unityEngineResolutionPropertySetRefreshRate, + IntPtr boxResolution, + IntPtr unboxResolution, + IntPtr releaseUnityEngineRaycastHit, + IntPtr unityEngineRaycastHitPropertyGetPoint, + IntPtr unityEngineRaycastHitPropertySetPoint, + IntPtr unityEngineRaycastHitPropertyGetTransform, + IntPtr boxRaycastHit, + IntPtr unboxRaycastHit, + IntPtr releaseUnityEnginePlayablesPlayableGraph, + IntPtr boxPlayableGraph, + IntPtr unboxPlayableGraph, + IntPtr releaseUnityEngineAnimationsAnimationMixerPlayable, + IntPtr unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean, + IntPtr boxAnimationMixerPlayable, + IntPtr unboxAnimationMixerPlayable, + IntPtr systemDiagnosticsStopwatchConstructor, + IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds, + IntPtr systemDiagnosticsStopwatchMethodStart, + IntPtr systemDiagnosticsStopwatchMethodReset, IntPtr unityEngineGameObjectConstructor, IntPtr unityEngineGameObjectConstructorSystemString, IntPtr unityEngineGameObjectPropertyGetTransform, IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript, IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript, IntPtr unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType, - IntPtr unityEngineComponentPropertyGetTransform, - IntPtr unityEngineTransformPropertyGetPosition, - IntPtr unityEngineTransformPropertySetPosition, IntPtr unityEngineDebugMethodLogSystemObject, IntPtr unityEngineAssertionsAssertFieldGetRaiseExceptions, IntPtr unityEngineAssertionsAssertFieldSetRaiseExceptions, @@ -300,25 +333,12 @@ delegate void InitDelegate( 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 boxVector3, - IntPtr unboxVector3, IntPtr boxQuaternion, IntPtr unboxQuaternion, IntPtr unityEngineMatrix4x4PropertyGetItem, IntPtr unityEngineMatrix4x4PropertySetItem, IntPtr boxMatrix4x4, IntPtr unboxMatrix4x4, - IntPtr releaseUnityEngineRaycastHit, - IntPtr unityEngineRaycastHitPropertyGetPoint, - IntPtr unityEngineRaycastHitPropertySetPoint, - IntPtr unityEngineRaycastHitPropertyGetTransform, - IntPtr boxRaycastHit, - IntPtr unboxRaycastHit, IntPtr boxQueryTriggerInteraction, IntPtr unboxQueryTriggerInteraction, IntPtr releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, @@ -344,15 +364,6 @@ delegate void InitDelegate( IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue, IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue, IntPtr systemExceptionConstructorSystemString, - IntPtr releaseUnityEngineResolution, - IntPtr unityEngineResolutionPropertyGetWidth, - IntPtr unityEngineResolutionPropertySetWidth, - IntPtr unityEngineResolutionPropertyGetHeight, - IntPtr unityEngineResolutionPropertySetHeight, - IntPtr unityEngineResolutionPropertyGetRefreshRate, - IntPtr unityEngineResolutionPropertySetRefreshRate, - IntPtr boxResolution, - IntPtr unboxResolution, IntPtr unityEngineScreenPropertyGetResolutions, IntPtr releaseUnityEngineRay, IntPtr unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3, @@ -360,10 +371,6 @@ delegate void InitDelegate( IntPtr unboxRay, IntPtr unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1, IntPtr unityEnginePhysicsMethodRaycastAllUnityEngineRay, - IntPtr boxColor, - IntPtr unboxColor, - IntPtr boxGradientColorKey, - IntPtr unboxGradientColorKey, IntPtr unityEngineGradientConstructor, IntPtr unityEngineGradientPropertyGetColorKeys, IntPtr unityEngineGradientPropertySetColorKeys, @@ -392,10 +399,6 @@ delegate void InitDelegate( IntPtr systemCollectionsGenericBaseIComparerSystemStringConstructor, IntPtr releaseSystemBaseStringComparer, IntPtr systemBaseStringComparerConstructor, - IntPtr releaseSystemCollectionsBaseICollection, - IntPtr systemCollectionsBaseICollectionConstructor, - IntPtr releaseSystemCollectionsBaseIList, - IntPtr systemCollectionsBaseIListConstructor, IntPtr systemCollectionsQueuePropertyGetCount, IntPtr releaseSystemCollectionsBaseQueue, IntPtr systemCollectionsBaseQueueConstructor, @@ -408,13 +411,6 @@ delegate void InitDelegate( IntPtr releaseUnityEnginePlayablesPlayableHandle, IntPtr boxPlayableHandle, IntPtr unboxPlayableHandle, - IntPtr releaseUnityEnginePlayablesPlayableGraph, - IntPtr boxPlayableGraph, - IntPtr unboxPlayableGraph, - IntPtr releaseUnityEngineAnimationsAnimationMixerPlayable, - IntPtr unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean, - IntPtr boxAnimationMixerPlayable, - IntPtr unboxAnimationMixerPlayable, IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1, IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString, IntPtr boxInteractionSourcePositionAccuracy, @@ -555,69 +551,6 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke public delegate int SystemStringComparerGetHashCodeDelegate(int thisHandle, int param0); public static SystemStringComparerGetHashCodeDelegate SystemStringComparerGetHashCode; - public delegate void SystemCollectionsICollectionCopyToDelegate(int thisHandle, int param0, int param1); - public static SystemCollectionsICollectionCopyToDelegate SystemCollectionsICollectionCopyTo; - - public delegate int SystemCollectionsICollectionGetEnumeratorDelegate(int thisHandle); - public static SystemCollectionsICollectionGetEnumeratorDelegate SystemCollectionsICollectionGetEnumerator; - - public delegate int SystemCollectionsICollectionGetCountDelegate(int thisHandle); - public static SystemCollectionsICollectionGetCountDelegate SystemCollectionsICollectionGetCount; - - public delegate bool SystemCollectionsICollectionGetIsSynchronizedDelegate(int thisHandle); - public static SystemCollectionsICollectionGetIsSynchronizedDelegate SystemCollectionsICollectionGetIsSynchronized; - - public delegate int SystemCollectionsICollectionGetSyncRootDelegate(int thisHandle); - public static SystemCollectionsICollectionGetSyncRootDelegate SystemCollectionsICollectionGetSyncRoot; - - public delegate int SystemCollectionsIListAddDelegate(int thisHandle, int param0); - public static SystemCollectionsIListAddDelegate SystemCollectionsIListAdd; - - public delegate void SystemCollectionsIListClearDelegate(int thisHandle); - public static SystemCollectionsIListClearDelegate SystemCollectionsIListClear; - - public delegate bool SystemCollectionsIListContainsDelegate(int thisHandle, int param0); - public static SystemCollectionsIListContainsDelegate SystemCollectionsIListContains; - - public delegate int SystemCollectionsIListIndexOfDelegate(int thisHandle, int param0); - public static SystemCollectionsIListIndexOfDelegate SystemCollectionsIListIndexOf; - - public delegate void SystemCollectionsIListInsertDelegate(int thisHandle, int param0, int param1); - public static SystemCollectionsIListInsertDelegate SystemCollectionsIListInsert; - - public delegate void SystemCollectionsIListRemoveDelegate(int thisHandle, int param0); - public static SystemCollectionsIListRemoveDelegate SystemCollectionsIListRemove; - - public delegate void SystemCollectionsIListRemoveAtDelegate(int thisHandle, int param0); - public static SystemCollectionsIListRemoveAtDelegate SystemCollectionsIListRemoveAt; - - public delegate int SystemCollectionsIListGetEnumeratorDelegate(int thisHandle); - public static SystemCollectionsIListGetEnumeratorDelegate SystemCollectionsIListGetEnumerator; - - public delegate void SystemCollectionsIListCopyToDelegate(int thisHandle, int param0, int param1); - public static SystemCollectionsIListCopyToDelegate SystemCollectionsIListCopyTo; - - public delegate bool SystemCollectionsIListGetIsFixedSizeDelegate(int thisHandle); - public static SystemCollectionsIListGetIsFixedSizeDelegate SystemCollectionsIListGetIsFixedSize; - - public delegate bool SystemCollectionsIListGetIsReadOnlyDelegate(int thisHandle); - public static SystemCollectionsIListGetIsReadOnlyDelegate SystemCollectionsIListGetIsReadOnly; - - public delegate int SystemCollectionsIListGetItemDelegate(int thisHandle, int param0); - public static SystemCollectionsIListGetItemDelegate SystemCollectionsIListGetItem; - - public delegate void SystemCollectionsIListSetItemDelegate(int thisHandle, int param0, int param1); - public static SystemCollectionsIListSetItemDelegate SystemCollectionsIListSetItem; - - public delegate int SystemCollectionsIListGetCountDelegate(int thisHandle); - public static SystemCollectionsIListGetCountDelegate SystemCollectionsIListGetCount; - - public delegate bool SystemCollectionsIListGetIsSynchronizedDelegate(int thisHandle); - public static SystemCollectionsIListGetIsSynchronizedDelegate SystemCollectionsIListGetIsSynchronized; - - public delegate int SystemCollectionsIListGetSyncRootDelegate(int thisHandle); - public static SystemCollectionsIListGetSyncRootDelegate SystemCollectionsIListGetSyncRoot; - public delegate int SystemCollectionsQueueGetCountDelegate(int thisHandle); public static SystemCollectionsQueueGetCountDelegate SystemCollectionsQueueGetCount; @@ -827,23 +760,56 @@ static extern void Init( IntPtr setException, IntPtr arrayGetLength, /*BEGIN INIT PARAMS*/ - IntPtr systemDiagnosticsStopwatchConstructor, - IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds, - IntPtr systemDiagnosticsStopwatchMethodStart, - IntPtr systemDiagnosticsStopwatchMethodReset, + IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, + IntPtr unityEngineVector3PropertyGetMagnitude, + IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, + IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, + IntPtr unityEngineVector3Methodop_UnaryNegationUnityEngineVector3, + IntPtr boxVector3, + IntPtr unboxVector3, IntPtr unityEngineObjectPropertyGetName, IntPtr unityEngineObjectPropertySetName, IntPtr unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject, IntPtr unityEngineObjectMethodop_ImplicitUnityEngineObject, + IntPtr unityEngineComponentPropertyGetTransform, + IntPtr unityEngineTransformPropertyGetPosition, + IntPtr unityEngineTransformPropertySetPosition, + IntPtr boxColor, + IntPtr unboxColor, + IntPtr boxGradientColorKey, + IntPtr unboxGradientColorKey, + IntPtr releaseUnityEngineResolution, + IntPtr unityEngineResolutionPropertyGetWidth, + IntPtr unityEngineResolutionPropertySetWidth, + IntPtr unityEngineResolutionPropertyGetHeight, + IntPtr unityEngineResolutionPropertySetHeight, + IntPtr unityEngineResolutionPropertyGetRefreshRate, + IntPtr unityEngineResolutionPropertySetRefreshRate, + IntPtr boxResolution, + IntPtr unboxResolution, + IntPtr releaseUnityEngineRaycastHit, + IntPtr unityEngineRaycastHitPropertyGetPoint, + IntPtr unityEngineRaycastHitPropertySetPoint, + IntPtr unityEngineRaycastHitPropertyGetTransform, + IntPtr boxRaycastHit, + IntPtr unboxRaycastHit, + IntPtr releaseUnityEnginePlayablesPlayableGraph, + IntPtr boxPlayableGraph, + IntPtr unboxPlayableGraph, + IntPtr releaseUnityEngineAnimationsAnimationMixerPlayable, + IntPtr unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean, + IntPtr boxAnimationMixerPlayable, + IntPtr unboxAnimationMixerPlayable, + IntPtr systemDiagnosticsStopwatchConstructor, + IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds, + IntPtr systemDiagnosticsStopwatchMethodStart, + IntPtr systemDiagnosticsStopwatchMethodReset, IntPtr unityEngineGameObjectConstructor, IntPtr unityEngineGameObjectConstructorSystemString, IntPtr unityEngineGameObjectPropertyGetTransform, IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript, IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript, IntPtr unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType, - IntPtr unityEngineComponentPropertyGetTransform, - IntPtr unityEngineTransformPropertyGetPosition, - IntPtr unityEngineTransformPropertySetPosition, IntPtr unityEngineDebugMethodLogSystemObject, IntPtr unityEngineAssertionsAssertFieldGetRaiseExceptions, IntPtr unityEngineAssertionsAssertFieldSetRaiseExceptions, @@ -853,25 +819,12 @@ static extern void Init( 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 boxVector3, - IntPtr unboxVector3, IntPtr boxQuaternion, IntPtr unboxQuaternion, IntPtr unityEngineMatrix4x4PropertyGetItem, IntPtr unityEngineMatrix4x4PropertySetItem, IntPtr boxMatrix4x4, IntPtr unboxMatrix4x4, - IntPtr releaseUnityEngineRaycastHit, - IntPtr unityEngineRaycastHitPropertyGetPoint, - IntPtr unityEngineRaycastHitPropertySetPoint, - IntPtr unityEngineRaycastHitPropertyGetTransform, - IntPtr boxRaycastHit, - IntPtr unboxRaycastHit, IntPtr boxQueryTriggerInteraction, IntPtr unboxQueryTriggerInteraction, IntPtr releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, @@ -897,15 +850,6 @@ static extern void Init( IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue, IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue, IntPtr systemExceptionConstructorSystemString, - IntPtr releaseUnityEngineResolution, - IntPtr unityEngineResolutionPropertyGetWidth, - IntPtr unityEngineResolutionPropertySetWidth, - IntPtr unityEngineResolutionPropertyGetHeight, - IntPtr unityEngineResolutionPropertySetHeight, - IntPtr unityEngineResolutionPropertyGetRefreshRate, - IntPtr unityEngineResolutionPropertySetRefreshRate, - IntPtr boxResolution, - IntPtr unboxResolution, IntPtr unityEngineScreenPropertyGetResolutions, IntPtr releaseUnityEngineRay, IntPtr unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3, @@ -913,10 +857,6 @@ static extern void Init( IntPtr unboxRay, IntPtr unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1, IntPtr unityEnginePhysicsMethodRaycastAllUnityEngineRay, - IntPtr boxColor, - IntPtr unboxColor, - IntPtr boxGradientColorKey, - IntPtr unboxGradientColorKey, IntPtr unityEngineGradientConstructor, IntPtr unityEngineGradientPropertyGetColorKeys, IntPtr unityEngineGradientPropertySetColorKeys, @@ -945,10 +885,6 @@ static extern void Init( IntPtr systemCollectionsGenericBaseIComparerSystemStringConstructor, IntPtr releaseSystemBaseStringComparer, IntPtr systemBaseStringComparerConstructor, - IntPtr releaseSystemCollectionsBaseICollection, - IntPtr systemCollectionsBaseICollectionConstructor, - IntPtr releaseSystemCollectionsBaseIList, - IntPtr systemCollectionsBaseIListConstructor, IntPtr systemCollectionsQueuePropertyGetCount, IntPtr releaseSystemCollectionsBaseQueue, IntPtr systemCollectionsBaseQueueConstructor, @@ -961,13 +897,6 @@ static extern void Init( IntPtr releaseUnityEnginePlayablesPlayableHandle, IntPtr boxPlayableHandle, IntPtr unboxPlayableHandle, - IntPtr releaseUnityEnginePlayablesPlayableGraph, - IntPtr boxPlayableGraph, - IntPtr unboxPlayableGraph, - IntPtr releaseUnityEngineAnimationsAnimationMixerPlayable, - IntPtr unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean, - IntPtr boxAnimationMixerPlayable, - IntPtr unboxAnimationMixerPlayable, IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1, IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString, IntPtr boxInteractionSourcePositionAccuracy, @@ -1109,69 +1038,6 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke [DllImport(Constants.PluginName)] public static extern void SystemStringComparerGetHashCode(int thisHandle, int param0); - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsICollectionCopyTo(int thisHandle, int param0, int param1); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsICollectionGetEnumerator(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsICollectionGetCount(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsICollectionGetIsSynchronized(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsICollectionGetSyncRoot(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListAdd(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListClear(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListContains(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListIndexOf(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListInsert(int thisHandle, int param0, int param1); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListRemove(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListRemoveAt(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListGetEnumerator(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListCopyTo(int thisHandle, int param0, int param1); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListGetIsFixedSize(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListGetIsReadOnly(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListGetItem(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListSetItem(int thisHandle, int param0, int param1); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListGetCount(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListGetIsSynchronized(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsIListGetSyncRoot(int thisHandle); - [DllImport(Constants.PluginName)] public static extern void SystemCollectionsQueueGetCount(int thisHandle); @@ -1291,32 +1157,6 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate int ArrayGetLengthDelegate(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 UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScriptDelegate(int thisHandle); - delegate int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate(UnityEngine.PrimitiveType type); - 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 int UnityEngineMonoBehaviourPropertyGetTransformDelegate(int thisHandle); - 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); @@ -1324,18 +1164,64 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate UnityEngine.Vector3 UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3Delegate(ref UnityEngine.Vector3 a); delegate int BoxVector3Delegate(ref UnityEngine.Vector3 val); delegate UnityEngine.Vector3 UnboxVector3Delegate(int valHandle); - delegate int BoxQuaternionDelegate(ref UnityEngine.Quaternion val); - delegate UnityEngine.Quaternion UnboxQuaternionDelegate(int valHandle); - 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 int BoxMatrix4x4Delegate(ref UnityEngine.Matrix4x4 val); - delegate UnityEngine.Matrix4x4 UnboxMatrix4x4Delegate(int valHandle); - delegate void ReleaseUnityEngineRaycastHitDelegate(int handle); + 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 UnityEngineComponentPropertyGetTransformDelegate(int thisHandle); + delegate UnityEngine.Vector3 UnityEngineTransformPropertyGetPositionDelegate(int thisHandle); + delegate void UnityEngineTransformPropertySetPositionDelegate(int thisHandle, ref UnityEngine.Vector3 value); + delegate int BoxColorDelegate(ref UnityEngine.Color val); + delegate UnityEngine.Color UnboxColorDelegate(int valHandle); + delegate int BoxGradientColorKeyDelegate(ref UnityEngine.GradientColorKey val); + delegate UnityEngine.GradientColorKey UnboxGradientColorKeyDelegate(int valHandle); + delegate void ReleaseUnityEngineResolutionDelegate(int handle); + delegate int UnityEngineResolutionPropertyGetWidthDelegate(int thisHandle); + delegate void UnityEngineResolutionPropertySetWidthDelegate(int thisHandle, int value); + delegate int UnityEngineResolutionPropertyGetHeightDelegate(int thisHandle); + delegate void UnityEngineResolutionPropertySetHeightDelegate(int thisHandle, int value); + delegate int UnityEngineResolutionPropertyGetRefreshRateDelegate(int thisHandle); + delegate void UnityEngineResolutionPropertySetRefreshRateDelegate(int thisHandle, int value); + delegate int BoxResolutionDelegate(int valHandle); + delegate int UnboxResolutionDelegate(int valHandle); + 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 int BoxRaycastHitDelegate(int valHandle); delegate int UnboxRaycastHitDelegate(int valHandle); + delegate void ReleaseUnityEnginePlayablesPlayableGraphDelegate(int handle); + delegate int BoxPlayableGraphDelegate(int valHandle); + delegate int UnboxPlayableGraphDelegate(int valHandle); + delegate void ReleaseUnityEngineAnimationsAnimationMixerPlayableDelegate(int handle); + delegate int UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBooleanDelegate(int graphHandle, int inputCount, bool normalizeWeights); + delegate int BoxAnimationMixerPlayableDelegate(int valHandle); + delegate int UnboxAnimationMixerPlayableDelegate(int valHandle); + delegate int SystemDiagnosticsStopwatchConstructorDelegate(); + delegate long SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate(int thisHandle); + delegate void SystemDiagnosticsStopwatchMethodStartDelegate(int thisHandle); + delegate void SystemDiagnosticsStopwatchMethodResetDelegate(int thisHandle); + delegate int UnityEngineGameObjectConstructorDelegate(); + delegate int UnityEngineGameObjectConstructorSystemStringDelegate(int nameHandle); + delegate int UnityEngineGameObjectPropertyGetTransformDelegate(int thisHandle); + delegate int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate(int thisHandle); + delegate int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScriptDelegate(int thisHandle); + delegate int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate(UnityEngine.PrimitiveType type); + 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 int UnityEngineMonoBehaviourPropertyGetTransformDelegate(int thisHandle); + 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 int BoxQuaternionDelegate(ref UnityEngine.Quaternion val); + delegate UnityEngine.Quaternion UnboxQuaternionDelegate(int valHandle); + 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 int BoxMatrix4x4Delegate(ref UnityEngine.Matrix4x4 val); + delegate UnityEngine.Matrix4x4 UnboxMatrix4x4Delegate(int valHandle); delegate int BoxQueryTriggerInteractionDelegate(UnityEngine.QueryTriggerInteraction val); delegate UnityEngine.QueryTriggerInteraction UnboxQueryTriggerInteractionDelegate(int valHandle); delegate void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate(int handle); @@ -1361,15 +1247,6 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate(int thisHandle); delegate void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate(int thisHandle, int valueHandle); delegate int SystemExceptionConstructorSystemStringDelegate(int messageHandle); - delegate void ReleaseUnityEngineResolutionDelegate(int handle); - delegate int UnityEngineResolutionPropertyGetWidthDelegate(int thisHandle); - delegate void UnityEngineResolutionPropertySetWidthDelegate(int thisHandle, int value); - delegate int UnityEngineResolutionPropertyGetHeightDelegate(int thisHandle); - delegate void UnityEngineResolutionPropertySetHeightDelegate(int thisHandle, int value); - delegate int UnityEngineResolutionPropertyGetRefreshRateDelegate(int thisHandle); - delegate void UnityEngineResolutionPropertySetRefreshRateDelegate(int thisHandle, int value); - delegate int BoxResolutionDelegate(int valHandle); - delegate int UnboxResolutionDelegate(int valHandle); delegate int UnityEngineScreenPropertyGetResolutionsDelegate(); delegate void ReleaseUnityEngineRayDelegate(int handle); delegate int UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction); @@ -1377,10 +1254,6 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate int UnboxRayDelegate(int valHandle); delegate int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1Delegate(int rayHandle, int resultsHandle); delegate int UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate(int rayHandle); - delegate int BoxColorDelegate(ref UnityEngine.Color val); - delegate UnityEngine.Color UnboxColorDelegate(int valHandle); - delegate int BoxGradientColorKeyDelegate(ref UnityEngine.GradientColorKey val); - delegate UnityEngine.GradientColorKey UnboxGradientColorKeyDelegate(int valHandle); delegate int UnityEngineGradientConstructorDelegate(); delegate int UnityEngineGradientPropertyGetColorKeysDelegate(int thisHandle); delegate void UnityEngineGradientPropertySetColorKeysDelegate(int thisHandle, int valueHandle); @@ -1409,10 +1282,6 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate void ReleaseSystemCollectionsGenericBaseIComparerSystemStringDelegate(int handle); delegate void SystemBaseStringComparerConstructorDelegate(int cppHandle, ref int handle); delegate void ReleaseSystemBaseStringComparerDelegate(int handle); - delegate void SystemCollectionsBaseICollectionConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemCollectionsBaseICollectionDelegate(int handle); - delegate void SystemCollectionsBaseIListConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemCollectionsBaseIListDelegate(int handle); delegate int SystemCollectionsQueuePropertyGetCountDelegate(int thisHandle); delegate void SystemCollectionsBaseQueueConstructorDelegate(int cppHandle, ref int handle); delegate void ReleaseSystemCollectionsBaseQueueDelegate(int handle); @@ -1425,13 +1294,6 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate void ReleaseUnityEnginePlayablesPlayableHandleDelegate(int handle); delegate int BoxPlayableHandleDelegate(int valHandle); delegate int UnboxPlayableHandleDelegate(int valHandle); - delegate void ReleaseUnityEnginePlayablesPlayableGraphDelegate(int handle); - delegate int BoxPlayableGraphDelegate(int valHandle); - delegate int UnboxPlayableGraphDelegate(int valHandle); - delegate void ReleaseUnityEngineAnimationsAnimationMixerPlayableDelegate(int handle); - delegate int UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBooleanDelegate(int graphHandle, int inputCount, bool normalizeWeights); - delegate int BoxAnimationMixerPlayableDelegate(int valHandle); - delegate int UnboxAnimationMixerPlayableDelegate(int valHandle); delegate int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1Delegate(int eHandle, int nameHandle, int classesHandle); delegate int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringDelegate(int eHandle, int nameHandle, int classNameHandle); delegate int BoxInteractionSourcePositionAccuracyDelegate(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy val); @@ -1570,14 +1432,14 @@ public static void Open( { ObjectStore.Init(maxManagedObjects); /*BEGIN STRUCTSTORE INIT CALLS*/ + NativeScript.Bindings.StructStore.Init(maxManagedObjects); NativeScript.Bindings.StructStore.Init(1000); + NativeScript.Bindings.StructStore.Init(maxManagedObjects); + NativeScript.Bindings.StructStore.Init(maxManagedObjects); NativeScript.Bindings.StructStore>.Init(maxManagedObjects); - NativeScript.Bindings.StructStore.Init(maxManagedObjects); NativeScript.Bindings.StructStore.Init(maxManagedObjects); NativeScript.Bindings.StructStore.Init(maxManagedObjects); NativeScript.Bindings.StructStore.Init(maxManagedObjects); - NativeScript.Bindings.StructStore.Init(maxManagedObjects); - NativeScript.Bindings.StructStore.Init(maxManagedObjects); NativeScript.Bindings.StructStore.Init(maxManagedObjects); /*END STRUCTSTORE INIT CALLS*/ @@ -1598,27 +1460,6 @@ public static void Open( SystemStringComparerCompare = GetDelegate(libraryHandle, "SystemStringComparerCompare"); SystemStringComparerEquals = GetDelegate(libraryHandle, "SystemStringComparerEquals"); SystemStringComparerGetHashCode = GetDelegate(libraryHandle, "SystemStringComparerGetHashCode"); - SystemCollectionsICollectionCopyTo = GetDelegate(libraryHandle, "SystemCollectionsICollectionCopyTo"); - SystemCollectionsICollectionGetEnumerator = GetDelegate(libraryHandle, "SystemCollectionsICollectionGetEnumerator"); - SystemCollectionsICollectionGetCount = GetDelegate(libraryHandle, "SystemCollectionsICollectionGetCount"); - SystemCollectionsICollectionGetIsSynchronized = GetDelegate(libraryHandle, "SystemCollectionsICollectionGetIsSynchronized"); - SystemCollectionsICollectionGetSyncRoot = GetDelegate(libraryHandle, "SystemCollectionsICollectionGetSyncRoot"); - SystemCollectionsIListAdd = GetDelegate(libraryHandle, "SystemCollectionsIListAdd"); - SystemCollectionsIListClear = GetDelegate(libraryHandle, "SystemCollectionsIListClear"); - SystemCollectionsIListContains = GetDelegate(libraryHandle, "SystemCollectionsIListContains"); - SystemCollectionsIListIndexOf = GetDelegate(libraryHandle, "SystemCollectionsIListIndexOf"); - SystemCollectionsIListInsert = GetDelegate(libraryHandle, "SystemCollectionsIListInsert"); - SystemCollectionsIListRemove = GetDelegate(libraryHandle, "SystemCollectionsIListRemove"); - SystemCollectionsIListRemoveAt = GetDelegate(libraryHandle, "SystemCollectionsIListRemoveAt"); - SystemCollectionsIListGetEnumerator = GetDelegate(libraryHandle, "SystemCollectionsIListGetEnumerator"); - SystemCollectionsIListCopyTo = GetDelegate(libraryHandle, "SystemCollectionsIListCopyTo"); - SystemCollectionsIListGetIsFixedSize = GetDelegate(libraryHandle, "SystemCollectionsIListGetIsFixedSize"); - SystemCollectionsIListGetIsReadOnly = GetDelegate(libraryHandle, "SystemCollectionsIListGetIsReadOnly"); - SystemCollectionsIListGetItem = GetDelegate(libraryHandle, "SystemCollectionsIListGetItem"); - SystemCollectionsIListSetItem = GetDelegate(libraryHandle, "SystemCollectionsIListSetItem"); - SystemCollectionsIListGetCount = GetDelegate(libraryHandle, "SystemCollectionsIListGetCount"); - SystemCollectionsIListGetIsSynchronized = GetDelegate(libraryHandle, "SystemCollectionsIListGetIsSynchronized"); - SystemCollectionsIListGetSyncRoot = GetDelegate(libraryHandle, "SystemCollectionsIListGetSyncRoot"); SystemCollectionsQueueGetCount = GetDelegate(libraryHandle, "SystemCollectionsQueueGetCount"); SystemComponentModelDesignIComponentChangeServiceOnComponentChanged = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceOnComponentChanged"); SystemComponentModelDesignIComponentChangeServiceOnComponentChanging = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceOnComponentChanging"); @@ -1668,23 +1509,56 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new SetExceptionDelegate(SetException)), Marshal.GetFunctionPointerForDelegate(new ArrayGetLengthDelegate(ArrayGetLength)), /*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 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 BoxVector3Delegate(BoxVector3)), + Marshal.GetFunctionPointerForDelegate(new UnboxVector3Delegate(UnboxVector3)), 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 UnityEngineComponentPropertyGetTransformDelegate(UnityEngineComponentPropertyGetTransform)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformPropertyGetPositionDelegate(UnityEngineTransformPropertyGetPosition)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformPropertySetPositionDelegate(UnityEngineTransformPropertySetPosition)), + Marshal.GetFunctionPointerForDelegate(new BoxColorDelegate(BoxColor)), + Marshal.GetFunctionPointerForDelegate(new UnboxColorDelegate(UnboxColor)), + Marshal.GetFunctionPointerForDelegate(new BoxGradientColorKeyDelegate(BoxGradientColorKey)), + Marshal.GetFunctionPointerForDelegate(new UnboxGradientColorKeyDelegate(UnboxGradientColorKey)), + Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineResolutionDelegate(ReleaseUnityEngineResolution)), + 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 BoxResolutionDelegate(BoxResolution)), + Marshal.GetFunctionPointerForDelegate(new UnboxResolutionDelegate(UnboxResolution)), + Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineRaycastHitDelegate(ReleaseUnityEngineRaycastHit)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetPointDelegate(UnityEngineRaycastHitPropertyGetPoint)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertySetPointDelegate(UnityEngineRaycastHitPropertySetPoint)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetTransformDelegate(UnityEngineRaycastHitPropertyGetTransform)), + Marshal.GetFunctionPointerForDelegate(new BoxRaycastHitDelegate(BoxRaycastHit)), + Marshal.GetFunctionPointerForDelegate(new UnboxRaycastHitDelegate(UnboxRaycastHit)), + Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEnginePlayablesPlayableGraphDelegate(ReleaseUnityEnginePlayablesPlayableGraph)), + Marshal.GetFunctionPointerForDelegate(new BoxPlayableGraphDelegate(BoxPlayableGraph)), + Marshal.GetFunctionPointerForDelegate(new UnboxPlayableGraphDelegate(UnboxPlayableGraph)), + Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineAnimationsAnimationMixerPlayableDelegate(ReleaseUnityEngineAnimationsAnimationMixerPlayable)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBooleanDelegate(UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)), + Marshal.GetFunctionPointerForDelegate(new BoxAnimationMixerPlayableDelegate(BoxAnimationMixerPlayable)), + Marshal.GetFunctionPointerForDelegate(new UnboxAnimationMixerPlayableDelegate(UnboxAnimationMixerPlayable)), + Marshal.GetFunctionPointerForDelegate(new SystemDiagnosticsStopwatchConstructorDelegate(SystemDiagnosticsStopwatchConstructor)), + Marshal.GetFunctionPointerForDelegate(new SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate(SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)), + Marshal.GetFunctionPointerForDelegate(new SystemDiagnosticsStopwatchMethodStartDelegate(SystemDiagnosticsStopwatchMethodStart)), + Marshal.GetFunctionPointerForDelegate(new SystemDiagnosticsStopwatchMethodResetDelegate(SystemDiagnosticsStopwatchMethodReset)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectConstructorDelegate(UnityEngineGameObjectConstructor)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectConstructorSystemStringDelegate(UnityEngineGameObjectConstructorSystemString)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectPropertyGetTransformDelegate(UnityEngineGameObjectPropertyGetTransform)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScriptDelegate(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)), - 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)), @@ -1694,25 +1568,12 @@ public static void Open( 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 BoxVector3Delegate(BoxVector3)), - Marshal.GetFunctionPointerForDelegate(new UnboxVector3Delegate(UnboxVector3)), Marshal.GetFunctionPointerForDelegate(new BoxQuaternionDelegate(BoxQuaternion)), Marshal.GetFunctionPointerForDelegate(new UnboxQuaternionDelegate(UnboxQuaternion)), Marshal.GetFunctionPointerForDelegate(new UnityEngineMatrix4x4PropertyGetItemDelegate(UnityEngineMatrix4x4PropertyGetItem)), Marshal.GetFunctionPointerForDelegate(new UnityEngineMatrix4x4PropertySetItemDelegate(UnityEngineMatrix4x4PropertySetItem)), Marshal.GetFunctionPointerForDelegate(new BoxMatrix4x4Delegate(BoxMatrix4x4)), Marshal.GetFunctionPointerForDelegate(new UnboxMatrix4x4Delegate(UnboxMatrix4x4)), - Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineRaycastHitDelegate(ReleaseUnityEngineRaycastHit)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetPointDelegate(UnityEngineRaycastHitPropertyGetPoint)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertySetPointDelegate(UnityEngineRaycastHitPropertySetPoint)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetTransformDelegate(UnityEngineRaycastHitPropertyGetTransform)), - Marshal.GetFunctionPointerForDelegate(new BoxRaycastHitDelegate(BoxRaycastHit)), - Marshal.GetFunctionPointerForDelegate(new UnboxRaycastHitDelegate(UnboxRaycastHit)), Marshal.GetFunctionPointerForDelegate(new BoxQueryTriggerInteractionDelegate(BoxQueryTriggerInteraction)), Marshal.GetFunctionPointerForDelegate(new UnboxQueryTriggerInteractionDelegate(UnboxQueryTriggerInteraction)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate(ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)), @@ -1738,15 +1599,6 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)), Marshal.GetFunctionPointerForDelegate(new SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)), Marshal.GetFunctionPointerForDelegate(new SystemExceptionConstructorSystemStringDelegate(SystemExceptionConstructorSystemString)), - Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineResolutionDelegate(ReleaseUnityEngineResolution)), - 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 BoxResolutionDelegate(BoxResolution)), - Marshal.GetFunctionPointerForDelegate(new UnboxResolutionDelegate(UnboxResolution)), Marshal.GetFunctionPointerForDelegate(new UnityEngineScreenPropertyGetResolutionsDelegate(UnityEngineScreenPropertyGetResolutions)), Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineRayDelegate(ReleaseUnityEngineRay)), Marshal.GetFunctionPointerForDelegate(new UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)), @@ -1754,10 +1606,6 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new UnboxRayDelegate(UnboxRay)), Marshal.GetFunctionPointerForDelegate(new UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1Delegate(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1)), Marshal.GetFunctionPointerForDelegate(new UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate(UnityEnginePhysicsMethodRaycastAllUnityEngineRay)), - Marshal.GetFunctionPointerForDelegate(new BoxColorDelegate(BoxColor)), - Marshal.GetFunctionPointerForDelegate(new UnboxColorDelegate(UnboxColor)), - Marshal.GetFunctionPointerForDelegate(new BoxGradientColorKeyDelegate(BoxGradientColorKey)), - Marshal.GetFunctionPointerForDelegate(new UnboxGradientColorKeyDelegate(UnboxGradientColorKey)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientConstructorDelegate(UnityEngineGradientConstructor)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientPropertyGetColorKeysDelegate(UnityEngineGradientPropertyGetColorKeys)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientPropertySetColorKeysDelegate(UnityEngineGradientPropertySetColorKeys)), @@ -1786,10 +1634,6 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericBaseIComparerSystemStringConstructorDelegate(SystemCollectionsGenericBaseIComparerSystemStringConstructor)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemBaseStringComparerDelegate(ReleaseSystemBaseStringComparer)), Marshal.GetFunctionPointerForDelegate(new SystemBaseStringComparerConstructorDelegate(SystemBaseStringComparerConstructor)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsBaseICollectionDelegate(ReleaseSystemCollectionsBaseICollection)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsBaseICollectionConstructorDelegate(SystemCollectionsBaseICollectionConstructor)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsBaseIListDelegate(ReleaseSystemCollectionsBaseIList)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsBaseIListConstructorDelegate(SystemCollectionsBaseIListConstructor)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsQueuePropertyGetCountDelegate(SystemCollectionsQueuePropertyGetCount)), Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsBaseQueueDelegate(ReleaseSystemCollectionsBaseQueue)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsBaseQueueConstructorDelegate(SystemCollectionsBaseQueueConstructor)), @@ -1802,13 +1646,6 @@ public static void Open( Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEnginePlayablesPlayableHandleDelegate(ReleaseUnityEnginePlayablesPlayableHandle)), Marshal.GetFunctionPointerForDelegate(new BoxPlayableHandleDelegate(BoxPlayableHandle)), Marshal.GetFunctionPointerForDelegate(new UnboxPlayableHandleDelegate(UnboxPlayableHandle)), - Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEnginePlayablesPlayableGraphDelegate(ReleaseUnityEnginePlayablesPlayableGraph)), - Marshal.GetFunctionPointerForDelegate(new BoxPlayableGraphDelegate(BoxPlayableGraph)), - Marshal.GetFunctionPointerForDelegate(new UnboxPlayableGraphDelegate(UnboxPlayableGraph)), - Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineAnimationsAnimationMixerPlayableDelegate(ReleaseUnityEngineAnimationsAnimationMixerPlayable)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBooleanDelegate(UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)), - Marshal.GetFunctionPointerForDelegate(new BoxAnimationMixerPlayableDelegate(BoxAnimationMixerPlayable)), - Marshal.GetFunctionPointerForDelegate(new UnboxAnimationMixerPlayableDelegate(UnboxAnimationMixerPlayable)), Marshal.GetFunctionPointerForDelegate(new UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1Delegate(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1)), Marshal.GetFunctionPointerForDelegate(new UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringDelegate(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString)), Marshal.GetFunctionPointerForDelegate(new BoxInteractionSourcePositionAccuracyDelegate(BoxInteractionSourcePositionAccuracy)), @@ -2113,23 +1950,58 @@ public override int GetHashCode(string obj) } - class SystemCollectionsBaseICollection : System.Collections.ICollection + class SystemCollectionsBaseQueue : System.Collections.Queue + { + public int CppHandle; + + public SystemCollectionsBaseQueue(int cppHandle) + : base() + { + CppHandle = cppHandle; + } + + public override int Count + { + get + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + var returnVal = NativeScript.Bindings.SystemCollectionsQueueGetCount(thisHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + return returnVal; + } + return default(int); + } + } + + } + + class SystemComponentModelDesignBaseIComponentChangeService : System.ComponentModel.Design.IComponentChangeService { public int CppHandle; - public SystemCollectionsBaseICollection(int cppHandle) + public SystemComponentModelDesignBaseIComponentChangeService(int cppHandle) : base() { CppHandle = cppHandle; } - public void CopyTo(System.Array array, int index) + public void OnComponentChanged(object component, System.ComponentModel.MemberDescriptor member, object oldValue, object newValue) { if (CppHandle != 0) { int thisHandle = CppHandle; - int arrayHandle = NativeScript.Bindings.ObjectStore.GetHandle(array); - NativeScript.Bindings.SystemCollectionsICollectionCopyTo(thisHandle, arrayHandle, index); + int componentHandle = NativeScript.Bindings.ObjectStore.GetHandle(component); + int memberHandle = NativeScript.Bindings.ObjectStore.GetHandle(member); + int oldValueHandle = NativeScript.Bindings.ObjectStore.GetHandle(oldValue); + int newValueHandle = NativeScript.Bindings.ObjectStore.GetHandle(newValue); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceOnComponentChanged(thisHandle, componentHandle, memberHandle, oldValueHandle, newValueHandle); if (NativeScript.Bindings.UnhandledCppException != null) { Exception ex = NativeScript.Bindings.UnhandledCppException; @@ -2139,528 +2011,92 @@ public void CopyTo(System.Array array, int index) } } - public System.Collections.IEnumerator GetEnumerator() + public void OnComponentChanging(object component, System.ComponentModel.MemberDescriptor member) { if (CppHandle != 0) { int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemCollectionsICollectionGetEnumerator(thisHandle); + int componentHandle = NativeScript.Bindings.ObjectStore.GetHandle(component); + int memberHandle = NativeScript.Bindings.ObjectStore.GetHandle(member); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceOnComponentChanging(thisHandle, componentHandle, memberHandle); if (NativeScript.Bindings.UnhandledCppException != null) { Exception ex = NativeScript.Bindings.UnhandledCppException; NativeScript.Bindings.UnhandledCppException = null; throw ex; } - return (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(returnVal); } - return default(System.Collections.IEnumerator); } - public int Count + public event System.ComponentModel.Design.ComponentEventHandler ComponentAdded { - get + add { if (CppHandle != 0) { int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemCollectionsICollectionGetCount(thisHandle); + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentAdded(thisHandle, valueHandle); if (NativeScript.Bindings.UnhandledCppException != null) { Exception ex = NativeScript.Bindings.UnhandledCppException; NativeScript.Bindings.UnhandledCppException = null; throw ex; } - return returnVal; } - return default(int); } - } - - public bool IsSynchronized - { - get + remove { if (CppHandle != 0) { int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemCollectionsICollectionGetIsSynchronized(thisHandle); + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded(thisHandle, valueHandle); if (NativeScript.Bindings.UnhandledCppException != null) { Exception ex = NativeScript.Bindings.UnhandledCppException; NativeScript.Bindings.UnhandledCppException = null; throw ex; } - return returnVal; } - return default(bool); } } - public object SyncRoot + public event System.ComponentModel.Design.ComponentEventHandler ComponentAdding { - get + add { if (CppHandle != 0) { int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemCollectionsICollectionGetSyncRoot(thisHandle); + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentAdding(thisHandle, valueHandle); if (NativeScript.Bindings.UnhandledCppException != null) { Exception ex = NativeScript.Bindings.UnhandledCppException; NativeScript.Bindings.UnhandledCppException = null; throw ex; } - return NativeScript.Bindings.ObjectStore.Get(returnVal); } - return default(object); } - } - - } - - class SystemCollectionsBaseIList : System.Collections.IList - { - public int CppHandle; - - public SystemCollectionsBaseIList(int cppHandle) - : base() - { - CppHandle = cppHandle; - } - - public int Add(object value) - { - if (CppHandle != 0) + remove { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - var returnVal = NativeScript.Bindings.SystemCollectionsIListAdd(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) + if (CppHandle != 0) { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; + int thisHandle = CppHandle; + int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); + NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding(thisHandle, valueHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } } - return returnVal; } - return default(int); } - public void Clear() - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - NativeScript.Bindings.SystemCollectionsIListClear(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - public bool Contains(object value) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - var returnVal = NativeScript.Bindings.SystemCollectionsIListContains(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } - return default(bool); - } - - public int IndexOf(object value) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - var returnVal = NativeScript.Bindings.SystemCollectionsIListIndexOf(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } - return default(int); - } - - public void Insert(int index, object value) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemCollectionsIListInsert(thisHandle, index, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - public void Remove(object value) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemCollectionsIListRemove(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - public void RemoveAt(int index) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - NativeScript.Bindings.SystemCollectionsIListRemoveAt(thisHandle, index); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - public System.Collections.IEnumerator GetEnumerator() - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemCollectionsIListGetEnumerator(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(returnVal); - } - return default(System.Collections.IEnumerator); - } - - public void CopyTo(System.Array array, int index) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int arrayHandle = NativeScript.Bindings.ObjectStore.GetHandle(array); - NativeScript.Bindings.SystemCollectionsIListCopyTo(thisHandle, arrayHandle, index); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - public bool IsFixedSize - { - get - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemCollectionsIListGetIsFixedSize(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } - return default(bool); - } - } - - public bool IsReadOnly - { - get - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemCollectionsIListGetIsReadOnly(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } - return default(bool); - } - } - - public object this[int index] - { - get - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemCollectionsIListGetItem(thisHandle, index); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return NativeScript.Bindings.ObjectStore.Get(returnVal); - } - return default(object); - } - set - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemCollectionsIListSetItem(thisHandle, index, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - - public int Count - { - get - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemCollectionsIListGetCount(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } - return default(int); - } - } - - public bool IsSynchronized - { - get - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemCollectionsIListGetIsSynchronized(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } - return default(bool); - } - } - - public object SyncRoot - { - get - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemCollectionsIListGetSyncRoot(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return NativeScript.Bindings.ObjectStore.Get(returnVal); - } - return default(object); - } - } - - } - - class SystemCollectionsBaseQueue : System.Collections.Queue - { - public int CppHandle; - - public SystemCollectionsBaseQueue(int cppHandle) - : base() - { - CppHandle = cppHandle; - } - - public override int Count - { - get - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemCollectionsQueueGetCount(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } - return default(int); - } - } - - } - - class SystemComponentModelDesignBaseIComponentChangeService : System.ComponentModel.Design.IComponentChangeService - { - public int CppHandle; - - public SystemComponentModelDesignBaseIComponentChangeService(int cppHandle) - : base() - { - CppHandle = cppHandle; - } - - public void OnComponentChanged(object component, System.ComponentModel.MemberDescriptor member, object oldValue, object newValue) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int componentHandle = NativeScript.Bindings.ObjectStore.GetHandle(component); - int memberHandle = NativeScript.Bindings.ObjectStore.GetHandle(member); - int oldValueHandle = NativeScript.Bindings.ObjectStore.GetHandle(oldValue); - int newValueHandle = NativeScript.Bindings.ObjectStore.GetHandle(newValue); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceOnComponentChanged(thisHandle, componentHandle, memberHandle, oldValueHandle, newValueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - public void OnComponentChanging(object component, System.ComponentModel.MemberDescriptor member) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int componentHandle = NativeScript.Bindings.ObjectStore.GetHandle(component); - int memberHandle = NativeScript.Bindings.ObjectStore.GetHandle(member); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceOnComponentChanging(thisHandle, componentHandle, memberHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - public event System.ComponentModel.Design.ComponentEventHandler ComponentAdded - { - add - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentAdded(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - remove - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - - public event System.ComponentModel.Design.ComponentEventHandler ComponentAdding - { - add - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentAdding(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - remove - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - - public event System.ComponentModel.Design.ComponentChangedEventHandler ComponentChanged + public event System.ComponentModel.Design.ComponentChangedEventHandler ComponentChanged { add { @@ -3176,123 +2612,190 @@ public void NativeInvoke(object sender, System.ComponentModel.Design.ComponentCh } } } - + + } + + class SystemComponentModelDesignComponentRenameEventHandler + { + public int CppHandle; + public System.ComponentModel.Design.ComponentRenameEventHandler Delegate; + + public SystemComponentModelDesignComponentRenameEventHandler(int cppHandle) + { + CppHandle = cppHandle; + Delegate = NativeInvoke; + } + + public void NativeInvoke(object sender, System.ComponentModel.Design.ComponentRenameEventArgs e) + { + if (CppHandle != 0) + { + int thisHandle = CppHandle; + int senderHandle = NativeScript.Bindings.ObjectStore.GetHandle(sender); + int eHandle = NativeScript.Bindings.ObjectStore.GetHandle(e); + NativeScript.Bindings.SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke(thisHandle, senderHandle, eHandle); + if (NativeScript.Bindings.UnhandledCppException != null) + { + Exception ex = NativeScript.Bindings.UnhandledCppException; + NativeScript.Bindings.UnhandledCppException = null; + throw ex; + } + } + } + + } + /*END BASE TYPES*/ + + /*BEGIN FUNCTIONS*/ + [MonoPInvokeCallback(typeof(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate))] + static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(float x, float y, float z) + { + try + { + var returnValue = new UnityEngine.Vector3(x, y, z); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineVector3PropertyGetMagnitudeDelegate))] + static float UnityEngineVector3PropertyGetMagnitude(ref UnityEngine.Vector3 thiz) + { + try + { + var returnValue = thiz.magnitude; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } } - class SystemComponentModelDesignComponentRenameEventHandler + [MonoPInvokeCallback(typeof(UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingleDelegate))] + static void UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(ref UnityEngine.Vector3 thiz, float newX, float newY, float newZ) { - public int CppHandle; - public System.ComponentModel.Design.ComponentRenameEventHandler Delegate; - - public SystemComponentModelDesignComponentRenameEventHandler(int cppHandle) + try { - CppHandle = cppHandle; - Delegate = NativeInvoke; + thiz.Set(newX, newY, newZ); } - - public void NativeInvoke(object sender, System.ComponentModel.Design.ComponentRenameEventArgs e) + catch (System.NullReferenceException ex) { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int senderHandle = NativeScript.Bindings.ObjectStore.GetHandle(sender); - int eHandle = NativeScript.Bindings.ObjectStore.GetHandle(e); - NativeScript.Bindings.SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke(thisHandle, senderHandle, eHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); } - } - /*END BASE TYPES*/ - /*BEGIN FUNCTIONS*/ - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchConstructorDelegate))] - static int SystemDiagnosticsStopwatchConstructor() + [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate))] + static UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 a, ref UnityEngine.Vector3 b) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Diagnostics.Stopwatch()); + var returnValue = a + b; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate))] - static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3Delegate))] + static UnityEngine.Vector3 UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3(ref UnityEngine.Vector3 a) { try { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.ElapsedMilliseconds; + var returnValue = -a; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(long); + return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(long); + return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodStartDelegate))] - static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) + [MonoPInvokeCallback(typeof(BoxVector3Delegate))] + static int BoxVector3(ref UnityEngine.Vector3 val) { try { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Start(); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodResetDelegate))] - static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) + [MonoPInvokeCallback(typeof(UnboxVector3Delegate))] + static UnityEngine.Vector3 UnboxVector3(int valHandle) { try { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Reset(); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Vector3)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); } } @@ -3387,13 +2890,14 @@ static bool UnityEngineObjectMethodop_ImplicitUnityEngineObject(int existsHandle } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorDelegate))] - static int UnityEngineGameObjectConstructor() + [MonoPInvokeCallback(typeof(UnityEngineComponentPropertyGetTransformDelegate))] + static int UnityEngineComponentPropertyGetTransform(int thisHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject()); - return returnValue; + var thiz = (UnityEngine.Component)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -3409,60 +2913,56 @@ static int UnityEngineGameObjectConstructor() } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorSystemStringDelegate))] - static int UnityEngineGameObjectConstructorSystemString(int nameHandle) + [MonoPInvokeCallback(typeof(UnityEngineTransformPropertyGetPositionDelegate))] + static UnityEngine.Vector3 UnityEngineTransformPropertyGetPosition(int thisHandle) { try { - var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject(name)); + var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.position; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectPropertyGetTransformDelegate))] - static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineTransformPropertySetPositionDelegate))] + static void UnityEngineTransformPropertySetPosition(int thisHandle, ref UnityEngine.Vector3 value) { try { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.position = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate))] - static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(int thisHandle) + [MonoPInvokeCallback(typeof(BoxColorDelegate))] + static int BoxColor(ref UnityEngine.Color val) { try { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.AddComponent(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -3478,14 +2978,36 @@ static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScriptDelegate))] - static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript(int thisHandle) + [MonoPInvokeCallback(typeof(UnboxColorDelegate))] + static UnityEngine.Color UnboxColor(int valHandle) { try { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.AddComponent(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Color)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Color); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Color); + } + } + + [MonoPInvokeCallback(typeof(BoxGradientColorKeyDelegate))] + static int BoxGradientColorKey(ref UnityEngine.GradientColorKey val) + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -3501,13 +3023,59 @@ static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScr } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate))] - static int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(UnityEngine.PrimitiveType type) + [MonoPInvokeCallback(typeof(UnboxGradientColorKeyDelegate))] + static UnityEngine.GradientColorKey UnboxGradientColorKey(int valHandle) { try { - var returnValue = UnityEngine.GameObject.CreatePrimitive(type); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.GradientColorKey)val; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.GradientColorKey); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.GradientColorKey); + } + } + + [MonoPInvokeCallback(typeof(ReleaseUnityEngineResolutionDelegate))] + static void ReleaseUnityEngineResolution(int handle) + { + try + { + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetWidthDelegate))] + static int UnityEngineResolutionPropertyGetWidth(int thisHandle) + { + try + { + var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); + var returnValue = thiz.width; + return returnValue; } catch (System.NullReferenceException ex) { @@ -3523,14 +3091,35 @@ static int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(Un } } - [MonoPInvokeCallback(typeof(UnityEngineComponentPropertyGetTransformDelegate))] - static int UnityEngineComponentPropertyGetTransform(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetWidthDelegate))] + static void UnityEngineResolutionPropertySetWidth(int thisHandle, int value) { try { - var thiz = (UnityEngine.Component)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); + thiz.width = value; + NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetHeightDelegate))] + static int UnityEngineResolutionPropertyGetHeight(int thisHandle) + { + try + { + var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); + var returnValue = thiz.height; + return returnValue; } catch (System.NullReferenceException ex) { @@ -3546,56 +3135,58 @@ static int UnityEngineComponentPropertyGetTransform(int thisHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineTransformPropertyGetPositionDelegate))] - static UnityEngine.Vector3 UnityEngineTransformPropertyGetPosition(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetHeightDelegate))] + static void UnityEngineResolutionPropertySetHeight(int thisHandle, int value) { try { - var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.position; - return returnValue; + var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); + thiz.height = value; + NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(UnityEngineTransformPropertySetPositionDelegate))] - static void UnityEngineTransformPropertySetPosition(int thisHandle, ref UnityEngine.Vector3 value) + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetRefreshRateDelegate))] + static int UnityEngineResolutionPropertyGetRefreshRate(int thisHandle) { try { - var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.position = value; + var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); + var returnValue = thiz.refreshRate; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineDebugMethodLogSystemObjectDelegate))] - static void UnityEngineDebugMethodLogSystemObject(int messageHandle) + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetRefreshRateDelegate))] + static void UnityEngineResolutionPropertySetRefreshRate(int thisHandle, int value) { try { - var message = NativeScript.Bindings.ObjectStore.Get(messageHandle); - UnityEngine.Debug.Log(message); + var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); + thiz.refreshRate = value; + NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); } catch (System.NullReferenceException ex) { @@ -3609,55 +3200,61 @@ static void UnityEngineDebugMethodLogSystemObject(int messageHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldGetRaiseExceptionsDelegate))] - static bool UnityEngineAssertionsAssertFieldGetRaiseExceptions() + [MonoPInvokeCallback(typeof(BoxResolutionDelegate))] + static int BoxResolution(int valHandle) { try { - var returnValue = UnityEngine.Assertions.Assert.raiseExceptions; + var val = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldSetRaiseExceptionsDelegate))] - static void UnityEngineAssertionsAssertFieldSetRaiseExceptions(bool value) + [MonoPInvokeCallback(typeof(UnboxResolutionDelegate))] + static int UnboxResolution(int valHandle) { try { - UnityEngine.Assertions.Assert.raiseExceptions = value; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Resolution)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemStringDelegate))] - static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(int expectedHandle, int actualHandle) + [MonoPInvokeCallback(typeof(ReleaseUnityEngineRaycastHitDelegate))] + static void ReleaseUnityEngineRaycastHit(int handle) { try { - var expected = (string)NativeScript.Bindings.ObjectStore.Get(expectedHandle); - var actual = (string)NativeScript.Bindings.ObjectStore.Get(actualHandle); - UnityEngine.Assertions.Assert.AreEqual(expected, actual); + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } } catch (System.NullReferenceException ex) { @@ -3671,232 +3268,238 @@ static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_Sy } } - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObjectDelegate))] - static void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(int expectedHandle, int actualHandle) + [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertyGetPointDelegate))] + static UnityEngine.Vector3 UnityEngineRaycastHitPropertyGetPoint(int thisHandle) { try { - var expected = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(expectedHandle); - var actual = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(actualHandle); - UnityEngine.Assertions.Assert.AreEqual(expected, actual); + var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); + var returnValue = thiz.point; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(UnityEngineMonoBehaviourPropertyGetTransformDelegate))] - static int UnityEngineMonoBehaviourPropertyGetTransform(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertySetPointDelegate))] + static void UnityEngineRaycastHitPropertySetPoint(int thisHandle, ref UnityEngine.Vector3 value) { try { - var thiz = (UnityEngine.MonoBehaviour)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); + thiz.point = value; + NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate))] - static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(ref int bufferLength, ref int numBuffers) + [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertyGetTransformDelegate))] + static int UnityEngineRaycastHitPropertyGetTransform(int thisHandle) { try { - UnityEngine.AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers); + var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - bufferLength = default(int); - numBuffers = default(int); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - bufferLength = default(int); - numBuffers = default(int); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate))] - static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(int hostId, ref int addressHandle, ref int port, ref byte error) + [MonoPInvokeCallback(typeof(BoxRaycastHitDelegate))] + static int BoxRaycastHit(int valHandle) { try { - var address = (string)NativeScript.Bindings.ObjectStore.Get(addressHandle); - UnityEngine.Networking.NetworkTransport.GetBroadcastConnectionInfo(hostId, out address, out port, out error); - int addressHandleNew = NativeScript.Bindings.ObjectStore.GetHandle(address); - addressHandle = addressHandleNew; + var val = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - addressHandle = default(int); - port = default(int); - error = default(byte); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - addressHandle = default(int); - port = default(int); - error = default(byte); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodInitDelegate))] - static void UnityEngineNetworkingNetworkTransportMethodInit() + [MonoPInvokeCallback(typeof(UnboxRaycastHitDelegate))] + static int UnboxRaycastHit(int valHandle) { try { - UnityEngine.Networking.NetworkTransport.Init(); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.RaycastHit)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate))] - static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(float x, float y, float z) + [MonoPInvokeCallback(typeof(ReleaseUnityEnginePlayablesPlayableGraphDelegate))] + static void ReleaseUnityEnginePlayablesPlayableGraph(int handle) { try { - var returnValue = new UnityEngine.Vector3(x, y, z); - return returnValue; + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(UnityEngineVector3PropertyGetMagnitudeDelegate))] - static float UnityEngineVector3PropertyGetMagnitude(ref UnityEngine.Vector3 thiz) + [MonoPInvokeCallback(typeof(BoxPlayableGraphDelegate))] + static int BoxPlayableGraph(int valHandle) { try { - var returnValue = thiz.magnitude; + var val = (UnityEngine.Playables.PlayableGraph)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingleDelegate))] - static void UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(ref UnityEngine.Vector3 thiz, float newX, float newY, float newZ) + [MonoPInvokeCallback(typeof(UnboxPlayableGraphDelegate))] + static int UnboxPlayableGraph(int valHandle) { try { - thiz.Set(newX, newY, newZ); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Playables.PlayableGraph)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate))] - static UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 a, ref UnityEngine.Vector3 b) + [MonoPInvokeCallback(typeof(ReleaseUnityEngineAnimationsAnimationMixerPlayableDelegate))] + static void ReleaseUnityEngineAnimationsAnimationMixerPlayable(int handle) { try { - var returnValue = a + b; - return returnValue; + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3Delegate))] - static UnityEngine.Vector3 UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3(ref UnityEngine.Vector3 a) + [MonoPInvokeCallback(typeof(UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBooleanDelegate))] + static int UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean(int graphHandle, int inputCount, bool normalizeWeights) { try { - var returnValue = -a; - return returnValue; + var graph = (UnityEngine.Playables.PlayableGraph)NativeScript.Bindings.StructStore.Get(graphHandle); + var returnValue = UnityEngine.Animations.AnimationMixerPlayable.Create(graph, inputCount, normalizeWeights); + return NativeScript.Bindings.StructStore.Store(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxVector3Delegate))] - static int BoxVector3(ref UnityEngine.Vector3 val) + [MonoPInvokeCallback(typeof(BoxAnimationMixerPlayableDelegate))] + static int BoxAnimationMixerPlayable(int valHandle) { try { + var val = (UnityEngine.Animations.AnimationMixerPlayable)NativeScript.Bindings.StructStore.Get(valHandle); var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } @@ -3914,35 +3517,35 @@ static int BoxVector3(ref UnityEngine.Vector3 val) } } - [MonoPInvokeCallback(typeof(UnboxVector3Delegate))] - static UnityEngine.Vector3 UnboxVector3(int valHandle) + [MonoPInvokeCallback(typeof(UnboxAnimationMixerPlayableDelegate))] + static int UnboxAnimationMixerPlayable(int valHandle) { try { var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Vector3)val; + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Animations.AnimationMixerPlayable)val); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxQuaternionDelegate))] - static int BoxQuaternion(ref UnityEngine.Quaternion val) + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchConstructorDelegate))] + static int SystemDiagnosticsStopwatchConstructor() { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Diagnostics.Stopwatch()); return returnValue; } catch (System.NullReferenceException ex) @@ -3959,57 +3562,56 @@ static int BoxQuaternion(ref UnityEngine.Quaternion val) } } - [MonoPInvokeCallback(typeof(UnboxQuaternionDelegate))] - static UnityEngine.Quaternion UnboxQuaternion(int valHandle) + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate))] + static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Quaternion)val; + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.ElapsedMilliseconds; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Quaternion); + return default(long); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Quaternion); + return default(long); } } - [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertyGetItemDelegate))] - static float UnityEngineMatrix4x4PropertyGetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column) + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodStartDelegate))] + static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) { try { - var returnValue = thiz[row, row]; - return returnValue; + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Start(); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); } } - [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertySetItemDelegate))] - static void UnityEngineMatrix4x4PropertySetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column, float value) + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodResetDelegate))] + static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) { try { - thiz[row, column] = column; + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Reset(); } catch (System.NullReferenceException ex) { @@ -4023,12 +3625,12 @@ static void UnityEngineMatrix4x4PropertySetItem(ref UnityEngine.Matrix4x4 thiz, } } - [MonoPInvokeCallback(typeof(BoxMatrix4x4Delegate))] - static int BoxMatrix4x4(ref UnityEngine.Matrix4x4 val) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorDelegate))] + static int UnityEngineGameObjectConstructor() { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject()); return returnValue; } catch (System.NullReferenceException ex) @@ -4045,102 +3647,104 @@ static int BoxMatrix4x4(ref UnityEngine.Matrix4x4 val) } } - [MonoPInvokeCallback(typeof(UnboxMatrix4x4Delegate))] - static UnityEngine.Matrix4x4 UnboxMatrix4x4(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorSystemStringDelegate))] + static int UnityEngineGameObjectConstructorSystemString(int nameHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Matrix4x4)val; + var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject(name)); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Matrix4x4); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Matrix4x4); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseUnityEngineRaycastHitDelegate))] - static void ReleaseUnityEngineRaycastHit(int handle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectPropertyGetTransformDelegate))] + static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) { try { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertyGetPointDelegate))] - static UnityEngine.Vector3 UnityEngineRaycastHitPropertyGetPoint(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate))] + static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(int thisHandle) { try { - var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.point; - return returnValue; + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.AddComponent(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertySetPointDelegate))] - static void UnityEngineRaycastHitPropertySetPoint(int thisHandle, ref UnityEngine.Vector3 value) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScriptDelegate))] + static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript(int thisHandle) { try { - var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); - thiz.point = value; - NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.AddComponent(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertyGetTransformDelegate))] - static int UnityEngineRaycastHitPropertyGetTransform(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate))] + static int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(UnityEngine.PrimitiveType type) { try { - var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.transform; + var returnValue = UnityEngine.GameObject.CreatePrimitive(type); return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) @@ -4157,106 +3761,96 @@ static int UnityEngineRaycastHitPropertyGetTransform(int thisHandle) } } - [MonoPInvokeCallback(typeof(BoxRaycastHitDelegate))] - static int BoxRaycastHit(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineDebugMethodLogSystemObjectDelegate))] + static void UnityEngineDebugMethodLogSystemObject(int messageHandle) { try { - var val = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var message = NativeScript.Bindings.ObjectStore.Get(messageHandle); + UnityEngine.Debug.Log(message); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxRaycastHitDelegate))] - static int UnboxRaycastHit(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldGetRaiseExceptionsDelegate))] + static bool UnityEngineAssertionsAssertFieldGetRaiseExceptions() { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.RaycastHit)val); + var returnValue = UnityEngine.Assertions.Assert.raiseExceptions; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(bool); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(bool); } } - [MonoPInvokeCallback(typeof(BoxQueryTriggerInteractionDelegate))] - static int BoxQueryTriggerInteraction(UnityEngine.QueryTriggerInteraction val) + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldSetRaiseExceptionsDelegate))] + static void UnityEngineAssertionsAssertFieldSetRaiseExceptions(bool value) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + UnityEngine.Assertions.Assert.raiseExceptions = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxQueryTriggerInteractionDelegate))] - static UnityEngine.QueryTriggerInteraction UnboxQueryTriggerInteraction(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemStringDelegate))] + static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(int expectedHandle, int actualHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.QueryTriggerInteraction)val; - return returnValue; + var expected = (string)NativeScript.Bindings.ObjectStore.Get(expectedHandle); + var actual = (string)NativeScript.Bindings.ObjectStore.Get(actualHandle); + UnityEngine.Assertions.Assert.AreEqual(expected, actual); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.QueryTriggerInteraction); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.QueryTriggerInteraction); } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate))] - static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int handle) + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObjectDelegate))] + static void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(int expectedHandle, int actualHandle) { try { - if (handle != 0) - { - NativeScript.Bindings.StructStore>.Remove(handle); - } + var expected = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(expectedHandle); + var actual = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(actualHandle); + UnityEngine.Assertions.Assert.AreEqual(expected, actual); } catch (System.NullReferenceException ex) { @@ -4270,14 +3864,14 @@ static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate))] - static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(int keyHandle, double value) + [MonoPInvokeCallback(typeof(UnityEngineMonoBehaviourPropertyGetTransformDelegate))] + static int UnityEngineMonoBehaviourPropertyGetTransform(int thisHandle) { try { - var key = (string)NativeScript.Bindings.ObjectStore.Get(keyHandle); - var returnValue = NativeScript.Bindings.StructStore>.Store(new System.Collections.Generic.KeyValuePair(key, value)); - return returnValue; + var thiz = (UnityEngine.MonoBehaviour)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -4293,82 +3887,82 @@ static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstruc } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate))] - static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate))] + static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(ref int bufferLength, ref int numBuffers) { try { - var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); - var returnValue = thiz.Key; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + UnityEngine.AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + bufferLength = default(int); + numBuffers = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + bufferLength = default(int); + numBuffers = default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate))] - static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate))] + static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(int hostId, ref int addressHandle, ref int port, ref byte error) { try { - var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); - var returnValue = thiz.Value; - return returnValue; + var address = (string)NativeScript.Bindings.ObjectStore.Get(addressHandle); + UnityEngine.Networking.NetworkTransport.GetBroadcastConnectionInfo(hostId, out address, out port, out error); + int addressHandleNew = NativeScript.Bindings.ObjectStore.GetHandle(address); + addressHandle = addressHandleNew; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); + addressHandle = default(int); + port = default(int); + error = default(byte); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); + addressHandle = default(int); + port = default(int); + error = default(byte); } } - [MonoPInvokeCallback(typeof(BoxKeyValuePairSystemString_SystemDoubleDelegate))] - static int BoxKeyValuePairSystemString_SystemDouble(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodInitDelegate))] + static void UnityEngineNetworkingNetworkTransportMethodInit() { try { - var val = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + UnityEngine.Networking.NetworkTransport.Init(); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxKeyValuePairSystemString_SystemDoubleDelegate))] - static int UnboxKeyValuePairSystemString_SystemDouble(int valHandle) + [MonoPInvokeCallback(typeof(BoxQuaternionDelegate))] + static int BoxQuaternion(ref UnityEngine.Quaternion val) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore>.Store((System.Collections.Generic.KeyValuePair)val); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } catch (System.NullReferenceException ex) @@ -4385,59 +3979,57 @@ static int UnboxKeyValuePairSystemString_SystemDouble(int valHandle) } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringConstructorDelegate))] - static int SystemCollectionsGenericListSystemStringConstructor() + [MonoPInvokeCallback(typeof(UnboxQuaternionDelegate))] + static UnityEngine.Quaternion UnboxQuaternion(int valHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Quaternion)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Quaternion); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Quaternion); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertyGetItemDelegate))] - static int SystemCollectionsGenericListSystemStringPropertyGetItem(int thisHandle, int index) + [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertyGetItemDelegate))] + static float UnityEngineMatrix4x4PropertyGetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index]; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = thiz[row, row]; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertySetItemDelegate))] - static void SystemCollectionsGenericListSystemStringPropertySetItem(int thisHandle, int index, int valueHandle) + [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertySetItemDelegate))] + static void UnityEngineMatrix4x4PropertySetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column, float value) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz[index] = value; + thiz[row, column] = column; } catch (System.NullReferenceException ex) { @@ -4451,54 +4043,57 @@ static void SystemCollectionsGenericListSystemStringPropertySetItem(int thisHand } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate))] - static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int thisHandle, int itemHandle) + [MonoPInvokeCallback(typeof(BoxMatrix4x4Delegate))] + static int BoxMatrix4x4(ref UnityEngine.Matrix4x4 val) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); - thiz.Add(item); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate))] - static void SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) + [MonoPInvokeCallback(typeof(UnboxMatrix4x4Delegate))] + static UnityEngine.Matrix4x4 UnboxMatrix4x4(int valHandle) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); - thiz.Sort(comparer); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Matrix4x4)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Matrix4x4); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Matrix4x4); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32ConstructorDelegate))] - static int SystemCollectionsGenericListSystemInt32Constructor() + [MonoPInvokeCallback(typeof(BoxQueryTriggerInteractionDelegate))] + static int BoxQueryTriggerInteraction(UnityEngine.QueryTriggerInteraction val) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } catch (System.NullReferenceException ex) @@ -4515,36 +4110,38 @@ static int SystemCollectionsGenericListSystemInt32Constructor() } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate))] - static int SystemCollectionsGenericListSystemInt32PropertyGetItem(int thisHandle, int index) + [MonoPInvokeCallback(typeof(UnboxQueryTriggerInteractionDelegate))] + static UnityEngine.QueryTriggerInteraction UnboxQueryTriggerInteraction(int valHandle) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index]; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.QueryTriggerInteraction)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.QueryTriggerInteraction); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.QueryTriggerInteraction); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertySetItemDelegate))] - static void SystemCollectionsGenericListSystemInt32PropertySetItem(int thisHandle, int index, int value) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate))] + static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int handle) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz[index] = value; + if (handle != 0) + { + NativeScript.Bindings.StructStore>.Remove(handle); + } } catch (System.NullReferenceException ex) { @@ -4558,78 +4155,83 @@ static void SystemCollectionsGenericListSystemInt32PropertySetItem(int thisHandl } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate))] - static void SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(int thisHandle, int item) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate))] + static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(int keyHandle, double value) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Add(item); + var key = (string)NativeScript.Bindings.ObjectStore.Get(keyHandle); + var returnValue = NativeScript.Bindings.StructStore>.Store(new System.Collections.Generic.KeyValuePair(key, value)); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate))] - static void SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate))] + static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(int thisHandle) { try - { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); - thiz.Sort(comparer); + { + var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); + var returnValue = thiz.Key; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate))] - static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(int valueHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate))] + static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(int thisHandle) { try { - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.LinkedListNode(value)); + var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); + var returnValue = thiz.Value; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(double); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(double); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate))] - static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(int thisHandle) + [MonoPInvokeCallback(typeof(BoxKeyValuePairSystemString_SystemDoubleDelegate))] + static int BoxKeyValuePairSystemString_SystemDouble(int valHandle) { try { - var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Value; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var val = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -4645,34 +4247,35 @@ static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(in } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate))] - static void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(UnboxKeyValuePairSystemString_SystemDoubleDelegate))] + static int UnboxKeyValuePairSystemString_SystemDouble(int valHandle) { try { - var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.Value = value; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore>.Store((System.Collections.Generic.KeyValuePair)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate))] - static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(int valueHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringConstructorDelegate))] + static int SystemCollectionsGenericListSystemStringConstructor() { try { - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Runtime.CompilerServices.StrongBox(value)); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); return returnValue; } catch (System.NullReferenceException ex) @@ -4689,13 +4292,13 @@ static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemSt } } - [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate))] - static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int thisHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertyGetItemDelegate))] + static int SystemCollectionsGenericListSystemStringPropertyGetItem(int thisHandle, int index) { try { - var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Value; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index]; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) @@ -4712,14 +4315,14 @@ static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int t } } - [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate))] - static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertySetItemDelegate))] + static void SystemCollectionsGenericListSystemStringPropertySetItem(int thisHandle, int index, int valueHandle) { try { - var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.Value = value; + thiz[index] = value; } catch (System.NullReferenceException ex) { @@ -4733,38 +4336,35 @@ static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int } } - [MonoPInvokeCallback(typeof(SystemExceptionConstructorSystemStringDelegate))] - static int SystemExceptionConstructorSystemString(int messageHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate))] + static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int thisHandle, int itemHandle) { try { - var message = (string)NativeScript.Bindings.ObjectStore.Get(messageHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Exception(message)); - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); + thiz.Add(item); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseUnityEngineResolutionDelegate))] - static void ReleaseUnityEngineResolution(int handle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate))] + static void SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) { try { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); + thiz.Sort(comparer); } catch (System.NullReferenceException ex) { @@ -4778,13 +4378,12 @@ static void ReleaseUnityEngineResolution(int handle) } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetWidthDelegate))] - static int UnityEngineResolutionPropertyGetWidth(int thisHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32ConstructorDelegate))] + static int SystemCollectionsGenericListSystemInt32Constructor() { try { - var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.width; + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); return returnValue; } catch (System.NullReferenceException ex) @@ -4801,58 +4400,56 @@ static int UnityEngineResolutionPropertyGetWidth(int thisHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetWidthDelegate))] - static void UnityEngineResolutionPropertySetWidth(int thisHandle, int value) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate))] + static int SystemCollectionsGenericListSystemInt32PropertyGetItem(int thisHandle, int index) { try { - var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); - thiz.width = value; - NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index]; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetHeightDelegate))] - static int UnityEngineResolutionPropertyGetHeight(int thisHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertySetItemDelegate))] + static void SystemCollectionsGenericListSystemInt32PropertySetItem(int thisHandle, int index, int value) { try { - var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.height; - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz[index] = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetHeightDelegate))] - static void UnityEngineResolutionPropertySetHeight(int thisHandle, int value) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate))] + static void SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(int thisHandle, int item) { try { - var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); - thiz.height = value; - NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Add(item); } catch (System.NullReferenceException ex) { @@ -4866,58 +4463,58 @@ static void UnityEngineResolutionPropertySetHeight(int thisHandle, int value) } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetRefreshRateDelegate))] - static int UnityEngineResolutionPropertyGetRefreshRate(int thisHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate))] + static void SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) { try { - var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.refreshRate; - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); + thiz.Sort(comparer); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetRefreshRateDelegate))] - static void UnityEngineResolutionPropertySetRefreshRate(int thisHandle, int value) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate))] + static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(int valueHandle) { try { - var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); - thiz.refreshRate = value; - NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.LinkedListNode(value)); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxResolutionDelegate))] - static int BoxResolution(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate))] + static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(int thisHandle) { try { - var val = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Value; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -4933,36 +4530,35 @@ static int BoxResolution(int valHandle) } } - [MonoPInvokeCallback(typeof(UnboxResolutionDelegate))] - static int UnboxResolution(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate))] + static void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(int thisHandle, int valueHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Resolution)val); - return returnValue; + var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.Value = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineScreenPropertyGetResolutionsDelegate))] - static int UnityEngineScreenPropertyGetResolutions() + [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate))] + static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(int valueHandle) { try { - var returnValue = UnityEngine.Screen.resolutions; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Runtime.CompilerServices.StrongBox(value)); + return returnValue; } catch (System.NullReferenceException ex) { @@ -4978,57 +4574,57 @@ static int UnityEngineScreenPropertyGetResolutions() } } - [MonoPInvokeCallback(typeof(ReleaseUnityEngineRayDelegate))] - static void ReleaseUnityEngineRay(int handle) + [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate))] + static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int thisHandle) { try { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } + var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Value; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate))] - static int UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction) + [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate))] + static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int thisHandle, int valueHandle) { try { - var returnValue = NativeScript.Bindings.StructStore.Store(new UnityEngine.Ray(origin, direction)); - return returnValue; + var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.Value = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(BoxRayDelegate))] - static int BoxRay(int valHandle) + [MonoPInvokeCallback(typeof(SystemExceptionConstructorSystemStringDelegate))] + static int SystemExceptionConstructorSystemString(int messageHandle) { try { - var val = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var message = (string)NativeScript.Bindings.ObjectStore.Get(messageHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Exception(message)); return returnValue; } catch (System.NullReferenceException ex) @@ -5045,14 +4641,13 @@ static int BoxRay(int valHandle) } } - [MonoPInvokeCallback(typeof(UnboxRayDelegate))] - static int UnboxRay(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineScreenPropertyGetResolutionsDelegate))] + static int UnityEngineScreenPropertyGetResolutions() { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Ray)val); - return returnValue; + var returnValue = UnityEngine.Screen.resolutions; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -5068,38 +4663,35 @@ static int UnboxRay(int valHandle) } } - [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1Delegate))] - static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1(int rayHandle, int resultsHandle) + [MonoPInvokeCallback(typeof(ReleaseUnityEngineRayDelegate))] + static void ReleaseUnityEngineRay(int handle) { try { - var ray = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(rayHandle); - var results = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(resultsHandle); - var returnValue = UnityEngine.Physics.RaycastNonAlloc(ray, results); - return returnValue; + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate))] - static int UnityEnginePhysicsMethodRaycastAllUnityEngineRay(int rayHandle) + [MonoPInvokeCallback(typeof(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate))] + static int UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction) { try { - var ray = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(rayHandle); - var returnValue = UnityEngine.Physics.RaycastAll(ray); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = NativeScript.Bindings.StructStore.Store(new UnityEngine.Ray(origin, direction)); + return returnValue; } catch (System.NullReferenceException ex) { @@ -5115,11 +4707,12 @@ static int UnityEnginePhysicsMethodRaycastAllUnityEngineRay(int rayHandle) } } - [MonoPInvokeCallback(typeof(BoxColorDelegate))] - static int BoxColor(ref UnityEngine.Color val) + [MonoPInvokeCallback(typeof(BoxRayDelegate))] + static int BoxRay(int valHandle) { try { + var val = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(valHandle); var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } @@ -5137,35 +4730,37 @@ static int BoxColor(ref UnityEngine.Color val) } } - [MonoPInvokeCallback(typeof(UnboxColorDelegate))] - static UnityEngine.Color UnboxColor(int valHandle) + [MonoPInvokeCallback(typeof(UnboxRayDelegate))] + static int UnboxRay(int valHandle) { try { var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Color)val; + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Ray)val); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Color); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Color); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxGradientColorKeyDelegate))] - static int BoxGradientColorKey(ref UnityEngine.GradientColorKey val) + [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1Delegate))] + static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1(int rayHandle, int resultsHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var ray = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(rayHandle); + var results = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(resultsHandle); + var returnValue = UnityEngine.Physics.RaycastNonAlloc(ray, results); return returnValue; } catch (System.NullReferenceException ex) @@ -5182,26 +4777,26 @@ static int BoxGradientColorKey(ref UnityEngine.GradientColorKey val) } } - [MonoPInvokeCallback(typeof(UnboxGradientColorKeyDelegate))] - static UnityEngine.GradientColorKey UnboxGradientColorKey(int valHandle) + [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate))] + static int UnityEnginePhysicsMethodRaycastAllUnityEngineRay(int rayHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.GradientColorKey)val; - return returnValue; + var ray = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(rayHandle); + var returnValue = UnityEngine.Physics.RaycastAll(ray); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); + return default(int); } } @@ -5811,88 +5406,6 @@ static void ReleaseSystemBaseStringComparer(int handle) } } - [MonoPInvokeCallback(typeof(SystemCollectionsBaseICollectionConstructorDelegate))] - static void SystemCollectionsBaseICollectionConstructor(int cppHandle, ref int handle) - { - try - { - var thiz = new SystemCollectionsBaseICollection(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsBaseICollectionDelegate))] - static void ReleaseSystemCollectionsBaseICollection(int handle) - { - try - { - NativeScript.Bindings.ObjectStore.Remove(handle); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsBaseIListConstructorDelegate))] - static void SystemCollectionsBaseIListConstructor(int cppHandle, ref int handle) - { - try - { - var thiz = new SystemCollectionsBaseIList(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsBaseIListDelegate))] - static void ReleaseSystemCollectionsBaseIList(int handle) - { - try - { - NativeScript.Bindings.ObjectStore.Remove(handle); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - [MonoPInvokeCallback(typeof(SystemCollectionsQueuePropertyGetCountDelegate))] static int SystemCollectionsQueuePropertyGetCount(int thisHandle) { @@ -6151,165 +5664,6 @@ static int UnboxPlayableHandle(int valHandle) } } - [MonoPInvokeCallback(typeof(ReleaseUnityEnginePlayablesPlayableGraphDelegate))] - static void ReleaseUnityEnginePlayablesPlayableGraph(int handle) - { - try - { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(BoxPlayableGraphDelegate))] - static int BoxPlayableGraph(int valHandle) - { - try - { - var val = (UnityEngine.Playables.PlayableGraph)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxPlayableGraphDelegate))] - static int UnboxPlayableGraph(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Playables.PlayableGraph)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseUnityEngineAnimationsAnimationMixerPlayableDelegate))] - static void ReleaseUnityEngineAnimationsAnimationMixerPlayable(int handle) - { - try - { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBooleanDelegate))] - static int UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean(int graphHandle, int inputCount, bool normalizeWeights) - { - try - { - var graph = (UnityEngine.Playables.PlayableGraph)NativeScript.Bindings.StructStore.Get(graphHandle); - var returnValue = UnityEngine.Animations.AnimationMixerPlayable.Create(graph, inputCount, normalizeWeights); - return NativeScript.Bindings.StructStore.Store(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(BoxAnimationMixerPlayableDelegate))] - static int BoxAnimationMixerPlayable(int valHandle) - { - try - { - var val = (UnityEngine.Animations.AnimationMixerPlayable)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxAnimationMixerPlayableDelegate))] - static int UnboxAnimationMixerPlayable(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Animations.AnimationMixerPlayable)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - [MonoPInvokeCallback(typeof(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1Delegate))] static int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1(int eHandle, int nameHandle, int classesHandle) { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 0080eed..48f3d07 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -166,6 +166,10 @@ class StringBuilders new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppTypeDeclarations = new StringBuilder(InitialStringBuilderCapacity); + public readonly StringBuilder CppTemplateDeclarations = + new StringBuilder(InitialStringBuilderCapacity); + public readonly StringBuilder CppTemplateSpecializationDeclarations = + new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppTypeDefinitions = new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppMethodDefinitions = @@ -542,7 +546,7 @@ static void DoPostCompileWork(bool canRefreshAssetDb) cppBaseTypeName, type.Namespace, genericArgTypes.Length, - builders.CppTypeDeclarations); + builders.CppTemplateDeclarations); } } } @@ -902,6 +906,57 @@ static MethodInfo GetMethod( throw new Exception(errorBuilder.ToString()); } + static Type[] GetDirectInterfaces(Type type) + { + Type[] allInterfaces = type.GetInterfaces(); + List minimalInterfaces = new List(); + foreach(Type iType in allInterfaces) + { + bool contains = false; + foreach (Type t in allInterfaces) + { + if (Array.IndexOf(t.GetInterfaces(), iType) >= 0) + { + contains = true; + break; + } + } + if (!contains) + { + minimalInterfaces.Add(iType); + } + } + minimalInterfaces.Sort((x, y) => x.Name.CompareTo(y.Name)); + return minimalInterfaces.ToArray(); + } + + static void AddCppCtorInitType(Type type, List types) + { + if (type.BaseType != null && type.BaseType != typeof(object)) + { + AddCppCtorInitType(type.BaseType, types); + } + foreach (Type interfaceType in GetDirectInterfaces(type)) + { + AddCppCtorInitType(interfaceType, types); + } + if (!types.Contains(type)) + { + types.Add(type); + } + } + + static Type[] GetCppCtorInitTypes(Type type, bool includeSelf) + { + List types = new List(); + AddCppCtorInitType(type, types); + if (!includeSelf) + { + types.RemoveAll(t => t == type); + } + return types.ToArray(); + } + static bool CheckParametersMatch( string[] paramTypeNames, System.Reflection.ParameterInfo[] reflectionParams) @@ -1269,7 +1324,7 @@ static void AppendType( type.Name, type.Namespace, genericArgTypes.Length, - builders.CppTypeDeclarations); + builders.CppTemplateDeclarations); } foreach (JsonGenericParams jsonGenericParams @@ -1529,10 +1584,13 @@ static void AppendType( type.Name, isStatic, typeParams, - builders.CppTypeDeclarations); + typeParams != null ? + builders.CppTemplateSpecializationDeclarations : + builders.CppTypeDeclarations); // C++ type definition (beginning) Type baseType = type.BaseType ?? typeof(object); + Type[] interfaceTypes = GetDirectInterfaces(type); AppendCppTypeDefinitionBegin( type.Name, type.Namespace, @@ -1541,11 +1599,15 @@ static void AppendType( baseType.Name, baseType.Namespace, baseType.GetGenericArguments(), + interfaceTypes, isStatic, indent, builders.CppTypeDefinitions); // C++ method definition + Type[] cppCtorInterfaceTypes = GetCppCtorInitTypes( + type, + false); int cppMethodDefinitionsIndent = AppendCppMethodDefinitionsBegin( type.Name, type.Namespace, @@ -1554,6 +1616,7 @@ static void AppendType( baseType.Name, baseType.Namespace, baseType.GetGenericArguments(), + cppCtorInterfaceTypes, isStatic, (extraIndent, subject) => {}, (extraIndent, subject) => {}, @@ -1581,6 +1644,7 @@ static void AppendType( assemblies, typeParams, genericArgTypes, + cppCtorInterfaceTypes, indent, builders); } @@ -2185,6 +2249,7 @@ static void AppendConstructor( Assembly[] assemblies, Type[] enclosingTypeParams, Type[] genericArgTypes, + Type[] interfaceTypes, int indent, StringBuilders builders) { @@ -2370,14 +2435,19 @@ static void AppendConstructor( builders.CppMethodDefinitions); if (enclosingTypeKind != TypeKind.FullStruct) { - AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(" : "); - AppendCppTypeName( - enclosingType.BaseType, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("(nullptr)\n"); + string separator = ": "; + foreach (Type interfaceType in interfaceTypes) + { + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(separator); + AppendCppTypeName( + interfaceType, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("(nullptr)\n"); + separator = ", "; + } } AppendIndent( indent, @@ -3749,11 +3819,15 @@ static void AppendMonoBehaviour( "MonoBehaviour", "UnityEngine", null, + null, false, cppIndent, builders.CppTypeDefinitions); // C++ method definition + Type[] interfaceTypes = GetCppCtorInitTypes( + type, + false); int cppMethodDefinitionsIndent = AppendCppMethodDefinitionsBegin( type.Name, type.Namespace, @@ -3762,6 +3836,7 @@ static void AppendMonoBehaviour( "MonoBehaviour", "UnityEngine", null, + interfaceTypes, false, (extraIndent, subject) => {}, (extraIndent, subject) => {}, @@ -4228,9 +4303,12 @@ static void AppendArray( cppArrayTypeName, false, cppTypeParams, - builders.CppTypeDeclarations); + cppTypeParams != null ? + builders.CppTemplateSpecializationDeclarations : + builders.CppTypeDeclarations); // C++ type definition (beginning) + Type[] interfaceTypes = GetDirectInterfaces(arrayType); AppendCppTypeDefinitionBegin( cppArrayTypeName, "System", @@ -4239,11 +4317,15 @@ static void AppendArray( "Array", "System", null, + interfaceTypes, false, indent, builders.CppTypeDefinitions); // C++ method definitions (beginning) + Type[] cppCtorInitTypes = GetCppCtorInitTypes( + arrayType, + false); int cppMethodDefinitionsIndent = AppendCppMethodDefinitionsBegin( cppArrayTypeName, "System", @@ -4252,6 +4334,7 @@ static void AppendArray( "Array", "System", null, + cppCtorInitTypes, false, (extraIndent, subject) => { AppendIndent( @@ -4332,6 +4415,7 @@ static void AppendArray( cppArrayTypeName, rank, bindingArrayTypeName, + cppCtorInitTypes, indent, builders); @@ -4656,17 +4740,17 @@ static void AppendArrayElementProxy( // C++ element proxy type declaration int indent = AppendNamespaceBeginning( "Plugin", - builders.CppTypeDeclarations); - AppendIndent(indent, builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append("template<> struct "); + builders.CppTemplateSpecializationDeclarations); + AppendIndent(indent, builders.CppTemplateSpecializationDeclarations); + builders.CppTemplateSpecializationDeclarations.Append("template<> struct "); AppendTypeNameWithoutGenericSuffix( cppElementProxyTypeName, - builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append(";\n"); + builders.CppTemplateSpecializationDeclarations); + builders.CppTemplateSpecializationDeclarations.Append(";\n"); AppendNamespaceEnding( indent, - builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append('\n'); + builders.CppTemplateSpecializationDeclarations); + builders.CppTemplateSpecializationDeclarations.Append('\n'); // C++ element proxy type definition AppendNamespaceBeginning( @@ -4903,6 +4987,7 @@ static void AppendArrayConstructor( string cppArrayTypeName, int rank, string csharpTypeName, + Type[] cppCtorInitTypes, int indent, StringBuilders builders) { @@ -5044,15 +5129,19 @@ static void AppendArrayConstructor( parameters, indent, builders.CppMethodDefinitions); - AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(" : "); - AppendCppTypeName( - "System", - "Array", - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("(nullptr)\n"); + string separator = ": "; + foreach (Type interfaceType in cppCtorInitTypes) + { + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(separator); + AppendCppTypeName( + interfaceType, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("(nullptr)\n"); + separator = ", "; + } AppendIndent( indent, builders.CppMethodDefinitions); @@ -5702,7 +5791,7 @@ static void AppendDelegate( cppTypeName, type.Namespace, genericArgTypes.Length, - builders.CppTypeDeclarations); + builders.CppTemplateDeclarations); } foreach (JsonGenericParams jsonGenericParams @@ -5813,7 +5902,9 @@ static void AppendDelegate( cppTypeName, false, typeParams, - builders.CppTypeDeclarations); + typeParams != null ? + builders.CppTemplateSpecializationDeclarations : + builders.CppTypeDeclarations); ParameterInfo[] addRemoveParams = { new ParameterInfo @@ -5900,6 +5991,7 @@ static void AppendDelegate( "Object", "System", null, + null, false, indent, builders.CppTypeDefinitions); @@ -6087,6 +6179,7 @@ static void AppendDelegate( typeof(object), typeParams, null, + new Type[0], new ParameterInfo[0], constructorParams, true, @@ -6101,6 +6194,7 @@ static void AppendDelegate( "Object", "System", null, + new Type[0], true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6112,6 +6206,7 @@ static void AppendDelegate( "Object", "System", null, + new Type[0], true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6122,6 +6217,7 @@ static void AppendDelegate( "Object", "System", null, + new Type[0], true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6133,6 +6229,7 @@ static void AppendDelegate( "Object", "System", null, + new Type[0], true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6550,13 +6647,35 @@ static void AppendBaseType( constructorParams[i] = fullParams; } + // Determine what the C++ class should derive from + Type cppBaseClass; + Type[] cppBaseClassTypeParams; + Type[] cppCtorInitTypes = GetCppCtorInitTypes( + type, + true); + Type[] cppInterfaceTypes; + if (type.IsInterface) + { + cppBaseClass = typeof(object); + cppBaseClassTypeParams = null; + cppInterfaceTypes = new Type[] { type }; + } + else + { + cppBaseClass = type; + cppBaseClassTypeParams = typeParams; + cppInterfaceTypes = new Type[0]; + } + // C++ type declaration int indent = AppendCppTypeDeclaration( type.Namespace, cppBaseTypeName, false, typeParams, - builders.CppTypeDeclarations); + typeParams != null ? + builders.CppTemplateSpecializationDeclarations : + builders.CppTypeDeclarations); ParameterInfo[] releaseParams = { new ParameterInfo @@ -6590,9 +6709,10 @@ static void AppendBaseType( type.Namespace, TypeKind.Class, typeParams, - type.Name, - type.Namespace, - typeParams, + cppBaseClass.Name, + cppBaseClass.Namespace, + cppBaseClassTypeParams, + cppInterfaceTypes, false, indent, builders.CppTypeDefinitions); @@ -6707,9 +6827,10 @@ static void AppendBaseType( type.Namespace, TypeKind.Class, cppBaseTypeName, - type, + cppBaseClass, typeParams, typeParams, + cppCtorInitTypes, cppConstructorParams[i], constructorParams[i], false, @@ -6722,9 +6843,10 @@ static void AppendBaseType( bindingTypeName, cppBaseTypeName, typeParams, - type.Name, - type.Namespace, - typeParams, + cppBaseClass.Name, + cppBaseClass.Namespace, + cppBaseClassTypeParams, + cppCtorInitTypes, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6733,9 +6855,10 @@ static void AppendBaseType( bindingTypeName, cppBaseTypeName, typeParams, - type.Name, - type.Namespace, - typeParams, + cppBaseClass.Name, + cppBaseClass.Namespace, + cppBaseClassTypeParams, + cppCtorInitTypes, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6743,9 +6866,10 @@ static void AppendBaseType( AppendCppBaseTypeMoveConstructor( cppBaseTypeName, typeParams, - type.Name, - type.Namespace, - typeParams, + cppBaseClass.Name, + cppBaseClass.Namespace, + cppBaseClassTypeParams, + cppCtorInitTypes, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -6754,9 +6878,10 @@ static void AppendBaseType( bindingTypeName, cppBaseTypeName, typeParams, - type.Name, - type.Namespace, - typeParams, + cppBaseClass.Name, + cppBaseClass.Namespace, + cppBaseClassTypeParams, + cppCtorInitTypes, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -8813,6 +8938,7 @@ static void AppendCppBaseTypeHandleConstructor( string baseTypeName, string baseTypeNamespace, Type[] baseTypeParams, + Type[] interfaceTypes, bool typeIsDelegate, int cppMethodDefinitionsIndent, StringBuilder output) @@ -8832,22 +8958,27 @@ static void AppendCppBaseTypeHandleConstructor( output); output.Append( "(Plugin::InternalUse iu, int32_t handle)\n"); + string separator = ": "; + foreach (Type interfaceType in interfaceTypes) + { + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append(separator); + AppendCppTypeName( + interfaceType, + output); + output.Append("(nullptr)\n"); + separator = ", "; + } AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("\t: "); - AppendCppTypeName( - baseTypeNamespace, - baseTypeName, - output); - AppendCppTypeParameters( - baseTypeParams, - output); - output.Append("(iu, handle)\n"); + output.Append("{\n"); AppendIndent( - cppMethodDefinitionsIndent, + cppMethodDefinitionsIndent + 1, output); - output.Append("{\n"); + output.Append("Handle = handle;\n"); AppendIndent( cppMethodDefinitionsIndent + 1, output); @@ -8895,6 +9026,7 @@ static void AppendCppBaseTypeMoveConstructor( string baseTypeName, string baseTypeNamespace, Type[] baseTypeParams, + Type[] interfaceTypes, bool typeIsDelegate, int cppMethodDefinitionsIndent, StringBuilder output) @@ -8920,22 +9052,28 @@ static void AppendCppBaseTypeMoveConstructor( typeParams, output); output.Append("&& other)\n"); + string separator = ": "; + foreach (Type interfaceType in interfaceTypes) + { + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append(separator); + AppendCppTypeName( + interfaceType, + output); + output.Append("(nullptr)\n"); + separator = ", "; + } AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("\t: "); - AppendCppTypeName( - baseTypeNamespace, - baseTypeName, - output); - AppendCppTypeParameters( - baseTypeParams, - output); - output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); + output.Append("{\n"); AppendIndent( - cppMethodDefinitionsIndent, + cppMethodDefinitionsIndent + 1, output); - output.Append("{\n"); + output.Append( + "Handle = other.Handle;\n"); AppendIndent( cppMethodDefinitionsIndent + 1, output); @@ -8981,6 +9119,7 @@ static void AppendCppBaseTypeCopyConstructor( string baseTypeName, string baseTypeNamespace, Type[] baseTypeParams, + Type[] interfaceTypes, bool typeIsDelegate, int cppMethodDefinitionsIndent, StringBuilder output) @@ -9006,22 +9145,28 @@ static void AppendCppBaseTypeCopyConstructor( typeParams, output); output.Append("& other)\n"); + string separator = ": "; + foreach (Type interfaceType in interfaceTypes) + { + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append(separator); + AppendCppTypeName( + interfaceType, + output); + output.Append("(nullptr)\n"); + separator = ", "; + } AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("\t: "); - AppendCppTypeName( - baseTypeNamespace, - baseTypeName, - output); - AppendCppTypeParameters( - baseTypeParams, - output); - output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); + output.Append("{\n"); AppendIndent( - cppMethodDefinitionsIndent, + cppMethodDefinitionsIndent + 1, output); - output.Append("{\n"); + output.Append( + "Handle = other.Handle;\n"); AppendIndent( cppMethodDefinitionsIndent + 1, output); @@ -9070,6 +9215,7 @@ static void AppendCppBaseTypeNullptrConstructor( string baseTypeName, string baseTypeNamespace, Type[] baseTypeParams, + Type[] interfaceTypes, bool typeIsDelegate, int cppMethodDefinitionsIndent, StringBuilder output) @@ -9088,18 +9234,19 @@ static void AppendCppBaseTypeNullptrConstructor( cppTypeName, output); output.Append("(decltype(nullptr) n)\n"); - AppendIndent( - cppMethodDefinitionsIndent, - output); - output.Append("\t: "); - AppendCppTypeName( - baseTypeNamespace, - baseTypeName, - output); - AppendCppTypeParameters( - baseTypeParams, - output); - output.Append("(Plugin::InternalUse::Only, 0)\n"); + string separator = ": "; + foreach (Type interfaceType in interfaceTypes) + { + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append(separator); + AppendCppTypeName( + interfaceType, + output); + output.Append("(nullptr)\n"); + separator = ", "; + } AppendIndent( cppMethodDefinitionsIndent, output); @@ -9136,6 +9283,7 @@ static void AppendCppBaseTypeConstructor( Type baseType, Type[] typeParams, Type[] baseTypeParams, + Type[] interfaceTypes, ParameterInfo[] cppParameters, ParameterInfo[] parameters, bool typeIsDelegate, @@ -9152,14 +9300,19 @@ static void AppendCppBaseTypeConstructor( cppParameters, cppMethodDefinitionsIndent, output); - AppendIndent( - cppMethodDefinitionsIndent + 1, - output); - output.Append(" : "); - AppendCppTypeName( - baseType ?? typeof(object), - output); - output.Append("(nullptr)\n"); + string separator = ": "; + foreach (Type interfaceType in interfaceTypes) + { + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append(separator); + AppendCppTypeName( + interfaceType, + output); + output.Append("(nullptr)\n"); + separator = ", "; + } AppendIndent( cppMethodDefinitionsIndent, output); @@ -9732,7 +9885,23 @@ static void AppendExceptions( AppendIndent( throwerIndent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(": "); + builders.CppMethodDefinitions.Append(": System::Runtime::InteropServices::_Exception(nullptr)\n"); + AppendIndent( + throwerIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(", System::Runtime::Serialization::ISerializable(nullptr)\n"); + AppendIndent( + throwerIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(", System::Exception(nullptr)\n"); + AppendIndent( + throwerIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(", System::SystemException(nullptr)\n"); + AppendIndent( + throwerIndent + 2, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(", "); AppendCppTypeName( exceptionType, builders.CppMethodDefinitions); @@ -10331,6 +10500,7 @@ static void AppendCppTypeDefinitionBegin( string baseTypeName, string baseTypeNamespace, Type[] baseTypeTypeParams, + Type[] interfaceTypes, bool isStatic, int indent, StringBuilder output) @@ -10359,22 +10529,46 @@ static void AppendCppTypeDefinitionBegin( typeName, output); AppendCppTypeParameters(typeParams, output); - if (baseTypeName != null) + switch (typeKind) { - switch (typeKind) - { - case TypeKind.Class: - case TypeKind.ManagedStruct: - output.Append(" : "); + case TypeKind.Class: + case TypeKind.ManagedStruct: + // Only add the base type if it's not System.Object or + // there are no interfaces (since they always extend it) + string separator = " : virtual "; + if ( + (baseTypeName != null && + (baseTypeNamespace != "System" || + baseTypeName != "Object")) || + (interfaceTypes == null || + interfaceTypes.Length == 0)) + { + output.Append(separator); + separator = ", virtual "; AppendCppTypeName( - baseTypeNamespace, - baseTypeName, + baseTypeNamespace ?? "System", + baseTypeName ?? "Object", output); AppendCppTypeParameters( baseTypeTypeParams, output); - break; - } + } + if (interfaceTypes != null) + { + foreach (Type interfaceType in interfaceTypes) + { + output.Append(separator); + separator = ", virtual "; + AppendCppTypeName( + interfaceType.Namespace, + interfaceType.Name, + output); + AppendCppTypeParameters( + interfaceType.GetGenericArguments(), + output); + } + } + break; } } output.Append('\n'); @@ -10552,6 +10746,7 @@ static int AppendCppMethodDefinitionsBegin( string baseTypeName, string baseTypeNamespace, Type[] baseTypeTypeParams, + Type[] interfaceTypes, bool isStatic, Action extraDefault, Action extraCopy, @@ -10584,12 +10779,19 @@ static int AppendCppMethodDefinitionsBegin( enclosingTypeName, output); output.Append("(decltype(nullptr) n)\n"); - AppendIndent(indent, output); - output.Append("\t: "); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, - output); - output.Append("(Plugin::InternalUse::Only, 0)\n"); + string separator = ": "; + foreach (Type interfaceType in interfaceTypes) + { + AppendIndent( + indent + 1, + output); + output.Append(separator); + AppendCppTypeName( + interfaceType, + output); + output.Append("(nullptr)\n"); + separator = ", "; + } AppendIndent(indent, output); output.Append("{\n"); extraDefault(indent + 1, "this->"); @@ -10611,19 +10813,24 @@ static int AppendCppMethodDefinitionsBegin( enclosingTypeName, output); output.Append("(Plugin::InternalUse iu, int32_t handle)\n"); - AppendIndent(indent, output); - output.Append("\t: "); - AppendCppTypeName( - baseTypeNamespace, - baseTypeName, - output); - AppendCppTypeParameters( - baseTypeTypeParams, - output); - output.Append("(iu, handle)\n"); + separator = ": "; + foreach (Type interfaceType in interfaceTypes) + { + AppendIndent( + indent + 1, + output); + output.Append(separator); + AppendCppTypeName( + interfaceType, + output); + output.Append("(nullptr)\n"); + separator = ", "; + } AppendIndent(indent, output); output.Append("{\n"); AppendIndent(indent + 1, output); + output.Append("Handle = handle;\n"); + AppendIndent(indent + 1, output); output.Append("if (handle)\n"); AppendIndent(indent + 1, output); output.Append("{\n"); @@ -10664,8 +10871,8 @@ static int AppendCppMethodDefinitionsBegin( enclosingTypeParams, output); output.Append("& other)\n"); - AppendIndent(indent, output); - output.Append("\t: "); + AppendIndent(indent + 1, output); + output.Append(": "); AppendTypeNameWithoutGenericSuffix( enclosingTypeName, output); @@ -12424,6 +12631,8 @@ static void RemoveTrailingChars( RemoveTrailingChars(builders.CsharpGetDelegateCalls); RemoveTrailingChars(builders.CppFunctionPointers); RemoveTrailingChars(builders.CppTypeDeclarations); + RemoveTrailingChars(builders.CppTemplateDeclarations); + RemoveTrailingChars(builders.CppTemplateSpecializationDeclarations); RemoveTrailingChars(builders.CppTypeDefinitions); RemoveTrailingChars(builders.CppMethodDefinitions); RemoveTrailingChars(builders.CppInitParams); @@ -12527,6 +12736,16 @@ static void InjectBuilders( "/*BEGIN TYPE DECLARATIONS*/\n", "\n/*END TYPE DECLARATIONS*/", builders.CppTypeDeclarations.ToString()); + cppHeaderContents = InjectIntoString( + cppHeaderContents, + "/*BEGIN TEMPLATE DECLARATIONS*/\n", + "\n/*END TEMPLATE DECLARATIONS*/", + builders.CppTemplateDeclarations.ToString()); + cppHeaderContents = InjectIntoString( + cppHeaderContents, + "/*BEGIN TEMPLATE SPECIALIZATION DECLARATIONS*/\n", + "\n/*END TEMPLATE SPECIALIZATION DECLARATIONS*/", + builders.CppTemplateSpecializationDeclarations.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, "/*BEGIN TYPE DEFINITIONS*/\n", diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 7c09fbb..4e364ad 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -4,25 +4,45 @@ ], "Types": [ { - "Name": "System.Diagnostics.Stopwatch", + "Name": " System.IDisposable" + }, + { + "Name": "UnityEngine.Vector3", "Constructors": [ { - "ParamTypes": [] + "ParamTypes": [ + "System.Single", + "System.Single", + "System.Single" + ] } ], "Methods": [ { - "Name": "Start", - "ParamTypes": [] + "Name": "Set", + "ParamTypes": [ + "System.Single", + "System.Single", + "System.Single" + ] }, { - "Name": "Reset", - "ParamTypes": [] + "Name": "x+y", + "ParamTypes": [ + "UnityEngine.Vector3", + "UnityEngine.Vector3" + ] + }, + { + "Name": "-x", + "ParamTypes": [ + "UnityEngine.Vector3" + ] } ], "Properties": [ { - "Name": "ElapsedMilliseconds", + "Name": "magnitude", "Get": {} } ] @@ -52,6 +72,266 @@ } ] }, + { + "Name": "UnityEngine.Component", + "Properties": [ + { + "Name": "transform", + "Get": {} + } + ] + }, + { + "Name": "UnityEngine.Transform", + "Properties": [ + { + "Name": "position", + "Get": {}, + "Set": { + "Exceptions": [ + "System.NullReferenceException" + ] + } + } + ] + }, + { + "Name": "UnityEngine.Color" + }, + { + "Name": "UnityEngine.GradientColorKey" + }, + { + "Name": "UnityEngine.Resolution", + "Properties": [ + { + "Name": "width", + "Get": {}, + "Set": {} + }, + { + "Name": "height", + "Get": {}, + "Set": {} + }, + { + "Name": "refreshRate", + "Get": {}, + "Set": {} + } + ] + }, + { + "Name": "UnityEngine.RaycastHit", + "MaxSimultaneous": 1000, + "Properties": [ + { + "Name": "point", + "Get": {} + }, + { + "Name": "transform", + "Get": {} + } + ] + }, + { + "Name": "System.Collections.Generic.IEnumerable`1", + "GenericParams": [ + { + "Types": [ + "System.String" + ] + }, + { + "Types": [ + "System.Int32" + ] + }, + { + "Types": [ + "System.Single" + ] + }, + { + "Types": [ + "UnityEngine.RaycastHit" + ] + }, + { + "Types": [ + "UnityEngine.GradientColorKey" + ] + }, + { + "Types": [ + "UnityEngine.Resolution" + ] + } + ] + }, + { + "Name": "System.Collections.Generic.ICollection`1", + "GenericParams": [ + { + "Types": [ + "System.String" + ] + }, + { + "Types": [ + "System.Int32" + ] + }, + { + "Types": [ + "System.Single" + ] + }, + { + "Types": [ + "UnityEngine.RaycastHit" + ] + }, + { + "Types": [ + "UnityEngine.GradientColorKey" + ] + }, + { + "Types": [ + "UnityEngine.Resolution" + ] + } + ] + }, + { + "Name": "System.Collections.Generic.IList`1", + "GenericParams": [ + { + "Types": [ + "System.String" + ] + }, + { + "Types": [ + "System.Int32" + ] + }, + { + "Types": [ + "System.Single" + ] + }, + { + "Types": [ + "UnityEngine.RaycastHit" + ] + }, + { + "Types": [ + "UnityEngine.GradientColorKey" + ] + }, + { + "Types": [ + "UnityEngine.Resolution" + ] + } + ] + }, + { + "Name": "System.Runtime.Serialization.ISerializable" + }, + { + "Name": "System.Runtime.InteropServices._Exception" + }, + { + "Name": "System.IAppDomainSetup" + }, + { + "Name": "System.Collections.IComparer" + }, + { + "Name": "System.Collections.IEqualityComparer" + }, + { + "Name": "System.Collections.Generic.IEqualityComparer`1", + "GenericParams": [ + { + "Types": [ + "System.String" + ] + }, + { + "Types": [ + "System.Int32" + ] + } + ] + }, + { + "Name": "UnityEngine.Playables.PlayableGraph" + }, + { + "Name": "UnityEngine.Playables.IPlayable" + }, + { + "Name": "System.IEquatable`1", + "GenericParams": [ + { + "Types": [ + "UnityEngine.Animations.AnimationMixerPlayable" + ] + } + ] + }, + { + "Name": "UnityEngine.Animations.AnimationMixerPlayable", + "Methods": [ + { + "Name": "Create", + "ParamTypes": [ + "UnityEngine.Playables.PlayableGraph", + "System.Int32", + "System.Boolean" + ] + } + ] + }, + { + "Name": " System.Runtime.CompilerServices.IStrongBox" + }, + { + "Name": "UnityEngine.Experimental.UIElements.IEventHandler" + }, + { + "Name": "UnityEngine.Experimental.UIElements.IStyle" + }, + { + "Name": "System.Diagnostics.Stopwatch", + "Constructors": [ + { + "ParamTypes": [] + } + ], + "Methods": [ + { + "Name": "Start", + "ParamTypes": [] + }, + { + "Name": "Reset", + "ParamTypes": [] + } + ], + "Properties": [ + { + "Name": "ElapsedMilliseconds", + "Get": {} + } + ] + }, { "Name": "UnityEngine.GameObject", "Constructors": [ @@ -102,29 +382,6 @@ } ] }, - { - "Name": "UnityEngine.Component", - "Properties": [ - { - "Name": "transform", - "Get": {} - } - ] - }, - { - "Name": "UnityEngine.Transform", - "Properties": [ - { - "Name": "position", - "Get": {}, - "Set": { - "Exceptions": [ - "System.NullReferenceException" - ] - } - } - ] - }, { "Name": "UnityEngine.Debug", "Methods": [ @@ -209,47 +466,6 @@ } ] }, - { - "Name": "UnityEngine.Vector3", - "Constructors": [ - { - "ParamTypes": [ - "System.Single", - "System.Single", - "System.Single" - ] - } - ], - "Methods": [ - { - "Name": "Set", - "ParamTypes": [ - "System.Single", - "System.Single", - "System.Single" - ] - }, - { - "Name": "x+y", - "ParamTypes": [ - "UnityEngine.Vector3", - "UnityEngine.Vector3" - ] - }, - { - "Name": "-x", - "ParamTypes": [ - "UnityEngine.Vector3" - ] - } - ], - "Properties": [ - { - "Name": "magnitude", - "Get": {} - } - ] - }, { "Name": "UnityEngine.Quaternion" }, @@ -274,20 +490,6 @@ } ] }, - { - "Name": "UnityEngine.RaycastHit", - "MaxSimultaneous": 1000, - "Properties": [ - { - "Name": "point", - "Get": {} - }, - { - "Name": "transform", - "Get": {} - } - ] - }, { "Name": "UnityEngine.QueryTriggerInteraction" }, @@ -444,26 +646,6 @@ { "Name": "System.NullReferenceException" }, - { - "Name": "UnityEngine.Resolution", - "Properties": [ - { - "Name": "width", - "Get": {}, - "Set": {} - }, - { - "Name": "height", - "Get": {}, - "Set": {} - }, - { - "Name": "refreshRate", - "Get": {}, - "Set": {} - } - ] - }, { "Name": "UnityEngine.Screen", "Properties": [ @@ -502,12 +684,6 @@ } ] }, - { - "Name": "UnityEngine.Color" - }, - { - "Name": "UnityEngine.GradientColorKey" - }, { "Name": "UnityEngine.Gradient", "Constructors": [ @@ -649,18 +825,6 @@ {} ] }, - { - "Name": "System.Collections.ICollection", - "BaseTypes": [ - {} - ] - }, - { - "Name": "System.Collections.IList", - "BaseTypes": [ - {} - ] - }, { "Name": "System.Collections.Queue", "Properties": [ @@ -730,22 +894,6 @@ { "Name": "UnityEngine.Playables.PlayableHandle" }, - { - "Name": "UnityEngine.Playables.PlayableGraph" - }, - { - "Name": "UnityEngine.Animations.AnimationMixerPlayable", - "Methods": [ - { - "Name": "Create", - "ParamTypes": [ - "UnityEngine.Playables.PlayableGraph", - "System.Int32", - "System.Boolean" - ] - } - ] - }, { "Name": "UnityEngine.Experimental.UIElements.CallbackEventHandler" }, diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index e2ce580..b580994 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -49,23 +49,56 @@ namespace Plugin int32_t (*ArrayGetLength)(int32_t handle); /*BEGIN FUNCTION POINTERS*/ - int32_t (*SystemDiagnosticsStopwatchConstructor)(); - int64_t (*SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle); - void (*SystemDiagnosticsStopwatchMethodStart)(int32_t thisHandle); - void (*SystemDiagnosticsStopwatchMethodReset)(int32_t thisHandle); + UnityEngine::Vector3 (*UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z); + float (*UnityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz); + void (*UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ); + UnityEngine::Vector3 (*UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b); + UnityEngine::Vector3 (*UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a); + int32_t (*BoxVector3)(UnityEngine::Vector3& val); + UnityEngine::Vector3 (*UnboxVector3)(int32_t valHandle); int32_t (*UnityEngineObjectPropertyGetName)(int32_t thisHandle); void (*UnityEngineObjectPropertySetName)(int32_t thisHandle, int32_t valueHandle); System::Boolean (*UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject)(int32_t xHandle, int32_t yHandle); System::Boolean (*UnityEngineObjectMethodop_ImplicitUnityEngineObject)(int32_t existsHandle); + int32_t (*UnityEngineComponentPropertyGetTransform)(int32_t thisHandle); + UnityEngine::Vector3 (*UnityEngineTransformPropertyGetPosition)(int32_t thisHandle); + void (*UnityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value); + int32_t (*BoxColor)(UnityEngine::Color& val); + UnityEngine::Color (*UnboxColor)(int32_t valHandle); + int32_t (*BoxGradientColorKey)(UnityEngine::GradientColorKey& val); + UnityEngine::GradientColorKey (*UnboxGradientColorKey)(int32_t valHandle); + void (*ReleaseUnityEngineResolution)(int32_t handle); + int32_t (*UnityEngineResolutionPropertyGetWidth)(int32_t thisHandle); + void (*UnityEngineResolutionPropertySetWidth)(int32_t thisHandle, int32_t value); + int32_t (*UnityEngineResolutionPropertyGetHeight)(int32_t thisHandle); + void (*UnityEngineResolutionPropertySetHeight)(int32_t thisHandle, int32_t value); + int32_t (*UnityEngineResolutionPropertyGetRefreshRate)(int32_t thisHandle); + void (*UnityEngineResolutionPropertySetRefreshRate)(int32_t thisHandle, int32_t value); + int32_t (*BoxResolution)(int32_t valHandle); + int32_t (*UnboxResolution)(int32_t valHandle); + void (*ReleaseUnityEngineRaycastHit)(int32_t handle); + UnityEngine::Vector3 (*UnityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle); + void (*UnityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value); + int32_t (*UnityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle); + int32_t (*BoxRaycastHit)(int32_t valHandle); + int32_t (*UnboxRaycastHit)(int32_t valHandle); + void (*ReleaseUnityEnginePlayablesPlayableGraph)(int32_t handle); + int32_t (*BoxPlayableGraph)(int32_t valHandle); + int32_t (*UnboxPlayableGraph)(int32_t valHandle); + void (*ReleaseUnityEngineAnimationsAnimationMixerPlayable)(int32_t handle); + int32_t (*UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)(int32_t graphHandle, int32_t inputCount, System::Boolean normalizeWeights); + int32_t (*BoxAnimationMixerPlayable)(int32_t valHandle); + int32_t (*UnboxAnimationMixerPlayable)(int32_t valHandle); + int32_t (*SystemDiagnosticsStopwatchConstructor)(); + int64_t (*SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle); + void (*SystemDiagnosticsStopwatchMethodStart)(int32_t thisHandle); + void (*SystemDiagnosticsStopwatchMethodReset)(int32_t thisHandle); int32_t (*UnityEngineGameObjectConstructor)(); int32_t (*UnityEngineGameObjectConstructorSystemString)(int32_t nameHandle); int32_t (*UnityEngineGameObjectPropertyGetTransform)(int32_t thisHandle); int32_t (*UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle); int32_t (*UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript)(int32_t thisHandle); int32_t (*UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)(UnityEngine::PrimitiveType type); - int32_t (*UnityEngineComponentPropertyGetTransform)(int32_t thisHandle); - UnityEngine::Vector3 (*UnityEngineTransformPropertyGetPosition)(int32_t thisHandle); - void (*UnityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value); void (*UnityEngineDebugMethodLogSystemObject)(int32_t messageHandle); System::Boolean (*UnityEngineAssertionsAssertFieldGetRaiseExceptions)(); void (*UnityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value); @@ -75,25 +108,12 @@ namespace Plugin void (*UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)(int32_t* bufferLength, int32_t* numBuffers); void (*UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)(int32_t hostId, int32_t* addressHandle, int32_t* port, uint8_t* error); void (*UnityEngineNetworkingNetworkTransportMethodInit)(); - UnityEngine::Vector3 (*UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z); - float (*UnityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz); - void (*UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ); - UnityEngine::Vector3 (*UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b); - UnityEngine::Vector3 (*UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a); - int32_t (*BoxVector3)(UnityEngine::Vector3& val); - UnityEngine::Vector3 (*UnboxVector3)(int32_t valHandle); int32_t (*BoxQuaternion)(UnityEngine::Quaternion& val); UnityEngine::Quaternion (*UnboxQuaternion)(int32_t valHandle); float (*UnityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column); void (*UnityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value); int32_t (*BoxMatrix4x4)(UnityEngine::Matrix4x4& val); UnityEngine::Matrix4x4 (*UnboxMatrix4x4)(int32_t valHandle); - void (*ReleaseUnityEngineRaycastHit)(int32_t handle); - UnityEngine::Vector3 (*UnityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle); - void (*UnityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value); - int32_t (*UnityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle); - int32_t (*BoxRaycastHit)(int32_t valHandle); - int32_t (*UnboxRaycastHit)(int32_t valHandle); int32_t (*BoxQueryTriggerInteraction)(UnityEngine::QueryTriggerInteraction val); UnityEngine::QueryTriggerInteraction (*UnboxQueryTriggerInteraction)(int32_t valHandle); void (*ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)(int32_t handle); @@ -119,15 +139,6 @@ namespace Plugin int32_t (*SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)(int32_t thisHandle); void (*SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)(int32_t thisHandle, int32_t valueHandle); int32_t (*SystemExceptionConstructorSystemString)(int32_t messageHandle); - void (*ReleaseUnityEngineResolution)(int32_t handle); - int32_t (*UnityEngineResolutionPropertyGetWidth)(int32_t thisHandle); - void (*UnityEngineResolutionPropertySetWidth)(int32_t thisHandle, int32_t value); - int32_t (*UnityEngineResolutionPropertyGetHeight)(int32_t thisHandle); - void (*UnityEngineResolutionPropertySetHeight)(int32_t thisHandle, int32_t value); - int32_t (*UnityEngineResolutionPropertyGetRefreshRate)(int32_t thisHandle); - void (*UnityEngineResolutionPropertySetRefreshRate)(int32_t thisHandle, int32_t value); - int32_t (*BoxResolution)(int32_t valHandle); - int32_t (*UnboxResolution)(int32_t valHandle); int32_t (*UnityEngineScreenPropertyGetResolutions)(); void (*ReleaseUnityEngineRay)(int32_t handle); int32_t (*UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); @@ -135,10 +146,6 @@ namespace Plugin int32_t (*UnboxRay)(int32_t valHandle); int32_t (*UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1)(int32_t rayHandle, int32_t resultsHandle); int32_t (*UnityEnginePhysicsMethodRaycastAllUnityEngineRay)(int32_t rayHandle); - int32_t (*BoxColor)(UnityEngine::Color& val); - UnityEngine::Color (*UnboxColor)(int32_t valHandle); - int32_t (*BoxGradientColorKey)(UnityEngine::GradientColorKey& val); - UnityEngine::GradientColorKey (*UnboxGradientColorKey)(int32_t valHandle); int32_t (*UnityEngineGradientConstructor)(); int32_t (*UnityEngineGradientPropertyGetColorKeys)(int32_t thisHandle); void (*UnityEngineGradientPropertySetColorKeys)(int32_t thisHandle, int32_t valueHandle); @@ -167,10 +174,6 @@ namespace Plugin void (*SystemCollectionsGenericBaseIComparerSystemStringConstructor)(int32_t cppHandle, int32_t* handle); void (*ReleaseSystemBaseStringComparer)(int32_t handle); void (*SystemBaseStringComparerConstructor)(int32_t cppHandle, int32_t* handle); - void (*ReleaseSystemCollectionsBaseICollection)(int32_t handle); - void (*SystemCollectionsBaseICollectionConstructor)(int32_t cppHandle, int32_t* handle); - void (*ReleaseSystemCollectionsBaseIList)(int32_t handle); - void (*SystemCollectionsBaseIListConstructor)(int32_t cppHandle, int32_t* handle); int32_t (*SystemCollectionsQueuePropertyGetCount)(int32_t thisHandle); void (*ReleaseSystemCollectionsBaseQueue)(int32_t handle); void (*SystemCollectionsBaseQueueConstructor)(int32_t cppHandle, int32_t* handle); @@ -183,13 +186,6 @@ namespace Plugin void (*ReleaseUnityEnginePlayablesPlayableHandle)(int32_t handle); int32_t (*BoxPlayableHandle)(int32_t valHandle); int32_t (*UnboxPlayableHandle)(int32_t valHandle); - void (*ReleaseUnityEnginePlayablesPlayableGraph)(int32_t handle); - int32_t (*BoxPlayableGraph)(int32_t valHandle); - int32_t (*UnboxPlayableGraph)(int32_t valHandle); - void (*ReleaseUnityEngineAnimationsAnimationMixerPlayable)(int32_t handle); - int32_t (*UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)(int32_t graphHandle, int32_t inputCount, System::Boolean normalizeWeights); - int32_t (*BoxAnimationMixerPlayable)(int32_t valHandle); - int32_t (*UnboxAnimationMixerPlayable)(int32_t valHandle); int32_t (*UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1)(int32_t eHandle, int32_t nameHandle, int32_t classesHandle); int32_t (*UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString)(int32_t eHandle, int32_t nameHandle, int32_t classNameHandle); int32_t (*BoxInteractionSourcePositionAccuracy)(UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy val); @@ -359,6 +355,31 @@ namespace Plugin } /*BEGIN GLOBAL STATE AND FUNCTIONS*/ + int32_t RefCountsLenUnityEngineResolution; + int32_t* RefCountsUnityEngineResolution; + + void ReferenceManagedUnityEngineResolution(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineResolution); + if (handle != 0) + { + RefCountsUnityEngineResolution[handle]++; + } + } + + void DereferenceManagedUnityEngineResolution(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineResolution); + if (handle != 0) + { + int32_t numRemain = --RefCountsUnityEngineResolution[handle]; + if (numRemain == 0) + { + ReleaseUnityEngineResolution(handle); + } + } + } + int32_t RefCountsLenUnityEngineRaycastHit; int32_t* RefCountsUnityEngineRaycastHit; @@ -384,52 +405,77 @@ namespace Plugin } } - int32_t RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; - int32_t* RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; + int32_t RefCountsLenUnityEnginePlayablesPlayableGraph; + int32_t* RefCountsUnityEnginePlayablesPlayableGraph; - void ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int32_t handle) + void ReferenceManagedUnityEnginePlayablesPlayableGraph(int32_t handle) { - assert(handle >= 0 && handle < RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble); + assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableGraph); if (handle != 0) { - RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble[handle]++; + RefCountsUnityEnginePlayablesPlayableGraph[handle]++; } } - void DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int32_t handle) + void DereferenceManagedUnityEnginePlayablesPlayableGraph(int32_t handle) { - assert(handle >= 0 && handle < RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble); + assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableGraph); if (handle != 0) { - int32_t numRemain = --RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble[handle]; + int32_t numRemain = --RefCountsUnityEnginePlayablesPlayableGraph[handle]; if (numRemain == 0) { - ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(handle); + ReleaseUnityEnginePlayablesPlayableGraph(handle); } } } - int32_t RefCountsLenUnityEngineResolution; - int32_t* RefCountsUnityEngineResolution; + int32_t RefCountsLenUnityEngineAnimationsAnimationMixerPlayable; + int32_t* RefCountsUnityEngineAnimationsAnimationMixerPlayable; - void ReferenceManagedUnityEngineResolution(int32_t handle) + void ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(int32_t handle) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineResolution); + assert(handle >= 0 && handle < RefCountsLenUnityEngineAnimationsAnimationMixerPlayable); if (handle != 0) { - RefCountsUnityEngineResolution[handle]++; + RefCountsUnityEngineAnimationsAnimationMixerPlayable[handle]++; } } - void DereferenceManagedUnityEngineResolution(int32_t handle) + void DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(int32_t handle) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineResolution); + assert(handle >= 0 && handle < RefCountsLenUnityEngineAnimationsAnimationMixerPlayable); if (handle != 0) { - int32_t numRemain = --RefCountsUnityEngineResolution[handle]; + int32_t numRemain = --RefCountsUnityEngineAnimationsAnimationMixerPlayable[handle]; if (numRemain == 0) { - ReleaseUnityEngineResolution(handle); + ReleaseUnityEngineAnimationsAnimationMixerPlayable(handle); + } + } + } + + int32_t RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; + int32_t* RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; + + void ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble); + if (handle != 0) + { + RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble[handle]++; + } + } + + void DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble); + if (handle != 0) + { + int32_t numRemain = --RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble[handle]; + if (numRemain == 0) + { + ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(handle); } } } @@ -559,56 +605,6 @@ namespace Plugin *pRelease = (System::BaseStringComparer*)NextFreeSystemBaseStringComparer; NextFreeSystemBaseStringComparer = pRelease; } - int32_t SystemCollectionsBaseICollectionFreeListSize; - System::Collections::BaseICollection** SystemCollectionsBaseICollectionFreeList; - System::Collections::BaseICollection** NextFreeSystemCollectionsBaseICollection; - - int32_t StoreSystemCollectionsBaseICollection(System::Collections::BaseICollection* del) - { - assert(NextFreeSystemCollectionsBaseICollection != nullptr); - System::Collections::BaseICollection** pNext = NextFreeSystemCollectionsBaseICollection; - NextFreeSystemCollectionsBaseICollection = (System::Collections::BaseICollection**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemCollectionsBaseICollectionFreeList); - } - - System::Collections::BaseICollection* GetSystemCollectionsBaseICollection(int32_t handle) - { - assert(handle >= 0 && handle < SystemCollectionsBaseICollectionFreeListSize); - return SystemCollectionsBaseICollectionFreeList[handle]; - } - - void RemoveSystemCollectionsBaseICollection(int32_t handle) - { - System::Collections::BaseICollection** pRelease = SystemCollectionsBaseICollectionFreeList + handle; - *pRelease = (System::Collections::BaseICollection*)NextFreeSystemCollectionsBaseICollection; - NextFreeSystemCollectionsBaseICollection = pRelease; - } - int32_t SystemCollectionsBaseIListFreeListSize; - System::Collections::BaseIList** SystemCollectionsBaseIListFreeList; - System::Collections::BaseIList** NextFreeSystemCollectionsBaseIList; - - int32_t StoreSystemCollectionsBaseIList(System::Collections::BaseIList* del) - { - assert(NextFreeSystemCollectionsBaseIList != nullptr); - System::Collections::BaseIList** pNext = NextFreeSystemCollectionsBaseIList; - NextFreeSystemCollectionsBaseIList = (System::Collections::BaseIList**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemCollectionsBaseIListFreeList); - } - - System::Collections::BaseIList* GetSystemCollectionsBaseIList(int32_t handle) - { - assert(handle >= 0 && handle < SystemCollectionsBaseIListFreeListSize); - return SystemCollectionsBaseIListFreeList[handle]; - } - - void RemoveSystemCollectionsBaseIList(int32_t handle) - { - System::Collections::BaseIList** pRelease = SystemCollectionsBaseIListFreeList + handle; - *pRelease = (System::Collections::BaseIList*)NextFreeSystemCollectionsBaseIList; - NextFreeSystemCollectionsBaseIList = pRelease; - } int32_t SystemCollectionsBaseQueueFreeListSize; System::Collections::BaseQueue** SystemCollectionsBaseQueueFreeList; System::Collections::BaseQueue** NextFreeSystemCollectionsBaseQueue; @@ -709,56 +705,6 @@ namespace Plugin } } - int32_t RefCountsLenUnityEnginePlayablesPlayableGraph; - int32_t* RefCountsUnityEnginePlayablesPlayableGraph; - - void ReferenceManagedUnityEnginePlayablesPlayableGraph(int32_t handle) - { - assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableGraph); - if (handle != 0) - { - RefCountsUnityEnginePlayablesPlayableGraph[handle]++; - } - } - - void DereferenceManagedUnityEnginePlayablesPlayableGraph(int32_t handle) - { - assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableGraph); - if (handle != 0) - { - int32_t numRemain = --RefCountsUnityEnginePlayablesPlayableGraph[handle]; - if (numRemain == 0) - { - ReleaseUnityEnginePlayablesPlayableGraph(handle); - } - } - } - - int32_t RefCountsLenUnityEngineAnimationsAnimationMixerPlayable; - int32_t* RefCountsUnityEngineAnimationsAnimationMixerPlayable; - - void ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(int32_t handle) - { - assert(handle >= 0 && handle < RefCountsLenUnityEngineAnimationsAnimationMixerPlayable); - if (handle != 0) - { - RefCountsUnityEngineAnimationsAnimationMixerPlayable[handle]++; - } - } - - void DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(int32_t handle) - { - assert(handle >= 0 && handle < RefCountsLenUnityEngineAnimationsAnimationMixerPlayable); - if (handle != 0) - { - int32_t numRemain = --RefCountsUnityEngineAnimationsAnimationMixerPlayable[handle]; - if (numRemain == 0) - { - ReleaseUnityEngineAnimationsAnimationMixerPlayable(handle); - } - } - } - int32_t RefCountsLenUnityEngineXRWSAInputInteractionSourcePose; int32_t* RefCountsUnityEngineXRWSAInputInteractionSourcePose; @@ -1100,6 +1046,11 @@ namespace Plugin namespace System { + Object::Object() + : Handle(0) + { + } + Object::Object(Plugin::InternalUse iu, int32_t handle) : Handle(handle) { @@ -1126,13 +1077,13 @@ namespace System } ValueType::ValueType(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) { - Handle = handle; } ValueType::ValueType(decltype(nullptr) n) + : Object(nullptr) { - Handle = 0; } String::String(decltype(nullptr) n) @@ -1216,196 +1167,112 @@ namespace System { } - Array::Array(Plugin::InternalUse iu, int32_t handle) + ICloneable::ICloneable(Plugin::InternalUse iu, int32_t handle) : Object(iu, handle) { } - Array::Array(decltype(nullptr) n) - : Object(Plugin::InternalUse::Only, 0) - { - } - - int32_t Array::GetLength() + ICloneable::ICloneable(decltype(nullptr) n) + : Object(nullptr) { - return Plugin::ArrayGetLength(Handle); } - int32_t Array::GetRank() + namespace Collections { - return 0; - } -} - -/*BEGIN METHOD DEFINITIONS*/ -namespace System -{ - namespace Diagnostics - { - Stopwatch::Stopwatch(decltype(nullptr) n) - : Stopwatch(Plugin::InternalUse::Only, 0) - { - } - - Stopwatch::Stopwatch(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Stopwatch::Stopwatch(const Stopwatch& other) - : Stopwatch(Plugin::InternalUse::Only, other.Handle) - { - } - - Stopwatch::Stopwatch(Stopwatch&& other) - : Stopwatch(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Stopwatch::~Stopwatch() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Stopwatch& Stopwatch::operator=(const Stopwatch& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Stopwatch& Stopwatch::operator=(decltype(nullptr) other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Stopwatch& Stopwatch::operator=(Stopwatch&& other) + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; } - bool Stopwatch::operator==(const Stopwatch& other) const + IEnumerable::IEnumerable(decltype(nullptr) n) + : Object(nullptr) { - return Handle == other.Handle; } - bool Stopwatch::operator!=(const Stopwatch& other) const + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) + , IEnumerable(nullptr) { - return Handle != other.Handle; } - Stopwatch::Stopwatch() - : System::Object(nullptr) + ICollection::ICollection(decltype(nullptr) n) + : Object(nullptr) + , IEnumerable(nullptr) { - auto returnValue = Plugin::SystemDiagnosticsStopwatchConstructor(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } } - int64_t Stopwatch::GetElapsedMilliseconds() + IList::IList(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) + , IEnumerable(nullptr) + , ICollection(nullptr) { - auto returnValue = Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; } - void Stopwatch::Start() + IList::IList(decltype(nullptr) n) + : Object(nullptr) + , IEnumerable(nullptr) + , ICollection(nullptr) { - Plugin::SystemDiagnosticsStopwatchMethodStart(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } } + } - void Stopwatch::Reset() - { - Plugin::SystemDiagnosticsStopwatchMethodReset(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + Array::Array(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) + , ICloneable(nullptr) + , Collections::IEnumerable(nullptr) + , Collections::ICollection(nullptr) + , Collections::IList(nullptr) + { + } + + Array::Array(decltype(nullptr) n) + : Object(nullptr) + , ICloneable(nullptr) + , Collections::IEnumerable(nullptr) + , Collections::ICollection(nullptr) + , Collections::IList(nullptr) + { + } + + int32_t Array::GetLength() + { + return Plugin::ArrayGetLength(Handle); + } + + int32_t Array::GetRank() + { + return 0; } } -namespace UnityEngine +/*BEGIN METHOD DEFINITIONS*/ +namespace System { - Object::Object(decltype(nullptr) n) - : Object(Plugin::InternalUse::Only, 0) + IDisposable::IDisposable(decltype(nullptr) n) { } - Object::Object(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + IDisposable::IDisposable(Plugin::InternalUse iu, int32_t handle) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - Object::Object(const Object& other) - : Object(Plugin::InternalUse::Only, other.Handle) + IDisposable::IDisposable(const IDisposable& other) + : IDisposable(Plugin::InternalUse::Only, other.Handle) { } - Object::Object(Object&& other) - : Object(Plugin::InternalUse::Only, other.Handle) + IDisposable::IDisposable(IDisposable&& other) + : IDisposable(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - Object::~Object() + IDisposable::~IDisposable() { if (Handle) { @@ -1414,7 +1281,7 @@ namespace UnityEngine } } - Object& Object::operator=(const Object& other) + IDisposable& IDisposable::operator=(const IDisposable& other) { if (this->Handle) { @@ -1428,7 +1295,7 @@ namespace UnityEngine return *this; } - Object& Object::operator=(decltype(nullptr) other) + IDisposable& IDisposable::operator=(decltype(nullptr) other) { if (Handle) { @@ -1438,7 +1305,7 @@ namespace UnityEngine return *this; } - Object& Object::operator=(Object&& other) + IDisposable& IDisposable::operator=(IDisposable&& other) { if (Handle) { @@ -1449,19 +1316,26 @@ namespace UnityEngine return *this; } - bool Object::operator==(const Object& other) const + bool IDisposable::operator==(const IDisposable& other) const { return Handle == other.Handle; } - bool Object::operator!=(const Object& other) const + bool IDisposable::operator!=(const IDisposable& other) const { return Handle != other.Handle; } +} + +namespace UnityEngine +{ + Vector3::Vector3() + { + } - System::String Object::GetName() + Vector3::Vector3(float x, float y, float z) { - auto returnValue = Plugin::UnityEngineObjectPropertyGetName(Handle); + auto returnValue = Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(x, y, z); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -1469,12 +1343,12 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return System::String(Plugin::InternalUse::Only, returnValue); + *this = returnValue; } - void Object::SetName(System::String& value) + float Vector3::GetMagnitude() { - Plugin::UnityEngineObjectPropertySetName(Handle, value.Handle); + auto returnValue = Plugin::UnityEngineVector3PropertyGetMagnitude(this); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -1482,11 +1356,24 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } + return returnValue; } - System::Boolean Object::operator==(UnityEngine::Object& x) + void Vector3::Set(float newX, float newY, float newZ) { - auto returnValue = Plugin::UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject(Handle, x.Handle); + Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(this, newX, newY, newZ); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + UnityEngine::Vector3 Vector3::operator+(UnityEngine::Vector3& a) + { + auto returnValue = Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(*this, a); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -1497,9 +1384,9 @@ namespace UnityEngine return returnValue; } - Object::operator System::Boolean() + UnityEngine::Vector3 Vector3::operator-() { - auto returnValue = Plugin::UnityEngineObjectMethodop_ImplicitUnityEngineObject(Handle); + auto returnValue = Plugin::UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3(*this); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -1511,34 +1398,66 @@ namespace UnityEngine } } +namespace System +{ + Object::Object(UnityEngine::Vector3& val) + { + int32_t handle = Plugin::BoxVector3(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::Vector3() + { + UnityEngine::Vector3 returnVal(Plugin::UnboxVector3(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + namespace UnityEngine { - GameObject::GameObject(decltype(nullptr) n) - : GameObject(Plugin::InternalUse::Only, 0) + Object::Object(decltype(nullptr) n) { } - GameObject::GameObject(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::Object(iu, handle) + Object::Object(Plugin::InternalUse iu, int32_t handle) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - GameObject::GameObject(const GameObject& other) - : GameObject(Plugin::InternalUse::Only, other.Handle) + Object::Object(const Object& other) + : Object(Plugin::InternalUse::Only, other.Handle) { } - GameObject::GameObject(GameObject&& other) - : GameObject(Plugin::InternalUse::Only, other.Handle) + Object::Object(Object&& other) + : Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - GameObject::~GameObject() + Object::~Object() { if (Handle) { @@ -1547,7 +1466,7 @@ namespace UnityEngine } } - GameObject& GameObject::operator=(const GameObject& other) + Object& Object::operator=(const Object& other) { if (this->Handle) { @@ -1561,7 +1480,7 @@ namespace UnityEngine return *this; } - GameObject& GameObject::operator=(decltype(nullptr) other) + Object& Object::operator=(decltype(nullptr) other) { if (Handle) { @@ -1571,7 +1490,7 @@ namespace UnityEngine return *this; } - GameObject& GameObject::operator=(GameObject&& other) + Object& Object::operator=(Object&& other) { if (Handle) { @@ -1582,55 +1501,19 @@ namespace UnityEngine return *this; } - bool GameObject::operator==(const GameObject& other) const + bool Object::operator==(const Object& other) const { return Handle == other.Handle; } - bool GameObject::operator!=(const GameObject& other) const + bool Object::operator!=(const Object& other) const { return Handle != other.Handle; } - GameObject::GameObject() - : UnityEngine::Object(nullptr) + System::String Object::GetName() { - auto returnValue = Plugin::UnityEngineGameObjectConstructor(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - GameObject::GameObject(System::String& name) - : UnityEngine::Object(nullptr) - { - auto returnValue = Plugin::UnityEngineGameObjectConstructorSystemString(name.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - UnityEngine::Transform GameObject::GetTransform() - { - auto returnValue = Plugin::UnityEngineGameObjectPropertyGetTransform(Handle); + auto returnValue = Plugin::UnityEngineObjectPropertyGetName(Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -1638,12 +1521,12 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); + return System::String(Plugin::InternalUse::Only, returnValue); } - template<> MyGame::MonoBehaviours::TestScript GameObject::AddComponent() + void Object::SetName(System::String& value) { - auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(Handle); + Plugin::UnityEngineObjectPropertySetName(Handle, value.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -1651,12 +1534,11 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return MyGame::MonoBehaviours::TestScript(Plugin::InternalUse::Only, returnValue); } - template<> MyGame::MonoBehaviours::AnotherScript GameObject::AddComponent() + System::Boolean Object::operator==(UnityEngine::Object& x) { - auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript(Handle); + auto returnValue = Plugin::UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject(Handle, x.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -1664,12 +1546,12 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return MyGame::MonoBehaviours::AnotherScript(Plugin::InternalUse::Only, returnValue); + return returnValue; } - UnityEngine::GameObject GameObject::CreatePrimitive(UnityEngine::PrimitiveType type) + Object::operator System::Boolean() { - auto returnValue = Plugin::UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(type); + auto returnValue = Plugin::UnityEngineObjectMethodop_ImplicitUnityEngineObject(Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -1677,20 +1559,21 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return UnityEngine::GameObject(Plugin::InternalUse::Only, returnValue); + return returnValue; } } namespace UnityEngine { Component::Component(decltype(nullptr) n) - : Component(Plugin::InternalUse::Only, 0) + : UnityEngine::Object(nullptr) { } Component::Component(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::Object(iu, handle) + : UnityEngine::Object(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -1779,13 +1662,18 @@ namespace UnityEngine namespace UnityEngine { Transform::Transform(decltype(nullptr) n) - : Transform(Plugin::InternalUse::Only, 0) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , System::Collections::IEnumerable(nullptr) { } Transform::Transform(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::Component(iu, handle) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , System::Collections::IEnumerable(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -1885,88 +1773,33 @@ namespace UnityEngine namespace UnityEngine { - Debug::Debug(decltype(nullptr) n) - : Debug(Plugin::InternalUse::Only, 0) - { - } - - Debug::Debug(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Debug::Debug(const Debug& other) - : Debug(Plugin::InternalUse::Only, other.Handle) - { - } - - Debug::Debug(Debug&& other) - : Debug(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Debug::~Debug() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Debug& Debug::operator=(const Debug& other) + Color::Color() { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; } - - Debug& Debug::operator=(decltype(nullptr) other) +} + +namespace System +{ + Object::Object(UnityEngine::Color& val) { - if (Handle) + int32_t handle = Plugin::BoxColor(val); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - return *this; - } - - Debug& Debug::operator=(Debug&& other) - { - if (Handle) + if (handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::ReferenceManagedClass(handle); + Handle = handle; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Debug::operator==(const Debug& other) const - { - return Handle == other.Handle; - } - - bool Debug::operator!=(const Debug& other) const - { - return Handle != other.Handle; } - void Debug::Log(System::Object& message) + Object::operator UnityEngine::Color() { - Plugin::UnityEngineDebugMethodLogSystemObject(message.Handle); + UnityEngine::Color returnVal(Plugin::UnboxColor(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -1974,312 +1807,326 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } + return returnVal; } } namespace UnityEngine { - namespace Assertions + GradientColorKey::GradientColorKey() { - System::Boolean Assert::GetRaiseExceptions() - { - auto returnValue = Plugin::UnityEngineAssertionsAssertFieldGetRaiseExceptions(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void Assert::SetRaiseExceptions(System::Boolean value) + } +} + +namespace System +{ + Object::Object(UnityEngine::GradientColorKey& val) + { + int32_t handle = Plugin::BoxGradientColorKey(val); + if (Plugin::unhandledCsharpException) { - Plugin::UnityEngineAssertionsAssertFieldSetRaiseExceptions(value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - template<> void Assert::AreEqual(System::String& expected, System::String& actual) + if (handle) { - Plugin::UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(expected.Handle, actual.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + Plugin::ReferenceManagedClass(handle); + Handle = handle; } + } - template<> void Assert::AreEqual(UnityEngine::GameObject& expected, UnityEngine::GameObject& actual) + Object::operator UnityEngine::GradientColorKey() + { + UnityEngine::GradientColorKey returnVal(Plugin::UnboxGradientColorKey(Handle)); + if (Plugin::unhandledCsharpException) { - Plugin::UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(expected.Handle, actual.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnVal; } } namespace UnityEngine { - Collision::Collision(decltype(nullptr) n) - : Collision(Plugin::InternalUse::Only, 0) + Resolution::Resolution(decltype(nullptr) n) + : System::ValueType(nullptr) { } - Collision::Collision(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + Resolution::Resolution(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(nullptr) { + Handle = handle; if (handle) { - Plugin::ReferenceManagedClass(handle); + Plugin::ReferenceManagedUnityEngineResolution(Handle); } } - Collision::Collision(const Collision& other) - : Collision(Plugin::InternalUse::Only, other.Handle) + Resolution::Resolution(const Resolution& other) + : Resolution(Plugin::InternalUse::Only, other.Handle) { } - Collision::Collision(Collision&& other) - : Collision(Plugin::InternalUse::Only, other.Handle) + Resolution::Resolution(Resolution&& other) + : Resolution(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - Collision::~Collision() + Resolution::~Resolution() { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedUnityEngineResolution(Handle); Handle = 0; } } - Collision& Collision::operator=(const Collision& other) + Resolution& Resolution::operator=(const Resolution& other) { if (this->Handle) { - Plugin::DereferenceManagedClass(this->Handle); + Plugin::DereferenceManagedUnityEngineResolution(Handle); } this->Handle = other.Handle; if (this->Handle) { - Plugin::ReferenceManagedClass(this->Handle); + Plugin::ReferenceManagedUnityEngineResolution(Handle); } return *this; } - Collision& Collision::operator=(decltype(nullptr) other) + Resolution& Resolution::operator=(decltype(nullptr) other) { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedUnityEngineResolution(Handle); Handle = 0; } return *this; } - Collision& Collision::operator=(Collision&& other) + Resolution& Resolution::operator=(Resolution&& other) { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedUnityEngineResolution(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool Collision::operator==(const Collision& other) const + bool Resolution::operator==(const Resolution& other) const { return Handle == other.Handle; } - bool Collision::operator!=(const Collision& other) const + bool Resolution::operator!=(const Resolution& other) const { return Handle != other.Handle; } -} - -namespace UnityEngine -{ - Behaviour::Behaviour(decltype(nullptr) n) - : Behaviour(Plugin::InternalUse::Only, 0) - { - } - Behaviour::Behaviour(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::Component(iu, handle) + int32_t Resolution::GetWidth() { - if (handle) + auto returnValue = Plugin::UnityEngineResolutionPropertyGetWidth(Handle); + if (Plugin::unhandledCsharpException) { - Plugin::ReferenceManagedClass(handle); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnValue; } - Behaviour::Behaviour(const Behaviour& other) - : Behaviour(Plugin::InternalUse::Only, other.Handle) - { - } - - Behaviour::Behaviour(Behaviour&& other) - : Behaviour(Plugin::InternalUse::Only, other.Handle) + void Resolution::SetWidth(int32_t value) { - other.Handle = 0; + Plugin::UnityEngineResolutionPropertySetWidth(Handle, value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - Behaviour::~Behaviour() + int32_t Resolution::GetHeight() { - if (Handle) + auto returnValue = Plugin::UnityEngineResolutionPropertyGetHeight(Handle); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnValue; } - Behaviour& Behaviour::operator=(const Behaviour& other) + void Resolution::SetHeight(int32_t value) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + Plugin::UnityEngineResolutionPropertySetHeight(Handle, value); + if (Plugin::unhandledCsharpException) { - Plugin::ReferenceManagedClass(this->Handle); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - return *this; } - Behaviour& Behaviour::operator=(decltype(nullptr) other) + int32_t Resolution::GetRefreshRate() { - if (Handle) + auto returnValue = Plugin::UnityEngineResolutionPropertyGetRefreshRate(Handle); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - return *this; + return returnValue; } - Behaviour& Behaviour::operator=(Behaviour&& other) + void Resolution::SetRefreshRate(int32_t value) { - if (Handle) + Plugin::UnityEngineResolutionPropertySetRefreshRate(Handle, value); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - Handle = other.Handle; - other.Handle = 0; - return *this; } - - bool Behaviour::operator==(const Behaviour& other) const +} + +namespace System +{ + Object::Object(UnityEngine::Resolution& val) { - return Handle == other.Handle; + int32_t handle = Plugin::BoxResolution(val.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } } - bool Behaviour::operator!=(const Behaviour& other) const + Object::operator UnityEngine::Resolution() { - return Handle != other.Handle; + UnityEngine::Resolution returnVal(Plugin::InternalUse::Only, Plugin::UnboxResolution(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; } } namespace UnityEngine { - MonoBehaviour::MonoBehaviour(decltype(nullptr) n) - : MonoBehaviour(Plugin::InternalUse::Only, 0) + RaycastHit::RaycastHit(decltype(nullptr) n) + : System::ValueType(nullptr) { } - MonoBehaviour::MonoBehaviour(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::Behaviour(iu, handle) + RaycastHit::RaycastHit(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(nullptr) { + Handle = handle; if (handle) { - Plugin::ReferenceManagedClass(handle); + Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); } } - MonoBehaviour::MonoBehaviour(const MonoBehaviour& other) - : MonoBehaviour(Plugin::InternalUse::Only, other.Handle) + RaycastHit::RaycastHit(const RaycastHit& other) + : RaycastHit(Plugin::InternalUse::Only, other.Handle) { } - MonoBehaviour::MonoBehaviour(MonoBehaviour&& other) - : MonoBehaviour(Plugin::InternalUse::Only, other.Handle) + RaycastHit::RaycastHit(RaycastHit&& other) + : RaycastHit(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - MonoBehaviour::~MonoBehaviour() + RaycastHit::~RaycastHit() { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); Handle = 0; } } - MonoBehaviour& MonoBehaviour::operator=(const MonoBehaviour& other) + RaycastHit& RaycastHit::operator=(const RaycastHit& other) { if (this->Handle) { - Plugin::DereferenceManagedClass(this->Handle); + Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); } this->Handle = other.Handle; if (this->Handle) { - Plugin::ReferenceManagedClass(this->Handle); + Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); } return *this; } - MonoBehaviour& MonoBehaviour::operator=(decltype(nullptr) other) + RaycastHit& RaycastHit::operator=(decltype(nullptr) other) { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); Handle = 0; } return *this; } - MonoBehaviour& MonoBehaviour::operator=(MonoBehaviour&& other) + RaycastHit& RaycastHit::operator=(RaycastHit&& other) { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool MonoBehaviour::operator==(const MonoBehaviour& other) const + bool RaycastHit::operator==(const RaycastHit& other) const { return Handle == other.Handle; } - bool MonoBehaviour::operator!=(const MonoBehaviour& other) const + bool RaycastHit::operator!=(const RaycastHit& other) const { return Handle != other.Handle; } - UnityEngine::Transform MonoBehaviour::GetTransform() + UnityEngine::Vector3 RaycastHit::GetPoint() { - auto returnValue = Plugin::UnityEngineMonoBehaviourPropertyGetTransform(Handle); + auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetPoint(Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -2287,94 +2134,57 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); - } -} - -namespace UnityEngine -{ - AudioSettings::AudioSettings(decltype(nullptr) n) - : AudioSettings(Plugin::InternalUse::Only, 0) - { - } - - AudioSettings::AudioSettings(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - AudioSettings::AudioSettings(const AudioSettings& other) - : AudioSettings(Plugin::InternalUse::Only, other.Handle) - { - } - - AudioSettings::AudioSettings(AudioSettings&& other) - : AudioSettings(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; + return returnValue; } - AudioSettings::~AudioSettings() + void RaycastHit::SetPoint(UnityEngine::Vector3& value) { - if (Handle) + Plugin::UnityEngineRaycastHitPropertySetPoint(Handle, value); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } } - AudioSettings& AudioSettings::operator=(const AudioSettings& other) + UnityEngine::Transform RaycastHit::GetTransform() { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetTransform(Handle); + if (Plugin::unhandledCsharpException) { - Plugin::ReferenceManagedClass(this->Handle); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - return *this; + return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); } - - AudioSettings& AudioSettings::operator=(decltype(nullptr) other) +} + +namespace System +{ + Object::Object(UnityEngine::RaycastHit& val) { - if (Handle) + int32_t handle = Plugin::BoxRaycastHit(val.Handle); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - return *this; - } - - AudioSettings& AudioSettings::operator=(AudioSettings&& other) - { - if (Handle) + if (handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::ReferenceManagedClass(handle); + Handle = handle; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool AudioSettings::operator==(const AudioSettings& other) const - { - return Handle == other.Handle; - } - - bool AudioSettings::operator!=(const AudioSettings& other) const - { - return Handle != other.Handle; } - void AudioSettings::GetDSPBufferSize(int32_t* bufferLength, int32_t* numBuffers) + Object::operator UnityEngine::RaycastHit() { - Plugin::UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(bufferLength, numBuffers); + UnityEngine::RaycastHit returnVal(Plugin::InternalUse::Only, Plugin::UnboxRaycastHit(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -2382,720 +2192,943 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } + return returnVal; } } -namespace UnityEngine +namespace System { - namespace Networking + namespace Collections { - NetworkTransport::NetworkTransport(decltype(nullptr) n) - : NetworkTransport(Plugin::InternalUse::Only, 0) - { - } - - NetworkTransport::NetworkTransport(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + namespace Generic { - if (handle) + IEnumerable::IEnumerable(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) { - Plugin::ReferenceManagedClass(handle); } - } - - NetworkTransport::NetworkTransport(const NetworkTransport& other) - : NetworkTransport(Plugin::InternalUse::Only, other.Handle) - { - } - - NetworkTransport::NetworkTransport(NetworkTransport&& other) - : NetworkTransport(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - NetworkTransport::~NetworkTransport() - { - if (Handle) + + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - } - - NetworkTransport& NetworkTransport::operator=(const NetworkTransport& other) - { - if (this->Handle) + + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(this->Handle); } - this->Handle = other.Handle; - if (this->Handle) + + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(this->Handle); + other.Handle = 0; } - return *this; - } - - NetworkTransport& NetworkTransport::operator=(decltype(nullptr) other) - { - if (Handle) + + IEnumerable::~IEnumerable() { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - return *this; - } - - NetworkTransport& NetworkTransport::operator=(NetworkTransport&& other) - { - if (Handle) + + IEnumerable& IEnumerable::operator=(const IEnumerable& other) { - Plugin::DereferenceManagedClass(Handle); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool NetworkTransport::operator==(const NetworkTransport& other) const - { - return Handle == other.Handle; - } - - bool NetworkTransport::operator!=(const NetworkTransport& other) const - { - return Handle != other.Handle; - } - - void NetworkTransport::GetBroadcastConnectionInfo(int32_t hostId, System::String* address, int32_t* port, uint8_t* error) - { - int32_t addressHandle = address->Handle; - Plugin::UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(hostId, &addressHandle, port, error); - if (Plugin::unhandledCsharpException) + + IEnumerable& IEnumerable::operator=(decltype(nullptr) other) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - if (address->Handle) + + IEnumerable& IEnumerable::operator=(IEnumerable&& other) { - Plugin::DereferenceManagedClass(address->Handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - address->Handle = addressHandle; - if (address->Handle) + + bool IEnumerable::operator==(const IEnumerable& other) const { - Plugin::ReferenceManagedClass(address->Handle); + return Handle == other.Handle; } - } - - void NetworkTransport::Init() - { - Plugin::UnityEngineNetworkingNetworkTransportMethodInit(); - if (Plugin::unhandledCsharpException) + + bool IEnumerable::operator!=(const IEnumerable& other) const { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Handle != other.Handle; } } } } -namespace UnityEngine +namespace System { - Vector3::Vector3() - { - } - - Vector3::Vector3(float x, float y, float z) - { - auto returnValue = Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(x, y, z); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - *this = returnValue; - } - - float Vector3::GetMagnitude() - { - auto returnValue = Plugin::UnityEngineVector3PropertyGetMagnitude(this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void Vector3::Set(float newX, float newY, float newZ) + namespace Collections { - Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(this, newX, newY, newZ); - if (Plugin::unhandledCsharpException) + namespace Generic { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + IEnumerable::IEnumerable(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + { + } + + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerable::~IEnumerable() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerable& IEnumerable::operator=(const IEnumerable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerable& IEnumerable::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerable& IEnumerable::operator=(IEnumerable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerable::operator==(const IEnumerable& other) const + { + return Handle == other.Handle; + } + + bool IEnumerable::operator!=(const IEnumerable& other) const + { + return Handle != other.Handle; + } } } - - UnityEngine::Vector3 Vector3::operator+(UnityEngine::Vector3& a) +} + +namespace System +{ + namespace Collections { - auto returnValue = Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(*this, a); - if (Plugin::unhandledCsharpException) + namespace Generic { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - UnityEngine::Vector3 Vector3::operator-() - { - auto returnValue = Plugin::UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + IEnumerable::IEnumerable(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + { + } + + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerable::~IEnumerable() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerable& IEnumerable::operator=(const IEnumerable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerable& IEnumerable::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerable& IEnumerable::operator=(IEnumerable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerable::operator==(const IEnumerable& other) const + { + return Handle == other.Handle; + } + + bool IEnumerable::operator!=(const IEnumerable& other) const + { + return Handle != other.Handle; + } } - return returnValue; } } namespace System { - Object::Object(UnityEngine::Vector3& val) - { - int32_t handle = Plugin::BoxVector3(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator UnityEngine::Vector3() + namespace Collections { - UnityEngine::Vector3 returnVal(Plugin::UnboxVector3(Handle)); - if (Plugin::unhandledCsharpException) + namespace Generic { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + IEnumerable::IEnumerable(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + { + } + + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerable::~IEnumerable() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerable& IEnumerable::operator=(const IEnumerable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerable& IEnumerable::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerable& IEnumerable::operator=(IEnumerable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerable::operator==(const IEnumerable& other) const + { + return Handle == other.Handle; + } + + bool IEnumerable::operator!=(const IEnumerable& other) const + { + return Handle != other.Handle; + } } - return returnVal; } } -namespace UnityEngine +namespace System { - Quaternion::Quaternion() + namespace Collections { + namespace Generic + { + IEnumerable::IEnumerable(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + { + } + + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerable::~IEnumerable() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerable& IEnumerable::operator=(const IEnumerable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerable& IEnumerable::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerable& IEnumerable::operator=(IEnumerable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerable::operator==(const IEnumerable& other) const + { + return Handle == other.Handle; + } + + bool IEnumerable::operator!=(const IEnumerable& other) const + { + return Handle != other.Handle; + } + } } } namespace System { - Object::Object(UnityEngine::Quaternion& val) + namespace Collections { - int32_t handle = Plugin::BoxQuaternion(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) + namespace Generic { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator UnityEngine::Quaternion() - { - UnityEngine::Quaternion returnVal(Plugin::UnboxQuaternion(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + IEnumerable::IEnumerable(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + { + } + + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerable::~IEnumerable() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerable& IEnumerable::operator=(const IEnumerable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerable& IEnumerable::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerable& IEnumerable::operator=(IEnumerable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerable::operator==(const IEnumerable& other) const + { + return Handle == other.Handle; + } + + bool IEnumerable::operator!=(const IEnumerable& other) const + { + return Handle != other.Handle; + } } - return returnVal; } } -namespace UnityEngine +namespace System { - Matrix4x4::Matrix4x4() - { - } - - float Matrix4x4::GetItem(int32_t row, int32_t column) - { - auto returnValue = Plugin::UnityEngineMatrix4x4PropertyGetItem(this, row, column); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void Matrix4x4::SetItem(int32_t row, int32_t column, float value) + namespace Collections { - Plugin::UnityEngineMatrix4x4PropertySetItem(this, row, column, value); - if (Plugin::unhandledCsharpException) + namespace Generic { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + ICollection::ICollection(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + } + + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + } + + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ICollection::~ICollection() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ICollection& ICollection::operator=(const ICollection& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ICollection& ICollection::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ICollection& ICollection::operator=(ICollection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ICollection::operator==(const ICollection& other) const + { + return Handle == other.Handle; + } + + bool ICollection::operator!=(const ICollection& other) const + { + return Handle != other.Handle; + } } } } namespace System { - Object::Object(UnityEngine::Matrix4x4& val) + namespace Collections { - int32_t handle = Plugin::BoxMatrix4x4(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) + namespace Generic { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + ICollection::ICollection(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + } + + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + } + + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ICollection::~ICollection() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ICollection& ICollection::operator=(const ICollection& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ICollection& ICollection::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ICollection& ICollection::operator=(ICollection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ICollection::operator==(const ICollection& other) const + { + return Handle == other.Handle; + } + + bool ICollection::operator!=(const ICollection& other) const + { + return Handle != other.Handle; + } } } - - Object::operator UnityEngine::Matrix4x4() +} + +namespace System +{ + namespace Collections { - UnityEngine::Matrix4x4 returnVal(Plugin::UnboxMatrix4x4(Handle)); - if (Plugin::unhandledCsharpException) + namespace Generic { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - RaycastHit::RaycastHit(decltype(nullptr) n) - : RaycastHit(Plugin::InternalUse::Only, 0) - { - } - - RaycastHit::RaycastHit(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); - } - } - - RaycastHit::RaycastHit(const RaycastHit& other) - : RaycastHit(Plugin::InternalUse::Only, other.Handle) - { - } - - RaycastHit::RaycastHit(RaycastHit&& other) - : RaycastHit(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - RaycastHit::~RaycastHit() - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); - Handle = 0; - } - } - - RaycastHit& RaycastHit::operator=(const RaycastHit& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); - } - return *this; - } - - RaycastHit& RaycastHit::operator=(decltype(nullptr) other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); - Handle = 0; - } - return *this; - } - - RaycastHit& RaycastHit::operator=(RaycastHit&& other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool RaycastHit::operator==(const RaycastHit& other) const - { - return Handle == other.Handle; - } - - bool RaycastHit::operator!=(const RaycastHit& other) const - { - return Handle != other.Handle; - } - - UnityEngine::Vector3 RaycastHit::GetPoint() - { - auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetPoint(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void RaycastHit::SetPoint(UnityEngine::Vector3& value) - { - Plugin::UnityEngineRaycastHitPropertySetPoint(Handle, value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - UnityEngine::Transform RaycastHit::GetTransform() - { - auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetTransform(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); - } -} - -namespace System -{ - Object::Object(UnityEngine::RaycastHit& val) - { - int32_t handle = Plugin::BoxRaycastHit(val.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator UnityEngine::RaycastHit() - { - UnityEngine::RaycastHit returnVal(Plugin::InternalUse::Only, Plugin::UnboxRaycastHit(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::Object(UnityEngine::QueryTriggerInteraction val) - { - int32_t handle = Plugin::BoxQueryTriggerInteraction(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator UnityEngine::QueryTriggerInteraction() - { - UnityEngine::QueryTriggerInteraction returnVal(Plugin::UnboxQueryTriggerInteraction(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - KeyValuePair::KeyValuePair(decltype(nullptr) n) - : KeyValuePair(Plugin::InternalUse::Only, 0) + ICollection::ICollection(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { } - KeyValuePair::KeyValuePair(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(iu, handle) + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { + Handle = handle; if (handle) { - Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + Plugin::ReferenceManagedClass(handle); } } - KeyValuePair::KeyValuePair(const KeyValuePair& other) - : KeyValuePair(Plugin::InternalUse::Only, other.Handle) + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { } - KeyValuePair::KeyValuePair(KeyValuePair&& other) - : KeyValuePair(Plugin::InternalUse::Only, other.Handle) + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - KeyValuePair::~KeyValuePair() + ICollection::~ICollection() { if (Handle) { - Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } } - KeyValuePair& KeyValuePair::operator=(const KeyValuePair& other) + ICollection& ICollection::operator=(const ICollection& other) { if (this->Handle) { - Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + Plugin::DereferenceManagedClass(this->Handle); } this->Handle = other.Handle; if (this->Handle) { - Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + Plugin::ReferenceManagedClass(this->Handle); } return *this; } - KeyValuePair& KeyValuePair::operator=(decltype(nullptr) other) + ICollection& ICollection::operator=(decltype(nullptr) other) { if (Handle) { - Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; } - KeyValuePair& KeyValuePair::operator=(KeyValuePair&& other) + ICollection& ICollection::operator=(ICollection&& other) { if (Handle) { - Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool KeyValuePair::operator==(const KeyValuePair& other) const + bool ICollection::operator==(const ICollection& other) const { return Handle == other.Handle; } - bool KeyValuePair::operator!=(const KeyValuePair& other) const + bool ICollection::operator!=(const ICollection& other) const { return Handle != other.Handle; } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + ICollection::ICollection(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + } - KeyValuePair::KeyValuePair(System::String& key, double value) - : System::ValueType(nullptr) + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { - auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(key.Handle, value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) + Handle = handle; + if (handle) { - Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + Plugin::ReferenceManagedClass(handle); } } - System::String KeyValuePair::GetKey() + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { - auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + } + + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ICollection::~ICollection() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - return System::String(Plugin::InternalUse::Only, returnValue); } - double KeyValuePair::GetValue() + ICollection& ICollection::operator=(const ICollection& other) { - auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(Handle); - if (Plugin::unhandledCsharpException) + if (this->Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(this->Handle); } - return returnValue; + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ICollection& ICollection::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ICollection& ICollection::operator=(ICollection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ICollection::operator==(const ICollection& other) const + { + return Handle == other.Handle; + } + + bool ICollection::operator!=(const ICollection& other) const + { + return Handle != other.Handle; } } } } -namespace System -{ - Object::Object(System::Collections::Generic::KeyValuePair& val) - { - int32_t handle = Plugin::BoxKeyValuePairSystemString_SystemDouble(val.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator System::Collections::Generic::KeyValuePair() - { - System::Collections::Generic::KeyValuePair returnVal(Plugin::InternalUse::Only, Plugin::UnboxKeyValuePairSystemString_SystemDouble(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - namespace System { namespace Collections { namespace Generic { - List::List(decltype(nullptr) n) - : List(Plugin::InternalUse::Only, 0) + ICollection::ICollection(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { } - List::List(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - List::List(const List& other) - : List(Plugin::InternalUse::Only, other.Handle) + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { } - List::List(List&& other) - : List(Plugin::InternalUse::Only, other.Handle) + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - List::~List() + ICollection::~ICollection() { if (Handle) { @@ -3104,7 +3137,7 @@ namespace System } } - List& List::operator=(const List& other) + ICollection& ICollection::operator=(const ICollection& other) { if (this->Handle) { @@ -3118,7 +3151,7 @@ namespace System return *this; } - List& List::operator=(decltype(nullptr) other) + ICollection& ICollection::operator=(decltype(nullptr) other) { if (Handle) { @@ -3128,7 +3161,7 @@ namespace System return *this; } - List& List::operator=(List&& other) + ICollection& ICollection::operator=(ICollection&& other) { if (Handle) { @@ -3139,82 +3172,15 @@ namespace System return *this; } - bool List::operator==(const List& other) const + bool ICollection::operator==(const ICollection& other) const { return Handle == other.Handle; } - bool List::operator!=(const List& other) const + bool ICollection::operator!=(const ICollection& other) const { return Handle != other.Handle; } - - List::List() - : System::Object(nullptr) - { - auto returnValue = Plugin::SystemCollectionsGenericListSystemStringConstructor(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - System::String List::GetItem(int32_t index) - { - auto returnValue = Plugin::SystemCollectionsGenericListSystemStringPropertyGetItem(Handle, index); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); - } - - void List::SetItem(int32_t index, System::String& value) - { - Plugin::SystemCollectionsGenericListSystemStringPropertySetItem(Handle, index, value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void List::Add(System::String& item) - { - Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString(Handle, item.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void List::Sort(System::Collections::Generic::IComparer& comparer) - { - Plugin::SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } } } @@ -3225,32 +3191,35 @@ namespace System { namespace Generic { - List::List(decltype(nullptr) n) - : List(Plugin::InternalUse::Only, 0) + ICollection::ICollection(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { } - List::List(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - List::List(const List& other) - : List(Plugin::InternalUse::Only, other.Handle) + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { } - List::List(List&& other) - : List(Plugin::InternalUse::Only, other.Handle) + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - List::~List() + ICollection::~ICollection() { if (Handle) { @@ -3259,7 +3228,7 @@ namespace System } } - List& List::operator=(const List& other) + ICollection& ICollection::operator=(const ICollection& other) { if (this->Handle) { @@ -3273,7 +3242,7 @@ namespace System return *this; } - List& List::operator=(decltype(nullptr) other) + ICollection& ICollection::operator=(decltype(nullptr) other) { if (Handle) { @@ -3283,7 +3252,7 @@ namespace System return *this; } - List& List::operator=(List&& other) + ICollection& ICollection::operator=(ICollection&& other) { if (Handle) { @@ -3294,82 +3263,15 @@ namespace System return *this; } - bool List::operator==(const List& other) const + bool ICollection::operator==(const ICollection& other) const { return Handle == other.Handle; } - bool List::operator!=(const List& other) const + bool ICollection::operator!=(const ICollection& other) const { return Handle != other.Handle; } - - List::List() - : System::Object(nullptr) - { - auto returnValue = Plugin::SystemCollectionsGenericListSystemInt32Constructor(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - int32_t List::GetItem(int32_t index) - { - auto returnValue = Plugin::SystemCollectionsGenericListSystemInt32PropertyGetItem(Handle, index); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void List::SetItem(int32_t index, int32_t value) - { - Plugin::SystemCollectionsGenericListSystemInt32PropertySetItem(Handle, index, value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void List::Add(int32_t item) - { - Plugin::SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(Handle, item); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void List::Sort(System::Collections::Generic::IComparer& comparer) - { - Plugin::SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } } } @@ -3380,32 +3282,37 @@ namespace System { namespace Generic { - LinkedListNode::LinkedListNode(decltype(nullptr) n) - : LinkedListNode(Plugin::InternalUse::Only, 0) + IList::IList(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { } - LinkedListNode::LinkedListNode(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + IList::IList(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - LinkedListNode::LinkedListNode(const LinkedListNode& other) - : LinkedListNode(Plugin::InternalUse::Only, other.Handle) + IList::IList(const IList& other) + : IList(Plugin::InternalUse::Only, other.Handle) { } - LinkedListNode::LinkedListNode(LinkedListNode&& other) - : LinkedListNode(Plugin::InternalUse::Only, other.Handle) + IList::IList(IList&& other) + : IList(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - LinkedListNode::~LinkedListNode() + IList::~IList() { if (Handle) { @@ -3414,7 +3321,7 @@ namespace System } } - LinkedListNode& LinkedListNode::operator=(const LinkedListNode& other) + IList& IList::operator=(const IList& other) { if (this->Handle) { @@ -3428,7 +3335,7 @@ namespace System return *this; } - LinkedListNode& LinkedListNode::operator=(decltype(nullptr) other) + IList& IList::operator=(decltype(nullptr) other) { if (Handle) { @@ -3438,7 +3345,7 @@ namespace System return *this; } - LinkedListNode& LinkedListNode::operator=(LinkedListNode&& other) + IList& IList::operator=(IList&& other) { if (Handle) { @@ -3449,57 +3356,107 @@ namespace System return *this; } - bool LinkedListNode::operator==(const LinkedListNode& other) const + bool IList::operator==(const IList& other) const { return Handle == other.Handle; } - bool LinkedListNode::operator!=(const LinkedListNode& other) const + bool IList::operator!=(const IList& other) const { return Handle != other.Handle; } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + IList::IList(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + { + } - LinkedListNode::LinkedListNode(System::String& value) - : System::Object(nullptr) + IList::IList(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { - auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(value.Handle); - if (Plugin::unhandledCsharpException) + Handle = handle; + if (handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(handle); } - Handle = returnValue; - if (returnValue) + } + + IList::IList(const IList& other) + : IList(Plugin::InternalUse::Only, other.Handle) + { + } + + IList::IList(IList&& other) + : IList(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IList::~IList() + { + if (Handle) { - Plugin::ReferenceManagedClass(returnValue); + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } - System::String LinkedListNode::GetValue() + IList& IList::operator=(const IList& other) { - auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(Handle); - if (Plugin::unhandledCsharpException) + if (this->Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(this->Handle); } - return System::String(Plugin::InternalUse::Only, returnValue); + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - void LinkedListNode::SetValue(System::String& value) + IList& IList::operator=(decltype(nullptr) other) { - Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(Handle, value.Handle); - if (Plugin::unhandledCsharpException) + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } + return *this; + } + + IList& IList::operator=(IList&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IList::operator==(const IList& other) const + { + return Handle == other.Handle; + } + + bool IList::operator!=(const IList& other) const + { + return Handle != other.Handle; } } } @@ -3507,36 +3464,41 @@ namespace System namespace System { - namespace Runtime + namespace Collections { - namespace CompilerServices + namespace Generic { - StrongBox::StrongBox(decltype(nullptr) n) - : StrongBox(Plugin::InternalUse::Only, 0) + IList::IList(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { } - StrongBox::StrongBox(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + IList::IList(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - StrongBox::StrongBox(const StrongBox& other) - : StrongBox(Plugin::InternalUse::Only, other.Handle) + IList::IList(const IList& other) + : IList(Plugin::InternalUse::Only, other.Handle) { } - StrongBox::StrongBox(StrongBox&& other) - : StrongBox(Plugin::InternalUse::Only, other.Handle) + IList::IList(IList&& other) + : IList(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - StrongBox::~StrongBox() + IList::~IList() { if (Handle) { @@ -3545,7 +3507,7 @@ namespace System } } - StrongBox& StrongBox::operator=(const StrongBox& other) + IList& IList::operator=(const IList& other) { if (this->Handle) { @@ -3559,7 +3521,7 @@ namespace System return *this; } - StrongBox& StrongBox::operator=(decltype(nullptr) other) + IList& IList::operator=(decltype(nullptr) other) { if (Handle) { @@ -3569,7 +3531,7 @@ namespace System return *this; } - StrongBox& StrongBox::operator=(StrongBox&& other) + IList& IList::operator=(IList&& other) { if (Handle) { @@ -3580,57 +3542,107 @@ namespace System return *this; } - bool StrongBox::operator==(const StrongBox& other) const + bool IList::operator==(const IList& other) const { return Handle == other.Handle; } - bool StrongBox::operator!=(const StrongBox& other) const + bool IList::operator!=(const IList& other) const { return Handle != other.Handle; } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + IList::IList(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + { + } - StrongBox::StrongBox(System::String& value) - : System::Object(nullptr) + IList::IList(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { - auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(value.Handle); - if (Plugin::unhandledCsharpException) + Handle = handle; + if (handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(handle); } - Handle = returnValue; - if (returnValue) + } + + IList::IList(const IList& other) + : IList(Plugin::InternalUse::Only, other.Handle) + { + } + + IList::IList(IList&& other) + : IList(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IList::~IList() + { + if (Handle) { - Plugin::ReferenceManagedClass(returnValue); + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } - System::String StrongBox::GetValue() + IList& IList::operator=(const IList& other) { - auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(Handle); - if (Plugin::unhandledCsharpException) + if (this->Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(this->Handle); } - return System::String(Plugin::InternalUse::Only, returnValue); + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - void StrongBox::SetValue(System::String& value) + IList& IList::operator=(decltype(nullptr) other) { - Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(Handle, value.Handle); - if (Plugin::unhandledCsharpException) + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IList& IList::operator=(IList&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IList::operator==(const IList& other) const + { + return Handle == other.Handle; + } + + bool IList::operator!=(const IList& other) const + { + return Handle != other.Handle; } } } @@ -3640,34 +3652,39 @@ namespace System { namespace Collections { - namespace ObjectModel + namespace Generic { - Collection::Collection(decltype(nullptr) n) - : Collection(Plugin::InternalUse::Only, 0) + IList::IList(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { } - Collection::Collection(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + IList::IList(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - Collection::Collection(const Collection& other) - : Collection(Plugin::InternalUse::Only, other.Handle) + IList::IList(const IList& other) + : IList(Plugin::InternalUse::Only, other.Handle) { } - Collection::Collection(Collection&& other) - : Collection(Plugin::InternalUse::Only, other.Handle) + IList::IList(IList&& other) + : IList(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - Collection::~Collection() + IList::~IList() { if (Handle) { @@ -3676,7 +3693,7 @@ namespace System } } - Collection& Collection::operator=(const Collection& other) + IList& IList::operator=(const IList& other) { if (this->Handle) { @@ -3690,7 +3707,7 @@ namespace System return *this; } - Collection& Collection::operator=(decltype(nullptr) other) + IList& IList::operator=(decltype(nullptr) other) { if (Handle) { @@ -3700,7 +3717,7 @@ namespace System return *this; } - Collection& Collection::operator=(Collection&& other) + IList& IList::operator=(IList&& other) { if (Handle) { @@ -3711,12 +3728,12 @@ namespace System return *this; } - bool Collection::operator==(const Collection& other) const + bool IList::operator==(const IList& other) const { return Handle == other.Handle; } - bool Collection::operator!=(const Collection& other) const + bool IList::operator!=(const IList& other) const { return Handle != other.Handle; } @@ -3728,34 +3745,39 @@ namespace System { namespace Collections { - namespace ObjectModel + namespace Generic { - KeyedCollection::KeyedCollection(decltype(nullptr) n) - : KeyedCollection(Plugin::InternalUse::Only, 0) + IList::IList(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { } - KeyedCollection::KeyedCollection(Plugin::InternalUse iu, int32_t handle) - : System::Collections::ObjectModel::Collection(iu, handle) + IList::IList(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - KeyedCollection::KeyedCollection(const KeyedCollection& other) - : KeyedCollection(Plugin::InternalUse::Only, other.Handle) + IList::IList(const IList& other) + : IList(Plugin::InternalUse::Only, other.Handle) { } - KeyedCollection::KeyedCollection(KeyedCollection&& other) - : KeyedCollection(Plugin::InternalUse::Only, other.Handle) + IList::IList(IList&& other) + : IList(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - KeyedCollection::~KeyedCollection() + IList::~IList() { if (Handle) { @@ -3764,7 +3786,7 @@ namespace System } } - KeyedCollection& KeyedCollection::operator=(const KeyedCollection& other) + IList& IList::operator=(const IList& other) { if (this->Handle) { @@ -3778,7 +3800,7 @@ namespace System return *this; } - KeyedCollection& KeyedCollection::operator=(decltype(nullptr) other) + IList& IList::operator=(decltype(nullptr) other) { if (Handle) { @@ -3788,7 +3810,7 @@ namespace System return *this; } - KeyedCollection& KeyedCollection::operator=(KeyedCollection&& other) + IList& IList::operator=(IList&& other) { if (Handle) { @@ -3799,12 +3821,12 @@ namespace System return *this; } - bool KeyedCollection::operator==(const KeyedCollection& other) const + bool IList::operator==(const IList& other) const { return Handle == other.Handle; } - bool KeyedCollection::operator!=(const KeyedCollection& other) const + bool IList::operator!=(const IList& other) const { return Handle != other.Handle; } @@ -3814,132 +3836,205 @@ namespace System namespace System { - Exception::Exception(decltype(nullptr) n) - : Exception(Plugin::InternalUse::Only, 0) - { - } - - Exception::Exception(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Exception::Exception(const Exception& other) - : Exception(Plugin::InternalUse::Only, other.Handle) - { - } - - Exception::Exception(Exception&& other) - : Exception(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Exception::~Exception() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Exception& Exception::operator=(const Exception& other) + namespace Runtime { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + namespace Serialization { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Exception& Exception::operator=(decltype(nullptr) other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Exception& Exception::operator=(Exception&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); + ISerializable::ISerializable(decltype(nullptr) n) + { + } + + ISerializable::ISerializable(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ISerializable::ISerializable(const ISerializable& other) + : ISerializable(Plugin::InternalUse::Only, other.Handle) + { + } + + ISerializable::ISerializable(ISerializable&& other) + : ISerializable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ISerializable::~ISerializable() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ISerializable& ISerializable::operator=(const ISerializable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ISerializable& ISerializable::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ISerializable& ISerializable::operator=(ISerializable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ISerializable::operator==(const ISerializable& other) const + { + return Handle == other.Handle; + } + + bool ISerializable::operator!=(const ISerializable& other) const + { + return Handle != other.Handle; + } } - Handle = other.Handle; - other.Handle = 0; - return *this; } - - bool Exception::operator==(const Exception& other) const - { - return Handle == other.Handle; - } - - bool Exception::operator!=(const Exception& other) const - { - return Handle != other.Handle; - } - - Exception::Exception(System::String& message) - : System::Object(nullptr) +} + +namespace System +{ + namespace Runtime { - auto returnValue = Plugin::SystemExceptionConstructorSystemString(message.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) + namespace InteropServices { - Plugin::ReferenceManagedClass(returnValue); + _Exception::_Exception(decltype(nullptr) n) + { + } + + _Exception::_Exception(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + _Exception::_Exception(const _Exception& other) + : _Exception(Plugin::InternalUse::Only, other.Handle) + { + } + + _Exception::_Exception(_Exception&& other) + : _Exception(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + _Exception::~_Exception() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + _Exception& _Exception::operator=(const _Exception& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + _Exception& _Exception::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + _Exception& _Exception::operator=(_Exception&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool _Exception::operator==(const _Exception& other) const + { + return Handle == other.Handle; + } + + bool _Exception::operator!=(const _Exception& other) const + { + return Handle != other.Handle; + } } } } namespace System { - SystemException::SystemException(decltype(nullptr) n) - : SystemException(Plugin::InternalUse::Only, 0) + IAppDomainSetup::IAppDomainSetup(decltype(nullptr) n) { } - SystemException::SystemException(Plugin::InternalUse iu, int32_t handle) - : System::Exception(iu, handle) + IAppDomainSetup::IAppDomainSetup(Plugin::InternalUse iu, int32_t handle) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - SystemException::SystemException(const SystemException& other) - : SystemException(Plugin::InternalUse::Only, other.Handle) + IAppDomainSetup::IAppDomainSetup(const IAppDomainSetup& other) + : IAppDomainSetup(Plugin::InternalUse::Only, other.Handle) { } - SystemException::SystemException(SystemException&& other) - : SystemException(Plugin::InternalUse::Only, other.Handle) + IAppDomainSetup::IAppDomainSetup(IAppDomainSetup&& other) + : IAppDomainSetup(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - SystemException::~SystemException() + IAppDomainSetup::~IAppDomainSetup() { if (Handle) { @@ -3948,7 +4043,7 @@ namespace System } } - SystemException& SystemException::operator=(const SystemException& other) + IAppDomainSetup& IAppDomainSetup::operator=(const IAppDomainSetup& other) { if (this->Handle) { @@ -3962,7 +4057,7 @@ namespace System return *this; } - SystemException& SystemException::operator=(decltype(nullptr) other) + IAppDomainSetup& IAppDomainSetup::operator=(decltype(nullptr) other) { if (Handle) { @@ -3972,7 +4067,7 @@ namespace System return *this; } - SystemException& SystemException::operator=(SystemException&& other) + IAppDomainSetup& IAppDomainSetup::operator=(IAppDomainSetup&& other) { if (Handle) { @@ -3983,12 +4078,12 @@ namespace System return *this; } - bool SystemException::operator==(const SystemException& other) const + bool IAppDomainSetup::operator==(const IAppDomainSetup& other) const { return Handle == other.Handle; } - bool SystemException::operator!=(const SystemException& other) const + bool IAppDomainSetup::operator!=(const IAppDomainSetup& other) const { return Handle != other.Handle; } @@ -3996,476 +4091,437 @@ namespace System namespace System { - NullReferenceException::NullReferenceException(decltype(nullptr) n) - : NullReferenceException(Plugin::InternalUse::Only, 0) - { - } - - NullReferenceException::NullReferenceException(Plugin::InternalUse iu, int32_t handle) - : System::SystemException(iu, handle) + namespace Collections { - if (handle) + IComparer::IComparer(decltype(nullptr) n) { - Plugin::ReferenceManagedClass(handle); } - } - - NullReferenceException::NullReferenceException(const NullReferenceException& other) - : NullReferenceException(Plugin::InternalUse::Only, other.Handle) - { - } - - NullReferenceException::NullReferenceException(NullReferenceException&& other) - : NullReferenceException(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - NullReferenceException::~NullReferenceException() - { - if (Handle) + + IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - } - - NullReferenceException& NullReferenceException::operator=(const NullReferenceException& other) - { - if (this->Handle) + + IComparer::IComparer(const IComparer& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(this->Handle); } - this->Handle = other.Handle; - if (this->Handle) + + IComparer::IComparer(IComparer&& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(this->Handle); + other.Handle = 0; } - return *this; - } - - NullReferenceException& NullReferenceException::operator=(decltype(nullptr) other) - { - if (Handle) + + IComparer::~IComparer() { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - return *this; - } - - NullReferenceException& NullReferenceException::operator=(NullReferenceException&& other) - { - if (Handle) + + IComparer& IComparer::operator=(const IComparer& other) { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool NullReferenceException::operator==(const NullReferenceException& other) const - { - return Handle == other.Handle; - } - - bool NullReferenceException::operator!=(const NullReferenceException& other) const - { - return Handle != other.Handle; - } -} - -namespace UnityEngine -{ - Resolution::Resolution(decltype(nullptr) n) - : Resolution(Plugin::InternalUse::Only, 0) - { - } - - Resolution::Resolution(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedUnityEngineResolution(Handle); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - } - - Resolution::Resolution(const Resolution& other) - : Resolution(Plugin::InternalUse::Only, other.Handle) - { - } - - Resolution::Resolution(Resolution&& other) - : Resolution(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Resolution::~Resolution() - { - if (Handle) + + IComparer& IComparer::operator=(decltype(nullptr) other) { - Plugin::DereferenceManagedUnityEngineResolution(Handle); - Handle = 0; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - } - - Resolution& Resolution::operator=(const Resolution& other) - { - if (this->Handle) + + IComparer& IComparer::operator=(IComparer&& other) { - Plugin::DereferenceManagedUnityEngineResolution(Handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - this->Handle = other.Handle; - if (this->Handle) + + bool IComparer::operator==(const IComparer& other) const { - Plugin::ReferenceManagedUnityEngineResolution(Handle); + return Handle == other.Handle; } - return *this; - } - - Resolution& Resolution::operator=(decltype(nullptr) other) - { - if (Handle) + + bool IComparer::operator!=(const IComparer& other) const { - Plugin::DereferenceManagedUnityEngineResolution(Handle); - Handle = 0; + return Handle != other.Handle; } - return *this; } - - Resolution& Resolution::operator=(Resolution&& other) +} + +namespace System +{ + namespace Collections { - if (Handle) + IEqualityComparer::IEqualityComparer(decltype(nullptr) n) { - Plugin::DereferenceManagedUnityEngineResolution(Handle); } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Resolution::operator==(const Resolution& other) const - { - return Handle == other.Handle; - } - - bool Resolution::operator!=(const Resolution& other) const - { - return Handle != other.Handle; - } - - int32_t Resolution::GetWidth() - { - auto returnValue = Plugin::UnityEngineResolutionPropertyGetWidth(Handle); - if (Plugin::unhandledCsharpException) + + IEqualityComparer::IEqualityComparer(Plugin::InternalUse iu, int32_t handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - return returnValue; - } - - void Resolution::SetWidth(int32_t value) - { - Plugin::UnityEngineResolutionPropertySetWidth(Handle, value); - if (Plugin::unhandledCsharpException) + + IEqualityComparer::IEqualityComparer(const IEqualityComparer& other) + : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } - } - - int32_t Resolution::GetHeight() - { - auto returnValue = Plugin::UnityEngineResolutionPropertyGetHeight(Handle); - if (Plugin::unhandledCsharpException) + + IEqualityComparer::IEqualityComparer(IEqualityComparer&& other) + : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + other.Handle = 0; } - return returnValue; - } - - void Resolution::SetHeight(int32_t value) - { - Plugin::UnityEngineResolutionPropertySetHeight(Handle, value); - if (Plugin::unhandledCsharpException) + + IEqualityComparer::~IEqualityComparer() { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - } - - int32_t Resolution::GetRefreshRate() - { - auto returnValue = Plugin::UnityEngineResolutionPropertyGetRefreshRate(Handle); - if (Plugin::unhandledCsharpException) + + IEqualityComparer& IEqualityComparer::operator=(const IEqualityComparer& other) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - return returnValue; - } - - void Resolution::SetRefreshRate(int32_t value) - { - Plugin::UnityEngineResolutionPropertySetRefreshRate(Handle, value); - if (Plugin::unhandledCsharpException) + + IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr) other) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - } -} - -namespace System -{ - Object::Object(UnityEngine::Resolution& val) - { - int32_t handle = Plugin::BoxResolution(val.Handle); - if (Plugin::unhandledCsharpException) + + IEqualityComparer& IEqualityComparer::operator=(IEqualityComparer&& other) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - if (handle) + + bool IEqualityComparer::operator==(const IEqualityComparer& other) const { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + return Handle == other.Handle; } - } - - Object::operator UnityEngine::Resolution() - { - UnityEngine::Resolution returnVal(Plugin::InternalUse::Only, Plugin::UnboxResolution(Handle)); - if (Plugin::unhandledCsharpException) + + bool IEqualityComparer::operator!=(const IEqualityComparer& other) const { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Handle != other.Handle; } - return returnVal; } } -namespace UnityEngine +namespace System { - Screen::Screen(decltype(nullptr) n) - : Screen(Plugin::InternalUse::Only, 0) - { - } - - Screen::Screen(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + namespace Collections { - if (handle) + namespace Generic { - Plugin::ReferenceManagedClass(handle); + IEqualityComparer::IEqualityComparer(decltype(nullptr) n) + { + } + + IEqualityComparer::IEqualityComparer(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEqualityComparer::IEqualityComparer(const IEqualityComparer& other) + : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) + { + } + + IEqualityComparer::IEqualityComparer(IEqualityComparer&& other) + : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEqualityComparer::~IEqualityComparer() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEqualityComparer& IEqualityComparer::operator=(const IEqualityComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEqualityComparer& IEqualityComparer::operator=(IEqualityComparer&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEqualityComparer::operator==(const IEqualityComparer& other) const + { + return Handle == other.Handle; + } + + bool IEqualityComparer::operator!=(const IEqualityComparer& other) const + { + return Handle != other.Handle; + } } } - - Screen::Screen(const Screen& other) - : Screen(Plugin::InternalUse::Only, other.Handle) - { - } - - Screen::Screen(Screen&& other) - : Screen(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Screen::~Screen() +} + +namespace System +{ + namespace Collections { - if (Handle) + namespace Generic { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + IEqualityComparer::IEqualityComparer(decltype(nullptr) n) + { + } + + IEqualityComparer::IEqualityComparer(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEqualityComparer::IEqualityComparer(const IEqualityComparer& other) + : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) + { + } + + IEqualityComparer::IEqualityComparer(IEqualityComparer&& other) + : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEqualityComparer::~IEqualityComparer() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEqualityComparer& IEqualityComparer::operator=(const IEqualityComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEqualityComparer& IEqualityComparer::operator=(IEqualityComparer&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEqualityComparer::operator==(const IEqualityComparer& other) const + { + return Handle == other.Handle; + } + + bool IEqualityComparer::operator!=(const IEqualityComparer& other) const + { + return Handle != other.Handle; + } } } - - Screen& Screen::operator=(const Screen& other) +} + +namespace UnityEngine +{ + namespace Playables { - if (this->Handle) + PlayableGraph::PlayableGraph(decltype(nullptr) n) + : System::ValueType(nullptr) { - Plugin::DereferenceManagedClass(this->Handle); } - this->Handle = other.Handle; - if (this->Handle) + + PlayableGraph::PlayableGraph(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(nullptr) { - Plugin::ReferenceManagedClass(this->Handle); + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + } } - return *this; - } - - Screen& Screen::operator=(decltype(nullptr) other) - { - if (Handle) + + PlayableGraph::PlayableGraph(const PlayableGraph& other) + : PlayableGraph(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; } - return *this; - } - - Screen& Screen::operator=(Screen&& other) - { - if (Handle) + + PlayableGraph::PlayableGraph(PlayableGraph&& other) + : PlayableGraph(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(Handle); + other.Handle = 0; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Screen::operator==(const Screen& other) const - { - return Handle == other.Handle; - } - - bool Screen::operator!=(const Screen& other) const - { - return Handle != other.Handle; - } - - System::Array1 Screen::GetResolutions() - { - auto returnValue = Plugin::UnityEngineScreenPropertyGetResolutions(); - if (Plugin::unhandledCsharpException) + + PlayableGraph::~PlayableGraph() { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + if (Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + Handle = 0; + } } - return System::Array1(Plugin::InternalUse::Only, returnValue); - } -} - -namespace UnityEngine -{ - Ray::Ray(decltype(nullptr) n) - : Ray(Plugin::InternalUse::Only, 0) - { - } - - Ray::Ray(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(iu, handle) - { - if (handle) + + PlayableGraph& PlayableGraph::operator=(const PlayableGraph& other) { - Plugin::ReferenceManagedUnityEngineRay(Handle); + if (this->Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + } + return *this; } - } - - Ray::Ray(const Ray& other) - : Ray(Plugin::InternalUse::Only, other.Handle) - { - } - - Ray::Ray(Ray&& other) - : Ray(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Ray::~Ray() - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineRay(Handle); - Handle = 0; - } - } - - Ray& Ray::operator=(const Ray& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEngineRay(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEngineRay(Handle); - } - return *this; - } - - Ray& Ray::operator=(decltype(nullptr) other) - { - if (Handle) + + PlayableGraph& PlayableGraph::operator=(decltype(nullptr) other) { - Plugin::DereferenceManagedUnityEngineRay(Handle); - Handle = 0; + if (Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + Handle = 0; + } + return *this; } - return *this; - } - - Ray& Ray::operator=(Ray&& other) - { - if (Handle) + + PlayableGraph& PlayableGraph::operator=(PlayableGraph&& other) { - Plugin::DereferenceManagedUnityEngineRay(Handle); + if (Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Ray::operator==(const Ray& other) const - { - return Handle == other.Handle; - } - - bool Ray::operator!=(const Ray& other) const - { - return Handle != other.Handle; - } - - Ray::Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction) - : System::ValueType(nullptr) - { - auto returnValue = Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(origin, direction); - if (Plugin::unhandledCsharpException) + + bool PlayableGraph::operator==(const PlayableGraph& other) const { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Handle == other.Handle; } - Handle = returnValue; - if (returnValue) + + bool PlayableGraph::operator!=(const PlayableGraph& other) const { - Plugin::ReferenceManagedUnityEngineRay(Handle); + return Handle != other.Handle; } } } namespace System { - Object::Object(UnityEngine::Ray& val) + Object::Object(UnityEngine::Playables::PlayableGraph& val) { - int32_t handle = Plugin::BoxRay(val.Handle); + int32_t handle = Plugin::BoxPlayableGraph(val.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4480,9 +4536,9 @@ namespace System } } - Object::operator UnityEngine::Ray() + Object::operator UnityEngine::Playables::PlayableGraph() { - UnityEngine::Ray returnVal(Plugin::InternalUse::Only, Plugin::UnboxRay(Handle)); + UnityEngine::Playables::PlayableGraph returnVal(Plugin::InternalUse::Only, Plugin::UnboxPlayableGraph(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4496,32 +4552,115 @@ namespace System namespace UnityEngine { - Physics::Physics(decltype(nullptr) n) - : Physics(Plugin::InternalUse::Only, 0) + namespace Playables + { + IPlayable::IPlayable(decltype(nullptr) n) + { + } + + IPlayable::IPlayable(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IPlayable::IPlayable(const IPlayable& other) + : IPlayable(Plugin::InternalUse::Only, other.Handle) + { + } + + IPlayable::IPlayable(IPlayable&& other) + : IPlayable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IPlayable::~IPlayable() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IPlayable& IPlayable::operator=(const IPlayable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IPlayable& IPlayable::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IPlayable& IPlayable::operator=(IPlayable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IPlayable::operator==(const IPlayable& other) const + { + return Handle == other.Handle; + } + + bool IPlayable::operator!=(const IPlayable& other) const + { + return Handle != other.Handle; + } + } +} + +namespace System +{ + IEquatable::IEquatable(decltype(nullptr) n) { } - Physics::Physics(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + IEquatable::IEquatable(Plugin::InternalUse iu, int32_t handle) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - Physics::Physics(const Physics& other) - : Physics(Plugin::InternalUse::Only, other.Handle) + IEquatable::IEquatable(const IEquatable& other) + : IEquatable(Plugin::InternalUse::Only, other.Handle) { } - Physics::Physics(Physics&& other) - : Physics(Plugin::InternalUse::Only, other.Handle) + IEquatable::IEquatable(IEquatable&& other) + : IEquatable(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - Physics::~Physics() + IEquatable::~IEquatable() { if (Handle) { @@ -4530,7 +4669,7 @@ namespace UnityEngine } } - Physics& Physics::operator=(const Physics& other) + IEquatable& IEquatable::operator=(const IEquatable& other) { if (this->Handle) { @@ -4544,7 +4683,7 @@ namespace UnityEngine return *this; } - Physics& Physics::operator=(decltype(nullptr) other) + IEquatable& IEquatable::operator=(decltype(nullptr) other) { if (Handle) { @@ -4554,7 +4693,7 @@ namespace UnityEngine return *this; } - Physics& Physics::operator=(Physics&& other) + IEquatable& IEquatable::operator=(IEquatable&& other) { if (Handle) { @@ -4565,208 +4704,125 @@ namespace UnityEngine return *this; } - bool Physics::operator==(const Physics& other) const + bool IEquatable::operator==(const IEquatable& other) const { return Handle == other.Handle; } - bool Physics::operator!=(const Physics& other) const + bool IEquatable::operator!=(const IEquatable& other) const { return Handle != other.Handle; } - - int32_t Physics::RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1& results) - { - auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1(ray.Handle, results.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - System::Array1 Physics::RaycastAll(UnityEngine::Ray& ray) - { - auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ray.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Array1(Plugin::InternalUse::Only, returnValue); - } } namespace UnityEngine { - Color::Color() - { - } -} - -namespace System -{ - Object::Object(UnityEngine::Color& val) + namespace Animations { - int32_t handle = Plugin::BoxColor(val); - if (Plugin::unhandledCsharpException) + AnimationMixerPlayable::AnimationMixerPlayable(decltype(nullptr) n) + : System::ValueType(nullptr) + , System::IEquatable(nullptr) + , UnityEngine::Playables::IPlayable(nullptr) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } - if (handle) + + AnimationMixerPlayable::AnimationMixerPlayable(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(nullptr) + , System::IEquatable(nullptr) + , UnityEngine::Playables::IPlayable(nullptr) { - Plugin::ReferenceManagedClass(handle); Handle = handle; + if (handle) + { + Plugin::ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + } } - } - - Object::operator UnityEngine::Color() - { - UnityEngine::Color returnVal(Plugin::UnboxColor(Handle)); - if (Plugin::unhandledCsharpException) + + AnimationMixerPlayable::AnimationMixerPlayable(const AnimationMixerPlayable& other) + : AnimationMixerPlayable(Plugin::InternalUse::Only, other.Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } - return returnVal; - } -} - -namespace UnityEngine -{ - GradientColorKey::GradientColorKey() - { - } -} - -namespace System -{ - Object::Object(UnityEngine::GradientColorKey& val) - { - int32_t handle = Plugin::BoxGradientColorKey(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) + + AnimationMixerPlayable::AnimationMixerPlayable(AnimationMixerPlayable&& other) + : AnimationMixerPlayable(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + other.Handle = 0; } - } - - Object::operator UnityEngine::GradientColorKey() - { - UnityEngine::GradientColorKey returnVal(Plugin::UnboxGradientColorKey(Handle)); - if (Plugin::unhandledCsharpException) + + AnimationMixerPlayable::~AnimationMixerPlayable() { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + if (Handle) + { + Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + Handle = 0; + } } - return returnVal; - } -} - -namespace UnityEngine -{ - Gradient::Gradient(decltype(nullptr) n) - : Gradient(Plugin::InternalUse::Only, 0) - { - } - - Gradient::Gradient(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - if (handle) + + AnimationMixerPlayable& AnimationMixerPlayable::operator=(const AnimationMixerPlayable& other) { - Plugin::ReferenceManagedClass(handle); + if (this->Handle) + { + Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + } + return *this; } - } - - Gradient::Gradient(const Gradient& other) - : Gradient(Plugin::InternalUse::Only, other.Handle) - { - } - - Gradient::Gradient(Gradient&& other) - : Gradient(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Gradient::~Gradient() - { - if (Handle) + + AnimationMixerPlayable& AnimationMixerPlayable::operator=(decltype(nullptr) other) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + if (Handle) + { + Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + Handle = 0; + } + return *this; } - } - - Gradient& Gradient::operator=(const Gradient& other) - { - if (this->Handle) + + AnimationMixerPlayable& AnimationMixerPlayable::operator=(AnimationMixerPlayable&& other) { - Plugin::DereferenceManagedClass(this->Handle); + if (Handle) + { + Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - this->Handle = other.Handle; - if (this->Handle) + + bool AnimationMixerPlayable::operator==(const AnimationMixerPlayable& other) const { - Plugin::ReferenceManagedClass(this->Handle); + return Handle == other.Handle; } - return *this; - } - - Gradient& Gradient::operator=(decltype(nullptr) other) - { - if (Handle) + + bool AnimationMixerPlayable::operator!=(const AnimationMixerPlayable& other) const { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + return Handle != other.Handle; } - return *this; - } - - Gradient& Gradient::operator=(Gradient&& other) - { - if (Handle) + + UnityEngine::Animations::AnimationMixerPlayable AnimationMixerPlayable::Create(UnityEngine::Playables::PlayableGraph& graph, int32_t inputCount, System::Boolean normalizeWeights) { - Plugin::DereferenceManagedClass(Handle); + auto returnValue = Plugin::UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean(graph.Handle, inputCount, normalizeWeights); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Animations::AnimationMixerPlayable(Plugin::InternalUse::Only, returnValue); } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Gradient::operator==(const Gradient& other) const - { - return Handle == other.Handle; - } - - bool Gradient::operator!=(const Gradient& other) const - { - return Handle != other.Handle; } - - Gradient::Gradient() - : System::Object(nullptr) +} + +namespace System +{ + Object::Object(UnityEngine::Animations::AnimationMixerPlayable& val) { - auto returnValue = Plugin::UnityEngineGradientConstructor(); + int32_t handle = Plugin::BoxAnimationMixerPlayable(val.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4774,16 +4830,16 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - Handle = returnValue; - if (returnValue) + if (handle) { - Plugin::ReferenceManagedClass(returnValue); + Plugin::ReferenceManagedClass(handle); + Handle = handle; } } - System::Array1 Gradient::GetColorKeys() + Object::operator UnityEngine::Animations::AnimationMixerPlayable() { - auto returnValue = Plugin::UnityEngineGradientPropertyGetColorKeys(Handle); + UnityEngine::Animations::AnimationMixerPlayable returnVal(Plugin::InternalUse::Only, Plugin::UnboxAnimationMixerPlayable(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -4791,175 +4847,438 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return System::Array1(Plugin::InternalUse::Only, returnValue); + return returnVal; } - - void Gradient::SetColorKeys(System::Array1& value) +} + +namespace System +{ + namespace Runtime { - Plugin::UnityEngineGradientPropertySetColorKeys(Handle, value.Handle); - if (Plugin::unhandledCsharpException) + namespace CompilerServices { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + IStrongBox::IStrongBox(decltype(nullptr) n) + { + } + + IStrongBox::IStrongBox(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IStrongBox::IStrongBox(const IStrongBox& other) + : IStrongBox(Plugin::InternalUse::Only, other.Handle) + { + } + + IStrongBox::IStrongBox(IStrongBox&& other) + : IStrongBox(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IStrongBox::~IStrongBox() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IStrongBox& IStrongBox::operator=(const IStrongBox& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IStrongBox& IStrongBox::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IStrongBox& IStrongBox::operator=(IStrongBox&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IStrongBox::operator==(const IStrongBox& other) const + { + return Handle == other.Handle; + } + + bool IStrongBox::operator!=(const IStrongBox& other) const + { + return Handle != other.Handle; + } } } } -namespace System +namespace UnityEngine { - AppDomainSetup::AppDomainSetup(decltype(nullptr) n) - : AppDomainSetup(Plugin::InternalUse::Only, 0) + namespace Experimental { - } - - AppDomainSetup::AppDomainSetup(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - if (handle) + namespace UIElements { - Plugin::ReferenceManagedClass(handle); + IEventHandler::IEventHandler(decltype(nullptr) n) + { + } + + IEventHandler::IEventHandler(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEventHandler::IEventHandler(const IEventHandler& other) + : IEventHandler(Plugin::InternalUse::Only, other.Handle) + { + } + + IEventHandler::IEventHandler(IEventHandler&& other) + : IEventHandler(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEventHandler::~IEventHandler() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEventHandler& IEventHandler::operator=(const IEventHandler& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEventHandler& IEventHandler::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEventHandler& IEventHandler::operator=(IEventHandler&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEventHandler::operator==(const IEventHandler& other) const + { + return Handle == other.Handle; + } + + bool IEventHandler::operator!=(const IEventHandler& other) const + { + return Handle != other.Handle; + } } } - - AppDomainSetup::AppDomainSetup(const AppDomainSetup& other) - : AppDomainSetup(Plugin::InternalUse::Only, other.Handle) - { - } - - AppDomainSetup::AppDomainSetup(AppDomainSetup&& other) - : AppDomainSetup(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - AppDomainSetup::~AppDomainSetup() +} + +namespace UnityEngine +{ + namespace Experimental { - if (Handle) + namespace UIElements { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + IStyle::IStyle(decltype(nullptr) n) + { + } + + IStyle::IStyle(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IStyle::IStyle(const IStyle& other) + : IStyle(Plugin::InternalUse::Only, other.Handle) + { + } + + IStyle::IStyle(IStyle&& other) + : IStyle(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IStyle::~IStyle() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IStyle& IStyle::operator=(const IStyle& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IStyle& IStyle::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IStyle& IStyle::operator=(IStyle&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IStyle::operator==(const IStyle& other) const + { + return Handle == other.Handle; + } + + bool IStyle::operator!=(const IStyle& other) const + { + return Handle != other.Handle; + } } } - - AppDomainSetup& AppDomainSetup::operator=(const AppDomainSetup& other) +} + +namespace System +{ + namespace Diagnostics { - if (this->Handle) + Stopwatch::Stopwatch(decltype(nullptr) n) { - Plugin::DereferenceManagedClass(this->Handle); } - this->Handle = other.Handle; - if (this->Handle) + + Stopwatch::Stopwatch(Plugin::InternalUse iu, int32_t handle) { - Plugin::ReferenceManagedClass(this->Handle); + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - return *this; - } - - AppDomainSetup& AppDomainSetup::operator=(decltype(nullptr) other) - { - if (Handle) + + Stopwatch::Stopwatch(const Stopwatch& other) + : Stopwatch(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; } - return *this; - } - - AppDomainSetup& AppDomainSetup::operator=(AppDomainSetup&& other) - { - if (Handle) + + Stopwatch::Stopwatch(Stopwatch&& other) + : Stopwatch(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(Handle); + other.Handle = 0; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool AppDomainSetup::operator==(const AppDomainSetup& other) const - { - return Handle == other.Handle; - } - - bool AppDomainSetup::operator!=(const AppDomainSetup& other) const - { - return Handle != other.Handle; - } - - AppDomainSetup::AppDomainSetup() - : System::Object(nullptr) - { - auto returnValue = Plugin::SystemAppDomainSetupConstructor(); - if (Plugin::unhandledCsharpException) + + Stopwatch::~Stopwatch() { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - Handle = returnValue; - if (returnValue) + + Stopwatch& Stopwatch::operator=(const Stopwatch& other) { - Plugin::ReferenceManagedClass(returnValue); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - } - - System::AppDomainInitializer AppDomainSetup::GetAppDomainInitializer() - { - auto returnValue = Plugin::SystemAppDomainSetupPropertyGetAppDomainInitializer(Handle); - if (Plugin::unhandledCsharpException) + + Stopwatch& Stopwatch::operator=(decltype(nullptr) other) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::AppDomainInitializer(Plugin::InternalUse::Only, returnValue); - } + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Stopwatch& Stopwatch::operator=(Stopwatch&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Stopwatch::operator==(const Stopwatch& other) const + { + return Handle == other.Handle; + } + + bool Stopwatch::operator!=(const Stopwatch& other) const + { + return Handle != other.Handle; + } + + Stopwatch::Stopwatch() + { + auto returnValue = Plugin::SystemDiagnosticsStopwatchConstructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + int64_t Stopwatch::GetElapsedMilliseconds() + { + auto returnValue = Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + void Stopwatch::Start() + { + Plugin::SystemDiagnosticsStopwatchMethodStart(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } - void AppDomainSetup::SetAppDomainInitializer(System::AppDomainInitializer& value) - { - Plugin::SystemAppDomainSetupPropertySetAppDomainInitializer(Handle, value.Handle); - if (Plugin::unhandledCsharpException) + void Stopwatch::Reset() { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::SystemDiagnosticsStopwatchMethodReset(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } } namespace UnityEngine { - Application::Application(decltype(nullptr) n) - : Application(Plugin::InternalUse::Only, 0) + GameObject::GameObject(decltype(nullptr) n) + : UnityEngine::Object(nullptr) { } - Application::Application(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + GameObject::GameObject(Plugin::InternalUse iu, int32_t handle) + : UnityEngine::Object(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - Application::Application(const Application& other) - : Application(Plugin::InternalUse::Only, other.Handle) + GameObject::GameObject(const GameObject& other) + : GameObject(Plugin::InternalUse::Only, other.Handle) { } - Application::Application(Application&& other) - : Application(Plugin::InternalUse::Only, other.Handle) + GameObject::GameObject(GameObject&& other) + : GameObject(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - Application::~Application() + GameObject::~GameObject() { if (Handle) { @@ -4968,7 +5287,7 @@ namespace UnityEngine } } - Application& Application::operator=(const Application& other) + GameObject& GameObject::operator=(const GameObject& other) { if (this->Handle) { @@ -4982,7 +5301,7 @@ namespace UnityEngine return *this; } - Application& Application::operator=(decltype(nullptr) other) + GameObject& GameObject::operator=(decltype(nullptr) other) { if (Handle) { @@ -4992,7 +5311,7 @@ namespace UnityEngine return *this; } - Application& Application::operator=(Application&& other) + GameObject& GameObject::operator=(GameObject&& other) { if (Handle) { @@ -5003,19 +5322,20 @@ namespace UnityEngine return *this; } - bool Application::operator==(const Application& other) const + bool GameObject::operator==(const GameObject& other) const { return Handle == other.Handle; } - bool Application::operator!=(const Application& other) const + bool GameObject::operator!=(const GameObject& other) const { return Handle != other.Handle; } - void Application::AddOnBeforeRender(UnityEngine::Events::UnityAction& del) + GameObject::GameObject() + : UnityEngine::Object(nullptr) { - Plugin::UnityEngineApplicationAddEventOnBeforeRender(del.Handle); + auto returnValue = Plugin::UnityEngineGameObjectConstructor(); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5023,11 +5343,73 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } } - void Application::RemoveOnBeforeRender(UnityEngine::Events::UnityAction& del) + GameObject::GameObject(System::String& name) + : UnityEngine::Object(nullptr) { - Plugin::UnityEngineApplicationRemoveEventOnBeforeRender(del.Handle); + auto returnValue = Plugin::UnityEngineGameObjectConstructorSystemString(name.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + UnityEngine::Transform GameObject::GetTransform() + { + auto returnValue = Plugin::UnityEngineGameObjectPropertyGetTransform(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); + } + + template<> MyGame::MonoBehaviours::TestScript GameObject::AddComponent() + { + auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return MyGame::MonoBehaviours::TestScript(Plugin::InternalUse::Only, returnValue); + } + + template<> MyGame::MonoBehaviours::AnotherScript GameObject::AddComponent() + { + auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return MyGame::MonoBehaviours::AnotherScript(Plugin::InternalUse::Only, returnValue); + } + + UnityEngine::GameObject GameObject::CreatePrimitive(UnityEngine::PrimitiveType type) + { + auto returnValue = Plugin::UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(type); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5035,95 +5417,135 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } + return UnityEngine::GameObject(Plugin::InternalUse::Only, returnValue); } } namespace UnityEngine { - namespace SceneManagement + Debug::Debug(decltype(nullptr) n) { - SceneManager::SceneManager(decltype(nullptr) n) - : SceneManager(Plugin::InternalUse::Only, 0) + } + + Debug::Debug(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) { + Plugin::ReferenceManagedClass(handle); } - - SceneManager::SceneManager(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + } + + Debug::Debug(const Debug& other) + : Debug(Plugin::InternalUse::Only, other.Handle) + { + } + + Debug::Debug(Debug&& other) + : Debug(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Debug::~Debug() + { + if (Handle) { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - SceneManager::SceneManager(const SceneManager& other) - : SceneManager(Plugin::InternalUse::Only, other.Handle) + } + + Debug& Debug::operator=(const Debug& other) + { + if (this->Handle) { + Plugin::DereferenceManagedClass(this->Handle); } - - SceneManager::SceneManager(SceneManager&& other) - : SceneManager(Plugin::InternalUse::Only, other.Handle) + this->Handle = other.Handle; + if (this->Handle) { - other.Handle = 0; + Plugin::ReferenceManagedClass(this->Handle); } - - SceneManager::~SceneManager() + return *this; + } + + Debug& Debug::operator=(decltype(nullptr) other) + { + if (Handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - SceneManager& SceneManager::operator=(const SceneManager& other) + return *this; + } + + Debug& Debug::operator=(Debug&& other) + { + if (Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; + Plugin::DereferenceManagedClass(Handle); } - - SceneManager& SceneManager::operator=(decltype(nullptr) other) + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Debug::operator==(const Debug& other) const + { + return Handle == other.Handle; + } + + bool Debug::operator!=(const Debug& other) const + { + return Handle != other.Handle; + } + + void Debug::Log(System::Object& message) + { + Plugin::UnityEngineDebugMethodLogSystemObject(message.Handle); + if (Plugin::unhandledCsharpException) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - SceneManager& SceneManager::operator=(SceneManager&& other) + } +} + +namespace UnityEngine +{ + namespace Assertions + { + System::Boolean Assert::GetRaiseExceptions() { - if (Handle) + auto returnValue = Plugin::UnityEngineAssertionsAssertFieldGetRaiseExceptions(); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool SceneManager::operator==(const SceneManager& other) const - { - return Handle == other.Handle; + return returnValue; } - bool SceneManager::operator!=(const SceneManager& other) const + void Assert::SetRaiseExceptions(System::Boolean value) { - return Handle != other.Handle; + Plugin::UnityEngineAssertionsAssertFieldSetRaiseExceptions(value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - void SceneManager::AddSceneLoaded(UnityEngine::Events::UnityAction2& del) + template<> void Assert::AreEqual(System::String& expected, System::String& actual) { - Plugin::UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(del.Handle); + Plugin::UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(expected.Handle, actual.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5133,9 +5555,9 @@ namespace UnityEngine } } - void SceneManager::RemoveSceneLoaded(UnityEngine::Events::UnityAction2& del) + template<> void Assert::AreEqual(UnityEngine::GameObject& expected, UnityEngine::GameObject& actual) { - Plugin::UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(del.Handle); + Plugin::UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(expected.Handle, actual.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -5149,294 +5571,203 @@ namespace UnityEngine namespace UnityEngine { - namespace SceneManagement + Collision::Collision(decltype(nullptr) n) { - Scene::Scene(decltype(nullptr) n) - : Scene(Plugin::InternalUse::Only, 0) - { - } - - Scene::Scene(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedUnityEngineSceneManagementScene(Handle); - } - } - - Scene::Scene(const Scene& other) - : Scene(Plugin::InternalUse::Only, other.Handle) - { - } - - Scene::Scene(Scene&& other) - : Scene(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Scene::~Scene() - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); - Handle = 0; - } - } - - Scene& Scene::operator=(const Scene& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEngineSceneManagementScene(Handle); - } - return *this; - } - - Scene& Scene::operator=(decltype(nullptr) other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); - Handle = 0; - } - return *this; - } - - Scene& Scene::operator=(Scene&& other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Scene::operator==(const Scene& other) const - { - return Handle == other.Handle; - } - - bool Scene::operator!=(const Scene& other) const - { - return Handle != other.Handle; - } } -} - -namespace System -{ - Object::Object(UnityEngine::SceneManagement::Scene& val) + + Collision::Collision(Plugin::InternalUse iu, int32_t handle) { - int32_t handle = Plugin::BoxScene(val.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); - Handle = handle; } } - Object::operator UnityEngine::SceneManagement::Scene() + Collision::Collision(const Collision& other) + : Collision(Plugin::InternalUse::Only, other.Handle) { - UnityEngine::SceneManagement::Scene returnVal(Plugin::InternalUse::Only, Plugin::UnboxScene(Handle)); - if (Plugin::unhandledCsharpException) + } + + Collision::Collision(Collision&& other) + : Collision(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Collision::~Collision() + { + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - return returnVal; } -} - -namespace System -{ - Object::Object(UnityEngine::SceneManagement::LoadSceneMode val) + + Collision& Collision::operator=(const Collision& other) { - int32_t handle = Plugin::BoxLoadSceneMode(val); - if (Plugin::unhandledCsharpException) + if (this->Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(this->Handle); } - if (handle) + this->Handle = other.Handle; + if (this->Handle) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } - Object::operator UnityEngine::SceneManagement::LoadSceneMode() + Collision& Collision::operator=(decltype(nullptr) other) { - UnityEngine::SceneManagement::LoadSceneMode returnVal(Plugin::UnboxLoadSceneMode(Handle)); - if (Plugin::unhandledCsharpException) + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - return returnVal; + return *this; } -} - -namespace System -{ - namespace Collections + + Collision& Collision::operator=(Collision&& other) { - IEnumerator::IEnumerator(decltype(nullptr) n) - : IEnumerator(Plugin::InternalUse::Only, 0) + if (Handle) { + Plugin::DereferenceManagedClass(Handle); } - - IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerator& IEnumerator::operator=(decltype(nullptr) other) + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Collision::operator==(const Collision& other) const + { + return Handle == other.Handle; + } + + bool Collision::operator!=(const Collision& other) const + { + return Handle != other.Handle; + } +} + +namespace UnityEngine +{ + Behaviour::Behaviour(decltype(nullptr) n) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + { + } + + Behaviour::Behaviour(Plugin::InternalUse iu, int32_t handle) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + { + Handle = handle; + if (handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; + Plugin::ReferenceManagedClass(handle); } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) + } + + Behaviour::Behaviour(const Behaviour& other) + : Behaviour(Plugin::InternalUse::Only, other.Handle) + { + } + + Behaviour::Behaviour(Behaviour&& other) + : Behaviour(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Behaviour::~Behaviour() + { + if (Handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - bool IEnumerator::operator==(const IEnumerator& other) const + } + + Behaviour& Behaviour::operator=(const Behaviour& other) + { + if (this->Handle) { - return Handle == other.Handle; + Plugin::DereferenceManagedClass(this->Handle); } - - bool IEnumerator::operator!=(const IEnumerator& other) const + this->Handle = other.Handle; + if (this->Handle) { - return Handle != other.Handle; + Plugin::ReferenceManagedClass(this->Handle); } - - System::Object IEnumerator::GetCurrent() + return *this; + } + + Behaviour& Behaviour::operator=(decltype(nullptr) other) + { + if (Handle) { - auto returnValue = Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Object(Plugin::InternalUse::Only, returnValue); + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - System::Boolean IEnumerator::MoveNext() + return *this; + } + + Behaviour& Behaviour::operator=(Behaviour&& other) + { + if (Handle) { - auto returnValue = Plugin::SystemCollectionsIEnumeratorMethodMoveNext(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Behaviour::operator==(const Behaviour& other) const + { + return Handle == other.Handle; + } + + bool Behaviour::operator!=(const Behaviour& other) const + { + return Handle != other.Handle; } } -namespace System +namespace UnityEngine { - EventArgs::EventArgs(decltype(nullptr) n) - : EventArgs(Plugin::InternalUse::Only, 0) + MonoBehaviour::MonoBehaviour(decltype(nullptr) n) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) { } - EventArgs::EventArgs(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + MonoBehaviour::MonoBehaviour(Plugin::InternalUse iu, int32_t handle) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - EventArgs::EventArgs(const EventArgs& other) - : EventArgs(Plugin::InternalUse::Only, other.Handle) + MonoBehaviour::MonoBehaviour(const MonoBehaviour& other) + : MonoBehaviour(Plugin::InternalUse::Only, other.Handle) { } - EventArgs::EventArgs(EventArgs&& other) - : EventArgs(Plugin::InternalUse::Only, other.Handle) + MonoBehaviour::MonoBehaviour(MonoBehaviour&& other) + : MonoBehaviour(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - EventArgs::~EventArgs() + MonoBehaviour::~MonoBehaviour() { if (Handle) { @@ -5445,7 +5776,7 @@ namespace System } } - EventArgs& EventArgs::operator=(const EventArgs& other) + MonoBehaviour& MonoBehaviour::operator=(const MonoBehaviour& other) { if (this->Handle) { @@ -5459,7 +5790,7 @@ namespace System return *this; } - EventArgs& EventArgs::operator=(decltype(nullptr) other) + MonoBehaviour& MonoBehaviour::operator=(decltype(nullptr) other) { if (Handle) { @@ -5469,7 +5800,7 @@ namespace System return *this; } - EventArgs& EventArgs::operator=(EventArgs&& other) + MonoBehaviour& MonoBehaviour::operator=(MonoBehaviour&& other) { if (Handle) { @@ -5480,399 +5811,2346 @@ namespace System return *this; } - bool EventArgs::operator==(const EventArgs& other) const + bool MonoBehaviour::operator==(const MonoBehaviour& other) const { return Handle == other.Handle; } - bool EventArgs::operator!=(const EventArgs& other) const + bool MonoBehaviour::operator!=(const MonoBehaviour& other) const { return Handle != other.Handle; } + + UnityEngine::Transform MonoBehaviour::GetTransform() + { + auto returnValue = Plugin::UnityEngineMonoBehaviourPropertyGetTransform(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); + } } -namespace System +namespace UnityEngine { - namespace ComponentModel + AudioSettings::AudioSettings(decltype(nullptr) n) { - namespace Design + } + + AudioSettings::AudioSettings(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) { - ComponentEventArgs::ComponentEventArgs(decltype(nullptr) n) - : ComponentEventArgs(Plugin::InternalUse::Only, 0) - { - } - - ComponentEventArgs::ComponentEventArgs(Plugin::InternalUse iu, int32_t handle) - : System::EventArgs(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ComponentEventArgs::ComponentEventArgs(const ComponentEventArgs& other) - : ComponentEventArgs(Plugin::InternalUse::Only, other.Handle) - { - } - - ComponentEventArgs::ComponentEventArgs(ComponentEventArgs&& other) - : ComponentEventArgs(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ComponentEventArgs::~ComponentEventArgs() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ComponentEventArgs& ComponentEventArgs::operator=(const ComponentEventArgs& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ComponentEventArgs& ComponentEventArgs::operator=(decltype(nullptr) other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ComponentEventArgs& ComponentEventArgs::operator=(ComponentEventArgs&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ComponentEventArgs::operator==(const ComponentEventArgs& other) const - { - return Handle == other.Handle; - } - - bool ComponentEventArgs::operator!=(const ComponentEventArgs& other) const - { - return Handle != other.Handle; - } + Plugin::ReferenceManagedClass(handle); + } + } + + AudioSettings::AudioSettings(const AudioSettings& other) + : AudioSettings(Plugin::InternalUse::Only, other.Handle) + { + } + + AudioSettings::AudioSettings(AudioSettings&& other) + : AudioSettings(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + AudioSettings::~AudioSettings() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + AudioSettings& AudioSettings::operator=(const AudioSettings& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + AudioSettings& AudioSettings::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + AudioSettings& AudioSettings::operator=(AudioSettings&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool AudioSettings::operator==(const AudioSettings& other) const + { + return Handle == other.Handle; + } + + bool AudioSettings::operator!=(const AudioSettings& other) const + { + return Handle != other.Handle; + } + + void AudioSettings::GetDSPBufferSize(int32_t* bufferLength, int32_t* numBuffers) + { + Plugin::UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(bufferLength, numBuffers); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } } } -namespace System +namespace UnityEngine { - namespace ComponentModel + namespace Networking { - namespace Design + NetworkTransport::NetworkTransport(decltype(nullptr) n) { - ComponentChangingEventArgs::ComponentChangingEventArgs(decltype(nullptr) n) - : ComponentChangingEventArgs(Plugin::InternalUse::Only, 0) - { - } - - ComponentChangingEventArgs::ComponentChangingEventArgs(Plugin::InternalUse iu, int32_t handle) - : System::EventArgs(iu, handle) + } + + NetworkTransport::NetworkTransport(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } + Plugin::ReferenceManagedClass(handle); } - - ComponentChangingEventArgs::ComponentChangingEventArgs(const ComponentChangingEventArgs& other) - : ComponentChangingEventArgs(Plugin::InternalUse::Only, other.Handle) + } + + NetworkTransport::NetworkTransport(const NetworkTransport& other) + : NetworkTransport(Plugin::InternalUse::Only, other.Handle) + { + } + + NetworkTransport::NetworkTransport(NetworkTransport&& other) + : NetworkTransport(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + NetworkTransport::~NetworkTransport() + { + if (Handle) { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - ComponentChangingEventArgs::ComponentChangingEventArgs(ComponentChangingEventArgs&& other) - : ComponentChangingEventArgs(Plugin::InternalUse::Only, other.Handle) + } + + NetworkTransport& NetworkTransport::operator=(const NetworkTransport& other) + { + if (this->Handle) { - other.Handle = 0; + Plugin::DereferenceManagedClass(this->Handle); } - - ComponentChangingEventArgs::~ComponentChangingEventArgs() + this->Handle = other.Handle; + if (this->Handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } + Plugin::ReferenceManagedClass(this->Handle); } - - ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(const ComponentChangingEventArgs& other) + return *this; + } + + NetworkTransport& NetworkTransport::operator=(decltype(nullptr) other) + { + if (Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(decltype(nullptr) other) + return *this; + } + + NetworkTransport& NetworkTransport::operator=(NetworkTransport&& other) + { + if (Handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; + Plugin::DereferenceManagedClass(Handle); } - - ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(ComponentChangingEventArgs&& other) + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool NetworkTransport::operator==(const NetworkTransport& other) const + { + return Handle == other.Handle; + } + + bool NetworkTransport::operator!=(const NetworkTransport& other) const + { + return Handle != other.Handle; + } + + void NetworkTransport::GetBroadcastConnectionInfo(int32_t hostId, System::String* address, int32_t* port, uint8_t* error) + { + int32_t addressHandle = address->Handle; + Plugin::UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(hostId, &addressHandle, port, error); + if (Plugin::unhandledCsharpException) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - bool ComponentChangingEventArgs::operator==(const ComponentChangingEventArgs& other) const + if (address->Handle) { - return Handle == other.Handle; + Plugin::DereferenceManagedClass(address->Handle); } - - bool ComponentChangingEventArgs::operator!=(const ComponentChangingEventArgs& other) const + address->Handle = addressHandle; + if (address->Handle) { - return Handle != other.Handle; + Plugin::ReferenceManagedClass(address->Handle); } } - } + + void NetworkTransport::Init() + { + Plugin::UnityEngineNetworkingNetworkTransportMethodInit(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } +} + +namespace UnityEngine +{ + Quaternion::Quaternion() + { + } } namespace System { - namespace ComponentModel + Object::Object(UnityEngine::Quaternion& val) { - namespace Design + int32_t handle = Plugin::BoxQuaternion(val); + if (Plugin::unhandledCsharpException) { - ComponentChangedEventArgs::ComponentChangedEventArgs(decltype(nullptr) n) - : ComponentChangedEventArgs(Plugin::InternalUse::Only, 0) + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::Quaternion() + { + UnityEngine::Quaternion returnVal(Plugin::UnboxQuaternion(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace UnityEngine +{ + Matrix4x4::Matrix4x4() + { + } + + float Matrix4x4::GetItem(int32_t row, int32_t column) + { + auto returnValue = Plugin::UnityEngineMatrix4x4PropertyGetItem(this, row, column); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + void Matrix4x4::SetItem(int32_t row, int32_t column, float value) + { + Plugin::UnityEngineMatrix4x4PropertySetItem(this, row, column, value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace System +{ + Object::Object(UnityEngine::Matrix4x4& val) + { + int32_t handle = Plugin::BoxMatrix4x4(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::Matrix4x4() + { + UnityEngine::Matrix4x4 returnVal(Plugin::UnboxMatrix4x4(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(UnityEngine::QueryTriggerInteraction val) + { + int32_t handle = Plugin::BoxQueryTriggerInteraction(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::QueryTriggerInteraction() + { + UnityEngine::QueryTriggerInteraction returnVal(Plugin::UnboxQueryTriggerInteraction(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + KeyValuePair::KeyValuePair(decltype(nullptr) n) + : System::ValueType(nullptr) { } - ComponentChangedEventArgs::ComponentChangedEventArgs(Plugin::InternalUse iu, int32_t handle) - : System::EventArgs(iu, handle) + KeyValuePair::KeyValuePair(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(nullptr) { + Handle = handle; if (handle) { - Plugin::ReferenceManagedClass(handle); + Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); } } - ComponentChangedEventArgs::ComponentChangedEventArgs(const ComponentChangedEventArgs& other) - : ComponentChangedEventArgs(Plugin::InternalUse::Only, other.Handle) + KeyValuePair::KeyValuePair(const KeyValuePair& other) + : KeyValuePair(Plugin::InternalUse::Only, other.Handle) { } - ComponentChangedEventArgs::ComponentChangedEventArgs(ComponentChangedEventArgs&& other) - : ComponentChangedEventArgs(Plugin::InternalUse::Only, other.Handle) + KeyValuePair::KeyValuePair(KeyValuePair&& other) + : KeyValuePair(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - ComponentChangedEventArgs::~ComponentChangedEventArgs() + KeyValuePair::~KeyValuePair() { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); Handle = 0; } } - ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(const ComponentChangedEventArgs& other) + KeyValuePair& KeyValuePair::operator=(const KeyValuePair& other) { if (this->Handle) { - Plugin::DereferenceManagedClass(this->Handle); + Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); } this->Handle = other.Handle; if (this->Handle) { - Plugin::ReferenceManagedClass(this->Handle); + Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); } return *this; } - ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(decltype(nullptr) other) + KeyValuePair& KeyValuePair::operator=(decltype(nullptr) other) { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); Handle = 0; } return *this; } - ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(ComponentChangedEventArgs&& other) + KeyValuePair& KeyValuePair::operator=(KeyValuePair&& other) { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool ComponentChangedEventArgs::operator==(const ComponentChangedEventArgs& other) const + bool KeyValuePair::operator==(const KeyValuePair& other) const { return Handle == other.Handle; } - bool ComponentChangedEventArgs::operator!=(const ComponentChangedEventArgs& other) const + bool KeyValuePair::operator!=(const KeyValuePair& other) const { return Handle != other.Handle; } + + KeyValuePair::KeyValuePair(System::String& key, double value) + : System::ValueType(nullptr) + { + auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(key.Handle, value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + } + } + + System::String KeyValuePair::GetKey() + { + auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::String(Plugin::InternalUse::Only, returnValue); + } + + double KeyValuePair::GetValue() + { + auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + } + } +} + +namespace System +{ + Object::Object(System::Collections::Generic::KeyValuePair& val) + { + int32_t handle = Plugin::BoxKeyValuePairSystemString_SystemDouble(val.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator System::Collections::Generic::KeyValuePair() + { + System::Collections::Generic::KeyValuePair returnVal(Plugin::InternalUse::Only, Plugin::UnboxKeyValuePairSystemString_SystemDouble(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + List::List(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) + { + } + + List::List(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + List::List(const List& other) + : List(Plugin::InternalUse::Only, other.Handle) + { + } + + List::List(List&& other) + : List(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + List::~List() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + List& List::operator=(const List& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + List& List::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + List& List::operator=(List&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool List::operator==(const List& other) const + { + return Handle == other.Handle; + } + + bool List::operator!=(const List& other) const + { + return Handle != other.Handle; + } + + List::List() + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) + { + auto returnValue = Plugin::SystemCollectionsGenericListSystemStringConstructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + System::String List::GetItem(int32_t index) + { + auto returnValue = Plugin::SystemCollectionsGenericListSystemStringPropertyGetItem(Handle, index); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::String(Plugin::InternalUse::Only, returnValue); + } + + void List::SetItem(int32_t index, System::String& value) + { + Plugin::SystemCollectionsGenericListSystemStringPropertySetItem(Handle, index, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void List::Add(System::String& item) + { + Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString(Handle, item.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void List::Sort(System::Collections::Generic::IComparer& comparer) + { + Plugin::SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + List::List(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) + { + } + + List::List(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + List::List(const List& other) + : List(Plugin::InternalUse::Only, other.Handle) + { + } + + List::List(List&& other) + : List(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + List::~List() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + List& List::operator=(const List& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + List& List::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + List& List::operator=(List&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool List::operator==(const List& other) const + { + return Handle == other.Handle; + } + + bool List::operator!=(const List& other) const + { + return Handle != other.Handle; + } + + List::List() + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) + { + auto returnValue = Plugin::SystemCollectionsGenericListSystemInt32Constructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + int32_t List::GetItem(int32_t index) + { + auto returnValue = Plugin::SystemCollectionsGenericListSystemInt32PropertyGetItem(Handle, index); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + void List::SetItem(int32_t index, int32_t value) + { + Plugin::SystemCollectionsGenericListSystemInt32PropertySetItem(Handle, index, value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void List::Add(int32_t item) + { + Plugin::SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(Handle, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void List::Sort(System::Collections::Generic::IComparer& comparer) + { + Plugin::SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + LinkedListNode::LinkedListNode(decltype(nullptr) n) + { + } + + LinkedListNode::LinkedListNode(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + LinkedListNode::LinkedListNode(const LinkedListNode& other) + : LinkedListNode(Plugin::InternalUse::Only, other.Handle) + { + } + + LinkedListNode::LinkedListNode(LinkedListNode&& other) + : LinkedListNode(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + LinkedListNode::~LinkedListNode() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + LinkedListNode& LinkedListNode::operator=(const LinkedListNode& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + LinkedListNode& LinkedListNode::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + LinkedListNode& LinkedListNode::operator=(LinkedListNode&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool LinkedListNode::operator==(const LinkedListNode& other) const + { + return Handle == other.Handle; + } + + bool LinkedListNode::operator!=(const LinkedListNode& other) const + { + return Handle != other.Handle; + } + + LinkedListNode::LinkedListNode(System::String& value) + { + auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + System::String LinkedListNode::GetValue() + { + auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::String(Plugin::InternalUse::Only, returnValue); + } + + void LinkedListNode::SetValue(System::String& value) + { + Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(Handle, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } +} + +namespace System +{ + namespace Runtime + { + namespace CompilerServices + { + StrongBox::StrongBox(decltype(nullptr) n) + : System::Runtime::CompilerServices::IStrongBox(nullptr) + { + } + + StrongBox::StrongBox(Plugin::InternalUse iu, int32_t handle) + : System::Runtime::CompilerServices::IStrongBox(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + StrongBox::StrongBox(const StrongBox& other) + : StrongBox(Plugin::InternalUse::Only, other.Handle) + { + } + + StrongBox::StrongBox(StrongBox&& other) + : StrongBox(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + StrongBox::~StrongBox() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + StrongBox& StrongBox::operator=(const StrongBox& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + StrongBox& StrongBox::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + StrongBox& StrongBox::operator=(StrongBox&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool StrongBox::operator==(const StrongBox& other) const + { + return Handle == other.Handle; + } + + bool StrongBox::operator!=(const StrongBox& other) const + { + return Handle != other.Handle; + } + + StrongBox::StrongBox(System::String& value) + : System::Runtime::CompilerServices::IStrongBox(nullptr) + { + auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + System::String StrongBox::GetValue() + { + auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::String(Plugin::InternalUse::Only, returnValue); + } + + void StrongBox::SetValue(System::String& value) + { + Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(Handle, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + Collection::Collection(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) + { + } + + Collection::Collection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Collection::Collection(const Collection& other) + : Collection(Plugin::InternalUse::Only, other.Handle) + { + } + + Collection::Collection(Collection&& other) + : Collection(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Collection::~Collection() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Collection& Collection::operator=(const Collection& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Collection& Collection::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Collection& Collection::operator=(Collection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Collection::operator==(const Collection& other) const + { + return Handle == other.Handle; + } + + bool Collection::operator!=(const Collection& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + KeyedCollection::KeyedCollection(decltype(nullptr) n) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) + , System::Collections::ObjectModel::Collection(nullptr) + { + } + + KeyedCollection::KeyedCollection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) + , System::Collections::ObjectModel::Collection(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + KeyedCollection::KeyedCollection(const KeyedCollection& other) + : KeyedCollection(Plugin::InternalUse::Only, other.Handle) + { + } + + KeyedCollection::KeyedCollection(KeyedCollection&& other) + : KeyedCollection(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + KeyedCollection::~KeyedCollection() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + KeyedCollection& KeyedCollection::operator=(const KeyedCollection& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + KeyedCollection& KeyedCollection::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + KeyedCollection& KeyedCollection::operator=(KeyedCollection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool KeyedCollection::operator==(const KeyedCollection& other) const + { + return Handle == other.Handle; + } + + bool KeyedCollection::operator!=(const KeyedCollection& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace System +{ + Exception::Exception(decltype(nullptr) n) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + { + } + + Exception::Exception(Plugin::InternalUse iu, int32_t handle) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Exception::Exception(const Exception& other) + : Exception(Plugin::InternalUse::Only, other.Handle) + { + } + + Exception::Exception(Exception&& other) + : Exception(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Exception::~Exception() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Exception& Exception::operator=(const Exception& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Exception& Exception::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Exception& Exception::operator=(Exception&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Exception::operator==(const Exception& other) const + { + return Handle == other.Handle; + } + + bool Exception::operator!=(const Exception& other) const + { + return Handle != other.Handle; + } + + Exception::Exception(System::String& message) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + { + auto returnValue = Plugin::SystemExceptionConstructorSystemString(message.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } +} + +namespace System +{ + SystemException::SystemException(decltype(nullptr) n) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + , System::Exception(nullptr) + { + } + + SystemException::SystemException(Plugin::InternalUse iu, int32_t handle) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + , System::Exception(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + SystemException::SystemException(const SystemException& other) + : SystemException(Plugin::InternalUse::Only, other.Handle) + { + } + + SystemException::SystemException(SystemException&& other) + : SystemException(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + SystemException::~SystemException() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + SystemException& SystemException::operator=(const SystemException& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + SystemException& SystemException::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + SystemException& SystemException::operator=(SystemException&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool SystemException::operator==(const SystemException& other) const + { + return Handle == other.Handle; + } + + bool SystemException::operator!=(const SystemException& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + NullReferenceException::NullReferenceException(decltype(nullptr) n) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + , System::Exception(nullptr) + , System::SystemException(nullptr) + { + } + + NullReferenceException::NullReferenceException(Plugin::InternalUse iu, int32_t handle) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + , System::Exception(nullptr) + , System::SystemException(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + NullReferenceException::NullReferenceException(const NullReferenceException& other) + : NullReferenceException(Plugin::InternalUse::Only, other.Handle) + { + } + + NullReferenceException::NullReferenceException(NullReferenceException&& other) + : NullReferenceException(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + NullReferenceException::~NullReferenceException() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + NullReferenceException& NullReferenceException::operator=(const NullReferenceException& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + NullReferenceException& NullReferenceException::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + NullReferenceException& NullReferenceException::operator=(NullReferenceException&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool NullReferenceException::operator==(const NullReferenceException& other) const + { + return Handle == other.Handle; + } + + bool NullReferenceException::operator!=(const NullReferenceException& other) const + { + return Handle != other.Handle; + } +} + +namespace UnityEngine +{ + Screen::Screen(decltype(nullptr) n) + { + } + + Screen::Screen(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Screen::Screen(const Screen& other) + : Screen(Plugin::InternalUse::Only, other.Handle) + { + } + + Screen::Screen(Screen&& other) + : Screen(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Screen::~Screen() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Screen& Screen::operator=(const Screen& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Screen& Screen::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Screen& Screen::operator=(Screen&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Screen::operator==(const Screen& other) const + { + return Handle == other.Handle; + } + + bool Screen::operator!=(const Screen& other) const + { + return Handle != other.Handle; + } + + System::Array1 Screen::GetResolutions() + { + auto returnValue = Plugin::UnityEngineScreenPropertyGetResolutions(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Array1(Plugin::InternalUse::Only, returnValue); + } +} + +namespace UnityEngine +{ + Ray::Ray(decltype(nullptr) n) + : System::ValueType(nullptr) + { + } + + Ray::Ray(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedUnityEngineRay(Handle); + } + } + + Ray::Ray(const Ray& other) + : Ray(Plugin::InternalUse::Only, other.Handle) + { + } + + Ray::Ray(Ray&& other) + : Ray(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Ray::~Ray() + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineRay(Handle); + Handle = 0; + } + } + + Ray& Ray::operator=(const Ray& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedUnityEngineRay(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEngineRay(Handle); + } + return *this; + } + + Ray& Ray::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineRay(Handle); + Handle = 0; + } + return *this; + } + + Ray& Ray::operator=(Ray&& other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineRay(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Ray::operator==(const Ray& other) const + { + return Handle == other.Handle; + } + + bool Ray::operator!=(const Ray& other) const + { + return Handle != other.Handle; + } + + Ray::Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction) + : System::ValueType(nullptr) + { + auto returnValue = Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(origin, direction); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedUnityEngineRay(Handle); + } + } +} + +namespace System +{ + Object::Object(UnityEngine::Ray& val) + { + int32_t handle = Plugin::BoxRay(val.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::Ray() + { + UnityEngine::Ray returnVal(Plugin::InternalUse::Only, Plugin::UnboxRay(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace UnityEngine +{ + Physics::Physics(decltype(nullptr) n) + { + } + + Physics::Physics(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Physics::Physics(const Physics& other) + : Physics(Plugin::InternalUse::Only, other.Handle) + { + } + + Physics::Physics(Physics&& other) + : Physics(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Physics::~Physics() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Physics& Physics::operator=(const Physics& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Physics& Physics::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Physics& Physics::operator=(Physics&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Physics::operator==(const Physics& other) const + { + return Handle == other.Handle; + } + + bool Physics::operator!=(const Physics& other) const + { + return Handle != other.Handle; + } + + int32_t Physics::RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1& results) + { + auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1(ray.Handle, results.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + System::Array1 Physics::RaycastAll(UnityEngine::Ray& ray) + { + auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ray.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Array1(Plugin::InternalUse::Only, returnValue); + } +} + +namespace UnityEngine +{ + Gradient::Gradient(decltype(nullptr) n) + { + } + + Gradient::Gradient(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Gradient::Gradient(const Gradient& other) + : Gradient(Plugin::InternalUse::Only, other.Handle) + { + } + + Gradient::Gradient(Gradient&& other) + : Gradient(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Gradient::~Gradient() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Gradient& Gradient::operator=(const Gradient& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Gradient& Gradient::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Gradient& Gradient::operator=(Gradient&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Gradient::operator==(const Gradient& other) const + { + return Handle == other.Handle; + } + + bool Gradient::operator!=(const Gradient& other) const + { + return Handle != other.Handle; + } + + Gradient::Gradient() + { + auto returnValue = Plugin::UnityEngineGradientConstructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + System::Array1 Gradient::GetColorKeys() + { + auto returnValue = Plugin::UnityEngineGradientPropertyGetColorKeys(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Array1(Plugin::InternalUse::Only, returnValue); + } + + void Gradient::SetColorKeys(System::Array1& value) + { + Plugin::UnityEngineGradientPropertySetColorKeys(Handle, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace System +{ + AppDomainSetup::AppDomainSetup(decltype(nullptr) n) + : System::IAppDomainSetup(nullptr) + { + } + + AppDomainSetup::AppDomainSetup(Plugin::InternalUse iu, int32_t handle) + : System::IAppDomainSetup(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + AppDomainSetup::AppDomainSetup(const AppDomainSetup& other) + : AppDomainSetup(Plugin::InternalUse::Only, other.Handle) + { + } + + AppDomainSetup::AppDomainSetup(AppDomainSetup&& other) + : AppDomainSetup(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + AppDomainSetup::~AppDomainSetup() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + AppDomainSetup& AppDomainSetup::operator=(const AppDomainSetup& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + AppDomainSetup& AppDomainSetup::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + AppDomainSetup& AppDomainSetup::operator=(AppDomainSetup&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool AppDomainSetup::operator==(const AppDomainSetup& other) const + { + return Handle == other.Handle; + } + + bool AppDomainSetup::operator!=(const AppDomainSetup& other) const + { + return Handle != other.Handle; + } + + AppDomainSetup::AppDomainSetup() + : System::IAppDomainSetup(nullptr) + { + auto returnValue = Plugin::SystemAppDomainSetupConstructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + System::AppDomainInitializer AppDomainSetup::GetAppDomainInitializer() + { + auto returnValue = Plugin::SystemAppDomainSetupPropertyGetAppDomainInitializer(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::AppDomainInitializer(Plugin::InternalUse::Only, returnValue); + } + + void AppDomainSetup::SetAppDomainInitializer(System::AppDomainInitializer& value) + { + Plugin::SystemAppDomainSetupPropertySetAppDomainInitializer(Handle, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace UnityEngine +{ + Application::Application(decltype(nullptr) n) + { + } + + Application::Application(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Application::Application(const Application& other) + : Application(Plugin::InternalUse::Only, other.Handle) + { + } + + Application::Application(Application&& other) + : Application(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Application::~Application() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Application& Application::operator=(const Application& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Application& Application::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Application& Application::operator=(Application&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Application::operator==(const Application& other) const + { + return Handle == other.Handle; + } + + bool Application::operator!=(const Application& other) const + { + return Handle != other.Handle; + } + + void Application::AddOnBeforeRender(UnityEngine::Events::UnityAction& del) + { + Plugin::UnityEngineApplicationAddEventOnBeforeRender(del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } } -} - -namespace System -{ - namespace ComponentModel + + void Application::RemoveOnBeforeRender(UnityEngine::Events::UnityAction& del) { - namespace Design + Plugin::UnityEngineApplicationRemoveEventOnBeforeRender(del.Handle); + if (Plugin::unhandledCsharpException) { - ComponentRenameEventArgs::ComponentRenameEventArgs(decltype(nullptr) n) - : ComponentRenameEventArgs(Plugin::InternalUse::Only, 0) - { - } - - ComponentRenameEventArgs::ComponentRenameEventArgs(Plugin::InternalUse iu, int32_t handle) - : System::EventArgs(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ComponentRenameEventArgs::ComponentRenameEventArgs(const ComponentRenameEventArgs& other) - : ComponentRenameEventArgs(Plugin::InternalUse::Only, other.Handle) - { - } - - ComponentRenameEventArgs::ComponentRenameEventArgs(ComponentRenameEventArgs&& other) - : ComponentRenameEventArgs(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ComponentRenameEventArgs::~ComponentRenameEventArgs() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(const ComponentRenameEventArgs& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(decltype(nullptr) other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(ComponentRenameEventArgs&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ComponentRenameEventArgs::operator==(const ComponentRenameEventArgs& other) const - { - return Handle == other.Handle; - } - - bool ComponentRenameEventArgs::operator!=(const ComponentRenameEventArgs& other) const - { - return Handle != other.Handle; - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } } } -namespace System +namespace UnityEngine { - namespace ComponentModel + namespace SceneManagement { - MemberDescriptor::MemberDescriptor(decltype(nullptr) n) - : MemberDescriptor(Plugin::InternalUse::Only, 0) + SceneManager::SceneManager(decltype(nullptr) n) { } - MemberDescriptor::MemberDescriptor(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + SceneManager::SceneManager(Plugin::InternalUse iu, int32_t handle) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - MemberDescriptor::MemberDescriptor(const MemberDescriptor& other) - : MemberDescriptor(Plugin::InternalUse::Only, other.Handle) + SceneManager::SceneManager(const SceneManager& other) + : SceneManager(Plugin::InternalUse::Only, other.Handle) { } - MemberDescriptor::MemberDescriptor(MemberDescriptor&& other) - : MemberDescriptor(Plugin::InternalUse::Only, other.Handle) + SceneManager::SceneManager(SceneManager&& other) + : SceneManager(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - MemberDescriptor::~MemberDescriptor() + SceneManager::~SceneManager() { if (Handle) { @@ -5881,7 +8159,7 @@ namespace System } } - MemberDescriptor& MemberDescriptor::operator=(const MemberDescriptor& other) + SceneManager& SceneManager::operator=(const SceneManager& other) { if (this->Handle) { @@ -5895,7 +8173,7 @@ namespace System return *this; } - MemberDescriptor& MemberDescriptor::operator=(decltype(nullptr) other) + SceneManager& SceneManager::operator=(decltype(nullptr) other) { if (Handle) { @@ -5905,7 +8183,7 @@ namespace System return *this; } - MemberDescriptor& MemberDescriptor::operator=(MemberDescriptor&& other) + SceneManager& SceneManager::operator=(SceneManager&& other) { if (Handle) { @@ -5916,135 +8194,150 @@ namespace System return *this; } - bool MemberDescriptor::operator==(const MemberDescriptor& other) const + bool SceneManager::operator==(const SceneManager& other) const { return Handle == other.Handle; } - bool MemberDescriptor::operator!=(const MemberDescriptor& other) const + bool SceneManager::operator!=(const SceneManager& other) const { return Handle != other.Handle; } + + void SceneManager::AddSceneLoaded(UnityEngine::Events::UnityAction2& del) + { + Plugin::UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void SceneManager::RemoveSceneLoaded(UnityEngine::Events::UnityAction2& del) + { + Plugin::UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } } -namespace System +namespace UnityEngine { - Object::Object(UnityEngine::PrimitiveType val) + namespace SceneManagement { - int32_t handle = Plugin::BoxPrimitiveType(val); - if (Plugin::unhandledCsharpException) + Scene::Scene(decltype(nullptr) n) + : System::ValueType(nullptr) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } - if (handle) + + Scene::Scene(Plugin::InternalUse iu, int32_t handle) + : System::ValueType(nullptr) { - Plugin::ReferenceManagedClass(handle); Handle = handle; + if (handle) + { + Plugin::ReferenceManagedUnityEngineSceneManagementScene(Handle); + } } - } - - Object::operator UnityEngine::PrimitiveType() - { - UnityEngine::PrimitiveType returnVal(Plugin::UnboxPrimitiveType(Handle)); - if (Plugin::unhandledCsharpException) + + Scene::Scene(const Scene& other) + : Scene(Plugin::InternalUse::Only, other.Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } - return returnVal; - } -} - -namespace UnityEngine -{ - Time::Time(decltype(nullptr) n) - : Time(Plugin::InternalUse::Only, 0) - { - } - - Time::Time(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - if (handle) + + Scene::Scene(Scene&& other) + : Scene(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(handle); + other.Handle = 0; } - } - - Time::Time(const Time& other) - : Time(Plugin::InternalUse::Only, other.Handle) - { - } - - Time::Time(Time&& other) - : Time(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Time::~Time() - { - if (Handle) + + Scene::~Scene() { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + if (Handle) + { + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); + Handle = 0; + } + } + + Scene& Scene::operator=(const Scene& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEngineSceneManagementScene(Handle); + } + return *this; + } + + Scene& Scene::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); + Handle = 0; + } + return *this; + } + + Scene& Scene::operator=(Scene&& other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - } - - Time& Time::operator=(const Time& other) - { - if (this->Handle) + + bool Scene::operator==(const Scene& other) const { - Plugin::DereferenceManagedClass(this->Handle); + return Handle == other.Handle; } - this->Handle = other.Handle; - if (this->Handle) + + bool Scene::operator!=(const Scene& other) const { - Plugin::ReferenceManagedClass(this->Handle); + return Handle != other.Handle; } - return *this; } - - Time& Time::operator=(decltype(nullptr) other) +} + +namespace System +{ + Object::Object(UnityEngine::SceneManagement::Scene& val) { - if (Handle) + int32_t handle = Plugin::BoxScene(val.Handle); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - return *this; - } - - Time& Time::operator=(Time&& other) - { - if (Handle) + if (handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::ReferenceManagedClass(handle); + Handle = handle; } - Handle = other.Handle; - other.Handle = 0; - return *this; } - bool Time::operator==(const Time& other) const - { - return Handle == other.Handle; - } - - bool Time::operator!=(const Time& other) const - { - return Handle != other.Handle; - } - - float Time::GetDeltaTime() + Object::operator UnityEngine::SceneManagement::Scene() { - auto returnValue = Plugin::UnityEngineTimePropertyGetDeltaTime(); + UnityEngine::SceneManagement::Scene returnVal(Plugin::InternalUse::Only, Plugin::UnboxScene(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6052,15 +8345,15 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return returnValue; + return returnVal; } } namespace System { - Object::Object(System::IO::FileMode val) + Object::Object(UnityEngine::SceneManagement::LoadSceneMode val) { - int32_t handle = Plugin::BoxFileMode(val); + int32_t handle = Plugin::BoxLoadSceneMode(val); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6075,9 +8368,9 @@ namespace System } } - Object::operator System::IO::FileMode() + Object::operator UnityEngine::SceneManagement::LoadSceneMode() { - System::IO::FileMode returnVal(Plugin::UnboxFileMode(Handle)); + UnityEngine::SceneManagement::LoadSceneMode returnVal(Plugin::UnboxLoadSceneMode(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6091,203 +8384,228 @@ namespace System namespace System { - MarshalByRefObject::MarshalByRefObject(decltype(nullptr) n) - : MarshalByRefObject(Plugin::InternalUse::Only, 0) - { - } - - MarshalByRefObject::MarshalByRefObject(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + namespace Collections { - if (handle) + IEnumerator::IEnumerator(decltype(nullptr) n) { - Plugin::ReferenceManagedClass(handle); } - } - - MarshalByRefObject::MarshalByRefObject(const MarshalByRefObject& other) - : MarshalByRefObject(Plugin::InternalUse::Only, other.Handle) - { - } - - MarshalByRefObject::MarshalByRefObject(MarshalByRefObject&& other) - : MarshalByRefObject(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - MarshalByRefObject::~MarshalByRefObject() - { - if (Handle) + + IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - } - - MarshalByRefObject& MarshalByRefObject::operator=(const MarshalByRefObject& other) - { - if (this->Handle) + + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(this->Handle); } - this->Handle = other.Handle; - if (this->Handle) + + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(this->Handle); + other.Handle = 0; } - return *this; - } - - MarshalByRefObject& MarshalByRefObject::operator=(decltype(nullptr) other) - { - if (Handle) + + IEnumerator::~IEnumerator() { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - return *this; - } - - MarshalByRefObject& MarshalByRefObject::operator=(MarshalByRefObject&& other) - { - if (Handle) + + IEnumerator& IEnumerator::operator=(const IEnumerator& other) { - Plugin::DereferenceManagedClass(Handle); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool MarshalByRefObject::operator==(const MarshalByRefObject& other) const - { - return Handle == other.Handle; - } - - bool MarshalByRefObject::operator!=(const MarshalByRefObject& other) const - { - return Handle != other.Handle; - } -} - -namespace System -{ - namespace IO - { - Stream::Stream(decltype(nullptr) n) - : Stream(Plugin::InternalUse::Only, 0) + + IEnumerator& IEnumerator::operator=(decltype(nullptr) other) { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - Stream::Stream(Plugin::InternalUse iu, int32_t handle) - : System::MarshalByRefObject(iu, handle) + IEnumerator& IEnumerator::operator=(IEnumerator&& other) { - if (handle) + if (Handle) { - Plugin::ReferenceManagedClass(handle); + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; } - Stream::Stream(const Stream& other) - : Stream(Plugin::InternalUse::Only, other.Handle) + bool IEnumerator::operator==(const IEnumerator& other) const { + return Handle == other.Handle; } - Stream::Stream(Stream&& other) - : Stream(Plugin::InternalUse::Only, other.Handle) + bool IEnumerator::operator!=(const IEnumerator& other) const { - other.Handle = 0; + return Handle != other.Handle; } - Stream::~Stream() + System::Object IEnumerator::GetCurrent() { - if (Handle) + auto returnValue = Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return System::Object(Plugin::InternalUse::Only, returnValue); } - Stream& Stream::operator=(const Stream& other) + System::Boolean IEnumerator::MoveNext() + { + auto returnValue = Plugin::SystemCollectionsIEnumeratorMethodMoveNext(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + } +} + +namespace System +{ + EventArgs::EventArgs(decltype(nullptr) n) + { + } + + EventArgs::EventArgs(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + EventArgs::EventArgs(const EventArgs& other) + : EventArgs(Plugin::InternalUse::Only, other.Handle) + { + } + + EventArgs::EventArgs(EventArgs&& other) + : EventArgs(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + EventArgs::~EventArgs() + { + if (Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - Stream& Stream::operator=(decltype(nullptr) other) + } + + EventArgs& EventArgs::operator=(const EventArgs& other) + { + if (this->Handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; + Plugin::DereferenceManagedClass(this->Handle); } - - Stream& Stream::operator=(Stream&& other) + this->Handle = other.Handle; + if (this->Handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; + Plugin::ReferenceManagedClass(this->Handle); } - - bool Stream::operator==(const Stream& other) const + return *this; + } + + EventArgs& EventArgs::operator=(decltype(nullptr) other) + { + if (Handle) { - return Handle == other.Handle; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - bool Stream::operator!=(const Stream& other) const + return *this; + } + + EventArgs& EventArgs::operator=(EventArgs&& other) + { + if (Handle) { - return Handle != other.Handle; + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool EventArgs::operator==(const EventArgs& other) const + { + return Handle == other.Handle; + } + + bool EventArgs::operator!=(const EventArgs& other) const + { + return Handle != other.Handle; } } namespace System { - namespace Collections + namespace ComponentModel { - namespace Generic + namespace Design { - IComparer::IComparer(decltype(nullptr) n) - : IComparer(Plugin::InternalUse::Only, 0) + ComponentEventArgs::ComponentEventArgs(decltype(nullptr) n) + : System::EventArgs(nullptr) { } - IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + ComponentEventArgs::ComponentEventArgs(Plugin::InternalUse iu, int32_t handle) + : System::EventArgs(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - IComparer::IComparer(const IComparer& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) + ComponentEventArgs::ComponentEventArgs(const ComponentEventArgs& other) + : ComponentEventArgs(Plugin::InternalUse::Only, other.Handle) { } - IComparer::IComparer(IComparer&& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) + ComponentEventArgs::ComponentEventArgs(ComponentEventArgs&& other) + : ComponentEventArgs(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IComparer::~IComparer() + ComponentEventArgs::~ComponentEventArgs() { if (Handle) { @@ -6296,7 +8614,7 @@ namespace System } } - IComparer& IComparer::operator=(const IComparer& other) + ComponentEventArgs& ComponentEventArgs::operator=(const ComponentEventArgs& other) { if (this->Handle) { @@ -6310,7 +8628,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(decltype(nullptr) other) + ComponentEventArgs& ComponentEventArgs::operator=(decltype(nullptr) other) { if (Handle) { @@ -6320,7 +8638,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(IComparer&& other) + ComponentEventArgs& ComponentEventArgs::operator=(ComponentEventArgs&& other) { if (Handle) { @@ -6331,12 +8649,12 @@ namespace System return *this; } - bool IComparer::operator==(const IComparer& other) const + bool ComponentEventArgs::operator==(const ComponentEventArgs& other) const { return Handle == other.Handle; } - bool IComparer::operator!=(const IComparer& other) const + bool ComponentEventArgs::operator!=(const ComponentEventArgs& other) const { return Handle != other.Handle; } @@ -6346,36 +8664,37 @@ namespace System namespace System { - namespace Collections + namespace ComponentModel { - namespace Generic + namespace Design { - IComparer::IComparer(decltype(nullptr) n) - : IComparer(Plugin::InternalUse::Only, 0) + ComponentChangingEventArgs::ComponentChangingEventArgs(decltype(nullptr) n) + : System::EventArgs(nullptr) { } - IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + ComponentChangingEventArgs::ComponentChangingEventArgs(Plugin::InternalUse iu, int32_t handle) + : System::EventArgs(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - IComparer::IComparer(const IComparer& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) + ComponentChangingEventArgs::ComponentChangingEventArgs(const ComponentChangingEventArgs& other) + : ComponentChangingEventArgs(Plugin::InternalUse::Only, other.Handle) { } - IComparer::IComparer(IComparer&& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) + ComponentChangingEventArgs::ComponentChangingEventArgs(ComponentChangingEventArgs&& other) + : ComponentChangingEventArgs(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IComparer::~IComparer() + ComponentChangingEventArgs::~ComponentChangingEventArgs() { if (Handle) { @@ -6384,7 +8703,7 @@ namespace System } } - IComparer& IComparer::operator=(const IComparer& other) + ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(const ComponentChangingEventArgs& other) { if (this->Handle) { @@ -6398,7 +8717,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(decltype(nullptr) other) + ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(decltype(nullptr) other) { if (Handle) { @@ -6408,7 +8727,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(IComparer&& other) + ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(ComponentChangingEventArgs&& other) { if (Handle) { @@ -6419,12 +8738,12 @@ namespace System return *this; } - bool IComparer::operator==(const IComparer& other) const + bool ComponentChangingEventArgs::operator==(const ComponentChangingEventArgs& other) const { return Handle == other.Handle; } - bool IComparer::operator!=(const IComparer& other) const + bool ComponentChangingEventArgs::operator!=(const ComponentChangingEventArgs& other) const { return Handle != other.Handle; } @@ -6434,99 +8753,46 @@ namespace System namespace System { - namespace Collections + namespace ComponentModel { - namespace Generic + namespace Design { - BaseIComparer::BaseIComparer() - : System::Collections::Generic::IComparer(nullptr) - { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); - int32_t* handle = &Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsGenericBaseIComparerSystemInt32Constructor(cppHandle, handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - BaseIComparer::BaseIComparer(decltype(nullptr) n) - : System::Collections::Generic::IComparer(Plugin::InternalUse::Only, 0) + ComponentChangedEventArgs::ComponentChangedEventArgs(decltype(nullptr) n) + : System::EventArgs(nullptr) { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); } - BaseIComparer::BaseIComparer(const BaseIComparer& other) - : System::Collections::Generic::IComparer(Plugin::InternalUse::Only, other.Handle) + ComponentChangedEventArgs::ComponentChangedEventArgs(Plugin::InternalUse iu, int32_t handle) + : System::EventArgs(nullptr) { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); - if (Handle) + Handle = handle; + if (handle) { - Plugin::ReferenceManagedClass(Handle); + Plugin::ReferenceManagedClass(handle); } } - BaseIComparer::BaseIComparer(BaseIComparer&& other) - : System::Collections::Generic::IComparer(Plugin::InternalUse::Only, other.Handle) + ComponentChangedEventArgs::ComponentChangedEventArgs(const ComponentChangedEventArgs& other) + : ComponentChangedEventArgs(Plugin::InternalUse::Only, other.Handle) { - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; } - BaseIComparer::BaseIComparer(Plugin::InternalUse iu, int32_t handle) - : System::Collections::Generic::IComparer(iu, handle) + ComponentChangedEventArgs::ComponentChangedEventArgs(ComponentChangedEventArgs&& other) + : ComponentChangedEventArgs(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } + other.Handle = 0; } - BaseIComparer::~BaseIComparer() + ComponentChangedEventArgs::~ComponentChangedEventArgs() { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; + Plugin::DereferenceManagedClass(Handle); Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } } - BaseIComparer& BaseIComparer::operator=(const BaseIComparer& other) + ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(const ComponentChangedEventArgs& other) { if (this->Handle) { @@ -6540,86 +8806,35 @@ namespace System return *this; } - BaseIComparer& BaseIComparer::operator=(decltype(nullptr) other) + ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(decltype(nullptr) other) { if (Handle) { - int32_t handle = Handle; + Plugin::DereferenceManagedClass(Handle); Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } - Handle = 0; return *this; } - BaseIComparer& BaseIComparer::operator=(BaseIComparer&& other) + ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(ComponentChangedEventArgs&& other) { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; - return *this; - } - - bool BaseIComparer::operator==(const BaseIComparer& other) const - { - return Handle == other.Handle; - } - - bool BaseIComparer::operator!=(const BaseIComparer& other) const - { - return Handle != other.Handle; + return *this; } - int32_t BaseIComparer::Compare(int32_t x, int32_t y) + bool ComponentChangedEventArgs::operator==(const ComponentChangedEventArgs& other) const { - return {}; + return Handle == other.Handle; } - DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemInt32Compare(int32_t cppHandle, int32_t x, int32_t y) + bool ComponentChangedEventArgs::operator!=(const ComponentChangedEventArgs& other) const { - try - { - return Plugin::GetSystemCollectionsGenericBaseIComparerSystemInt32(cppHandle)->Compare(x, y); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } + return Handle != other.Handle; } } } @@ -6627,99 +8842,46 @@ namespace System namespace System { - namespace Collections + namespace ComponentModel { - namespace Generic + namespace Design { - BaseIComparer::BaseIComparer() - : System::Collections::Generic::IComparer(nullptr) - { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); - int32_t* handle = &Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsGenericBaseIComparerSystemStringConstructor(cppHandle, handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - BaseIComparer::BaseIComparer(decltype(nullptr) n) - : System::Collections::Generic::IComparer(Plugin::InternalUse::Only, 0) + ComponentRenameEventArgs::ComponentRenameEventArgs(decltype(nullptr) n) + : System::EventArgs(nullptr) { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); } - BaseIComparer::BaseIComparer(const BaseIComparer& other) - : System::Collections::Generic::IComparer(Plugin::InternalUse::Only, other.Handle) + ComponentRenameEventArgs::ComponentRenameEventArgs(Plugin::InternalUse iu, int32_t handle) + : System::EventArgs(nullptr) { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); - if (Handle) + Handle = handle; + if (handle) { - Plugin::ReferenceManagedClass(Handle); + Plugin::ReferenceManagedClass(handle); } } - BaseIComparer::BaseIComparer(BaseIComparer&& other) - : System::Collections::Generic::IComparer(Plugin::InternalUse::Only, other.Handle) + ComponentRenameEventArgs::ComponentRenameEventArgs(const ComponentRenameEventArgs& other) + : ComponentRenameEventArgs(Plugin::InternalUse::Only, other.Handle) { - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; } - BaseIComparer::BaseIComparer(Plugin::InternalUse iu, int32_t handle) - : System::Collections::Generic::IComparer(iu, handle) + ComponentRenameEventArgs::ComponentRenameEventArgs(ComponentRenameEventArgs&& other) + : ComponentRenameEventArgs(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } + other.Handle = 0; } - BaseIComparer::~BaseIComparer() + ComponentRenameEventArgs::~ComponentRenameEventArgs() { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; + Plugin::DereferenceManagedClass(Handle); Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } } - BaseIComparer& BaseIComparer::operator=(const BaseIComparer& other) + ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(const ComponentRenameEventArgs& other) { if (this->Handle) { @@ -6733,121 +8895,184 @@ namespace System return *this; } - BaseIComparer& BaseIComparer::operator=(decltype(nullptr) other) + ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(decltype(nullptr) other) { if (Handle) { - int32_t handle = Handle; + Plugin::DereferenceManagedClass(Handle); Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } - Handle = 0; return *this; } - BaseIComparer& BaseIComparer::operator=(BaseIComparer&& other) + ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(ComponentRenameEventArgs&& other) { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool BaseIComparer::operator==(const BaseIComparer& other) const + bool ComponentRenameEventArgs::operator==(const ComponentRenameEventArgs& other) const { return Handle == other.Handle; } - bool BaseIComparer::operator!=(const BaseIComparer& other) const + bool ComponentRenameEventArgs::operator!=(const ComponentRenameEventArgs& other) const { return Handle != other.Handle; } - - int32_t BaseIComparer::Compare(System::String& x, System::String& y) + } + } +} + +namespace System +{ + namespace ComponentModel + { + MemberDescriptor::MemberDescriptor(decltype(nullptr) n) + { + } + + MemberDescriptor::MemberDescriptor(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) { - return {}; + Plugin::ReferenceManagedClass(handle); } - - DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemStringCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + } + + MemberDescriptor::MemberDescriptor(const MemberDescriptor& other) + : MemberDescriptor(Plugin::InternalUse::Only, other.Handle) + { + } + + MemberDescriptor::MemberDescriptor(MemberDescriptor&& other) + : MemberDescriptor(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + MemberDescriptor::~MemberDescriptor() + { + if (Handle) { - try - { - auto x = System::String(Plugin::InternalUse::Only, xHandle); - auto y = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemCollectionsGenericBaseIComparerSystemString(cppHandle)->Compare(x, y); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + MemberDescriptor& MemberDescriptor::operator=(const MemberDescriptor& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + MemberDescriptor& MemberDescriptor::operator=(decltype(nullptr) other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + MemberDescriptor& MemberDescriptor::operator=(MemberDescriptor&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool MemberDescriptor::operator==(const MemberDescriptor& other) const + { + return Handle == other.Handle; + } + + bool MemberDescriptor::operator!=(const MemberDescriptor& other) const + { + return Handle != other.Handle; + } + } +} + +namespace System +{ + Object::Object(UnityEngine::PrimitiveType val) + { + int32_t handle = Plugin::BoxPrimitiveType(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::PrimitiveType() + { + UnityEngine::PrimitiveType returnVal(Plugin::UnboxPrimitiveType(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnVal; } } -namespace System +namespace UnityEngine { - StringComparer::StringComparer(decltype(nullptr) n) - : StringComparer(Plugin::InternalUse::Only, 0) + Time::Time(decltype(nullptr) n) { } - StringComparer::StringComparer(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + Time::Time(Plugin::InternalUse iu, int32_t handle) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - StringComparer::StringComparer(const StringComparer& other) - : StringComparer(Plugin::InternalUse::Only, other.Handle) + Time::Time(const Time& other) + : Time(Plugin::InternalUse::Only, other.Handle) { } - StringComparer::StringComparer(StringComparer&& other) - : StringComparer(Plugin::InternalUse::Only, other.Handle) + Time::Time(Time&& other) + : Time(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - StringComparer::~StringComparer() + Time::~Time() { if (Handle) { @@ -6856,7 +9081,7 @@ namespace System } } - StringComparer& StringComparer::operator=(const StringComparer& other) + Time& Time::operator=(const Time& other) { if (this->Handle) { @@ -6870,7 +9095,7 @@ namespace System return *this; } - StringComparer& StringComparer::operator=(decltype(nullptr) other) + Time& Time::operator=(decltype(nullptr) other) { if (Handle) { @@ -6880,7 +9105,7 @@ namespace System return *this; } - StringComparer& StringComparer::operator=(StringComparer&& other) + Time& Time::operator=(Time&& other) { if (Handle) { @@ -6891,26 +9116,35 @@ namespace System return *this; } - bool StringComparer::operator==(const StringComparer& other) const + bool Time::operator==(const Time& other) const { return Handle == other.Handle; } - bool StringComparer::operator!=(const StringComparer& other) const + bool Time::operator!=(const Time& other) const { return Handle != other.Handle; } + + float Time::GetDeltaTime() + { + auto returnValue = Plugin::UnityEngineTimePropertyGetDeltaTime(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } } namespace System { - BaseStringComparer::BaseStringComparer() - : System::StringComparer(nullptr) + Object::Object(System::IO::FileMode val) { - CppHandle = Plugin::StoreSystemBaseStringComparer(this); - int32_t* handle = &Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemBaseStringComparerConstructor(cppHandle, handle); + int32_t handle = Plugin::BoxFileMode(val); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6918,15 +9152,16 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else + if (handle) { - Plugin::RemoveSystemBaseStringComparer(CppHandle); - CppHandle = 0; + Plugin::ReferenceManagedClass(handle); + Handle = handle; } + } + + Object::operator System::IO::FileMode() + { + System::IO::FileMode returnVal(Plugin::UnboxFileMode(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6934,65 +9169,46 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } + return returnVal; } - - BaseStringComparer::BaseStringComparer(decltype(nullptr) n) - : System::StringComparer(Plugin::InternalUse::Only, 0) +} + +namespace System +{ + MarshalByRefObject::MarshalByRefObject(decltype(nullptr) n) { - CppHandle = Plugin::StoreSystemBaseStringComparer(this); } - BaseStringComparer::BaseStringComparer(const BaseStringComparer& other) - : System::StringComparer(Plugin::InternalUse::Only, other.Handle) + MarshalByRefObject::MarshalByRefObject(Plugin::InternalUse iu, int32_t handle) { - CppHandle = Plugin::StoreSystemBaseStringComparer(this); - if (Handle) + Handle = handle; + if (handle) { - Plugin::ReferenceManagedClass(Handle); + Plugin::ReferenceManagedClass(handle); } } - BaseStringComparer::BaseStringComparer(BaseStringComparer&& other) - : System::StringComparer(Plugin::InternalUse::Only, other.Handle) + MarshalByRefObject::MarshalByRefObject(const MarshalByRefObject& other) + : MarshalByRefObject(Plugin::InternalUse::Only, other.Handle) { - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; } - BaseStringComparer::BaseStringComparer(Plugin::InternalUse iu, int32_t handle) - : System::StringComparer(iu, handle) + MarshalByRefObject::MarshalByRefObject(MarshalByRefObject&& other) + : MarshalByRefObject(Plugin::InternalUse::Only, other.Handle) { - CppHandle = Plugin::StoreSystemBaseStringComparer(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } + other.Handle = 0; } - BaseStringComparer::~BaseStringComparer() + MarshalByRefObject::~MarshalByRefObject() { - Plugin::RemoveSystemBaseStringComparer(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; + Plugin::DereferenceManagedClass(Handle); Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemBaseStringComparer(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } } - BaseStringComparer& BaseStringComparer::operator=(const BaseStringComparer& other) + MarshalByRefObject& MarshalByRefObject::operator=(const MarshalByRefObject& other) { if (this->Handle) { @@ -7006,174 +9222,71 @@ namespace System return *this; } - BaseStringComparer& BaseStringComparer::operator=(decltype(nullptr) other) + MarshalByRefObject& MarshalByRefObject::operator=(decltype(nullptr) other) { if (Handle) { - int32_t handle = Handle; + Plugin::DereferenceManagedClass(Handle); Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemBaseStringComparer(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } - Handle = 0; return *this; } - BaseStringComparer& BaseStringComparer::operator=(BaseStringComparer&& other) + MarshalByRefObject& MarshalByRefObject::operator=(MarshalByRefObject&& other) { - Plugin::RemoveSystemBaseStringComparer(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemBaseStringComparer(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool BaseStringComparer::operator==(const BaseStringComparer& other) const + bool MarshalByRefObject::operator==(const MarshalByRefObject& other) const { return Handle == other.Handle; } - bool BaseStringComparer::operator!=(const BaseStringComparer& other) const + bool MarshalByRefObject::operator!=(const MarshalByRefObject& other) const { return Handle != other.Handle; } - - int32_t BaseStringComparer::Compare(System::String& x, System::String& y) - { - return {}; - } - - DLLEXPORT int32_t SystemStringComparerCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) - { - try - { - auto x = System::String(Plugin::InternalUse::Only, xHandle); - auto y = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemBaseStringComparer(cppHandle)->Compare(x, y); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::StringComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } - - System::Boolean BaseStringComparer::Equals(System::String& x, System::String& y) - { - return {}; - } - - DLLEXPORT int32_t SystemStringComparerEquals(int32_t cppHandle, int32_t xHandle, int32_t yHandle) - { - try - { - auto x = System::String(Plugin::InternalUse::Only, xHandle); - auto y = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemBaseStringComparer(cppHandle)->Equals(x, y); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::StringComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } - - int32_t BaseStringComparer::GetHashCode(System::String& obj) - { - return {}; - } - - DLLEXPORT int32_t SystemStringComparerGetHashCode(int32_t cppHandle, int32_t objHandle) - { - try - { - auto obj = System::String(Plugin::InternalUse::Only, objHandle); - return Plugin::GetSystemBaseStringComparer(cppHandle)->GetHashCode(obj); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::StringComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } } namespace System { - namespace Collections + namespace IO { - ICollection::ICollection(decltype(nullptr) n) - : ICollection(Plugin::InternalUse::Only, 0) + Stream::Stream(decltype(nullptr) n) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) { } - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + Stream::Stream(Plugin::InternalUse iu, int32_t handle) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) + Stream::Stream(const Stream& other) + : Stream(Plugin::InternalUse::Only, other.Handle) { } - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) + Stream::Stream(Stream&& other) + : Stream(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - ICollection::~ICollection() + Stream::~Stream() { if (Handle) { @@ -7182,7 +9295,7 @@ namespace System } } - ICollection& ICollection::operator=(const ICollection& other) + Stream& Stream::operator=(const Stream& other) { if (this->Handle) { @@ -7196,7 +9309,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(decltype(nullptr) other) + Stream& Stream::operator=(decltype(nullptr) other) { if (Handle) { @@ -7206,7 +9319,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(ICollection&& other) + Stream& Stream::operator=(Stream&& other) { if (Handle) { @@ -7217,12 +9330,12 @@ namespace System return *this; } - bool ICollection::operator==(const ICollection& other) const + bool Stream::operator==(const Stream& other) const { return Handle == other.Handle; } - bool ICollection::operator!=(const ICollection& other) const + bool Stream::operator!=(const Stream& other) const { return Handle != other.Handle; } @@ -7233,371 +9346,368 @@ namespace System { namespace Collections { - BaseICollection::BaseICollection() - : System::Collections::ICollection(nullptr) + namespace Generic { - CppHandle = Plugin::StoreSystemCollectionsBaseICollection(this); - int32_t* handle = &Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsBaseICollectionConstructor(cppHandle, handle); - if (Plugin::unhandledCsharpException) + IComparer::IComparer(decltype(nullptr) n) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } - if (Handle) + + IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) { - Plugin::ReferenceManagedClass(Handle); + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - else + + IComparer::IComparer(const IComparer& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) { - Plugin::RemoveSystemCollectionsBaseICollection(CppHandle); - CppHandle = 0; } - if (Plugin::unhandledCsharpException) + + IComparer::IComparer(IComparer&& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + other.Handle = 0; } - } - - BaseICollection::BaseICollection(decltype(nullptr) n) - : System::Collections::ICollection(Plugin::InternalUse::Only, 0) - { - CppHandle = Plugin::StoreSystemCollectionsBaseICollection(this); - } - - BaseICollection::BaseICollection(const BaseICollection& other) - : System::Collections::ICollection(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = Plugin::StoreSystemCollectionsBaseICollection(this); - if (Handle) + + IComparer::~IComparer() { - Plugin::ReferenceManagedClass(Handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - } - - BaseICollection::BaseICollection(BaseICollection&& other) - : System::Collections::ICollection(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - BaseICollection::BaseICollection(Plugin::InternalUse iu, int32_t handle) - : System::Collections::ICollection(iu, handle) - { - CppHandle = Plugin::StoreSystemCollectionsBaseICollection(this); - if (Handle) + + IComparer& IComparer::operator=(const IComparer& other) { - Plugin::ReferenceManagedClass(Handle); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - } - - BaseICollection::~BaseICollection() - { - Plugin::RemoveSystemCollectionsBaseICollection(CppHandle); - CppHandle = 0; - if (Handle) + + IComparer& IComparer::operator=(decltype(nullptr) other) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + if (Handle) { - Plugin::ReleaseSystemCollectionsBaseICollection(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } + return *this; } - } - - BaseICollection& BaseICollection::operator=(const BaseICollection& other) - { - if (this->Handle) + + IComparer& IComparer::operator=(IComparer&& other) { - Plugin::DereferenceManagedClass(this->Handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - this->Handle = other.Handle; - if (this->Handle) + + bool IComparer::operator==(const IComparer& other) const { - Plugin::ReferenceManagedClass(this->Handle); + return Handle == other.Handle; } - return *this; - } - - BaseICollection& BaseICollection::operator=(decltype(nullptr) other) - { - if (Handle) + + bool IComparer::operator!=(const IComparer& other) const { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsBaseICollection(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + return Handle != other.Handle; } - Handle = 0; - return *this; } - - BaseICollection& BaseICollection::operator=(BaseICollection&& other) + } +} + +namespace System +{ + namespace Collections + { + namespace Generic { - Plugin::RemoveSystemCollectionsBaseICollection(CppHandle); - CppHandle = 0; - if (Handle) + IComparer::IComparer(decltype(nullptr) n) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsBaseICollection(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool BaseICollection::operator==(const BaseICollection& other) const - { - return Handle == other.Handle; - } - - bool BaseICollection::operator!=(const BaseICollection& other) const - { - return Handle != other.Handle; - } - - void BaseICollection::CopyTo(System::Array& array, int32_t index) - { - } - - DLLEXPORT void SystemCollectionsICollectionCopyTo(int32_t cppHandle, int32_t arrayHandle, int32_t index) - { - try + + IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) { - auto array = System::Array(Plugin::InternalUse::Only, arrayHandle); - Plugin::GetSystemCollectionsBaseICollection(cppHandle)->CopyTo(array, index); + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - catch (System::Exception ex) + + IComparer::IComparer(const IComparer& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) { - Plugin::SetException(ex.Handle); } - catch (...) + + IComparer::IComparer(IComparer&& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) { - System::String msg = "Unhandled exception invoking System::Collections::ICollection"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); + other.Handle = 0; } - } - - System::Collections::IEnumerator BaseICollection::GetEnumerator() - { - return nullptr; - } - - DLLEXPORT int32_t SystemCollectionsICollectionGetEnumerator(int32_t cppHandle) - { - try + + IComparer::~IComparer() { - return Plugin::GetSystemCollectionsBaseICollection(cppHandle)->GetEnumerator().Handle; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - catch (System::Exception ex) + + IComparer& IComparer::operator=(const IComparer& other) { - Plugin::SetException(ex.Handle); - return {}; + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - catch (...) + + IComparer& IComparer::operator=(decltype(nullptr) other) { - System::String msg = "Unhandled exception invoking System::Collections::ICollection"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - } - - int32_t BaseICollection::GetCount() - { - return {}; - } - - DLLEXPORT int32_t SystemCollectionsICollectionGetCount(int32_t cppHandle) - { - try + + IComparer& IComparer::operator=(IComparer&& other) { - return Plugin::GetSystemCollectionsBaseICollection(cppHandle)->GetCount(); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - catch (System::Exception ex) + + bool IComparer::operator==(const IComparer& other) const { - Plugin::SetException(ex.Handle); - return {}; + return Handle == other.Handle; } - catch (...) + + bool IComparer::operator!=(const IComparer& other) const { - System::String msg = "Unhandled exception invoking System::Collections::ICollection"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + return Handle != other.Handle; } } - - System::Boolean BaseICollection::GetIsSynchronized() - { - return {}; - } - - DLLEXPORT int32_t SystemCollectionsICollectionGetIsSynchronized(int32_t cppHandle) + } +} + +namespace System +{ + namespace Collections + { + namespace Generic { - try + BaseIComparer::BaseIComparer() + : System::Collections::Generic::IComparer(nullptr) { - return Plugin::GetSystemCollectionsBaseICollection(cppHandle)->GetIsSynchronized(); + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemCollectionsGenericBaseIComparerSystemInt32Constructor(cppHandle, handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - catch (System::Exception ex) + + BaseIComparer::BaseIComparer(decltype(nullptr) n) + : System::Collections::Generic::IComparer(nullptr) { - Plugin::SetException(ex.Handle); - return {}; + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); } - catch (...) + + BaseIComparer::BaseIComparer(const BaseIComparer& other) + : System::Collections::Generic::IComparer(nullptr) { - System::String msg = "Unhandled exception invoking System::Collections::ICollection"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + Handle = other.Handle; + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } - } - - System::Object BaseICollection::GetSyncRoot() - { - return nullptr; - } - - DLLEXPORT int32_t SystemCollectionsICollectionGetSyncRoot(int32_t cppHandle) - { - try + + BaseIComparer::BaseIComparer(BaseIComparer&& other) + : System::Collections::Generic::IComparer(nullptr) { - return Plugin::GetSystemCollectionsBaseICollection(cppHandle)->GetSyncRoot().Handle; + Handle = other.Handle; + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; } - catch (System::Exception ex) + + BaseIComparer::BaseIComparer(Plugin::InternalUse iu, int32_t handle) + : System::Collections::Generic::IComparer(nullptr) { - Plugin::SetException(ex.Handle); - return {}; + Handle = handle; + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } - catch (...) + + BaseIComparer::~BaseIComparer() { - System::String msg = "Unhandled exception invoking System::Collections::ICollection"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } } - } - } -} - -namespace System -{ - namespace Collections - { - IList::IList(decltype(nullptr) n) - : IList(Plugin::InternalUse::Only, 0) - { - } - - IList::IList(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) - { - if (handle) + + BaseIComparer& BaseIComparer::operator=(const BaseIComparer& other) { - Plugin::ReferenceManagedClass(handle); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - } - - IList::IList(const IList& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - } - - IList::IList(IList&& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IList::~IList() - { - if (Handle) + + BaseIComparer& BaseIComparer::operator=(decltype(nullptr) other) { - Plugin::DereferenceManagedClass(Handle); + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } Handle = 0; + return *this; } - } - - IList& IList::operator=(const IList& other) - { - if (this->Handle) + + BaseIComparer& BaseIComparer::operator=(BaseIComparer&& other) { - Plugin::DereferenceManagedClass(this->Handle); + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - this->Handle = other.Handle; - if (this->Handle) + + bool BaseIComparer::operator==(const BaseIComparer& other) const { - Plugin::ReferenceManagedClass(this->Handle); + return Handle == other.Handle; } - return *this; - } - - IList& IList::operator=(decltype(nullptr) other) - { - if (Handle) + + bool BaseIComparer::operator!=(const BaseIComparer& other) const { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + return Handle != other.Handle; } - return *this; - } - - IList& IList::operator=(IList&& other) - { - if (Handle) + + int32_t BaseIComparer::Compare(int32_t x, int32_t y) { - Plugin::DereferenceManagedClass(Handle); + return {}; + } + + DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemInt32Compare(int32_t cppHandle, int32_t x, int32_t y) + { + try + { + return Plugin::GetSystemCollectionsGenericBaseIComparerSystemInt32(cppHandle)->Compare(x, y); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IList::operator==(const IList& other) const - { - return Handle == other.Handle; - } - - bool IList::operator!=(const IList& other) const - { - return Handle != other.Handle; } } } @@ -7606,552 +9716,550 @@ namespace System { namespace Collections { - BaseIList::BaseIList() - : System::Collections::IList(nullptr) + namespace Generic { - CppHandle = Plugin::StoreSystemCollectionsBaseIList(this); - int32_t* handle = &Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsBaseIListConstructor(cppHandle, handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) + BaseIComparer::BaseIComparer() + : System::Collections::Generic::IComparer(nullptr) { - Plugin::ReferenceManagedClass(Handle); + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemCollectionsGenericBaseIComparerSystemStringConstructor(cppHandle, handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - else + + BaseIComparer::BaseIComparer(decltype(nullptr) n) + : System::Collections::Generic::IComparer(nullptr) { - Plugin::RemoveSystemCollectionsBaseIList(CppHandle); - CppHandle = 0; + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); } - if (Plugin::unhandledCsharpException) + + BaseIComparer::BaseIComparer(const BaseIComparer& other) + : System::Collections::Generic::IComparer(nullptr) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Handle = other.Handle; + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } - } - - BaseIList::BaseIList(decltype(nullptr) n) - : System::Collections::IList(Plugin::InternalUse::Only, 0) - { - CppHandle = Plugin::StoreSystemCollectionsBaseIList(this); - } - - BaseIList::BaseIList(const BaseIList& other) - : System::Collections::IList(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = Plugin::StoreSystemCollectionsBaseIList(this); - if (Handle) + + BaseIComparer::BaseIComparer(BaseIComparer&& other) + : System::Collections::Generic::IComparer(nullptr) { - Plugin::ReferenceManagedClass(Handle); + Handle = other.Handle; + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; } - } - - BaseIList::BaseIList(BaseIList&& other) - : System::Collections::IList(Plugin::InternalUse::Only, other.Handle) - { - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - BaseIList::BaseIList(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IList(iu, handle) - { - CppHandle = Plugin::StoreSystemCollectionsBaseIList(this); - if (Handle) + + BaseIComparer::BaseIComparer(Plugin::InternalUse iu, int32_t handle) + : System::Collections::Generic::IComparer(nullptr) { - Plugin::ReferenceManagedClass(Handle); + Handle = handle; + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } - } - - BaseIList::~BaseIList() - { - Plugin::RemoveSystemCollectionsBaseIList(CppHandle); - CppHandle = 0; - if (Handle) + + BaseIComparer::~BaseIComparer() { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); + CppHandle = 0; + if (Handle) { - Plugin::ReleaseSystemCollectionsBaseIList(handle); - if (Plugin::unhandledCsharpException) + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } } - } - - BaseIList& BaseIList::operator=(const BaseIList& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - BaseIList& BaseIList::operator=(decltype(nullptr) other) - { - if (Handle) + + BaseIComparer& BaseIComparer::operator=(const BaseIComparer& other) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + if (this->Handle) { - Plugin::ReleaseSystemCollectionsBaseIList(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } - Handle = 0; - return *this; - } - - BaseIList& BaseIList::operator=(BaseIList&& other) - { - Plugin::RemoveSystemCollectionsBaseIList(CppHandle); - CppHandle = 0; - if (Handle) + + BaseIComparer& BaseIComparer::operator=(decltype(nullptr) other) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + if (Handle) { - Plugin::ReleaseSystemCollectionsBaseIList(handle); - if (Plugin::unhandledCsharpException) + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } + Handle = 0; + return *this; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool BaseIList::operator==(const BaseIList& other) const - { - return Handle == other.Handle; - } - - bool BaseIList::operator!=(const BaseIList& other) const - { - return Handle != other.Handle; - } - - int32_t BaseIList::Add(System::Object& value) - { - return {}; - } - - DLLEXPORT int32_t SystemCollectionsIListAdd(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::Object(Plugin::InternalUse::Only, valueHandle); - return Plugin::GetSystemCollectionsBaseIList(cppHandle)->Add(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } - - void BaseIList::Clear() - { - } - - DLLEXPORT void SystemCollectionsIListClear(int32_t cppHandle) - { - try - { - Plugin::GetSystemCollectionsBaseIList(cppHandle)->Clear(); - } - catch (System::Exception ex) + + BaseIComparer& BaseIComparer::operator=(BaseIComparer&& other) { - Plugin::SetException(ex.Handle); + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - catch (...) + + bool BaseIComparer::operator==(const BaseIComparer& other) const { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); + return Handle == other.Handle; } - } - - System::Boolean BaseIList::Contains(System::Object& value) - { - return {}; - } - - DLLEXPORT int32_t SystemCollectionsIListContains(int32_t cppHandle, int32_t valueHandle) - { - try + + bool BaseIComparer::operator!=(const BaseIComparer& other) const { - auto value = System::Object(Plugin::InternalUse::Only, valueHandle); - return Plugin::GetSystemCollectionsBaseIList(cppHandle)->Contains(value); + return Handle != other.Handle; } - catch (System::Exception ex) + + int32_t BaseIComparer::Compare(System::String& x, System::String& y) { - Plugin::SetException(ex.Handle); return {}; } - catch (...) + + DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemStringCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + try + { + auto x = System::String(Plugin::InternalUse::Only, xHandle); + auto y = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemCollectionsGenericBaseIComparerSystemString(cppHandle)->Compare(x, y); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } } } - - int32_t BaseIList::IndexOf(System::Object& value) + } +} + +namespace System +{ + StringComparer::StringComparer(decltype(nullptr) n) + : System::Collections::IComparer(nullptr) + , System::Collections::Generic::IComparer(nullptr) + , System::Collections::IEqualityComparer(nullptr) + , System::Collections::Generic::IEqualityComparer(nullptr) + { + } + + StringComparer::StringComparer(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IComparer(nullptr) + , System::Collections::Generic::IComparer(nullptr) + , System::Collections::IEqualityComparer(nullptr) + , System::Collections::Generic::IEqualityComparer(nullptr) + { + Handle = handle; + if (handle) { - return {}; + Plugin::ReferenceManagedClass(handle); } - - DLLEXPORT int32_t SystemCollectionsIListIndexOf(int32_t cppHandle, int32_t valueHandle) + } + + StringComparer::StringComparer(const StringComparer& other) + : StringComparer(Plugin::InternalUse::Only, other.Handle) + { + } + + StringComparer::StringComparer(StringComparer&& other) + : StringComparer(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + StringComparer::~StringComparer() + { + if (Handle) { - try - { - auto value = System::Object(Plugin::InternalUse::Only, valueHandle); - return Plugin::GetSystemCollectionsBaseIList(cppHandle)->IndexOf(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - void BaseIList::Insert(int32_t index, System::Object& value) + } + + StringComparer& StringComparer::operator=(const StringComparer& other) + { + if (this->Handle) { + Plugin::DereferenceManagedClass(this->Handle); } - - DLLEXPORT void SystemCollectionsIListInsert(int32_t cppHandle, int32_t index, int32_t valueHandle) + this->Handle = other.Handle; + if (this->Handle) { - try - { - auto value = System::Object(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemCollectionsBaseIList(cppHandle)->Insert(index, value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } + Plugin::ReferenceManagedClass(this->Handle); } - - void BaseIList::Remove(System::Object& value) + return *this; + } + + StringComparer& StringComparer::operator=(decltype(nullptr) other) + { + if (Handle) { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - DLLEXPORT void SystemCollectionsIListRemove(int32_t cppHandle, int32_t valueHandle) + return *this; + } + + StringComparer& StringComparer::operator=(StringComparer&& other) + { + if (Handle) { - try - { - auto value = System::Object(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemCollectionsBaseIList(cppHandle)->Remove(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } + Plugin::DereferenceManagedClass(Handle); } - - void BaseIList::RemoveAt(int32_t index) + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool StringComparer::operator==(const StringComparer& other) const + { + return Handle == other.Handle; + } + + bool StringComparer::operator!=(const StringComparer& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + BaseStringComparer::BaseStringComparer() + : System::Collections::IComparer(nullptr) + , System::Collections::Generic::IComparer(nullptr) + , System::Collections::IEqualityComparer(nullptr) + , System::Collections::Generic::IEqualityComparer(nullptr) + , System::StringComparer(nullptr) + { + CppHandle = Plugin::StoreSystemBaseStringComparer(this); + int32_t* handle = &Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemBaseStringComparerConstructor(cppHandle, handle); + if (Plugin::unhandledCsharpException) { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - DLLEXPORT void SystemCollectionsIListRemoveAt(int32_t cppHandle, int32_t index) + if (Handle) { - try - { - Plugin::GetSystemCollectionsBaseIList(cppHandle)->RemoveAt(index); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } + Plugin::ReferenceManagedClass(Handle); } - - System::Collections::IEnumerator BaseIList::GetEnumerator() + else { - return nullptr; + Plugin::RemoveSystemBaseStringComparer(CppHandle); + CppHandle = 0; } - - DLLEXPORT int32_t SystemCollectionsIListGetEnumerator(int32_t cppHandle) + if (Plugin::unhandledCsharpException) { - try - { - return Plugin::GetSystemCollectionsBaseIList(cppHandle)->GetEnumerator().Handle; - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - void BaseIList::CopyTo(System::Array& array, int32_t index) + } + + BaseStringComparer::BaseStringComparer(decltype(nullptr) n) + : System::Collections::IComparer(nullptr) + , System::Collections::Generic::IComparer(nullptr) + , System::Collections::IEqualityComparer(nullptr) + , System::Collections::Generic::IEqualityComparer(nullptr) + , System::StringComparer(nullptr) + { + CppHandle = Plugin::StoreSystemBaseStringComparer(this); + } + + BaseStringComparer::BaseStringComparer(const BaseStringComparer& other) + : System::Collections::IComparer(nullptr) + , System::Collections::Generic::IComparer(nullptr) + , System::Collections::IEqualityComparer(nullptr) + , System::Collections::Generic::IEqualityComparer(nullptr) + , System::StringComparer(nullptr) + { + Handle = other.Handle; + CppHandle = Plugin::StoreSystemBaseStringComparer(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + BaseStringComparer::BaseStringComparer(BaseStringComparer&& other) + : System::Collections::IComparer(nullptr) + , System::Collections::Generic::IComparer(nullptr) + , System::Collections::IEqualityComparer(nullptr) + , System::Collections::Generic::IEqualityComparer(nullptr) + , System::StringComparer(nullptr) + { + Handle = other.Handle; + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + BaseStringComparer::BaseStringComparer(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IComparer(nullptr) + , System::Collections::Generic::IComparer(nullptr) + , System::Collections::IEqualityComparer(nullptr) + , System::Collections::Generic::IEqualityComparer(nullptr) + , System::StringComparer(nullptr) + { + Handle = handle; + CppHandle = Plugin::StoreSystemBaseStringComparer(this); + if (Handle) { + Plugin::ReferenceManagedClass(Handle); } - - DLLEXPORT void SystemCollectionsIListCopyTo(int32_t cppHandle, int32_t arrayHandle, int32_t index) + } + + BaseStringComparer::~BaseStringComparer() + { + Plugin::RemoveSystemBaseStringComparer(CppHandle); + CppHandle = 0; + if (Handle) { - try - { - auto array = System::Array(Plugin::InternalUse::Only, arrayHandle); - Plugin::GetSystemCollectionsBaseIList(cppHandle)->CopyTo(array, index); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); + Plugin::ReleaseSystemBaseStringComparer(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } - - System::Boolean BaseIList::GetIsFixedSize() - { - return {}; - } - - DLLEXPORT int32_t SystemCollectionsIListGetIsFixedSize(int32_t cppHandle) + } + + BaseStringComparer& BaseStringComparer::operator=(const BaseStringComparer& other) + { + if (this->Handle) { - try - { - return Plugin::GetSystemCollectionsBaseIList(cppHandle)->GetIsFixedSize(); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } + Plugin::DereferenceManagedClass(this->Handle); } - - System::Boolean BaseIList::GetIsReadOnly() + this->Handle = other.Handle; + if (this->Handle) { - return {}; + Plugin::ReferenceManagedClass(this->Handle); } - - DLLEXPORT int32_t SystemCollectionsIListGetIsReadOnly(int32_t cppHandle) + return *this; + } + + BaseStringComparer& BaseStringComparer::operator=(decltype(nullptr) other) + { + if (Handle) { - try - { - return Plugin::GetSystemCollectionsBaseIList(cppHandle)->GetIsReadOnly(); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + Plugin::ReleaseSystemBaseStringComparer(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } - - System::Object BaseIList::GetItem(int32_t index) - { - return nullptr; - } - - DLLEXPORT int32_t SystemCollectionsIListGetItem(int32_t cppHandle, int32_t index) + Handle = 0; + return *this; + } + + BaseStringComparer& BaseStringComparer::operator=(BaseStringComparer&& other) + { + Plugin::RemoveSystemBaseStringComparer(CppHandle); + CppHandle = 0; + if (Handle) { - try - { - return Plugin::GetSystemCollectionsBaseIList(cppHandle)->GetItem(index).Handle; - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + Plugin::ReleaseSystemBaseStringComparer(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } } - - void BaseIList::SetItem(int32_t index, System::Object& value) + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool BaseStringComparer::operator==(const BaseStringComparer& other) const + { + return Handle == other.Handle; + } + + bool BaseStringComparer::operator!=(const BaseStringComparer& other) const + { + return Handle != other.Handle; + } + + int32_t BaseStringComparer::Compare(System::String& x, System::String& y) + { + return {}; + } + + DLLEXPORT int32_t SystemStringComparerCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + { + try { + auto x = System::String(Plugin::InternalUse::Only, xHandle); + auto y = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemBaseStringComparer(cppHandle)->Compare(x, y); } - - DLLEXPORT void SystemCollectionsIListSetItem(int32_t cppHandle, int32_t index, int32_t valueHandle) + catch (System::Exception ex) { - try - { - auto value = System::Object(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemCollectionsBaseIList(cppHandle)->SetItem(index, value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } + Plugin::SetException(ex.Handle); + return {}; } - - int32_t BaseIList::GetCount() + catch (...) { + System::String msg = "Unhandled exception invoking System::StringComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); return {}; } - - DLLEXPORT int32_t SystemCollectionsIListGetCount(int32_t cppHandle) + } + + System::Boolean BaseStringComparer::Equals(System::String& x, System::String& y) + { + return {}; + } + + DLLEXPORT int32_t SystemStringComparerEquals(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + { + try { - try - { - return Plugin::GetSystemCollectionsBaseIList(cppHandle)->GetCount(); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } + auto x = System::String(Plugin::InternalUse::Only, xHandle); + auto y = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemBaseStringComparer(cppHandle)->Equals(x, y); } - - System::Boolean BaseIList::GetIsSynchronized() + catch (System::Exception ex) { + Plugin::SetException(ex.Handle); return {}; } - - DLLEXPORT int32_t SystemCollectionsIListGetIsSynchronized(int32_t cppHandle) + catch (...) { - try - { - return Plugin::GetSystemCollectionsBaseIList(cppHandle)->GetIsSynchronized(); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } + System::String msg = "Unhandled exception invoking System::StringComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; } - - System::Object BaseIList::GetSyncRoot() + } + + int32_t BaseStringComparer::GetHashCode(System::String& obj) + { + return {}; + } + + DLLEXPORT int32_t SystemStringComparerGetHashCode(int32_t cppHandle, int32_t objHandle) + { + try { - return nullptr; + auto obj = System::String(Plugin::InternalUse::Only, objHandle); + return Plugin::GetSystemBaseStringComparer(cppHandle)->GetHashCode(obj); } - - DLLEXPORT int32_t SystemCollectionsIListGetSyncRoot(int32_t cppHandle) - { - try - { - return Plugin::GetSystemCollectionsBaseIList(cppHandle)->GetSyncRoot().Handle; - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::IList"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::StringComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; } } } @@ -8161,13 +10269,18 @@ namespace System namespace Collections { Queue::Queue(decltype(nullptr) n) - : Queue(Plugin::InternalUse::Only, 0) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) { } Queue::Queue(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -8259,7 +10372,10 @@ namespace System namespace Collections { BaseQueue::BaseQueue() - : System::Collections::Queue(nullptr) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::Queue(nullptr) { CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); int32_t* handle = &Handle; @@ -8291,14 +10407,21 @@ namespace System } BaseQueue::BaseQueue(decltype(nullptr) n) - : System::Collections::Queue(Plugin::InternalUse::Only, 0) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::Queue(nullptr) { CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); } BaseQueue::BaseQueue(const BaseQueue& other) - : System::Collections::Queue(Plugin::InternalUse::Only, other.Handle) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::Queue(nullptr) { + Handle = other.Handle; CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); if (Handle) { @@ -8307,16 +10430,24 @@ namespace System } BaseQueue::BaseQueue(BaseQueue&& other) - : System::Collections::Queue(Plugin::InternalUse::Only, other.Handle) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::Queue(nullptr) { + Handle = other.Handle; CppHandle = other.CppHandle; other.Handle = 0; other.CppHandle = 0; } BaseQueue::BaseQueue(Plugin::InternalUse iu, int32_t handle) - : System::Collections::Queue(iu, handle) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::Queue(nullptr) { + Handle = handle; CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); if (Handle) { @@ -8451,13 +10582,12 @@ namespace System namespace Design { IComponentChangeService::IComponentChangeService(decltype(nullptr) n) - : IComponentChangeService(Plugin::InternalUse::Only, 0) { } IComponentChangeService::IComponentChangeService(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -8539,7 +10669,7 @@ namespace System namespace Design { BaseIComponentChangeService::BaseIComponentChangeService() - : System::ComponentModel::Design::IComponentChangeService(nullptr) + : System::ComponentModel::Design::IComponentChangeService(nullptr) { CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); int32_t* handle = &Handle; @@ -8571,14 +10701,15 @@ namespace System } BaseIComponentChangeService::BaseIComponentChangeService(decltype(nullptr) n) - : System::ComponentModel::Design::IComponentChangeService(Plugin::InternalUse::Only, 0) + : System::ComponentModel::Design::IComponentChangeService(nullptr) { CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); } BaseIComponentChangeService::BaseIComponentChangeService(const BaseIComponentChangeService& other) - : System::ComponentModel::Design::IComponentChangeService(Plugin::InternalUse::Only, other.Handle) + : System::ComponentModel::Design::IComponentChangeService(nullptr) { + Handle = other.Handle; CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); if (Handle) { @@ -8587,16 +10718,18 @@ namespace System } BaseIComponentChangeService::BaseIComponentChangeService(BaseIComponentChangeService&& other) - : System::ComponentModel::Design::IComponentChangeService(Plugin::InternalUse::Only, other.Handle) + : System::ComponentModel::Design::IComponentChangeService(nullptr) { + Handle = other.Handle; CppHandle = other.CppHandle; other.Handle = 0; other.CppHandle = 0; } BaseIComponentChangeService::BaseIComponentChangeService(Plugin::InternalUse iu, int32_t handle) - : System::ComponentModel::Design::IComponentChangeService(iu, handle) + : System::ComponentModel::Design::IComponentChangeService(nullptr) { + Handle = handle; CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); if (Handle) { @@ -9077,13 +11210,18 @@ namespace System namespace IO { FileStream::FileStream(decltype(nullptr) n) - : FileStream(Plugin::InternalUse::Only, 0) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) { } FileStream::FileStream(Plugin::InternalUse iu, int32_t handle) - : System::IO::Stream(iu, handle) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -9156,7 +11294,9 @@ namespace System } FileStream::FileStream(System::String& path, System::IO::FileMode mode) - : System::IO::Stream(nullptr) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) { auto returnValue = Plugin::SystemIOFileStreamConstructorSystemString_SystemIOFileMode(path.Handle, mode); if (Plugin::unhandledCsharpException) @@ -9192,7 +11332,10 @@ namespace System namespace IO { BaseFileStream::BaseFileStream(System::String& path, System::IO::FileMode mode) - : System::IO::FileStream(nullptr) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) + , System::IO::FileStream(nullptr) { CppHandle = Plugin::StoreSystemIOBaseFileStream(this); int32_t* handle = &Handle; @@ -9224,14 +11367,21 @@ namespace System } BaseFileStream::BaseFileStream(decltype(nullptr) n) - : System::IO::FileStream(Plugin::InternalUse::Only, 0) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) + , System::IO::FileStream(nullptr) { CppHandle = Plugin::StoreSystemIOBaseFileStream(this); } BaseFileStream::BaseFileStream(const BaseFileStream& other) - : System::IO::FileStream(Plugin::InternalUse::Only, other.Handle) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) + , System::IO::FileStream(nullptr) { + Handle = other.Handle; CppHandle = Plugin::StoreSystemIOBaseFileStream(this); if (Handle) { @@ -9240,16 +11390,24 @@ namespace System } BaseFileStream::BaseFileStream(BaseFileStream&& other) - : System::IO::FileStream(Plugin::InternalUse::Only, other.Handle) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) + , System::IO::FileStream(nullptr) { + Handle = other.Handle; CppHandle = other.CppHandle; other.Handle = 0; other.CppHandle = 0; } BaseFileStream::BaseFileStream(Plugin::InternalUse iu, int32_t handle) - : System::IO::FileStream(iu, handle) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) + , System::IO::FileStream(nullptr) { + Handle = handle; CppHandle = Plugin::StoreSystemIOBaseFileStream(this); if (Handle) { @@ -9379,13 +11537,14 @@ namespace UnityEngine namespace Playables { PlayableHandle::PlayableHandle(decltype(nullptr) n) - : PlayableHandle(Plugin::InternalUse::Only, 0) + : System::ValueType(nullptr) { } PlayableHandle::PlayableHandle(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(iu, handle) + : System::ValueType(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedUnityEnginePlayablesPlayableHandle(Handle); @@ -9396,323 +11555,74 @@ namespace UnityEngine : PlayableHandle(Plugin::InternalUse::Only, other.Handle) { } - - PlayableHandle::PlayableHandle(PlayableHandle&& other) - : PlayableHandle(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - PlayableHandle::~PlayableHandle() - { - if (Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); - Handle = 0; - } - } - - PlayableHandle& PlayableHandle::operator=(const PlayableHandle& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEnginePlayablesPlayableHandle(Handle); - } - return *this; - } - - PlayableHandle& PlayableHandle::operator=(decltype(nullptr) other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); - Handle = 0; - } - return *this; - } - - PlayableHandle& PlayableHandle::operator=(PlayableHandle&& other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool PlayableHandle::operator==(const PlayableHandle& other) const - { - return Handle == other.Handle; - } - - bool PlayableHandle::operator!=(const PlayableHandle& other) const - { - return Handle != other.Handle; - } - } -} - -namespace System -{ - Object::Object(UnityEngine::Playables::PlayableHandle& val) - { - int32_t handle = Plugin::BoxPlayableHandle(val.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator UnityEngine::Playables::PlayableHandle() - { - UnityEngine::Playables::PlayableHandle returnVal(Plugin::InternalUse::Only, Plugin::UnboxPlayableHandle(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - namespace Playables - { - PlayableGraph::PlayableGraph(decltype(nullptr) n) - : PlayableGraph(Plugin::InternalUse::Only, 0) - { - } - - PlayableGraph::PlayableGraph(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedUnityEnginePlayablesPlayableGraph(Handle); - } - } - - PlayableGraph::PlayableGraph(const PlayableGraph& other) - : PlayableGraph(Plugin::InternalUse::Only, other.Handle) - { - } - - PlayableGraph::PlayableGraph(PlayableGraph&& other) - : PlayableGraph(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - PlayableGraph::~PlayableGraph() - { - if (Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); - Handle = 0; - } - } - - PlayableGraph& PlayableGraph::operator=(const PlayableGraph& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEnginePlayablesPlayableGraph(Handle); - } - return *this; - } - - PlayableGraph& PlayableGraph::operator=(decltype(nullptr) other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); - Handle = 0; - } - return *this; - } - - PlayableGraph& PlayableGraph::operator=(PlayableGraph&& other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool PlayableGraph::operator==(const PlayableGraph& other) const - { - return Handle == other.Handle; - } - - bool PlayableGraph::operator!=(const PlayableGraph& other) const - { - return Handle != other.Handle; - } - } -} - -namespace System -{ - Object::Object(UnityEngine::Playables::PlayableGraph& val) - { - int32_t handle = Plugin::BoxPlayableGraph(val.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator UnityEngine::Playables::PlayableGraph() - { - UnityEngine::Playables::PlayableGraph returnVal(Plugin::InternalUse::Only, Plugin::UnboxPlayableGraph(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - namespace Animations - { - AnimationMixerPlayable::AnimationMixerPlayable(decltype(nullptr) n) - : AnimationMixerPlayable(Plugin::InternalUse::Only, 0) - { - } - - AnimationMixerPlayable::AnimationMixerPlayable(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(iu, handle) - { - if (handle) - { - Plugin::ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); - } - } - - AnimationMixerPlayable::AnimationMixerPlayable(const AnimationMixerPlayable& other) - : AnimationMixerPlayable(Plugin::InternalUse::Only, other.Handle) - { - } - - AnimationMixerPlayable::AnimationMixerPlayable(AnimationMixerPlayable&& other) - : AnimationMixerPlayable(Plugin::InternalUse::Only, other.Handle) + + PlayableHandle::PlayableHandle(PlayableHandle&& other) + : PlayableHandle(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - AnimationMixerPlayable::~AnimationMixerPlayable() + PlayableHandle::~PlayableHandle() { if (Handle) { - Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); Handle = 0; } } - AnimationMixerPlayable& AnimationMixerPlayable::operator=(const AnimationMixerPlayable& other) + PlayableHandle& PlayableHandle::operator=(const PlayableHandle& other) { if (this->Handle) { - Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); } this->Handle = other.Handle; if (this->Handle) { - Plugin::ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + Plugin::ReferenceManagedUnityEnginePlayablesPlayableHandle(Handle); } return *this; } - AnimationMixerPlayable& AnimationMixerPlayable::operator=(decltype(nullptr) other) + PlayableHandle& PlayableHandle::operator=(decltype(nullptr) other) { if (Handle) { - Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); Handle = 0; } return *this; } - AnimationMixerPlayable& AnimationMixerPlayable::operator=(AnimationMixerPlayable&& other) + PlayableHandle& PlayableHandle::operator=(PlayableHandle&& other) { if (Handle) { - Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool AnimationMixerPlayable::operator==(const AnimationMixerPlayable& other) const + bool PlayableHandle::operator==(const PlayableHandle& other) const { return Handle == other.Handle; } - bool AnimationMixerPlayable::operator!=(const AnimationMixerPlayable& other) const + bool PlayableHandle::operator!=(const PlayableHandle& other) const { return Handle != other.Handle; } - - UnityEngine::Animations::AnimationMixerPlayable AnimationMixerPlayable::Create(UnityEngine::Playables::PlayableGraph& graph, int32_t inputCount, System::Boolean normalizeWeights) - { - auto returnValue = Plugin::UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean(graph.Handle, inputCount, normalizeWeights); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Animations::AnimationMixerPlayable(Plugin::InternalUse::Only, returnValue); - } } } namespace System { - Object::Object(UnityEngine::Animations::AnimationMixerPlayable& val) + Object::Object(UnityEngine::Playables::PlayableHandle& val) { - int32_t handle = Plugin::BoxAnimationMixerPlayable(val.Handle); + int32_t handle = Plugin::BoxPlayableHandle(val.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9727,9 +11637,9 @@ namespace System } } - Object::operator UnityEngine::Animations::AnimationMixerPlayable() + Object::operator UnityEngine::Playables::PlayableHandle() { - UnityEngine::Animations::AnimationMixerPlayable returnVal(Plugin::InternalUse::Only, Plugin::UnboxAnimationMixerPlayable(Handle)); + UnityEngine::Playables::PlayableHandle returnVal(Plugin::InternalUse::Only, Plugin::UnboxPlayableHandle(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9748,13 +11658,14 @@ namespace UnityEngine namespace UIElements { CallbackEventHandler::CallbackEventHandler(decltype(nullptr) n) - : CallbackEventHandler(Plugin::InternalUse::Only, 0) + : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) { } CallbackEventHandler::CallbackEventHandler(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) + : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -9836,13 +11747,18 @@ namespace UnityEngine namespace UIElements { VisualElement::VisualElement(decltype(nullptr) n) - : VisualElement(Plugin::InternalUse::Only, 0) + : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) + , UnityEngine::Experimental::UIElements::CallbackEventHandler(nullptr) + , UnityEngine::Experimental::UIElements::IStyle(nullptr) { } VisualElement::VisualElement(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::Experimental::UIElements::CallbackEventHandler(iu, handle) + : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) + , UnityEngine::Experimental::UIElements::CallbackEventHandler(nullptr) + , UnityEngine::Experimental::UIElements::IStyle(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -10027,13 +11943,14 @@ namespace UnityEngine namespace Input { InteractionSourcePose::InteractionSourcePose(decltype(nullptr) n) - : InteractionSourcePose(Plugin::InternalUse::Only, 0) + : System::ValueType(nullptr) { } InteractionSourcePose::InteractionSourcePose(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(iu, handle) + : System::ValueType(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); @@ -10556,13 +12473,20 @@ namespace MyGame namespace MonoBehaviours { TestScript::TestScript(decltype(nullptr) n) - : TestScript(Plugin::InternalUse::Only, 0) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) + , UnityEngine::MonoBehaviour(nullptr) { } TestScript::TestScript(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::MonoBehaviour(iu, handle) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) + , UnityEngine::MonoBehaviour(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -10641,13 +12565,20 @@ namespace MyGame namespace MonoBehaviours { AnotherScript::AnotherScript(decltype(nullptr) n) - : AnotherScript(Plugin::InternalUse::Only, 0) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) + , UnityEngine::MonoBehaviour(nullptr) { } AnotherScript::AnotherScript(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::MonoBehaviour(iu, handle) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) + , UnityEngine::MonoBehaviour(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -10758,14 +12689,29 @@ namespace Plugin namespace System { Array1::Array1(decltype(nullptr) n) - : Array1(Plugin::InternalUse::Only, 0) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { this->InternalLength = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) - : System::Array(iu, handle) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -10845,7 +12791,14 @@ namespace System } Array1::Array1(int32_t length0) - : System::Array(nullptr) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { auto returnValue = Plugin::SystemSystemInt32Array1Constructor1(length0); if (Plugin::unhandledCsharpException) @@ -11036,14 +12989,29 @@ namespace Plugin namespace System { Array1::Array1(decltype(nullptr) n) - : Array1(Plugin::InternalUse::Only, 0) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { this->InternalLength = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) - : System::Array(iu, handle) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -11123,7 +13091,14 @@ namespace System } Array1::Array1(int32_t length0) - : System::Array(nullptr) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { auto returnValue = Plugin::SystemSystemSingleArray1Constructor1(length0); if (Plugin::unhandledCsharpException) @@ -11166,7 +13141,11 @@ namespace System namespace System { Array2::Array2(decltype(nullptr) n) - : Array2(Plugin::InternalUse::Only, 0) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) { this->InternalLength = 0; this->InternalLengths[0] = 0; @@ -11174,8 +13153,13 @@ namespace System } Array2::Array2(Plugin::InternalUse iu, int32_t handle) - : System::Array(iu, handle) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -11269,7 +13253,11 @@ namespace System } Array2::Array2(int32_t length0, int32_t length1) - : System::Array(nullptr) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) { auto returnValue = Plugin::SystemSystemSingleArray2Constructor2(length0, length1); if (Plugin::unhandledCsharpException) @@ -11334,7 +13322,11 @@ namespace System namespace System { Array3::Array3(decltype(nullptr) n) - : Array3(Plugin::InternalUse::Only, 0) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) { this->InternalLength = 0; this->InternalLengths[0] = 0; @@ -11343,8 +13335,13 @@ namespace System } Array3::Array3(Plugin::InternalUse iu, int32_t handle) - : System::Array(iu, handle) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -11445,7 +13442,11 @@ namespace System } Array3::Array3(int32_t length0, int32_t length1, int32_t length2) - : System::Array(nullptr) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) { auto returnValue = Plugin::SystemSystemSingleArray3Constructor3(length0, length1, length2); if (Plugin::unhandledCsharpException) @@ -11545,14 +13546,29 @@ namespace Plugin namespace System { Array1::Array1(decltype(nullptr) n) - : Array1(Plugin::InternalUse::Only, 0) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { this->InternalLength = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) - : System::Array(iu, handle) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -11632,7 +13648,14 @@ namespace System } Array1::Array1(int32_t length0) - : System::Array(nullptr) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { auto returnValue = Plugin::SystemSystemStringArray1Constructor1(length0); if (Plugin::unhandledCsharpException) @@ -11709,14 +13732,29 @@ namespace Plugin namespace System { Array1::Array1(decltype(nullptr) n) - : Array1(Plugin::InternalUse::Only, 0) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { this->InternalLength = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) - : System::Array(iu, handle) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -11796,7 +13834,14 @@ namespace System } Array1::Array1(int32_t length0) - : System::Array(nullptr) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { auto returnValue = Plugin::UnityEngineUnityEngineResolutionArray1Constructor1(length0); if (Plugin::unhandledCsharpException) @@ -11873,14 +13918,29 @@ namespace Plugin namespace System { Array1::Array1(decltype(nullptr) n) - : Array1(Plugin::InternalUse::Only, 0) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { this->InternalLength = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) - : System::Array(iu, handle) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -11960,7 +14020,14 @@ namespace System } Array1::Array1(int32_t length0) - : System::Array(nullptr) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { auto returnValue = Plugin::UnityEngineUnityEngineRaycastHitArray1Constructor1(length0); if (Plugin::unhandledCsharpException) @@ -12037,14 +14104,29 @@ namespace Plugin namespace System { Array1::Array1(decltype(nullptr) n) - : Array1(Plugin::InternalUse::Only, 0) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { this->InternalLength = 0; } Array1::Array1(Plugin::InternalUse iu, int32_t handle) - : System::Array(iu, handle) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); @@ -12124,7 +14206,14 @@ namespace System } Array1::Array1(int32_t length0) - : System::Array(nullptr) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Array(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { auto returnValue = Plugin::UnityEngineUnityEngineGradientColorKeyArray1Constructor1(length0); if (Plugin::unhandledCsharpException) @@ -12167,7 +14256,6 @@ namespace System namespace System { Action::Action() - : System::Object(nullptr) { CppHandle = Plugin::StoreSystemAction(this); int32_t* handle = &Handle; @@ -12201,15 +14289,14 @@ namespace System } Action::Action(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemAction(this); ClassHandle = 0; } Action::Action(const Action& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = Plugin::StoreSystemAction(this); if (Handle) { @@ -12219,8 +14306,8 @@ namespace System } Action::Action(Action&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = other.CppHandle; ClassHandle = other.ClassHandle; other.Handle = 0; @@ -12229,8 +14316,8 @@ namespace System } Action::Action(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) { + Handle = handle; CppHandle = Plugin::StoreSystemAction(this); if (Handle) { @@ -12404,7 +14491,6 @@ namespace System namespace System { Action1::Action1() - : System::Object(nullptr) { CppHandle = Plugin::StoreSystemActionSystemSingle(this); int32_t* handle = &Handle; @@ -12438,15 +14524,14 @@ namespace System } Action1::Action1(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemActionSystemSingle(this); ClassHandle = 0; } Action1::Action1(const Action1& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = Plugin::StoreSystemActionSystemSingle(this); if (Handle) { @@ -12456,8 +14541,8 @@ namespace System } Action1::Action1(Action1&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = other.CppHandle; ClassHandle = other.ClassHandle; other.Handle = 0; @@ -12466,8 +14551,8 @@ namespace System } Action1::Action1(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) { + Handle = handle; CppHandle = Plugin::StoreSystemActionSystemSingle(this); if (Handle) { @@ -12641,7 +14726,6 @@ namespace System namespace System { Action2::Action2() - : System::Object(nullptr) { CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); int32_t* handle = &Handle; @@ -12675,15 +14759,14 @@ namespace System } Action2::Action2(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); ClassHandle = 0; } Action2::Action2(const Action2& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); if (Handle) { @@ -12693,8 +14776,8 @@ namespace System } Action2::Action2(Action2&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = other.CppHandle; ClassHandle = other.ClassHandle; other.Handle = 0; @@ -12703,8 +14786,8 @@ namespace System } Action2::Action2(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) { + Handle = handle; CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); if (Handle) { @@ -12878,7 +14961,6 @@ namespace System namespace System { Func3::Func3() - : System::Object(nullptr) { CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); int32_t* handle = &Handle; @@ -12912,15 +14994,14 @@ namespace System } Func3::Func3(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); ClassHandle = 0; } Func3::Func3(const Func3& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); if (Handle) { @@ -12930,8 +15011,8 @@ namespace System } Func3::Func3(Func3&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = other.CppHandle; ClassHandle = other.ClassHandle; other.Handle = 0; @@ -12940,8 +15021,8 @@ namespace System } Func3::Func3(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) { + Handle = handle; CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); if (Handle) { @@ -13119,7 +15200,6 @@ namespace System namespace System { Func3::Func3() - : System::Object(nullptr) { CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); int32_t* handle = &Handle; @@ -13153,15 +15233,14 @@ namespace System } Func3::Func3(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); ClassHandle = 0; } Func3::Func3(const Func3& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); if (Handle) { @@ -13171,8 +15250,8 @@ namespace System } Func3::Func3(Func3&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = other.CppHandle; ClassHandle = other.ClassHandle; other.Handle = 0; @@ -13181,8 +15260,8 @@ namespace System } Func3::Func3(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) { + Handle = handle; CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); if (Handle) { @@ -13360,7 +15439,6 @@ namespace System namespace System { AppDomainInitializer::AppDomainInitializer() - : System::Object(nullptr) { CppHandle = Plugin::StoreSystemAppDomainInitializer(this); int32_t* handle = &Handle; @@ -13394,15 +15472,14 @@ namespace System } AppDomainInitializer::AppDomainInitializer(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemAppDomainInitializer(this); ClassHandle = 0; } AppDomainInitializer::AppDomainInitializer(const AppDomainInitializer& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = Plugin::StoreSystemAppDomainInitializer(this); if (Handle) { @@ -13412,8 +15489,8 @@ namespace System } AppDomainInitializer::AppDomainInitializer(AppDomainInitializer&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = other.CppHandle; ClassHandle = other.ClassHandle; other.Handle = 0; @@ -13422,8 +15499,8 @@ namespace System } AppDomainInitializer::AppDomainInitializer(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) { + Handle = handle; CppHandle = Plugin::StoreSystemAppDomainInitializer(this); if (Handle) { @@ -13600,7 +15677,6 @@ namespace UnityEngine namespace Events { UnityAction::UnityAction() - : System::Object(nullptr) { CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); int32_t* handle = &Handle; @@ -13634,15 +15710,14 @@ namespace UnityEngine } UnityAction::UnityAction(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); ClassHandle = 0; } UnityAction::UnityAction(const UnityAction& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); if (Handle) { @@ -13652,8 +15727,8 @@ namespace UnityEngine } UnityAction::UnityAction(UnityAction&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = other.CppHandle; ClassHandle = other.ClassHandle; other.Handle = 0; @@ -13662,8 +15737,8 @@ namespace UnityEngine } UnityAction::UnityAction(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) { + Handle = handle; CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); if (Handle) { @@ -13840,7 +15915,6 @@ namespace UnityEngine namespace Events { UnityAction2::UnityAction2() - : System::Object(nullptr) { CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); int32_t* handle = &Handle; @@ -13874,15 +15948,14 @@ namespace UnityEngine } UnityAction2::UnityAction2(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); ClassHandle = 0; } UnityAction2::UnityAction2(const UnityAction2& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); if (Handle) { @@ -13892,8 +15965,8 @@ namespace UnityEngine } UnityAction2::UnityAction2(UnityAction2&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = other.CppHandle; ClassHandle = other.ClassHandle; other.Handle = 0; @@ -13902,8 +15975,8 @@ namespace UnityEngine } UnityAction2::UnityAction2(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) { + Handle = handle; CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); if (Handle) { @@ -14083,7 +16156,6 @@ namespace System namespace Design { ComponentEventHandler::ComponentEventHandler() - : System::Object(nullptr) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); int32_t* handle = &Handle; @@ -14117,15 +16189,14 @@ namespace System } ComponentEventHandler::ComponentEventHandler(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); ClassHandle = 0; } ComponentEventHandler::ComponentEventHandler(const ComponentEventHandler& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); if (Handle) { @@ -14135,8 +16206,8 @@ namespace System } ComponentEventHandler::ComponentEventHandler(ComponentEventHandler&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = other.CppHandle; ClassHandle = other.ClassHandle; other.Handle = 0; @@ -14145,8 +16216,8 @@ namespace System } ComponentEventHandler::ComponentEventHandler(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) { + Handle = handle; CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); if (Handle) { @@ -14328,7 +16399,6 @@ namespace System namespace Design { ComponentChangingEventHandler::ComponentChangingEventHandler() - : System::Object(nullptr) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); int32_t* handle = &Handle; @@ -14362,15 +16432,14 @@ namespace System } ComponentChangingEventHandler::ComponentChangingEventHandler(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); ClassHandle = 0; } ComponentChangingEventHandler::ComponentChangingEventHandler(const ComponentChangingEventHandler& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); if (Handle) { @@ -14380,8 +16449,8 @@ namespace System } ComponentChangingEventHandler::ComponentChangingEventHandler(ComponentChangingEventHandler&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = other.CppHandle; ClassHandle = other.ClassHandle; other.Handle = 0; @@ -14390,8 +16459,8 @@ namespace System } ComponentChangingEventHandler::ComponentChangingEventHandler(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) { + Handle = handle; CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); if (Handle) { @@ -14573,7 +16642,6 @@ namespace System namespace Design { ComponentChangedEventHandler::ComponentChangedEventHandler() - : System::Object(nullptr) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); int32_t* handle = &Handle; @@ -14607,15 +16675,14 @@ namespace System } ComponentChangedEventHandler::ComponentChangedEventHandler(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); ClassHandle = 0; } ComponentChangedEventHandler::ComponentChangedEventHandler(const ComponentChangedEventHandler& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); if (Handle) { @@ -14625,8 +16692,8 @@ namespace System } ComponentChangedEventHandler::ComponentChangedEventHandler(ComponentChangedEventHandler&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = other.CppHandle; ClassHandle = other.ClassHandle; other.Handle = 0; @@ -14635,8 +16702,8 @@ namespace System } ComponentChangedEventHandler::ComponentChangedEventHandler(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) { + Handle = handle; CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); if (Handle) { @@ -14818,7 +16885,6 @@ namespace System namespace Design { ComponentRenameEventHandler::ComponentRenameEventHandler() - : System::Object(nullptr) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); int32_t* handle = &Handle; @@ -14852,15 +16918,14 @@ namespace System } ComponentRenameEventHandler::ComponentRenameEventHandler(decltype(nullptr) n) - : System::Object(Plugin::InternalUse::Only, 0) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); ClassHandle = 0; } ComponentRenameEventHandler::ComponentRenameEventHandler(const ComponentRenameEventHandler& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); if (Handle) { @@ -14870,8 +16935,8 @@ namespace System } ComponentRenameEventHandler::ComponentRenameEventHandler(ComponentRenameEventHandler&& other) - : System::Object(Plugin::InternalUse::Only, other.Handle) { + Handle = other.Handle; CppHandle = other.CppHandle; ClassHandle = other.ClassHandle; other.Handle = 0; @@ -14880,8 +16945,8 @@ namespace System } ComponentRenameEventHandler::ComponentRenameEventHandler(Plugin::InternalUse iu, int32_t handle) - : System::Object(iu, handle) { + Handle = handle; CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); if (Handle) { @@ -15061,7 +17126,11 @@ namespace System struct NullReferenceExceptionThrower : System::NullReferenceException { NullReferenceExceptionThrower(int32_t handle) - : System::NullReferenceException(Plugin::InternalUse::Only, handle) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + , System::Exception(nullptr) + , System::SystemException(nullptr) + , System::NullReferenceException(Plugin::InternalUse::Only, handle) { } @@ -15098,23 +17167,56 @@ DLLEXPORT void Init( void (*setException)(int32_t handle), int32_t (*arrayGetLength)(int32_t handle), /*BEGIN INIT PARAMS*/ - int32_t (*systemDiagnosticsStopwatchConstructor)(), - int64_t (*systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle), - void (*systemDiagnosticsStopwatchMethodStart)(int32_t thisHandle), - void (*systemDiagnosticsStopwatchMethodReset)(int32_t thisHandle), + UnityEngine::Vector3 (*unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z), + float (*unityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz), + void (*unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ), + UnityEngine::Vector3 (*unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b), + UnityEngine::Vector3 (*unityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a), + int32_t (*boxVector3)(UnityEngine::Vector3& val), + UnityEngine::Vector3 (*unboxVector3)(int32_t valHandle), int32_t (*unityEngineObjectPropertyGetName)(int32_t thisHandle), void (*unityEngineObjectPropertySetName)(int32_t thisHandle, int32_t valueHandle), System::Boolean (*unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject)(int32_t xHandle, int32_t yHandle), System::Boolean (*unityEngineObjectMethodop_ImplicitUnityEngineObject)(int32_t existsHandle), + int32_t (*unityEngineComponentPropertyGetTransform)(int32_t thisHandle), + UnityEngine::Vector3 (*unityEngineTransformPropertyGetPosition)(int32_t thisHandle), + void (*unityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value), + int32_t (*boxColor)(UnityEngine::Color& val), + UnityEngine::Color (*unboxColor)(int32_t valHandle), + int32_t (*boxGradientColorKey)(UnityEngine::GradientColorKey& val), + UnityEngine::GradientColorKey (*unboxGradientColorKey)(int32_t valHandle), + void (*releaseUnityEngineResolution)(int32_t handle), + int32_t (*unityEngineResolutionPropertyGetWidth)(int32_t thisHandle), + void (*unityEngineResolutionPropertySetWidth)(int32_t thisHandle, int32_t value), + int32_t (*unityEngineResolutionPropertyGetHeight)(int32_t thisHandle), + void (*unityEngineResolutionPropertySetHeight)(int32_t thisHandle, int32_t value), + int32_t (*unityEngineResolutionPropertyGetRefreshRate)(int32_t thisHandle), + void (*unityEngineResolutionPropertySetRefreshRate)(int32_t thisHandle, int32_t value), + int32_t (*boxResolution)(int32_t valHandle), + int32_t (*unboxResolution)(int32_t valHandle), + void (*releaseUnityEngineRaycastHit)(int32_t handle), + UnityEngine::Vector3 (*unityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle), + void (*unityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value), + int32_t (*unityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle), + int32_t (*boxRaycastHit)(int32_t valHandle), + int32_t (*unboxRaycastHit)(int32_t valHandle), + void (*releaseUnityEnginePlayablesPlayableGraph)(int32_t handle), + int32_t (*boxPlayableGraph)(int32_t valHandle), + int32_t (*unboxPlayableGraph)(int32_t valHandle), + void (*releaseUnityEngineAnimationsAnimationMixerPlayable)(int32_t handle), + int32_t (*unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)(int32_t graphHandle, int32_t inputCount, System::Boolean normalizeWeights), + int32_t (*boxAnimationMixerPlayable)(int32_t valHandle), + int32_t (*unboxAnimationMixerPlayable)(int32_t valHandle), + int32_t (*systemDiagnosticsStopwatchConstructor)(), + int64_t (*systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle), + void (*systemDiagnosticsStopwatchMethodStart)(int32_t thisHandle), + void (*systemDiagnosticsStopwatchMethodReset)(int32_t thisHandle), int32_t (*unityEngineGameObjectConstructor)(), int32_t (*unityEngineGameObjectConstructorSystemString)(int32_t nameHandle), int32_t (*unityEngineGameObjectPropertyGetTransform)(int32_t thisHandle), int32_t (*unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle), int32_t (*unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript)(int32_t thisHandle), int32_t (*unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)(UnityEngine::PrimitiveType type), - int32_t (*unityEngineComponentPropertyGetTransform)(int32_t thisHandle), - UnityEngine::Vector3 (*unityEngineTransformPropertyGetPosition)(int32_t thisHandle), - void (*unityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value), void (*unityEngineDebugMethodLogSystemObject)(int32_t messageHandle), System::Boolean (*unityEngineAssertionsAssertFieldGetRaiseExceptions)(), void (*unityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value), @@ -15124,25 +17226,12 @@ DLLEXPORT void Init( void (*unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)(int32_t* bufferLength, int32_t* numBuffers), void (*unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)(int32_t hostId, int32_t* addressHandle, int32_t* port, uint8_t* error), void (*unityEngineNetworkingNetworkTransportMethodInit)(), - UnityEngine::Vector3 (*unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z), - float (*unityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz), - void (*unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ), - UnityEngine::Vector3 (*unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b), - UnityEngine::Vector3 (*unityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a), - int32_t (*boxVector3)(UnityEngine::Vector3& val), - UnityEngine::Vector3 (*unboxVector3)(int32_t valHandle), int32_t (*boxQuaternion)(UnityEngine::Quaternion& val), UnityEngine::Quaternion (*unboxQuaternion)(int32_t valHandle), float (*unityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column), void (*unityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value), int32_t (*boxMatrix4x4)(UnityEngine::Matrix4x4& val), UnityEngine::Matrix4x4 (*unboxMatrix4x4)(int32_t valHandle), - void (*releaseUnityEngineRaycastHit)(int32_t handle), - UnityEngine::Vector3 (*unityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle), - void (*unityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value), - int32_t (*unityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle), - int32_t (*boxRaycastHit)(int32_t valHandle), - int32_t (*unboxRaycastHit)(int32_t valHandle), int32_t (*boxQueryTriggerInteraction)(UnityEngine::QueryTriggerInteraction val), UnityEngine::QueryTriggerInteraction (*unboxQueryTriggerInteraction)(int32_t valHandle), void (*releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)(int32_t handle), @@ -15168,15 +17257,6 @@ DLLEXPORT void Init( int32_t (*systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)(int32_t thisHandle), void (*systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)(int32_t thisHandle, int32_t valueHandle), int32_t (*systemExceptionConstructorSystemString)(int32_t messageHandle), - void (*releaseUnityEngineResolution)(int32_t handle), - int32_t (*unityEngineResolutionPropertyGetWidth)(int32_t thisHandle), - void (*unityEngineResolutionPropertySetWidth)(int32_t thisHandle, int32_t value), - int32_t (*unityEngineResolutionPropertyGetHeight)(int32_t thisHandle), - void (*unityEngineResolutionPropertySetHeight)(int32_t thisHandle, int32_t value), - int32_t (*unityEngineResolutionPropertyGetRefreshRate)(int32_t thisHandle), - void (*unityEngineResolutionPropertySetRefreshRate)(int32_t thisHandle, int32_t value), - int32_t (*boxResolution)(int32_t valHandle), - int32_t (*unboxResolution)(int32_t valHandle), int32_t (*unityEngineScreenPropertyGetResolutions)(), void (*releaseUnityEngineRay)(int32_t handle), int32_t (*unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction), @@ -15184,10 +17264,6 @@ DLLEXPORT void Init( int32_t (*unboxRay)(int32_t valHandle), int32_t (*unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1)(int32_t rayHandle, int32_t resultsHandle), int32_t (*unityEnginePhysicsMethodRaycastAllUnityEngineRay)(int32_t rayHandle), - int32_t (*boxColor)(UnityEngine::Color& val), - UnityEngine::Color (*unboxColor)(int32_t valHandle), - int32_t (*boxGradientColorKey)(UnityEngine::GradientColorKey& val), - UnityEngine::GradientColorKey (*unboxGradientColorKey)(int32_t valHandle), int32_t (*unityEngineGradientConstructor)(), int32_t (*unityEngineGradientPropertyGetColorKeys)(int32_t thisHandle), void (*unityEngineGradientPropertySetColorKeys)(int32_t thisHandle, int32_t valueHandle), @@ -15216,10 +17292,6 @@ DLLEXPORT void Init( void (*systemCollectionsGenericBaseIComparerSystemStringConstructor)(int32_t cppHandle, int32_t* handle), void (*releaseSystemBaseStringComparer)(int32_t handle), void (*systemBaseStringComparerConstructor)(int32_t cppHandle, int32_t* handle), - void (*releaseSystemCollectionsBaseICollection)(int32_t handle), - void (*systemCollectionsBaseICollectionConstructor)(int32_t cppHandle, int32_t* handle), - void (*releaseSystemCollectionsBaseIList)(int32_t handle), - void (*systemCollectionsBaseIListConstructor)(int32_t cppHandle, int32_t* handle), int32_t (*systemCollectionsQueuePropertyGetCount)(int32_t thisHandle), void (*releaseSystemCollectionsBaseQueue)(int32_t handle), void (*systemCollectionsBaseQueueConstructor)(int32_t cppHandle, int32_t* handle), @@ -15232,13 +17304,6 @@ DLLEXPORT void Init( void (*releaseUnityEnginePlayablesPlayableHandle)(int32_t handle), int32_t (*boxPlayableHandle)(int32_t valHandle), int32_t (*unboxPlayableHandle)(int32_t valHandle), - void (*releaseUnityEnginePlayablesPlayableGraph)(int32_t handle), - int32_t (*boxPlayableGraph)(int32_t valHandle), - int32_t (*unboxPlayableGraph)(int32_t valHandle), - void (*releaseUnityEngineAnimationsAnimationMixerPlayable)(int32_t handle), - int32_t (*unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)(int32_t graphHandle, int32_t inputCount, System::Boolean normalizeWeights), - int32_t (*boxAnimationMixerPlayable)(int32_t valHandle), - int32_t (*unboxAnimationMixerPlayable)(int32_t valHandle), int32_t (*unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1)(int32_t eHandle, int32_t nameHandle, int32_t classesHandle), int32_t (*unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString)(int32_t eHandle, int32_t nameHandle, int32_t classNameHandle), int32_t (*boxInteractionSourcePositionAccuracy)(UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy val), @@ -15373,23 +17438,60 @@ DLLEXPORT void Init( Plugin::SetException = setException; Plugin::ArrayGetLength = arrayGetLength; /*BEGIN INIT BODY*/ - Plugin::SystemDiagnosticsStopwatchConstructor = systemDiagnosticsStopwatchConstructor; - Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds = systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds; - Plugin::SystemDiagnosticsStopwatchMethodStart = systemDiagnosticsStopwatchMethodStart; - Plugin::SystemDiagnosticsStopwatchMethodReset = systemDiagnosticsStopwatchMethodReset; + Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle = unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle; + Plugin::UnityEngineVector3PropertyGetMagnitude = unityEngineVector3PropertyGetMagnitude; + Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle = unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle; + Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3 = unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3; + Plugin::UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3 = unityEngineVector3Methodop_UnaryNegationUnityEngineVector3; + Plugin::BoxVector3 = boxVector3; + Plugin::UnboxVector3 = unboxVector3; Plugin::UnityEngineObjectPropertyGetName = unityEngineObjectPropertyGetName; Plugin::UnityEngineObjectPropertySetName = unityEngineObjectPropertySetName; Plugin::UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject = unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject; Plugin::UnityEngineObjectMethodop_ImplicitUnityEngineObject = unityEngineObjectMethodop_ImplicitUnityEngineObject; + Plugin::UnityEngineComponentPropertyGetTransform = unityEngineComponentPropertyGetTransform; + Plugin::UnityEngineTransformPropertyGetPosition = unityEngineTransformPropertyGetPosition; + Plugin::UnityEngineTransformPropertySetPosition = unityEngineTransformPropertySetPosition; + Plugin::BoxColor = boxColor; + Plugin::UnboxColor = unboxColor; + Plugin::BoxGradientColorKey = boxGradientColorKey; + Plugin::UnboxGradientColorKey = unboxGradientColorKey; + Plugin::ReleaseUnityEngineResolution = releaseUnityEngineResolution; + Plugin::RefCountsUnityEngineResolution = new int32_t[maxManagedObjects](); + Plugin::UnityEngineResolutionPropertyGetWidth = unityEngineResolutionPropertyGetWidth; + Plugin::UnityEngineResolutionPropertySetWidth = unityEngineResolutionPropertySetWidth; + Plugin::UnityEngineResolutionPropertyGetHeight = unityEngineResolutionPropertyGetHeight; + Plugin::UnityEngineResolutionPropertySetHeight = unityEngineResolutionPropertySetHeight; + Plugin::UnityEngineResolutionPropertyGetRefreshRate = unityEngineResolutionPropertyGetRefreshRate; + Plugin::UnityEngineResolutionPropertySetRefreshRate = unityEngineResolutionPropertySetRefreshRate; + Plugin::BoxResolution = boxResolution; + Plugin::UnboxResolution = unboxResolution; + Plugin::ReleaseUnityEngineRaycastHit = releaseUnityEngineRaycastHit; + Plugin::RefCountsUnityEngineRaycastHit = new int32_t[1000](); + Plugin::UnityEngineRaycastHitPropertyGetPoint = unityEngineRaycastHitPropertyGetPoint; + Plugin::UnityEngineRaycastHitPropertySetPoint = unityEngineRaycastHitPropertySetPoint; + Plugin::UnityEngineRaycastHitPropertyGetTransform = unityEngineRaycastHitPropertyGetTransform; + Plugin::BoxRaycastHit = boxRaycastHit; + Plugin::UnboxRaycastHit = unboxRaycastHit; + Plugin::ReleaseUnityEnginePlayablesPlayableGraph = releaseUnityEnginePlayablesPlayableGraph; + Plugin::RefCountsUnityEnginePlayablesPlayableGraph = new int32_t[maxManagedObjects](); + Plugin::BoxPlayableGraph = boxPlayableGraph; + Plugin::UnboxPlayableGraph = unboxPlayableGraph; + Plugin::ReleaseUnityEngineAnimationsAnimationMixerPlayable = releaseUnityEngineAnimationsAnimationMixerPlayable; + Plugin::RefCountsUnityEngineAnimationsAnimationMixerPlayable = new int32_t[maxManagedObjects](); + Plugin::UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean = unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean; + Plugin::BoxAnimationMixerPlayable = boxAnimationMixerPlayable; + Plugin::UnboxAnimationMixerPlayable = unboxAnimationMixerPlayable; + Plugin::SystemDiagnosticsStopwatchConstructor = systemDiagnosticsStopwatchConstructor; + Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds = systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds; + Plugin::SystemDiagnosticsStopwatchMethodStart = systemDiagnosticsStopwatchMethodStart; + Plugin::SystemDiagnosticsStopwatchMethodReset = systemDiagnosticsStopwatchMethodReset; Plugin::UnityEngineGameObjectConstructor = unityEngineGameObjectConstructor; Plugin::UnityEngineGameObjectConstructorSystemString = unityEngineGameObjectConstructorSystemString; Plugin::UnityEngineGameObjectPropertyGetTransform = unityEngineGameObjectPropertyGetTransform; Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript = unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript; Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript = unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript; Plugin::UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType = unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType; - Plugin::UnityEngineComponentPropertyGetTransform = unityEngineComponentPropertyGetTransform; - Plugin::UnityEngineTransformPropertyGetPosition = unityEngineTransformPropertyGetPosition; - Plugin::UnityEngineTransformPropertySetPosition = unityEngineTransformPropertySetPosition; Plugin::UnityEngineDebugMethodLogSystemObject = unityEngineDebugMethodLogSystemObject; Plugin::UnityEngineAssertionsAssertFieldGetRaiseExceptions = unityEngineAssertionsAssertFieldGetRaiseExceptions; Plugin::UnityEngineAssertionsAssertFieldSetRaiseExceptions = unityEngineAssertionsAssertFieldSetRaiseExceptions; @@ -15399,26 +17501,12 @@ DLLEXPORT void Init( Plugin::UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32 = unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32; Plugin::UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte = unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte; Plugin::UnityEngineNetworkingNetworkTransportMethodInit = unityEngineNetworkingNetworkTransportMethodInit; - Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle = unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle; - Plugin::UnityEngineVector3PropertyGetMagnitude = unityEngineVector3PropertyGetMagnitude; - Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle = unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle; - Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3 = unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3; - Plugin::UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3 = unityEngineVector3Methodop_UnaryNegationUnityEngineVector3; - Plugin::BoxVector3 = boxVector3; - Plugin::UnboxVector3 = unboxVector3; Plugin::BoxQuaternion = boxQuaternion; Plugin::UnboxQuaternion = unboxQuaternion; Plugin::UnityEngineMatrix4x4PropertyGetItem = unityEngineMatrix4x4PropertyGetItem; Plugin::UnityEngineMatrix4x4PropertySetItem = unityEngineMatrix4x4PropertySetItem; Plugin::BoxMatrix4x4 = boxMatrix4x4; Plugin::UnboxMatrix4x4 = unboxMatrix4x4; - Plugin::ReleaseUnityEngineRaycastHit = releaseUnityEngineRaycastHit; - Plugin::RefCountsUnityEngineRaycastHit = new int32_t[1000](); - Plugin::UnityEngineRaycastHitPropertyGetPoint = unityEngineRaycastHitPropertyGetPoint; - Plugin::UnityEngineRaycastHitPropertySetPoint = unityEngineRaycastHitPropertySetPoint; - Plugin::UnityEngineRaycastHitPropertyGetTransform = unityEngineRaycastHitPropertyGetTransform; - Plugin::BoxRaycastHit = boxRaycastHit; - Plugin::UnboxRaycastHit = unboxRaycastHit; Plugin::BoxQueryTriggerInteraction = boxQueryTriggerInteraction; Plugin::UnboxQueryTriggerInteraction = unboxQueryTriggerInteraction; Plugin::ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; @@ -15445,16 +17533,6 @@ DLLEXPORT void Init( Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue; Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue; Plugin::SystemExceptionConstructorSystemString = systemExceptionConstructorSystemString; - Plugin::ReleaseUnityEngineResolution = releaseUnityEngineResolution; - Plugin::RefCountsUnityEngineResolution = new int32_t[maxManagedObjects](); - Plugin::UnityEngineResolutionPropertyGetWidth = unityEngineResolutionPropertyGetWidth; - Plugin::UnityEngineResolutionPropertySetWidth = unityEngineResolutionPropertySetWidth; - Plugin::UnityEngineResolutionPropertyGetHeight = unityEngineResolutionPropertyGetHeight; - Plugin::UnityEngineResolutionPropertySetHeight = unityEngineResolutionPropertySetHeight; - Plugin::UnityEngineResolutionPropertyGetRefreshRate = unityEngineResolutionPropertyGetRefreshRate; - Plugin::UnityEngineResolutionPropertySetRefreshRate = unityEngineResolutionPropertySetRefreshRate; - Plugin::BoxResolution = boxResolution; - Plugin::UnboxResolution = unboxResolution; Plugin::UnityEngineScreenPropertyGetResolutions = unityEngineScreenPropertyGetResolutions; Plugin::ReleaseUnityEngineRay = releaseUnityEngineRay; Plugin::RefCountsUnityEngineRay = new int32_t[maxManagedObjects](); @@ -15463,10 +17541,6 @@ DLLEXPORT void Init( Plugin::UnboxRay = unboxRay; Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1 = unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1; Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay = unityEnginePhysicsMethodRaycastAllUnityEngineRay; - Plugin::BoxColor = boxColor; - Plugin::UnboxColor = unboxColor; - Plugin::BoxGradientColorKey = boxGradientColorKey; - Plugin::UnboxGradientColorKey = unboxGradientColorKey; Plugin::UnityEngineGradientConstructor = unityEngineGradientConstructor; Plugin::UnityEngineGradientPropertyGetColorKeys = unityEngineGradientPropertyGetColorKeys; Plugin::UnityEngineGradientPropertySetColorKeys = unityEngineGradientPropertySetColorKeys; @@ -15520,26 +17594,6 @@ DLLEXPORT void Init( NextFreeSystemBaseStringComparer = SystemBaseStringComparerFreeList + 1; Plugin::ReleaseSystemBaseStringComparer = releaseSystemBaseStringComparer; Plugin::SystemBaseStringComparerConstructor = systemBaseStringComparerConstructor; - SystemCollectionsBaseICollectionFreeListSize = maxManagedObjects; - SystemCollectionsBaseICollectionFreeList = new System::Collections::BaseICollection*[SystemCollectionsBaseICollectionFreeListSize]; - for (int32_t i = 0, end = SystemCollectionsBaseICollectionFreeListSize - 1; i < end; ++i) - { - SystemCollectionsBaseICollectionFreeList[i] = (System::Collections::BaseICollection*)(SystemCollectionsBaseICollectionFreeList + i + 1); - } - SystemCollectionsBaseICollectionFreeList[SystemCollectionsBaseICollectionFreeListSize - 1] = nullptr; - NextFreeSystemCollectionsBaseICollection = SystemCollectionsBaseICollectionFreeList + 1; - Plugin::ReleaseSystemCollectionsBaseICollection = releaseSystemCollectionsBaseICollection; - Plugin::SystemCollectionsBaseICollectionConstructor = systemCollectionsBaseICollectionConstructor; - SystemCollectionsBaseIListFreeListSize = maxManagedObjects; - SystemCollectionsBaseIListFreeList = new System::Collections::BaseIList*[SystemCollectionsBaseIListFreeListSize]; - for (int32_t i = 0, end = SystemCollectionsBaseIListFreeListSize - 1; i < end; ++i) - { - SystemCollectionsBaseIListFreeList[i] = (System::Collections::BaseIList*)(SystemCollectionsBaseIListFreeList + i + 1); - } - SystemCollectionsBaseIListFreeList[SystemCollectionsBaseIListFreeListSize - 1] = nullptr; - NextFreeSystemCollectionsBaseIList = SystemCollectionsBaseIListFreeList + 1; - Plugin::ReleaseSystemCollectionsBaseIList = releaseSystemCollectionsBaseIList; - Plugin::SystemCollectionsBaseIListConstructor = systemCollectionsBaseIListConstructor; Plugin::SystemCollectionsQueuePropertyGetCount = systemCollectionsQueuePropertyGetCount; SystemCollectionsBaseQueueFreeListSize = maxManagedObjects; SystemCollectionsBaseQueueFreeList = new System::Collections::BaseQueue*[SystemCollectionsBaseQueueFreeListSize]; @@ -15577,15 +17631,6 @@ DLLEXPORT void Init( Plugin::RefCountsUnityEnginePlayablesPlayableHandle = new int32_t[maxManagedObjects](); Plugin::BoxPlayableHandle = boxPlayableHandle; Plugin::UnboxPlayableHandle = unboxPlayableHandle; - Plugin::ReleaseUnityEnginePlayablesPlayableGraph = releaseUnityEnginePlayablesPlayableGraph; - Plugin::RefCountsUnityEnginePlayablesPlayableGraph = new int32_t[maxManagedObjects](); - Plugin::BoxPlayableGraph = boxPlayableGraph; - Plugin::UnboxPlayableGraph = unboxPlayableGraph; - Plugin::ReleaseUnityEngineAnimationsAnimationMixerPlayable = releaseUnityEngineAnimationsAnimationMixerPlayable; - Plugin::RefCountsUnityEngineAnimationsAnimationMixerPlayable = new int32_t[maxManagedObjects](); - Plugin::UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean = unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean; - Plugin::BoxAnimationMixerPlayable = boxAnimationMixerPlayable; - Plugin::UnboxAnimationMixerPlayable = unboxAnimationMixerPlayable; Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1 = unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1; Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString = unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString; Plugin::BoxInteractionSourcePositionAccuracy = boxInteractionSourcePositionAccuracy; diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 040361b..cf746c0 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -207,115 +207,25 @@ namespace System using Double = double; } -/*BEGIN TYPE DECLARATIONS*/ +/*BEGIN TEMPLATE DECLARATIONS*/ namespace System { - namespace Diagnostics - { - struct Stopwatch; - } -} - -namespace UnityEngine -{ - struct Object; -} - -namespace UnityEngine -{ - struct GameObject; -} - -namespace UnityEngine -{ - struct Component; -} - -namespace UnityEngine -{ - struct Transform; -} - -namespace UnityEngine -{ - struct Debug; -} - -namespace UnityEngine -{ - namespace Assertions + namespace Collections { - namespace Assert + namespace Generic { + template struct IEnumerable; } } } -namespace UnityEngine -{ - struct Collision; -} - -namespace UnityEngine -{ - struct Behaviour; -} - -namespace UnityEngine -{ - struct MonoBehaviour; -} - -namespace UnityEngine -{ - struct AudioSettings; -} - -namespace UnityEngine -{ - namespace Networking - { - struct NetworkTransport; - } -} - -namespace UnityEngine -{ - struct Vector3; -} - -namespace UnityEngine -{ - struct Quaternion; -} - -namespace UnityEngine -{ - struct Matrix4x4; -} - -namespace UnityEngine -{ - struct RaycastHit; -} - -namespace UnityEngine -{ - enum struct QueryTriggerInteraction : int32_t - { - UseGlobal = 0, - Ignore = 1, - Collide = 2 - }; -} - namespace System { namespace Collections { namespace Generic { - template struct KeyValuePair; + template struct ICollection; } } } @@ -326,7 +236,7 @@ namespace System { namespace Generic { - template<> struct KeyValuePair; + template struct IList; } } } @@ -337,20 +247,14 @@ namespace System { namespace Generic { - template struct List; + template struct IEqualityComparer; } } } namespace System { - namespace Collections - { - namespace Generic - { - template<> struct List; - } - } + template struct IEquatable; } namespace System @@ -359,7 +263,7 @@ namespace System { namespace Generic { - template<> struct List; + template struct KeyValuePair; } } } @@ -370,7 +274,7 @@ namespace System { namespace Generic { - template struct LinkedListNode; + template struct List; } } } @@ -381,7 +285,7 @@ namespace System { namespace Generic { - template<> struct LinkedListNode; + template struct LinkedListNode; } } } @@ -399,11 +303,11 @@ namespace System namespace System { - namespace Runtime + namespace Collections { - namespace CompilerServices + namespace ObjectModel { - template<> struct StrongBox; + template struct Collection; } } } @@ -414,7 +318,7 @@ namespace System { namespace ObjectModel { - template struct Collection; + template struct KeyedCollection; } } } @@ -423,9 +327,9 @@ namespace System { namespace Collections { - namespace ObjectModel + namespace Generic { - template<> struct Collection; + template struct IComparer; } } } @@ -434,9 +338,9 @@ namespace System { namespace Collections { - namespace ObjectModel + namespace Generic { - template struct KeyedCollection; + template struct BaseIComparer; } } } @@ -445,232 +349,334 @@ namespace System { namespace Collections { - namespace ObjectModel + namespace Generic { - template<> struct KeyedCollection; + template struct BaseIComparer; } } } namespace System { - struct Exception; + template struct Action1; } namespace System { - struct SystemException; + template struct Action2; } namespace System { - struct NullReferenceException; + template struct Func3; } -namespace UnityEngine +namespace System { - struct Resolution; + template struct Func3; } namespace UnityEngine { - struct Screen; + namespace Events + { + template struct UnityAction2; + } } +/*END TEMPLATE DECLARATIONS*/ -namespace UnityEngine +/*BEGIN TYPE DECLARATIONS*/ +namespace System { - struct Ray; + struct IDisposable; } namespace UnityEngine { - struct Physics; + struct Vector3; } namespace UnityEngine { - struct Color; + struct Object; } namespace UnityEngine { - struct GradientColorKey; + struct Component; } namespace UnityEngine { - struct Gradient; + struct Transform; } -namespace System +namespace UnityEngine { - struct AppDomainSetup; + struct Color; } namespace UnityEngine { - struct Application; + struct GradientColorKey; } namespace UnityEngine { - namespace SceneManagement - { - struct SceneManager; - } + struct Resolution; } namespace UnityEngine { - namespace SceneManagement + struct RaycastHit; +} + +namespace System +{ + namespace Runtime { - struct Scene; + namespace Serialization + { + struct ISerializable; + } } } -namespace UnityEngine +namespace System { - namespace SceneManagement + namespace Runtime { - enum struct LoadSceneMode : int32_t + namespace InteropServices { - Single = 0, - Additive = 1 - }; + struct _Exception; + } } } +namespace System +{ + struct IAppDomainSetup; +} + namespace System { namespace Collections { - struct IEnumerator; + struct IComparer; } } namespace System { - struct EventArgs; + namespace Collections + { + struct IEqualityComparer; + } } -namespace System +namespace UnityEngine { - namespace ComponentModel + namespace Playables { - namespace Design - { - struct ComponentEventArgs; - } + struct PlayableGraph; + } +} + +namespace UnityEngine +{ + namespace Playables + { + struct IPlayable; + } +} + +namespace UnityEngine +{ + namespace Animations + { + struct AnimationMixerPlayable; } } namespace System { - namespace ComponentModel + namespace Runtime { - namespace Design + namespace CompilerServices { - struct ComponentChangingEventArgs; + struct IStrongBox; } } } -namespace System +namespace UnityEngine { - namespace ComponentModel + namespace Experimental { - namespace Design + namespace UIElements { - struct ComponentChangedEventArgs; + struct IEventHandler; } } } -namespace System +namespace UnityEngine { - namespace ComponentModel + namespace Experimental { - namespace Design + namespace UIElements { - struct ComponentRenameEventArgs; + struct IStyle; } } } namespace System { - namespace ComponentModel + namespace Diagnostics { - struct MemberDescriptor; + struct Stopwatch; } } namespace UnityEngine { - enum struct PrimitiveType : int32_t - { - Sphere = 0, - Capsule = 1, - Cylinder = 2, - Cube = 3, - Plane = 4, - Quad = 5 - }; + struct GameObject; } namespace UnityEngine { - struct Time; + struct Debug; } -namespace System +namespace UnityEngine { - namespace IO + namespace Assertions { - enum struct FileMode : int32_t + namespace Assert { - CreateNew = 1, - Create = 2, - Open = 3, - OpenOrCreate = 4, - Truncate = 5, - Append = 6 - }; + } + } +} + +namespace UnityEngine +{ + struct Collision; +} + +namespace UnityEngine +{ + struct Behaviour; +} + +namespace UnityEngine +{ + struct MonoBehaviour; +} + +namespace UnityEngine +{ + struct AudioSettings; +} + +namespace UnityEngine +{ + namespace Networking + { + struct NetworkTransport; } } +namespace UnityEngine +{ + struct Quaternion; +} + +namespace UnityEngine +{ + struct Matrix4x4; +} + +namespace UnityEngine +{ + enum struct QueryTriggerInteraction : int32_t + { + UseGlobal = 0, + Ignore = 1, + Collide = 2 + }; +} + namespace System { - struct MarshalByRefObject; + struct Exception; } namespace System { - namespace IO + struct SystemException; +} + +namespace System +{ + struct NullReferenceException; +} + +namespace UnityEngine +{ + struct Screen; +} + +namespace UnityEngine +{ + struct Ray; +} + +namespace UnityEngine +{ + struct Physics; +} + +namespace UnityEngine +{ + struct Gradient; +} + +namespace System +{ + struct AppDomainSetup; +} + +namespace UnityEngine +{ + struct Application; +} + +namespace UnityEngine +{ + namespace SceneManagement { - struct Stream; + struct SceneManager; } } -namespace System +namespace UnityEngine { - namespace Collections + namespace SceneManagement { - namespace Generic - { - template struct IComparer; - } + struct Scene; } } -namespace System +namespace UnityEngine { - namespace Collections + namespace SceneManagement { - namespace Generic + enum struct LoadSceneMode : int32_t { - template<> struct IComparer; - } + Single = 0, + Additive = 1 + }; } } @@ -678,97 +684,122 @@ namespace System { namespace Collections { - namespace Generic - { - template<> struct IComparer; - } + struct IEnumerator; } } namespace System { - namespace Collections + struct EventArgs; +} + +namespace System +{ + namespace ComponentModel { - namespace Generic + namespace Design { - template struct BaseIComparer; + struct ComponentEventArgs; } } } namespace System { - namespace Collections + namespace ComponentModel { - namespace Generic + namespace Design { - template struct BaseIComparer; + struct ComponentChangingEventArgs; } } } namespace System { - namespace Collections + namespace ComponentModel { - namespace Generic + namespace Design { - template<> struct BaseIComparer; + struct ComponentChangedEventArgs; } } } namespace System { - namespace Collections + namespace ComponentModel { - namespace Generic + namespace Design { - template<> struct BaseIComparer; + struct ComponentRenameEventArgs; } } } namespace System { - struct StringComparer; + namespace ComponentModel + { + struct MemberDescriptor; + } } -namespace System +namespace UnityEngine { - struct BaseStringComparer; + enum struct PrimitiveType : int32_t + { + Sphere = 0, + Capsule = 1, + Cylinder = 2, + Cube = 3, + Plane = 4, + Quad = 5 + }; +} + +namespace UnityEngine +{ + struct Time; } namespace System { - namespace Collections + namespace IO { - struct ICollection; + enum struct FileMode : int32_t + { + CreateNew = 1, + Create = 2, + Open = 3, + OpenOrCreate = 4, + Truncate = 5, + Append = 6 + }; } } namespace System { - namespace Collections - { - struct BaseICollection; - } + struct MarshalByRefObject; } namespace System { - namespace Collections + namespace IO { - struct IList; + struct Stream; } } namespace System { - namespace Collections - { - struct BaseIList; - } + struct StringComparer; +} + +namespace System +{ + struct BaseStringComparer; } namespace System @@ -833,22 +864,6 @@ namespace UnityEngine } } -namespace UnityEngine -{ - namespace Playables - { - struct PlayableGraph; - } -} - -namespace UnityEngine -{ - namespace Animations - { - struct AnimationMixerPlayable; - } -} - namespace UnityEngine { namespace Experimental @@ -951,229 +966,550 @@ namespace MyGame } } -namespace Plugin +namespace System { - template<> struct ArrayElementProxy1_1; + struct Action; } namespace System { - template<> struct Array1; + struct AppDomainInitializer; } -namespace Plugin +namespace UnityEngine { - template<> struct ArrayElementProxy1_1; + namespace Events + { + struct UnityAction; + } } -namespace Plugin +namespace System { - template<> struct ArrayElementProxy1_2; + namespace ComponentModel + { + namespace Design + { + struct ComponentEventHandler; + } + } } -namespace Plugin +namespace System { - template<> struct ArrayElementProxy2_2; -} - -namespace Plugin + namespace ComponentModel + { + namespace Design + { + struct ComponentChangingEventHandler; + } + } +} + +namespace System { - template<> struct ArrayElementProxy1_3; + namespace ComponentModel + { + namespace Design + { + struct ComponentChangedEventHandler; + } + } } -namespace Plugin +namespace System { - template<> struct ArrayElementProxy2_3; + namespace ComponentModel + { + namespace Design + { + struct ComponentRenameEventHandler; + } + } } +/*END TYPE DECLARATIONS*/ -namespace Plugin +/*BEGIN TEMPLATE SPECIALIZATION DECLARATIONS*/ +namespace System { - template<> struct ArrayElementProxy3_3; + namespace Collections + { + namespace Generic + { + template<> struct IEnumerable; + } + } } namespace System { - template<> struct Array1; + namespace Collections + { + namespace Generic + { + template<> struct IEnumerable; + } + } } namespace System { - template<> struct Array2; + namespace Collections + { + namespace Generic + { + template<> struct IEnumerable; + } + } } namespace System { - template<> struct Array3; + namespace Collections + { + namespace Generic + { + template<> struct IEnumerable; + } + } } -namespace Plugin +namespace System { - template<> struct ArrayElementProxy1_1; + namespace Collections + { + namespace Generic + { + template<> struct IEnumerable; + } + } } namespace System { - template<> struct Array1; + namespace Collections + { + namespace Generic + { + template<> struct IEnumerable; + } + } } -namespace Plugin +namespace System { - template<> struct ArrayElementProxy1_1; + namespace Collections + { + namespace Generic + { + template<> struct ICollection; + } + } } namespace System { - template<> struct Array1; + namespace Collections + { + namespace Generic + { + template<> struct ICollection; + } + } } -namespace Plugin +namespace System { - template<> struct ArrayElementProxy1_1; + namespace Collections + { + namespace Generic + { + template<> struct ICollection; + } + } } namespace System { - template<> struct Array1; + namespace Collections + { + namespace Generic + { + template<> struct ICollection; + } + } } -namespace Plugin +namespace System { - template<> struct ArrayElementProxy1_1; + namespace Collections + { + namespace Generic + { + template<> struct ICollection; + } + } } namespace System { - template<> struct Array1; + namespace Collections + { + namespace Generic + { + template<> struct ICollection; + } + } } namespace System { - struct Action; + namespace Collections + { + namespace Generic + { + template<> struct IList; + } + } } namespace System { - template struct Action1; + namespace Collections + { + namespace Generic + { + template<> struct IList; + } + } } namespace System { - template<> struct Action1; + namespace Collections + { + namespace Generic + { + template<> struct IList; + } + } } namespace System { - template struct Action2; + namespace Collections + { + namespace Generic + { + template<> struct IList; + } + } } namespace System { - template<> struct Action2; + namespace Collections + { + namespace Generic + { + template<> struct IList; + } + } } namespace System { - template struct Func3; + namespace Collections + { + namespace Generic + { + template<> struct IList; + } + } } namespace System { - template struct Func3; + namespace Collections + { + namespace Generic + { + template<> struct IEqualityComparer; + } + } } namespace System { - template<> struct Func3; + namespace Collections + { + namespace Generic + { + template<> struct IEqualityComparer; + } + } } namespace System { - template<> struct Func3; + template<> struct IEquatable; } namespace System { - struct AppDomainInitializer; + namespace Collections + { + namespace Generic + { + template<> struct KeyValuePair; + } + } } -namespace UnityEngine +namespace System { - namespace Events + namespace Collections { - struct UnityAction; + namespace Generic + { + template<> struct List; + } } } -namespace UnityEngine +namespace System { - namespace Events + namespace Collections { - template struct UnityAction2; + namespace Generic + { + template<> struct List; + } } } -namespace UnityEngine +namespace System { - namespace Events + namespace Collections { - template<> struct UnityAction2; + namespace Generic + { + template<> struct LinkedListNode; + } } } namespace System { - namespace ComponentModel + namespace Runtime { - namespace Design + namespace CompilerServices { - struct ComponentEventHandler; + template<> struct StrongBox; } } } namespace System { - namespace ComponentModel + namespace Collections { - namespace Design + namespace ObjectModel { - struct ComponentChangingEventHandler; + template<> struct Collection; } } } namespace System { - namespace ComponentModel + namespace Collections { - namespace Design + namespace ObjectModel { - struct ComponentChangedEventHandler; + template<> struct KeyedCollection; } } } namespace System { - namespace ComponentModel + namespace Collections { - namespace Design + namespace Generic { - struct ComponentRenameEventHandler; + template<> struct IComparer; } } } -/*END TYPE DECLARATIONS*/ -//////////////////////////////////////////////////////////////// -// C# type definitions -//////////////////////////////////////////////////////////////// +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IComparer; + } + } +} namespace System { - struct Object + namespace Collections + { + namespace Generic + { + template<> struct BaseIComparer; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct BaseIComparer; + } + } +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_1; +} + +namespace System +{ + template<> struct Array1; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_1; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_2; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy2_2; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_3; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy2_3; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy3_3; +} + +namespace System +{ + template<> struct Array1; +} + +namespace System +{ + template<> struct Array2; +} + +namespace System +{ + template<> struct Array3; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_1; +} + +namespace System +{ + template<> struct Array1; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_1; +} + +namespace System +{ + template<> struct Array1; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_1; +} + +namespace System +{ + template<> struct Array1; +} + +namespace Plugin +{ + template<> struct ArrayElementProxy1_1; +} + +namespace System +{ + template<> struct Array1; +} + +namespace System +{ + template<> struct Action1; +} + +namespace System +{ + template<> struct Action2; +} + +namespace System +{ + template<> struct Func3; +} + +namespace System +{ + template<> struct Func3; +} + +namespace UnityEngine +{ + namespace Events + { + template<> struct UnityAction2; + } +} +/*END TEMPLATE SPECIALIZATION DECLARATIONS*/ + +//////////////////////////////////////////////////////////////// +// C# type definitions +//////////////////////////////////////////////////////////////// + +namespace System +{ + struct Object { int32_t Handle; + Object(); Object(Plugin::InternalUse iu, int32_t handle); Object(decltype(nullptr) n); virtual ~Object() = default; @@ -1184,24 +1520,28 @@ namespace System /*BEGIN BOXING METHOD DECLARATIONS*/ Object(UnityEngine::Vector3& val); explicit operator UnityEngine::Vector3(); + Object(UnityEngine::Color& val); + explicit operator UnityEngine::Color(); + Object(UnityEngine::GradientColorKey& val); + explicit operator UnityEngine::GradientColorKey(); + Object(UnityEngine::Resolution& val); + explicit operator UnityEngine::Resolution(); + Object(UnityEngine::RaycastHit& val); + explicit operator UnityEngine::RaycastHit(); + Object(UnityEngine::Playables::PlayableGraph& val); + explicit operator UnityEngine::Playables::PlayableGraph(); + Object(UnityEngine::Animations::AnimationMixerPlayable& val); + explicit operator UnityEngine::Animations::AnimationMixerPlayable(); Object(UnityEngine::Quaternion& val); explicit operator UnityEngine::Quaternion(); Object(UnityEngine::Matrix4x4& val); explicit operator UnityEngine::Matrix4x4(); - Object(UnityEngine::RaycastHit& val); - explicit operator UnityEngine::RaycastHit(); Object(UnityEngine::QueryTriggerInteraction val); explicit operator UnityEngine::QueryTriggerInteraction(); Object(System::Collections::Generic::KeyValuePair& val); explicit operator System::Collections::Generic::KeyValuePair(); - Object(UnityEngine::Resolution& val); - explicit operator UnityEngine::Resolution(); Object(UnityEngine::Ray& val); explicit operator UnityEngine::Ray(); - Object(UnityEngine::Color& val); - explicit operator UnityEngine::Color(); - Object(UnityEngine::GradientColorKey& val); - explicit operator UnityEngine::GradientColorKey(); Object(UnityEngine::SceneManagement::Scene& val); explicit operator UnityEngine::SceneManagement::Scene(); Object(UnityEngine::SceneManagement::LoadSceneMode val); @@ -1212,10 +1552,6 @@ namespace System explicit operator System::IO::FileMode(); Object(UnityEngine::Playables::PlayableHandle& val); explicit operator UnityEngine::Playables::PlayableHandle(); - Object(UnityEngine::Playables::PlayableGraph& val); - explicit operator UnityEngine::Playables::PlayableGraph(); - Object(UnityEngine::Animations::AnimationMixerPlayable& val); - explicit operator UnityEngine::Animations::AnimationMixerPlayable(); Object(UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy val); explicit operator UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy(); Object(UnityEngine::XR::WSA::Input::InteractionSourceNode val); @@ -1249,14 +1585,13 @@ namespace System /*END BOXING METHOD DECLARATIONS*/ }; - struct ValueType + struct ValueType : virtual Object { - int32_t Handle; ValueType(Plugin::InternalUse iu, int32_t handle); ValueType(decltype(nullptr) n); }; - struct String : Object + struct String : virtual Object { String(Plugin::InternalUse iu, int32_t handle); String(decltype(nullptr) n); @@ -1269,30 +1604,923 @@ namespace System String(const char* chars); }; - struct Array : Object + struct ICloneable : virtual Object + { + ICloneable(Plugin::InternalUse iu, int32_t handle); + ICloneable(decltype(nullptr) n); + }; + + namespace Collections + { + struct IEnumerable : virtual Object + { + IEnumerable(Plugin::InternalUse iu, int32_t handle); + IEnumerable(decltype(nullptr) n); + }; + + struct ICollection : virtual IEnumerable + { + ICollection(Plugin::InternalUse iu, int32_t handle); + ICollection(decltype(nullptr) n); + }; + + struct IList : virtual ICollection, virtual IEnumerable + { + IList(Plugin::InternalUse iu, int32_t handle); + IList(decltype(nullptr) n); + }; + } + + struct Array : virtual ICloneable, virtual Collections::IList + { + Array(Plugin::InternalUse iu, int32_t handle); + Array(decltype(nullptr) n); + int32_t GetLength(); + int32_t GetRank(); + }; +} + +//////////////////////////////////////////////////////////////// +// Global variables +//////////////////////////////////////////////////////////////// + +namespace Plugin +{ + extern System::String NullString; +} + +/*BEGIN TYPE DEFINITIONS*/ +namespace System +{ + struct IDisposable : virtual System::Object + { + IDisposable(decltype(nullptr) n); + IDisposable(Plugin::InternalUse iu, int32_t handle); + IDisposable(const IDisposable& other); + IDisposable(IDisposable&& other); + virtual ~IDisposable(); + IDisposable& operator=(const IDisposable& other); + IDisposable& operator=(decltype(nullptr) other); + IDisposable& operator=(IDisposable&& other); + bool operator==(const IDisposable& other) const; + bool operator!=(const IDisposable& other) const; + }; +} + +namespace UnityEngine +{ + struct Vector3 + { + Vector3(); + Vector3(float x, float y, float z); + float GetMagnitude(); + float x; + float y; + float z; + void Set(float newX, float newY, float newZ); + UnityEngine::Vector3 operator+(UnityEngine::Vector3& a); + UnityEngine::Vector3 operator-(); + }; +} + +namespace UnityEngine +{ + struct Object : virtual System::Object + { + Object(decltype(nullptr) n); + Object(Plugin::InternalUse iu, int32_t handle); + Object(const Object& other); + Object(Object&& other); + virtual ~Object(); + Object& operator=(const Object& other); + Object& operator=(decltype(nullptr) other); + Object& operator=(Object&& other); + bool operator==(const Object& other) const; + bool operator!=(const Object& other) const; + System::String GetName(); + void SetName(System::String& value); + System::Boolean operator==(UnityEngine::Object& x); + operator System::Boolean(); + }; +} + +namespace UnityEngine +{ + struct Component : virtual UnityEngine::Object + { + Component(decltype(nullptr) n); + Component(Plugin::InternalUse iu, int32_t handle); + Component(const Component& other); + Component(Component&& other); + virtual ~Component(); + Component& operator=(const Component& other); + Component& operator=(decltype(nullptr) other); + Component& operator=(Component&& other); + bool operator==(const Component& other) const; + bool operator!=(const Component& other) const; + UnityEngine::Transform GetTransform(); + }; +} + +namespace UnityEngine +{ + struct Transform : virtual UnityEngine::Component, virtual System::Collections::IEnumerable + { + Transform(decltype(nullptr) n); + Transform(Plugin::InternalUse iu, int32_t handle); + Transform(const Transform& other); + Transform(Transform&& other); + virtual ~Transform(); + Transform& operator=(const Transform& other); + Transform& operator=(decltype(nullptr) other); + Transform& operator=(Transform&& other); + bool operator==(const Transform& other) const; + bool operator!=(const Transform& other) const; + UnityEngine::Vector3 GetPosition(); + void SetPosition(UnityEngine::Vector3& value); + }; +} + +namespace UnityEngine +{ + struct Color + { + Color(); + float r; + float g; + float b; + float a; + }; +} + +namespace UnityEngine +{ + struct GradientColorKey + { + GradientColorKey(); + UnityEngine::Color color; + float time; + }; +} + +namespace UnityEngine +{ + struct Resolution : virtual System::ValueType + { + Resolution(decltype(nullptr) n); + Resolution(Plugin::InternalUse iu, int32_t handle); + Resolution(const Resolution& other); + Resolution(Resolution&& other); + virtual ~Resolution(); + Resolution& operator=(const Resolution& other); + Resolution& operator=(decltype(nullptr) other); + Resolution& operator=(Resolution&& other); + bool operator==(const Resolution& other) const; + bool operator!=(const Resolution& other) const; + int32_t GetWidth(); + void SetWidth(int32_t value); + int32_t GetHeight(); + void SetHeight(int32_t value); + int32_t GetRefreshRate(); + void SetRefreshRate(int32_t value); + }; +} + +namespace UnityEngine +{ + struct RaycastHit : virtual System::ValueType + { + RaycastHit(decltype(nullptr) n); + RaycastHit(Plugin::InternalUse iu, int32_t handle); + RaycastHit(const RaycastHit& other); + RaycastHit(RaycastHit&& other); + virtual ~RaycastHit(); + RaycastHit& operator=(const RaycastHit& other); + RaycastHit& operator=(decltype(nullptr) other); + RaycastHit& operator=(RaycastHit&& other); + bool operator==(const RaycastHit& other) const; + bool operator!=(const RaycastHit& other) const; + UnityEngine::Vector3 GetPoint(); + void SetPoint(UnityEngine::Vector3& value); + UnityEngine::Transform GetTransform(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerable : virtual System::Collections::IEnumerable + { + IEnumerable(decltype(nullptr) n); + IEnumerable(Plugin::InternalUse iu, int32_t handle); + IEnumerable(const IEnumerable& other); + IEnumerable(IEnumerable&& other); + virtual ~IEnumerable(); + IEnumerable& operator=(const IEnumerable& other); + IEnumerable& operator=(decltype(nullptr) other); + IEnumerable& operator=(IEnumerable&& other); + bool operator==(const IEnumerable& other) const; + bool operator!=(const IEnumerable& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerable : virtual System::Collections::IEnumerable + { + IEnumerable(decltype(nullptr) n); + IEnumerable(Plugin::InternalUse iu, int32_t handle); + IEnumerable(const IEnumerable& other); + IEnumerable(IEnumerable&& other); + virtual ~IEnumerable(); + IEnumerable& operator=(const IEnumerable& other); + IEnumerable& operator=(decltype(nullptr) other); + IEnumerable& operator=(IEnumerable&& other); + bool operator==(const IEnumerable& other) const; + bool operator!=(const IEnumerable& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerable : virtual System::Collections::IEnumerable + { + IEnumerable(decltype(nullptr) n); + IEnumerable(Plugin::InternalUse iu, int32_t handle); + IEnumerable(const IEnumerable& other); + IEnumerable(IEnumerable&& other); + virtual ~IEnumerable(); + IEnumerable& operator=(const IEnumerable& other); + IEnumerable& operator=(decltype(nullptr) other); + IEnumerable& operator=(IEnumerable&& other); + bool operator==(const IEnumerable& other) const; + bool operator!=(const IEnumerable& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerable : virtual System::Collections::IEnumerable + { + IEnumerable(decltype(nullptr) n); + IEnumerable(Plugin::InternalUse iu, int32_t handle); + IEnumerable(const IEnumerable& other); + IEnumerable(IEnumerable&& other); + virtual ~IEnumerable(); + IEnumerable& operator=(const IEnumerable& other); + IEnumerable& operator=(decltype(nullptr) other); + IEnumerable& operator=(IEnumerable&& other); + bool operator==(const IEnumerable& other) const; + bool operator!=(const IEnumerable& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerable : virtual System::Collections::IEnumerable + { + IEnumerable(decltype(nullptr) n); + IEnumerable(Plugin::InternalUse iu, int32_t handle); + IEnumerable(const IEnumerable& other); + IEnumerable(IEnumerable&& other); + virtual ~IEnumerable(); + IEnumerable& operator=(const IEnumerable& other); + IEnumerable& operator=(decltype(nullptr) other); + IEnumerable& operator=(IEnumerable&& other); + bool operator==(const IEnumerable& other) const; + bool operator!=(const IEnumerable& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerable : virtual System::Collections::IEnumerable + { + IEnumerable(decltype(nullptr) n); + IEnumerable(Plugin::InternalUse iu, int32_t handle); + IEnumerable(const IEnumerable& other); + IEnumerable(IEnumerable&& other); + virtual ~IEnumerable(); + IEnumerable& operator=(const IEnumerable& other); + IEnumerable& operator=(decltype(nullptr) other); + IEnumerable& operator=(IEnumerable&& other); + bool operator==(const IEnumerable& other) const; + bool operator!=(const IEnumerable& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct ICollection : virtual System::Collections::Generic::IEnumerable + { + ICollection(decltype(nullptr) n); + ICollection(Plugin::InternalUse iu, int32_t handle); + ICollection(const ICollection& other); + ICollection(ICollection&& other); + virtual ~ICollection(); + ICollection& operator=(const ICollection& other); + ICollection& operator=(decltype(nullptr) other); + ICollection& operator=(ICollection&& other); + bool operator==(const ICollection& other) const; + bool operator!=(const ICollection& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct ICollection : virtual System::Collections::Generic::IEnumerable + { + ICollection(decltype(nullptr) n); + ICollection(Plugin::InternalUse iu, int32_t handle); + ICollection(const ICollection& other); + ICollection(ICollection&& other); + virtual ~ICollection(); + ICollection& operator=(const ICollection& other); + ICollection& operator=(decltype(nullptr) other); + ICollection& operator=(ICollection&& other); + bool operator==(const ICollection& other) const; + bool operator!=(const ICollection& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct ICollection : virtual System::Collections::Generic::IEnumerable + { + ICollection(decltype(nullptr) n); + ICollection(Plugin::InternalUse iu, int32_t handle); + ICollection(const ICollection& other); + ICollection(ICollection&& other); + virtual ~ICollection(); + ICollection& operator=(const ICollection& other); + ICollection& operator=(decltype(nullptr) other); + ICollection& operator=(ICollection&& other); + bool operator==(const ICollection& other) const; + bool operator!=(const ICollection& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct ICollection : virtual System::Collections::Generic::IEnumerable + { + ICollection(decltype(nullptr) n); + ICollection(Plugin::InternalUse iu, int32_t handle); + ICollection(const ICollection& other); + ICollection(ICollection&& other); + virtual ~ICollection(); + ICollection& operator=(const ICollection& other); + ICollection& operator=(decltype(nullptr) other); + ICollection& operator=(ICollection&& other); + bool operator==(const ICollection& other) const; + bool operator!=(const ICollection& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct ICollection : virtual System::Collections::Generic::IEnumerable + { + ICollection(decltype(nullptr) n); + ICollection(Plugin::InternalUse iu, int32_t handle); + ICollection(const ICollection& other); + ICollection(ICollection&& other); + virtual ~ICollection(); + ICollection& operator=(const ICollection& other); + ICollection& operator=(decltype(nullptr) other); + ICollection& operator=(ICollection&& other); + bool operator==(const ICollection& other) const; + bool operator!=(const ICollection& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct ICollection : virtual System::Collections::Generic::IEnumerable + { + ICollection(decltype(nullptr) n); + ICollection(Plugin::InternalUse iu, int32_t handle); + ICollection(const ICollection& other); + ICollection(ICollection&& other); + virtual ~ICollection(); + ICollection& operator=(const ICollection& other); + ICollection& operator=(decltype(nullptr) other); + ICollection& operator=(ICollection&& other); + bool operator==(const ICollection& other) const; + bool operator!=(const ICollection& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IList : virtual System::Collections::Generic::ICollection + { + IList(decltype(nullptr) n); + IList(Plugin::InternalUse iu, int32_t handle); + IList(const IList& other); + IList(IList&& other); + virtual ~IList(); + IList& operator=(const IList& other); + IList& operator=(decltype(nullptr) other); + IList& operator=(IList&& other); + bool operator==(const IList& other) const; + bool operator!=(const IList& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IList : virtual System::Collections::Generic::ICollection + { + IList(decltype(nullptr) n); + IList(Plugin::InternalUse iu, int32_t handle); + IList(const IList& other); + IList(IList&& other); + virtual ~IList(); + IList& operator=(const IList& other); + IList& operator=(decltype(nullptr) other); + IList& operator=(IList&& other); + bool operator==(const IList& other) const; + bool operator!=(const IList& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IList : virtual System::Collections::Generic::ICollection + { + IList(decltype(nullptr) n); + IList(Plugin::InternalUse iu, int32_t handle); + IList(const IList& other); + IList(IList&& other); + virtual ~IList(); + IList& operator=(const IList& other); + IList& operator=(decltype(nullptr) other); + IList& operator=(IList&& other); + bool operator==(const IList& other) const; + bool operator!=(const IList& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IList : virtual System::Collections::Generic::ICollection + { + IList(decltype(nullptr) n); + IList(Plugin::InternalUse iu, int32_t handle); + IList(const IList& other); + IList(IList&& other); + virtual ~IList(); + IList& operator=(const IList& other); + IList& operator=(decltype(nullptr) other); + IList& operator=(IList&& other); + bool operator==(const IList& other) const; + bool operator!=(const IList& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IList : virtual System::Collections::Generic::ICollection + { + IList(decltype(nullptr) n); + IList(Plugin::InternalUse iu, int32_t handle); + IList(const IList& other); + IList(IList&& other); + virtual ~IList(); + IList& operator=(const IList& other); + IList& operator=(decltype(nullptr) other); + IList& operator=(IList&& other); + bool operator==(const IList& other) const; + bool operator!=(const IList& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IList : virtual System::Collections::Generic::ICollection + { + IList(decltype(nullptr) n); + IList(Plugin::InternalUse iu, int32_t handle); + IList(const IList& other); + IList(IList&& other); + virtual ~IList(); + IList& operator=(const IList& other); + IList& operator=(decltype(nullptr) other); + IList& operator=(IList&& other); + bool operator==(const IList& other) const; + bool operator!=(const IList& other) const; + }; + } + } +} + +namespace System +{ + namespace Runtime + { + namespace Serialization + { + struct ISerializable : virtual System::Object + { + ISerializable(decltype(nullptr) n); + ISerializable(Plugin::InternalUse iu, int32_t handle); + ISerializable(const ISerializable& other); + ISerializable(ISerializable&& other); + virtual ~ISerializable(); + ISerializable& operator=(const ISerializable& other); + ISerializable& operator=(decltype(nullptr) other); + ISerializable& operator=(ISerializable&& other); + bool operator==(const ISerializable& other) const; + bool operator!=(const ISerializable& other) const; + }; + } + } +} + +namespace System +{ + namespace Runtime + { + namespace InteropServices + { + struct _Exception : virtual System::Object + { + _Exception(decltype(nullptr) n); + _Exception(Plugin::InternalUse iu, int32_t handle); + _Exception(const _Exception& other); + _Exception(_Exception&& other); + virtual ~_Exception(); + _Exception& operator=(const _Exception& other); + _Exception& operator=(decltype(nullptr) other); + _Exception& operator=(_Exception&& other); + bool operator==(const _Exception& other) const; + bool operator!=(const _Exception& other) const; + }; + } + } +} + +namespace System +{ + struct IAppDomainSetup : virtual System::Object + { + IAppDomainSetup(decltype(nullptr) n); + IAppDomainSetup(Plugin::InternalUse iu, int32_t handle); + IAppDomainSetup(const IAppDomainSetup& other); + IAppDomainSetup(IAppDomainSetup&& other); + virtual ~IAppDomainSetup(); + IAppDomainSetup& operator=(const IAppDomainSetup& other); + IAppDomainSetup& operator=(decltype(nullptr) other); + IAppDomainSetup& operator=(IAppDomainSetup&& other); + bool operator==(const IAppDomainSetup& other) const; + bool operator!=(const IAppDomainSetup& other) const; + }; +} + +namespace System +{ + namespace Collections + { + struct IComparer : virtual System::Object + { + IComparer(decltype(nullptr) n); + IComparer(Plugin::InternalUse iu, int32_t handle); + IComparer(const IComparer& other); + IComparer(IComparer&& other); + virtual ~IComparer(); + IComparer& operator=(const IComparer& other); + IComparer& operator=(decltype(nullptr) other); + IComparer& operator=(IComparer&& other); + bool operator==(const IComparer& other) const; + bool operator!=(const IComparer& other) const; + }; + } +} + +namespace System +{ + namespace Collections + { + struct IEqualityComparer : virtual System::Object + { + IEqualityComparer(decltype(nullptr) n); + IEqualityComparer(Plugin::InternalUse iu, int32_t handle); + IEqualityComparer(const IEqualityComparer& other); + IEqualityComparer(IEqualityComparer&& other); + virtual ~IEqualityComparer(); + IEqualityComparer& operator=(const IEqualityComparer& other); + IEqualityComparer& operator=(decltype(nullptr) other); + IEqualityComparer& operator=(IEqualityComparer&& other); + bool operator==(const IEqualityComparer& other) const; + bool operator!=(const IEqualityComparer& other) const; + }; + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEqualityComparer : virtual System::Object + { + IEqualityComparer(decltype(nullptr) n); + IEqualityComparer(Plugin::InternalUse iu, int32_t handle); + IEqualityComparer(const IEqualityComparer& other); + IEqualityComparer(IEqualityComparer&& other); + virtual ~IEqualityComparer(); + IEqualityComparer& operator=(const IEqualityComparer& other); + IEqualityComparer& operator=(decltype(nullptr) other); + IEqualityComparer& operator=(IEqualityComparer&& other); + bool operator==(const IEqualityComparer& other) const; + bool operator!=(const IEqualityComparer& other) const; + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEqualityComparer : virtual System::Object + { + IEqualityComparer(decltype(nullptr) n); + IEqualityComparer(Plugin::InternalUse iu, int32_t handle); + IEqualityComparer(const IEqualityComparer& other); + IEqualityComparer(IEqualityComparer&& other); + virtual ~IEqualityComparer(); + IEqualityComparer& operator=(const IEqualityComparer& other); + IEqualityComparer& operator=(decltype(nullptr) other); + IEqualityComparer& operator=(IEqualityComparer&& other); + bool operator==(const IEqualityComparer& other) const; + bool operator!=(const IEqualityComparer& other) const; + }; + } + } +} + +namespace UnityEngine +{ + namespace Playables + { + struct PlayableGraph : virtual System::ValueType + { + PlayableGraph(decltype(nullptr) n); + PlayableGraph(Plugin::InternalUse iu, int32_t handle); + PlayableGraph(const PlayableGraph& other); + PlayableGraph(PlayableGraph&& other); + virtual ~PlayableGraph(); + PlayableGraph& operator=(const PlayableGraph& other); + PlayableGraph& operator=(decltype(nullptr) other); + PlayableGraph& operator=(PlayableGraph&& other); + bool operator==(const PlayableGraph& other) const; + bool operator!=(const PlayableGraph& other) const; + }; + } +} + +namespace UnityEngine +{ + namespace Playables + { + struct IPlayable : virtual System::Object + { + IPlayable(decltype(nullptr) n); + IPlayable(Plugin::InternalUse iu, int32_t handle); + IPlayable(const IPlayable& other); + IPlayable(IPlayable&& other); + virtual ~IPlayable(); + IPlayable& operator=(const IPlayable& other); + IPlayable& operator=(decltype(nullptr) other); + IPlayable& operator=(IPlayable&& other); + bool operator==(const IPlayable& other) const; + bool operator!=(const IPlayable& other) const; + }; + } +} + +namespace System +{ + template<> struct IEquatable : virtual System::Object + { + IEquatable(decltype(nullptr) n); + IEquatable(Plugin::InternalUse iu, int32_t handle); + IEquatable(const IEquatable& other); + IEquatable(IEquatable&& other); + virtual ~IEquatable(); + IEquatable& operator=(const IEquatable& other); + IEquatable& operator=(decltype(nullptr) other); + IEquatable& operator=(IEquatable&& other); + bool operator==(const IEquatable& other) const; + bool operator!=(const IEquatable& other) const; + }; +} + +namespace UnityEngine +{ + namespace Animations + { + struct AnimationMixerPlayable : virtual System::ValueType, virtual System::IEquatable, virtual UnityEngine::Playables::IPlayable + { + AnimationMixerPlayable(decltype(nullptr) n); + AnimationMixerPlayable(Plugin::InternalUse iu, int32_t handle); + AnimationMixerPlayable(const AnimationMixerPlayable& other); + AnimationMixerPlayable(AnimationMixerPlayable&& other); + virtual ~AnimationMixerPlayable(); + AnimationMixerPlayable& operator=(const AnimationMixerPlayable& other); + AnimationMixerPlayable& operator=(decltype(nullptr) other); + AnimationMixerPlayable& operator=(AnimationMixerPlayable&& other); + bool operator==(const AnimationMixerPlayable& other) const; + bool operator!=(const AnimationMixerPlayable& other) const; + static UnityEngine::Animations::AnimationMixerPlayable Create(UnityEngine::Playables::PlayableGraph& graph, int32_t inputCount = 0, System::Boolean normalizeWeights = false); + }; + } +} + +namespace System +{ + namespace Runtime { - Array(Plugin::InternalUse iu, int32_t handle); - Array(decltype(nullptr) n); - int32_t GetLength(); - int32_t GetRank(); - }; + namespace CompilerServices + { + struct IStrongBox : virtual System::Object + { + IStrongBox(decltype(nullptr) n); + IStrongBox(Plugin::InternalUse iu, int32_t handle); + IStrongBox(const IStrongBox& other); + IStrongBox(IStrongBox&& other); + virtual ~IStrongBox(); + IStrongBox& operator=(const IStrongBox& other); + IStrongBox& operator=(decltype(nullptr) other); + IStrongBox& operator=(IStrongBox&& other); + bool operator==(const IStrongBox& other) const; + bool operator!=(const IStrongBox& other) const; + }; + } + } } -//////////////////////////////////////////////////////////////// -// Global variables -//////////////////////////////////////////////////////////////// +namespace UnityEngine +{ + namespace Experimental + { + namespace UIElements + { + struct IEventHandler : virtual System::Object + { + IEventHandler(decltype(nullptr) n); + IEventHandler(Plugin::InternalUse iu, int32_t handle); + IEventHandler(const IEventHandler& other); + IEventHandler(IEventHandler&& other); + virtual ~IEventHandler(); + IEventHandler& operator=(const IEventHandler& other); + IEventHandler& operator=(decltype(nullptr) other); + IEventHandler& operator=(IEventHandler&& other); + bool operator==(const IEventHandler& other) const; + bool operator!=(const IEventHandler& other) const; + }; + } + } +} -namespace Plugin +namespace UnityEngine { - extern System::String NullString; + namespace Experimental + { + namespace UIElements + { + struct IStyle : virtual System::Object + { + IStyle(decltype(nullptr) n); + IStyle(Plugin::InternalUse iu, int32_t handle); + IStyle(const IStyle& other); + IStyle(IStyle&& other); + virtual ~IStyle(); + IStyle& operator=(const IStyle& other); + IStyle& operator=(decltype(nullptr) other); + IStyle& operator=(IStyle&& other); + bool operator==(const IStyle& other) const; + bool operator!=(const IStyle& other) const; + }; + } + } } -/*BEGIN TYPE DEFINITIONS*/ namespace System { namespace Diagnostics { - struct Stopwatch : System::Object + struct Stopwatch : virtual System::Object { Stopwatch(decltype(nullptr) n); Stopwatch(Plugin::InternalUse iu, int32_t handle); @@ -1314,28 +2542,7 @@ namespace System namespace UnityEngine { - struct Object : System::Object - { - Object(decltype(nullptr) n); - Object(Plugin::InternalUse iu, int32_t handle); - Object(const Object& other); - Object(Object&& other); - virtual ~Object(); - Object& operator=(const Object& other); - Object& operator=(decltype(nullptr) other); - Object& operator=(Object&& other); - bool operator==(const Object& other) const; - bool operator!=(const Object& other) const; - System::String GetName(); - void SetName(System::String& value); - System::Boolean operator==(UnityEngine::Object& x); - operator System::Boolean(); - }; -} - -namespace UnityEngine -{ - struct GameObject : UnityEngine::Object + struct GameObject : virtual UnityEngine::Object { GameObject(decltype(nullptr) n); GameObject(Plugin::InternalUse iu, int32_t handle); @@ -1357,44 +2564,7 @@ namespace UnityEngine namespace UnityEngine { - struct Component : UnityEngine::Object - { - Component(decltype(nullptr) n); - Component(Plugin::InternalUse iu, int32_t handle); - Component(const Component& other); - Component(Component&& other); - virtual ~Component(); - Component& operator=(const Component& other); - Component& operator=(decltype(nullptr) other); - Component& operator=(Component&& other); - bool operator==(const Component& other) const; - bool operator!=(const Component& other) const; - UnityEngine::Transform GetTransform(); - }; -} - -namespace UnityEngine -{ - struct Transform : UnityEngine::Component - { - Transform(decltype(nullptr) n); - Transform(Plugin::InternalUse iu, int32_t handle); - Transform(const Transform& other); - Transform(Transform&& other); - virtual ~Transform(); - Transform& operator=(const Transform& other); - Transform& operator=(decltype(nullptr) other); - Transform& operator=(Transform&& other); - bool operator==(const Transform& other) const; - bool operator!=(const Transform& other) const; - UnityEngine::Vector3 GetPosition(); - void SetPosition(UnityEngine::Vector3& value); - }; -} - -namespace UnityEngine -{ - struct Debug : System::Object + struct Debug : virtual System::Object { Debug(decltype(nullptr) n); Debug(Plugin::InternalUse iu, int32_t handle); @@ -1425,7 +2595,7 @@ namespace UnityEngine namespace UnityEngine { - struct Collision : System::Object + struct Collision : virtual System::Object { Collision(decltype(nullptr) n); Collision(Plugin::InternalUse iu, int32_t handle); @@ -1442,7 +2612,7 @@ namespace UnityEngine namespace UnityEngine { - struct Behaviour : UnityEngine::Component + struct Behaviour : virtual UnityEngine::Component { Behaviour(decltype(nullptr) n); Behaviour(Plugin::InternalUse iu, int32_t handle); @@ -1459,7 +2629,7 @@ namespace UnityEngine namespace UnityEngine { - struct MonoBehaviour : UnityEngine::Behaviour + struct MonoBehaviour : virtual UnityEngine::Behaviour { MonoBehaviour(decltype(nullptr) n); MonoBehaviour(Plugin::InternalUse iu, int32_t handle); @@ -1477,7 +2647,7 @@ namespace UnityEngine namespace UnityEngine { - struct AudioSettings : System::Object + struct AudioSettings : virtual System::Object { AudioSettings(decltype(nullptr) n); AudioSettings(Plugin::InternalUse iu, int32_t handle); @@ -1497,7 +2667,7 @@ namespace UnityEngine { namespace Networking { - struct NetworkTransport : System::Object + struct NetworkTransport : virtual System::Object { NetworkTransport(decltype(nullptr) n); NetworkTransport(Plugin::InternalUse iu, int32_t handle); @@ -1515,22 +2685,6 @@ namespace UnityEngine } } -namespace UnityEngine -{ - struct Vector3 - { - Vector3(); - Vector3(float x, float y, float z); - float GetMagnitude(); - float x; - float y; - float z; - void Set(float newX, float newY, float newZ); - UnityEngine::Vector3 operator+(UnityEngine::Vector3& a); - UnityEngine::Vector3 operator-(); - }; -} - namespace UnityEngine { struct Quaternion @@ -1569,33 +2723,13 @@ namespace UnityEngine }; } -namespace UnityEngine -{ - struct RaycastHit : System::ValueType - { - RaycastHit(decltype(nullptr) n); - RaycastHit(Plugin::InternalUse iu, int32_t handle); - RaycastHit(const RaycastHit& other); - RaycastHit(RaycastHit&& other); - virtual ~RaycastHit(); - RaycastHit& operator=(const RaycastHit& other); - RaycastHit& operator=(decltype(nullptr) other); - RaycastHit& operator=(RaycastHit&& other); - bool operator==(const RaycastHit& other) const; - bool operator!=(const RaycastHit& other) const; - UnityEngine::Vector3 GetPoint(); - void SetPoint(UnityEngine::Vector3& value); - UnityEngine::Transform GetTransform(); - }; -} - namespace System { namespace Collections { namespace Generic { - template<> struct KeyValuePair : System::ValueType + template<> struct KeyValuePair : virtual System::ValueType { KeyValuePair(decltype(nullptr) n); KeyValuePair(Plugin::InternalUse iu, int32_t handle); @@ -1621,7 +2755,7 @@ namespace System { namespace Generic { - template<> struct List : System::Object + template<> struct List : virtual System::Collections::IList, virtual System::Collections::Generic::IList { List(decltype(nullptr) n); List(Plugin::InternalUse iu, int32_t handle); @@ -1649,7 +2783,7 @@ namespace System { namespace Generic { - template<> struct List : System::Object + template<> struct List : virtual System::Collections::IList, virtual System::Collections::Generic::IList { List(decltype(nullptr) n); List(Plugin::InternalUse iu, int32_t handle); @@ -1677,7 +2811,7 @@ namespace System { namespace Generic { - template<> struct LinkedListNode : System::Object + template<> struct LinkedListNode : virtual System::Object { LinkedListNode(decltype(nullptr) n); LinkedListNode(Plugin::InternalUse iu, int32_t handle); @@ -1703,7 +2837,7 @@ namespace System { namespace CompilerServices { - template<> struct StrongBox : System::Object + template<> struct StrongBox : virtual System::Runtime::CompilerServices::IStrongBox { StrongBox(decltype(nullptr) n); StrongBox(Plugin::InternalUse iu, int32_t handle); @@ -1729,7 +2863,7 @@ namespace System { namespace ObjectModel { - template<> struct Collection : System::Object + template<> struct Collection : virtual System::Collections::IList, virtual System::Collections::Generic::IList { Collection(decltype(nullptr) n); Collection(Plugin::InternalUse iu, int32_t handle); @@ -1752,7 +2886,7 @@ namespace System { namespace ObjectModel { - template<> struct KeyedCollection : System::Collections::ObjectModel::Collection + template<> struct KeyedCollection : virtual System::Collections::ObjectModel::Collection, virtual System::Collections::IList, virtual System::Collections::Generic::IList { KeyedCollection(decltype(nullptr) n); KeyedCollection(Plugin::InternalUse iu, int32_t handle); @@ -1771,7 +2905,7 @@ namespace System namespace System { - struct Exception : System::Object + struct Exception : virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable { Exception(decltype(nullptr) n); Exception(Plugin::InternalUse iu, int32_t handle); @@ -1789,7 +2923,7 @@ namespace System namespace System { - struct SystemException : System::Exception + struct SystemException : virtual System::Exception, virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable { SystemException(decltype(nullptr) n); SystemException(Plugin::InternalUse iu, int32_t handle); @@ -1806,7 +2940,7 @@ namespace System namespace System { - struct NullReferenceException : System::SystemException + struct NullReferenceException : virtual System::SystemException, virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable { NullReferenceException(decltype(nullptr) n); NullReferenceException(Plugin::InternalUse iu, int32_t handle); @@ -1823,30 +2957,7 @@ namespace System namespace UnityEngine { - struct Resolution : System::ValueType - { - Resolution(decltype(nullptr) n); - Resolution(Plugin::InternalUse iu, int32_t handle); - Resolution(const Resolution& other); - Resolution(Resolution&& other); - virtual ~Resolution(); - Resolution& operator=(const Resolution& other); - Resolution& operator=(decltype(nullptr) other); - Resolution& operator=(Resolution&& other); - bool operator==(const Resolution& other) const; - bool operator!=(const Resolution& other) const; - int32_t GetWidth(); - void SetWidth(int32_t value); - int32_t GetHeight(); - void SetHeight(int32_t value); - int32_t GetRefreshRate(); - void SetRefreshRate(int32_t value); - }; -} - -namespace UnityEngine -{ - struct Screen : System::Object + struct Screen : virtual System::Object { Screen(decltype(nullptr) n); Screen(Plugin::InternalUse iu, int32_t handle); @@ -1864,7 +2975,7 @@ namespace UnityEngine namespace UnityEngine { - struct Ray : System::ValueType + struct Ray : virtual System::ValueType { Ray(decltype(nullptr) n); Ray(Plugin::InternalUse iu, int32_t handle); @@ -1882,7 +2993,7 @@ namespace UnityEngine namespace UnityEngine { - struct Physics : System::Object + struct Physics : virtual System::Object { Physics(decltype(nullptr) n); Physics(Plugin::InternalUse iu, int32_t handle); @@ -1901,29 +3012,7 @@ namespace UnityEngine namespace UnityEngine { - struct Color - { - Color(); - float r; - float g; - float b; - float a; - }; -} - -namespace UnityEngine -{ - struct GradientColorKey - { - GradientColorKey(); - UnityEngine::Color color; - float time; - }; -} - -namespace UnityEngine -{ - struct Gradient : System::Object + struct Gradient : virtual System::Object { Gradient(decltype(nullptr) n); Gradient(Plugin::InternalUse iu, int32_t handle); @@ -1943,7 +3032,7 @@ namespace UnityEngine namespace System { - struct AppDomainSetup : System::Object + struct AppDomainSetup : virtual System::IAppDomainSetup { AppDomainSetup(decltype(nullptr) n); AppDomainSetup(Plugin::InternalUse iu, int32_t handle); @@ -1963,7 +3052,7 @@ namespace System namespace UnityEngine { - struct Application : System::Object + struct Application : virtual System::Object { Application(decltype(nullptr) n); Application(Plugin::InternalUse iu, int32_t handle); @@ -1984,7 +3073,7 @@ namespace UnityEngine { namespace SceneManagement { - struct SceneManager : System::Object + struct SceneManager : virtual System::Object { SceneManager(decltype(nullptr) n); SceneManager(Plugin::InternalUse iu, int32_t handle); @@ -2006,7 +3095,7 @@ namespace UnityEngine { namespace SceneManagement { - struct Scene : System::ValueType + struct Scene : virtual System::ValueType { Scene(decltype(nullptr) n); Scene(Plugin::InternalUse iu, int32_t handle); @@ -2026,7 +3115,7 @@ namespace System { namespace Collections { - struct IEnumerator : System::Object + struct IEnumerator : virtual System::Object { IEnumerator(decltype(nullptr) n); IEnumerator(Plugin::InternalUse iu, int32_t handle); @@ -2046,7 +3135,7 @@ namespace System namespace System { - struct EventArgs : System::Object + struct EventArgs : virtual System::Object { EventArgs(decltype(nullptr) n); EventArgs(Plugin::InternalUse iu, int32_t handle); @@ -2067,7 +3156,7 @@ namespace System { namespace Design { - struct ComponentEventArgs : System::EventArgs + struct ComponentEventArgs : virtual System::EventArgs { ComponentEventArgs(decltype(nullptr) n); ComponentEventArgs(Plugin::InternalUse iu, int32_t handle); @@ -2090,7 +3179,7 @@ namespace System { namespace Design { - struct ComponentChangingEventArgs : System::EventArgs + struct ComponentChangingEventArgs : virtual System::EventArgs { ComponentChangingEventArgs(decltype(nullptr) n); ComponentChangingEventArgs(Plugin::InternalUse iu, int32_t handle); @@ -2113,7 +3202,7 @@ namespace System { namespace Design { - struct ComponentChangedEventArgs : System::EventArgs + struct ComponentChangedEventArgs : virtual System::EventArgs { ComponentChangedEventArgs(decltype(nullptr) n); ComponentChangedEventArgs(Plugin::InternalUse iu, int32_t handle); @@ -2136,7 +3225,7 @@ namespace System { namespace Design { - struct ComponentRenameEventArgs : System::EventArgs + struct ComponentRenameEventArgs : virtual System::EventArgs { ComponentRenameEventArgs(decltype(nullptr) n); ComponentRenameEventArgs(Plugin::InternalUse iu, int32_t handle); @@ -2157,7 +3246,7 @@ namespace System { namespace ComponentModel { - struct MemberDescriptor : System::Object + struct MemberDescriptor : virtual System::Object { MemberDescriptor(decltype(nullptr) n); MemberDescriptor(Plugin::InternalUse iu, int32_t handle); @@ -2175,7 +3264,7 @@ namespace System namespace UnityEngine { - struct Time : System::Object + struct Time : virtual System::Object { Time(decltype(nullptr) n); Time(Plugin::InternalUse iu, int32_t handle); @@ -2193,7 +3282,7 @@ namespace UnityEngine namespace System { - struct MarshalByRefObject : System::Object + struct MarshalByRefObject : virtual System::Object { MarshalByRefObject(decltype(nullptr) n); MarshalByRefObject(Plugin::InternalUse iu, int32_t handle); @@ -2212,7 +3301,7 @@ namespace System { namespace IO { - struct Stream : System::MarshalByRefObject + struct Stream : virtual System::MarshalByRefObject, virtual System::IDisposable { Stream(decltype(nullptr) n); Stream(Plugin::InternalUse iu, int32_t handle); @@ -2234,7 +3323,7 @@ namespace System { namespace Generic { - template<> struct IComparer : System::Object + template<> struct IComparer : virtual System::Object { IComparer(decltype(nullptr) n); IComparer(Plugin::InternalUse iu, int32_t handle); @@ -2257,7 +3346,7 @@ namespace System { namespace Generic { - template<> struct IComparer : System::Object + template<> struct IComparer : virtual System::Object { IComparer(decltype(nullptr) n); IComparer(Plugin::InternalUse iu, int32_t handle); @@ -2280,7 +3369,7 @@ namespace System { namespace Generic { - template<> struct BaseIComparer : System::Collections::Generic::IComparer + template<> struct BaseIComparer : virtual System::Collections::Generic::IComparer { BaseIComparer(decltype(nullptr) n); BaseIComparer(Plugin::InternalUse iu, int32_t handle); @@ -2306,7 +3395,7 @@ namespace System { namespace Generic { - template<> struct BaseIComparer : System::Collections::Generic::IComparer + template<> struct BaseIComparer : virtual System::Collections::Generic::IComparer { BaseIComparer(decltype(nullptr) n); BaseIComparer(Plugin::InternalUse iu, int32_t handle); @@ -2328,7 +3417,7 @@ namespace System namespace System { - struct StringComparer : System::Object + struct StringComparer : virtual System::Collections::IComparer, virtual System::Collections::Generic::IComparer, virtual System::Collections::IEqualityComparer, virtual System::Collections::Generic::IEqualityComparer { StringComparer(decltype(nullptr) n); StringComparer(Plugin::InternalUse iu, int32_t handle); @@ -2345,7 +3434,7 @@ namespace System namespace System { - struct BaseStringComparer : System::StringComparer + struct BaseStringComparer : virtual System::StringComparer { BaseStringComparer(decltype(nullptr) n); BaseStringComparer(Plugin::InternalUse iu, int32_t handle); @@ -2369,112 +3458,7 @@ namespace System { namespace Collections { - struct ICollection : System::Object - { - ICollection(decltype(nullptr) n); - ICollection(Plugin::InternalUse iu, int32_t handle); - ICollection(const ICollection& other); - ICollection(ICollection&& other); - virtual ~ICollection(); - ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr) other); - ICollection& operator=(ICollection&& other); - bool operator==(const ICollection& other) const; - bool operator!=(const ICollection& other) const; - }; - } -} - -namespace System -{ - namespace Collections - { - struct BaseICollection : System::Collections::ICollection - { - BaseICollection(decltype(nullptr) n); - BaseICollection(Plugin::InternalUse iu, int32_t handle); - BaseICollection(const BaseICollection& other); - BaseICollection(BaseICollection&& other); - virtual ~BaseICollection(); - BaseICollection& operator=(const BaseICollection& other); - BaseICollection& operator=(decltype(nullptr) other); - BaseICollection& operator=(BaseICollection&& other); - bool operator==(const BaseICollection& other) const; - bool operator!=(const BaseICollection& other) const; - int32_t CppHandle; - BaseICollection(); - virtual void CopyTo(System::Array& array, int32_t index); - virtual System::Collections::IEnumerator GetEnumerator(); - virtual int32_t GetCount(); - virtual System::Boolean GetIsSynchronized(); - virtual System::Object GetSyncRoot(); - }; - } -} - -namespace System -{ - namespace Collections - { - struct IList : System::Object - { - IList(decltype(nullptr) n); - IList(Plugin::InternalUse iu, int32_t handle); - IList(const IList& other); - IList(IList&& other); - virtual ~IList(); - IList& operator=(const IList& other); - IList& operator=(decltype(nullptr) other); - IList& operator=(IList&& other); - bool operator==(const IList& other) const; - bool operator!=(const IList& other) const; - }; - } -} - -namespace System -{ - namespace Collections - { - struct BaseIList : System::Collections::IList - { - BaseIList(decltype(nullptr) n); - BaseIList(Plugin::InternalUse iu, int32_t handle); - BaseIList(const BaseIList& other); - BaseIList(BaseIList&& other); - virtual ~BaseIList(); - BaseIList& operator=(const BaseIList& other); - BaseIList& operator=(decltype(nullptr) other); - BaseIList& operator=(BaseIList&& other); - bool operator==(const BaseIList& other) const; - bool operator!=(const BaseIList& other) const; - int32_t CppHandle; - BaseIList(); - virtual int32_t Add(System::Object& value); - virtual void Clear(); - virtual System::Boolean Contains(System::Object& value); - virtual int32_t IndexOf(System::Object& value); - virtual void Insert(int32_t index, System::Object& value); - virtual void Remove(System::Object& value); - virtual void RemoveAt(int32_t index); - virtual System::Collections::IEnumerator GetEnumerator(); - virtual void CopyTo(System::Array& array, int32_t index); - virtual System::Boolean GetIsFixedSize(); - virtual System::Boolean GetIsReadOnly(); - virtual System::Object GetItem(int32_t index); - virtual void SetItem(int32_t index, System::Object& value); - virtual int32_t GetCount(); - virtual System::Boolean GetIsSynchronized(); - virtual System::Object GetSyncRoot(); - }; - } -} - -namespace System -{ - namespace Collections - { - struct Queue : System::Object + struct Queue : virtual System::ICloneable, virtual System::Collections::ICollection { Queue(decltype(nullptr) n); Queue(Plugin::InternalUse iu, int32_t handle); @@ -2495,7 +3479,7 @@ namespace System { namespace Collections { - struct BaseQueue : System::Collections::Queue + struct BaseQueue : virtual System::Collections::Queue { BaseQueue(decltype(nullptr) n); BaseQueue(Plugin::InternalUse iu, int32_t handle); @@ -2520,7 +3504,7 @@ namespace System { namespace Design { - struct IComponentChangeService : System::Object + struct IComponentChangeService : virtual System::Object { IComponentChangeService(decltype(nullptr) n); IComponentChangeService(Plugin::InternalUse iu, int32_t handle); @@ -2543,7 +3527,7 @@ namespace System { namespace Design { - struct BaseIComponentChangeService : System::ComponentModel::Design::IComponentChangeService + struct BaseIComponentChangeService : virtual System::ComponentModel::Design::IComponentChangeService { BaseIComponentChangeService(decltype(nullptr) n); BaseIComponentChangeService(Plugin::InternalUse iu, int32_t handle); @@ -2582,7 +3566,7 @@ namespace System { namespace IO { - struct FileStream : System::IO::Stream + struct FileStream : virtual System::IO::Stream, virtual System::IDisposable { FileStream(decltype(nullptr) n); FileStream(Plugin::InternalUse iu, int32_t handle); @@ -2604,7 +3588,7 @@ namespace System { namespace IO { - struct BaseFileStream : System::IO::FileStream + struct BaseFileStream : virtual System::IO::FileStream { BaseFileStream(decltype(nullptr) n); BaseFileStream(Plugin::InternalUse iu, int32_t handle); @@ -2627,7 +3611,7 @@ namespace UnityEngine { namespace Playables { - struct PlayableHandle : System::ValueType + struct PlayableHandle : virtual System::ValueType { PlayableHandle(decltype(nullptr) n); PlayableHandle(Plugin::InternalUse iu, int32_t handle); @@ -2643,54 +3627,13 @@ namespace UnityEngine } } -namespace UnityEngine -{ - namespace Playables - { - struct PlayableGraph : System::ValueType - { - PlayableGraph(decltype(nullptr) n); - PlayableGraph(Plugin::InternalUse iu, int32_t handle); - PlayableGraph(const PlayableGraph& other); - PlayableGraph(PlayableGraph&& other); - virtual ~PlayableGraph(); - PlayableGraph& operator=(const PlayableGraph& other); - PlayableGraph& operator=(decltype(nullptr) other); - PlayableGraph& operator=(PlayableGraph&& other); - bool operator==(const PlayableGraph& other) const; - bool operator!=(const PlayableGraph& other) const; - }; - } -} - -namespace UnityEngine -{ - namespace Animations - { - struct AnimationMixerPlayable : System::ValueType - { - AnimationMixerPlayable(decltype(nullptr) n); - AnimationMixerPlayable(Plugin::InternalUse iu, int32_t handle); - AnimationMixerPlayable(const AnimationMixerPlayable& other); - AnimationMixerPlayable(AnimationMixerPlayable&& other); - virtual ~AnimationMixerPlayable(); - AnimationMixerPlayable& operator=(const AnimationMixerPlayable& other); - AnimationMixerPlayable& operator=(decltype(nullptr) other); - AnimationMixerPlayable& operator=(AnimationMixerPlayable&& other); - bool operator==(const AnimationMixerPlayable& other) const; - bool operator!=(const AnimationMixerPlayable& other) const; - static UnityEngine::Animations::AnimationMixerPlayable Create(UnityEngine::Playables::PlayableGraph& graph, int32_t inputCount = 0, System::Boolean normalizeWeights = false); - }; - } -} - namespace UnityEngine { namespace Experimental { namespace UIElements { - struct CallbackEventHandler : System::Object + struct CallbackEventHandler : virtual UnityEngine::Experimental::UIElements::IEventHandler { CallbackEventHandler(decltype(nullptr) n); CallbackEventHandler(Plugin::InternalUse iu, int32_t handle); @@ -2713,7 +3656,7 @@ namespace UnityEngine { namespace UIElements { - struct VisualElement : UnityEngine::Experimental::UIElements::CallbackEventHandler + struct VisualElement : virtual UnityEngine::Experimental::UIElements::CallbackEventHandler, virtual UnityEngine::Experimental::UIElements::IEventHandler, virtual UnityEngine::Experimental::UIElements::IStyle { VisualElement(decltype(nullptr) n); VisualElement(Plugin::InternalUse iu, int32_t handle); @@ -2753,7 +3696,7 @@ namespace UnityEngine { namespace Input { - struct InteractionSourcePose : System::ValueType + struct InteractionSourcePose : virtual System::ValueType { InteractionSourcePose(decltype(nullptr) n); InteractionSourcePose(Plugin::InternalUse iu, int32_t handle); @@ -2776,7 +3719,7 @@ namespace MyGame { namespace MonoBehaviours { - struct TestScript : UnityEngine::MonoBehaviour + struct TestScript : virtual UnityEngine::MonoBehaviour { TestScript(decltype(nullptr) n); TestScript(Plugin::InternalUse iu, int32_t handle); @@ -2800,7 +3743,7 @@ namespace MyGame { namespace MonoBehaviours { - struct AnotherScript : UnityEngine::MonoBehaviour + struct AnotherScript : virtual UnityEngine::MonoBehaviour { AnotherScript(decltype(nullptr) n); AnotherScript(Plugin::InternalUse iu, int32_t handle); @@ -2832,7 +3775,7 @@ namespace Plugin namespace System { - template<> struct Array1 : System::Array + template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { Array1(decltype(nullptr) n); Array1(Plugin::InternalUse iu, int32_t handle); @@ -2927,7 +3870,7 @@ namespace Plugin namespace System { - template<> struct Array1 : System::Array + template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { Array1(decltype(nullptr) n); Array1(Plugin::InternalUse iu, int32_t handle); @@ -2949,7 +3892,7 @@ namespace System namespace System { - template<> struct Array2 : System::Array + template<> struct Array2 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList { Array2(decltype(nullptr) n); Array2(Plugin::InternalUse iu, int32_t handle); @@ -2973,7 +3916,7 @@ namespace System namespace System { - template<> struct Array3 : System::Array + template<> struct Array3 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList { Array3(decltype(nullptr) n); Array3(Plugin::InternalUse iu, int32_t handle); @@ -3009,7 +3952,7 @@ namespace Plugin namespace System { - template<> struct Array1 : System::Array + template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { Array1(decltype(nullptr) n); Array1(Plugin::InternalUse iu, int32_t handle); @@ -3043,7 +3986,7 @@ namespace Plugin namespace System { - template<> struct Array1 : System::Array + template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { Array1(decltype(nullptr) n); Array1(Plugin::InternalUse iu, int32_t handle); @@ -3077,7 +4020,7 @@ namespace Plugin namespace System { - template<> struct Array1 : System::Array + template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { Array1(decltype(nullptr) n); Array1(Plugin::InternalUse iu, int32_t handle); @@ -3111,7 +4054,7 @@ namespace Plugin namespace System { - template<> struct Array1 : System::Array + template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { Array1(decltype(nullptr) n); Array1(Plugin::InternalUse iu, int32_t handle); @@ -3133,7 +4076,7 @@ namespace System namespace System { - struct Action : System::Object + struct Action : virtual System::Object { Action(decltype(nullptr) n); Action(Plugin::InternalUse iu, int32_t handle); @@ -3157,7 +4100,7 @@ namespace System namespace System { - template<> struct Action1 : System::Object + template<> struct Action1 : virtual System::Object { Action1(decltype(nullptr) n); Action1(Plugin::InternalUse iu, int32_t handle); @@ -3181,7 +4124,7 @@ namespace System namespace System { - template<> struct Action2 : System::Object + template<> struct Action2 : virtual System::Object { Action2(decltype(nullptr) n); Action2(Plugin::InternalUse iu, int32_t handle); @@ -3205,7 +4148,7 @@ namespace System namespace System { - template<> struct Func3 : System::Object + template<> struct Func3 : virtual System::Object { Func3(decltype(nullptr) n); Func3(Plugin::InternalUse iu, int32_t handle); @@ -3229,7 +4172,7 @@ namespace System namespace System { - template<> struct Func3 : System::Object + template<> struct Func3 : virtual System::Object { Func3(decltype(nullptr) n); Func3(Plugin::InternalUse iu, int32_t handle); @@ -3253,7 +4196,7 @@ namespace System namespace System { - struct AppDomainInitializer : System::Object + struct AppDomainInitializer : virtual System::Object { AppDomainInitializer(decltype(nullptr) n); AppDomainInitializer(Plugin::InternalUse iu, int32_t handle); @@ -3279,7 +4222,7 @@ namespace UnityEngine { namespace Events { - struct UnityAction : System::Object + struct UnityAction : virtual System::Object { UnityAction(decltype(nullptr) n); UnityAction(Plugin::InternalUse iu, int32_t handle); @@ -3306,7 +4249,7 @@ namespace UnityEngine { namespace Events { - template<> struct UnityAction2 : System::Object + template<> struct UnityAction2 : virtual System::Object { UnityAction2(decltype(nullptr) n); UnityAction2(Plugin::InternalUse iu, int32_t handle); @@ -3335,7 +4278,7 @@ namespace System { namespace Design { - struct ComponentEventHandler : System::Object + struct ComponentEventHandler : virtual System::Object { ComponentEventHandler(decltype(nullptr) n); ComponentEventHandler(Plugin::InternalUse iu, int32_t handle); @@ -3365,7 +4308,7 @@ namespace System { namespace Design { - struct ComponentChangingEventHandler : System::Object + struct ComponentChangingEventHandler : virtual System::Object { ComponentChangingEventHandler(decltype(nullptr) n); ComponentChangingEventHandler(Plugin::InternalUse iu, int32_t handle); @@ -3395,7 +4338,7 @@ namespace System { namespace Design { - struct ComponentChangedEventHandler : System::Object + struct ComponentChangedEventHandler : virtual System::Object { ComponentChangedEventHandler(decltype(nullptr) n); ComponentChangedEventHandler(Plugin::InternalUse iu, int32_t handle); @@ -3425,7 +4368,7 @@ namespace System { namespace Design { - struct ComponentRenameEventHandler : System::Object + struct ComponentRenameEventHandler : virtual System::Object { ComponentRenameEventHandler(decltype(nullptr) n); ComponentRenameEventHandler(Plugin::InternalUse iu, int32_t handle); From f9c3a6f775b9dd9236dbe8cbf2d8075a73012530 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Fri, 12 Jan 2018 23:49:19 -0800 Subject: [PATCH 53/95] Add support for hot reloading --- README.md | 4 +- Unity/Assets/NativeScript/Bindings.cs | 168 +++++-- Unity/Assets/NativeScript/BootScene.unity | 4 +- Unity/Assets/NativeScript/BootScript.cs | 59 ++- .../Assets/NativeScript/Editor/EditorMenus.cs | 31 ++ .../NativeScript/Editor/EditorMenus.cs.meta | 13 + .../NativeScript/Editor/GenerateBindings.cs | 241 ++++++---- Unity/Assets/NativeScriptConstants.cs | 2 +- Unity/Assets/NativeScriptTypes.json | 4 +- Unity/CppSource/Game/Game.cpp | 55 ++- Unity/CppSource/NativeScript/Bindings.cpp | 424 +++++++++++------- 11 files changed, 696 insertions(+), 309 deletions(-) create mode 100644 Unity/Assets/NativeScript/Editor/EditorMenus.cs create mode 100644 Unity/Assets/NativeScript/Editor/EditorMenus.cs.meta diff --git a/README.md b/README.md index 3a766ab..ff70cd5 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ C++ is the standard language for video games as well as many other fields. By pr Vector3 position(1.0f, 2.0f, 3.0f); transform.SetPosition(position); -* No need to reload the Unity editor when changing C++ +* Hot reloading: change C++ without restarting the game * Handle `MonoBehaviour` messages in C++ > @@ -112,6 +112,8 @@ Almost all projects will see a net performance win by reducing garbage collectio [Testing and benchmarks article](https://jacksondunstan.com/articles/3952) +[Optimizations article](https://jacksondunstan.com/articles/4311) + # Project Structure When scripting in C++, C# is used only as a "binding" layer so Unity can call C++ functions and C++ functions can call the Unity API. A code generator is used to generate most of these bindings according to the needs of your project. diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 51b1c0b..bb527ea 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -1,6 +1,7 @@ using AOT; using System; +using System.Collections; using System.IO; using System.Runtime.InteropServices; @@ -251,30 +252,68 @@ public static void Remove(int handle) } } + /// + /// A reusable version of UnityEngine.WaitForSecondsRealtime to avoid + /// GC allocs + /// + class ReusableWaitForSecondsRealtime : CustomYieldInstruction + { + private float waitTime; + + public float WaitTime + { + set + { + waitTime = Time.realtimeSinceStartup + value; + } + } + + public override bool keepWaiting + { + get + { + return Time.realtimeSinceStartup < waitTime; + } + } + + public ReusableWaitForSecondsRealtime(float time) + { + WaitTime = time; + } + } + // Name of the plugin when using [DllImport] - const string PluginName = "NativeScript"; + const string PLUGIN_NAME = "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"; + const string PLUGIN_PATH = "/Plugins/Editor/NativeScript.bundle/Contents/MacOS/NativeScript"; #elif UNITY_EDITOR_LINUX - const string PluginPath = "/Plugins/Editor/libNativeScript.so"; + const string PLUGIN_PATH = "/Plugins/Editor/libNativeScript.so"; #elif UNITY_EDITOR_WIN - const string PluginPath = "/Plugins/Editor/NativeScript.dll"; + const string PLUGIN_PATH = "/Plugins/Editor/NativeScript.dll"; #endif - + + enum InitMode : byte + { + FirstBoot, + Reload + } + #if UNITY_EDITOR // Handle to the C++ DLL static IntPtr libraryHandle; delegate void InitDelegate( - int maxManagedObjects, + IntPtr memory, + int memorySize, + InitMode initMode, IntPtr releaseObject, IntPtr stringNew, IntPtr setException, IntPtr arrayGetLength, /*BEGIN INIT PARAMS*/ - IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, + int maxManagedObjects, IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3PropertyGetMagnitude, IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, @@ -754,13 +793,15 @@ static T GetDelegate( #else [DllImport(PluginName)] static extern void Init( - int maxManagedObjects, + IntPtr memory, + int memorySize, + initMode initMode, IntPtr releaseObject, IntPtr stringNew, IntPtr setException, IntPtr arrayGetLength, /*BEGIN INIT PARAMS*/ - IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, + int maxManagedObjects, IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3PropertyGetMagnitude, IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, @@ -1416,38 +1457,95 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate void SystemComponentModelDesignComponentRenameEventHandlerRemoveDelegate(int thisHandle, int delHandle); /*END DELEGATE TYPES*/ + private static readonly string pluginPath = Application.dataPath + PLUGIN_PATH; public static Exception UnhandledCppException; public static SetCsharpExceptionDelegate SetCsharpException; + private static IntPtr memory; + private static int memorySize; /// /// Open the C++ plugin and call its PluginMain() /// /// - /// - /// Maximum number of simultaneous managed objects that the C++ plugin - /// uses. + /// + /// Number of bytes of memory to make available to the C++ plugin /// - public static void Open( - int maxManagedObjects) + public static void Open(int memorySize) { - ObjectStore.Init(maxManagedObjects); - /*BEGIN STRUCTSTORE INIT CALLS*/ - NativeScript.Bindings.StructStore.Init(maxManagedObjects); + /*BEGIN STORE INIT CALLS*/ + NativeScript.Bindings.ObjectStore.Init(1000); + NativeScript.Bindings.StructStore.Init(1000); NativeScript.Bindings.StructStore.Init(1000); - NativeScript.Bindings.StructStore.Init(maxManagedObjects); - NativeScript.Bindings.StructStore.Init(maxManagedObjects); - NativeScript.Bindings.StructStore>.Init(maxManagedObjects); - NativeScript.Bindings.StructStore.Init(maxManagedObjects); - NativeScript.Bindings.StructStore.Init(maxManagedObjects); - NativeScript.Bindings.StructStore.Init(maxManagedObjects); - NativeScript.Bindings.StructStore.Init(maxManagedObjects); - /*END STRUCTSTORE INIT CALLS*/ + NativeScript.Bindings.StructStore.Init(1000); + NativeScript.Bindings.StructStore.Init(1000); + NativeScript.Bindings.StructStore>.Init(20); + NativeScript.Bindings.StructStore.Init(10); + NativeScript.Bindings.StructStore.Init(1000); + NativeScript.Bindings.StructStore.Init(1000); + NativeScript.Bindings.StructStore.Init(1000); + /*END STORE INIT CALLS*/ + Bindings.memorySize = memorySize; + memory = Marshal.AllocHGlobal(memorySize); + OpenPlugin(InitMode.FirstBoot); + } + + // Reloading requires dynamic loading of the C++ plugin, which is only + // available in the editor +#if UNITY_EDITOR + /// + /// Reload the C++ plugin. Its memory is intact and false is passed for + /// the isFirstBoot parameter of PluginMain(). + /// + public static void Reload() + { + ClosePlugin(); + OpenPlugin(InitMode.Reload); + } + + /// + /// Poll the plugin for changes and reload if any are found. + /// + /// + /// + /// Number of seconds between polls. + /// + /// + /// + /// Enumerator for this iterator function. Can be passed to + /// MonoBehaviour.StartCoroutine for easy usage. + /// + public static IEnumerator AutoReload(float pollTime) + { + // Get the original time + long lastWriteTime = File.GetLastWriteTime(pluginPath).Ticks; + + ReusableWaitForSecondsRealtime poll + = new ReusableWaitForSecondsRealtime(pollTime); + do + { + // Poll. Reload if the last write time changed. + long cur = File.GetLastWriteTime(pluginPath).Ticks; + if (cur != lastWriteTime) + { + Debug.Log("reloading at " + DateTime.Now); + lastWriteTime = cur; + Reload(); + } + + // Wait to poll again + poll.WaitTime = pollTime; + yield return poll; + } + while (true); + } +#endif + + private static void OpenPlugin(InitMode initMode) + { #if UNITY_EDITOR - // Open native library - libraryHandle = OpenLibrary( - Application.dataPath + PluginPath); + libraryHandle = OpenLibrary(pluginPath); InitDelegate Init = GetDelegate( libraryHandle, "Init"); @@ -1498,17 +1596,18 @@ public static void Open( SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke = GetDelegate(libraryHandle, "SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke"); SetCsharpExceptionSystemNullReferenceException = GetDelegate(libraryHandle, "SetCsharpExceptionSystemNullReferenceException"); /*END MONOBEHAVIOUR GETDELEGATE CALLS*/ - #endif - // Init C++ library Init( - maxManagedObjects, + memory, + memorySize, + initMode, Marshal.GetFunctionPointerForDelegate(new ReleaseObjectDelegate(ReleaseObject)), Marshal.GetFunctionPointerForDelegate(new StringNewDelegate(StringNew)), Marshal.GetFunctionPointerForDelegate(new SetExceptionDelegate(SetException)), Marshal.GetFunctionPointerForDelegate(new ArrayGetLengthDelegate(ArrayGetLength)), /*BEGIN INIT CALL*/ + 1000, Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)), Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3PropertyGetMagnitudeDelegate(UnityEngineVector3PropertyGetMagnitude)), Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingleDelegate(UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)), @@ -1781,6 +1880,13 @@ public static void Open( /// public static void Close() { + ClosePlugin(); + Marshal.FreeHGlobal(memory); + memory = IntPtr.Zero; + } + + private static void ClosePlugin() + { #if UNITY_EDITOR CloseLibrary(libraryHandle); libraryHandle = IntPtr.Zero; diff --git a/Unity/Assets/NativeScript/BootScene.unity b/Unity/Assets/NativeScript/BootScene.unity index c38824f..4c9bb79 100644 --- a/Unity/Assets/NativeScript/BootScene.unity +++ b/Unity/Assets/NativeScript/BootScene.unity @@ -139,7 +139,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 6b5575a60b7c04c7a87ff4e161573c66, type: 3} m_Name: m_EditorClassIdentifier: - MaxManagedObjects: 1024 + MemorySize: 16777216 + AutoReload: 1 + AutoReloadPollTime: 1 --- !u!4 &643357610 Transform: m_ObjectHideFlags: 0 diff --git a/Unity/Assets/NativeScript/BootScript.cs b/Unity/Assets/NativeScript/BootScript.cs index 356f3a5..7ca6ee0 100644 --- a/Unity/Assets/NativeScript/BootScript.cs +++ b/Unity/Assets/NativeScript/BootScript.cs @@ -5,21 +5,74 @@ namespace NativeScript /// /// Script to run at app startup that initializes and runs the native plugin /// + /// /// /// Jackson Dunstan, 2017, http://JacksonDunstan.com /// + /// /// /// MIT /// - class BootScript : MonoBehaviour + public class BootScript : MonoBehaviour { - public int MaxManagedObjects = 1024; + public int MemorySize = 1024 * 1024 * 16; + + // Reloading requires dynamic loading of the C++ plugin, which is only + // available in the editor +#if UNITY_EDITOR + public bool AutoReload; + + public float AutoReloadPollTime = 1.0f; + private float lastAutoReloadPollTime; + private Coroutine autoReloadCoroutine; +#endif void Awake() { +#if UNITY_EDITOR + lastAutoReloadPollTime = AutoReloadPollTime; +#endif DontDestroyOnLoad(gameObject); - Bindings.Open(MaxManagedObjects); + Bindings.Open(MemorySize); + } + +#if UNITY_EDITOR + void Update() + { + if (AutoReload) + { + if (AutoReloadPollTime > 0) + { + // Not started yet. Start. + if (autoReloadCoroutine == null) + { + lastAutoReloadPollTime = AutoReloadPollTime; + autoReloadCoroutine = StartCoroutine( + Bindings.AutoReload( + AutoReloadPollTime)); + } + // Poll time changed. Restart. + else if (AutoReloadPollTime != lastAutoReloadPollTime) + { + StopCoroutine(autoReloadCoroutine); + lastAutoReloadPollTime = AutoReloadPollTime; + autoReloadCoroutine = StartCoroutine( + Bindings.AutoReload( + AutoReloadPollTime)); + } + } + } + else + { + // Not stopped yet. Stop. + if (autoReloadCoroutine != null) + { + StopCoroutine(autoReloadCoroutine); + autoReloadCoroutine = null; + } + } } +#endif void OnApplicationQuit() { diff --git a/Unity/Assets/NativeScript/Editor/EditorMenus.cs b/Unity/Assets/NativeScript/Editor/EditorMenus.cs new file mode 100644 index 0000000..12866f1 --- /dev/null +++ b/Unity/Assets/NativeScript/Editor/EditorMenus.cs @@ -0,0 +1,31 @@ +using UnityEngine; +using UnityEditor; + +namespace NativeScript +{ + /// + /// Menus for the Unity Editor + /// + /// + /// + /// Jackson Dunstan, 2018, http://JacksonDunstan.com + /// + /// + /// + /// MIT + /// + public static class EditorMenus + { + [MenuItem("NativeScript/Generate Bindings #%g")] + public static void Generate() + { + GenerateBindings.Generate(); + } + + [MenuItem("NativeScript/Reload Plugin #%r")] + public static void Reload() + { + Bindings.Reload(); + } + } +} diff --git a/Unity/Assets/NativeScript/Editor/EditorMenus.cs.meta b/Unity/Assets/NativeScript/Editor/EditorMenus.cs.meta new file mode 100644 index 0000000..ae3469a --- /dev/null +++ b/Unity/Assets/NativeScript/Editor/EditorMenus.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 5aad51de55c544325a293e98c996a550 +timeCreated: 1515806821 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 48f3d07..ebec6cf 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -131,6 +131,8 @@ class JsonDelegate [Serializable] class JsonDocument { + public int MaxSimultaneousObjects; + public int DefaultMaxSimultaneous; public string[] Assemblies; public JsonType[] Types; public JsonMonoBehaviour[] MonoBehaviours; @@ -146,7 +148,7 @@ class StringBuilders new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CsharpDelegateTypes = new StringBuilder(InitialStringBuilderCapacity); - public readonly StringBuilder CsharpStructStoreInitCalls = + public readonly StringBuilder CsharpStoreInitCalls = new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CsharpInitCall = new StringBuilder(InitialStringBuilderCapacity); @@ -178,6 +180,8 @@ class StringBuilders new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppInitBody = new StringBuilder(InitialStringBuilderCapacity); + public readonly StringBuilder CppInitBodyFirstBoot = + new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppMonoBehaviourMessages = new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppGlobalStateAndFunctions = @@ -264,6 +268,9 @@ public MessageInfo( } } + const int DEFAULT_MAX_SIMULTANEOUS = 1000; + const int DEFAULT_MAX_SIMULTANEOUS_OBJECTS = 1000; + static readonly MessageInfo[] messageInfos = new[] { new MessageInfo("Awake"), new MessageInfo("FixedUpdate"), @@ -382,7 +389,6 @@ static readonly FieldOrderComparer DefaultFieldOrderComparer // Restore unused field types #pragma warning restore CS0649 - [MenuItem("NativeScript/Generate Bindings #%g")] public static void Generate() { EditorPrefs.DeleteKey(PostCompileWorkPref); @@ -518,22 +524,47 @@ static void DoPostCompileWork(bool canRefreshAssetDb) Assembly[] assemblies = GetAssemblies(doc.Assemblies); StringBuilders builders = new StringBuilders(); + // Count the number of ref-counts in C++ + // Start with 1 for Object + int defaultMaxSimultaneous = doc.DefaultMaxSimultaneous != 0 + ? doc.DefaultMaxSimultaneous + : DEFAULT_MAX_SIMULTANEOUS; + int totalMaxSimultaneous = defaultMaxSimultaneous; + + // Init param for max managed Objects + int maxSimultaneousObjects = doc.MaxSimultaneousObjects != 0 + ? doc.MaxSimultaneousObjects + : DEFAULT_MAX_SIMULTANEOUS_OBJECTS; + builders.CppInitParams.Append("\tint32_t maxManagedObjects,\n"); + builders.CsharpInitParams.Append("\t\t\tint maxManagedObjects,\n"); + builders.CsharpInitCall.Append("\t\t\t\t"); + builders.CsharpInitCall.Append(maxSimultaneousObjects); + builders.CsharpInitCall.Append(",\n"); + + // C# ObjectStore Init call + builders.CsharpStoreInitCalls.Append( + "\t\t\tNativeScript.Bindings.ObjectStore.Init("); + builders.CsharpStoreInitCalls.Append(defaultMaxSimultaneous); + builders.CsharpStoreInitCalls.Append(");\n"); + // Generate types if (doc.Types != null) { foreach (JsonType jsonType in doc.Types) { - AppendType( + Type type = GetType(jsonType.Name, assemblies); + TypeKind typeKind = GetTypeKind(type); + totalMaxSimultaneous += AppendType( jsonType, + type, + typeKind, assemblies, + defaultMaxSimultaneous, builders); if (jsonType.BaseTypes != null) { // C++ template declaration if necessary - Type type = GetType( - jsonType.Name, - assemblies); Type[] genericArgTypes = type.GetGenericArguments(); string cppBaseTypeName = "Base" + type.Name; if (!IsStatic(type)) @@ -560,12 +591,13 @@ static void DoPostCompileWork(bool canRefreshAssetDb) cppBaseTypeName, jsonBaseType, assemblies, + defaultMaxSimultaneous, builders); } } } } - + // Generate boxing and unboxing for primitive types foreach (Type type in PRIMITIVE_TYPES) { @@ -607,6 +639,7 @@ static void DoPostCompileWork(bool canRefreshAssetDb) AppendDelegate( del, assemblies, + defaultMaxSimultaneous, builders); } } @@ -642,7 +675,7 @@ static JsonDocument LoadJson() { string jsonPath = Path.Combine( Application.dataPath, - NativeScriptConstants.ExposedTypesJsonPath); + NativeScriptConstants.JSON_CONFIG_PATH); string json = File.ReadAllText(jsonPath); return JsonUtility.FromJson(json); } @@ -1295,13 +1328,14 @@ static void AppendTypeNameWithoutSuffixes( } } - static void AppendType( + static int AppendType( JsonType jsonType, + Type type, + TypeKind typeKind, Assembly[] assemblies, + int defaultMaxSimultaneous, StringBuilders builders) { - Type type = GetType(jsonType.Name, assemblies); - TypeKind typeKind = GetTypeKind(type); if (typeKind == TypeKind.Enum) { AppendEnum( @@ -1312,9 +1346,11 @@ static void AppendType( typeKind, null, builders); + return 0; } else { + int totalMaxSimultaneous = 0; Type[] genericArgTypes = type.GetGenericArguments(); if (jsonType.GenericParams != null) { @@ -1334,15 +1370,17 @@ static void AppendType( jsonGenericParams.Types, assemblies); Type genericType = type.MakeGenericType(typeParams); - int? maxSimultaneous = jsonGenericParams.MaxSimultaneous != 0 + int maxSimultaneous = jsonGenericParams.MaxSimultaneous != 0 ? jsonGenericParams.MaxSimultaneous : jsonType.MaxSimultaneous != 0 ? jsonType.MaxSimultaneous - : default(int?); + : defaultMaxSimultaneous; + totalMaxSimultaneous += maxSimultaneous; AppendType( jsonType, genericArgTypes, genericType, + typeKind, typeParams, maxSimultaneous, assemblies, @@ -1359,13 +1397,15 @@ static void AppendType( } else { - int? maxSimultaneous = jsonType.MaxSimultaneous != 0 + int maxSimultaneous = jsonType.MaxSimultaneous != 0 ? jsonType.MaxSimultaneous - : default(int?); + : defaultMaxSimultaneous; + totalMaxSimultaneous += maxSimultaneous; AppendType( jsonType, genericArgTypes, type, + typeKind, null, maxSimultaneous, assemblies, @@ -1379,6 +1419,7 @@ static void AppendType( builders); } } + return totalMaxSimultaneous; } } @@ -1386,35 +1427,24 @@ static void AppendType( JsonType jsonType, Type[] genericArgTypes, Type type, + TypeKind typeKind, Type[] typeParams, - int? maxSimultaneous, + int maxSimultaneous, Assembly[] assemblies, StringBuilders builders) { bool isStatic = IsStatic(type); - TypeKind typeKind = GetTypeKind(type); if (!isStatic && typeKind == TypeKind.ManagedStruct) { // C# StructStore Init call - builders.CsharpStructStoreInitCalls.Append( + builders.CsharpStoreInitCalls.Append( "\t\t\tNativeScript.Bindings.StructStore<"); AppendCsharpTypeName( type, - builders.CsharpStructStoreInitCalls); - builders.CsharpStructStoreInitCalls.Append( - ">.Init("); - if (maxSimultaneous.HasValue) - { - builders.CsharpStructStoreInitCalls.Append( - maxSimultaneous.Value); - } - else - { - builders.CsharpStructStoreInitCalls.Append( - "maxManagedObjects"); - } - builders.CsharpStructStoreInitCalls.Append( - ");\n"); + builders.CsharpStoreInitCalls); + builders.CsharpStoreInitCalls.Append(">.Init("); + builders.CsharpStoreInitCalls.Append(maxSimultaneous); + builders.CsharpStoreInitCalls.Append(");\n"); // Build function name suffix builders.TempStrBuilder.Length = 0; @@ -1525,16 +1555,15 @@ static void AppendType( // C++ init body for handle array length builders.CppInitBody.Append("\tPlugin::RefCounts"); builders.CppInitBody.Append(funcNameSuffix); - builders.CppInitBody.Append(" = new int32_t["); - if (maxSimultaneous.HasValue) - { - builders.CppInitBody.Append(maxSimultaneous.Value); - } - else - { - builders.CppInitBody.Append("maxManagedObjects"); - } - builders.CppInitBody.Append("]();\n"); + builders.CppInitBody.Append(" = (int32_t*)curMemory;\n"); + builders.CppInitBody.Append("\tcurMemory += "); + builders.CppInitBody.Append(maxSimultaneous); + builders.CppInitBody.Append(" * sizeof(int32_t);\n"); + builders.CppInitBody.Append("\tPlugin::RefCountsLen"); + builders.CppInitBody.Append(funcNameSuffix); + builders.CppInitBody.Append(" = "); + builders.CppInitBody.Append(maxSimultaneous); + builders.CppInitBody.Append(";\n"); // C++ ref count state and functions builders.CppGlobalStateAndFunctions.Append("\tint32_t RefCountsLen"); @@ -1751,11 +1780,12 @@ static void AppendBaseType( string cppBaseTypeName, JsonBaseType jsonBaseType, Assembly[] assemblies, + int defaultMaxSimultaneous, StringBuilders builders) { - int? maxSimultaneous = jsonBaseType.MaxSimultaneous != 0 + int maxSimultaneous = jsonBaseType.MaxSimultaneous != 0 ? jsonBaseType.MaxSimultaneous - : default(int?); + : defaultMaxSimultaneous; if (jsonBaseType.GenericTypes != null) { Type[] typeParams = GetTypes( @@ -5766,6 +5796,7 @@ static void AppendArraySetItem( static void AppendDelegate( JsonDelegate jsonDelegate, Assembly[] assemblies, + int defaultMaxSimultaneous, StringBuilders builders) { Type type = GetType( @@ -5812,11 +5843,11 @@ static void AppendDelegate( string cppTypeName = builders.TempStrBuilder.ToString(); // Max simultaneous handles of this type - int? maxSimultaneous = jsonGenericParams.MaxSimultaneous != 0 + int maxSimultaneous = jsonGenericParams.MaxSimultaneous != 0 ? jsonGenericParams.MaxSimultaneous : jsonDelegate.MaxSimultaneous != 0 ? jsonDelegate.MaxSimultaneous - : default(int?); + : defaultMaxSimultaneous; AppendDelegate( genericType, @@ -5828,9 +5859,9 @@ static void AppendDelegate( } else { - int? maxSimultaneous = jsonDelegate.MaxSimultaneous != 0 + int maxSimultaneous = jsonDelegate.MaxSimultaneous != 0 ? jsonDelegate.MaxSimultaneous - : default(int?); + : defaultMaxSimultaneous; AppendDelegate( type, type.Name, @@ -5844,7 +5875,7 @@ static void AppendDelegate( Type type, string cppTypeName, Type[] typeParams, - int? maxSimultaneous, + int maxSimultaneous, StringBuilders builders) { builders.TempStrBuilder.Length = 0; @@ -5980,7 +6011,8 @@ static void AppendDelegate( cppTypeName, maxSimultaneous, bindingTypeName, - builders.CppInitBody); + builders.CppInitBody, + builders.CppInitBodyFirstBoot); // C++ type definition (begin) AppendCppTypeDefinitionBegin( @@ -6527,7 +6559,7 @@ static void AppendBaseType( JsonBaseType jsonBaseType, string cppBaseTypeName, Type[] typeParams, - int? maxSimultaneous, + int maxSimultaneous, Assembly[] assemblies, StringBuilders builders) { @@ -6701,7 +6733,8 @@ static void AppendBaseType( cppBaseTypeName, maxSimultaneous, bindingTypeName, - builders.CppInitBody); + builders.CppInitBody, + builders.CppInitBodyFirstBoot); // C++ type definition (begin) AppendCppTypeDefinitionBegin( @@ -9412,25 +9445,20 @@ static void AppendCppFreeListInit( Type type, Type[] typeParams, string cppTypeName, - int? maxSimultaneous, + int maxSimultaneous, string typeName, - StringBuilder output) + StringBuilder output, + StringBuilder outputFirstBoot) { - output.Append('\t'); + output.Append("\tPlugin::"); output.Append(typeName); output.Append("FreeListSize = "); - if (maxSimultaneous.HasValue) - { - output.Append(maxSimultaneous); - } - else - { - output.Append("maxManagedObjects"); - } + output.Append(maxSimultaneous); output.Append(";\n"); - output.Append("\t"); + + output.Append("\tPlugin::"); output.Append(typeName); - output.Append("FreeList = new "); + output.Append("FreeList = ("); AppendCppTypeName( type.Namespace, cppTypeName, @@ -9438,16 +9466,11 @@ static void AppendCppFreeListInit( AppendCppTypeParameters( typeParams, output); - output.Append("*["); - output.Append(typeName); - output.Append("FreeListSize];\n"); - output.Append("\tfor (int32_t i = 0, end = "); - output.Append(typeName); - output.Append("FreeListSize - 1; i < end; ++i)\n"); - output.Append("\t{\n"); - output.Append("\t "); - output.Append(typeName); - output.Append("FreeList[i] = ("); + output.Append("**)curMemory;\n"); + + output.Append("\tcurMemory += "); + output.Append(maxSimultaneous); + output.Append(" * sizeof("); AppendCppTypeName( type.Namespace, cppTypeName, @@ -9455,20 +9478,42 @@ static void AppendCppFreeListInit( AppendCppTypeParameters( typeParams, output); - output.Append("*)("); - output.Append(typeName); - output.Append("FreeList + i + 1);\n"); - output.Append("\t}\n"); - output.Append('\t'); - output.Append(typeName); - output.Append("FreeList["); - output.Append(typeName); - output.Append("FreeListSize - 1] = nullptr;\n"); - output.Append("\tNextFree"); - output.Append(typeName); - output.Append(" = "); - output.Append(typeName); - output.Append("FreeList + 1;\n"); + output.Append("*);\n"); + + output.Append("\t\n"); + + outputFirstBoot.Append("\t\tfor (int32_t i = 0, end = Plugin::"); + outputFirstBoot.Append(typeName); + outputFirstBoot.Append("FreeListSize - 1; i < end; ++i)\n"); + outputFirstBoot.Append("\t\t{\n"); + outputFirstBoot.Append("\t\t\tPlugin::"); + outputFirstBoot.Append(typeName); + outputFirstBoot.Append("FreeList[i] = ("); + AppendCppTypeName( + type.Namespace, + cppTypeName, + outputFirstBoot); + AppendCppTypeParameters( + typeParams, + outputFirstBoot); + outputFirstBoot.Append("*)(Plugin::"); + outputFirstBoot.Append(typeName); + outputFirstBoot.Append("FreeList + i + 1);\n"); + outputFirstBoot.Append("\t\t}\n"); + + outputFirstBoot.Append("\t\tPlugin::"); + outputFirstBoot.Append(typeName); + outputFirstBoot.Append("FreeList[Plugin::"); + outputFirstBoot.Append(typeName); + outputFirstBoot.Append("FreeListSize - 1] = nullptr;\n"); + + outputFirstBoot.Append("\t\tPlugin::NextFree"); + outputFirstBoot.Append(typeName); + outputFirstBoot.Append(" = Plugin::"); + outputFirstBoot.Append(typeName); + outputFirstBoot.Append("FreeList + 1;\n"); + + outputFirstBoot.Append("\t\t\n"); } static void AppendCppFreeListStateAndFunctions( @@ -12621,7 +12666,7 @@ static void RemoveTrailingChars( { RemoveTrailingChars(builders.CsharpInitParams); RemoveTrailingChars(builders.CsharpDelegateTypes); - RemoveTrailingChars(builders.CsharpStructStoreInitCalls); + RemoveTrailingChars(builders.CsharpStoreInitCalls); RemoveTrailingChars(builders.CsharpInitCall); RemoveTrailingChars(builders.CsharpBaseTypes); RemoveTrailingChars(builders.CsharpFunctions); @@ -12629,6 +12674,7 @@ static void RemoveTrailingChars( RemoveTrailingChars(builders.CsharpDelegates); RemoveTrailingChars(builders.CsharpImports); RemoveTrailingChars(builders.CsharpGetDelegateCalls); + RemoveTrailingChars(builders.CsharpGetDelegateCalls); RemoveTrailingChars(builders.CppFunctionPointers); RemoveTrailingChars(builders.CppTypeDeclarations); RemoveTrailingChars(builders.CppTemplateDeclarations); @@ -12637,10 +12683,10 @@ static void RemoveTrailingChars( RemoveTrailingChars(builders.CppMethodDefinitions); RemoveTrailingChars(builders.CppInitParams); RemoveTrailingChars(builders.CppInitBody); + RemoveTrailingChars(builders.CppInitBodyFirstBoot); RemoveTrailingChars(builders.CppMonoBehaviourMessages); RemoveTrailingChars(builders.CppGlobalStateAndFunctions); RemoveTrailingChars(builders.CppBoxingMethodDeclarations); - RemoveTrailingChars(builders.CppStringDefaultParams); } // Remove trailing chars (e.g. commas) for last elements @@ -12688,9 +12734,9 @@ static void InjectBuilders( builders.CsharpDelegateTypes.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN STRUCTSTORE INIT CALLS*/\n", - "\n\t\t\t/*END STRUCTSTORE INIT CALLS*/", - builders.CsharpStructStoreInitCalls.ToString()); + "/*BEGIN STORE INIT CALLS*/\n", + "\n\t\t\t/*END STORE INIT CALLS*/", + builders.CsharpStoreInitCalls.ToString()); csharpContents = InjectIntoString( csharpContents, "/*BEGIN INIT CALL*/\n", @@ -12766,6 +12812,11 @@ static void InjectBuilders( "/*BEGIN INIT BODY*/\n", "\n\t/*END INIT BODY*/", builders.CppInitBody.ToString()); + cppSourceContents = InjectIntoString( + cppSourceContents, + "/*BEGIN INIT BODY FIRST BOOT*/\n", + "\n\t\t/*END INIT BODY FIRST BOOT*/", + builders.CppInitBodyFirstBoot.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, "/*BEGIN MONOBEHAVIOUR MESSAGES*/\n", diff --git a/Unity/Assets/NativeScriptConstants.cs b/Unity/Assets/NativeScriptConstants.cs index 8d8f46e..54e6923 100644 --- a/Unity/Assets/NativeScriptConstants.cs +++ b/Unity/Assets/NativeScriptConstants.cs @@ -13,5 +13,5 @@ public static class NativeScriptConstants /// /// Path within the Unity project to the exposed types JSON file /// - public const string ExposedTypesJsonPath = "NativeScriptTypes.json"; + public const string JSON_CONFIG_PATH = "NativeScriptTypes.json"; } \ No newline at end of file diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 4e364ad..2013316 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -500,7 +500,8 @@ "Types": [ "System.String", "System.Double" - ] + ], + "MaxSimultaneous": 20 } ], "Constructors": [ @@ -657,6 +658,7 @@ }, { "Name": "UnityEngine.Ray", + "MaxSimultaneous": 10, "Constructors": [ { "ParamTypes": [ diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index f7caf26..a44f151 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -13,16 +13,37 @@ using namespace System; using namespace UnityEngine; +namespace +{ + struct GameState + { + int32_t NumCreated; + float Dir; + }; + + GameState* gameState; +} + // Called when the plugin is initialized // This is mostly full of test code. Feel free to remove it all. -void PluginMain() +void PluginMain( + void* memory, + int32_t memorySize, + bool isFirstBoot) { - String message("Game booted up"); - Debug::Log(message); - - String name("GameObject with a TestScript"); - GameObject go(name); - go.AddComponent(); + gameState = (GameState*)memory; + if (isFirstBoot) + { + String message("Game booted up"); + Debug::Log(message); + + gameState->NumCreated = 0; + gameState->Dir = 1.0f; + + String name("GameObject with a TestScript"); + GameObject go(name); + go.AddComponent(); + } } void MyGame::MonoBehaviours::TestScript::Awake() @@ -45,16 +66,15 @@ void MyGame::MonoBehaviours::TestScript::OnCollisionEnter(UnityEngine::Collision void MyGame::MonoBehaviours::TestScript::Update() { - static int32_t numCreated = 0; - if (numCreated < 10) + if (gameState->NumCreated < 10) { GameObject go; Transform transform = go.GetTransform(); - float comp = (float)numCreated; + float comp = (float)gameState->NumCreated; Vector3 position(comp, comp*10.0f, comp*100.0f); transform.SetPosition(position); - numCreated++; - if (numCreated == 10) + gameState->NumCreated++; + if (gameState->NumCreated == 10) { String message("Done spawning game objects"); Debug::Log(message); @@ -78,19 +98,18 @@ void MyGame::MonoBehaviours::AnotherScript::Update() Transform transform = GetTransform(); Vector3 pos = transform.GetPosition(); const float speed = 1.2f; - static float dir = 1.0f; - static float min = -1.5f; - static float max = 1.5f; - Vector3 offset(Time::GetDeltaTime() * speed * dir, 0, 0); + const float min = -1.5f; + const float max = 1.5f; + Vector3 offset(Time::GetDeltaTime() * speed * gameState->Dir, 0, 0); Vector3 newPos = pos + offset; if (newPos.x > max) { - dir = -dir; + gameState->Dir *= -1.0f; newPos.x = max - (newPos.x - max); } else if (newPos.x < min) { - dir = -dir; + gameState->Dir *= -1.0f; newPos.x = min + (min - newPos.x); } transform.SetPosition(newPos); diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index b580994..16eb64f 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -21,6 +21,9 @@ // For malloc(), etc. #include +// For memset(), etc. +#include + // Macro to put before functions that need to be exposed to C# #ifdef _WIN32 #define DLLEXPORT extern "C" __declspec(dllexport) @@ -17153,20 +17156,32 @@ DLLEXPORT void SetCsharpExceptionSystemNullReferenceException(int32_t handle) //////////////////////////////////////////////////////////////// // Called when the plugin is initialized -extern void PluginMain(); +extern void PluginMain( + void* memory, + int32_t memorySize, + bool isFirstBoot); //////////////////////////////////////////////////////////////// // C++ functions for C# to call //////////////////////////////////////////////////////////////// +enum class InitMode : uint8_t +{ + FirstBoot, + Reload +}; + // Init the plugin DLLEXPORT void Init( - int32_t maxManagedObjects, + uint8_t* memory, + int32_t memorySize, + InitMode initMode, void (*releaseObject)(int32_t handle), int32_t (*stringNew)(const char* chars), void (*setException)(int32_t handle), int32_t (*arrayGetLength)(int32_t handle), /*BEGIN INIT PARAMS*/ + int32_t maxManagedObjects, UnityEngine::Vector3 (*unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z), float (*unityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz), void (*unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ), @@ -17426,11 +17441,12 @@ DLLEXPORT void Init( void (*systemComponentModelDesignComponentRenameEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle) /*END INIT PARAMS*/) { - using namespace Plugin; + uint8_t* curMemory = memory; // Init managed object ref counting Plugin::RefCountsLenClass = maxManagedObjects; - Plugin::RefCountsClass = new int32_t[maxManagedObjects](); + Plugin::RefCountsClass = (int32_t*)curMemory; + curMemory += maxManagedObjects * sizeof(int32_t); // Init pointers to C# functions Plugin::StringNew = stringNew; @@ -17457,7 +17473,9 @@ DLLEXPORT void Init( Plugin::BoxGradientColorKey = boxGradientColorKey; Plugin::UnboxGradientColorKey = unboxGradientColorKey; Plugin::ReleaseUnityEngineResolution = releaseUnityEngineResolution; - Plugin::RefCountsUnityEngineResolution = new int32_t[maxManagedObjects](); + Plugin::RefCountsUnityEngineResolution = (int32_t*)curMemory; + curMemory += 1000 * sizeof(int32_t); + Plugin::RefCountsLenUnityEngineResolution = 1000; Plugin::UnityEngineResolutionPropertyGetWidth = unityEngineResolutionPropertyGetWidth; Plugin::UnityEngineResolutionPropertySetWidth = unityEngineResolutionPropertySetWidth; Plugin::UnityEngineResolutionPropertyGetHeight = unityEngineResolutionPropertyGetHeight; @@ -17467,18 +17485,24 @@ DLLEXPORT void Init( Plugin::BoxResolution = boxResolution; Plugin::UnboxResolution = unboxResolution; Plugin::ReleaseUnityEngineRaycastHit = releaseUnityEngineRaycastHit; - Plugin::RefCountsUnityEngineRaycastHit = new int32_t[1000](); + Plugin::RefCountsUnityEngineRaycastHit = (int32_t*)curMemory; + curMemory += 1000 * sizeof(int32_t); + Plugin::RefCountsLenUnityEngineRaycastHit = 1000; Plugin::UnityEngineRaycastHitPropertyGetPoint = unityEngineRaycastHitPropertyGetPoint; Plugin::UnityEngineRaycastHitPropertySetPoint = unityEngineRaycastHitPropertySetPoint; Plugin::UnityEngineRaycastHitPropertyGetTransform = unityEngineRaycastHitPropertyGetTransform; Plugin::BoxRaycastHit = boxRaycastHit; Plugin::UnboxRaycastHit = unboxRaycastHit; Plugin::ReleaseUnityEnginePlayablesPlayableGraph = releaseUnityEnginePlayablesPlayableGraph; - Plugin::RefCountsUnityEnginePlayablesPlayableGraph = new int32_t[maxManagedObjects](); + Plugin::RefCountsUnityEnginePlayablesPlayableGraph = (int32_t*)curMemory; + curMemory += 1000 * sizeof(int32_t); + Plugin::RefCountsLenUnityEnginePlayablesPlayableGraph = 1000; Plugin::BoxPlayableGraph = boxPlayableGraph; Plugin::UnboxPlayableGraph = unboxPlayableGraph; Plugin::ReleaseUnityEngineAnimationsAnimationMixerPlayable = releaseUnityEngineAnimationsAnimationMixerPlayable; - Plugin::RefCountsUnityEngineAnimationsAnimationMixerPlayable = new int32_t[maxManagedObjects](); + Plugin::RefCountsUnityEngineAnimationsAnimationMixerPlayable = (int32_t*)curMemory; + curMemory += 1000 * sizeof(int32_t); + Plugin::RefCountsLenUnityEngineAnimationsAnimationMixerPlayable = 1000; Plugin::UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean = unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean; Plugin::BoxAnimationMixerPlayable = boxAnimationMixerPlayable; Plugin::UnboxAnimationMixerPlayable = unboxAnimationMixerPlayable; @@ -17510,7 +17534,9 @@ DLLEXPORT void Init( Plugin::BoxQueryTriggerInteraction = boxQueryTriggerInteraction; Plugin::UnboxQueryTriggerInteraction = unboxQueryTriggerInteraction; Plugin::ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; - Plugin::RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = new int32_t[maxManagedObjects](); + Plugin::RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = (int32_t*)curMemory; + curMemory += 20 * sizeof(int32_t); + Plugin::RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = 20; Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble = systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble; Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey; Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue; @@ -17535,7 +17561,9 @@ DLLEXPORT void Init( Plugin::SystemExceptionConstructorSystemString = systemExceptionConstructorSystemString; Plugin::UnityEngineScreenPropertyGetResolutions = unityEngineScreenPropertyGetResolutions; Plugin::ReleaseUnityEngineRay = releaseUnityEngineRay; - Plugin::RefCountsUnityEngineRay = new int32_t[maxManagedObjects](); + Plugin::RefCountsUnityEngineRay = (int32_t*)curMemory; + curMemory += 10 * sizeof(int32_t); + Plugin::RefCountsLenUnityEngineRay = 10; Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3 = unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3; Plugin::BoxRay = boxRay; Plugin::UnboxRay = unboxRay; @@ -17552,7 +17580,9 @@ DLLEXPORT void Init( Plugin::UnityEngineSceneManagementSceneManagerAddEventSceneLoaded = unityEngineSceneManagementSceneManagerAddEventSceneLoaded; Plugin::UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded = unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded; Plugin::ReleaseUnityEngineSceneManagementScene = releaseUnityEngineSceneManagementScene; - Plugin::RefCountsUnityEngineSceneManagementScene = new int32_t[maxManagedObjects](); + Plugin::RefCountsUnityEngineSceneManagementScene = (int32_t*)curMemory; + curMemory += 1000 * sizeof(int32_t); + Plugin::RefCountsLenUnityEngineSceneManagementScene = 1000; Plugin::BoxScene = boxScene; Plugin::UnboxScene = unboxScene; Plugin::BoxLoadSceneMode = boxLoadSceneMode; @@ -17564,71 +17594,49 @@ DLLEXPORT void Init( Plugin::UnityEngineTimePropertyGetDeltaTime = unityEngineTimePropertyGetDeltaTime; Plugin::BoxFileMode = boxFileMode; Plugin::UnboxFileMode = unboxFileMode; - SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize = maxManagedObjects; - SystemCollectionsGenericBaseIComparerSystemInt32FreeList = new System::Collections::Generic::BaseIComparer*[SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize]; - for (int32_t i = 0, end = SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize - 1; i < end; ++i) - { - SystemCollectionsGenericBaseIComparerSystemInt32FreeList[i] = (System::Collections::Generic::BaseIComparer*)(SystemCollectionsGenericBaseIComparerSystemInt32FreeList + i + 1); - } - SystemCollectionsGenericBaseIComparerSystemInt32FreeList[SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize - 1] = nullptr; - NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 = SystemCollectionsGenericBaseIComparerSystemInt32FreeList + 1; + Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize = 1000; + Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList = (System::Collections::Generic::BaseIComparer**)curMemory; + curMemory += 1000 * sizeof(System::Collections::Generic::BaseIComparer*); + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32 = releaseSystemCollectionsGenericBaseIComparerSystemInt32; Plugin::SystemCollectionsGenericBaseIComparerSystemInt32Constructor = systemCollectionsGenericBaseIComparerSystemInt32Constructor; - SystemCollectionsGenericBaseIComparerSystemStringFreeListSize = maxManagedObjects; - SystemCollectionsGenericBaseIComparerSystemStringFreeList = new System::Collections::Generic::BaseIComparer*[SystemCollectionsGenericBaseIComparerSystemStringFreeListSize]; - for (int32_t i = 0, end = SystemCollectionsGenericBaseIComparerSystemStringFreeListSize - 1; i < end; ++i) - { - SystemCollectionsGenericBaseIComparerSystemStringFreeList[i] = (System::Collections::Generic::BaseIComparer*)(SystemCollectionsGenericBaseIComparerSystemStringFreeList + i + 1); - } - SystemCollectionsGenericBaseIComparerSystemStringFreeList[SystemCollectionsGenericBaseIComparerSystemStringFreeListSize - 1] = nullptr; - NextFreeSystemCollectionsGenericBaseIComparerSystemString = SystemCollectionsGenericBaseIComparerSystemStringFreeList + 1; + Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeListSize = 1000; + Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeList = (System::Collections::Generic::BaseIComparer**)curMemory; + curMemory += 1000 * sizeof(System::Collections::Generic::BaseIComparer*); + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString = releaseSystemCollectionsGenericBaseIComparerSystemString; Plugin::SystemCollectionsGenericBaseIComparerSystemStringConstructor = systemCollectionsGenericBaseIComparerSystemStringConstructor; - SystemBaseStringComparerFreeListSize = maxManagedObjects; - SystemBaseStringComparerFreeList = new System::BaseStringComparer*[SystemBaseStringComparerFreeListSize]; - for (int32_t i = 0, end = SystemBaseStringComparerFreeListSize - 1; i < end; ++i) - { - SystemBaseStringComparerFreeList[i] = (System::BaseStringComparer*)(SystemBaseStringComparerFreeList + i + 1); - } - SystemBaseStringComparerFreeList[SystemBaseStringComparerFreeListSize - 1] = nullptr; - NextFreeSystemBaseStringComparer = SystemBaseStringComparerFreeList + 1; + Plugin::SystemBaseStringComparerFreeListSize = 1000; + Plugin::SystemBaseStringComparerFreeList = (System::BaseStringComparer**)curMemory; + curMemory += 1000 * sizeof(System::BaseStringComparer*); + Plugin::ReleaseSystemBaseStringComparer = releaseSystemBaseStringComparer; Plugin::SystemBaseStringComparerConstructor = systemBaseStringComparerConstructor; Plugin::SystemCollectionsQueuePropertyGetCount = systemCollectionsQueuePropertyGetCount; - SystemCollectionsBaseQueueFreeListSize = maxManagedObjects; - SystemCollectionsBaseQueueFreeList = new System::Collections::BaseQueue*[SystemCollectionsBaseQueueFreeListSize]; - for (int32_t i = 0, end = SystemCollectionsBaseQueueFreeListSize - 1; i < end; ++i) - { - SystemCollectionsBaseQueueFreeList[i] = (System::Collections::BaseQueue*)(SystemCollectionsBaseQueueFreeList + i + 1); - } - SystemCollectionsBaseQueueFreeList[SystemCollectionsBaseQueueFreeListSize - 1] = nullptr; - NextFreeSystemCollectionsBaseQueue = SystemCollectionsBaseQueueFreeList + 1; + Plugin::SystemCollectionsBaseQueueFreeListSize = 1000; + Plugin::SystemCollectionsBaseQueueFreeList = (System::Collections::BaseQueue**)curMemory; + curMemory += 1000 * sizeof(System::Collections::BaseQueue*); + Plugin::ReleaseSystemCollectionsBaseQueue = releaseSystemCollectionsBaseQueue; Plugin::SystemCollectionsBaseQueueConstructor = systemCollectionsBaseQueueConstructor; - SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize = maxManagedObjects; - SystemComponentModelDesignBaseIComponentChangeServiceFreeList = new System::ComponentModel::Design::BaseIComponentChangeService*[SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize]; - for (int32_t i = 0, end = SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize - 1; i < end; ++i) - { - SystemComponentModelDesignBaseIComponentChangeServiceFreeList[i] = (System::ComponentModel::Design::BaseIComponentChangeService*)(SystemComponentModelDesignBaseIComponentChangeServiceFreeList + i + 1); - } - SystemComponentModelDesignBaseIComponentChangeServiceFreeList[SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize - 1] = nullptr; - NextFreeSystemComponentModelDesignBaseIComponentChangeService = SystemComponentModelDesignBaseIComponentChangeServiceFreeList + 1; + Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize = 1000; + Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeList = (System::ComponentModel::Design::BaseIComponentChangeService**)curMemory; + curMemory += 1000 * sizeof(System::ComponentModel::Design::BaseIComponentChangeService*); + Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService = releaseSystemComponentModelDesignBaseIComponentChangeService; Plugin::SystemComponentModelDesignBaseIComponentChangeServiceConstructor = systemComponentModelDesignBaseIComponentChangeServiceConstructor; Plugin::SystemIOFileStreamConstructorSystemString_SystemIOFileMode = systemIOFileStreamConstructorSystemString_SystemIOFileMode; Plugin::SystemIOFileStreamMethodWriteByteSystemByte = systemIOFileStreamMethodWriteByteSystemByte; - SystemIOBaseFileStreamFreeListSize = maxManagedObjects; - SystemIOBaseFileStreamFreeList = new System::IO::BaseFileStream*[SystemIOBaseFileStreamFreeListSize]; - for (int32_t i = 0, end = SystemIOBaseFileStreamFreeListSize - 1; i < end; ++i) - { - SystemIOBaseFileStreamFreeList[i] = (System::IO::BaseFileStream*)(SystemIOBaseFileStreamFreeList + i + 1); - } - SystemIOBaseFileStreamFreeList[SystemIOBaseFileStreamFreeListSize - 1] = nullptr; - NextFreeSystemIOBaseFileStream = SystemIOBaseFileStreamFreeList + 1; + Plugin::SystemIOBaseFileStreamFreeListSize = 1000; + Plugin::SystemIOBaseFileStreamFreeList = (System::IO::BaseFileStream**)curMemory; + curMemory += 1000 * sizeof(System::IO::BaseFileStream*); + Plugin::ReleaseSystemIOBaseFileStream = releaseSystemIOBaseFileStream; Plugin::SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode = systemIOBaseFileStreamConstructorSystemString_SystemIOFileMode; Plugin::ReleaseUnityEnginePlayablesPlayableHandle = releaseUnityEnginePlayablesPlayableHandle; - Plugin::RefCountsUnityEnginePlayablesPlayableHandle = new int32_t[maxManagedObjects](); + Plugin::RefCountsUnityEnginePlayablesPlayableHandle = (int32_t*)curMemory; + curMemory += 1000 * sizeof(int32_t); + Plugin::RefCountsLenUnityEnginePlayablesPlayableHandle = 1000; Plugin::BoxPlayableHandle = boxPlayableHandle; Plugin::UnboxPlayableHandle = unboxPlayableHandle; Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1 = unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1; @@ -17638,7 +17646,9 @@ DLLEXPORT void Init( Plugin::BoxInteractionSourceNode = boxInteractionSourceNode; Plugin::UnboxInteractionSourceNode = unboxInteractionSourceNode; Plugin::ReleaseUnityEngineXRWSAInputInteractionSourcePose = releaseUnityEngineXRWSAInputInteractionSourcePose; - Plugin::RefCountsUnityEngineXRWSAInputInteractionSourcePose = new int32_t[maxManagedObjects](); + Plugin::RefCountsUnityEngineXRWSAInputInteractionSourcePose = (int32_t*)curMemory; + curMemory += 1000 * sizeof(int32_t); + Plugin::RefCountsLenUnityEngineXRWSAInputInteractionSourcePose = 1000; Plugin::UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode = unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode; Plugin::BoxInteractionSourcePose = boxInteractionSourcePose; Plugin::UnboxInteractionSourcePose = unboxInteractionSourcePose; @@ -17692,157 +17702,109 @@ DLLEXPORT void Init( Plugin::UnityEngineUnityEngineGradientColorKeyArray1Constructor1 = unityEngineUnityEngineGradientColorKeyArray1Constructor1; Plugin::UnityEngineGradientColorKeyArray1GetItem1 = unityEngineGradientColorKeyArray1GetItem1; Plugin::UnityEngineGradientColorKeyArray1SetItem1 = unityEngineGradientColorKeyArray1SetItem1; - SystemActionFreeListSize = maxManagedObjects; - SystemActionFreeList = new System::Action*[SystemActionFreeListSize]; - for (int32_t i = 0, end = SystemActionFreeListSize - 1; i < end; ++i) - { - SystemActionFreeList[i] = (System::Action*)(SystemActionFreeList + i + 1); - } - SystemActionFreeList[SystemActionFreeListSize - 1] = nullptr; - NextFreeSystemAction = SystemActionFreeList + 1; + Plugin::SystemActionFreeListSize = 1000; + Plugin::SystemActionFreeList = (System::Action**)curMemory; + curMemory += 1000 * sizeof(System::Action*); + Plugin::ReleaseSystemAction = releaseSystemAction; Plugin::SystemActionConstructor = systemActionConstructor; Plugin::SystemActionAdd = systemActionAdd; Plugin::SystemActionRemove = systemActionRemove; Plugin::SystemActionInvoke = systemActionInvoke; - SystemActionSystemSingleFreeListSize = maxManagedObjects; - SystemActionSystemSingleFreeList = new System::Action1*[SystemActionSystemSingleFreeListSize]; - for (int32_t i = 0, end = SystemActionSystemSingleFreeListSize - 1; i < end; ++i) - { - SystemActionSystemSingleFreeList[i] = (System::Action1*)(SystemActionSystemSingleFreeList + i + 1); - } - SystemActionSystemSingleFreeList[SystemActionSystemSingleFreeListSize - 1] = nullptr; - NextFreeSystemActionSystemSingle = SystemActionSystemSingleFreeList + 1; + Plugin::SystemActionSystemSingleFreeListSize = 1000; + Plugin::SystemActionSystemSingleFreeList = (System::Action1**)curMemory; + curMemory += 1000 * sizeof(System::Action1*); + Plugin::ReleaseSystemActionSystemSingle = releaseSystemActionSystemSingle; Plugin::SystemActionSystemSingleConstructor = systemActionSystemSingleConstructor; Plugin::SystemActionSystemSingleAdd = systemActionSystemSingleAdd; Plugin::SystemActionSystemSingleRemove = systemActionSystemSingleRemove; Plugin::SystemActionSystemSingleInvoke = systemActionSystemSingleInvoke; - SystemActionSystemSingle_SystemSingleFreeListSize = 100; - SystemActionSystemSingle_SystemSingleFreeList = new System::Action2*[SystemActionSystemSingle_SystemSingleFreeListSize]; - for (int32_t i = 0, end = SystemActionSystemSingle_SystemSingleFreeListSize - 1; i < end; ++i) - { - SystemActionSystemSingle_SystemSingleFreeList[i] = (System::Action2*)(SystemActionSystemSingle_SystemSingleFreeList + i + 1); - } - SystemActionSystemSingle_SystemSingleFreeList[SystemActionSystemSingle_SystemSingleFreeListSize - 1] = nullptr; - NextFreeSystemActionSystemSingle_SystemSingle = SystemActionSystemSingle_SystemSingleFreeList + 1; + Plugin::SystemActionSystemSingle_SystemSingleFreeListSize = 100; + Plugin::SystemActionSystemSingle_SystemSingleFreeList = (System::Action2**)curMemory; + curMemory += 100 * sizeof(System::Action2*); + Plugin::ReleaseSystemActionSystemSingle_SystemSingle = releaseSystemActionSystemSingle_SystemSingle; Plugin::SystemActionSystemSingle_SystemSingleConstructor = systemActionSystemSingle_SystemSingleConstructor; Plugin::SystemActionSystemSingle_SystemSingleAdd = systemActionSystemSingle_SystemSingleAdd; Plugin::SystemActionSystemSingle_SystemSingleRemove = systemActionSystemSingle_SystemSingleRemove; Plugin::SystemActionSystemSingle_SystemSingleInvoke = systemActionSystemSingle_SystemSingleInvoke; - SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize = 50; - SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList = new System::Func3*[SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize]; - for (int32_t i = 0, end = SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize - 1; i < end; ++i) - { - SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[i] = (System::Func3*)(SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + i + 1); - } - SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize - 1] = nullptr; - NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble = SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + 1; + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize = 50; + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList = (System::Func3**)curMemory; + curMemory += 50 * sizeof(System::Func3*); + Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble = releaseSystemFuncSystemInt32_SystemSingle_SystemDouble; Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor = systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor; Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd = systemFuncSystemInt32_SystemSingle_SystemDoubleAdd; Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove = systemFuncSystemInt32_SystemSingle_SystemDoubleRemove; Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke = systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke; - SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize = 25; - SystemFuncSystemInt16_SystemInt32_SystemStringFreeList = new System::Func3*[SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize]; - for (int32_t i = 0, end = SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize - 1; i < end; ++i) - { - SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[i] = (System::Func3*)(SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + i + 1); - } - SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize - 1] = nullptr; - NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + 1; + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize = 25; + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList = (System::Func3**)curMemory; + curMemory += 25 * sizeof(System::Func3*); + Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString = releaseSystemFuncSystemInt16_SystemInt32_SystemString; Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor = systemFuncSystemInt16_SystemInt32_SystemStringConstructor; Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd = systemFuncSystemInt16_SystemInt32_SystemStringAdd; Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove = systemFuncSystemInt16_SystemInt32_SystemStringRemove; Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke = systemFuncSystemInt16_SystemInt32_SystemStringInvoke; - SystemAppDomainInitializerFreeListSize = maxManagedObjects; - SystemAppDomainInitializerFreeList = new System::AppDomainInitializer*[SystemAppDomainInitializerFreeListSize]; - for (int32_t i = 0, end = SystemAppDomainInitializerFreeListSize - 1; i < end; ++i) - { - SystemAppDomainInitializerFreeList[i] = (System::AppDomainInitializer*)(SystemAppDomainInitializerFreeList + i + 1); - } - SystemAppDomainInitializerFreeList[SystemAppDomainInitializerFreeListSize - 1] = nullptr; - NextFreeSystemAppDomainInitializer = SystemAppDomainInitializerFreeList + 1; + Plugin::SystemAppDomainInitializerFreeListSize = 1000; + Plugin::SystemAppDomainInitializerFreeList = (System::AppDomainInitializer**)curMemory; + curMemory += 1000 * sizeof(System::AppDomainInitializer*); + Plugin::ReleaseSystemAppDomainInitializer = releaseSystemAppDomainInitializer; Plugin::SystemAppDomainInitializerConstructor = systemAppDomainInitializerConstructor; Plugin::SystemAppDomainInitializerAdd = systemAppDomainInitializerAdd; Plugin::SystemAppDomainInitializerRemove = systemAppDomainInitializerRemove; Plugin::SystemAppDomainInitializerInvoke = systemAppDomainInitializerInvoke; - UnityEngineEventsUnityActionFreeListSize = maxManagedObjects; - UnityEngineEventsUnityActionFreeList = new UnityEngine::Events::UnityAction*[UnityEngineEventsUnityActionFreeListSize]; - for (int32_t i = 0, end = UnityEngineEventsUnityActionFreeListSize - 1; i < end; ++i) - { - UnityEngineEventsUnityActionFreeList[i] = (UnityEngine::Events::UnityAction*)(UnityEngineEventsUnityActionFreeList + i + 1); - } - UnityEngineEventsUnityActionFreeList[UnityEngineEventsUnityActionFreeListSize - 1] = nullptr; - NextFreeUnityEngineEventsUnityAction = UnityEngineEventsUnityActionFreeList + 1; + Plugin::UnityEngineEventsUnityActionFreeListSize = 1000; + Plugin::UnityEngineEventsUnityActionFreeList = (UnityEngine::Events::UnityAction**)curMemory; + curMemory += 1000 * sizeof(UnityEngine::Events::UnityAction*); + Plugin::ReleaseUnityEngineEventsUnityAction = releaseUnityEngineEventsUnityAction; Plugin::UnityEngineEventsUnityActionConstructor = unityEngineEventsUnityActionConstructor; Plugin::UnityEngineEventsUnityActionAdd = unityEngineEventsUnityActionAdd; Plugin::UnityEngineEventsUnityActionRemove = unityEngineEventsUnityActionRemove; Plugin::UnityEngineEventsUnityActionInvoke = unityEngineEventsUnityActionInvoke; - UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize = 10; - UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList = new UnityEngine::Events::UnityAction2*[UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize]; - for (int32_t i = 0, end = UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize - 1; i < end; ++i) - { - UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList[i] = (UnityEngine::Events::UnityAction2*)(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList + i + 1); - } - UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList[UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize - 1] = nullptr; - NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList + 1; + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize = 10; + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList = (UnityEngine::Events::UnityAction2**)curMemory; + curMemory += 10 * sizeof(UnityEngine::Events::UnityAction2*); + Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = releaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor; Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd; Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove; Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke; - SystemComponentModelDesignComponentEventHandlerFreeListSize = maxManagedObjects; - SystemComponentModelDesignComponentEventHandlerFreeList = new System::ComponentModel::Design::ComponentEventHandler*[SystemComponentModelDesignComponentEventHandlerFreeListSize]; - for (int32_t i = 0, end = SystemComponentModelDesignComponentEventHandlerFreeListSize - 1; i < end; ++i) - { - SystemComponentModelDesignComponentEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentEventHandler*)(SystemComponentModelDesignComponentEventHandlerFreeList + i + 1); - } - SystemComponentModelDesignComponentEventHandlerFreeList[SystemComponentModelDesignComponentEventHandlerFreeListSize - 1] = nullptr; - NextFreeSystemComponentModelDesignComponentEventHandler = SystemComponentModelDesignComponentEventHandlerFreeList + 1; + Plugin::SystemComponentModelDesignComponentEventHandlerFreeListSize = 1000; + Plugin::SystemComponentModelDesignComponentEventHandlerFreeList = (System::ComponentModel::Design::ComponentEventHandler**)curMemory; + curMemory += 1000 * sizeof(System::ComponentModel::Design::ComponentEventHandler*); + Plugin::ReleaseSystemComponentModelDesignComponentEventHandler = releaseSystemComponentModelDesignComponentEventHandler; Plugin::SystemComponentModelDesignComponentEventHandlerConstructor = systemComponentModelDesignComponentEventHandlerConstructor; Plugin::SystemComponentModelDesignComponentEventHandlerAdd = systemComponentModelDesignComponentEventHandlerAdd; Plugin::SystemComponentModelDesignComponentEventHandlerRemove = systemComponentModelDesignComponentEventHandlerRemove; Plugin::SystemComponentModelDesignComponentEventHandlerInvoke = systemComponentModelDesignComponentEventHandlerInvoke; - SystemComponentModelDesignComponentChangingEventHandlerFreeListSize = maxManagedObjects; - SystemComponentModelDesignComponentChangingEventHandlerFreeList = new System::ComponentModel::Design::ComponentChangingEventHandler*[SystemComponentModelDesignComponentChangingEventHandlerFreeListSize]; - for (int32_t i = 0, end = SystemComponentModelDesignComponentChangingEventHandlerFreeListSize - 1; i < end; ++i) - { - SystemComponentModelDesignComponentChangingEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentChangingEventHandler*)(SystemComponentModelDesignComponentChangingEventHandlerFreeList + i + 1); - } - SystemComponentModelDesignComponentChangingEventHandlerFreeList[SystemComponentModelDesignComponentChangingEventHandlerFreeListSize - 1] = nullptr; - NextFreeSystemComponentModelDesignComponentChangingEventHandler = SystemComponentModelDesignComponentChangingEventHandlerFreeList + 1; + Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeListSize = 1000; + Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeList = (System::ComponentModel::Design::ComponentChangingEventHandler**)curMemory; + curMemory += 1000 * sizeof(System::ComponentModel::Design::ComponentChangingEventHandler*); + Plugin::ReleaseSystemComponentModelDesignComponentChangingEventHandler = releaseSystemComponentModelDesignComponentChangingEventHandler; Plugin::SystemComponentModelDesignComponentChangingEventHandlerConstructor = systemComponentModelDesignComponentChangingEventHandlerConstructor; Plugin::SystemComponentModelDesignComponentChangingEventHandlerAdd = systemComponentModelDesignComponentChangingEventHandlerAdd; Plugin::SystemComponentModelDesignComponentChangingEventHandlerRemove = systemComponentModelDesignComponentChangingEventHandlerRemove; Plugin::SystemComponentModelDesignComponentChangingEventHandlerInvoke = systemComponentModelDesignComponentChangingEventHandlerInvoke; - SystemComponentModelDesignComponentChangedEventHandlerFreeListSize = maxManagedObjects; - SystemComponentModelDesignComponentChangedEventHandlerFreeList = new System::ComponentModel::Design::ComponentChangedEventHandler*[SystemComponentModelDesignComponentChangedEventHandlerFreeListSize]; - for (int32_t i = 0, end = SystemComponentModelDesignComponentChangedEventHandlerFreeListSize - 1; i < end; ++i) - { - SystemComponentModelDesignComponentChangedEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentChangedEventHandler*)(SystemComponentModelDesignComponentChangedEventHandlerFreeList + i + 1); - } - SystemComponentModelDesignComponentChangedEventHandlerFreeList[SystemComponentModelDesignComponentChangedEventHandlerFreeListSize - 1] = nullptr; - NextFreeSystemComponentModelDesignComponentChangedEventHandler = SystemComponentModelDesignComponentChangedEventHandlerFreeList + 1; + Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeListSize = 1000; + Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeList = (System::ComponentModel::Design::ComponentChangedEventHandler**)curMemory; + curMemory += 1000 * sizeof(System::ComponentModel::Design::ComponentChangedEventHandler*); + Plugin::ReleaseSystemComponentModelDesignComponentChangedEventHandler = releaseSystemComponentModelDesignComponentChangedEventHandler; Plugin::SystemComponentModelDesignComponentChangedEventHandlerConstructor = systemComponentModelDesignComponentChangedEventHandlerConstructor; Plugin::SystemComponentModelDesignComponentChangedEventHandlerAdd = systemComponentModelDesignComponentChangedEventHandlerAdd; Plugin::SystemComponentModelDesignComponentChangedEventHandlerRemove = systemComponentModelDesignComponentChangedEventHandlerRemove; Plugin::SystemComponentModelDesignComponentChangedEventHandlerInvoke = systemComponentModelDesignComponentChangedEventHandlerInvoke; - SystemComponentModelDesignComponentRenameEventHandlerFreeListSize = maxManagedObjects; - SystemComponentModelDesignComponentRenameEventHandlerFreeList = new System::ComponentModel::Design::ComponentRenameEventHandler*[SystemComponentModelDesignComponentRenameEventHandlerFreeListSize]; - for (int32_t i = 0, end = SystemComponentModelDesignComponentRenameEventHandlerFreeListSize - 1; i < end; ++i) - { - SystemComponentModelDesignComponentRenameEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentRenameEventHandler*)(SystemComponentModelDesignComponentRenameEventHandlerFreeList + i + 1); - } - SystemComponentModelDesignComponentRenameEventHandlerFreeList[SystemComponentModelDesignComponentRenameEventHandlerFreeListSize - 1] = nullptr; - NextFreeSystemComponentModelDesignComponentRenameEventHandler = SystemComponentModelDesignComponentRenameEventHandlerFreeList + 1; + Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeListSize = 1000; + Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeList = (System::ComponentModel::Design::ComponentRenameEventHandler**)curMemory; + curMemory += 1000 * sizeof(System::ComponentModel::Design::ComponentRenameEventHandler*); + Plugin::ReleaseSystemComponentModelDesignComponentRenameEventHandler = releaseSystemComponentModelDesignComponentRenameEventHandler; Plugin::SystemComponentModelDesignComponentRenameEventHandlerConstructor = systemComponentModelDesignComponentRenameEventHandlerConstructor; Plugin::SystemComponentModelDesignComponentRenameEventHandlerAdd = systemComponentModelDesignComponentRenameEventHandlerAdd; @@ -17850,9 +17812,155 @@ DLLEXPORT void Init( Plugin::SystemComponentModelDesignComponentRenameEventHandlerInvoke = systemComponentModelDesignComponentRenameEventHandlerInvoke; /*END INIT BODY*/ + // Make sure there was enough memory + int32_t usedMemory = curMemory - (uint8_t*)memory; + if (usedMemory > memorySize) + { + System::String msg = "Plugin memory size is too low"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return; + } + + if (initMode == InitMode::FirstBoot) + { + memset(memory, 0, memorySize); + + /*BEGIN INIT BODY FIRST BOOT*/ + for (int32_t i = 0, end = Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize - 1; i < end; ++i) + { + Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList[i] = (System::Collections::Generic::BaseIComparer*)(Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList + i + 1); + } + Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList[Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize - 1] = nullptr; + Plugin::NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 = Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeListSize - 1; i < end; ++i) + { + Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeList[i] = (System::Collections::Generic::BaseIComparer*)(Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeList + i + 1); + } + Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeList[Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemCollectionsGenericBaseIComparerSystemString = Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemBaseStringComparerFreeListSize - 1; i < end; ++i) + { + Plugin::SystemBaseStringComparerFreeList[i] = (System::BaseStringComparer*)(Plugin::SystemBaseStringComparerFreeList + i + 1); + } + Plugin::SystemBaseStringComparerFreeList[Plugin::SystemBaseStringComparerFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemBaseStringComparer = Plugin::SystemBaseStringComparerFreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemCollectionsBaseQueueFreeListSize - 1; i < end; ++i) + { + Plugin::SystemCollectionsBaseQueueFreeList[i] = (System::Collections::BaseQueue*)(Plugin::SystemCollectionsBaseQueueFreeList + i + 1); + } + Plugin::SystemCollectionsBaseQueueFreeList[Plugin::SystemCollectionsBaseQueueFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemCollectionsBaseQueue = Plugin::SystemCollectionsBaseQueueFreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize - 1; i < end; ++i) + { + Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeList[i] = (System::ComponentModel::Design::BaseIComponentChangeService*)(Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeList + i + 1); + } + Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeList[Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemComponentModelDesignBaseIComponentChangeService = Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemIOBaseFileStreamFreeListSize - 1; i < end; ++i) + { + Plugin::SystemIOBaseFileStreamFreeList[i] = (System::IO::BaseFileStream*)(Plugin::SystemIOBaseFileStreamFreeList + i + 1); + } + Plugin::SystemIOBaseFileStreamFreeList[Plugin::SystemIOBaseFileStreamFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemIOBaseFileStream = Plugin::SystemIOBaseFileStreamFreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemActionFreeListSize - 1; i < end; ++i) + { + Plugin::SystemActionFreeList[i] = (System::Action*)(Plugin::SystemActionFreeList + i + 1); + } + Plugin::SystemActionFreeList[Plugin::SystemActionFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemAction = Plugin::SystemActionFreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemActionSystemSingleFreeListSize - 1; i < end; ++i) + { + Plugin::SystemActionSystemSingleFreeList[i] = (System::Action1*)(Plugin::SystemActionSystemSingleFreeList + i + 1); + } + Plugin::SystemActionSystemSingleFreeList[Plugin::SystemActionSystemSingleFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemActionSystemSingle = Plugin::SystemActionSystemSingleFreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemActionSystemSingle_SystemSingleFreeListSize - 1; i < end; ++i) + { + Plugin::SystemActionSystemSingle_SystemSingleFreeList[i] = (System::Action2*)(Plugin::SystemActionSystemSingle_SystemSingleFreeList + i + 1); + } + Plugin::SystemActionSystemSingle_SystemSingleFreeList[Plugin::SystemActionSystemSingle_SystemSingleFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemActionSystemSingle_SystemSingle = Plugin::SystemActionSystemSingle_SystemSingleFreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize - 1; i < end; ++i) + { + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[i] = (System::Func3*)(Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + i + 1); + } + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize - 1; i < end; ++i) + { + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[i] = (System::Func3*)(Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + i + 1); + } + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemAppDomainInitializerFreeListSize - 1; i < end; ++i) + { + Plugin::SystemAppDomainInitializerFreeList[i] = (System::AppDomainInitializer*)(Plugin::SystemAppDomainInitializerFreeList + i + 1); + } + Plugin::SystemAppDomainInitializerFreeList[Plugin::SystemAppDomainInitializerFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemAppDomainInitializer = Plugin::SystemAppDomainInitializerFreeList + 1; + + for (int32_t i = 0, end = Plugin::UnityEngineEventsUnityActionFreeListSize - 1; i < end; ++i) + { + Plugin::UnityEngineEventsUnityActionFreeList[i] = (UnityEngine::Events::UnityAction*)(Plugin::UnityEngineEventsUnityActionFreeList + i + 1); + } + Plugin::UnityEngineEventsUnityActionFreeList[Plugin::UnityEngineEventsUnityActionFreeListSize - 1] = nullptr; + Plugin::NextFreeUnityEngineEventsUnityAction = Plugin::UnityEngineEventsUnityActionFreeList + 1; + + for (int32_t i = 0, end = Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize - 1; i < end; ++i) + { + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList[i] = (UnityEngine::Events::UnityAction2*)(Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList + i + 1); + } + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList[Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize - 1] = nullptr; + Plugin::NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemComponentModelDesignComponentEventHandlerFreeListSize - 1; i < end; ++i) + { + Plugin::SystemComponentModelDesignComponentEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentEventHandler*)(Plugin::SystemComponentModelDesignComponentEventHandlerFreeList + i + 1); + } + Plugin::SystemComponentModelDesignComponentEventHandlerFreeList[Plugin::SystemComponentModelDesignComponentEventHandlerFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemComponentModelDesignComponentEventHandler = Plugin::SystemComponentModelDesignComponentEventHandlerFreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeListSize - 1; i < end; ++i) + { + Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentChangingEventHandler*)(Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeList + i + 1); + } + Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeList[Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemComponentModelDesignComponentChangingEventHandler = Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeListSize - 1; i < end; ++i) + { + Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentChangedEventHandler*)(Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeList + i + 1); + } + Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeList[Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemComponentModelDesignComponentChangedEventHandler = Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeList + 1; + + for (int32_t i = 0, end = Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeListSize - 1; i < end; ++i) + { + Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentRenameEventHandler*)(Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeList + i + 1); + } + Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeList[Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeListSize - 1] = nullptr; + Plugin::NextFreeSystemComponentModelDesignComponentRenameEventHandler = Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeList + 1; + /*END INIT BODY FIRST BOOT*/ + } + try { - PluginMain(); + PluginMain( + curMemory, + memorySize - usedMemory, + initMode == InitMode::FirstBoot); } catch (System::Exception ex) { From 0f37ca2eef5dc96c624eae2b0c23699e7a950b1b Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 14 Jan 2018 22:33:01 -0800 Subject: [PATCH 54/95] Support "range for loops" for arrays, IEnumerator, and IEnumerator --- Unity/Assets/NativeScript/Bindings.cs | 499 ++- .../NativeScript/Editor/GenerateBindings.cs | 460 ++- Unity/Assets/NativeScriptTypes.json | 95 +- Unity/CppSource/NativeScript/Bindings.cpp | 3224 +++++++++++++---- Unity/CppSource/NativeScript/Bindings.h | 1335 +++++-- 5 files changed, 4624 insertions(+), 989 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index bb527ea..825944f 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -303,7 +303,7 @@ enum InitMode : byte #if UNITY_EDITOR // Handle to the C++ DLL static IntPtr libraryHandle; - + delegate void InitDelegate( IntPtr memory, int memorySize, @@ -312,8 +312,11 @@ delegate void InitDelegate( IntPtr stringNew, IntPtr setException, IntPtr arrayGetLength, + IntPtr enumerableGetEnumerator, /*BEGIN INIT PARAMS*/ - int maxManagedObjects, IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, + int maxManagedObjects, + IntPtr systemIDisposableMethodDispose, + IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3PropertyGetMagnitude, IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, @@ -327,6 +330,7 @@ delegate void InitDelegate( IntPtr unityEngineComponentPropertyGetTransform, IntPtr unityEngineTransformPropertyGetPosition, IntPtr unityEngineTransformPropertySetPosition, + IntPtr unityEngineTransformMethodSetParentUnityEngineTransform, IntPtr boxColor, IntPtr unboxColor, IntPtr boxGradientColorKey, @@ -346,6 +350,20 @@ delegate void InitDelegate( IntPtr unityEngineRaycastHitPropertyGetTransform, IntPtr boxRaycastHit, IntPtr unboxRaycastHit, + IntPtr systemCollectionsIEnumeratorPropertyGetCurrent, + IntPtr systemCollectionsIEnumeratorMethodMoveNext, + IntPtr systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator, IntPtr releaseUnityEnginePlayablesPlayableGraph, IntPtr boxPlayableGraph, IntPtr unboxPlayableGraph, @@ -425,8 +443,6 @@ delegate void InitDelegate( IntPtr unboxScene, IntPtr boxLoadSceneMode, IntPtr unboxLoadSceneMode, - IntPtr systemCollectionsIEnumeratorPropertyGetCurrent, - IntPtr systemCollectionsIEnumeratorMethodMoveNext, IntPtr boxPrimitiveType, IntPtr unboxPrimitiveType, IntPtr unityEngineTimePropertyGetDeltaTime, @@ -800,8 +816,11 @@ static extern void Init( IntPtr stringNew, IntPtr setException, IntPtr arrayGetLength, + IntPtr enumerableGetEnumerator, /*BEGIN INIT PARAMS*/ - int maxManagedObjects, IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, + int maxManagedObjects, + IntPtr systemIDisposableMethodDispose, + IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3PropertyGetMagnitude, IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, @@ -815,6 +834,7 @@ static extern void Init( IntPtr unityEngineComponentPropertyGetTransform, IntPtr unityEngineTransformPropertyGetPosition, IntPtr unityEngineTransformPropertySetPosition, + IntPtr unityEngineTransformMethodSetParentUnityEngineTransform, IntPtr boxColor, IntPtr unboxColor, IntPtr boxGradientColorKey, @@ -834,6 +854,20 @@ static extern void Init( IntPtr unityEngineRaycastHitPropertyGetTransform, IntPtr boxRaycastHit, IntPtr unboxRaycastHit, + IntPtr systemCollectionsIEnumeratorPropertyGetCurrent, + IntPtr systemCollectionsIEnumeratorMethodMoveNext, + IntPtr systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator, IntPtr releaseUnityEnginePlayablesPlayableGraph, IntPtr boxPlayableGraph, IntPtr unboxPlayableGraph, @@ -913,8 +947,6 @@ static extern void Init( IntPtr unboxScene, IntPtr boxLoadSceneMode, IntPtr unboxLoadSceneMode, - IntPtr systemCollectionsIEnumeratorPropertyGetCurrent, - IntPtr systemCollectionsIEnumeratorMethodMoveNext, IntPtr boxPrimitiveType, IntPtr unboxPrimitiveType, IntPtr unityEngineTimePropertyGetDeltaTime, @@ -1196,8 +1228,10 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate int StringNewDelegate(string chars); delegate void SetExceptionDelegate(int handle); delegate int ArrayGetLengthDelegate(int handle); + delegate int EnumerableGetEnumeratorDelegate(int handle); /*BEGIN DELEGATE TYPES*/ + delegate void SystemIDisposableMethodDisposeDelegate(int thisHandle); 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); @@ -1212,6 +1246,7 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate int UnityEngineComponentPropertyGetTransformDelegate(int thisHandle); delegate UnityEngine.Vector3 UnityEngineTransformPropertyGetPositionDelegate(int thisHandle); delegate void UnityEngineTransformPropertySetPositionDelegate(int thisHandle, ref UnityEngine.Vector3 value); + delegate void UnityEngineTransformMethodSetParentUnityEngineTransformDelegate(int thisHandle, int parentHandle); delegate int BoxColorDelegate(ref UnityEngine.Color val); delegate UnityEngine.Color UnboxColorDelegate(int valHandle); delegate int BoxGradientColorKeyDelegate(ref UnityEngine.GradientColorKey val); @@ -1231,6 +1266,20 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate int UnityEngineRaycastHitPropertyGetTransformDelegate(int thisHandle); delegate int BoxRaycastHitDelegate(int valHandle); delegate int UnboxRaycastHitDelegate(int valHandle); + delegate int SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(int thisHandle); + delegate bool SystemCollectionsIEnumeratorMethodMoveNextDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrentDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrentDelegate(int thisHandle); + delegate float SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrentDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrentDelegate(int thisHandle); + delegate UnityEngine.GradientColorKey SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrentDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrentDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumeratorDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumeratorDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumeratorDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumeratorDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumeratorDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumeratorDelegate(int thisHandle); delegate void ReleaseUnityEnginePlayablesPlayableGraphDelegate(int handle); delegate int BoxPlayableGraphDelegate(int valHandle); delegate int UnboxPlayableGraphDelegate(int valHandle); @@ -1310,8 +1359,6 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate int UnboxSceneDelegate(int valHandle); delegate int BoxLoadSceneModeDelegate(UnityEngine.SceneManagement.LoadSceneMode val); delegate UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneModeDelegate(int valHandle); - delegate int SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(int thisHandle); - delegate bool SystemCollectionsIEnumeratorMethodMoveNextDelegate(int thisHandle); delegate int BoxPrimitiveTypeDelegate(UnityEngine.PrimitiveType val); delegate UnityEngine.PrimitiveType UnboxPrimitiveTypeDelegate(int valHandle); delegate float UnityEngineTimePropertyGetDeltaTimeDelegate(); @@ -1606,8 +1653,10 @@ private static void OpenPlugin(InitMode initMode) Marshal.GetFunctionPointerForDelegate(new StringNewDelegate(StringNew)), Marshal.GetFunctionPointerForDelegate(new SetExceptionDelegate(SetException)), Marshal.GetFunctionPointerForDelegate(new ArrayGetLengthDelegate(ArrayGetLength)), + Marshal.GetFunctionPointerForDelegate(new EnumerableGetEnumeratorDelegate(EnumerableGetEnumerator)), /*BEGIN INIT CALL*/ 1000, + Marshal.GetFunctionPointerForDelegate(new SystemIDisposableMethodDisposeDelegate(SystemIDisposableMethodDispose)), Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)), Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3PropertyGetMagnitudeDelegate(UnityEngineVector3PropertyGetMagnitude)), Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingleDelegate(UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)), @@ -1622,6 +1671,7 @@ private static void OpenPlugin(InitMode initMode) Marshal.GetFunctionPointerForDelegate(new UnityEngineComponentPropertyGetTransformDelegate(UnityEngineComponentPropertyGetTransform)), Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformPropertyGetPositionDelegate(UnityEngineTransformPropertyGetPosition)), Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformPropertySetPositionDelegate(UnityEngineTransformPropertySetPosition)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformMethodSetParentUnityEngineTransformDelegate(UnityEngineTransformMethodSetParentUnityEngineTransform)), Marshal.GetFunctionPointerForDelegate(new BoxColorDelegate(BoxColor)), Marshal.GetFunctionPointerForDelegate(new UnboxColorDelegate(UnboxColor)), Marshal.GetFunctionPointerForDelegate(new BoxGradientColorKeyDelegate(BoxGradientColorKey)), @@ -1641,6 +1691,20 @@ private static void OpenPlugin(InitMode initMode) Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetTransformDelegate(UnityEngineRaycastHitPropertyGetTransform)), Marshal.GetFunctionPointerForDelegate(new BoxRaycastHitDelegate(BoxRaycastHit)), Marshal.GetFunctionPointerForDelegate(new UnboxRaycastHitDelegate(UnboxRaycastHit)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(SystemCollectionsIEnumeratorPropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIEnumeratorMethodMoveNextDelegate(SystemCollectionsIEnumeratorMethodMoveNext)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator)), Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEnginePlayablesPlayableGraphDelegate(ReleaseUnityEnginePlayablesPlayableGraph)), Marshal.GetFunctionPointerForDelegate(new BoxPlayableGraphDelegate(BoxPlayableGraph)), Marshal.GetFunctionPointerForDelegate(new UnboxPlayableGraphDelegate(UnboxPlayableGraph)), @@ -1720,8 +1784,6 @@ private static void OpenPlugin(InitMode initMode) Marshal.GetFunctionPointerForDelegate(new UnboxSceneDelegate(UnboxScene)), Marshal.GetFunctionPointerForDelegate(new BoxLoadSceneModeDelegate(BoxLoadSceneMode)), Marshal.GetFunctionPointerForDelegate(new UnboxLoadSceneModeDelegate(UnboxLoadSceneMode)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(SystemCollectionsIEnumeratorPropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIEnumeratorMethodMoveNextDelegate(SystemCollectionsIEnumeratorMethodMoveNext)), Marshal.GetFunctionPointerForDelegate(new BoxPrimitiveTypeDelegate(BoxPrimitiveType)), Marshal.GetFunctionPointerForDelegate(new UnboxPrimitiveTypeDelegate(UnboxPrimitiveType)), Marshal.GetFunctionPointerForDelegate(new UnityEngineTimePropertyGetDeltaTimeDelegate(UnityEngineTimePropertyGetDeltaTime)), @@ -1927,6 +1989,12 @@ static int ArrayGetLength(int handle) return ((Array)ObjectStore.Get(handle)).Length; } + [MonoPInvokeCallback(typeof(EnumerableGetEnumeratorDelegate))] + static int EnumerableGetEnumerator(int handle) + { + return ObjectStore.Store(((IEnumerable)ObjectStore.Get(handle)).GetEnumerator()); + } + /*BEGIN BASE TYPES*/ class SystemCollectionsGenericBaseIComparerSystemInt32 : System.Collections.Generic.IComparer { @@ -2753,6 +2821,26 @@ public void NativeInvoke(object sender, System.ComponentModel.Design.ComponentRe /*END BASE TYPES*/ /*BEGIN FUNCTIONS*/ + [MonoPInvokeCallback(typeof(SystemIDisposableMethodDisposeDelegate))] + static void SystemIDisposableMethodDispose(int thisHandle) + { + try + { + var thiz = (System.IDisposable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Dispose(); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + [MonoPInvokeCallback(typeof(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate))] static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(float x, float y, float z) { @@ -3062,6 +3150,27 @@ static void UnityEngineTransformPropertySetPosition(int thisHandle, ref UnityEng } } + [MonoPInvokeCallback(typeof(UnityEngineTransformMethodSetParentUnityEngineTransformDelegate))] + static void UnityEngineTransformMethodSetParentUnityEngineTransform(int thisHandle, int parentHandle) + { + try + { + var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var parent = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(parentHandle); + thiz.SetParent(parent); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + [MonoPInvokeCallback(typeof(BoxColorDelegate))] static int BoxColor(ref UnityEngine.Color val) { @@ -3487,6 +3596,328 @@ static int UnboxRaycastHit(int valHandle) } } + [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorPropertyGetCurrentDelegate))] + static int SystemCollectionsIEnumeratorPropertyGetCurrent(int thisHandle) + { + try + { + var thiz = (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorMethodMoveNextDelegate))] + static bool SystemCollectionsIEnumeratorMethodMoveNext(int thisHandle) + { + try + { + var thiz = (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.MoveNext(); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrentDelegate))] + static int SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent(int thisHandle) + { + try + { + var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrentDelegate))] + static int SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent(int thisHandle) + { + try + { + var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrentDelegate))] + static float SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent(int thisHandle) + { + try + { + var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrentDelegate))] + static int SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent(int thisHandle) + { + try + { + var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return NativeScript.Bindings.StructStore.Store(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrentDelegate))] + static UnityEngine.GradientColorKey SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent(int thisHandle) + { + try + { + var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.GradientColorKey); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.GradientColorKey); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrentDelegate))] + static int SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent(int thisHandle) + { + try + { + var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return NativeScript.Bindings.StructStore.Store(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumeratorDelegate))] + static int SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator(int thisHandle) + { + try + { + var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetEnumerator(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumeratorDelegate))] + static int SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator(int thisHandle) + { + try + { + var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetEnumerator(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumeratorDelegate))] + static int SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator(int thisHandle) + { + try + { + var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetEnumerator(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumeratorDelegate))] + static int SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator(int thisHandle) + { + try + { + var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetEnumerator(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumeratorDelegate))] + static int SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator(int thisHandle) + { + try + { + var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetEnumerator(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumeratorDelegate))] + static int SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator(int thisHandle) + { + try + { + var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetEnumerator(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + [MonoPInvokeCallback(typeof(ReleaseUnityEnginePlayablesPlayableGraphDelegate))] static void ReleaseUnityEnginePlayablesPlayableGraph(int handle) { @@ -5231,52 +5662,6 @@ static UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneMode(int valHandl } } - [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorPropertyGetCurrentDelegate))] - static int SystemCollectionsIEnumeratorPropertyGetCurrent(int thisHandle) - { - try - { - var thiz = (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorMethodMoveNextDelegate))] - static bool SystemCollectionsIEnumeratorMethodMoveNext(int thisHandle) - { - try - { - var thiz = (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.MoveNext(); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); - } - } - [MonoPInvokeCallback(typeof(BoxPrimitiveTypeDelegate))] static int BoxPrimitiveType(UnityEngine.PrimitiveType val) { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index ebec6cf..2b6735c 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -1771,6 +1771,38 @@ static void AppendType( AppendCppMethodDefinitionsEnd( cppMethodDefinitionsIndent, builders.CppMethodDefinitions); + + // Generate iterator if this type implements IEnumerable + Type[] allInterfaces = type.GetInterfaces(); + foreach (Type interfaceType in allInterfaces) + { + if (interfaceType.IsGenericType + && interfaceType.GetGenericTypeDefinition() == typeof(IEnumerable<>)) + { + builders.TempStrBuilder.Length = 0; + AppendNamespace( + type.Namespace, + string.Empty, + builders.TempStrBuilder); + AppendTypeNameWithoutGenericSuffix( + type.Name, + builders.TempStrBuilder); + AppendTypeNames( + typeParams, + builders.TempStrBuilder); + string bindingEnumerableTypeName = builders.TempStrBuilder.ToString(); + + Type elementType = interfaceType.GetGenericArguments()[0]; + AppendGenericEnumerableIterator( + type, + typeof(IEnumerator<>).MakeGenericType(elementType), + elementType, + bindingEnumerableTypeName, + builders.CppTypeDefinitions, + builders.CppMethodDefinitions); + break; + } + } } static void AppendBaseType( @@ -2543,7 +2575,7 @@ static void AppendConstructor( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); + builders.CppMethodDefinitions.Append('\n'); // C++ init params AppendCppInitParam( @@ -4526,9 +4558,365 @@ static void AppendArray( AppendCppMethodDefinitionsEnd( cppMethodDefinitionsIndent, builders.CppMethodDefinitions); + + if (rank == 1) + { + AppendArrayIterator( + elementType, + cppGenericArrayTypeName, + bindingArrayTypeName, + builders.CppTypeDefinitions, + builders.CppMethodDefinitions); + } } } + static void AppendArrayIterator( + Type elementType, + string cppGenericArrayTypeName, + string bindingArrayTypeName, + StringBuilder cppTypeDefinitions, + StringBuilder cppMethodDefinitions) + { + // Iterator type definition + cppTypeDefinitions.Append("namespace Plugin\n"); + cppTypeDefinitions.Append("{\n"); + cppTypeDefinitions.Append("\tstruct "); + cppTypeDefinitions.Append(bindingArrayTypeName); + cppTypeDefinitions.Append("Iterator\n"); + cppTypeDefinitions.Append("\t{\n"); + cppTypeDefinitions.Append("\t\tSystem::"); + cppTypeDefinitions.Append(cppGenericArrayTypeName); + cppTypeDefinitions.Append("& array;\n"); + cppTypeDefinitions.Append("\t\tint index;\n"); + cppTypeDefinitions.Append("\t\t"); + cppTypeDefinitions.Append(bindingArrayTypeName); + cppTypeDefinitions.Append("Iterator(System::"); + cppTypeDefinitions.Append(cppGenericArrayTypeName); + cppTypeDefinitions.Append("& array, int32_t index);\n"); + cppTypeDefinitions.Append("\t\t"); + cppTypeDefinitions.Append(bindingArrayTypeName); + cppTypeDefinitions.Append("Iterator& operator++();\n"); + cppTypeDefinitions.Append("\t\tbool operator!=(const "); + cppTypeDefinitions.Append(bindingArrayTypeName); + cppTypeDefinitions.Append("Iterator& other);\n"); + cppTypeDefinitions.Append("\t\t"); + AppendCppTypeName( + elementType, + cppTypeDefinitions); + cppTypeDefinitions.Append(" operator*();\n"); + cppTypeDefinitions.Append("\t};\n"); + cppTypeDefinitions.Append("}\n"); + cppTypeDefinitions.Append('\n'); + + // begin() and end() declarations + cppTypeDefinitions.Append("namespace System\n"); + cppTypeDefinitions.Append("{\n"); + cppTypeDefinitions.Append("\tPlugin::"); + cppTypeDefinitions.Append(bindingArrayTypeName); + cppTypeDefinitions.Append("Iterator begin(System::"); + cppTypeDefinitions.Append(cppGenericArrayTypeName); + cppTypeDefinitions.Append("& array);\n"); + cppTypeDefinitions.Append("\tPlugin::"); + cppTypeDefinitions.Append(bindingArrayTypeName); + cppTypeDefinitions.Append("Iterator end(System::"); + cppTypeDefinitions.Append(cppGenericArrayTypeName); + cppTypeDefinitions.Append("& array);\n"); + cppTypeDefinitions.Append("}\n"); + cppTypeDefinitions.Append('\n'); + + // Iterator method definitions + cppMethodDefinitions.Append("namespace Plugin\n"); + cppMethodDefinitions.Append("{\n"); + cppMethodDefinitions.Append('\t'); + cppMethodDefinitions.Append(bindingArrayTypeName); + cppMethodDefinitions.Append("Iterator::"); + cppMethodDefinitions.Append(bindingArrayTypeName); + cppMethodDefinitions.Append("Iterator(System::"); + cppMethodDefinitions.Append(cppGenericArrayTypeName); + cppMethodDefinitions.Append("& array, int32_t index)\n"); + cppMethodDefinitions.Append("\t\t: array(array)\n"); + cppMethodDefinitions.Append("\t\t, index(index)\n"); + cppMethodDefinitions.Append("\t{\n"); + cppMethodDefinitions.Append("\t}\n"); + cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.Append('\t'); + cppMethodDefinitions.Append(bindingArrayTypeName); + cppMethodDefinitions.Append("Iterator& "); + cppMethodDefinitions.Append(bindingArrayTypeName); + cppMethodDefinitions.Append("Iterator::"); + cppMethodDefinitions.Append("operator++()\n"); + cppMethodDefinitions.Append("\t{\n"); + cppMethodDefinitions.Append("\t\tindex++;\n"); + cppMethodDefinitions.Append("\t\treturn *this;\n"); + cppMethodDefinitions.Append("\t}\n"); + cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.Append("\tbool "); + cppMethodDefinitions.Append(bindingArrayTypeName); + cppMethodDefinitions.Append("Iterator::"); + cppMethodDefinitions.Append("operator!=(const "); + cppMethodDefinitions.Append(bindingArrayTypeName); + cppMethodDefinitions.Append("Iterator& other)\n"); + cppMethodDefinitions.Append("\t{\n"); + cppMethodDefinitions.Append("\t\treturn index != other.index;\n"); + cppMethodDefinitions.Append("\t}\n"); + cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.Append('\t'); + AppendCppTypeName( + elementType, + cppMethodDefinitions); + cppMethodDefinitions.Append(' '); + cppMethodDefinitions.Append(bindingArrayTypeName); + cppMethodDefinitions.Append("Iterator::"); + cppMethodDefinitions.Append("operator*()\n"); + cppMethodDefinitions.Append("\t{\n"); + cppMethodDefinitions.Append("\t\treturn array[index];\n"); + cppMethodDefinitions.Append("\t}\n"); + cppMethodDefinitions.Append("}\n"); + cppMethodDefinitions.Append('\n'); + + // begin() and end() definitions + cppMethodDefinitions.Append("namespace System\n"); + cppMethodDefinitions.Append("{\n"); + cppMethodDefinitions.Append("\tPlugin::"); + cppMethodDefinitions.Append(bindingArrayTypeName); + cppMethodDefinitions.Append("Iterator begin(System::"); + cppMethodDefinitions.Append(cppGenericArrayTypeName); + cppMethodDefinitions.Append("& array)\n"); + cppMethodDefinitions.Append("\t{\n"); + cppMethodDefinitions.Append("\t\treturn Plugin::"); + cppMethodDefinitions.Append(bindingArrayTypeName); + cppMethodDefinitions.Append("Iterator(array, 0);\n"); + cppMethodDefinitions.Append("\t}\n"); + cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.Append("\tPlugin::"); + cppMethodDefinitions.Append(bindingArrayTypeName); + cppMethodDefinitions.Append("Iterator end(System::"); + cppMethodDefinitions.Append(cppGenericArrayTypeName); + cppMethodDefinitions.Append("& array)\n"); + cppMethodDefinitions.Append("\t{\n"); + cppMethodDefinitions.Append("\t\treturn Plugin::"); + cppMethodDefinitions.Append(bindingArrayTypeName); + cppMethodDefinitions.Append("Iterator(array, array.GetLength() - 1);\n"); + cppMethodDefinitions.Append("\t}\n"); + cppMethodDefinitions.Append("}\n"); + cppMethodDefinitions.Append('\n'); + } + + static void AppendGenericEnumerableIterator( + Type enumerableType, + Type enumeratorType, + Type elementType, + string bindingEnumerableTypeName, + StringBuilder cppTypeDefinitions, + StringBuilder cppMethodDefinitions) + { + // Iterator type definition + cppTypeDefinitions.Append("namespace Plugin\n"); + cppTypeDefinitions.Append("{\n"); + cppTypeDefinitions.Append("\tstruct "); + cppTypeDefinitions.Append(bindingEnumerableTypeName); + cppTypeDefinitions.Append("Iterator\n"); + cppTypeDefinitions.Append("\t{\n"); + cppTypeDefinitions.Append("\t\t"); + AppendCppTypeName( + enumeratorType, + cppTypeDefinitions); + cppTypeDefinitions.Append(" enumerator;\n"); + cppTypeDefinitions.Append("\t\tbool hasMore;\n"); + cppTypeDefinitions.Append("\t\t"); + cppTypeDefinitions.Append(bindingEnumerableTypeName); + cppTypeDefinitions.Append("Iterator(decltype(nullptr));\n"); + cppTypeDefinitions.Append("\t\t"); + cppTypeDefinitions.Append(bindingEnumerableTypeName); + cppTypeDefinitions.Append("Iterator("); + AppendCppTypeName( + enumerableType, + cppTypeDefinitions); + cppTypeDefinitions.Append("& enumerable);\n"); + cppTypeDefinitions.Append("\t\t~"); + cppTypeDefinitions.Append(bindingEnumerableTypeName); + cppTypeDefinitions.Append("Iterator();\n"); + cppTypeDefinitions.Append("\t\t"); + cppTypeDefinitions.Append(bindingEnumerableTypeName); + cppTypeDefinitions.Append("Iterator& operator++();\n"); + cppTypeDefinitions.Append("\t\tbool operator!=(const "); + cppTypeDefinitions.Append(bindingEnumerableTypeName); + cppTypeDefinitions.Append("Iterator& other);\n"); + cppTypeDefinitions.Append("\t\t"); + AppendCppTypeName( + elementType, + cppTypeDefinitions); + cppTypeDefinitions.Append(" operator*();\n"); + cppTypeDefinitions.Append("\t};\n"); + cppTypeDefinitions.Append("}\n"); + cppTypeDefinitions.Append('\n'); + + // begin() and end() declarations + int indent = AppendNamespaceBeginning( + enumerableType.Namespace, + cppTypeDefinitions); + AppendIndent( + indent, + cppTypeDefinitions); + cppTypeDefinitions.Append("Plugin::"); + cppTypeDefinitions.Append(bindingEnumerableTypeName); + cppTypeDefinitions.Append("Iterator begin("); + AppendCppTypeName( + enumerableType, + cppTypeDefinitions); + cppTypeDefinitions.Append("& enumerable);\n"); + AppendIndent( + indent, + cppTypeDefinitions); + cppTypeDefinitions.Append("Plugin::"); + cppTypeDefinitions.Append(bindingEnumerableTypeName); + cppTypeDefinitions.Append("Iterator end("); + AppendCppTypeName( + enumerableType, + cppTypeDefinitions); + cppTypeDefinitions.Append("& enumerable);\n"); + AppendNamespaceEnding( + indent, + cppTypeDefinitions); + cppTypeDefinitions.Append('\n'); + + // Iterator method definitions + cppMethodDefinitions.Append("namespace Plugin\n"); + cppMethodDefinitions.Append("{\n"); + cppMethodDefinitions.Append('\t'); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator::"); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator(decltype(nullptr))\n"); + cppMethodDefinitions.Append("\t\t: enumerator(nullptr)\n"); + cppMethodDefinitions.Append("\t\t, hasMore(false)\n"); + cppMethodDefinitions.Append("\t{\n"); + cppMethodDefinitions.Append("\t}\n"); + cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.Append('\t'); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator::"); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator("); + AppendCppTypeName( + enumerableType, + cppMethodDefinitions); + cppMethodDefinitions.Append("& enumerable)\n"); + cppMethodDefinitions.Append("\t\t: enumerator(enumerable.GetEnumerator())\n"); + cppMethodDefinitions.Append("\t{\n"); + cppMethodDefinitions.Append("\t\thasMore = enumerator.MoveNext();\n"); + cppMethodDefinitions.Append("\t}\n"); + cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.Append('\t'); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator::~"); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator()\n"); + cppMethodDefinitions.Append("\t{\n"); + cppMethodDefinitions.Append("\t\tif (enumerator != nullptr)\n"); + cppMethodDefinitions.Append("\t\t{\n"); + cppMethodDefinitions.Append("\t\t\tenumerator.Dispose();\n"); + cppMethodDefinitions.Append("\t\t}\n"); + cppMethodDefinitions.Append("\t}\n"); + cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.Append('\t'); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator& "); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator::"); + cppMethodDefinitions.Append("operator++()\n"); + cppMethodDefinitions.Append("\t{\n"); + cppMethodDefinitions.Append("\t\thasMore = enumerator.MoveNext();\n"); + cppMethodDefinitions.Append("\t\treturn *this;\n"); + cppMethodDefinitions.Append("\t}\n"); + cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.Append("\tbool "); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator::"); + cppMethodDefinitions.Append("operator!=(const "); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator& other)\n"); + cppMethodDefinitions.Append("\t{\n"); + cppMethodDefinitions.Append("\t\treturn hasMore;\n"); + cppMethodDefinitions.Append("\t}\n"); + cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.Append('\t'); + AppendCppTypeName( + elementType, + cppMethodDefinitions); + cppMethodDefinitions.Append(' '); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator::"); + cppMethodDefinitions.Append("operator*()\n"); + cppMethodDefinitions.Append("\t{\n"); + cppMethodDefinitions.Append("\t\treturn enumerator.GetCurrent();\n"); + cppMethodDefinitions.Append("\t}\n"); + cppMethodDefinitions.Append("}\n"); + cppMethodDefinitions.Append('\n'); + + // begin() and end() definitions + indent = AppendNamespaceBeginning( + enumerableType.Namespace, + cppMethodDefinitions); + AppendIndent( + indent, + cppMethodDefinitions); + cppMethodDefinitions.Append("Plugin::"); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator begin("); + AppendCppTypeName( + enumerableType, + cppMethodDefinitions); + cppMethodDefinitions.Append("& enumerable)\n"); + AppendIndent( + indent, + cppMethodDefinitions); + cppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + cppMethodDefinitions); + cppMethodDefinitions.Append("return Plugin::"); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator(enumerable);\n"); + AppendIndent( + indent, + cppMethodDefinitions); + cppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + cppMethodDefinitions); + cppMethodDefinitions.Append('\n'); + AppendIndent( + indent, + cppMethodDefinitions); + cppMethodDefinitions.Append("Plugin::"); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator end("); + AppendCppTypeName( + enumerableType, + cppMethodDefinitions); + cppMethodDefinitions.Append("& enumerable)\n"); + AppendIndent( + indent, + cppMethodDefinitions); + cppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + cppMethodDefinitions); + cppMethodDefinitions.Append("return Plugin::"); + cppMethodDefinitions.Append(bindingEnumerableTypeName); + cppMethodDefinitions.Append("Iterator(nullptr);\n"); + AppendIndent( + indent, + cppMethodDefinitions); + cppMethodDefinitions.Append("}\n"); + AppendNamespaceEnding( + indent, + cppMethodDefinitions); + cppMethodDefinitions.Append('\n'); + } + static void AppendCppArrayIndexOperatorMethodDefinition( int rank, int indent, @@ -5261,7 +5649,7 @@ static void AppendArrayConstructor( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); + builders.CppMethodDefinitions.Append('\n'); } static void AppendArrayCppGetLengthFunction( @@ -6342,7 +6730,7 @@ static void AppendDelegate( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); + builders.CppMethodDefinitions.Append('\n'); // C++ remove AppendCppMethodDefinitionBegin( @@ -6374,7 +6762,7 @@ static void AppendDelegate( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); + builders.CppMethodDefinitions.Append('\n'); // C# GetDelegate call AppendCsharpGetDelegateCall( @@ -6387,7 +6775,7 @@ static void AppendDelegate( // C# class (beginning) builders.CsharpBaseTypes.Append("\t\tclass "); builders.CsharpBaseTypes.Append(bindingTypeName); - builders.CsharpBaseTypes.Append("\n"); + builders.CsharpBaseTypes.Append('\n'); builders.CsharpBaseTypes.Append("\t\t{\n"); // C# class fields @@ -6975,7 +7363,7 @@ static void AppendBaseType( type, builders.CsharpBaseTypes); } - builders.CsharpBaseTypes.Append("\n"); + builders.CsharpBaseTypes.Append('\n'); builders.CsharpBaseTypes.Append("\t\t{\n"); // C# class fields @@ -8074,7 +8462,7 @@ static void AppendCsharpBaseTypeCppMethodCallMethod( AppendCsharpTypeName( invokeMethod.ReturnType, output); - output.Append(" "); + output.Append(' '); output.Append(funcName); output.Append("("); AppendCsharpParams( @@ -8442,7 +8830,7 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( AppendIndent( indent, output); - output.Append("\n"); + output.Append('\n'); } static void AppendCppBaseTypeInequalityOperator( @@ -8670,7 +9058,7 @@ static void AppendCppBaseTypeMoveAssignmentOperator( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("\n"); + output.Append('\n'); } static void AppendCppBaseTypeAssignmentOperatorNullptr( @@ -8698,7 +9086,7 @@ static void AppendCppBaseTypeAssignmentOperatorNullptr( typeParams, output); output.Append( - "::operator=(decltype(nullptr) other)\n"); + "::operator=(decltype(nullptr))\n"); AppendIndent( cppMethodDefinitionsIndent, output); @@ -8786,7 +9174,7 @@ static void AppendCppBaseTypeAssignmentOperatorNullptr( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("\n"); + output.Append('\n'); } static void AppendCppBaseTypeAssignmentOperatorSameType( @@ -8853,7 +9241,7 @@ static void AppendCppBaseTypeAssignmentOperatorSameType( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("\n"); + output.Append('\n'); } static void AppendCppBaseTypeDestructor( @@ -8961,7 +9349,7 @@ static void AppendCppBaseTypeDestructor( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("\n"); + output.Append('\n'); } static void AppendCppBaseTypeHandleConstructor( @@ -9050,7 +9438,7 @@ static void AppendCppBaseTypeHandleConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("\n"); + output.Append('\n'); } static void AppendCppBaseTypeMoveConstructor( @@ -9142,7 +9530,7 @@ static void AppendCppBaseTypeMoveConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("\n"); + output.Append('\n'); } static void AppendCppBaseTypeCopyConstructor( @@ -9238,7 +9626,7 @@ static void AppendCppBaseTypeCopyConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("\n"); + output.Append('\n'); } static void AppendCppBaseTypeNullptrConstructor( @@ -9266,7 +9654,7 @@ static void AppendCppBaseTypeNullptrConstructor( AppendTypeNameWithoutGenericSuffix( cppTypeName, output); - output.Append("(decltype(nullptr) n)\n"); + output.Append("(decltype(nullptr))\n"); string separator = ": "; foreach (Type interfaceType in interfaceTypes) { @@ -9304,7 +9692,7 @@ static void AppendCppBaseTypeNullptrConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("\n"); + output.Append('\n'); } static void AppendCppBaseTypeConstructor( @@ -9962,7 +10350,7 @@ static void AppendExceptions( AppendIndent( throwerIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("\n"); + builders.CppMethodDefinitions.Append('\n'); AppendIndent( throwerIndent + 1, builders.CppMethodDefinitions); @@ -10635,7 +11023,7 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeParameters( typeParams, output); - output.Append("(decltype(nullptr) n);\n"); + output.Append("(decltype(nullptr));\n"); // Constructor from handle AppendIndent(indent + 1, output); @@ -10718,7 +11106,7 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeParameters( typeParams, output); - output.Append("& operator=(decltype(nullptr) other);\n"); + output.Append("& operator=(decltype(nullptr));\n"); // Move assignment operator to same type AppendIndent(indent + 1, output); @@ -10823,7 +11211,7 @@ static int AppendCppMethodDefinitionsBegin( AppendTypeNameWithoutGenericSuffix( enclosingTypeName, output); - output.Append("(decltype(nullptr) n)\n"); + output.Append("(decltype(nullptr))\n"); string separator = ": "; foreach (Type interfaceType in interfaceTypes) { @@ -10843,7 +11231,7 @@ static int AppendCppMethodDefinitionsBegin( AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); - output.Append("\n"); + output.Append('\n'); // Handle constructor AppendIndent(indent, output); @@ -10894,7 +11282,7 @@ static int AppendCppMethodDefinitionsBegin( AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); - output.Append("\n"); + output.Append('\n'); // Copy constructor AppendIndent(indent, output); @@ -10928,7 +11316,7 @@ static int AppendCppMethodDefinitionsBegin( AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); - output.Append("\n"); + output.Append('\n'); // Move constructor AppendIndent(indent, output); @@ -10965,7 +11353,7 @@ static int AppendCppMethodDefinitionsBegin( AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); - output.Append("\n"); + output.Append('\n'); // Destructor AppendIndent(indent, output); @@ -11005,7 +11393,7 @@ static int AppendCppMethodDefinitionsBegin( AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); - output.Append("\n"); + output.Append('\n'); // Assignment operator to same type AppendIndent(indent, output); @@ -11047,7 +11435,7 @@ static int AppendCppMethodDefinitionsBegin( AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); - output.Append("\n"); + output.Append('\n'); // Assignment operator to nullptr AppendIndent(indent, output); @@ -11064,7 +11452,7 @@ static int AppendCppMethodDefinitionsBegin( AppendCppTypeParameters( enclosingTypeParams, output); - output.Append("::operator=(decltype(nullptr) other)\n"); + output.Append("::operator=(decltype(nullptr))\n"); AppendIndent(indent, output); output.Append("{\n"); AppendIndent(indent + 1, output); @@ -11089,7 +11477,7 @@ static int AppendCppMethodDefinitionsBegin( AppendIndent(indent, output); output.Append("}\n"); AppendIndent(indent, output); - output.Append("\n"); + output.Append('\n'); // Move assignment operator to same type AppendIndent(indent, output); @@ -12277,7 +12665,17 @@ static void AppendCppFunctionPointer( StringBuilder output) { // Return type - if (IsFullValueType(returnType)) + if (returnType == typeof(bool)) + { + // C linkage requires us to use primitive types + output.Append("int32_t"); + } + else if (returnType == typeof(char)) + { + // C linkage requires us to use primitive types + output.Append("int16_t"); + } + else if (IsFullValueType(returnType)) { AppendCppTypeName(returnType, output); } diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 2013316..7e8f7a3 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -4,7 +4,13 @@ ], "Types": [ { - "Name": " System.IDisposable" + "Name": " System.IDisposable", + "Methods": [ + { + "Name": "Dispose", + "ParamTypes": [] + } + ] }, { "Name": "UnityEngine.Vector3", @@ -83,6 +89,14 @@ }, { "Name": "UnityEngine.Transform", + "Methods": [ + { + "Name": "SetParent", + "ParamTypes": [ + "UnityEngine.Transform" + ] + } + ], "Properties": [ { "Name": "position", @@ -135,6 +149,63 @@ } ] }, + { + "Name": "System.Collections.IEnumerator", + "Methods": [ + { + "Name": "MoveNext", + "ParamTypes": [] + } + ], + "Properties": [ + { + "Name": "Current", + "Get": {}, + "Set": {} + } + ] + }, + { + "Name": "System.Collections.Generic.IEnumerator`1", + "GenericParams": [ + { + "Types": [ + "System.String" + ] + }, + { + "Types": [ + "System.Int32" + ] + }, + { + "Types": [ + "System.Single" + ] + }, + { + "Types": [ + "UnityEngine.RaycastHit" + ] + }, + { + "Types": [ + "UnityEngine.GradientColorKey" + ] + }, + { + "Types": [ + "UnityEngine.Resolution" + ] + } + ], + "Properties": [ + { + "Name": "Current", + "Get": {} + } + ] + }, { "Name": "System.Collections.Generic.IEnumerable`1", "GenericParams": [ @@ -168,6 +239,12 @@ "UnityEngine.Resolution" ] } + ], + "Methods": [ + { + "Name": "GetEnumerator", + "ParamTypes": [] + } ] }, { @@ -738,22 +815,6 @@ { "Name": "UnityEngine.SceneManagement.LoadSceneMode" }, - { - "Name": "System.Collections.IEnumerator", - "Methods": [ - { - "Name": "MoveNext", - "ParamTypes": [] - } - ], - "Properties": [ - { - "Name": "Current", - "Get": {}, - "Set": {} - } - ] - }, { "Name": "System.EventArgs" }, diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 16eb64f..875abad 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -40,6 +40,44 @@ namespace Plugin System::String NullString(nullptr); } +//////////////////////////////////////////////////////////////// +// Support for using IEnumerable with range for loops +//////////////////////////////////////////////////////////////// + +namespace Plugin +{ + // End iterators are dummies full of null + EnumerableIterator::EnumerableIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + // Begin iterators keep track of an IEnumerator + EnumerableIterator::EnumerableIterator( + System::Collections::IEnumerable& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + EnumerableIterator& EnumerableIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool EnumerableIterator::operator!=(const EnumerableIterator& other) + { + return hasMore; + } + + System::Object EnumerableIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + //////////////////////////////////////////////////////////////// // C# functions for C++ to call //////////////////////////////////////////////////////////////// @@ -50,8 +88,10 @@ namespace Plugin int32_t (*StringNew)(const char* chars); void (*SetException)(int32_t handle); int32_t (*ArrayGetLength)(int32_t handle); + int32_t (*EnumerableGetEnumerator)(int32_t handle); /*BEGIN FUNCTION POINTERS*/ + void (*SystemIDisposableMethodDispose)(int32_t thisHandle); UnityEngine::Vector3 (*UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z); float (*UnityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz); void (*UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ); @@ -61,11 +101,12 @@ namespace Plugin UnityEngine::Vector3 (*UnboxVector3)(int32_t valHandle); int32_t (*UnityEngineObjectPropertyGetName)(int32_t thisHandle); void (*UnityEngineObjectPropertySetName)(int32_t thisHandle, int32_t valueHandle); - System::Boolean (*UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject)(int32_t xHandle, int32_t yHandle); - System::Boolean (*UnityEngineObjectMethodop_ImplicitUnityEngineObject)(int32_t existsHandle); + int32_t (*UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject)(int32_t xHandle, int32_t yHandle); + int32_t (*UnityEngineObjectMethodop_ImplicitUnityEngineObject)(int32_t existsHandle); int32_t (*UnityEngineComponentPropertyGetTransform)(int32_t thisHandle); UnityEngine::Vector3 (*UnityEngineTransformPropertyGetPosition)(int32_t thisHandle); void (*UnityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value); + void (*UnityEngineTransformMethodSetParentUnityEngineTransform)(int32_t thisHandle, int32_t parentHandle); int32_t (*BoxColor)(UnityEngine::Color& val); UnityEngine::Color (*UnboxColor)(int32_t valHandle); int32_t (*BoxGradientColorKey)(UnityEngine::GradientColorKey& val); @@ -85,6 +126,20 @@ namespace Plugin int32_t (*UnityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle); int32_t (*BoxRaycastHit)(int32_t valHandle); int32_t (*UnboxRaycastHit)(int32_t valHandle); + int32_t (*SystemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle); + int32_t (*SystemCollectionsIEnumeratorMethodMoveNext)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent)(int32_t thisHandle); + float (*SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent)(int32_t thisHandle); + UnityEngine::GradientColorKey (*SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator)(int32_t thisHandle); void (*ReleaseUnityEnginePlayablesPlayableGraph)(int32_t handle); int32_t (*BoxPlayableGraph)(int32_t valHandle); int32_t (*UnboxPlayableGraph)(int32_t valHandle); @@ -103,7 +158,7 @@ namespace Plugin int32_t (*UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript)(int32_t thisHandle); int32_t (*UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)(UnityEngine::PrimitiveType type); void (*UnityEngineDebugMethodLogSystemObject)(int32_t messageHandle); - System::Boolean (*UnityEngineAssertionsAssertFieldGetRaiseExceptions)(); + int32_t (*UnityEngineAssertionsAssertFieldGetRaiseExceptions)(); void (*UnityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value); void (*UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString)(int32_t expectedHandle, int32_t actualHandle); void (*UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject)(int32_t expectedHandle, int32_t actualHandle); @@ -164,8 +219,6 @@ namespace Plugin int32_t (*UnboxScene)(int32_t valHandle); int32_t (*BoxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val); UnityEngine::SceneManagement::LoadSceneMode (*UnboxLoadSceneMode)(int32_t valHandle); - int32_t (*SystemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle); - System::Boolean (*SystemCollectionsIEnumeratorMethodMoveNext)(int32_t thisHandle); int32_t (*BoxPrimitiveType)(UnityEngine::PrimitiveType val); UnityEngine::PrimitiveType (*UnboxPrimitiveType)(int32_t valHandle); float (*UnityEngineTimePropertyGetDeltaTime)(); @@ -196,11 +249,11 @@ namespace Plugin int32_t (*BoxInteractionSourceNode)(UnityEngine::XR::WSA::Input::InteractionSourceNode val); UnityEngine::XR::WSA::Input::InteractionSourceNode (*UnboxInteractionSourceNode)(int32_t valHandle); void (*ReleaseUnityEngineXRWSAInputInteractionSourcePose)(int32_t handle); - System::Boolean (*UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode)(int32_t thisHandle, UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node); + int32_t (*UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode)(int32_t thisHandle, UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node); int32_t (*BoxInteractionSourcePose)(int32_t valHandle); int32_t (*UnboxInteractionSourcePose)(int32_t valHandle); int32_t (*BoxBoolean)(System::Boolean val); - System::Boolean (*UnboxBoolean)(int32_t valHandle); + int32_t (*UnboxBoolean)(int32_t valHandle); int32_t (*BoxSByte)(int8_t val); int8_t (*UnboxSByte)(int32_t valHandle); int32_t (*BoxByte)(uint8_t val); @@ -218,7 +271,7 @@ namespace Plugin int32_t (*BoxUInt64)(uint64_t val); uint64_t (*UnboxUInt64)(int32_t valHandle); int32_t (*BoxChar)(System::Char val); - System::Char (*UnboxChar)(int32_t valHandle); + int16_t (*UnboxChar)(int32_t valHandle); int32_t (*BoxSingle)(float val); float (*UnboxSingle)(int32_t valHandle); int32_t (*BoxDouble)(double val); @@ -1059,17 +1112,17 @@ namespace System { } - Object::Object(decltype(nullptr) n) + Object::Object(decltype(nullptr)) : Handle(0) { } - bool Object::operator==(decltype(nullptr) other) const + bool Object::operator==(decltype(nullptr)) const { return Handle == 0; } - bool Object::operator!=(decltype(nullptr) other) const + bool Object::operator!=(decltype(nullptr)) const { return Handle != 0; } @@ -1084,12 +1137,12 @@ namespace System { } - ValueType::ValueType(decltype(nullptr) n) + ValueType::ValueType(decltype(nullptr)) : Object(nullptr) { } - String::String(decltype(nullptr) n) + String::String(decltype(nullptr)) : Object(Plugin::InternalUse::Only, 0) { } @@ -1144,7 +1197,7 @@ namespace System return *this; } - String& String::operator=(decltype(nullptr) other) + String& String::operator=(decltype(nullptr)) { if (Handle) { @@ -1175,7 +1228,7 @@ namespace System { } - ICloneable::ICloneable(decltype(nullptr) n) + ICloneable::ICloneable(decltype(nullptr)) : Object(nullptr) { } @@ -1187,18 +1240,37 @@ namespace System { } - IEnumerable::IEnumerable(decltype(nullptr) n) + IEnumerable::IEnumerable(decltype(nullptr)) : Object(nullptr) { } + IEnumerator IEnumerable::GetEnumerator() + { + return IEnumerator( + Plugin::InternalUse::Only, + Plugin::EnumerableGetEnumerator(Handle)); + } + + Plugin::EnumerableIterator begin( + System::Collections::IEnumerable& enumerable) + { + return Plugin::EnumerableIterator(enumerable); + } + + Plugin::EnumerableIterator end( + System::Collections::IEnumerable& enumerable) + { + return Plugin::EnumerableIterator(nullptr); + } + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) : Object(iu, handle) , IEnumerable(nullptr) { } - ICollection::ICollection(decltype(nullptr) n) + ICollection::ICollection(decltype(nullptr)) : Object(nullptr) , IEnumerable(nullptr) { @@ -1211,7 +1283,7 @@ namespace System { } - IList::IList(decltype(nullptr) n) + IList::IList(decltype(nullptr)) : Object(nullptr) , IEnumerable(nullptr) , ICollection(nullptr) @@ -1228,7 +1300,7 @@ namespace System { } - Array::Array(decltype(nullptr) n) + Array::Array(decltype(nullptr)) : Object(nullptr) , ICloneable(nullptr) , Collections::IEnumerable(nullptr) @@ -1251,7 +1323,7 @@ namespace System /*BEGIN METHOD DEFINITIONS*/ namespace System { - IDisposable::IDisposable(decltype(nullptr) n) + IDisposable::IDisposable(decltype(nullptr)) { } @@ -1298,7 +1370,7 @@ namespace System return *this; } - IDisposable& IDisposable::operator=(decltype(nullptr) other) + IDisposable& IDisposable::operator=(decltype(nullptr)) { if (Handle) { @@ -1328,6 +1400,18 @@ namespace System { return Handle != other.Handle; } + + void IDisposable::Dispose() + { + Plugin::SystemIDisposableMethodDispose(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } namespace UnityEngine @@ -1436,7 +1520,7 @@ namespace System namespace UnityEngine { - Object::Object(decltype(nullptr) n) + Object::Object(decltype(nullptr)) { } @@ -1483,7 +1567,7 @@ namespace UnityEngine return *this; } - Object& Object::operator=(decltype(nullptr) other) + Object& Object::operator=(decltype(nullptr)) { if (Handle) { @@ -1568,7 +1652,7 @@ namespace UnityEngine namespace UnityEngine { - Component::Component(decltype(nullptr) n) + Component::Component(decltype(nullptr)) : UnityEngine::Object(nullptr) { } @@ -1617,7 +1701,7 @@ namespace UnityEngine return *this; } - Component& Component::operator=(decltype(nullptr) other) + Component& Component::operator=(decltype(nullptr)) { if (Handle) { @@ -1664,7 +1748,7 @@ namespace UnityEngine namespace UnityEngine { - Transform::Transform(decltype(nullptr) n) + Transform::Transform(decltype(nullptr)) : UnityEngine::Object(nullptr) , UnityEngine::Component(nullptr) , System::Collections::IEnumerable(nullptr) @@ -1717,7 +1801,7 @@ namespace UnityEngine return *this; } - Transform& Transform::operator=(decltype(nullptr) other) + Transform& Transform::operator=(decltype(nullptr)) { if (Handle) { @@ -1772,6 +1856,18 @@ namespace UnityEngine delete ex; } } + + void Transform::SetParent(UnityEngine::Transform& parent) + { + Plugin::UnityEngineTransformMethodSetParentUnityEngineTransform(Handle, parent.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } namespace UnityEngine @@ -1856,7 +1952,7 @@ namespace System namespace UnityEngine { - Resolution::Resolution(decltype(nullptr) n) + Resolution::Resolution(decltype(nullptr)) : System::ValueType(nullptr) { } @@ -1905,7 +2001,7 @@ namespace UnityEngine return *this; } - Resolution& Resolution::operator=(decltype(nullptr) other) + Resolution& Resolution::operator=(decltype(nullptr)) { if (Handle) { @@ -2047,7 +2143,7 @@ namespace System namespace UnityEngine { - RaycastHit::RaycastHit(decltype(nullptr) n) + RaycastHit::RaycastHit(decltype(nullptr)) : System::ValueType(nullptr) { } @@ -2096,7 +2192,7 @@ namespace UnityEngine return *this; } - RaycastHit& RaycastHit::operator=(decltype(nullptr) other) + RaycastHit& RaycastHit::operator=(decltype(nullptr)) { if (Handle) { @@ -2199,19 +2295,131 @@ namespace System } } +namespace System +{ + namespace Collections + { + IEnumerator::IEnumerator(decltype(nullptr)) + { + } + + IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerator::~IEnumerator() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerator& IEnumerator::operator=(const IEnumerator& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerator& IEnumerator::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerator& IEnumerator::operator=(IEnumerator&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerator::operator==(const IEnumerator& other) const + { + return Handle == other.Handle; + } + + bool IEnumerator::operator!=(const IEnumerator& other) const + { + return Handle != other.Handle; + } + + System::Object IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Object(Plugin::InternalUse::Only, returnValue); + } + + System::Boolean IEnumerator::MoveNext() + { + auto returnValue = Plugin::SystemCollectionsIEnumeratorMethodMoveNext(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + } +} + namespace System { namespace Collections { namespace Generic { - IEnumerable::IEnumerable(decltype(nullptr) n) - : System::Collections::IEnumerable(nullptr) + IEnumerator::IEnumerator(decltype(nullptr)) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { } - IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) + IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { Handle = handle; if (handle) @@ -2220,18 +2428,18 @@ namespace System } } - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { } - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IEnumerable::~IEnumerable() + IEnumerator::~IEnumerator() { if (Handle) { @@ -2240,7 +2448,7 @@ namespace System } } - IEnumerable& IEnumerable::operator=(const IEnumerable& other) + IEnumerator& IEnumerator::operator=(const IEnumerator& other) { if (this->Handle) { @@ -2254,7 +2462,7 @@ namespace System return *this; } - IEnumerable& IEnumerable::operator=(decltype(nullptr) other) + IEnumerator& IEnumerator::operator=(decltype(nullptr)) { if (Handle) { @@ -2264,7 +2472,7 @@ namespace System return *this; } - IEnumerable& IEnumerable::operator=(IEnumerable&& other) + IEnumerator& IEnumerator::operator=(IEnumerator&& other) { if (Handle) { @@ -2275,15 +2483,28 @@ namespace System return *this; } - bool IEnumerable::operator==(const IEnumerable& other) const + bool IEnumerator::operator==(const IEnumerator& other) const { return Handle == other.Handle; } - bool IEnumerable::operator!=(const IEnumerable& other) const + bool IEnumerator::operator!=(const IEnumerator& other) const { return Handle != other.Handle; } + + System::String IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::String(Plugin::InternalUse::Only, returnValue); + } } } } @@ -2294,13 +2515,15 @@ namespace System { namespace Generic { - IEnumerable::IEnumerable(decltype(nullptr) n) - : System::Collections::IEnumerable(nullptr) + IEnumerator::IEnumerator(decltype(nullptr)) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { } - IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) + IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { Handle = handle; if (handle) @@ -2309,18 +2532,18 @@ namespace System } } - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { } - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IEnumerable::~IEnumerable() + IEnumerator::~IEnumerator() { if (Handle) { @@ -2329,7 +2552,7 @@ namespace System } } - IEnumerable& IEnumerable::operator=(const IEnumerable& other) + IEnumerator& IEnumerator::operator=(const IEnumerator& other) { if (this->Handle) { @@ -2343,7 +2566,7 @@ namespace System return *this; } - IEnumerable& IEnumerable::operator=(decltype(nullptr) other) + IEnumerator& IEnumerator::operator=(decltype(nullptr)) { if (Handle) { @@ -2353,7 +2576,7 @@ namespace System return *this; } - IEnumerable& IEnumerable::operator=(IEnumerable&& other) + IEnumerator& IEnumerator::operator=(IEnumerator&& other) { if (Handle) { @@ -2364,15 +2587,28 @@ namespace System return *this; } - bool IEnumerable::operator==(const IEnumerable& other) const + bool IEnumerator::operator==(const IEnumerator& other) const { return Handle == other.Handle; } - bool IEnumerable::operator!=(const IEnumerable& other) const + bool IEnumerator::operator!=(const IEnumerator& other) const { return Handle != other.Handle; } + + int32_t IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } } } } @@ -2383,13 +2619,15 @@ namespace System { namespace Generic { - IEnumerable::IEnumerable(decltype(nullptr) n) - : System::Collections::IEnumerable(nullptr) + IEnumerator::IEnumerator(decltype(nullptr)) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { } - IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) + IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { Handle = handle; if (handle) @@ -2398,18 +2636,18 @@ namespace System } } - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { } - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IEnumerable::~IEnumerable() + IEnumerator::~IEnumerator() { if (Handle) { @@ -2418,7 +2656,7 @@ namespace System } } - IEnumerable& IEnumerable::operator=(const IEnumerable& other) + IEnumerator& IEnumerator::operator=(const IEnumerator& other) { if (this->Handle) { @@ -2432,7 +2670,7 @@ namespace System return *this; } - IEnumerable& IEnumerable::operator=(decltype(nullptr) other) + IEnumerator& IEnumerator::operator=(decltype(nullptr)) { if (Handle) { @@ -2442,7 +2680,7 @@ namespace System return *this; } - IEnumerable& IEnumerable::operator=(IEnumerable&& other) + IEnumerator& IEnumerator::operator=(IEnumerator&& other) { if (Handle) { @@ -2453,15 +2691,28 @@ namespace System return *this; } - bool IEnumerable::operator==(const IEnumerable& other) const + bool IEnumerator::operator==(const IEnumerator& other) const { return Handle == other.Handle; } - bool IEnumerable::operator!=(const IEnumerable& other) const + bool IEnumerator::operator!=(const IEnumerator& other) const { return Handle != other.Handle; } + + float IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } } } } @@ -2472,13 +2723,15 @@ namespace System { namespace Generic { - IEnumerable::IEnumerable(decltype(nullptr) n) - : System::Collections::IEnumerable(nullptr) + IEnumerator::IEnumerator(decltype(nullptr)) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { } - IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) + IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { Handle = handle; if (handle) @@ -2487,18 +2740,18 @@ namespace System } } - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { } - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IEnumerable::~IEnumerable() + IEnumerator::~IEnumerator() { if (Handle) { @@ -2507,7 +2760,7 @@ namespace System } } - IEnumerable& IEnumerable::operator=(const IEnumerable& other) + IEnumerator& IEnumerator::operator=(const IEnumerator& other) { if (this->Handle) { @@ -2521,7 +2774,7 @@ namespace System return *this; } - IEnumerable& IEnumerable::operator=(decltype(nullptr) other) + IEnumerator& IEnumerator::operator=(decltype(nullptr)) { if (Handle) { @@ -2531,7 +2784,7 @@ namespace System return *this; } - IEnumerable& IEnumerable::operator=(IEnumerable&& other) + IEnumerator& IEnumerator::operator=(IEnumerator&& other) { if (Handle) { @@ -2542,15 +2795,28 @@ namespace System return *this; } - bool IEnumerable::operator==(const IEnumerable& other) const + bool IEnumerator::operator==(const IEnumerator& other) const { return Handle == other.Handle; } - bool IEnumerable::operator!=(const IEnumerable& other) const + bool IEnumerator::operator!=(const IEnumerator& other) const { return Handle != other.Handle; } + + UnityEngine::RaycastHit IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::RaycastHit(Plugin::InternalUse::Only, returnValue); + } } } } @@ -2561,13 +2827,15 @@ namespace System { namespace Generic { - IEnumerable::IEnumerable(decltype(nullptr) n) - : System::Collections::IEnumerable(nullptr) + IEnumerator::IEnumerator(decltype(nullptr)) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { } - IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) + IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { Handle = handle; if (handle) @@ -2576,18 +2844,18 @@ namespace System } } - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { } - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IEnumerable::~IEnumerable() + IEnumerator::~IEnumerator() { if (Handle) { @@ -2596,7 +2864,7 @@ namespace System } } - IEnumerable& IEnumerable::operator=(const IEnumerable& other) + IEnumerator& IEnumerator::operator=(const IEnumerator& other) { if (this->Handle) { @@ -2610,7 +2878,7 @@ namespace System return *this; } - IEnumerable& IEnumerable::operator=(decltype(nullptr) other) + IEnumerator& IEnumerator::operator=(decltype(nullptr)) { if (Handle) { @@ -2620,7 +2888,7 @@ namespace System return *this; } - IEnumerable& IEnumerable::operator=(IEnumerable&& other) + IEnumerator& IEnumerator::operator=(IEnumerator&& other) { if (Handle) { @@ -2631,15 +2899,28 @@ namespace System return *this; } - bool IEnumerable::operator==(const IEnumerable& other) const + bool IEnumerator::operator==(const IEnumerator& other) const { return Handle == other.Handle; } - bool IEnumerable::operator!=(const IEnumerable& other) const + bool IEnumerator::operator!=(const IEnumerator& other) const { return Handle != other.Handle; } + + UnityEngine::GradientColorKey IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } } } } @@ -2650,13 +2931,15 @@ namespace System { namespace Generic { - IEnumerable::IEnumerable(decltype(nullptr) n) - : System::Collections::IEnumerable(nullptr) + IEnumerator::IEnumerator(decltype(nullptr)) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { } - IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) + IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { Handle = handle; if (handle) @@ -2665,18 +2948,18 @@ namespace System } } - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { } - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IEnumerable::~IEnumerable() + IEnumerator::~IEnumerator() { if (Handle) { @@ -2685,7 +2968,7 @@ namespace System } } - IEnumerable& IEnumerable::operator=(const IEnumerable& other) + IEnumerator& IEnumerator::operator=(const IEnumerator& other) { if (this->Handle) { @@ -2699,7 +2982,7 @@ namespace System return *this; } - IEnumerable& IEnumerable::operator=(decltype(nullptr) other) + IEnumerator& IEnumerator::operator=(decltype(nullptr)) { if (Handle) { @@ -2709,7 +2992,7 @@ namespace System return *this; } - IEnumerable& IEnumerable::operator=(IEnumerable&& other) + IEnumerator& IEnumerator::operator=(IEnumerator&& other) { if (Handle) { @@ -2720,15 +3003,28 @@ namespace System return *this; } - bool IEnumerable::operator==(const IEnumerable& other) const + bool IEnumerator::operator==(const IEnumerator& other) const { return Handle == other.Handle; } - bool IEnumerable::operator!=(const IEnumerable& other) const + bool IEnumerator::operator!=(const IEnumerator& other) const { return Handle != other.Handle; } + + UnityEngine::Resolution IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Resolution(Plugin::InternalUse::Only, returnValue); + } } } } @@ -2739,15 +3035,13 @@ namespace System { namespace Generic { - ICollection::ICollection(decltype(nullptr) n) + IEnumerable::IEnumerable(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) { } - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) { Handle = handle; if (handle) @@ -2756,18 +3050,18 @@ namespace System } } - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { } - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - ICollection::~ICollection() + IEnumerable::~IEnumerable() { if (Handle) { @@ -2776,7 +3070,7 @@ namespace System } } - ICollection& ICollection::operator=(const ICollection& other) + IEnumerable& IEnumerable::operator=(const IEnumerable& other) { if (this->Handle) { @@ -2790,7 +3084,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(decltype(nullptr) other) + IEnumerable& IEnumerable::operator=(decltype(nullptr)) { if (Handle) { @@ -2800,7 +3094,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(ICollection&& other) + IEnumerable& IEnumerable::operator=(IEnumerable&& other) { if (Handle) { @@ -2811,15 +3105,28 @@ namespace System return *this; } - bool ICollection::operator==(const ICollection& other) const + bool IEnumerable::operator==(const IEnumerable& other) const { return Handle == other.Handle; } - bool ICollection::operator!=(const ICollection& other) const + bool IEnumerable::operator!=(const IEnumerable& other) const { return Handle != other.Handle; } + + System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); + } } } } @@ -2830,15 +3137,13 @@ namespace System { namespace Generic { - ICollection::ICollection(decltype(nullptr) n) + IEnumerable::IEnumerable(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) { } - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) { Handle = handle; if (handle) @@ -2847,18 +3152,18 @@ namespace System } } - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { } - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - ICollection::~ICollection() + IEnumerable::~IEnumerable() { if (Handle) { @@ -2867,7 +3172,7 @@ namespace System } } - ICollection& ICollection::operator=(const ICollection& other) + IEnumerable& IEnumerable::operator=(const IEnumerable& other) { if (this->Handle) { @@ -2881,7 +3186,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(decltype(nullptr) other) + IEnumerable& IEnumerable::operator=(decltype(nullptr)) { if (Handle) { @@ -2891,7 +3196,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(ICollection&& other) + IEnumerable& IEnumerable::operator=(IEnumerable&& other) { if (Handle) { @@ -2902,15 +3207,28 @@ namespace System return *this; } - bool ICollection::operator==(const ICollection& other) const + bool IEnumerable::operator==(const IEnumerable& other) const { return Handle == other.Handle; } - bool ICollection::operator!=(const ICollection& other) const + bool IEnumerable::operator!=(const IEnumerable& other) const { return Handle != other.Handle; } + + System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); + } } } } @@ -2921,15 +3239,13 @@ namespace System { namespace Generic { - ICollection::ICollection(decltype(nullptr) n) + IEnumerable::IEnumerable(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) { } - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) { Handle = handle; if (handle) @@ -2938,18 +3254,18 @@ namespace System } } - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { } - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - ICollection::~ICollection() + IEnumerable::~IEnumerable() { if (Handle) { @@ -2958,7 +3274,7 @@ namespace System } } - ICollection& ICollection::operator=(const ICollection& other) + IEnumerable& IEnumerable::operator=(const IEnumerable& other) { if (this->Handle) { @@ -2972,7 +3288,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(decltype(nullptr) other) + IEnumerable& IEnumerable::operator=(decltype(nullptr)) { if (Handle) { @@ -2982,7 +3298,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(ICollection&& other) + IEnumerable& IEnumerable::operator=(IEnumerable&& other) { if (Handle) { @@ -2993,15 +3309,28 @@ namespace System return *this; } - bool ICollection::operator==(const ICollection& other) const + bool IEnumerable::operator==(const IEnumerable& other) const { return Handle == other.Handle; } - bool ICollection::operator!=(const ICollection& other) const + bool IEnumerable::operator!=(const IEnumerable& other) const { return Handle != other.Handle; } + + System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); + } } } } @@ -3012,15 +3341,13 @@ namespace System { namespace Generic { - ICollection::ICollection(decltype(nullptr) n) + IEnumerable::IEnumerable(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) { } - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) { Handle = handle; if (handle) @@ -3029,18 +3356,18 @@ namespace System } } - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { } - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - ICollection::~ICollection() + IEnumerable::~IEnumerable() { if (Handle) { @@ -3049,7 +3376,7 @@ namespace System } } - ICollection& ICollection::operator=(const ICollection& other) + IEnumerable& IEnumerable::operator=(const IEnumerable& other) { if (this->Handle) { @@ -3063,7 +3390,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(decltype(nullptr) other) + IEnumerable& IEnumerable::operator=(decltype(nullptr)) { if (Handle) { @@ -3073,7 +3400,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(ICollection&& other) + IEnumerable& IEnumerable::operator=(IEnumerable&& other) { if (Handle) { @@ -3084,15 +3411,28 @@ namespace System return *this; } - bool ICollection::operator==(const ICollection& other) const + bool IEnumerable::operator==(const IEnumerable& other) const { return Handle == other.Handle; } - bool ICollection::operator!=(const ICollection& other) const + bool IEnumerable::operator!=(const IEnumerable& other) const { return Handle != other.Handle; } + + System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); + } } } } @@ -3103,15 +3443,13 @@ namespace System { namespace Generic { - ICollection::ICollection(decltype(nullptr) n) + IEnumerable::IEnumerable(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) { } - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) { Handle = handle; if (handle) @@ -3120,18 +3458,18 @@ namespace System } } - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { } - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - ICollection::~ICollection() + IEnumerable::~IEnumerable() { if (Handle) { @@ -3140,7 +3478,7 @@ namespace System } } - ICollection& ICollection::operator=(const ICollection& other) + IEnumerable& IEnumerable::operator=(const IEnumerable& other) { if (this->Handle) { @@ -3154,7 +3492,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(decltype(nullptr) other) + IEnumerable& IEnumerable::operator=(decltype(nullptr)) { if (Handle) { @@ -3164,7 +3502,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(ICollection&& other) + IEnumerable& IEnumerable::operator=(IEnumerable&& other) { if (Handle) { @@ -3175,15 +3513,28 @@ namespace System return *this; } - bool ICollection::operator==(const ICollection& other) const + bool IEnumerable::operator==(const IEnumerable& other) const { return Handle == other.Handle; } - bool ICollection::operator!=(const ICollection& other) const + bool IEnumerable::operator!=(const IEnumerable& other) const { return Handle != other.Handle; } + + System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); + } } } } @@ -3194,15 +3545,13 @@ namespace System { namespace Generic { - ICollection::ICollection(decltype(nullptr) n) + IEnumerable::IEnumerable(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) { } - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) { Handle = handle; if (handle) @@ -3211,18 +3560,18 @@ namespace System } } - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { } - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - ICollection::~ICollection() + IEnumerable::~IEnumerable() { if (Handle) { @@ -3231,7 +3580,7 @@ namespace System } } - ICollection& ICollection::operator=(const ICollection& other) + IEnumerable& IEnumerable::operator=(const IEnumerable& other) { if (this->Handle) { @@ -3245,7 +3594,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(decltype(nullptr) other) + IEnumerable& IEnumerable::operator=(decltype(nullptr)) { if (Handle) { @@ -3255,7 +3604,7 @@ namespace System return *this; } - ICollection& ICollection::operator=(ICollection&& other) + IEnumerable& IEnumerable::operator=(IEnumerable&& other) { if (Handle) { @@ -3266,15 +3615,28 @@ namespace System return *this; } - bool ICollection::operator==(const ICollection& other) const + bool IEnumerable::operator==(const IEnumerable& other) const { return Handle == other.Handle; } - bool ICollection::operator!=(const ICollection& other) const + bool IEnumerable::operator!=(const IEnumerable& other) const { return Handle != other.Handle; } + + System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); + } } } } @@ -3285,17 +3647,15 @@ namespace System { namespace Generic { - IList::IList(decltype(nullptr) n) + ICollection::ICollection(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) { } - IList::IList(Plugin::InternalUse iu, int32_t handle) + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) : System::Collections::IEnumerable(nullptr) , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) { Handle = handle; if (handle) @@ -3304,18 +3664,18 @@ namespace System } } - IList::IList(const IList& other) - : IList(Plugin::InternalUse::Only, other.Handle) + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { } - IList::IList(IList&& other) - : IList(Plugin::InternalUse::Only, other.Handle) + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IList::~IList() + ICollection::~ICollection() { if (Handle) { @@ -3324,7 +3684,7 @@ namespace System } } - IList& IList::operator=(const IList& other) + ICollection& ICollection::operator=(const ICollection& other) { if (this->Handle) { @@ -3338,7 +3698,7 @@ namespace System return *this; } - IList& IList::operator=(decltype(nullptr) other) + ICollection& ICollection::operator=(decltype(nullptr)) { if (Handle) { @@ -3348,7 +3708,7 @@ namespace System return *this; } - IList& IList::operator=(IList&& other) + ICollection& ICollection::operator=(ICollection&& other) { if (Handle) { @@ -3359,12 +3719,12 @@ namespace System return *this; } - bool IList::operator==(const IList& other) const + bool ICollection::operator==(const ICollection& other) const { return Handle == other.Handle; } - bool IList::operator!=(const IList& other) const + bool ICollection::operator!=(const ICollection& other) const { return Handle != other.Handle; } @@ -3372,13 +3732,967 @@ namespace System } } -namespace System +namespace Plugin +{ + SystemCollectionsGenericICollectionSystemStringIterator::SystemCollectionsGenericICollectionSystemStringIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericICollectionSystemStringIterator::SystemCollectionsGenericICollectionSystemStringIterator(System::Collections::Generic::ICollection& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericICollectionSystemStringIterator::~SystemCollectionsGenericICollectionSystemStringIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericICollectionSystemStringIterator& SystemCollectionsGenericICollectionSystemStringIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericICollectionSystemStringIterator::operator!=(const SystemCollectionsGenericICollectionSystemStringIterator& other) + { + return hasMore; + } + + System::String SystemCollectionsGenericICollectionSystemStringIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionSystemStringIterator begin(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionSystemStringIterator(enumerable); + } + + Plugin::SystemCollectionsGenericICollectionSystemStringIterator end(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionSystemStringIterator(nullptr); + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + ICollection::ICollection(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + } + + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + } + + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ICollection::~ICollection() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ICollection& ICollection::operator=(const ICollection& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ICollection& ICollection::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ICollection& ICollection::operator=(ICollection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ICollection::operator==(const ICollection& other) const + { + return Handle == other.Handle; + } + + bool ICollection::operator!=(const ICollection& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace Plugin +{ + SystemCollectionsGenericICollectionSystemInt32Iterator::SystemCollectionsGenericICollectionSystemInt32Iterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericICollectionSystemInt32Iterator::SystemCollectionsGenericICollectionSystemInt32Iterator(System::Collections::Generic::ICollection& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericICollectionSystemInt32Iterator::~SystemCollectionsGenericICollectionSystemInt32Iterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericICollectionSystemInt32Iterator& SystemCollectionsGenericICollectionSystemInt32Iterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericICollectionSystemInt32Iterator::operator!=(const SystemCollectionsGenericICollectionSystemInt32Iterator& other) + { + return hasMore; + } + + int32_t SystemCollectionsGenericICollectionSystemInt32Iterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator begin(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator(enumerable); + } + + Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator end(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator(nullptr); + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + ICollection::ICollection(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + } + + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + } + + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ICollection::~ICollection() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ICollection& ICollection::operator=(const ICollection& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ICollection& ICollection::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ICollection& ICollection::operator=(ICollection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ICollection::operator==(const ICollection& other) const + { + return Handle == other.Handle; + } + + bool ICollection::operator!=(const ICollection& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace Plugin +{ + SystemCollectionsGenericICollectionSystemSingleIterator::SystemCollectionsGenericICollectionSystemSingleIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericICollectionSystemSingleIterator::SystemCollectionsGenericICollectionSystemSingleIterator(System::Collections::Generic::ICollection& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericICollectionSystemSingleIterator::~SystemCollectionsGenericICollectionSystemSingleIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericICollectionSystemSingleIterator& SystemCollectionsGenericICollectionSystemSingleIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericICollectionSystemSingleIterator::operator!=(const SystemCollectionsGenericICollectionSystemSingleIterator& other) + { + return hasMore; + } + + float SystemCollectionsGenericICollectionSystemSingleIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionSystemSingleIterator begin(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionSystemSingleIterator(enumerable); + } + + Plugin::SystemCollectionsGenericICollectionSystemSingleIterator end(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionSystemSingleIterator(nullptr); + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + ICollection::ICollection(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + } + + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + } + + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ICollection::~ICollection() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ICollection& ICollection::operator=(const ICollection& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ICollection& ICollection::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ICollection& ICollection::operator=(ICollection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ICollection::operator==(const ICollection& other) const + { + return Handle == other.Handle; + } + + bool ICollection::operator!=(const ICollection& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace Plugin +{ + SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(System::Collections::Generic::ICollection& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::~SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::operator!=(const SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& other) + { + return hasMore; + } + + UnityEngine::RaycastHit SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator begin(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(enumerable); + } + + Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator end(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(nullptr); + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + ICollection::ICollection(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + } + + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + } + + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ICollection::~ICollection() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ICollection& ICollection::operator=(const ICollection& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ICollection& ICollection::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ICollection& ICollection::operator=(ICollection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ICollection::operator==(const ICollection& other) const + { + return Handle == other.Handle; + } + + bool ICollection::operator!=(const ICollection& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace Plugin +{ + SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(System::Collections::Generic::ICollection& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::~SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::operator!=(const SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& other) + { + return hasMore; + } + + UnityEngine::GradientColorKey SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(enumerable); + } + + Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator end(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(nullptr); + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + ICollection::ICollection(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + } + + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + } + + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ICollection::~ICollection() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ICollection& ICollection::operator=(const ICollection& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ICollection& ICollection::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ICollection& ICollection::operator=(ICollection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ICollection::operator==(const ICollection& other) const + { + return Handle == other.Handle; + } + + bool ICollection::operator!=(const ICollection& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace Plugin +{ + SystemCollectionsGenericICollectionUnityEngineResolutionIterator::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericICollectionUnityEngineResolutionIterator::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(System::Collections::Generic::ICollection& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericICollectionUnityEngineResolutionIterator::~SystemCollectionsGenericICollectionUnityEngineResolutionIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericICollectionUnityEngineResolutionIterator& SystemCollectionsGenericICollectionUnityEngineResolutionIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericICollectionUnityEngineResolutionIterator::operator!=(const SystemCollectionsGenericICollectionUnityEngineResolutionIterator& other) + { + return hasMore; + } + + UnityEngine::Resolution SystemCollectionsGenericICollectionUnityEngineResolutionIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator begin(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(enumerable); + } + + Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator end(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(nullptr); + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + IList::IList(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + { + } + + IList::IList(Plugin::InternalUse iu, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IList::IList(const IList& other) + : IList(Plugin::InternalUse::Only, other.Handle) + { + } + + IList::IList(IList&& other) + : IList(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IList::~IList() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IList& IList::operator=(const IList& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IList& IList::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IList& IList::operator=(IList&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IList::operator==(const IList& other) const + { + return Handle == other.Handle; + } + + bool IList::operator!=(const IList& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace Plugin +{ + SystemCollectionsGenericIListSystemStringIterator::SystemCollectionsGenericIListSystemStringIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericIListSystemStringIterator::SystemCollectionsGenericIListSystemStringIterator(System::Collections::Generic::IList& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericIListSystemStringIterator::~SystemCollectionsGenericIListSystemStringIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericIListSystemStringIterator& SystemCollectionsGenericIListSystemStringIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericIListSystemStringIterator::operator!=(const SystemCollectionsGenericIListSystemStringIterator& other) + { + return hasMore; + } + + System::String SystemCollectionsGenericIListSystemStringIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListSystemStringIterator begin(System::Collections::Generic::IList& enumerable) + { + return Plugin::SystemCollectionsGenericIListSystemStringIterator(enumerable); + } + + Plugin::SystemCollectionsGenericIListSystemStringIterator end(System::Collections::Generic::IList& enumerable) + { + return Plugin::SystemCollectionsGenericIListSystemStringIterator(nullptr); + } + } + } +} + +namespace System { namespace Collections { namespace Generic { - IList::IList(decltype(nullptr) n) + IList::IList(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) , System::Collections::Generic::IEnumerable(nullptr) , System::Collections::Generic::ICollection(nullptr) @@ -3431,7 +4745,7 @@ namespace System return *this; } - IList& IList::operator=(decltype(nullptr) other) + IList& IList::operator=(decltype(nullptr)) { if (Handle) { @@ -3465,13 +4779,71 @@ namespace System } } +namespace Plugin +{ + SystemCollectionsGenericIListSystemInt32Iterator::SystemCollectionsGenericIListSystemInt32Iterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericIListSystemInt32Iterator::SystemCollectionsGenericIListSystemInt32Iterator(System::Collections::Generic::IList& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericIListSystemInt32Iterator::~SystemCollectionsGenericIListSystemInt32Iterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericIListSystemInt32Iterator& SystemCollectionsGenericIListSystemInt32Iterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericIListSystemInt32Iterator::operator!=(const SystemCollectionsGenericIListSystemInt32Iterator& other) + { + return hasMore; + } + + int32_t SystemCollectionsGenericIListSystemInt32Iterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListSystemInt32Iterator begin(System::Collections::Generic::IList& enumerable) + { + return Plugin::SystemCollectionsGenericIListSystemInt32Iterator(enumerable); + } + + Plugin::SystemCollectionsGenericIListSystemInt32Iterator end(System::Collections::Generic::IList& enumerable) + { + return Plugin::SystemCollectionsGenericIListSystemInt32Iterator(nullptr); + } + } + } +} + namespace System { namespace Collections { namespace Generic { - IList::IList(decltype(nullptr) n) + IList::IList(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) , System::Collections::Generic::IEnumerable(nullptr) , System::Collections::Generic::ICollection(nullptr) @@ -3524,7 +4896,7 @@ namespace System return *this; } - IList& IList::operator=(decltype(nullptr) other) + IList& IList::operator=(decltype(nullptr)) { if (Handle) { @@ -3547,12 +4919,70 @@ namespace System bool IList::operator==(const IList& other) const { - return Handle == other.Handle; + return Handle == other.Handle; + } + + bool IList::operator!=(const IList& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace Plugin +{ + SystemCollectionsGenericIListSystemSingleIterator::SystemCollectionsGenericIListSystemSingleIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericIListSystemSingleIterator::SystemCollectionsGenericIListSystemSingleIterator(System::Collections::Generic::IList& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericIListSystemSingleIterator::~SystemCollectionsGenericIListSystemSingleIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericIListSystemSingleIterator& SystemCollectionsGenericIListSystemSingleIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericIListSystemSingleIterator::operator!=(const SystemCollectionsGenericIListSystemSingleIterator& other) + { + return hasMore; + } + + float SystemCollectionsGenericIListSystemSingleIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListSystemSingleIterator begin(System::Collections::Generic::IList& enumerable) + { + return Plugin::SystemCollectionsGenericIListSystemSingleIterator(enumerable); } - bool IList::operator!=(const IList& other) const + Plugin::SystemCollectionsGenericIListSystemSingleIterator end(System::Collections::Generic::IList& enumerable) { - return Handle != other.Handle; + return Plugin::SystemCollectionsGenericIListSystemSingleIterator(nullptr); } } } @@ -3564,7 +4994,7 @@ namespace System { namespace Generic { - IList::IList(decltype(nullptr) n) + IList::IList(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) , System::Collections::Generic::IEnumerable(nullptr) , System::Collections::Generic::ICollection(nullptr) @@ -3617,7 +5047,7 @@ namespace System return *this; } - IList& IList::operator=(decltype(nullptr) other) + IList& IList::operator=(decltype(nullptr)) { if (Handle) { @@ -3651,13 +5081,71 @@ namespace System } } +namespace Plugin +{ + SystemCollectionsGenericIListUnityEngineRaycastHitIterator::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericIListUnityEngineRaycastHitIterator::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(System::Collections::Generic::IList& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericIListUnityEngineRaycastHitIterator::~SystemCollectionsGenericIListUnityEngineRaycastHitIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericIListUnityEngineRaycastHitIterator& SystemCollectionsGenericIListUnityEngineRaycastHitIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericIListUnityEngineRaycastHitIterator::operator!=(const SystemCollectionsGenericIListUnityEngineRaycastHitIterator& other) + { + return hasMore; + } + + UnityEngine::RaycastHit SystemCollectionsGenericIListUnityEngineRaycastHitIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator begin(System::Collections::Generic::IList& enumerable) + { + return Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(enumerable); + } + + Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator end(System::Collections::Generic::IList& enumerable) + { + return Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(nullptr); + } + } + } +} + namespace System { namespace Collections { namespace Generic { - IList::IList(decltype(nullptr) n) + IList::IList(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) , System::Collections::Generic::IEnumerable(nullptr) , System::Collections::Generic::ICollection(nullptr) @@ -3710,7 +5198,7 @@ namespace System return *this; } - IList& IList::operator=(decltype(nullptr) other) + IList& IList::operator=(decltype(nullptr)) { if (Handle) { @@ -3744,13 +5232,71 @@ namespace System } } +namespace Plugin +{ + SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(System::Collections::Generic::IList& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::~SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::operator!=(const SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& other) + { + return hasMore; + } + + UnityEngine::GradientColorKey SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::IList& enumerable) + { + return Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(enumerable); + } + + Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator end(System::Collections::Generic::IList& enumerable) + { + return Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(nullptr); + } + } + } +} + namespace System { namespace Collections { namespace Generic { - IList::IList(decltype(nullptr) n) + IList::IList(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) , System::Collections::Generic::IEnumerable(nullptr) , System::Collections::Generic::ICollection(nullptr) @@ -3803,7 +5349,7 @@ namespace System return *this; } - IList& IList::operator=(decltype(nullptr) other) + IList& IList::operator=(decltype(nullptr)) { if (Handle) { @@ -3837,13 +5383,71 @@ namespace System } } +namespace Plugin +{ + SystemCollectionsGenericIListUnityEngineResolutionIterator::SystemCollectionsGenericIListUnityEngineResolutionIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericIListUnityEngineResolutionIterator::SystemCollectionsGenericIListUnityEngineResolutionIterator(System::Collections::Generic::IList& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericIListUnityEngineResolutionIterator::~SystemCollectionsGenericIListUnityEngineResolutionIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericIListUnityEngineResolutionIterator& SystemCollectionsGenericIListUnityEngineResolutionIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericIListUnityEngineResolutionIterator::operator!=(const SystemCollectionsGenericIListUnityEngineResolutionIterator& other) + { + return hasMore; + } + + UnityEngine::Resolution SystemCollectionsGenericIListUnityEngineResolutionIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator begin(System::Collections::Generic::IList& enumerable) + { + return Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator(enumerable); + } + + Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator end(System::Collections::Generic::IList& enumerable) + { + return Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator(nullptr); + } + } + } +} + namespace System { namespace Runtime { namespace Serialization { - ISerializable::ISerializable(decltype(nullptr) n) + ISerializable::ISerializable(decltype(nullptr)) { } @@ -3890,7 +5494,7 @@ namespace System return *this; } - ISerializable& ISerializable::operator=(decltype(nullptr) other) + ISerializable& ISerializable::operator=(decltype(nullptr)) { if (Handle) { @@ -3930,7 +5534,7 @@ namespace System { namespace InteropServices { - _Exception::_Exception(decltype(nullptr) n) + _Exception::_Exception(decltype(nullptr)) { } @@ -3977,7 +5581,7 @@ namespace System return *this; } - _Exception& _Exception::operator=(decltype(nullptr) other) + _Exception& _Exception::operator=(decltype(nullptr)) { if (Handle) { @@ -4013,7 +5617,7 @@ namespace System namespace System { - IAppDomainSetup::IAppDomainSetup(decltype(nullptr) n) + IAppDomainSetup::IAppDomainSetup(decltype(nullptr)) { } @@ -4060,7 +5664,7 @@ namespace System return *this; } - IAppDomainSetup& IAppDomainSetup::operator=(decltype(nullptr) other) + IAppDomainSetup& IAppDomainSetup::operator=(decltype(nullptr)) { if (Handle) { @@ -4096,7 +5700,7 @@ namespace System { namespace Collections { - IComparer::IComparer(decltype(nullptr) n) + IComparer::IComparer(decltype(nullptr)) { } @@ -4143,7 +5747,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(decltype(nullptr) other) + IComparer& IComparer::operator=(decltype(nullptr)) { if (Handle) { @@ -4180,7 +5784,7 @@ namespace System { namespace Collections { - IEqualityComparer::IEqualityComparer(decltype(nullptr) n) + IEqualityComparer::IEqualityComparer(decltype(nullptr)) { } @@ -4227,7 +5831,7 @@ namespace System return *this; } - IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr) other) + IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr)) { if (Handle) { @@ -4266,7 +5870,7 @@ namespace System { namespace Generic { - IEqualityComparer::IEqualityComparer(decltype(nullptr) n) + IEqualityComparer::IEqualityComparer(decltype(nullptr)) { } @@ -4313,7 +5917,7 @@ namespace System return *this; } - IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr) other) + IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr)) { if (Handle) { @@ -4353,7 +5957,7 @@ namespace System { namespace Generic { - IEqualityComparer::IEqualityComparer(decltype(nullptr) n) + IEqualityComparer::IEqualityComparer(decltype(nullptr)) { } @@ -4400,7 +6004,7 @@ namespace System return *this; } - IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr) other) + IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr)) { if (Handle) { @@ -4438,7 +6042,7 @@ namespace UnityEngine { namespace Playables { - PlayableGraph::PlayableGraph(decltype(nullptr) n) + PlayableGraph::PlayableGraph(decltype(nullptr)) : System::ValueType(nullptr) { } @@ -4487,7 +6091,7 @@ namespace UnityEngine return *this; } - PlayableGraph& PlayableGraph::operator=(decltype(nullptr) other) + PlayableGraph& PlayableGraph::operator=(decltype(nullptr)) { if (Handle) { @@ -4557,7 +6161,7 @@ namespace UnityEngine { namespace Playables { - IPlayable::IPlayable(decltype(nullptr) n) + IPlayable::IPlayable(decltype(nullptr)) { } @@ -4604,7 +6208,7 @@ namespace UnityEngine return *this; } - IPlayable& IPlayable::operator=(decltype(nullptr) other) + IPlayable& IPlayable::operator=(decltype(nullptr)) { if (Handle) { @@ -4639,7 +6243,7 @@ namespace UnityEngine namespace System { - IEquatable::IEquatable(decltype(nullptr) n) + IEquatable::IEquatable(decltype(nullptr)) { } @@ -4686,7 +6290,7 @@ namespace System return *this; } - IEquatable& IEquatable::operator=(decltype(nullptr) other) + IEquatable& IEquatable::operator=(decltype(nullptr)) { if (Handle) { @@ -4722,7 +6326,7 @@ namespace UnityEngine { namespace Animations { - AnimationMixerPlayable::AnimationMixerPlayable(decltype(nullptr) n) + AnimationMixerPlayable::AnimationMixerPlayable(decltype(nullptr)) : System::ValueType(nullptr) , System::IEquatable(nullptr) , UnityEngine::Playables::IPlayable(nullptr) @@ -4775,7 +6379,7 @@ namespace UnityEngine return *this; } - AnimationMixerPlayable& AnimationMixerPlayable::operator=(decltype(nullptr) other) + AnimationMixerPlayable& AnimationMixerPlayable::operator=(decltype(nullptr)) { if (Handle) { @@ -4860,7 +6464,7 @@ namespace System { namespace CompilerServices { - IStrongBox::IStrongBox(decltype(nullptr) n) + IStrongBox::IStrongBox(decltype(nullptr)) { } @@ -4907,7 +6511,7 @@ namespace System return *this; } - IStrongBox& IStrongBox::operator=(decltype(nullptr) other) + IStrongBox& IStrongBox::operator=(decltype(nullptr)) { if (Handle) { @@ -4947,7 +6551,7 @@ namespace UnityEngine { namespace UIElements { - IEventHandler::IEventHandler(decltype(nullptr) n) + IEventHandler::IEventHandler(decltype(nullptr)) { } @@ -4994,7 +6598,7 @@ namespace UnityEngine return *this; } - IEventHandler& IEventHandler::operator=(decltype(nullptr) other) + IEventHandler& IEventHandler::operator=(decltype(nullptr)) { if (Handle) { @@ -5034,7 +6638,7 @@ namespace UnityEngine { namespace UIElements { - IStyle::IStyle(decltype(nullptr) n) + IStyle::IStyle(decltype(nullptr)) { } @@ -5081,7 +6685,7 @@ namespace UnityEngine return *this; } - IStyle& IStyle::operator=(decltype(nullptr) other) + IStyle& IStyle::operator=(decltype(nullptr)) { if (Handle) { @@ -5119,7 +6723,7 @@ namespace System { namespace Diagnostics { - Stopwatch::Stopwatch(decltype(nullptr) n) + Stopwatch::Stopwatch(decltype(nullptr)) { } @@ -5166,7 +6770,7 @@ namespace System return *this; } - Stopwatch& Stopwatch::operator=(decltype(nullptr) other) + Stopwatch& Stopwatch::operator=(decltype(nullptr)) { if (Handle) { @@ -5255,7 +6859,7 @@ namespace System namespace UnityEngine { - GameObject::GameObject(decltype(nullptr) n) + GameObject::GameObject(decltype(nullptr)) : UnityEngine::Object(nullptr) { } @@ -5304,7 +6908,7 @@ namespace UnityEngine return *this; } - GameObject& GameObject::operator=(decltype(nullptr) other) + GameObject& GameObject::operator=(decltype(nullptr)) { if (Handle) { @@ -5426,7 +7030,7 @@ namespace UnityEngine namespace UnityEngine { - Debug::Debug(decltype(nullptr) n) + Debug::Debug(decltype(nullptr)) { } @@ -5473,7 +7077,7 @@ namespace UnityEngine return *this; } - Debug& Debug::operator=(decltype(nullptr) other) + Debug& Debug::operator=(decltype(nullptr)) { if (Handle) { @@ -5574,7 +7178,7 @@ namespace UnityEngine namespace UnityEngine { - Collision::Collision(decltype(nullptr) n) + Collision::Collision(decltype(nullptr)) { } @@ -5621,7 +7225,7 @@ namespace UnityEngine return *this; } - Collision& Collision::operator=(decltype(nullptr) other) + Collision& Collision::operator=(decltype(nullptr)) { if (Handle) { @@ -5655,7 +7259,7 @@ namespace UnityEngine namespace UnityEngine { - Behaviour::Behaviour(decltype(nullptr) n) + Behaviour::Behaviour(decltype(nullptr)) : UnityEngine::Object(nullptr) , UnityEngine::Component(nullptr) { @@ -5706,7 +7310,7 @@ namespace UnityEngine return *this; } - Behaviour& Behaviour::operator=(decltype(nullptr) other) + Behaviour& Behaviour::operator=(decltype(nullptr)) { if (Handle) { @@ -5740,7 +7344,7 @@ namespace UnityEngine namespace UnityEngine { - MonoBehaviour::MonoBehaviour(decltype(nullptr) n) + MonoBehaviour::MonoBehaviour(decltype(nullptr)) : UnityEngine::Object(nullptr) , UnityEngine::Component(nullptr) , UnityEngine::Behaviour(nullptr) @@ -5793,7 +7397,7 @@ namespace UnityEngine return *this; } - MonoBehaviour& MonoBehaviour::operator=(decltype(nullptr) other) + MonoBehaviour& MonoBehaviour::operator=(decltype(nullptr)) { if (Handle) { @@ -5840,7 +7444,7 @@ namespace UnityEngine namespace UnityEngine { - AudioSettings::AudioSettings(decltype(nullptr) n) + AudioSettings::AudioSettings(decltype(nullptr)) { } @@ -5887,7 +7491,7 @@ namespace UnityEngine return *this; } - AudioSettings& AudioSettings::operator=(decltype(nullptr) other) + AudioSettings& AudioSettings::operator=(decltype(nullptr)) { if (Handle) { @@ -5935,7 +7539,7 @@ namespace UnityEngine { namespace Networking { - NetworkTransport::NetworkTransport(decltype(nullptr) n) + NetworkTransport::NetworkTransport(decltype(nullptr)) { } @@ -5982,7 +7586,7 @@ namespace UnityEngine return *this; } - NetworkTransport& NetworkTransport::operator=(decltype(nullptr) other) + NetworkTransport& NetworkTransport::operator=(decltype(nullptr)) { if (Handle) { @@ -6193,7 +7797,7 @@ namespace System { namespace Generic { - KeyValuePair::KeyValuePair(decltype(nullptr) n) + KeyValuePair::KeyValuePair(decltype(nullptr)) : System::ValueType(nullptr) { } @@ -6242,7 +7846,7 @@ namespace System return *this; } - KeyValuePair& KeyValuePair::operator=(decltype(nullptr) other) + KeyValuePair& KeyValuePair::operator=(decltype(nullptr)) { if (Handle) { @@ -6359,7 +7963,7 @@ namespace System { namespace Generic { - List::List(decltype(nullptr) n) + List::List(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) , System::Collections::IList(nullptr) @@ -6418,7 +8022,7 @@ namespace System return *this; } - List& List::operator=(decltype(nullptr) other) + List& List::operator=(decltype(nullptr)) { if (Handle) { @@ -6524,13 +8128,71 @@ namespace System } } +namespace Plugin +{ + SystemCollectionsGenericListSystemStringIterator::SystemCollectionsGenericListSystemStringIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericListSystemStringIterator::SystemCollectionsGenericListSystemStringIterator(System::Collections::Generic::List& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericListSystemStringIterator::~SystemCollectionsGenericListSystemStringIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericListSystemStringIterator& SystemCollectionsGenericListSystemStringIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericListSystemStringIterator::operator!=(const SystemCollectionsGenericListSystemStringIterator& other) + { + return hasMore; + } + + System::String SystemCollectionsGenericListSystemStringIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericListSystemStringIterator begin(System::Collections::Generic::List& enumerable) + { + return Plugin::SystemCollectionsGenericListSystemStringIterator(enumerable); + } + + Plugin::SystemCollectionsGenericListSystemStringIterator end(System::Collections::Generic::List& enumerable) + { + return Plugin::SystemCollectionsGenericListSystemStringIterator(nullptr); + } + } + } +} + namespace System { namespace Collections { namespace Generic { - List::List(decltype(nullptr) n) + List::List(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) , System::Collections::IList(nullptr) @@ -6589,7 +8251,7 @@ namespace System return *this; } - List& List::operator=(decltype(nullptr) other) + List& List::operator=(decltype(nullptr)) { if (Handle) { @@ -6658,38 +8320,96 @@ namespace System void List::SetItem(int32_t index, int32_t value) { - Plugin::SystemCollectionsGenericListSystemInt32PropertySetItem(Handle, index, value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + Plugin::SystemCollectionsGenericListSystemInt32PropertySetItem(Handle, index, value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void List::Add(int32_t item) + { + Plugin::SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(Handle, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void List::Sort(System::Collections::Generic::IComparer& comparer) + { + Plugin::SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } +} + +namespace Plugin +{ + SystemCollectionsGenericListSystemInt32Iterator::SystemCollectionsGenericListSystemInt32Iterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericListSystemInt32Iterator::SystemCollectionsGenericListSystemInt32Iterator(System::Collections::Generic::List& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericListSystemInt32Iterator::~SystemCollectionsGenericListSystemInt32Iterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericListSystemInt32Iterator& SystemCollectionsGenericListSystemInt32Iterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericListSystemInt32Iterator::operator!=(const SystemCollectionsGenericListSystemInt32Iterator& other) + { + return hasMore; + } + + int32_t SystemCollectionsGenericListSystemInt32Iterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericListSystemInt32Iterator begin(System::Collections::Generic::List& enumerable) + { + return Plugin::SystemCollectionsGenericListSystemInt32Iterator(enumerable); } - void List::Add(int32_t item) - { - Plugin::SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(Handle, item); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void List::Sort(System::Collections::Generic::IComparer& comparer) + Plugin::SystemCollectionsGenericListSystemInt32Iterator end(System::Collections::Generic::List& enumerable) { - Plugin::SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + return Plugin::SystemCollectionsGenericListSystemInt32Iterator(nullptr); } } } @@ -6701,7 +8421,7 @@ namespace System { namespace Generic { - LinkedListNode::LinkedListNode(decltype(nullptr) n) + LinkedListNode::LinkedListNode(decltype(nullptr)) { } @@ -6748,7 +8468,7 @@ namespace System return *this; } - LinkedListNode& LinkedListNode::operator=(decltype(nullptr) other) + LinkedListNode& LinkedListNode::operator=(decltype(nullptr)) { if (Handle) { @@ -6830,7 +8550,7 @@ namespace System { namespace CompilerServices { - StrongBox::StrongBox(decltype(nullptr) n) + StrongBox::StrongBox(decltype(nullptr)) : System::Runtime::CompilerServices::IStrongBox(nullptr) { } @@ -6879,7 +8599,7 @@ namespace System return *this; } - StrongBox& StrongBox::operator=(decltype(nullptr) other) + StrongBox& StrongBox::operator=(decltype(nullptr)) { if (Handle) { @@ -6962,7 +8682,7 @@ namespace System { namespace ObjectModel { - Collection::Collection(decltype(nullptr) n) + Collection::Collection(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) , System::Collections::IList(nullptr) @@ -7021,7 +8741,7 @@ namespace System return *this; } - Collection& Collection::operator=(decltype(nullptr) other) + Collection& Collection::operator=(decltype(nullptr)) { if (Handle) { @@ -7055,13 +8775,71 @@ namespace System } } +namespace Plugin +{ + SystemCollectionsObjectModelCollectionSystemInt32Iterator::SystemCollectionsObjectModelCollectionSystemInt32Iterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsObjectModelCollectionSystemInt32Iterator::SystemCollectionsObjectModelCollectionSystemInt32Iterator(System::Collections::ObjectModel::Collection& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsObjectModelCollectionSystemInt32Iterator::~SystemCollectionsObjectModelCollectionSystemInt32Iterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsObjectModelCollectionSystemInt32Iterator& SystemCollectionsObjectModelCollectionSystemInt32Iterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsObjectModelCollectionSystemInt32Iterator::operator!=(const SystemCollectionsObjectModelCollectionSystemInt32Iterator& other) + { + return hasMore; + } + + int32_t SystemCollectionsObjectModelCollectionSystemInt32Iterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator begin(System::Collections::ObjectModel::Collection& enumerable) + { + return Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator(enumerable); + } + + Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator end(System::Collections::ObjectModel::Collection& enumerable) + { + return Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator(nullptr); + } + } + } +} + namespace System { namespace Collections { namespace ObjectModel { - KeyedCollection::KeyedCollection(decltype(nullptr) n) + KeyedCollection::KeyedCollection(decltype(nullptr)) : System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) , System::Collections::IList(nullptr) @@ -7122,7 +8900,7 @@ namespace System return *this; } - KeyedCollection& KeyedCollection::operator=(decltype(nullptr) other) + KeyedCollection& KeyedCollection::operator=(decltype(nullptr)) { if (Handle) { @@ -7156,9 +8934,67 @@ namespace System } } +namespace Plugin +{ + SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(System::Collections::ObjectModel::KeyedCollection& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::~SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::operator!=(const SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& other) + { + return hasMore; + } + + int32_t SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator begin(System::Collections::ObjectModel::KeyedCollection& enumerable) + { + return Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(enumerable); + } + + Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator end(System::Collections::ObjectModel::KeyedCollection& enumerable) + { + return Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(nullptr); + } + } + } +} + namespace System { - Exception::Exception(decltype(nullptr) n) + Exception::Exception(decltype(nullptr)) : System::Runtime::InteropServices::_Exception(nullptr) , System::Runtime::Serialization::ISerializable(nullptr) { @@ -7209,7 +9045,7 @@ namespace System return *this; } - Exception& Exception::operator=(decltype(nullptr) other) + Exception& Exception::operator=(decltype(nullptr)) { if (Handle) { @@ -7262,7 +9098,7 @@ namespace System namespace System { - SystemException::SystemException(decltype(nullptr) n) + SystemException::SystemException(decltype(nullptr)) : System::Runtime::InteropServices::_Exception(nullptr) , System::Runtime::Serialization::ISerializable(nullptr) , System::Exception(nullptr) @@ -7315,7 +9151,7 @@ namespace System return *this; } - SystemException& SystemException::operator=(decltype(nullptr) other) + SystemException& SystemException::operator=(decltype(nullptr)) { if (Handle) { @@ -7349,7 +9185,7 @@ namespace System namespace System { - NullReferenceException::NullReferenceException(decltype(nullptr) n) + NullReferenceException::NullReferenceException(decltype(nullptr)) : System::Runtime::InteropServices::_Exception(nullptr) , System::Runtime::Serialization::ISerializable(nullptr) , System::Exception(nullptr) @@ -7404,7 +9240,7 @@ namespace System return *this; } - NullReferenceException& NullReferenceException::operator=(decltype(nullptr) other) + NullReferenceException& NullReferenceException::operator=(decltype(nullptr)) { if (Handle) { @@ -7438,7 +9274,7 @@ namespace System namespace UnityEngine { - Screen::Screen(decltype(nullptr) n) + Screen::Screen(decltype(nullptr)) { } @@ -7485,7 +9321,7 @@ namespace UnityEngine return *this; } - Screen& Screen::operator=(decltype(nullptr) other) + Screen& Screen::operator=(decltype(nullptr)) { if (Handle) { @@ -7532,7 +9368,7 @@ namespace UnityEngine namespace UnityEngine { - Ray::Ray(decltype(nullptr) n) + Ray::Ray(decltype(nullptr)) : System::ValueType(nullptr) { } @@ -7581,7 +9417,7 @@ namespace UnityEngine return *this; } - Ray& Ray::operator=(decltype(nullptr) other) + Ray& Ray::operator=(decltype(nullptr)) { if (Handle) { @@ -7666,7 +9502,7 @@ namespace System namespace UnityEngine { - Physics::Physics(decltype(nullptr) n) + Physics::Physics(decltype(nullptr)) { } @@ -7713,7 +9549,7 @@ namespace UnityEngine return *this; } - Physics& Physics::operator=(decltype(nullptr) other) + Physics& Physics::operator=(decltype(nullptr)) { if (Handle) { @@ -7773,7 +9609,7 @@ namespace UnityEngine namespace UnityEngine { - Gradient::Gradient(decltype(nullptr) n) + Gradient::Gradient(decltype(nullptr)) { } @@ -7820,7 +9656,7 @@ namespace UnityEngine return *this; } - Gradient& Gradient::operator=(decltype(nullptr) other) + Gradient& Gradient::operator=(decltype(nullptr)) { if (Handle) { @@ -7896,7 +9732,7 @@ namespace UnityEngine namespace System { - AppDomainSetup::AppDomainSetup(decltype(nullptr) n) + AppDomainSetup::AppDomainSetup(decltype(nullptr)) : System::IAppDomainSetup(nullptr) { } @@ -7945,7 +9781,7 @@ namespace System return *this; } - AppDomainSetup& AppDomainSetup::operator=(decltype(nullptr) other) + AppDomainSetup& AppDomainSetup::operator=(decltype(nullptr)) { if (Handle) { @@ -8022,7 +9858,7 @@ namespace System namespace UnityEngine { - Application::Application(decltype(nullptr) n) + Application::Application(decltype(nullptr)) { } @@ -8069,7 +9905,7 @@ namespace UnityEngine return *this; } - Application& Application::operator=(decltype(nullptr) other) + Application& Application::operator=(decltype(nullptr)) { if (Handle) { @@ -8129,7 +9965,7 @@ namespace UnityEngine { namespace SceneManagement { - SceneManager::SceneManager(decltype(nullptr) n) + SceneManager::SceneManager(decltype(nullptr)) { } @@ -8176,7 +10012,7 @@ namespace UnityEngine return *this; } - SceneManager& SceneManager::operator=(decltype(nullptr) other) + SceneManager& SceneManager::operator=(decltype(nullptr)) { if (Handle) { @@ -8237,7 +10073,7 @@ namespace UnityEngine { namespace SceneManagement { - Scene::Scene(decltype(nullptr) n) + Scene::Scene(decltype(nullptr)) : System::ValueType(nullptr) { } @@ -8272,232 +10108,122 @@ namespace UnityEngine } } - Scene& Scene::operator=(const Scene& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEngineSceneManagementScene(Handle); - } - return *this; - } - - Scene& Scene::operator=(decltype(nullptr) other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); - Handle = 0; - } - return *this; - } - - Scene& Scene::operator=(Scene&& other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Scene::operator==(const Scene& other) const - { - return Handle == other.Handle; - } - - bool Scene::operator!=(const Scene& other) const - { - return Handle != other.Handle; - } - } -} - -namespace System -{ - Object::Object(UnityEngine::SceneManagement::Scene& val) - { - int32_t handle = Plugin::BoxScene(val.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator UnityEngine::SceneManagement::Scene() - { - UnityEngine::SceneManagement::Scene returnVal(Plugin::InternalUse::Only, Plugin::UnboxScene(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::Object(UnityEngine::SceneManagement::LoadSceneMode val) - { - int32_t handle = Plugin::BoxLoadSceneMode(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator UnityEngine::SceneManagement::LoadSceneMode() - { - UnityEngine::SceneManagement::LoadSceneMode returnVal(Plugin::UnboxLoadSceneMode(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - namespace Collections - { - IEnumerator::IEnumerator(decltype(nullptr) n) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) + Scene& Scene::operator=(const Scene& other) { if (this->Handle) { - Plugin::DereferenceManagedClass(this->Handle); + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); } this->Handle = other.Handle; if (this->Handle) { - Plugin::ReferenceManagedClass(this->Handle); + Plugin::ReferenceManagedUnityEngineSceneManagementScene(Handle); } return *this; } - IEnumerator& IEnumerator::operator=(decltype(nullptr) other) + Scene& Scene::operator=(decltype(nullptr)) { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); Handle = 0; } return *this; } - IEnumerator& IEnumerator::operator=(IEnumerator&& other) + Scene& Scene::operator=(Scene&& other) { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool IEnumerator::operator==(const IEnumerator& other) const + bool Scene::operator==(const Scene& other) const { return Handle == other.Handle; } - bool IEnumerator::operator!=(const IEnumerator& other) const + bool Scene::operator!=(const Scene& other) const { return Handle != other.Handle; } - - System::Object IEnumerator::GetCurrent() + } +} + +namespace System +{ + Object::Object(UnityEngine::SceneManagement::Scene& val) + { + int32_t handle = Plugin::BoxScene(val.Handle); + if (Plugin::unhandledCsharpException) { - auto returnValue = Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Object(Plugin::InternalUse::Only, returnValue); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - System::Boolean IEnumerator::MoveNext() + if (handle) { - auto returnValue = Plugin::SystemCollectionsIEnumeratorMethodMoveNext(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::SceneManagement::Scene() + { + UnityEngine::SceneManagement::Scene returnVal(Plugin::InternalUse::Only, Plugin::UnboxScene(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::Object(UnityEngine::SceneManagement::LoadSceneMode val) + { + int32_t handle = Plugin::BoxLoadSceneMode(val); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + Handle = handle; + } + } + + Object::operator UnityEngine::SceneManagement::LoadSceneMode() + { + UnityEngine::SceneManagement::LoadSceneMode returnVal(Plugin::UnboxLoadSceneMode(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnVal; } } namespace System { - EventArgs::EventArgs(decltype(nullptr) n) + EventArgs::EventArgs(decltype(nullptr)) { } @@ -8544,7 +10270,7 @@ namespace System return *this; } - EventArgs& EventArgs::operator=(decltype(nullptr) other) + EventArgs& EventArgs::operator=(decltype(nullptr)) { if (Handle) { @@ -8582,7 +10308,7 @@ namespace System { namespace Design { - ComponentEventArgs::ComponentEventArgs(decltype(nullptr) n) + ComponentEventArgs::ComponentEventArgs(decltype(nullptr)) : System::EventArgs(nullptr) { } @@ -8631,7 +10357,7 @@ namespace System return *this; } - ComponentEventArgs& ComponentEventArgs::operator=(decltype(nullptr) other) + ComponentEventArgs& ComponentEventArgs::operator=(decltype(nullptr)) { if (Handle) { @@ -8671,7 +10397,7 @@ namespace System { namespace Design { - ComponentChangingEventArgs::ComponentChangingEventArgs(decltype(nullptr) n) + ComponentChangingEventArgs::ComponentChangingEventArgs(decltype(nullptr)) : System::EventArgs(nullptr) { } @@ -8720,7 +10446,7 @@ namespace System return *this; } - ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(decltype(nullptr) other) + ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(decltype(nullptr)) { if (Handle) { @@ -8760,7 +10486,7 @@ namespace System { namespace Design { - ComponentChangedEventArgs::ComponentChangedEventArgs(decltype(nullptr) n) + ComponentChangedEventArgs::ComponentChangedEventArgs(decltype(nullptr)) : System::EventArgs(nullptr) { } @@ -8809,7 +10535,7 @@ namespace System return *this; } - ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(decltype(nullptr) other) + ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(decltype(nullptr)) { if (Handle) { @@ -8849,7 +10575,7 @@ namespace System { namespace Design { - ComponentRenameEventArgs::ComponentRenameEventArgs(decltype(nullptr) n) + ComponentRenameEventArgs::ComponentRenameEventArgs(decltype(nullptr)) : System::EventArgs(nullptr) { } @@ -8898,7 +10624,7 @@ namespace System return *this; } - ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(decltype(nullptr) other) + ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(decltype(nullptr)) { if (Handle) { @@ -8936,7 +10662,7 @@ namespace System { namespace ComponentModel { - MemberDescriptor::MemberDescriptor(decltype(nullptr) n) + MemberDescriptor::MemberDescriptor(decltype(nullptr)) { } @@ -8983,7 +10709,7 @@ namespace System return *this; } - MemberDescriptor& MemberDescriptor::operator=(decltype(nullptr) other) + MemberDescriptor& MemberDescriptor::operator=(decltype(nullptr)) { if (Handle) { @@ -9051,7 +10777,7 @@ namespace System namespace UnityEngine { - Time::Time(decltype(nullptr) n) + Time::Time(decltype(nullptr)) { } @@ -9098,7 +10824,7 @@ namespace UnityEngine return *this; } - Time& Time::operator=(decltype(nullptr) other) + Time& Time::operator=(decltype(nullptr)) { if (Handle) { @@ -9178,7 +10904,7 @@ namespace System namespace System { - MarshalByRefObject::MarshalByRefObject(decltype(nullptr) n) + MarshalByRefObject::MarshalByRefObject(decltype(nullptr)) { } @@ -9225,7 +10951,7 @@ namespace System return *this; } - MarshalByRefObject& MarshalByRefObject::operator=(decltype(nullptr) other) + MarshalByRefObject& MarshalByRefObject::operator=(decltype(nullptr)) { if (Handle) { @@ -9261,7 +10987,7 @@ namespace System { namespace IO { - Stream::Stream(decltype(nullptr) n) + Stream::Stream(decltype(nullptr)) : System::MarshalByRefObject(nullptr) , System::IDisposable(nullptr) { @@ -9312,7 +11038,7 @@ namespace System return *this; } - Stream& Stream::operator=(decltype(nullptr) other) + Stream& Stream::operator=(decltype(nullptr)) { if (Handle) { @@ -9351,7 +11077,7 @@ namespace System { namespace Generic { - IComparer::IComparer(decltype(nullptr) n) + IComparer::IComparer(decltype(nullptr)) { } @@ -9398,7 +11124,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(decltype(nullptr) other) + IComparer& IComparer::operator=(decltype(nullptr)) { if (Handle) { @@ -9438,7 +11164,7 @@ namespace System { namespace Generic { - IComparer::IComparer(decltype(nullptr) n) + IComparer::IComparer(decltype(nullptr)) { } @@ -9485,7 +11211,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(decltype(nullptr) other) + IComparer& IComparer::operator=(decltype(nullptr)) { if (Handle) { @@ -9557,7 +11283,7 @@ namespace System } } - BaseIComparer::BaseIComparer(decltype(nullptr) n) + BaseIComparer::BaseIComparer(decltype(nullptr)) : System::Collections::Generic::IComparer(nullptr) { CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); @@ -9630,7 +11356,7 @@ namespace System return *this; } - BaseIComparer& BaseIComparer::operator=(decltype(nullptr) other) + BaseIComparer& BaseIComparer::operator=(decltype(nullptr)) { if (Handle) { @@ -9753,7 +11479,7 @@ namespace System } } - BaseIComparer::BaseIComparer(decltype(nullptr) n) + BaseIComparer::BaseIComparer(decltype(nullptr)) : System::Collections::Generic::IComparer(nullptr) { CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); @@ -9826,7 +11552,7 @@ namespace System return *this; } - BaseIComparer& BaseIComparer::operator=(decltype(nullptr) other) + BaseIComparer& BaseIComparer::operator=(decltype(nullptr)) { if (Handle) { @@ -9915,7 +11641,7 @@ namespace System namespace System { - StringComparer::StringComparer(decltype(nullptr) n) + StringComparer::StringComparer(decltype(nullptr)) : System::Collections::IComparer(nullptr) , System::Collections::Generic::IComparer(nullptr) , System::Collections::IEqualityComparer(nullptr) @@ -9970,7 +11696,7 @@ namespace System return *this; } - StringComparer& StringComparer::operator=(decltype(nullptr) other) + StringComparer& StringComparer::operator=(decltype(nullptr)) { if (Handle) { @@ -10040,7 +11766,7 @@ namespace System } } - BaseStringComparer::BaseStringComparer(decltype(nullptr) n) + BaseStringComparer::BaseStringComparer(decltype(nullptr)) : System::Collections::IComparer(nullptr) , System::Collections::Generic::IComparer(nullptr) , System::Collections::IEqualityComparer(nullptr) @@ -10129,7 +11855,7 @@ namespace System return *this; } - BaseStringComparer& BaseStringComparer::operator=(decltype(nullptr) other) + BaseStringComparer& BaseStringComparer::operator=(decltype(nullptr)) { if (Handle) { @@ -10271,7 +11997,7 @@ namespace System { namespace Collections { - Queue::Queue(decltype(nullptr) n) + Queue::Queue(decltype(nullptr)) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -10324,7 +12050,7 @@ namespace System return *this; } - Queue& Queue::operator=(decltype(nullptr) other) + Queue& Queue::operator=(decltype(nullptr)) { if (Handle) { @@ -10409,7 +12135,7 @@ namespace System } } - BaseQueue::BaseQueue(decltype(nullptr) n) + BaseQueue::BaseQueue(decltype(nullptr)) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -10494,7 +12220,7 @@ namespace System return *this; } - BaseQueue& BaseQueue::operator=(decltype(nullptr) other) + BaseQueue& BaseQueue::operator=(decltype(nullptr)) { if (Handle) { @@ -10584,7 +12310,7 @@ namespace System { namespace Design { - IComponentChangeService::IComponentChangeService(decltype(nullptr) n) + IComponentChangeService::IComponentChangeService(decltype(nullptr)) { } @@ -10631,7 +12357,7 @@ namespace System return *this; } - IComponentChangeService& IComponentChangeService::operator=(decltype(nullptr) other) + IComponentChangeService& IComponentChangeService::operator=(decltype(nullptr)) { if (Handle) { @@ -10703,7 +12429,7 @@ namespace System } } - BaseIComponentChangeService::BaseIComponentChangeService(decltype(nullptr) n) + BaseIComponentChangeService::BaseIComponentChangeService(decltype(nullptr)) : System::ComponentModel::Design::IComponentChangeService(nullptr) { CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); @@ -10776,7 +12502,7 @@ namespace System return *this; } - BaseIComponentChangeService& BaseIComponentChangeService::operator=(decltype(nullptr) other) + BaseIComponentChangeService& BaseIComponentChangeService::operator=(decltype(nullptr)) { if (Handle) { @@ -11212,7 +12938,7 @@ namespace System { namespace IO { - FileStream::FileStream(decltype(nullptr) n) + FileStream::FileStream(decltype(nullptr)) : System::MarshalByRefObject(nullptr) , System::IDisposable(nullptr) , System::IO::Stream(nullptr) @@ -11265,7 +12991,7 @@ namespace System return *this; } - FileStream& FileStream::operator=(decltype(nullptr) other) + FileStream& FileStream::operator=(decltype(nullptr)) { if (Handle) { @@ -11369,7 +13095,7 @@ namespace System } } - BaseFileStream::BaseFileStream(decltype(nullptr) n) + BaseFileStream::BaseFileStream(decltype(nullptr)) : System::MarshalByRefObject(nullptr) , System::IDisposable(nullptr) , System::IO::Stream(nullptr) @@ -11454,7 +13180,7 @@ namespace System return *this; } - BaseFileStream& BaseFileStream::operator=(decltype(nullptr) other) + BaseFileStream& BaseFileStream::operator=(decltype(nullptr)) { if (Handle) { @@ -11539,7 +13265,7 @@ namespace UnityEngine { namespace Playables { - PlayableHandle::PlayableHandle(decltype(nullptr) n) + PlayableHandle::PlayableHandle(decltype(nullptr)) : System::ValueType(nullptr) { } @@ -11588,7 +13314,7 @@ namespace UnityEngine return *this; } - PlayableHandle& PlayableHandle::operator=(decltype(nullptr) other) + PlayableHandle& PlayableHandle::operator=(decltype(nullptr)) { if (Handle) { @@ -11660,7 +13386,7 @@ namespace UnityEngine { namespace UIElements { - CallbackEventHandler::CallbackEventHandler(decltype(nullptr) n) + CallbackEventHandler::CallbackEventHandler(decltype(nullptr)) : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) { } @@ -11709,7 +13435,7 @@ namespace UnityEngine return *this; } - CallbackEventHandler& CallbackEventHandler::operator=(decltype(nullptr) other) + CallbackEventHandler& CallbackEventHandler::operator=(decltype(nullptr)) { if (Handle) { @@ -11749,7 +13475,7 @@ namespace UnityEngine { namespace UIElements { - VisualElement::VisualElement(decltype(nullptr) n) + VisualElement::VisualElement(decltype(nullptr)) : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) , UnityEngine::Experimental::UIElements::CallbackEventHandler(nullptr) , UnityEngine::Experimental::UIElements::IStyle(nullptr) @@ -11802,7 +13528,7 @@ namespace UnityEngine return *this; } - VisualElement& VisualElement::operator=(decltype(nullptr) other) + VisualElement& VisualElement::operator=(decltype(nullptr)) { if (Handle) { @@ -11945,7 +13671,7 @@ namespace UnityEngine { namespace Input { - InteractionSourcePose::InteractionSourcePose(decltype(nullptr) n) + InteractionSourcePose::InteractionSourcePose(decltype(nullptr)) : System::ValueType(nullptr) { } @@ -11994,7 +13720,7 @@ namespace UnityEngine return *this; } - InteractionSourcePose& InteractionSourcePose::operator=(decltype(nullptr) other) + InteractionSourcePose& InteractionSourcePose::operator=(decltype(nullptr)) { if (Handle) { @@ -12475,7 +14201,7 @@ namespace MyGame { namespace MonoBehaviours { - TestScript::TestScript(decltype(nullptr) n) + TestScript::TestScript(decltype(nullptr)) : UnityEngine::Object(nullptr) , UnityEngine::Component(nullptr) , UnityEngine::Behaviour(nullptr) @@ -12530,7 +14256,7 @@ namespace MyGame return *this; } - TestScript& TestScript::operator=(decltype(nullptr) other) + TestScript& TestScript::operator=(decltype(nullptr)) { if (Handle) { @@ -12567,7 +14293,7 @@ namespace MyGame { namespace MonoBehaviours { - AnotherScript::AnotherScript(decltype(nullptr) n) + AnotherScript::AnotherScript(decltype(nullptr)) : UnityEngine::Object(nullptr) , UnityEngine::Component(nullptr) , UnityEngine::Behaviour(nullptr) @@ -12622,7 +14348,7 @@ namespace MyGame return *this; } - AnotherScript& AnotherScript::operator=(decltype(nullptr) other) + AnotherScript& AnotherScript::operator=(decltype(nullptr)) { if (Handle) { @@ -12691,7 +14417,7 @@ namespace Plugin namespace System { - Array1::Array1(decltype(nullptr) n) + Array1::Array1(decltype(nullptr)) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -12760,7 +14486,7 @@ namespace System return *this; } - Array1& Array1::operator=(decltype(nullptr) other) + Array1& Array1::operator=(decltype(nullptr)) { if (Handle) { @@ -12841,6 +14567,44 @@ namespace System } } +namespace Plugin +{ + SystemInt32Array1Iterator::SystemInt32Array1Iterator(System::Array1& array, int32_t index) + : array(array) + , index(index) + { + } + + SystemInt32Array1Iterator& SystemInt32Array1Iterator::operator++() + { + index++; + return *this; + } + + bool SystemInt32Array1Iterator::operator!=(const SystemInt32Array1Iterator& other) + { + return index != other.index; + } + + int32_t SystemInt32Array1Iterator::operator*() + { + return array[index]; + } +} + +namespace System +{ + Plugin::SystemInt32Array1Iterator begin(System::Array1& array) + { + return Plugin::SystemInt32Array1Iterator(array, 0); + } + + Plugin::SystemInt32Array1Iterator end(System::Array1& array) + { + return Plugin::SystemInt32Array1Iterator(array, array.GetLength() - 1); + } +} + namespace Plugin { ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) @@ -12991,7 +14755,7 @@ namespace Plugin namespace System { - Array1::Array1(decltype(nullptr) n) + Array1::Array1(decltype(nullptr)) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -13060,7 +14824,7 @@ namespace System return *this; } - Array1& Array1::operator=(decltype(nullptr) other) + Array1& Array1::operator=(decltype(nullptr)) { if (Handle) { @@ -13141,9 +14905,47 @@ namespace System } } +namespace Plugin +{ + SystemSingleArray1Iterator::SystemSingleArray1Iterator(System::Array1& array, int32_t index) + : array(array) + , index(index) + { + } + + SystemSingleArray1Iterator& SystemSingleArray1Iterator::operator++() + { + index++; + return *this; + } + + bool SystemSingleArray1Iterator::operator!=(const SystemSingleArray1Iterator& other) + { + return index != other.index; + } + + float SystemSingleArray1Iterator::operator*() + { + return array[index]; + } +} + +namespace System +{ + Plugin::SystemSingleArray1Iterator begin(System::Array1& array) + { + return Plugin::SystemSingleArray1Iterator(array, 0); + } + + Plugin::SystemSingleArray1Iterator end(System::Array1& array) + { + return Plugin::SystemSingleArray1Iterator(array, array.GetLength() - 1); + } +} + namespace System { - Array2::Array2(decltype(nullptr) n) + Array2::Array2(decltype(nullptr)) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -13218,7 +15020,7 @@ namespace System return *this; } - Array2& Array2::operator=(decltype(nullptr) other) + Array2& Array2::operator=(decltype(nullptr)) { if (Handle) { @@ -13324,7 +15126,7 @@ namespace System namespace System { - Array3::Array3(decltype(nullptr) n) + Array3::Array3(decltype(nullptr)) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -13405,7 +15207,7 @@ namespace System return *this; } - Array3& Array3::operator=(decltype(nullptr) other) + Array3& Array3::operator=(decltype(nullptr)) { if (Handle) { @@ -13548,7 +15350,7 @@ namespace Plugin namespace System { - Array1::Array1(decltype(nullptr) n) + Array1::Array1(decltype(nullptr)) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -13617,7 +15419,7 @@ namespace System return *this; } - Array1& Array1::operator=(decltype(nullptr) other) + Array1& Array1::operator=(decltype(nullptr)) { if (Handle) { @@ -13698,6 +15500,44 @@ namespace System } } +namespace Plugin +{ + SystemStringArray1Iterator::SystemStringArray1Iterator(System::Array1& array, int32_t index) + : array(array) + , index(index) + { + } + + SystemStringArray1Iterator& SystemStringArray1Iterator::operator++() + { + index++; + return *this; + } + + bool SystemStringArray1Iterator::operator!=(const SystemStringArray1Iterator& other) + { + return index != other.index; + } + + System::String SystemStringArray1Iterator::operator*() + { + return array[index]; + } +} + +namespace System +{ + Plugin::SystemStringArray1Iterator begin(System::Array1& array) + { + return Plugin::SystemStringArray1Iterator(array, 0); + } + + Plugin::SystemStringArray1Iterator end(System::Array1& array) + { + return Plugin::SystemStringArray1Iterator(array, array.GetLength() - 1); + } +} + namespace Plugin { ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) @@ -13734,7 +15574,7 @@ namespace Plugin namespace System { - Array1::Array1(decltype(nullptr) n) + Array1::Array1(decltype(nullptr)) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -13803,7 +15643,7 @@ namespace System return *this; } - Array1& Array1::operator=(decltype(nullptr) other) + Array1& Array1::operator=(decltype(nullptr)) { if (Handle) { @@ -13884,6 +15724,44 @@ namespace System } } +namespace Plugin +{ + UnityEngineResolutionArray1Iterator::UnityEngineResolutionArray1Iterator(System::Array1& array, int32_t index) + : array(array) + , index(index) + { + } + + UnityEngineResolutionArray1Iterator& UnityEngineResolutionArray1Iterator::operator++() + { + index++; + return *this; + } + + bool UnityEngineResolutionArray1Iterator::operator!=(const UnityEngineResolutionArray1Iterator& other) + { + return index != other.index; + } + + UnityEngine::Resolution UnityEngineResolutionArray1Iterator::operator*() + { + return array[index]; + } +} + +namespace System +{ + Plugin::UnityEngineResolutionArray1Iterator begin(System::Array1& array) + { + return Plugin::UnityEngineResolutionArray1Iterator(array, 0); + } + + Plugin::UnityEngineResolutionArray1Iterator end(System::Array1& array) + { + return Plugin::UnityEngineResolutionArray1Iterator(array, array.GetLength() - 1); + } +} + namespace Plugin { ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) @@ -13920,7 +15798,7 @@ namespace Plugin namespace System { - Array1::Array1(decltype(nullptr) n) + Array1::Array1(decltype(nullptr)) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -13989,7 +15867,7 @@ namespace System return *this; } - Array1& Array1::operator=(decltype(nullptr) other) + Array1& Array1::operator=(decltype(nullptr)) { if (Handle) { @@ -14070,6 +15948,44 @@ namespace System } } +namespace Plugin +{ + UnityEngineRaycastHitArray1Iterator::UnityEngineRaycastHitArray1Iterator(System::Array1& array, int32_t index) + : array(array) + , index(index) + { + } + + UnityEngineRaycastHitArray1Iterator& UnityEngineRaycastHitArray1Iterator::operator++() + { + index++; + return *this; + } + + bool UnityEngineRaycastHitArray1Iterator::operator!=(const UnityEngineRaycastHitArray1Iterator& other) + { + return index != other.index; + } + + UnityEngine::RaycastHit UnityEngineRaycastHitArray1Iterator::operator*() + { + return array[index]; + } +} + +namespace System +{ + Plugin::UnityEngineRaycastHitArray1Iterator begin(System::Array1& array) + { + return Plugin::UnityEngineRaycastHitArray1Iterator(array, 0); + } + + Plugin::UnityEngineRaycastHitArray1Iterator end(System::Array1& array) + { + return Plugin::UnityEngineRaycastHitArray1Iterator(array, array.GetLength() - 1); + } +} + namespace Plugin { ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) @@ -14106,7 +16022,7 @@ namespace Plugin namespace System { - Array1::Array1(decltype(nullptr) n) + Array1::Array1(decltype(nullptr)) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -14175,7 +16091,7 @@ namespace System return *this; } - Array1& Array1::operator=(decltype(nullptr) other) + Array1& Array1::operator=(decltype(nullptr)) { if (Handle) { @@ -14256,6 +16172,44 @@ namespace System } } +namespace Plugin +{ + UnityEngineGradientColorKeyArray1Iterator::UnityEngineGradientColorKeyArray1Iterator(System::Array1& array, int32_t index) + : array(array) + , index(index) + { + } + + UnityEngineGradientColorKeyArray1Iterator& UnityEngineGradientColorKeyArray1Iterator::operator++() + { + index++; + return *this; + } + + bool UnityEngineGradientColorKeyArray1Iterator::operator!=(const UnityEngineGradientColorKeyArray1Iterator& other) + { + return index != other.index; + } + + UnityEngine::GradientColorKey UnityEngineGradientColorKeyArray1Iterator::operator*() + { + return array[index]; + } +} + +namespace System +{ + Plugin::UnityEngineGradientColorKeyArray1Iterator begin(System::Array1& array) + { + return Plugin::UnityEngineGradientColorKeyArray1Iterator(array, 0); + } + + Plugin::UnityEngineGradientColorKeyArray1Iterator end(System::Array1& array) + { + return Plugin::UnityEngineGradientColorKeyArray1Iterator(array, array.GetLength() - 1); + } +} + namespace System { Action::Action() @@ -14291,7 +16245,7 @@ namespace System } } - Action::Action(decltype(nullptr) n) + Action::Action(decltype(nullptr)) { CppHandle = Plugin::StoreSystemAction(this); ClassHandle = 0; @@ -14368,7 +16322,7 @@ namespace System return *this; } - Action& Action::operator=(decltype(nullptr) other) + Action& Action::operator=(decltype(nullptr)) { if (Handle) { @@ -14526,7 +16480,7 @@ namespace System } } - Action1::Action1(decltype(nullptr) n) + Action1::Action1(decltype(nullptr)) { CppHandle = Plugin::StoreSystemActionSystemSingle(this); ClassHandle = 0; @@ -14603,7 +16557,7 @@ namespace System return *this; } - Action1& Action1::operator=(decltype(nullptr) other) + Action1& Action1::operator=(decltype(nullptr)) { if (Handle) { @@ -14761,7 +16715,7 @@ namespace System } } - Action2::Action2(decltype(nullptr) n) + Action2::Action2(decltype(nullptr)) { CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); ClassHandle = 0; @@ -14838,7 +16792,7 @@ namespace System return *this; } - Action2& Action2::operator=(decltype(nullptr) other) + Action2& Action2::operator=(decltype(nullptr)) { if (Handle) { @@ -14996,7 +16950,7 @@ namespace System } } - Func3::Func3(decltype(nullptr) n) + Func3::Func3(decltype(nullptr)) { CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); ClassHandle = 0; @@ -15073,7 +17027,7 @@ namespace System return *this; } - Func3& Func3::operator=(decltype(nullptr) other) + Func3& Func3::operator=(decltype(nullptr)) { if (Handle) { @@ -15235,7 +17189,7 @@ namespace System } } - Func3::Func3(decltype(nullptr) n) + Func3::Func3(decltype(nullptr)) { CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); ClassHandle = 0; @@ -15312,7 +17266,7 @@ namespace System return *this; } - Func3& Func3::operator=(decltype(nullptr) other) + Func3& Func3::operator=(decltype(nullptr)) { if (Handle) { @@ -15474,7 +17428,7 @@ namespace System } } - AppDomainInitializer::AppDomainInitializer(decltype(nullptr) n) + AppDomainInitializer::AppDomainInitializer(decltype(nullptr)) { CppHandle = Plugin::StoreSystemAppDomainInitializer(this); ClassHandle = 0; @@ -15551,7 +17505,7 @@ namespace System return *this; } - AppDomainInitializer& AppDomainInitializer::operator=(decltype(nullptr) other) + AppDomainInitializer& AppDomainInitializer::operator=(decltype(nullptr)) { if (Handle) { @@ -15712,7 +17666,7 @@ namespace UnityEngine } } - UnityAction::UnityAction(decltype(nullptr) n) + UnityAction::UnityAction(decltype(nullptr)) { CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); ClassHandle = 0; @@ -15789,7 +17743,7 @@ namespace UnityEngine return *this; } - UnityAction& UnityAction::operator=(decltype(nullptr) other) + UnityAction& UnityAction::operator=(decltype(nullptr)) { if (Handle) { @@ -15950,7 +17904,7 @@ namespace UnityEngine } } - UnityAction2::UnityAction2(decltype(nullptr) n) + UnityAction2::UnityAction2(decltype(nullptr)) { CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); ClassHandle = 0; @@ -16027,7 +17981,7 @@ namespace UnityEngine return *this; } - UnityAction2& UnityAction2::operator=(decltype(nullptr) other) + UnityAction2& UnityAction2::operator=(decltype(nullptr)) { if (Handle) { @@ -16191,7 +18145,7 @@ namespace System } } - ComponentEventHandler::ComponentEventHandler(decltype(nullptr) n) + ComponentEventHandler::ComponentEventHandler(decltype(nullptr)) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); ClassHandle = 0; @@ -16268,7 +18222,7 @@ namespace System return *this; } - ComponentEventHandler& ComponentEventHandler::operator=(decltype(nullptr) other) + ComponentEventHandler& ComponentEventHandler::operator=(decltype(nullptr)) { if (Handle) { @@ -16434,7 +18388,7 @@ namespace System } } - ComponentChangingEventHandler::ComponentChangingEventHandler(decltype(nullptr) n) + ComponentChangingEventHandler::ComponentChangingEventHandler(decltype(nullptr)) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); ClassHandle = 0; @@ -16511,7 +18465,7 @@ namespace System return *this; } - ComponentChangingEventHandler& ComponentChangingEventHandler::operator=(decltype(nullptr) other) + ComponentChangingEventHandler& ComponentChangingEventHandler::operator=(decltype(nullptr)) { if (Handle) { @@ -16677,7 +18631,7 @@ namespace System } } - ComponentChangedEventHandler::ComponentChangedEventHandler(decltype(nullptr) n) + ComponentChangedEventHandler::ComponentChangedEventHandler(decltype(nullptr)) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); ClassHandle = 0; @@ -16754,7 +18708,7 @@ namespace System return *this; } - ComponentChangedEventHandler& ComponentChangedEventHandler::operator=(decltype(nullptr) other) + ComponentChangedEventHandler& ComponentChangedEventHandler::operator=(decltype(nullptr)) { if (Handle) { @@ -16920,7 +18874,7 @@ namespace System } } - ComponentRenameEventHandler::ComponentRenameEventHandler(decltype(nullptr) n) + ComponentRenameEventHandler::ComponentRenameEventHandler(decltype(nullptr)) { CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); ClassHandle = 0; @@ -16997,7 +18951,7 @@ namespace System return *this; } - ComponentRenameEventHandler& ComponentRenameEventHandler::operator=(decltype(nullptr) other) + ComponentRenameEventHandler& ComponentRenameEventHandler::operator=(decltype(nullptr)) { if (Handle) { @@ -17180,8 +19134,10 @@ DLLEXPORT void Init( int32_t (*stringNew)(const char* chars), void (*setException)(int32_t handle), int32_t (*arrayGetLength)(int32_t handle), + int32_t (*enumerableGetEnumerator)(int32_t handle), /*BEGIN INIT PARAMS*/ int32_t maxManagedObjects, + void (*systemIDisposableMethodDispose)(int32_t thisHandle), UnityEngine::Vector3 (*unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z), float (*unityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz), void (*unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ), @@ -17191,11 +19147,12 @@ DLLEXPORT void Init( UnityEngine::Vector3 (*unboxVector3)(int32_t valHandle), int32_t (*unityEngineObjectPropertyGetName)(int32_t thisHandle), void (*unityEngineObjectPropertySetName)(int32_t thisHandle, int32_t valueHandle), - System::Boolean (*unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject)(int32_t xHandle, int32_t yHandle), - System::Boolean (*unityEngineObjectMethodop_ImplicitUnityEngineObject)(int32_t existsHandle), + int32_t (*unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject)(int32_t xHandle, int32_t yHandle), + int32_t (*unityEngineObjectMethodop_ImplicitUnityEngineObject)(int32_t existsHandle), int32_t (*unityEngineComponentPropertyGetTransform)(int32_t thisHandle), UnityEngine::Vector3 (*unityEngineTransformPropertyGetPosition)(int32_t thisHandle), void (*unityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value), + void (*unityEngineTransformMethodSetParentUnityEngineTransform)(int32_t thisHandle, int32_t parentHandle), int32_t (*boxColor)(UnityEngine::Color& val), UnityEngine::Color (*unboxColor)(int32_t valHandle), int32_t (*boxGradientColorKey)(UnityEngine::GradientColorKey& val), @@ -17215,6 +19172,20 @@ DLLEXPORT void Init( int32_t (*unityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle), int32_t (*boxRaycastHit)(int32_t valHandle), int32_t (*unboxRaycastHit)(int32_t valHandle), + int32_t (*systemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle), + int32_t (*systemCollectionsIEnumeratorMethodMoveNext)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent)(int32_t thisHandle), + float (*systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent)(int32_t thisHandle), + UnityEngine::GradientColorKey (*systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator)(int32_t thisHandle), void (*releaseUnityEnginePlayablesPlayableGraph)(int32_t handle), int32_t (*boxPlayableGraph)(int32_t valHandle), int32_t (*unboxPlayableGraph)(int32_t valHandle), @@ -17233,7 +19204,7 @@ DLLEXPORT void Init( int32_t (*unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript)(int32_t thisHandle), int32_t (*unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)(UnityEngine::PrimitiveType type), void (*unityEngineDebugMethodLogSystemObject)(int32_t messageHandle), - System::Boolean (*unityEngineAssertionsAssertFieldGetRaiseExceptions)(), + int32_t (*unityEngineAssertionsAssertFieldGetRaiseExceptions)(), void (*unityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value), void (*unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString)(int32_t expectedHandle, int32_t actualHandle), void (*unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject)(int32_t expectedHandle, int32_t actualHandle), @@ -17294,8 +19265,6 @@ DLLEXPORT void Init( int32_t (*unboxScene)(int32_t valHandle), int32_t (*boxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val), UnityEngine::SceneManagement::LoadSceneMode (*unboxLoadSceneMode)(int32_t valHandle), - int32_t (*systemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle), - System::Boolean (*systemCollectionsIEnumeratorMethodMoveNext)(int32_t thisHandle), int32_t (*boxPrimitiveType)(UnityEngine::PrimitiveType val), UnityEngine::PrimitiveType (*unboxPrimitiveType)(int32_t valHandle), float (*unityEngineTimePropertyGetDeltaTime)(), @@ -17326,11 +19295,11 @@ DLLEXPORT void Init( int32_t (*boxInteractionSourceNode)(UnityEngine::XR::WSA::Input::InteractionSourceNode val), UnityEngine::XR::WSA::Input::InteractionSourceNode (*unboxInteractionSourceNode)(int32_t valHandle), void (*releaseUnityEngineXRWSAInputInteractionSourcePose)(int32_t handle), - System::Boolean (*unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode)(int32_t thisHandle, UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node), + int32_t (*unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode)(int32_t thisHandle, UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node), int32_t (*boxInteractionSourcePose)(int32_t valHandle), int32_t (*unboxInteractionSourcePose)(int32_t valHandle), int32_t (*boxBoolean)(System::Boolean val), - System::Boolean (*unboxBoolean)(int32_t valHandle), + int32_t (*unboxBoolean)(int32_t valHandle), int32_t (*boxSByte)(int8_t val), int8_t (*unboxSByte)(int32_t valHandle), int32_t (*boxByte)(uint8_t val), @@ -17348,7 +19317,7 @@ DLLEXPORT void Init( int32_t (*boxUInt64)(uint64_t val), uint64_t (*unboxUInt64)(int32_t valHandle), int32_t (*boxChar)(System::Char val), - System::Char (*unboxChar)(int32_t valHandle), + int16_t (*unboxChar)(int32_t valHandle), int32_t (*boxSingle)(float val), float (*unboxSingle)(int32_t valHandle), int32_t (*boxDouble)(double val), @@ -17453,7 +19422,9 @@ DLLEXPORT void Init( Plugin::ReleaseObject = releaseObject; Plugin::SetException = setException; Plugin::ArrayGetLength = arrayGetLength; + Plugin::EnumerableGetEnumerator = enumerableGetEnumerator; /*BEGIN INIT BODY*/ + Plugin::SystemIDisposableMethodDispose = systemIDisposableMethodDispose; Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle = unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle; Plugin::UnityEngineVector3PropertyGetMagnitude = unityEngineVector3PropertyGetMagnitude; Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle = unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle; @@ -17468,6 +19439,7 @@ DLLEXPORT void Init( Plugin::UnityEngineComponentPropertyGetTransform = unityEngineComponentPropertyGetTransform; Plugin::UnityEngineTransformPropertyGetPosition = unityEngineTransformPropertyGetPosition; Plugin::UnityEngineTransformPropertySetPosition = unityEngineTransformPropertySetPosition; + Plugin::UnityEngineTransformMethodSetParentUnityEngineTransform = unityEngineTransformMethodSetParentUnityEngineTransform; Plugin::BoxColor = boxColor; Plugin::UnboxColor = unboxColor; Plugin::BoxGradientColorKey = boxGradientColorKey; @@ -17493,6 +19465,20 @@ DLLEXPORT void Init( Plugin::UnityEngineRaycastHitPropertyGetTransform = unityEngineRaycastHitPropertyGetTransform; Plugin::BoxRaycastHit = boxRaycastHit; Plugin::UnboxRaycastHit = unboxRaycastHit; + Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent = systemCollectionsIEnumeratorPropertyGetCurrent; + Plugin::SystemCollectionsIEnumeratorMethodMoveNext = systemCollectionsIEnumeratorMethodMoveNext; + Plugin::SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent = systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent; + Plugin::SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent = systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent; + Plugin::SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent = systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent; + Plugin::SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent = systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent; + Plugin::SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent = systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent; + Plugin::SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent = systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent; + Plugin::SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator = systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator; + Plugin::SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator = systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator; + Plugin::SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator = systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator; + Plugin::SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator = systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator; + Plugin::SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator = systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator; + Plugin::SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator = systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator; Plugin::ReleaseUnityEnginePlayablesPlayableGraph = releaseUnityEnginePlayablesPlayableGraph; Plugin::RefCountsUnityEnginePlayablesPlayableGraph = (int32_t*)curMemory; curMemory += 1000 * sizeof(int32_t); @@ -17587,8 +19573,6 @@ DLLEXPORT void Init( Plugin::UnboxScene = unboxScene; Plugin::BoxLoadSceneMode = boxLoadSceneMode; Plugin::UnboxLoadSceneMode = unboxLoadSceneMode; - Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent = systemCollectionsIEnumeratorPropertyGetCurrent; - Plugin::SystemCollectionsIEnumeratorMethodMoveNext = systemCollectionsIEnumeratorMethodMoveNext; Plugin::BoxPrimitiveType = boxPrimitiveType; Plugin::UnboxPrimitiveType = unboxPrimitiveType; Plugin::UnityEngineTimePropertyGetDeltaTime = unityEngineTimePropertyGetDeltaTime; diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index cf746c0..d2fdae9 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -77,6 +77,11 @@ namespace System { } + Boolean(int32_t value) + : Value(value) + { + } + operator bool() const { return (bool)Value; @@ -202,12 +207,22 @@ namespace System using UInt32 = uint32_t; using Int64 = int64_t; using UInt64 = uint64_t; - using Boolean = Boolean; using Single = float; using Double = double; } /*BEGIN TEMPLATE DECLARATIONS*/ +namespace System +{ + namespace Collections + { + namespace Generic + { + template struct IEnumerator; + } + } +} + namespace System { namespace Collections @@ -431,6 +446,14 @@ namespace UnityEngine struct RaycastHit; } +namespace System +{ + namespace Collections + { + struct IEnumerator; + } +} + namespace System { namespace Runtime @@ -680,14 +703,6 @@ namespace UnityEngine } } -namespace System -{ - namespace Collections - { - struct IEnumerator; - } -} - namespace System { struct EventArgs; @@ -1030,6 +1045,72 @@ namespace System /*END TYPE DECLARATIONS*/ /*BEGIN TEMPLATE SPECIALIZATION DECLARATIONS*/ +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerator; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerator; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerator; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerator; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerator; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerator; + } + } +} + namespace System { namespace Collections @@ -1511,10 +1592,10 @@ namespace System int32_t Handle; Object(); Object(Plugin::InternalUse iu, int32_t handle); - Object(decltype(nullptr) n); + Object(decltype(nullptr)); virtual ~Object() = default; - bool operator==(decltype(nullptr) other) const; - bool operator!=(decltype(nullptr) other) const; + bool operator==(decltype(nullptr)) const; + bool operator!=(decltype(nullptr)) const; virtual void ThrowReferenceToThis(); /*BEGIN BOXING METHOD DECLARATIONS*/ @@ -1588,18 +1669,18 @@ namespace System struct ValueType : virtual Object { ValueType(Plugin::InternalUse iu, int32_t handle); - ValueType(decltype(nullptr) n); + ValueType(decltype(nullptr)); }; struct String : virtual Object { String(Plugin::InternalUse iu, int32_t handle); - String(decltype(nullptr) n); + String(decltype(nullptr)); String(const String& other); String(String&& other); virtual ~String(); String& operator=(const String& other); - String& operator=(decltype(nullptr) other); + String& operator=(decltype(nullptr)); String& operator=(String&& other); String(const char* chars); }; @@ -1607,7 +1688,7 @@ namespace System struct ICloneable : virtual Object { ICloneable(Plugin::InternalUse iu, int32_t handle); - ICloneable(decltype(nullptr) n); + ICloneable(decltype(nullptr)); }; namespace Collections @@ -1615,26 +1696,27 @@ namespace System struct IEnumerable : virtual Object { IEnumerable(Plugin::InternalUse iu, int32_t handle); - IEnumerable(decltype(nullptr) n); + IEnumerable(decltype(nullptr)); + IEnumerator GetEnumerator(); }; struct ICollection : virtual IEnumerable { ICollection(Plugin::InternalUse iu, int32_t handle); - ICollection(decltype(nullptr) n); + ICollection(decltype(nullptr)); }; struct IList : virtual ICollection, virtual IEnumerable { IList(Plugin::InternalUse iu, int32_t handle); - IList(decltype(nullptr) n); + IList(decltype(nullptr)); }; } struct Array : virtual ICloneable, virtual Collections::IList { Array(Plugin::InternalUse iu, int32_t handle); - Array(decltype(nullptr) n); + Array(decltype(nullptr)); int32_t GetLength(); int32_t GetRank(); }; @@ -1654,16 +1736,17 @@ namespace System { struct IDisposable : virtual System::Object { - IDisposable(decltype(nullptr) n); + IDisposable(decltype(nullptr)); IDisposable(Plugin::InternalUse iu, int32_t handle); IDisposable(const IDisposable& other); IDisposable(IDisposable&& other); virtual ~IDisposable(); IDisposable& operator=(const IDisposable& other); - IDisposable& operator=(decltype(nullptr) other); + IDisposable& operator=(decltype(nullptr)); IDisposable& operator=(IDisposable&& other); bool operator==(const IDisposable& other) const; bool operator!=(const IDisposable& other) const; + void Dispose(); }; } @@ -1687,13 +1770,13 @@ namespace UnityEngine { struct Object : virtual System::Object { - Object(decltype(nullptr) n); + Object(decltype(nullptr)); Object(Plugin::InternalUse iu, int32_t handle); Object(const Object& other); Object(Object&& other); virtual ~Object(); Object& operator=(const Object& other); - Object& operator=(decltype(nullptr) other); + Object& operator=(decltype(nullptr)); Object& operator=(Object&& other); bool operator==(const Object& other) const; bool operator!=(const Object& other) const; @@ -1708,13 +1791,13 @@ namespace UnityEngine { struct Component : virtual UnityEngine::Object { - Component(decltype(nullptr) n); + Component(decltype(nullptr)); Component(Plugin::InternalUse iu, int32_t handle); Component(const Component& other); Component(Component&& other); virtual ~Component(); Component& operator=(const Component& other); - Component& operator=(decltype(nullptr) other); + Component& operator=(decltype(nullptr)); Component& operator=(Component&& other); bool operator==(const Component& other) const; bool operator!=(const Component& other) const; @@ -1726,18 +1809,19 @@ namespace UnityEngine { struct Transform : virtual UnityEngine::Component, virtual System::Collections::IEnumerable { - Transform(decltype(nullptr) n); + Transform(decltype(nullptr)); Transform(Plugin::InternalUse iu, int32_t handle); Transform(const Transform& other); Transform(Transform&& other); virtual ~Transform(); Transform& operator=(const Transform& other); - Transform& operator=(decltype(nullptr) other); + Transform& operator=(decltype(nullptr)); Transform& operator=(Transform&& other); bool operator==(const Transform& other) const; bool operator!=(const Transform& other) const; UnityEngine::Vector3 GetPosition(); void SetPosition(UnityEngine::Vector3& value); + void SetParent(UnityEngine::Transform& parent); }; } @@ -1767,13 +1851,13 @@ namespace UnityEngine { struct Resolution : virtual System::ValueType { - Resolution(decltype(nullptr) n); + Resolution(decltype(nullptr)); Resolution(Plugin::InternalUse iu, int32_t handle); Resolution(const Resolution& other); Resolution(Resolution&& other); virtual ~Resolution(); Resolution& operator=(const Resolution& other); - Resolution& operator=(decltype(nullptr) other); + Resolution& operator=(decltype(nullptr)); Resolution& operator=(Resolution&& other); bool operator==(const Resolution& other) const; bool operator!=(const Resolution& other) const; @@ -1790,13 +1874,13 @@ namespace UnityEngine { struct RaycastHit : virtual System::ValueType { - RaycastHit(decltype(nullptr) n); + RaycastHit(decltype(nullptr)); RaycastHit(Plugin::InternalUse iu, int32_t handle); RaycastHit(const RaycastHit& other); RaycastHit(RaycastHit&& other); virtual ~RaycastHit(); RaycastHit& operator=(const RaycastHit& other); - RaycastHit& operator=(decltype(nullptr) other); + RaycastHit& operator=(decltype(nullptr)); RaycastHit& operator=(RaycastHit&& other); bool operator==(const RaycastHit& other) const; bool operator!=(const RaycastHit& other) const; @@ -1806,6 +1890,172 @@ namespace UnityEngine }; } +namespace System +{ + namespace Collections + { + struct IEnumerator : virtual System::Object + { + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse iu, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + System::Object GetCurrent(); + System::Boolean MoveNext(); + }; + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator + { + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse iu, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + System::String GetCurrent(); + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator + { + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse iu, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + int32_t GetCurrent(); + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator + { + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse iu, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + float GetCurrent(); + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator + { + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse iu, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + UnityEngine::RaycastHit GetCurrent(); + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator + { + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse iu, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + UnityEngine::GradientColorKey GetCurrent(); + }; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator + { + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse iu, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + UnityEngine::Resolution GetCurrent(); + }; + } + } +} + namespace System { namespace Collections @@ -1814,16 +2064,17 @@ namespace System { template<> struct IEnumerable : virtual System::Collections::IEnumerable { - IEnumerable(decltype(nullptr) n); + IEnumerable(decltype(nullptr)); IEnumerable(Plugin::InternalUse iu, int32_t handle); IEnumerable(const IEnumerable& other); IEnumerable(IEnumerable&& other); virtual ~IEnumerable(); IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr) other); + IEnumerable& operator=(decltype(nullptr)); IEnumerable& operator=(IEnumerable&& other); bool operator==(const IEnumerable& other) const; bool operator!=(const IEnumerable& other) const; + System::Collections::Generic::IEnumerator GetEnumerator(); }; } } @@ -1837,16 +2088,17 @@ namespace System { template<> struct IEnumerable : virtual System::Collections::IEnumerable { - IEnumerable(decltype(nullptr) n); + IEnumerable(decltype(nullptr)); IEnumerable(Plugin::InternalUse iu, int32_t handle); IEnumerable(const IEnumerable& other); IEnumerable(IEnumerable&& other); virtual ~IEnumerable(); IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr) other); + IEnumerable& operator=(decltype(nullptr)); IEnumerable& operator=(IEnumerable&& other); bool operator==(const IEnumerable& other) const; bool operator!=(const IEnumerable& other) const; + System::Collections::Generic::IEnumerator GetEnumerator(); }; } } @@ -1860,16 +2112,17 @@ namespace System { template<> struct IEnumerable : virtual System::Collections::IEnumerable { - IEnumerable(decltype(nullptr) n); + IEnumerable(decltype(nullptr)); IEnumerable(Plugin::InternalUse iu, int32_t handle); IEnumerable(const IEnumerable& other); IEnumerable(IEnumerable&& other); virtual ~IEnumerable(); IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr) other); + IEnumerable& operator=(decltype(nullptr)); IEnumerable& operator=(IEnumerable&& other); bool operator==(const IEnumerable& other) const; bool operator!=(const IEnumerable& other) const; + System::Collections::Generic::IEnumerator GetEnumerator(); }; } } @@ -1883,16 +2136,17 @@ namespace System { template<> struct IEnumerable : virtual System::Collections::IEnumerable { - IEnumerable(decltype(nullptr) n); + IEnumerable(decltype(nullptr)); IEnumerable(Plugin::InternalUse iu, int32_t handle); IEnumerable(const IEnumerable& other); IEnumerable(IEnumerable&& other); virtual ~IEnumerable(); IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr) other); + IEnumerable& operator=(decltype(nullptr)); IEnumerable& operator=(IEnumerable&& other); bool operator==(const IEnumerable& other) const; bool operator!=(const IEnumerable& other) const; + System::Collections::Generic::IEnumerator GetEnumerator(); }; } } @@ -1906,16 +2160,17 @@ namespace System { template<> struct IEnumerable : virtual System::Collections::IEnumerable { - IEnumerable(decltype(nullptr) n); + IEnumerable(decltype(nullptr)); IEnumerable(Plugin::InternalUse iu, int32_t handle); IEnumerable(const IEnumerable& other); IEnumerable(IEnumerable&& other); virtual ~IEnumerable(); IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr) other); + IEnumerable& operator=(decltype(nullptr)); IEnumerable& operator=(IEnumerable&& other); bool operator==(const IEnumerable& other) const; bool operator!=(const IEnumerable& other) const; + System::Collections::Generic::IEnumerator GetEnumerator(); }; } } @@ -1929,16 +2184,17 @@ namespace System { template<> struct IEnumerable : virtual System::Collections::IEnumerable { - IEnumerable(decltype(nullptr) n); + IEnumerable(decltype(nullptr)); IEnumerable(Plugin::InternalUse iu, int32_t handle); IEnumerable(const IEnumerable& other); IEnumerable(IEnumerable&& other); virtual ~IEnumerable(); IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr) other); + IEnumerable& operator=(decltype(nullptr)); IEnumerable& operator=(IEnumerable&& other); bool operator==(const IEnumerable& other) const; bool operator!=(const IEnumerable& other) const; + System::Collections::Generic::IEnumerator GetEnumerator(); }; } } @@ -1952,13 +2208,13 @@ namespace System { template<> struct ICollection : virtual System::Collections::Generic::IEnumerable { - ICollection(decltype(nullptr) n); + ICollection(decltype(nullptr)); ICollection(Plugin::InternalUse iu, int32_t handle); ICollection(const ICollection& other); ICollection(ICollection&& other); virtual ~ICollection(); ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr) other); + ICollection& operator=(decltype(nullptr)); ICollection& operator=(ICollection&& other); bool operator==(const ICollection& other) const; bool operator!=(const ICollection& other) const; @@ -1967,6 +2223,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsGenericICollectionSystemStringIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericICollectionSystemStringIterator(decltype(nullptr)); + SystemCollectionsGenericICollectionSystemStringIterator(System::Collections::Generic::ICollection& enumerable); + ~SystemCollectionsGenericICollectionSystemStringIterator(); + SystemCollectionsGenericICollectionSystemStringIterator& operator++(); + bool operator!=(const SystemCollectionsGenericICollectionSystemStringIterator& other); + System::String operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionSystemStringIterator begin(System::Collections::Generic::ICollection& enumerable); + Plugin::SystemCollectionsGenericICollectionSystemStringIterator end(System::Collections::Generic::ICollection& enumerable); + } + } +} + namespace System { namespace Collections @@ -1975,13 +2258,13 @@ namespace System { template<> struct ICollection : virtual System::Collections::Generic::IEnumerable { - ICollection(decltype(nullptr) n); + ICollection(decltype(nullptr)); ICollection(Plugin::InternalUse iu, int32_t handle); ICollection(const ICollection& other); ICollection(ICollection&& other); virtual ~ICollection(); ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr) other); + ICollection& operator=(decltype(nullptr)); ICollection& operator=(ICollection&& other); bool operator==(const ICollection& other) const; bool operator!=(const ICollection& other) const; @@ -1990,6 +2273,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsGenericICollectionSystemInt32Iterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericICollectionSystemInt32Iterator(decltype(nullptr)); + SystemCollectionsGenericICollectionSystemInt32Iterator(System::Collections::Generic::ICollection& enumerable); + ~SystemCollectionsGenericICollectionSystemInt32Iterator(); + SystemCollectionsGenericICollectionSystemInt32Iterator& operator++(); + bool operator!=(const SystemCollectionsGenericICollectionSystemInt32Iterator& other); + int32_t operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator begin(System::Collections::Generic::ICollection& enumerable); + Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator end(System::Collections::Generic::ICollection& enumerable); + } + } +} + namespace System { namespace Collections @@ -1998,13 +2308,13 @@ namespace System { template<> struct ICollection : virtual System::Collections::Generic::IEnumerable { - ICollection(decltype(nullptr) n); + ICollection(decltype(nullptr)); ICollection(Plugin::InternalUse iu, int32_t handle); ICollection(const ICollection& other); ICollection(ICollection&& other); virtual ~ICollection(); ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr) other); + ICollection& operator=(decltype(nullptr)); ICollection& operator=(ICollection&& other); bool operator==(const ICollection& other) const; bool operator!=(const ICollection& other) const; @@ -2013,6 +2323,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsGenericICollectionSystemSingleIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericICollectionSystemSingleIterator(decltype(nullptr)); + SystemCollectionsGenericICollectionSystemSingleIterator(System::Collections::Generic::ICollection& enumerable); + ~SystemCollectionsGenericICollectionSystemSingleIterator(); + SystemCollectionsGenericICollectionSystemSingleIterator& operator++(); + bool operator!=(const SystemCollectionsGenericICollectionSystemSingleIterator& other); + float operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionSystemSingleIterator begin(System::Collections::Generic::ICollection& enumerable); + Plugin::SystemCollectionsGenericICollectionSystemSingleIterator end(System::Collections::Generic::ICollection& enumerable); + } + } +} + namespace System { namespace Collections @@ -2021,13 +2358,13 @@ namespace System { template<> struct ICollection : virtual System::Collections::Generic::IEnumerable { - ICollection(decltype(nullptr) n); + ICollection(decltype(nullptr)); ICollection(Plugin::InternalUse iu, int32_t handle); ICollection(const ICollection& other); ICollection(ICollection&& other); virtual ~ICollection(); ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr) other); + ICollection& operator=(decltype(nullptr)); ICollection& operator=(ICollection&& other); bool operator==(const ICollection& other) const; bool operator!=(const ICollection& other) const; @@ -2036,6 +2373,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(decltype(nullptr)); + SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(System::Collections::Generic::ICollection& enumerable); + ~SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(); + SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& operator++(); + bool operator!=(const SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& other); + UnityEngine::RaycastHit operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator begin(System::Collections::Generic::ICollection& enumerable); + Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator end(System::Collections::Generic::ICollection& enumerable); + } + } +} + namespace System { namespace Collections @@ -2044,13 +2408,13 @@ namespace System { template<> struct ICollection : virtual System::Collections::Generic::IEnumerable { - ICollection(decltype(nullptr) n); + ICollection(decltype(nullptr)); ICollection(Plugin::InternalUse iu, int32_t handle); ICollection(const ICollection& other); ICollection(ICollection&& other); virtual ~ICollection(); ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr) other); + ICollection& operator=(decltype(nullptr)); ICollection& operator=(ICollection&& other); bool operator==(const ICollection& other) const; bool operator!=(const ICollection& other) const; @@ -2059,6 +2423,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(decltype(nullptr)); + SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(System::Collections::Generic::ICollection& enumerable); + ~SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(); + SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& operator++(); + bool operator!=(const SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& other); + UnityEngine::GradientColorKey operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::ICollection& enumerable); + Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator end(System::Collections::Generic::ICollection& enumerable); + } + } +} + namespace System { namespace Collections @@ -2067,13 +2458,13 @@ namespace System { template<> struct ICollection : virtual System::Collections::Generic::IEnumerable { - ICollection(decltype(nullptr) n); + ICollection(decltype(nullptr)); ICollection(Plugin::InternalUse iu, int32_t handle); ICollection(const ICollection& other); ICollection(ICollection&& other); virtual ~ICollection(); ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr) other); + ICollection& operator=(decltype(nullptr)); ICollection& operator=(ICollection&& other); bool operator==(const ICollection& other) const; bool operator!=(const ICollection& other) const; @@ -2082,6 +2473,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsGenericICollectionUnityEngineResolutionIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericICollectionUnityEngineResolutionIterator(decltype(nullptr)); + SystemCollectionsGenericICollectionUnityEngineResolutionIterator(System::Collections::Generic::ICollection& enumerable); + ~SystemCollectionsGenericICollectionUnityEngineResolutionIterator(); + SystemCollectionsGenericICollectionUnityEngineResolutionIterator& operator++(); + bool operator!=(const SystemCollectionsGenericICollectionUnityEngineResolutionIterator& other); + UnityEngine::Resolution operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator begin(System::Collections::Generic::ICollection& enumerable); + Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator end(System::Collections::Generic::ICollection& enumerable); + } + } +} + namespace System { namespace Collections @@ -2090,13 +2508,13 @@ namespace System { template<> struct IList : virtual System::Collections::Generic::ICollection { - IList(decltype(nullptr) n); + IList(decltype(nullptr)); IList(Plugin::InternalUse iu, int32_t handle); IList(const IList& other); IList(IList&& other); virtual ~IList(); IList& operator=(const IList& other); - IList& operator=(decltype(nullptr) other); + IList& operator=(decltype(nullptr)); IList& operator=(IList&& other); bool operator==(const IList& other) const; bool operator!=(const IList& other) const; @@ -2105,6 +2523,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsGenericIListSystemStringIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericIListSystemStringIterator(decltype(nullptr)); + SystemCollectionsGenericIListSystemStringIterator(System::Collections::Generic::IList& enumerable); + ~SystemCollectionsGenericIListSystemStringIterator(); + SystemCollectionsGenericIListSystemStringIterator& operator++(); + bool operator!=(const SystemCollectionsGenericIListSystemStringIterator& other); + System::String operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListSystemStringIterator begin(System::Collections::Generic::IList& enumerable); + Plugin::SystemCollectionsGenericIListSystemStringIterator end(System::Collections::Generic::IList& enumerable); + } + } +} + namespace System { namespace Collections @@ -2113,13 +2558,13 @@ namespace System { template<> struct IList : virtual System::Collections::Generic::ICollection { - IList(decltype(nullptr) n); + IList(decltype(nullptr)); IList(Plugin::InternalUse iu, int32_t handle); IList(const IList& other); IList(IList&& other); virtual ~IList(); IList& operator=(const IList& other); - IList& operator=(decltype(nullptr) other); + IList& operator=(decltype(nullptr)); IList& operator=(IList&& other); bool operator==(const IList& other) const; bool operator!=(const IList& other) const; @@ -2128,6 +2573,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsGenericIListSystemInt32Iterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericIListSystemInt32Iterator(decltype(nullptr)); + SystemCollectionsGenericIListSystemInt32Iterator(System::Collections::Generic::IList& enumerable); + ~SystemCollectionsGenericIListSystemInt32Iterator(); + SystemCollectionsGenericIListSystemInt32Iterator& operator++(); + bool operator!=(const SystemCollectionsGenericIListSystemInt32Iterator& other); + int32_t operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListSystemInt32Iterator begin(System::Collections::Generic::IList& enumerable); + Plugin::SystemCollectionsGenericIListSystemInt32Iterator end(System::Collections::Generic::IList& enumerable); + } + } +} + namespace System { namespace Collections @@ -2136,13 +2608,13 @@ namespace System { template<> struct IList : virtual System::Collections::Generic::ICollection { - IList(decltype(nullptr) n); + IList(decltype(nullptr)); IList(Plugin::InternalUse iu, int32_t handle); IList(const IList& other); IList(IList&& other); virtual ~IList(); IList& operator=(const IList& other); - IList& operator=(decltype(nullptr) other); + IList& operator=(decltype(nullptr)); IList& operator=(IList&& other); bool operator==(const IList& other) const; bool operator!=(const IList& other) const; @@ -2151,6 +2623,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsGenericIListSystemSingleIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericIListSystemSingleIterator(decltype(nullptr)); + SystemCollectionsGenericIListSystemSingleIterator(System::Collections::Generic::IList& enumerable); + ~SystemCollectionsGenericIListSystemSingleIterator(); + SystemCollectionsGenericIListSystemSingleIterator& operator++(); + bool operator!=(const SystemCollectionsGenericIListSystemSingleIterator& other); + float operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListSystemSingleIterator begin(System::Collections::Generic::IList& enumerable); + Plugin::SystemCollectionsGenericIListSystemSingleIterator end(System::Collections::Generic::IList& enumerable); + } + } +} + namespace System { namespace Collections @@ -2159,13 +2658,13 @@ namespace System { template<> struct IList : virtual System::Collections::Generic::ICollection { - IList(decltype(nullptr) n); + IList(decltype(nullptr)); IList(Plugin::InternalUse iu, int32_t handle); IList(const IList& other); IList(IList&& other); virtual ~IList(); IList& operator=(const IList& other); - IList& operator=(decltype(nullptr) other); + IList& operator=(decltype(nullptr)); IList& operator=(IList&& other); bool operator==(const IList& other) const; bool operator!=(const IList& other) const; @@ -2174,6 +2673,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsGenericIListUnityEngineRaycastHitIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericIListUnityEngineRaycastHitIterator(decltype(nullptr)); + SystemCollectionsGenericIListUnityEngineRaycastHitIterator(System::Collections::Generic::IList& enumerable); + ~SystemCollectionsGenericIListUnityEngineRaycastHitIterator(); + SystemCollectionsGenericIListUnityEngineRaycastHitIterator& operator++(); + bool operator!=(const SystemCollectionsGenericIListUnityEngineRaycastHitIterator& other); + UnityEngine::RaycastHit operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator begin(System::Collections::Generic::IList& enumerable); + Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator end(System::Collections::Generic::IList& enumerable); + } + } +} + namespace System { namespace Collections @@ -2182,13 +2708,13 @@ namespace System { template<> struct IList : virtual System::Collections::Generic::ICollection { - IList(decltype(nullptr) n); + IList(decltype(nullptr)); IList(Plugin::InternalUse iu, int32_t handle); IList(const IList& other); IList(IList&& other); virtual ~IList(); IList& operator=(const IList& other); - IList& operator=(decltype(nullptr) other); + IList& operator=(decltype(nullptr)); IList& operator=(IList&& other); bool operator==(const IList& other) const; bool operator!=(const IList& other) const; @@ -2197,6 +2723,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(decltype(nullptr)); + SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(System::Collections::Generic::IList& enumerable); + ~SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(); + SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& operator++(); + bool operator!=(const SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& other); + UnityEngine::GradientColorKey operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::IList& enumerable); + Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator end(System::Collections::Generic::IList& enumerable); + } + } +} + namespace System { namespace Collections @@ -2205,13 +2758,13 @@ namespace System { template<> struct IList : virtual System::Collections::Generic::ICollection { - IList(decltype(nullptr) n); + IList(decltype(nullptr)); IList(Plugin::InternalUse iu, int32_t handle); IList(const IList& other); IList(IList&& other); virtual ~IList(); IList& operator=(const IList& other); - IList& operator=(decltype(nullptr) other); + IList& operator=(decltype(nullptr)); IList& operator=(IList&& other); bool operator==(const IList& other) const; bool operator!=(const IList& other) const; @@ -2220,6 +2773,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsGenericIListUnityEngineResolutionIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericIListUnityEngineResolutionIterator(decltype(nullptr)); + SystemCollectionsGenericIListUnityEngineResolutionIterator(System::Collections::Generic::IList& enumerable); + ~SystemCollectionsGenericIListUnityEngineResolutionIterator(); + SystemCollectionsGenericIListUnityEngineResolutionIterator& operator++(); + bool operator!=(const SystemCollectionsGenericIListUnityEngineResolutionIterator& other); + UnityEngine::Resolution operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator begin(System::Collections::Generic::IList& enumerable); + Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator end(System::Collections::Generic::IList& enumerable); + } + } +} + namespace System { namespace Runtime @@ -2228,13 +2808,13 @@ namespace System { struct ISerializable : virtual System::Object { - ISerializable(decltype(nullptr) n); + ISerializable(decltype(nullptr)); ISerializable(Plugin::InternalUse iu, int32_t handle); ISerializable(const ISerializable& other); ISerializable(ISerializable&& other); virtual ~ISerializable(); ISerializable& operator=(const ISerializable& other); - ISerializable& operator=(decltype(nullptr) other); + ISerializable& operator=(decltype(nullptr)); ISerializable& operator=(ISerializable&& other); bool operator==(const ISerializable& other) const; bool operator!=(const ISerializable& other) const; @@ -2251,13 +2831,13 @@ namespace System { struct _Exception : virtual System::Object { - _Exception(decltype(nullptr) n); + _Exception(decltype(nullptr)); _Exception(Plugin::InternalUse iu, int32_t handle); _Exception(const _Exception& other); _Exception(_Exception&& other); virtual ~_Exception(); _Exception& operator=(const _Exception& other); - _Exception& operator=(decltype(nullptr) other); + _Exception& operator=(decltype(nullptr)); _Exception& operator=(_Exception&& other); bool operator==(const _Exception& other) const; bool operator!=(const _Exception& other) const; @@ -2270,13 +2850,13 @@ namespace System { struct IAppDomainSetup : virtual System::Object { - IAppDomainSetup(decltype(nullptr) n); + IAppDomainSetup(decltype(nullptr)); IAppDomainSetup(Plugin::InternalUse iu, int32_t handle); IAppDomainSetup(const IAppDomainSetup& other); IAppDomainSetup(IAppDomainSetup&& other); virtual ~IAppDomainSetup(); IAppDomainSetup& operator=(const IAppDomainSetup& other); - IAppDomainSetup& operator=(decltype(nullptr) other); + IAppDomainSetup& operator=(decltype(nullptr)); IAppDomainSetup& operator=(IAppDomainSetup&& other); bool operator==(const IAppDomainSetup& other) const; bool operator!=(const IAppDomainSetup& other) const; @@ -2289,13 +2869,13 @@ namespace System { struct IComparer : virtual System::Object { - IComparer(decltype(nullptr) n); + IComparer(decltype(nullptr)); IComparer(Plugin::InternalUse iu, int32_t handle); IComparer(const IComparer& other); IComparer(IComparer&& other); virtual ~IComparer(); IComparer& operator=(const IComparer& other); - IComparer& operator=(decltype(nullptr) other); + IComparer& operator=(decltype(nullptr)); IComparer& operator=(IComparer&& other); bool operator==(const IComparer& other) const; bool operator!=(const IComparer& other) const; @@ -2309,13 +2889,13 @@ namespace System { struct IEqualityComparer : virtual System::Object { - IEqualityComparer(decltype(nullptr) n); + IEqualityComparer(decltype(nullptr)); IEqualityComparer(Plugin::InternalUse iu, int32_t handle); IEqualityComparer(const IEqualityComparer& other); IEqualityComparer(IEqualityComparer&& other); virtual ~IEqualityComparer(); IEqualityComparer& operator=(const IEqualityComparer& other); - IEqualityComparer& operator=(decltype(nullptr) other); + IEqualityComparer& operator=(decltype(nullptr)); IEqualityComparer& operator=(IEqualityComparer&& other); bool operator==(const IEqualityComparer& other) const; bool operator!=(const IEqualityComparer& other) const; @@ -2331,13 +2911,13 @@ namespace System { template<> struct IEqualityComparer : virtual System::Object { - IEqualityComparer(decltype(nullptr) n); + IEqualityComparer(decltype(nullptr)); IEqualityComparer(Plugin::InternalUse iu, int32_t handle); IEqualityComparer(const IEqualityComparer& other); IEqualityComparer(IEqualityComparer&& other); virtual ~IEqualityComparer(); IEqualityComparer& operator=(const IEqualityComparer& other); - IEqualityComparer& operator=(decltype(nullptr) other); + IEqualityComparer& operator=(decltype(nullptr)); IEqualityComparer& operator=(IEqualityComparer&& other); bool operator==(const IEqualityComparer& other) const; bool operator!=(const IEqualityComparer& other) const; @@ -2354,13 +2934,13 @@ namespace System { template<> struct IEqualityComparer : virtual System::Object { - IEqualityComparer(decltype(nullptr) n); + IEqualityComparer(decltype(nullptr)); IEqualityComparer(Plugin::InternalUse iu, int32_t handle); IEqualityComparer(const IEqualityComparer& other); IEqualityComparer(IEqualityComparer&& other); virtual ~IEqualityComparer(); IEqualityComparer& operator=(const IEqualityComparer& other); - IEqualityComparer& operator=(decltype(nullptr) other); + IEqualityComparer& operator=(decltype(nullptr)); IEqualityComparer& operator=(IEqualityComparer&& other); bool operator==(const IEqualityComparer& other) const; bool operator!=(const IEqualityComparer& other) const; @@ -2375,13 +2955,13 @@ namespace UnityEngine { struct PlayableGraph : virtual System::ValueType { - PlayableGraph(decltype(nullptr) n); + PlayableGraph(decltype(nullptr)); PlayableGraph(Plugin::InternalUse iu, int32_t handle); PlayableGraph(const PlayableGraph& other); PlayableGraph(PlayableGraph&& other); virtual ~PlayableGraph(); PlayableGraph& operator=(const PlayableGraph& other); - PlayableGraph& operator=(decltype(nullptr) other); + PlayableGraph& operator=(decltype(nullptr)); PlayableGraph& operator=(PlayableGraph&& other); bool operator==(const PlayableGraph& other) const; bool operator!=(const PlayableGraph& other) const; @@ -2395,13 +2975,13 @@ namespace UnityEngine { struct IPlayable : virtual System::Object { - IPlayable(decltype(nullptr) n); + IPlayable(decltype(nullptr)); IPlayable(Plugin::InternalUse iu, int32_t handle); IPlayable(const IPlayable& other); IPlayable(IPlayable&& other); virtual ~IPlayable(); IPlayable& operator=(const IPlayable& other); - IPlayable& operator=(decltype(nullptr) other); + IPlayable& operator=(decltype(nullptr)); IPlayable& operator=(IPlayable&& other); bool operator==(const IPlayable& other) const; bool operator!=(const IPlayable& other) const; @@ -2413,13 +2993,13 @@ namespace System { template<> struct IEquatable : virtual System::Object { - IEquatable(decltype(nullptr) n); + IEquatable(decltype(nullptr)); IEquatable(Plugin::InternalUse iu, int32_t handle); IEquatable(const IEquatable& other); IEquatable(IEquatable&& other); virtual ~IEquatable(); IEquatable& operator=(const IEquatable& other); - IEquatable& operator=(decltype(nullptr) other); + IEquatable& operator=(decltype(nullptr)); IEquatable& operator=(IEquatable&& other); bool operator==(const IEquatable& other) const; bool operator!=(const IEquatable& other) const; @@ -2432,13 +3012,13 @@ namespace UnityEngine { struct AnimationMixerPlayable : virtual System::ValueType, virtual System::IEquatable, virtual UnityEngine::Playables::IPlayable { - AnimationMixerPlayable(decltype(nullptr) n); + AnimationMixerPlayable(decltype(nullptr)); AnimationMixerPlayable(Plugin::InternalUse iu, int32_t handle); AnimationMixerPlayable(const AnimationMixerPlayable& other); AnimationMixerPlayable(AnimationMixerPlayable&& other); virtual ~AnimationMixerPlayable(); AnimationMixerPlayable& operator=(const AnimationMixerPlayable& other); - AnimationMixerPlayable& operator=(decltype(nullptr) other); + AnimationMixerPlayable& operator=(decltype(nullptr)); AnimationMixerPlayable& operator=(AnimationMixerPlayable&& other); bool operator==(const AnimationMixerPlayable& other) const; bool operator!=(const AnimationMixerPlayable& other) const; @@ -2455,13 +3035,13 @@ namespace System { struct IStrongBox : virtual System::Object { - IStrongBox(decltype(nullptr) n); + IStrongBox(decltype(nullptr)); IStrongBox(Plugin::InternalUse iu, int32_t handle); IStrongBox(const IStrongBox& other); IStrongBox(IStrongBox&& other); virtual ~IStrongBox(); IStrongBox& operator=(const IStrongBox& other); - IStrongBox& operator=(decltype(nullptr) other); + IStrongBox& operator=(decltype(nullptr)); IStrongBox& operator=(IStrongBox&& other); bool operator==(const IStrongBox& other) const; bool operator!=(const IStrongBox& other) const; @@ -2478,13 +3058,13 @@ namespace UnityEngine { struct IEventHandler : virtual System::Object { - IEventHandler(decltype(nullptr) n); + IEventHandler(decltype(nullptr)); IEventHandler(Plugin::InternalUse iu, int32_t handle); IEventHandler(const IEventHandler& other); IEventHandler(IEventHandler&& other); virtual ~IEventHandler(); IEventHandler& operator=(const IEventHandler& other); - IEventHandler& operator=(decltype(nullptr) other); + IEventHandler& operator=(decltype(nullptr)); IEventHandler& operator=(IEventHandler&& other); bool operator==(const IEventHandler& other) const; bool operator!=(const IEventHandler& other) const; @@ -2501,13 +3081,13 @@ namespace UnityEngine { struct IStyle : virtual System::Object { - IStyle(decltype(nullptr) n); + IStyle(decltype(nullptr)); IStyle(Plugin::InternalUse iu, int32_t handle); IStyle(const IStyle& other); IStyle(IStyle&& other); virtual ~IStyle(); IStyle& operator=(const IStyle& other); - IStyle& operator=(decltype(nullptr) other); + IStyle& operator=(decltype(nullptr)); IStyle& operator=(IStyle&& other); bool operator==(const IStyle& other) const; bool operator!=(const IStyle& other) const; @@ -2522,13 +3102,13 @@ namespace System { struct Stopwatch : virtual System::Object { - Stopwatch(decltype(nullptr) n); + Stopwatch(decltype(nullptr)); Stopwatch(Plugin::InternalUse iu, int32_t handle); Stopwatch(const Stopwatch& other); Stopwatch(Stopwatch&& other); virtual ~Stopwatch(); Stopwatch& operator=(const Stopwatch& other); - Stopwatch& operator=(decltype(nullptr) other); + Stopwatch& operator=(decltype(nullptr)); Stopwatch& operator=(Stopwatch&& other); bool operator==(const Stopwatch& other) const; bool operator!=(const Stopwatch& other) const; @@ -2544,13 +3124,13 @@ namespace UnityEngine { struct GameObject : virtual UnityEngine::Object { - GameObject(decltype(nullptr) n); + GameObject(decltype(nullptr)); GameObject(Plugin::InternalUse iu, int32_t handle); GameObject(const GameObject& other); GameObject(GameObject&& other); virtual ~GameObject(); GameObject& operator=(const GameObject& other); - GameObject& operator=(decltype(nullptr) other); + GameObject& operator=(decltype(nullptr)); GameObject& operator=(GameObject&& other); bool operator==(const GameObject& other) const; bool operator!=(const GameObject& other) const; @@ -2566,13 +3146,13 @@ namespace UnityEngine { struct Debug : virtual System::Object { - Debug(decltype(nullptr) n); + Debug(decltype(nullptr)); Debug(Plugin::InternalUse iu, int32_t handle); Debug(const Debug& other); Debug(Debug&& other); virtual ~Debug(); Debug& operator=(const Debug& other); - Debug& operator=(decltype(nullptr) other); + Debug& operator=(decltype(nullptr)); Debug& operator=(Debug&& other); bool operator==(const Debug& other) const; bool operator!=(const Debug& other) const; @@ -2597,13 +3177,13 @@ namespace UnityEngine { struct Collision : virtual System::Object { - Collision(decltype(nullptr) n); + Collision(decltype(nullptr)); Collision(Plugin::InternalUse iu, int32_t handle); Collision(const Collision& other); Collision(Collision&& other); virtual ~Collision(); Collision& operator=(const Collision& other); - Collision& operator=(decltype(nullptr) other); + Collision& operator=(decltype(nullptr)); Collision& operator=(Collision&& other); bool operator==(const Collision& other) const; bool operator!=(const Collision& other) const; @@ -2614,13 +3194,13 @@ namespace UnityEngine { struct Behaviour : virtual UnityEngine::Component { - Behaviour(decltype(nullptr) n); + Behaviour(decltype(nullptr)); Behaviour(Plugin::InternalUse iu, int32_t handle); Behaviour(const Behaviour& other); Behaviour(Behaviour&& other); virtual ~Behaviour(); Behaviour& operator=(const Behaviour& other); - Behaviour& operator=(decltype(nullptr) other); + Behaviour& operator=(decltype(nullptr)); Behaviour& operator=(Behaviour&& other); bool operator==(const Behaviour& other) const; bool operator!=(const Behaviour& other) const; @@ -2631,13 +3211,13 @@ namespace UnityEngine { struct MonoBehaviour : virtual UnityEngine::Behaviour { - MonoBehaviour(decltype(nullptr) n); + MonoBehaviour(decltype(nullptr)); MonoBehaviour(Plugin::InternalUse iu, int32_t handle); MonoBehaviour(const MonoBehaviour& other); MonoBehaviour(MonoBehaviour&& other); virtual ~MonoBehaviour(); MonoBehaviour& operator=(const MonoBehaviour& other); - MonoBehaviour& operator=(decltype(nullptr) other); + MonoBehaviour& operator=(decltype(nullptr)); MonoBehaviour& operator=(MonoBehaviour&& other); bool operator==(const MonoBehaviour& other) const; bool operator!=(const MonoBehaviour& other) const; @@ -2649,13 +3229,13 @@ namespace UnityEngine { struct AudioSettings : virtual System::Object { - AudioSettings(decltype(nullptr) n); + AudioSettings(decltype(nullptr)); AudioSettings(Plugin::InternalUse iu, int32_t handle); AudioSettings(const AudioSettings& other); AudioSettings(AudioSettings&& other); virtual ~AudioSettings(); AudioSettings& operator=(const AudioSettings& other); - AudioSettings& operator=(decltype(nullptr) other); + AudioSettings& operator=(decltype(nullptr)); AudioSettings& operator=(AudioSettings&& other); bool operator==(const AudioSettings& other) const; bool operator!=(const AudioSettings& other) const; @@ -2669,13 +3249,13 @@ namespace UnityEngine { struct NetworkTransport : virtual System::Object { - NetworkTransport(decltype(nullptr) n); + NetworkTransport(decltype(nullptr)); NetworkTransport(Plugin::InternalUse iu, int32_t handle); NetworkTransport(const NetworkTransport& other); NetworkTransport(NetworkTransport&& other); virtual ~NetworkTransport(); NetworkTransport& operator=(const NetworkTransport& other); - NetworkTransport& operator=(decltype(nullptr) other); + NetworkTransport& operator=(decltype(nullptr)); NetworkTransport& operator=(NetworkTransport&& other); bool operator==(const NetworkTransport& other) const; bool operator!=(const NetworkTransport& other) const; @@ -2731,13 +3311,13 @@ namespace System { template<> struct KeyValuePair : virtual System::ValueType { - KeyValuePair(decltype(nullptr) n); + KeyValuePair(decltype(nullptr)); KeyValuePair(Plugin::InternalUse iu, int32_t handle); KeyValuePair(const KeyValuePair& other); KeyValuePair(KeyValuePair&& other); virtual ~KeyValuePair(); KeyValuePair& operator=(const KeyValuePair& other); - KeyValuePair& operator=(decltype(nullptr) other); + KeyValuePair& operator=(decltype(nullptr)); KeyValuePair& operator=(KeyValuePair&& other); bool operator==(const KeyValuePair& other) const; bool operator!=(const KeyValuePair& other) const; @@ -2757,13 +3337,13 @@ namespace System { template<> struct List : virtual System::Collections::IList, virtual System::Collections::Generic::IList { - List(decltype(nullptr) n); + List(decltype(nullptr)); List(Plugin::InternalUse iu, int32_t handle); List(const List& other); List(List&& other); virtual ~List(); List& operator=(const List& other); - List& operator=(decltype(nullptr) other); + List& operator=(decltype(nullptr)); List& operator=(List&& other); bool operator==(const List& other) const; bool operator!=(const List& other) const; @@ -2777,6 +3357,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsGenericListSystemStringIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericListSystemStringIterator(decltype(nullptr)); + SystemCollectionsGenericListSystemStringIterator(System::Collections::Generic::List& enumerable); + ~SystemCollectionsGenericListSystemStringIterator(); + SystemCollectionsGenericListSystemStringIterator& operator++(); + bool operator!=(const SystemCollectionsGenericListSystemStringIterator& other); + System::String operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericListSystemStringIterator begin(System::Collections::Generic::List& enumerable); + Plugin::SystemCollectionsGenericListSystemStringIterator end(System::Collections::Generic::List& enumerable); + } + } +} + namespace System { namespace Collections @@ -2785,13 +3392,13 @@ namespace System { template<> struct List : virtual System::Collections::IList, virtual System::Collections::Generic::IList { - List(decltype(nullptr) n); + List(decltype(nullptr)); List(Plugin::InternalUse iu, int32_t handle); List(const List& other); List(List&& other); virtual ~List(); List& operator=(const List& other); - List& operator=(decltype(nullptr) other); + List& operator=(decltype(nullptr)); List& operator=(List&& other); bool operator==(const List& other) const; bool operator!=(const List& other) const; @@ -2805,6 +3412,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsGenericListSystemInt32Iterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericListSystemInt32Iterator(decltype(nullptr)); + SystemCollectionsGenericListSystemInt32Iterator(System::Collections::Generic::List& enumerable); + ~SystemCollectionsGenericListSystemInt32Iterator(); + SystemCollectionsGenericListSystemInt32Iterator& operator++(); + bool operator!=(const SystemCollectionsGenericListSystemInt32Iterator& other); + int32_t operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericListSystemInt32Iterator begin(System::Collections::Generic::List& enumerable); + Plugin::SystemCollectionsGenericListSystemInt32Iterator end(System::Collections::Generic::List& enumerable); + } + } +} + namespace System { namespace Collections @@ -2813,13 +3447,13 @@ namespace System { template<> struct LinkedListNode : virtual System::Object { - LinkedListNode(decltype(nullptr) n); + LinkedListNode(decltype(nullptr)); LinkedListNode(Plugin::InternalUse iu, int32_t handle); LinkedListNode(const LinkedListNode& other); LinkedListNode(LinkedListNode&& other); virtual ~LinkedListNode(); LinkedListNode& operator=(const LinkedListNode& other); - LinkedListNode& operator=(decltype(nullptr) other); + LinkedListNode& operator=(decltype(nullptr)); LinkedListNode& operator=(LinkedListNode&& other); bool operator==(const LinkedListNode& other) const; bool operator!=(const LinkedListNode& other) const; @@ -2839,13 +3473,13 @@ namespace System { template<> struct StrongBox : virtual System::Runtime::CompilerServices::IStrongBox { - StrongBox(decltype(nullptr) n); + StrongBox(decltype(nullptr)); StrongBox(Plugin::InternalUse iu, int32_t handle); StrongBox(const StrongBox& other); StrongBox(StrongBox&& other); virtual ~StrongBox(); StrongBox& operator=(const StrongBox& other); - StrongBox& operator=(decltype(nullptr) other); + StrongBox& operator=(decltype(nullptr)); StrongBox& operator=(StrongBox&& other); bool operator==(const StrongBox& other) const; bool operator!=(const StrongBox& other) const; @@ -2865,13 +3499,13 @@ namespace System { template<> struct Collection : virtual System::Collections::IList, virtual System::Collections::Generic::IList { - Collection(decltype(nullptr) n); + Collection(decltype(nullptr)); Collection(Plugin::InternalUse iu, int32_t handle); Collection(const Collection& other); Collection(Collection&& other); virtual ~Collection(); Collection& operator=(const Collection& other); - Collection& operator=(decltype(nullptr) other); + Collection& operator=(decltype(nullptr)); Collection& operator=(Collection&& other); bool operator==(const Collection& other) const; bool operator!=(const Collection& other) const; @@ -2880,6 +3514,33 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsObjectModelCollectionSystemInt32Iterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsObjectModelCollectionSystemInt32Iterator(decltype(nullptr)); + SystemCollectionsObjectModelCollectionSystemInt32Iterator(System::Collections::ObjectModel::Collection& enumerable); + ~SystemCollectionsObjectModelCollectionSystemInt32Iterator(); + SystemCollectionsObjectModelCollectionSystemInt32Iterator& operator++(); + bool operator!=(const SystemCollectionsObjectModelCollectionSystemInt32Iterator& other); + int32_t operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator begin(System::Collections::ObjectModel::Collection& enumerable); + Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator end(System::Collections::ObjectModel::Collection& enumerable); + } + } +} + namespace System { namespace Collections @@ -2888,13 +3549,13 @@ namespace System { template<> struct KeyedCollection : virtual System::Collections::ObjectModel::Collection, virtual System::Collections::IList, virtual System::Collections::Generic::IList { - KeyedCollection(decltype(nullptr) n); + KeyedCollection(decltype(nullptr)); KeyedCollection(Plugin::InternalUse iu, int32_t handle); KeyedCollection(const KeyedCollection& other); KeyedCollection(KeyedCollection&& other); virtual ~KeyedCollection(); KeyedCollection& operator=(const KeyedCollection& other); - KeyedCollection& operator=(decltype(nullptr) other); + KeyedCollection& operator=(decltype(nullptr)); KeyedCollection& operator=(KeyedCollection&& other); bool operator==(const KeyedCollection& other) const; bool operator!=(const KeyedCollection& other) const; @@ -2903,17 +3564,44 @@ namespace System } } +namespace Plugin +{ + struct SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(decltype(nullptr)); + SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(System::Collections::ObjectModel::KeyedCollection& enumerable); + ~SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(); + SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& operator++(); + bool operator!=(const SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& other); + int32_t operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator begin(System::Collections::ObjectModel::KeyedCollection& enumerable); + Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator end(System::Collections::ObjectModel::KeyedCollection& enumerable); + } + } +} + namespace System { struct Exception : virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable { - Exception(decltype(nullptr) n); + Exception(decltype(nullptr)); Exception(Plugin::InternalUse iu, int32_t handle); Exception(const Exception& other); Exception(Exception&& other); virtual ~Exception(); Exception& operator=(const Exception& other); - Exception& operator=(decltype(nullptr) other); + Exception& operator=(decltype(nullptr)); Exception& operator=(Exception&& other); bool operator==(const Exception& other) const; bool operator!=(const Exception& other) const; @@ -2925,13 +3613,13 @@ namespace System { struct SystemException : virtual System::Exception, virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable { - SystemException(decltype(nullptr) n); + SystemException(decltype(nullptr)); SystemException(Plugin::InternalUse iu, int32_t handle); SystemException(const SystemException& other); SystemException(SystemException&& other); virtual ~SystemException(); SystemException& operator=(const SystemException& other); - SystemException& operator=(decltype(nullptr) other); + SystemException& operator=(decltype(nullptr)); SystemException& operator=(SystemException&& other); bool operator==(const SystemException& other) const; bool operator!=(const SystemException& other) const; @@ -2942,13 +3630,13 @@ namespace System { struct NullReferenceException : virtual System::SystemException, virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable { - NullReferenceException(decltype(nullptr) n); + NullReferenceException(decltype(nullptr)); NullReferenceException(Plugin::InternalUse iu, int32_t handle); NullReferenceException(const NullReferenceException& other); NullReferenceException(NullReferenceException&& other); virtual ~NullReferenceException(); NullReferenceException& operator=(const NullReferenceException& other); - NullReferenceException& operator=(decltype(nullptr) other); + NullReferenceException& operator=(decltype(nullptr)); NullReferenceException& operator=(NullReferenceException&& other); bool operator==(const NullReferenceException& other) const; bool operator!=(const NullReferenceException& other) const; @@ -2959,13 +3647,13 @@ namespace UnityEngine { struct Screen : virtual System::Object { - Screen(decltype(nullptr) n); + Screen(decltype(nullptr)); Screen(Plugin::InternalUse iu, int32_t handle); Screen(const Screen& other); Screen(Screen&& other); virtual ~Screen(); Screen& operator=(const Screen& other); - Screen& operator=(decltype(nullptr) other); + Screen& operator=(decltype(nullptr)); Screen& operator=(Screen&& other); bool operator==(const Screen& other) const; bool operator!=(const Screen& other) const; @@ -2977,13 +3665,13 @@ namespace UnityEngine { struct Ray : virtual System::ValueType { - Ray(decltype(nullptr) n); + Ray(decltype(nullptr)); Ray(Plugin::InternalUse iu, int32_t handle); Ray(const Ray& other); Ray(Ray&& other); virtual ~Ray(); Ray& operator=(const Ray& other); - Ray& operator=(decltype(nullptr) other); + Ray& operator=(decltype(nullptr)); Ray& operator=(Ray&& other); bool operator==(const Ray& other) const; bool operator!=(const Ray& other) const; @@ -2995,13 +3683,13 @@ namespace UnityEngine { struct Physics : virtual System::Object { - Physics(decltype(nullptr) n); + Physics(decltype(nullptr)); Physics(Plugin::InternalUse iu, int32_t handle); Physics(const Physics& other); Physics(Physics&& other); virtual ~Physics(); Physics& operator=(const Physics& other); - Physics& operator=(decltype(nullptr) other); + Physics& operator=(decltype(nullptr)); Physics& operator=(Physics&& other); bool operator==(const Physics& other) const; bool operator!=(const Physics& other) const; @@ -3014,13 +3702,13 @@ namespace UnityEngine { struct Gradient : virtual System::Object { - Gradient(decltype(nullptr) n); + Gradient(decltype(nullptr)); Gradient(Plugin::InternalUse iu, int32_t handle); Gradient(const Gradient& other); Gradient(Gradient&& other); virtual ~Gradient(); Gradient& operator=(const Gradient& other); - Gradient& operator=(decltype(nullptr) other); + Gradient& operator=(decltype(nullptr)); Gradient& operator=(Gradient&& other); bool operator==(const Gradient& other) const; bool operator!=(const Gradient& other) const; @@ -3034,13 +3722,13 @@ namespace System { struct AppDomainSetup : virtual System::IAppDomainSetup { - AppDomainSetup(decltype(nullptr) n); + AppDomainSetup(decltype(nullptr)); AppDomainSetup(Plugin::InternalUse iu, int32_t handle); AppDomainSetup(const AppDomainSetup& other); AppDomainSetup(AppDomainSetup&& other); virtual ~AppDomainSetup(); AppDomainSetup& operator=(const AppDomainSetup& other); - AppDomainSetup& operator=(decltype(nullptr) other); + AppDomainSetup& operator=(decltype(nullptr)); AppDomainSetup& operator=(AppDomainSetup&& other); bool operator==(const AppDomainSetup& other) const; bool operator!=(const AppDomainSetup& other) const; @@ -3054,13 +3742,13 @@ namespace UnityEngine { struct Application : virtual System::Object { - Application(decltype(nullptr) n); + Application(decltype(nullptr)); Application(Plugin::InternalUse iu, int32_t handle); Application(const Application& other); Application(Application&& other); virtual ~Application(); Application& operator=(const Application& other); - Application& operator=(decltype(nullptr) other); + Application& operator=(decltype(nullptr)); Application& operator=(Application&& other); bool operator==(const Application& other) const; bool operator!=(const Application& other) const; @@ -3075,13 +3763,13 @@ namespace UnityEngine { struct SceneManager : virtual System::Object { - SceneManager(decltype(nullptr) n); + SceneManager(decltype(nullptr)); SceneManager(Plugin::InternalUse iu, int32_t handle); SceneManager(const SceneManager& other); SceneManager(SceneManager&& other); virtual ~SceneManager(); SceneManager& operator=(const SceneManager& other); - SceneManager& operator=(decltype(nullptr) other); + SceneManager& operator=(decltype(nullptr)); SceneManager& operator=(SceneManager&& other); bool operator==(const SceneManager& other) const; bool operator!=(const SceneManager& other) const; @@ -3097,13 +3785,13 @@ namespace UnityEngine { struct Scene : virtual System::ValueType { - Scene(decltype(nullptr) n); + Scene(decltype(nullptr)); Scene(Plugin::InternalUse iu, int32_t handle); Scene(const Scene& other); Scene(Scene&& other); virtual ~Scene(); Scene& operator=(const Scene& other); - Scene& operator=(decltype(nullptr) other); + Scene& operator=(decltype(nullptr)); Scene& operator=(Scene&& other); bool operator==(const Scene& other) const; bool operator!=(const Scene& other) const; @@ -3111,39 +3799,17 @@ namespace UnityEngine } } -namespace System -{ - namespace Collections - { - struct IEnumerator : virtual System::Object - { - IEnumerator(decltype(nullptr) n); - IEnumerator(Plugin::InternalUse iu, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr) other); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - System::Object GetCurrent(); - System::Boolean MoveNext(); - }; - } -} - namespace System { struct EventArgs : virtual System::Object { - EventArgs(decltype(nullptr) n); + EventArgs(decltype(nullptr)); EventArgs(Plugin::InternalUse iu, int32_t handle); EventArgs(const EventArgs& other); EventArgs(EventArgs&& other); virtual ~EventArgs(); EventArgs& operator=(const EventArgs& other); - EventArgs& operator=(decltype(nullptr) other); + EventArgs& operator=(decltype(nullptr)); EventArgs& operator=(EventArgs&& other); bool operator==(const EventArgs& other) const; bool operator!=(const EventArgs& other) const; @@ -3158,13 +3824,13 @@ namespace System { struct ComponentEventArgs : virtual System::EventArgs { - ComponentEventArgs(decltype(nullptr) n); + ComponentEventArgs(decltype(nullptr)); ComponentEventArgs(Plugin::InternalUse iu, int32_t handle); ComponentEventArgs(const ComponentEventArgs& other); ComponentEventArgs(ComponentEventArgs&& other); virtual ~ComponentEventArgs(); ComponentEventArgs& operator=(const ComponentEventArgs& other); - ComponentEventArgs& operator=(decltype(nullptr) other); + ComponentEventArgs& operator=(decltype(nullptr)); ComponentEventArgs& operator=(ComponentEventArgs&& other); bool operator==(const ComponentEventArgs& other) const; bool operator!=(const ComponentEventArgs& other) const; @@ -3181,13 +3847,13 @@ namespace System { struct ComponentChangingEventArgs : virtual System::EventArgs { - ComponentChangingEventArgs(decltype(nullptr) n); + ComponentChangingEventArgs(decltype(nullptr)); ComponentChangingEventArgs(Plugin::InternalUse iu, int32_t handle); ComponentChangingEventArgs(const ComponentChangingEventArgs& other); ComponentChangingEventArgs(ComponentChangingEventArgs&& other); virtual ~ComponentChangingEventArgs(); ComponentChangingEventArgs& operator=(const ComponentChangingEventArgs& other); - ComponentChangingEventArgs& operator=(decltype(nullptr) other); + ComponentChangingEventArgs& operator=(decltype(nullptr)); ComponentChangingEventArgs& operator=(ComponentChangingEventArgs&& other); bool operator==(const ComponentChangingEventArgs& other) const; bool operator!=(const ComponentChangingEventArgs& other) const; @@ -3204,13 +3870,13 @@ namespace System { struct ComponentChangedEventArgs : virtual System::EventArgs { - ComponentChangedEventArgs(decltype(nullptr) n); + ComponentChangedEventArgs(decltype(nullptr)); ComponentChangedEventArgs(Plugin::InternalUse iu, int32_t handle); ComponentChangedEventArgs(const ComponentChangedEventArgs& other); ComponentChangedEventArgs(ComponentChangedEventArgs&& other); virtual ~ComponentChangedEventArgs(); ComponentChangedEventArgs& operator=(const ComponentChangedEventArgs& other); - ComponentChangedEventArgs& operator=(decltype(nullptr) other); + ComponentChangedEventArgs& operator=(decltype(nullptr)); ComponentChangedEventArgs& operator=(ComponentChangedEventArgs&& other); bool operator==(const ComponentChangedEventArgs& other) const; bool operator!=(const ComponentChangedEventArgs& other) const; @@ -3227,13 +3893,13 @@ namespace System { struct ComponentRenameEventArgs : virtual System::EventArgs { - ComponentRenameEventArgs(decltype(nullptr) n); + ComponentRenameEventArgs(decltype(nullptr)); ComponentRenameEventArgs(Plugin::InternalUse iu, int32_t handle); ComponentRenameEventArgs(const ComponentRenameEventArgs& other); ComponentRenameEventArgs(ComponentRenameEventArgs&& other); virtual ~ComponentRenameEventArgs(); ComponentRenameEventArgs& operator=(const ComponentRenameEventArgs& other); - ComponentRenameEventArgs& operator=(decltype(nullptr) other); + ComponentRenameEventArgs& operator=(decltype(nullptr)); ComponentRenameEventArgs& operator=(ComponentRenameEventArgs&& other); bool operator==(const ComponentRenameEventArgs& other) const; bool operator!=(const ComponentRenameEventArgs& other) const; @@ -3248,13 +3914,13 @@ namespace System { struct MemberDescriptor : virtual System::Object { - MemberDescriptor(decltype(nullptr) n); + MemberDescriptor(decltype(nullptr)); MemberDescriptor(Plugin::InternalUse iu, int32_t handle); MemberDescriptor(const MemberDescriptor& other); MemberDescriptor(MemberDescriptor&& other); virtual ~MemberDescriptor(); MemberDescriptor& operator=(const MemberDescriptor& other); - MemberDescriptor& operator=(decltype(nullptr) other); + MemberDescriptor& operator=(decltype(nullptr)); MemberDescriptor& operator=(MemberDescriptor&& other); bool operator==(const MemberDescriptor& other) const; bool operator!=(const MemberDescriptor& other) const; @@ -3266,13 +3932,13 @@ namespace UnityEngine { struct Time : virtual System::Object { - Time(decltype(nullptr) n); + Time(decltype(nullptr)); Time(Plugin::InternalUse iu, int32_t handle); Time(const Time& other); Time(Time&& other); virtual ~Time(); Time& operator=(const Time& other); - Time& operator=(decltype(nullptr) other); + Time& operator=(decltype(nullptr)); Time& operator=(Time&& other); bool operator==(const Time& other) const; bool operator!=(const Time& other) const; @@ -3284,13 +3950,13 @@ namespace System { struct MarshalByRefObject : virtual System::Object { - MarshalByRefObject(decltype(nullptr) n); + MarshalByRefObject(decltype(nullptr)); MarshalByRefObject(Plugin::InternalUse iu, int32_t handle); MarshalByRefObject(const MarshalByRefObject& other); MarshalByRefObject(MarshalByRefObject&& other); virtual ~MarshalByRefObject(); MarshalByRefObject& operator=(const MarshalByRefObject& other); - MarshalByRefObject& operator=(decltype(nullptr) other); + MarshalByRefObject& operator=(decltype(nullptr)); MarshalByRefObject& operator=(MarshalByRefObject&& other); bool operator==(const MarshalByRefObject& other) const; bool operator!=(const MarshalByRefObject& other) const; @@ -3303,13 +3969,13 @@ namespace System { struct Stream : virtual System::MarshalByRefObject, virtual System::IDisposable { - Stream(decltype(nullptr) n); + Stream(decltype(nullptr)); Stream(Plugin::InternalUse iu, int32_t handle); Stream(const Stream& other); Stream(Stream&& other); virtual ~Stream(); Stream& operator=(const Stream& other); - Stream& operator=(decltype(nullptr) other); + Stream& operator=(decltype(nullptr)); Stream& operator=(Stream&& other); bool operator==(const Stream& other) const; bool operator!=(const Stream& other) const; @@ -3325,13 +3991,13 @@ namespace System { template<> struct IComparer : virtual System::Object { - IComparer(decltype(nullptr) n); + IComparer(decltype(nullptr)); IComparer(Plugin::InternalUse iu, int32_t handle); IComparer(const IComparer& other); IComparer(IComparer&& other); virtual ~IComparer(); IComparer& operator=(const IComparer& other); - IComparer& operator=(decltype(nullptr) other); + IComparer& operator=(decltype(nullptr)); IComparer& operator=(IComparer&& other); bool operator==(const IComparer& other) const; bool operator!=(const IComparer& other) const; @@ -3348,13 +4014,13 @@ namespace System { template<> struct IComparer : virtual System::Object { - IComparer(decltype(nullptr) n); + IComparer(decltype(nullptr)); IComparer(Plugin::InternalUse iu, int32_t handle); IComparer(const IComparer& other); IComparer(IComparer&& other); virtual ~IComparer(); IComparer& operator=(const IComparer& other); - IComparer& operator=(decltype(nullptr) other); + IComparer& operator=(decltype(nullptr)); IComparer& operator=(IComparer&& other); bool operator==(const IComparer& other) const; bool operator!=(const IComparer& other) const; @@ -3371,13 +4037,13 @@ namespace System { template<> struct BaseIComparer : virtual System::Collections::Generic::IComparer { - BaseIComparer(decltype(nullptr) n); + BaseIComparer(decltype(nullptr)); BaseIComparer(Plugin::InternalUse iu, int32_t handle); BaseIComparer(const BaseIComparer& other); BaseIComparer(BaseIComparer&& other); virtual ~BaseIComparer(); BaseIComparer& operator=(const BaseIComparer& other); - BaseIComparer& operator=(decltype(nullptr) other); + BaseIComparer& operator=(decltype(nullptr)); BaseIComparer& operator=(BaseIComparer&& other); bool operator==(const BaseIComparer& other) const; bool operator!=(const BaseIComparer& other) const; @@ -3397,13 +4063,13 @@ namespace System { template<> struct BaseIComparer : virtual System::Collections::Generic::IComparer { - BaseIComparer(decltype(nullptr) n); + BaseIComparer(decltype(nullptr)); BaseIComparer(Plugin::InternalUse iu, int32_t handle); BaseIComparer(const BaseIComparer& other); BaseIComparer(BaseIComparer&& other); virtual ~BaseIComparer(); BaseIComparer& operator=(const BaseIComparer& other); - BaseIComparer& operator=(decltype(nullptr) other); + BaseIComparer& operator=(decltype(nullptr)); BaseIComparer& operator=(BaseIComparer&& other); bool operator==(const BaseIComparer& other) const; bool operator!=(const BaseIComparer& other) const; @@ -3419,13 +4085,13 @@ namespace System { struct StringComparer : virtual System::Collections::IComparer, virtual System::Collections::Generic::IComparer, virtual System::Collections::IEqualityComparer, virtual System::Collections::Generic::IEqualityComparer { - StringComparer(decltype(nullptr) n); + StringComparer(decltype(nullptr)); StringComparer(Plugin::InternalUse iu, int32_t handle); StringComparer(const StringComparer& other); StringComparer(StringComparer&& other); virtual ~StringComparer(); StringComparer& operator=(const StringComparer& other); - StringComparer& operator=(decltype(nullptr) other); + StringComparer& operator=(decltype(nullptr)); StringComparer& operator=(StringComparer&& other); bool operator==(const StringComparer& other) const; bool operator!=(const StringComparer& other) const; @@ -3436,13 +4102,13 @@ namespace System { struct BaseStringComparer : virtual System::StringComparer { - BaseStringComparer(decltype(nullptr) n); + BaseStringComparer(decltype(nullptr)); BaseStringComparer(Plugin::InternalUse iu, int32_t handle); BaseStringComparer(const BaseStringComparer& other); BaseStringComparer(BaseStringComparer&& other); virtual ~BaseStringComparer(); BaseStringComparer& operator=(const BaseStringComparer& other); - BaseStringComparer& operator=(decltype(nullptr) other); + BaseStringComparer& operator=(decltype(nullptr)); BaseStringComparer& operator=(BaseStringComparer&& other); bool operator==(const BaseStringComparer& other) const; bool operator!=(const BaseStringComparer& other) const; @@ -3460,13 +4126,13 @@ namespace System { struct Queue : virtual System::ICloneable, virtual System::Collections::ICollection { - Queue(decltype(nullptr) n); + Queue(decltype(nullptr)); Queue(Plugin::InternalUse iu, int32_t handle); Queue(const Queue& other); Queue(Queue&& other); virtual ~Queue(); Queue& operator=(const Queue& other); - Queue& operator=(decltype(nullptr) other); + Queue& operator=(decltype(nullptr)); Queue& operator=(Queue&& other); bool operator==(const Queue& other) const; bool operator!=(const Queue& other) const; @@ -3481,13 +4147,13 @@ namespace System { struct BaseQueue : virtual System::Collections::Queue { - BaseQueue(decltype(nullptr) n); + BaseQueue(decltype(nullptr)); BaseQueue(Plugin::InternalUse iu, int32_t handle); BaseQueue(const BaseQueue& other); BaseQueue(BaseQueue&& other); virtual ~BaseQueue(); BaseQueue& operator=(const BaseQueue& other); - BaseQueue& operator=(decltype(nullptr) other); + BaseQueue& operator=(decltype(nullptr)); BaseQueue& operator=(BaseQueue&& other); bool operator==(const BaseQueue& other) const; bool operator!=(const BaseQueue& other) const; @@ -3506,13 +4172,13 @@ namespace System { struct IComponentChangeService : virtual System::Object { - IComponentChangeService(decltype(nullptr) n); + IComponentChangeService(decltype(nullptr)); IComponentChangeService(Plugin::InternalUse iu, int32_t handle); IComponentChangeService(const IComponentChangeService& other); IComponentChangeService(IComponentChangeService&& other); virtual ~IComponentChangeService(); IComponentChangeService& operator=(const IComponentChangeService& other); - IComponentChangeService& operator=(decltype(nullptr) other); + IComponentChangeService& operator=(decltype(nullptr)); IComponentChangeService& operator=(IComponentChangeService&& other); bool operator==(const IComponentChangeService& other) const; bool operator!=(const IComponentChangeService& other) const; @@ -3529,13 +4195,13 @@ namespace System { struct BaseIComponentChangeService : virtual System::ComponentModel::Design::IComponentChangeService { - BaseIComponentChangeService(decltype(nullptr) n); + BaseIComponentChangeService(decltype(nullptr)); BaseIComponentChangeService(Plugin::InternalUse iu, int32_t handle); BaseIComponentChangeService(const BaseIComponentChangeService& other); BaseIComponentChangeService(BaseIComponentChangeService&& other); virtual ~BaseIComponentChangeService(); BaseIComponentChangeService& operator=(const BaseIComponentChangeService& other); - BaseIComponentChangeService& operator=(decltype(nullptr) other); + BaseIComponentChangeService& operator=(decltype(nullptr)); BaseIComponentChangeService& operator=(BaseIComponentChangeService&& other); bool operator==(const BaseIComponentChangeService& other) const; bool operator!=(const BaseIComponentChangeService& other) const; @@ -3568,13 +4234,13 @@ namespace System { struct FileStream : virtual System::IO::Stream, virtual System::IDisposable { - FileStream(decltype(nullptr) n); + FileStream(decltype(nullptr)); FileStream(Plugin::InternalUse iu, int32_t handle); FileStream(const FileStream& other); FileStream(FileStream&& other); virtual ~FileStream(); FileStream& operator=(const FileStream& other); - FileStream& operator=(decltype(nullptr) other); + FileStream& operator=(decltype(nullptr)); FileStream& operator=(FileStream&& other); bool operator==(const FileStream& other) const; bool operator!=(const FileStream& other) const; @@ -3590,13 +4256,13 @@ namespace System { struct BaseFileStream : virtual System::IO::FileStream { - BaseFileStream(decltype(nullptr) n); + BaseFileStream(decltype(nullptr)); BaseFileStream(Plugin::InternalUse iu, int32_t handle); BaseFileStream(const BaseFileStream& other); BaseFileStream(BaseFileStream&& other); virtual ~BaseFileStream(); BaseFileStream& operator=(const BaseFileStream& other); - BaseFileStream& operator=(decltype(nullptr) other); + BaseFileStream& operator=(decltype(nullptr)); BaseFileStream& operator=(BaseFileStream&& other); bool operator==(const BaseFileStream& other) const; bool operator!=(const BaseFileStream& other) const; @@ -3613,13 +4279,13 @@ namespace UnityEngine { struct PlayableHandle : virtual System::ValueType { - PlayableHandle(decltype(nullptr) n); + PlayableHandle(decltype(nullptr)); PlayableHandle(Plugin::InternalUse iu, int32_t handle); PlayableHandle(const PlayableHandle& other); PlayableHandle(PlayableHandle&& other); virtual ~PlayableHandle(); PlayableHandle& operator=(const PlayableHandle& other); - PlayableHandle& operator=(decltype(nullptr) other); + PlayableHandle& operator=(decltype(nullptr)); PlayableHandle& operator=(PlayableHandle&& other); bool operator==(const PlayableHandle& other) const; bool operator!=(const PlayableHandle& other) const; @@ -3635,13 +4301,13 @@ namespace UnityEngine { struct CallbackEventHandler : virtual UnityEngine::Experimental::UIElements::IEventHandler { - CallbackEventHandler(decltype(nullptr) n); + CallbackEventHandler(decltype(nullptr)); CallbackEventHandler(Plugin::InternalUse iu, int32_t handle); CallbackEventHandler(const CallbackEventHandler& other); CallbackEventHandler(CallbackEventHandler&& other); virtual ~CallbackEventHandler(); CallbackEventHandler& operator=(const CallbackEventHandler& other); - CallbackEventHandler& operator=(decltype(nullptr) other); + CallbackEventHandler& operator=(decltype(nullptr)); CallbackEventHandler& operator=(CallbackEventHandler&& other); bool operator==(const CallbackEventHandler& other) const; bool operator!=(const CallbackEventHandler& other) const; @@ -3658,13 +4324,13 @@ namespace UnityEngine { struct VisualElement : virtual UnityEngine::Experimental::UIElements::CallbackEventHandler, virtual UnityEngine::Experimental::UIElements::IEventHandler, virtual UnityEngine::Experimental::UIElements::IStyle { - VisualElement(decltype(nullptr) n); + VisualElement(decltype(nullptr)); VisualElement(Plugin::InternalUse iu, int32_t handle); VisualElement(const VisualElement& other); VisualElement(VisualElement&& other); virtual ~VisualElement(); VisualElement& operator=(const VisualElement& other); - VisualElement& operator=(decltype(nullptr) other); + VisualElement& operator=(decltype(nullptr)); VisualElement& operator=(VisualElement&& other); bool operator==(const VisualElement& other) const; bool operator!=(const VisualElement& other) const; @@ -3698,13 +4364,13 @@ namespace UnityEngine { struct InteractionSourcePose : virtual System::ValueType { - InteractionSourcePose(decltype(nullptr) n); + InteractionSourcePose(decltype(nullptr)); InteractionSourcePose(Plugin::InternalUse iu, int32_t handle); InteractionSourcePose(const InteractionSourcePose& other); InteractionSourcePose(InteractionSourcePose&& other); virtual ~InteractionSourcePose(); InteractionSourcePose& operator=(const InteractionSourcePose& other); - InteractionSourcePose& operator=(decltype(nullptr) other); + InteractionSourcePose& operator=(decltype(nullptr)); InteractionSourcePose& operator=(InteractionSourcePose&& other); bool operator==(const InteractionSourcePose& other) const; bool operator!=(const InteractionSourcePose& other) const; @@ -3721,13 +4387,13 @@ namespace MyGame { struct TestScript : virtual UnityEngine::MonoBehaviour { - TestScript(decltype(nullptr) n); + TestScript(decltype(nullptr)); TestScript(Plugin::InternalUse iu, int32_t handle); TestScript(const TestScript& other); TestScript(TestScript&& other); virtual ~TestScript(); TestScript& operator=(const TestScript& other); - TestScript& operator=(decltype(nullptr) other); + TestScript& operator=(decltype(nullptr)); TestScript& operator=(TestScript&& other); bool operator==(const TestScript& other) const; bool operator!=(const TestScript& other) const; @@ -3745,13 +4411,13 @@ namespace MyGame { struct AnotherScript : virtual UnityEngine::MonoBehaviour { - AnotherScript(decltype(nullptr) n); + AnotherScript(decltype(nullptr)); AnotherScript(Plugin::InternalUse iu, int32_t handle); AnotherScript(const AnotherScript& other); AnotherScript(AnotherScript&& other); virtual ~AnotherScript(); AnotherScript& operator=(const AnotherScript& other); - AnotherScript& operator=(decltype(nullptr) other); + AnotherScript& operator=(decltype(nullptr)); AnotherScript& operator=(AnotherScript&& other); bool operator==(const AnotherScript& other) const; bool operator!=(const AnotherScript& other) const; @@ -3777,13 +4443,13 @@ namespace System { template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { - Array1(decltype(nullptr) n); + Array1(decltype(nullptr)); Array1(Plugin::InternalUse iu, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); Array1& operator=(const Array1& other); - Array1& operator=(decltype(nullptr) other); + Array1& operator=(decltype(nullptr)); Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; @@ -3795,6 +4461,25 @@ namespace System }; } +namespace Plugin +{ + struct SystemInt32Array1Iterator + { + System::Array1& array; + int index; + SystemInt32Array1Iterator(System::Array1& array, int32_t index); + SystemInt32Array1Iterator& operator++(); + bool operator!=(const SystemInt32Array1Iterator& other); + int32_t operator*(); + }; +} + +namespace System +{ + Plugin::SystemInt32Array1Iterator begin(System::Array1& array); + Plugin::SystemInt32Array1Iterator end(System::Array1& array); +} + namespace Plugin { template<> struct ArrayElementProxy1_1 @@ -3872,13 +4557,13 @@ namespace System { template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { - Array1(decltype(nullptr) n); + Array1(decltype(nullptr)); Array1(Plugin::InternalUse iu, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); Array1& operator=(const Array1& other); - Array1& operator=(decltype(nullptr) other); + Array1& operator=(decltype(nullptr)); Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; @@ -3890,17 +4575,36 @@ namespace System }; } +namespace Plugin +{ + struct SystemSingleArray1Iterator + { + System::Array1& array; + int index; + SystemSingleArray1Iterator(System::Array1& array, int32_t index); + SystemSingleArray1Iterator& operator++(); + bool operator!=(const SystemSingleArray1Iterator& other); + float operator*(); + }; +} + +namespace System +{ + Plugin::SystemSingleArray1Iterator begin(System::Array1& array); + Plugin::SystemSingleArray1Iterator end(System::Array1& array); +} + namespace System { template<> struct Array2 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList { - Array2(decltype(nullptr) n); + Array2(decltype(nullptr)); Array2(Plugin::InternalUse iu, int32_t handle); Array2(const Array2& other); Array2(Array2&& other); virtual ~Array2(); Array2& operator=(const Array2& other); - Array2& operator=(decltype(nullptr) other); + Array2& operator=(decltype(nullptr)); Array2& operator=(Array2&& other); bool operator==(const Array2& other) const; bool operator!=(const Array2& other) const; @@ -3918,13 +4622,13 @@ namespace System { template<> struct Array3 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList { - Array3(decltype(nullptr) n); + Array3(decltype(nullptr)); Array3(Plugin::InternalUse iu, int32_t handle); Array3(const Array3& other); Array3(Array3&& other); virtual ~Array3(); Array3& operator=(const Array3& other); - Array3& operator=(decltype(nullptr) other); + Array3& operator=(decltype(nullptr)); Array3& operator=(Array3&& other); bool operator==(const Array3& other) const; bool operator!=(const Array3& other) const; @@ -3954,13 +4658,13 @@ namespace System { template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { - Array1(decltype(nullptr) n); + Array1(decltype(nullptr)); Array1(Plugin::InternalUse iu, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); Array1& operator=(const Array1& other); - Array1& operator=(decltype(nullptr) other); + Array1& operator=(decltype(nullptr)); Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; @@ -3972,6 +4676,25 @@ namespace System }; } +namespace Plugin +{ + struct SystemStringArray1Iterator + { + System::Array1& array; + int index; + SystemStringArray1Iterator(System::Array1& array, int32_t index); + SystemStringArray1Iterator& operator++(); + bool operator!=(const SystemStringArray1Iterator& other); + System::String operator*(); + }; +} + +namespace System +{ + Plugin::SystemStringArray1Iterator begin(System::Array1& array); + Plugin::SystemStringArray1Iterator end(System::Array1& array); +} + namespace Plugin { template<> struct ArrayElementProxy1_1 @@ -3988,13 +4711,13 @@ namespace System { template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { - Array1(decltype(nullptr) n); + Array1(decltype(nullptr)); Array1(Plugin::InternalUse iu, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); Array1& operator=(const Array1& other); - Array1& operator=(decltype(nullptr) other); + Array1& operator=(decltype(nullptr)); Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; @@ -4006,6 +4729,25 @@ namespace System }; } +namespace Plugin +{ + struct UnityEngineResolutionArray1Iterator + { + System::Array1& array; + int index; + UnityEngineResolutionArray1Iterator(System::Array1& array, int32_t index); + UnityEngineResolutionArray1Iterator& operator++(); + bool operator!=(const UnityEngineResolutionArray1Iterator& other); + UnityEngine::Resolution operator*(); + }; +} + +namespace System +{ + Plugin::UnityEngineResolutionArray1Iterator begin(System::Array1& array); + Plugin::UnityEngineResolutionArray1Iterator end(System::Array1& array); +} + namespace Plugin { template<> struct ArrayElementProxy1_1 @@ -4022,13 +4764,13 @@ namespace System { template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { - Array1(decltype(nullptr) n); + Array1(decltype(nullptr)); Array1(Plugin::InternalUse iu, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); Array1& operator=(const Array1& other); - Array1& operator=(decltype(nullptr) other); + Array1& operator=(decltype(nullptr)); Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; @@ -4040,6 +4782,25 @@ namespace System }; } +namespace Plugin +{ + struct UnityEngineRaycastHitArray1Iterator + { + System::Array1& array; + int index; + UnityEngineRaycastHitArray1Iterator(System::Array1& array, int32_t index); + UnityEngineRaycastHitArray1Iterator& operator++(); + bool operator!=(const UnityEngineRaycastHitArray1Iterator& other); + UnityEngine::RaycastHit operator*(); + }; +} + +namespace System +{ + Plugin::UnityEngineRaycastHitArray1Iterator begin(System::Array1& array); + Plugin::UnityEngineRaycastHitArray1Iterator end(System::Array1& array); +} + namespace Plugin { template<> struct ArrayElementProxy1_1 @@ -4056,13 +4817,13 @@ namespace System { template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { - Array1(decltype(nullptr) n); + Array1(decltype(nullptr)); Array1(Plugin::InternalUse iu, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); Array1& operator=(const Array1& other); - Array1& operator=(decltype(nullptr) other); + Array1& operator=(decltype(nullptr)); Array1& operator=(Array1&& other); bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; @@ -4074,17 +4835,36 @@ namespace System }; } +namespace Plugin +{ + struct UnityEngineGradientColorKeyArray1Iterator + { + System::Array1& array; + int index; + UnityEngineGradientColorKeyArray1Iterator(System::Array1& array, int32_t index); + UnityEngineGradientColorKeyArray1Iterator& operator++(); + bool operator!=(const UnityEngineGradientColorKeyArray1Iterator& other); + UnityEngine::GradientColorKey operator*(); + }; +} + +namespace System +{ + Plugin::UnityEngineGradientColorKeyArray1Iterator begin(System::Array1& array); + Plugin::UnityEngineGradientColorKeyArray1Iterator end(System::Array1& array); +} + namespace System { struct Action : virtual System::Object { - Action(decltype(nullptr) n); + Action(decltype(nullptr)); Action(Plugin::InternalUse iu, int32_t handle); Action(const Action& other); Action(Action&& other); virtual ~Action(); Action& operator=(const Action& other); - Action& operator=(decltype(nullptr) other); + Action& operator=(decltype(nullptr)); Action& operator=(Action&& other); bool operator==(const Action& other) const; bool operator!=(const Action& other) const; @@ -4102,13 +4882,13 @@ namespace System { template<> struct Action1 : virtual System::Object { - Action1(decltype(nullptr) n); + Action1(decltype(nullptr)); Action1(Plugin::InternalUse iu, int32_t handle); Action1(const Action1& other); Action1(Action1&& other); virtual ~Action1(); Action1& operator=(const Action1& other); - Action1& operator=(decltype(nullptr) other); + Action1& operator=(decltype(nullptr)); Action1& operator=(Action1&& other); bool operator==(const Action1& other) const; bool operator!=(const Action1& other) const; @@ -4126,13 +4906,13 @@ namespace System { template<> struct Action2 : virtual System::Object { - Action2(decltype(nullptr) n); + Action2(decltype(nullptr)); Action2(Plugin::InternalUse iu, int32_t handle); Action2(const Action2& other); Action2(Action2&& other); virtual ~Action2(); Action2& operator=(const Action2& other); - Action2& operator=(decltype(nullptr) other); + Action2& operator=(decltype(nullptr)); Action2& operator=(Action2&& other); bool operator==(const Action2& other) const; bool operator!=(const Action2& other) const; @@ -4150,13 +4930,13 @@ namespace System { template<> struct Func3 : virtual System::Object { - Func3(decltype(nullptr) n); + Func3(decltype(nullptr)); Func3(Plugin::InternalUse iu, int32_t handle); Func3(const Func3& other); Func3(Func3&& other); virtual ~Func3(); Func3& operator=(const Func3& other); - Func3& operator=(decltype(nullptr) other); + Func3& operator=(decltype(nullptr)); Func3& operator=(Func3&& other); bool operator==(const Func3& other) const; bool operator!=(const Func3& other) const; @@ -4174,13 +4954,13 @@ namespace System { template<> struct Func3 : virtual System::Object { - Func3(decltype(nullptr) n); + Func3(decltype(nullptr)); Func3(Plugin::InternalUse iu, int32_t handle); Func3(const Func3& other); Func3(Func3&& other); virtual ~Func3(); Func3& operator=(const Func3& other); - Func3& operator=(decltype(nullptr) other); + Func3& operator=(decltype(nullptr)); Func3& operator=(Func3&& other); bool operator==(const Func3& other) const; bool operator!=(const Func3& other) const; @@ -4198,13 +4978,13 @@ namespace System { struct AppDomainInitializer : virtual System::Object { - AppDomainInitializer(decltype(nullptr) n); + AppDomainInitializer(decltype(nullptr)); AppDomainInitializer(Plugin::InternalUse iu, int32_t handle); AppDomainInitializer(const AppDomainInitializer& other); AppDomainInitializer(AppDomainInitializer&& other); virtual ~AppDomainInitializer(); AppDomainInitializer& operator=(const AppDomainInitializer& other); - AppDomainInitializer& operator=(decltype(nullptr) other); + AppDomainInitializer& operator=(decltype(nullptr)); AppDomainInitializer& operator=(AppDomainInitializer&& other); bool operator==(const AppDomainInitializer& other) const; bool operator!=(const AppDomainInitializer& other) const; @@ -4224,13 +5004,13 @@ namespace UnityEngine { struct UnityAction : virtual System::Object { - UnityAction(decltype(nullptr) n); + UnityAction(decltype(nullptr)); UnityAction(Plugin::InternalUse iu, int32_t handle); UnityAction(const UnityAction& other); UnityAction(UnityAction&& other); virtual ~UnityAction(); UnityAction& operator=(const UnityAction& other); - UnityAction& operator=(decltype(nullptr) other); + UnityAction& operator=(decltype(nullptr)); UnityAction& operator=(UnityAction&& other); bool operator==(const UnityAction& other) const; bool operator!=(const UnityAction& other) const; @@ -4251,13 +5031,13 @@ namespace UnityEngine { template<> struct UnityAction2 : virtual System::Object { - UnityAction2(decltype(nullptr) n); + UnityAction2(decltype(nullptr)); UnityAction2(Plugin::InternalUse iu, int32_t handle); UnityAction2(const UnityAction2& other); UnityAction2(UnityAction2&& other); virtual ~UnityAction2(); UnityAction2& operator=(const UnityAction2& other); - UnityAction2& operator=(decltype(nullptr) other); + UnityAction2& operator=(decltype(nullptr)); UnityAction2& operator=(UnityAction2&& other); bool operator==(const UnityAction2& other) const; bool operator!=(const UnityAction2& other) const; @@ -4280,13 +5060,13 @@ namespace System { struct ComponentEventHandler : virtual System::Object { - ComponentEventHandler(decltype(nullptr) n); + ComponentEventHandler(decltype(nullptr)); ComponentEventHandler(Plugin::InternalUse iu, int32_t handle); ComponentEventHandler(const ComponentEventHandler& other); ComponentEventHandler(ComponentEventHandler&& other); virtual ~ComponentEventHandler(); ComponentEventHandler& operator=(const ComponentEventHandler& other); - ComponentEventHandler& operator=(decltype(nullptr) other); + ComponentEventHandler& operator=(decltype(nullptr)); ComponentEventHandler& operator=(ComponentEventHandler&& other); bool operator==(const ComponentEventHandler& other) const; bool operator!=(const ComponentEventHandler& other) const; @@ -4310,13 +5090,13 @@ namespace System { struct ComponentChangingEventHandler : virtual System::Object { - ComponentChangingEventHandler(decltype(nullptr) n); + ComponentChangingEventHandler(decltype(nullptr)); ComponentChangingEventHandler(Plugin::InternalUse iu, int32_t handle); ComponentChangingEventHandler(const ComponentChangingEventHandler& other); ComponentChangingEventHandler(ComponentChangingEventHandler&& other); virtual ~ComponentChangingEventHandler(); ComponentChangingEventHandler& operator=(const ComponentChangingEventHandler& other); - ComponentChangingEventHandler& operator=(decltype(nullptr) other); + ComponentChangingEventHandler& operator=(decltype(nullptr)); ComponentChangingEventHandler& operator=(ComponentChangingEventHandler&& other); bool operator==(const ComponentChangingEventHandler& other) const; bool operator!=(const ComponentChangingEventHandler& other) const; @@ -4340,13 +5120,13 @@ namespace System { struct ComponentChangedEventHandler : virtual System::Object { - ComponentChangedEventHandler(decltype(nullptr) n); + ComponentChangedEventHandler(decltype(nullptr)); ComponentChangedEventHandler(Plugin::InternalUse iu, int32_t handle); ComponentChangedEventHandler(const ComponentChangedEventHandler& other); ComponentChangedEventHandler(ComponentChangedEventHandler&& other); virtual ~ComponentChangedEventHandler(); ComponentChangedEventHandler& operator=(const ComponentChangedEventHandler& other); - ComponentChangedEventHandler& operator=(decltype(nullptr) other); + ComponentChangedEventHandler& operator=(decltype(nullptr)); ComponentChangedEventHandler& operator=(ComponentChangedEventHandler&& other); bool operator==(const ComponentChangedEventHandler& other) const; bool operator!=(const ComponentChangedEventHandler& other) const; @@ -4370,13 +5150,13 @@ namespace System { struct ComponentRenameEventHandler : virtual System::Object { - ComponentRenameEventHandler(decltype(nullptr) n); + ComponentRenameEventHandler(decltype(nullptr)); ComponentRenameEventHandler(Plugin::InternalUse iu, int32_t handle); ComponentRenameEventHandler(const ComponentRenameEventHandler& other); ComponentRenameEventHandler(ComponentRenameEventHandler&& other); virtual ~ComponentRenameEventHandler(); ComponentRenameEventHandler& operator=(const ComponentRenameEventHandler& other); - ComponentRenameEventHandler& operator=(decltype(nullptr) other); + ComponentRenameEventHandler& operator=(decltype(nullptr)); ComponentRenameEventHandler& operator=(ComponentRenameEventHandler&& other); bool operator==(const ComponentRenameEventHandler& other) const; bool operator!=(const ComponentRenameEventHandler& other) const; @@ -4392,3 +5172,30 @@ namespace System } } /*END TYPE DEFINITIONS*/ + +//////////////////////////////////////////////////////////////// +// Support for using IEnumerable with range for loops +//////////////////////////////////////////////////////////////// + +namespace Plugin +{ + struct EnumerableIterator + { + System::Collections::IEnumerator enumerator; + bool hasMore; + EnumerableIterator(decltype(nullptr)); + EnumerableIterator(System::Collections::IEnumerable& enumerable); + EnumerableIterator& operator++(); + bool operator!=(const EnumerableIterator& other); + System::Object operator*(); + }; +} + +namespace System +{ + namespace Collections + { + Plugin::EnumerableIterator begin(IEnumerable& enumerable); + Plugin::EnumerableIterator end(IEnumerable& enumerable); + } +} From a04c1904b5eeffe46f993678e6b9ba88f697729d Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 3 Feb 2018 09:56:29 -0800 Subject: [PATCH 55/95] Make value types fit into the type hierarchy better - Managed structs no longer derive from ValueType - Enums are now structs with const static fields for their enumerators - Primitives are now structs in System and in all APIs - Boxing is now available for all target reference types via explicit conversion operators Use primitive types (e.g. int32_t) in all bindings functions instead of structs (e.g. System::Int32) Upgrade to Unity 2017.3 Update README --- README.md | 2 +- Unity/Assets/NativeScript/Bindings.cs | 1639 +- .../NativeScript/Editor/GenerateBindings.cs | 1006 +- Unity/Assets/NativeScriptTypes.json | 496 +- Unity/CppSource/Game/Game.cpp | 2 +- Unity/CppSource/NativeScript/Bindings.cpp | 21725 +++++++++------- Unity/CppSource/NativeScript/Bindings.h | 4797 ++-- Unity/ProjectSettings/ProjectVersion.txt | 2 +- Unity/ProjectSettings/UnityAdsSettings.asset | Bin 4116 -> 0 bytes 9 files changed, 16556 insertions(+), 13113 deletions(-) delete mode 100644 Unity/ProjectSettings/UnityAdsSettings.asset diff --git a/README.md b/README.md index ff70cd5..3ed4061 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ C++ is the standard language for video games as well as many other fields. By pr * Arrays (single- and multi-dimensional) * Delegates * Events - * Boxing and unboxing (e.g. boxing `int` to `object`, casting `object` to `int`) + * Boxing and unboxing (e.g. casting `int` to `object` and visa versa) * Implementing C# interfaces with C++ classes * Deriving from C# classes with C++ classes * Default parameters diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 825944f..86a7bf3 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -315,6 +315,7 @@ delegate void InitDelegate( IntPtr enumerableGetEnumerator, /*BEGIN INIT PARAMS*/ int maxManagedObjects, + IntPtr systemIComparableMethodCompareToSystemObject, IntPtr systemIDisposableMethodDispose, IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3PropertyGetMagnitude, @@ -336,6 +337,7 @@ delegate void InitDelegate( IntPtr boxGradientColorKey, IntPtr unboxGradientColorKey, IntPtr releaseUnityEngineResolution, + IntPtr unityEngineResolutionConstructor, IntPtr unityEngineResolutionPropertyGetWidth, IntPtr unityEngineResolutionPropertySetWidth, IntPtr unityEngineResolutionPropertyGetHeight, @@ -352,18 +354,6 @@ delegate void InitDelegate( IntPtr unboxRaycastHit, IntPtr systemCollectionsIEnumeratorPropertyGetCurrent, IntPtr systemCollectionsIEnumeratorMethodMoveNext, - IntPtr systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator, IntPtr releaseUnityEnginePlayablesPlayableGraph, IntPtr boxPlayableGraph, IntPtr unboxPlayableGraph, @@ -404,16 +394,6 @@ delegate void InitDelegate( IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue, IntPtr boxKeyValuePairSystemString_SystemDouble, IntPtr unboxKeyValuePairSystemString_SystemDouble, - IntPtr systemCollectionsGenericListSystemStringConstructor, - IntPtr systemCollectionsGenericListSystemStringPropertyGetItem, - IntPtr systemCollectionsGenericListSystemStringPropertySetItem, - IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString, - IntPtr systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer, - IntPtr systemCollectionsGenericListSystemInt32Constructor, - IntPtr systemCollectionsGenericListSystemInt32PropertyGetItem, - IntPtr systemCollectionsGenericListSystemInt32PropertySetItem, - IntPtr systemCollectionsGenericListSystemInt32MethodAddSystemInt32, - IntPtr systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer, IntPtr systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString, IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue, IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue, @@ -466,6 +446,8 @@ delegate void InitDelegate( IntPtr releaseUnityEnginePlayablesPlayableHandle, IntPtr boxPlayableHandle, IntPtr unboxPlayableHandle, + IntPtr systemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator, IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1, IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString, IntPtr boxInteractionSourcePositionAccuracy, @@ -476,6 +458,28 @@ delegate void InitDelegate( IntPtr unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode, IntPtr boxInteractionSourcePose, IntPtr unboxInteractionSourcePose, + IntPtr systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator, + IntPtr systemCollectionsGenericListSystemStringConstructor, + IntPtr systemCollectionsGenericListSystemStringPropertyGetItem, + IntPtr systemCollectionsGenericListSystemStringPropertySetItem, + IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString, + IntPtr systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer, + IntPtr systemCollectionsGenericListSystemInt32Constructor, + IntPtr systemCollectionsGenericListSystemInt32PropertyGetItem, + IntPtr systemCollectionsGenericListSystemInt32PropertySetItem, + IntPtr systemCollectionsGenericListSystemInt32MethodAddSystemInt32, + IntPtr systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -819,6 +823,7 @@ static extern void Init( IntPtr enumerableGetEnumerator, /*BEGIN INIT PARAMS*/ int maxManagedObjects, + IntPtr systemIComparableMethodCompareToSystemObject, IntPtr systemIDisposableMethodDispose, IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3PropertyGetMagnitude, @@ -840,6 +845,7 @@ static extern void Init( IntPtr boxGradientColorKey, IntPtr unboxGradientColorKey, IntPtr releaseUnityEngineResolution, + IntPtr unityEngineResolutionConstructor, IntPtr unityEngineResolutionPropertyGetWidth, IntPtr unityEngineResolutionPropertySetWidth, IntPtr unityEngineResolutionPropertyGetHeight, @@ -856,18 +862,6 @@ static extern void Init( IntPtr unboxRaycastHit, IntPtr systemCollectionsIEnumeratorPropertyGetCurrent, IntPtr systemCollectionsIEnumeratorMethodMoveNext, - IntPtr systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator, IntPtr releaseUnityEnginePlayablesPlayableGraph, IntPtr boxPlayableGraph, IntPtr unboxPlayableGraph, @@ -908,16 +902,6 @@ static extern void Init( IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue, IntPtr boxKeyValuePairSystemString_SystemDouble, IntPtr unboxKeyValuePairSystemString_SystemDouble, - IntPtr systemCollectionsGenericListSystemStringConstructor, - IntPtr systemCollectionsGenericListSystemStringPropertyGetItem, - IntPtr systemCollectionsGenericListSystemStringPropertySetItem, - IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString, - IntPtr systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer, - IntPtr systemCollectionsGenericListSystemInt32Constructor, - IntPtr systemCollectionsGenericListSystemInt32PropertyGetItem, - IntPtr systemCollectionsGenericListSystemInt32PropertySetItem, - IntPtr systemCollectionsGenericListSystemInt32MethodAddSystemInt32, - IntPtr systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer, IntPtr systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString, IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue, IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue, @@ -970,6 +954,8 @@ static extern void Init( IntPtr releaseUnityEnginePlayablesPlayableHandle, IntPtr boxPlayableHandle, IntPtr unboxPlayableHandle, + IntPtr systemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator, IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1, IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString, IntPtr boxInteractionSourcePositionAccuracy, @@ -980,6 +966,28 @@ static extern void Init( IntPtr unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode, IntPtr boxInteractionSourcePose, IntPtr unboxInteractionSourcePose, + IntPtr systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent, + IntPtr systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator, + IntPtr systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator, + IntPtr systemCollectionsGenericListSystemStringConstructor, + IntPtr systemCollectionsGenericListSystemStringPropertyGetItem, + IntPtr systemCollectionsGenericListSystemStringPropertySetItem, + IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString, + IntPtr systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer, + IntPtr systemCollectionsGenericListSystemInt32Constructor, + IntPtr systemCollectionsGenericListSystemInt32PropertyGetItem, + IntPtr systemCollectionsGenericListSystemInt32PropertySetItem, + IntPtr systemCollectionsGenericListSystemInt32MethodAddSystemInt32, + IntPtr systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -1231,6 +1239,7 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate int EnumerableGetEnumeratorDelegate(int handle); /*BEGIN DELEGATE TYPES*/ + delegate int SystemIComparableMethodCompareToSystemObjectDelegate(int thisHandle, int objHandle); delegate void SystemIDisposableMethodDisposeDelegate(int thisHandle); delegate UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate(float x, float y, float z); delegate float UnityEngineVector3PropertyGetMagnitudeDelegate(ref UnityEngine.Vector3 thiz); @@ -1252,6 +1261,7 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate int BoxGradientColorKeyDelegate(ref UnityEngine.GradientColorKey val); delegate UnityEngine.GradientColorKey UnboxGradientColorKeyDelegate(int valHandle); delegate void ReleaseUnityEngineResolutionDelegate(int handle); + delegate int UnityEngineResolutionConstructorDelegate(); delegate int UnityEngineResolutionPropertyGetWidthDelegate(int thisHandle); delegate void UnityEngineResolutionPropertySetWidthDelegate(int thisHandle, int value); delegate int UnityEngineResolutionPropertyGetHeightDelegate(int thisHandle); @@ -1268,18 +1278,6 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate int UnboxRaycastHitDelegate(int valHandle); delegate int SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(int thisHandle); delegate bool SystemCollectionsIEnumeratorMethodMoveNextDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrentDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrentDelegate(int thisHandle); - delegate float SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrentDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrentDelegate(int thisHandle); - delegate UnityEngine.GradientColorKey SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrentDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrentDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumeratorDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumeratorDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumeratorDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumeratorDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumeratorDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumeratorDelegate(int thisHandle); delegate void ReleaseUnityEnginePlayablesPlayableGraphDelegate(int handle); delegate int BoxPlayableGraphDelegate(int valHandle); delegate int UnboxPlayableGraphDelegate(int valHandle); @@ -1320,16 +1318,6 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate(int thisHandle); delegate int BoxKeyValuePairSystemString_SystemDoubleDelegate(int valHandle); delegate int UnboxKeyValuePairSystemString_SystemDoubleDelegate(int valHandle); - 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 void SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate(int thisHandle, int comparerHandle); - delegate int SystemCollectionsGenericListSystemInt32ConstructorDelegate(); - delegate int SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate(int thisHandle, int index); - delegate void SystemCollectionsGenericListSystemInt32PropertySetItemDelegate(int thisHandle, int index, int value); - delegate void SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate(int thisHandle, int item); - delegate void SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate(int thisHandle, int comparerHandle); delegate int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate(int valueHandle); delegate int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate(int thisHandle); delegate void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate(int thisHandle, int valueHandle); @@ -1382,6 +1370,8 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate void ReleaseUnityEnginePlayablesPlayableHandleDelegate(int handle); delegate int BoxPlayableHandleDelegate(int valHandle); delegate int UnboxPlayableHandleDelegate(int valHandle); + delegate int SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrentDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumeratorDelegate(int thisHandle); delegate int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1Delegate(int eHandle, int nameHandle, int classesHandle); delegate int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringDelegate(int eHandle, int nameHandle, int classNameHandle); delegate int BoxInteractionSourcePositionAccuracyDelegate(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy val); @@ -1392,6 +1382,28 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate bool UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNodeDelegate(int thisHandle, out UnityEngine.Quaternion rotation, UnityEngine.XR.WSA.Input.InteractionSourceNode node); delegate int BoxInteractionSourcePoseDelegate(int valHandle); delegate int UnboxInteractionSourcePoseDelegate(int valHandle); + delegate int SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrentDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrentDelegate(int thisHandle); + delegate float SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrentDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrentDelegate(int thisHandle); + delegate UnityEngine.GradientColorKey SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrentDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrentDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumeratorDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumeratorDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumeratorDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumeratorDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumeratorDelegate(int thisHandle); + delegate int SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumeratorDelegate(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 void SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate(int thisHandle, int comparerHandle); + delegate int SystemCollectionsGenericListSystemInt32ConstructorDelegate(); + delegate int SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate(int thisHandle, int index); + delegate void SystemCollectionsGenericListSystemInt32PropertySetItemDelegate(int thisHandle, int index, int value); + delegate void SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate(int thisHandle, int item); + delegate void SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate(int thisHandle, int comparerHandle); delegate int BoxBooleanDelegate(bool val); delegate bool UnboxBooleanDelegate(int valHandle); delegate int BoxSByteDelegate(sbyte val); @@ -1575,7 +1587,6 @@ ReusableWaitForSecondsRealtime poll long cur = File.GetLastWriteTime(pluginPath).Ticks; if (cur != lastWriteTime) { - Debug.Log("reloading at " + DateTime.Now); lastWriteTime = cur; Reload(); } @@ -1656,6 +1667,7 @@ private static void OpenPlugin(InitMode initMode) Marshal.GetFunctionPointerForDelegate(new EnumerableGetEnumeratorDelegate(EnumerableGetEnumerator)), /*BEGIN INIT CALL*/ 1000, + Marshal.GetFunctionPointerForDelegate(new SystemIComparableMethodCompareToSystemObjectDelegate(SystemIComparableMethodCompareToSystemObject)), Marshal.GetFunctionPointerForDelegate(new SystemIDisposableMethodDisposeDelegate(SystemIDisposableMethodDispose)), Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)), Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3PropertyGetMagnitudeDelegate(UnityEngineVector3PropertyGetMagnitude)), @@ -1677,6 +1689,7 @@ private static void OpenPlugin(InitMode initMode) Marshal.GetFunctionPointerForDelegate(new BoxGradientColorKeyDelegate(BoxGradientColorKey)), Marshal.GetFunctionPointerForDelegate(new UnboxGradientColorKeyDelegate(UnboxGradientColorKey)), Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineResolutionDelegate(ReleaseUnityEngineResolution)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionConstructorDelegate(UnityEngineResolutionConstructor)), Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertyGetWidthDelegate(UnityEngineResolutionPropertyGetWidth)), Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertySetWidthDelegate(UnityEngineResolutionPropertySetWidth)), Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionPropertyGetHeightDelegate(UnityEngineResolutionPropertyGetHeight)), @@ -1693,18 +1706,6 @@ private static void OpenPlugin(InitMode initMode) Marshal.GetFunctionPointerForDelegate(new UnboxRaycastHitDelegate(UnboxRaycastHit)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(SystemCollectionsIEnumeratorPropertyGetCurrent)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIEnumeratorMethodMoveNextDelegate(SystemCollectionsIEnumeratorMethodMoveNext)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator)), Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEnginePlayablesPlayableGraphDelegate(ReleaseUnityEnginePlayablesPlayableGraph)), Marshal.GetFunctionPointerForDelegate(new BoxPlayableGraphDelegate(BoxPlayableGraph)), Marshal.GetFunctionPointerForDelegate(new UnboxPlayableGraphDelegate(UnboxPlayableGraph)), @@ -1745,16 +1746,6 @@ private static void OpenPlugin(InitMode initMode) Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)), Marshal.GetFunctionPointerForDelegate(new BoxKeyValuePairSystemString_SystemDoubleDelegate(BoxKeyValuePairSystemString_SystemDouble)), Marshal.GetFunctionPointerForDelegate(new UnboxKeyValuePairSystemString_SystemDoubleDelegate(UnboxKeyValuePairSystemString_SystemDouble)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringConstructorDelegate(SystemCollectionsGenericListSystemStringConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringPropertyGetItemDelegate(SystemCollectionsGenericListSystemStringPropertyGetItem)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringPropertySetItemDelegate(SystemCollectionsGenericListSystemStringPropertySetItem)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate(SystemCollectionsGenericListSystemStringMethodAddSystemString)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate(SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32ConstructorDelegate(SystemCollectionsGenericListSystemInt32Constructor)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate(SystemCollectionsGenericListSystemInt32PropertyGetItem)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32PropertySetItemDelegate(SystemCollectionsGenericListSystemInt32PropertySetItem)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate(SystemCollectionsGenericListSystemInt32MethodAddSystemInt32)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate(SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate(SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate(SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue)), @@ -1807,6 +1798,8 @@ private static void OpenPlugin(InitMode initMode) Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEnginePlayablesPlayableHandleDelegate(ReleaseUnityEnginePlayablesPlayableHandle)), Marshal.GetFunctionPointerForDelegate(new BoxPlayableHandleDelegate(BoxPlayableHandle)), Marshal.GetFunctionPointerForDelegate(new UnboxPlayableHandleDelegate(UnboxPlayableHandle)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator)), Marshal.GetFunctionPointerForDelegate(new UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1Delegate(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1)), Marshal.GetFunctionPointerForDelegate(new UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringDelegate(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString)), Marshal.GetFunctionPointerForDelegate(new BoxInteractionSourcePositionAccuracyDelegate(BoxInteractionSourcePositionAccuracy)), @@ -1817,6 +1810,28 @@ private static void OpenPlugin(InitMode initMode) Marshal.GetFunctionPointerForDelegate(new UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNodeDelegate(UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode)), Marshal.GetFunctionPointerForDelegate(new BoxInteractionSourcePoseDelegate(BoxInteractionSourcePose)), Marshal.GetFunctionPointerForDelegate(new UnboxInteractionSourcePoseDelegate(UnboxInteractionSourcePose)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringConstructorDelegate(SystemCollectionsGenericListSystemStringConstructor)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringPropertyGetItemDelegate(SystemCollectionsGenericListSystemStringPropertyGetItem)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringPropertySetItemDelegate(SystemCollectionsGenericListSystemStringPropertySetItem)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate(SystemCollectionsGenericListSystemStringMethodAddSystemString)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate(SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32ConstructorDelegate(SystemCollectionsGenericListSystemInt32Constructor)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate(SystemCollectionsGenericListSystemInt32PropertyGetItem)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32PropertySetItemDelegate(SystemCollectionsGenericListSystemInt32PropertySetItem)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate(SystemCollectionsGenericListSystemInt32MethodAddSystemInt32)), + Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate(SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer)), Marshal.GetFunctionPointerForDelegate(new BoxBooleanDelegate(BoxBoolean)), Marshal.GetFunctionPointerForDelegate(new UnboxBooleanDelegate(UnboxBoolean)), Marshal.GetFunctionPointerForDelegate(new BoxSByteDelegate(BoxSByte)), @@ -2821,6 +2836,30 @@ public void NativeInvoke(object sender, System.ComponentModel.Design.ComponentRe /*END BASE TYPES*/ /*BEGIN FUNCTIONS*/ + [MonoPInvokeCallback(typeof(SystemIComparableMethodCompareToSystemObjectDelegate))] + static int SystemIComparableMethodCompareToSystemObject(int thisHandle, int objHandle) + { + try + { + var thiz = (System.IComparable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var obj = NativeScript.Bindings.ObjectStore.Get(objHandle); + var returnValue = thiz.CompareTo(obj); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + [MonoPInvokeCallback(typeof(SystemIDisposableMethodDisposeDelegate))] static void SystemIDisposableMethodDispose(int thisHandle) { @@ -3283,6 +3322,28 @@ static void ReleaseUnityEngineResolution(int handle) } } + [MonoPInvokeCallback(typeof(UnityEngineResolutionConstructorDelegate))] + static int UnityEngineResolutionConstructor() + { + try + { + var returnValue = NativeScript.Bindings.StructStore.Store(new UnityEngine.Resolution()); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetWidthDelegate))] static int UnityEngineResolutionPropertyGetWidth(int thisHandle) { @@ -3642,36 +3703,35 @@ static bool SystemCollectionsIEnumeratorMethodMoveNext(int thisHandle) } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrentDelegate))] - static int SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent(int thisHandle) + [MonoPInvokeCallback(typeof(ReleaseUnityEnginePlayablesPlayableGraphDelegate))] + static void ReleaseUnityEnginePlayablesPlayableGraph(int handle) { try { - var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrentDelegate))] - static int SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent(int thisHandle) + [MonoPInvokeCallback(typeof(BoxPlayableGraphDelegate))] + static int BoxPlayableGraph(int valHandle) { try { - var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; + var val = (UnityEngine.Playables.PlayableGraph)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } catch (System.NullReferenceException ex) @@ -3688,39 +3748,61 @@ static int SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent(int } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrentDelegate))] - static float SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent(int thisHandle) + [MonoPInvokeCallback(typeof(UnboxPlayableGraphDelegate))] + static int UnboxPlayableGraph(int valHandle) { try { - var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Playables.PlayableGraph)val); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrentDelegate))] - static int SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent(int thisHandle) + [MonoPInvokeCallback(typeof(ReleaseUnityEngineAnimationsAnimationMixerPlayableDelegate))] + static void ReleaseUnityEngineAnimationsAnimationMixerPlayable(int handle) { try { - var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; - return NativeScript.Bindings.StructStore.Store(returnValue); - } - catch (System.NullReferenceException ex) + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBooleanDelegate))] + static int UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean(int graphHandle, int inputCount, bool normalizeWeights) + { + try + { + var graph = (UnityEngine.Playables.PlayableGraph)NativeScript.Bindings.StructStore.Get(graphHandle); + var returnValue = UnityEngine.Animations.AnimationMixerPlayable.Create(graph, inputCount, normalizeWeights); + return NativeScript.Bindings.StructStore.Store(returnValue); + } + catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); @@ -3734,37 +3816,37 @@ static int SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCu } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrentDelegate))] - static UnityEngine.GradientColorKey SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent(int thisHandle) + [MonoPInvokeCallback(typeof(BoxAnimationMixerPlayableDelegate))] + static int BoxAnimationMixerPlayable(int valHandle) { try { - var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; + var val = (UnityEngine.Animations.AnimationMixerPlayable)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrentDelegate))] - static int SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent(int thisHandle) + [MonoPInvokeCallback(typeof(UnboxAnimationMixerPlayableDelegate))] + static int UnboxAnimationMixerPlayable(int valHandle) { try { - var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; - return NativeScript.Bindings.StructStore.Store(returnValue); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Animations.AnimationMixerPlayable)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -3780,14 +3862,13 @@ static int SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCu } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumeratorDelegate))] - static int SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator(int thisHandle) + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchConstructorDelegate))] + static int SystemDiagnosticsStopwatchConstructor() { try { - var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetEnumerator(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Diagnostics.Stopwatch()); + return returnValue; } catch (System.NullReferenceException ex) { @@ -3803,60 +3884,76 @@ static int SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator(in } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumeratorDelegate))] - static int SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator(int thisHandle) + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate))] + static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHandle) { try { - var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetEnumerator(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.ElapsedMilliseconds; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(long); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(long); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumeratorDelegate))] - static int SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator(int thisHandle) + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodStartDelegate))] + static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) { try { - var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetEnumerator(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Start(); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumeratorDelegate))] - static int SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator(int thisHandle) + [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodResetDelegate))] + static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) { try { - var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetEnumerator(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Reset(); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorDelegate))] + static int UnityEngineGameObjectConstructor() + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject()); + return returnValue; } catch (System.NullReferenceException ex) { @@ -3872,14 +3969,14 @@ static int SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnum } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumeratorDelegate))] - static int SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorSystemStringDelegate))] + static int UnityEngineGameObjectConstructorSystemString(int nameHandle) { try { - var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetEnumerator(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject(name)); + return returnValue; } catch (System.NullReferenceException ex) { @@ -3895,13 +3992,13 @@ static int SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodG } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumeratorDelegate))] - static int SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectPropertyGetTransformDelegate))] + static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) { try { - var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetEnumerator(); + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.transform; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) @@ -3918,36 +4015,37 @@ static int SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnum } } - [MonoPInvokeCallback(typeof(ReleaseUnityEnginePlayablesPlayableGraphDelegate))] - static void ReleaseUnityEnginePlayablesPlayableGraph(int handle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate))] + static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(int thisHandle) { try { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.AddComponent(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxPlayableGraphDelegate))] - static int BoxPlayableGraph(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScriptDelegate))] + static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript(int thisHandle) { try { - var val = (UnityEngine.Playables.PlayableGraph)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.AddComponent(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -3963,14 +4061,13 @@ static int BoxPlayableGraph(int valHandle) } } - [MonoPInvokeCallback(typeof(UnboxPlayableGraphDelegate))] - static int UnboxPlayableGraph(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate))] + static int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(UnityEngine.PrimitiveType type) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Playables.PlayableGraph)val); - return returnValue; + var returnValue = UnityEngine.GameObject.CreatePrimitive(type); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -3986,15 +4083,13 @@ static int UnboxPlayableGraph(int valHandle) } } - [MonoPInvokeCallback(typeof(ReleaseUnityEngineAnimationsAnimationMixerPlayableDelegate))] - static void ReleaseUnityEngineAnimationsAnimationMixerPlayable(int handle) + [MonoPInvokeCallback(typeof(UnityEngineDebugMethodLogSystemObjectDelegate))] + static void UnityEngineDebugMethodLogSystemObject(int messageHandle) { try { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } + var message = NativeScript.Bindings.ObjectStore.Get(messageHandle); + UnityEngine.Debug.Log(message); } catch (System.NullReferenceException ex) { @@ -4008,189 +4103,188 @@ static void ReleaseUnityEngineAnimationsAnimationMixerPlayable(int handle) } } - [MonoPInvokeCallback(typeof(UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBooleanDelegate))] - static int UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean(int graphHandle, int inputCount, bool normalizeWeights) + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldGetRaiseExceptionsDelegate))] + static bool UnityEngineAssertionsAssertFieldGetRaiseExceptions() { try { - var graph = (UnityEngine.Playables.PlayableGraph)NativeScript.Bindings.StructStore.Get(graphHandle); - var returnValue = UnityEngine.Animations.AnimationMixerPlayable.Create(graph, inputCount, normalizeWeights); - return NativeScript.Bindings.StructStore.Store(returnValue); + var returnValue = UnityEngine.Assertions.Assert.raiseExceptions; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(bool); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(bool); } } - [MonoPInvokeCallback(typeof(BoxAnimationMixerPlayableDelegate))] - static int BoxAnimationMixerPlayable(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldSetRaiseExceptionsDelegate))] + static void UnityEngineAssertionsAssertFieldSetRaiseExceptions(bool value) { try { - var val = (UnityEngine.Animations.AnimationMixerPlayable)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + UnityEngine.Assertions.Assert.raiseExceptions = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxAnimationMixerPlayableDelegate))] - static int UnboxAnimationMixerPlayable(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemStringDelegate))] + static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(int expectedHandle, int actualHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Animations.AnimationMixerPlayable)val); - return returnValue; + var expected = (string)NativeScript.Bindings.ObjectStore.Get(expectedHandle); + var actual = (string)NativeScript.Bindings.ObjectStore.Get(actualHandle); + UnityEngine.Assertions.Assert.AreEqual(expected, actual); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchConstructorDelegate))] - static int SystemDiagnosticsStopwatchConstructor() + [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObjectDelegate))] + static void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(int expectedHandle, int actualHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Diagnostics.Stopwatch()); - return returnValue; + var expected = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(expectedHandle); + var actual = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(actualHandle); + UnityEngine.Assertions.Assert.AreEqual(expected, actual); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate))] - static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineMonoBehaviourPropertyGetTransformDelegate))] + static int UnityEngineMonoBehaviourPropertyGetTransform(int thisHandle) { try { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.ElapsedMilliseconds; - return returnValue; + var thiz = (UnityEngine.MonoBehaviour)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(long); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(long); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodStartDelegate))] - static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate))] + static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(ref int bufferLength, ref int numBuffers) { try { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Start(); + UnityEngine.AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + bufferLength = default(int); + numBuffers = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + bufferLength = default(int); + numBuffers = default(int); } } - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodResetDelegate))] - static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate))] + static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(int hostId, ref int addressHandle, ref int port, ref byte error) { try { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Reset(); + var address = (string)NativeScript.Bindings.ObjectStore.Get(addressHandle); + UnityEngine.Networking.NetworkTransport.GetBroadcastConnectionInfo(hostId, out address, out port, out error); + int addressHandleNew = NativeScript.Bindings.ObjectStore.GetHandle(address); + addressHandle = addressHandleNew; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + addressHandle = default(int); + port = default(int); + error = default(byte); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + addressHandle = default(int); + port = default(int); + error = default(byte); } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorDelegate))] - static int UnityEngineGameObjectConstructor() + [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodInitDelegate))] + static void UnityEngineNetworkingNetworkTransportMethodInit() { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject()); - return returnValue; + UnityEngine.Networking.NetworkTransport.Init(); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorSystemStringDelegate))] - static int UnityEngineGameObjectConstructorSystemString(int nameHandle) + [MonoPInvokeCallback(typeof(BoxQuaternionDelegate))] + static int BoxQuaternion(ref UnityEngine.Quaternion val) { try { - var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject(name)); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } catch (System.NullReferenceException ex) @@ -4207,82 +4301,77 @@ static int UnityEngineGameObjectConstructorSystemString(int nameHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectPropertyGetTransformDelegate))] - static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) + [MonoPInvokeCallback(typeof(UnboxQuaternionDelegate))] + static UnityEngine.Quaternion UnboxQuaternion(int valHandle) { try { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Quaternion)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Quaternion); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.Quaternion); } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate))] - static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertyGetItemDelegate))] + static float UnityEngineMatrix4x4PropertyGetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column) { try { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.AddComponent(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = thiz[row, row]; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScriptDelegate))] - static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript(int thisHandle) + [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertySetItemDelegate))] + static void UnityEngineMatrix4x4PropertySetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column, float value) { try { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.AddComponent(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + thiz[row, column] = column; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate))] - static int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(UnityEngine.PrimitiveType type) + [MonoPInvokeCallback(typeof(BoxMatrix4x4Delegate))] + static int BoxMatrix4x4(ref UnityEngine.Matrix4x4 val) { try { - var returnValue = UnityEngine.GameObject.CreatePrimitive(type); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -4298,75 +4387,83 @@ static int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(Un } } - [MonoPInvokeCallback(typeof(UnityEngineDebugMethodLogSystemObjectDelegate))] - static void UnityEngineDebugMethodLogSystemObject(int messageHandle) + [MonoPInvokeCallback(typeof(UnboxMatrix4x4Delegate))] + static UnityEngine.Matrix4x4 UnboxMatrix4x4(int valHandle) { try { - var message = NativeScript.Bindings.ObjectStore.Get(messageHandle); - UnityEngine.Debug.Log(message); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Matrix4x4)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Matrix4x4); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Matrix4x4); } } - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldGetRaiseExceptionsDelegate))] - static bool UnityEngineAssertionsAssertFieldGetRaiseExceptions() + [MonoPInvokeCallback(typeof(BoxQueryTriggerInteractionDelegate))] + static int BoxQueryTriggerInteraction(UnityEngine.QueryTriggerInteraction val) { try { - var returnValue = UnityEngine.Assertions.Assert.raiseExceptions; + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldSetRaiseExceptionsDelegate))] - static void UnityEngineAssertionsAssertFieldSetRaiseExceptions(bool value) + [MonoPInvokeCallback(typeof(UnboxQueryTriggerInteractionDelegate))] + static UnityEngine.QueryTriggerInteraction UnboxQueryTriggerInteraction(int valHandle) { try { - UnityEngine.Assertions.Assert.raiseExceptions = value; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.QueryTriggerInteraction)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.QueryTriggerInteraction); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.QueryTriggerInteraction); } } - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemStringDelegate))] - static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(int expectedHandle, int actualHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate))] + static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int handle) { try { - var expected = (string)NativeScript.Bindings.ObjectStore.Get(expectedHandle); - var actual = (string)NativeScript.Bindings.ObjectStore.Get(actualHandle); - UnityEngine.Assertions.Assert.AreEqual(expected, actual); + if (handle != 0) + { + NativeScript.Bindings.StructStore>.Remove(handle); + } } catch (System.NullReferenceException ex) { @@ -4380,34 +4477,36 @@ static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_Sy } } - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObjectDelegate))] - static void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(int expectedHandle, int actualHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate))] + static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(int keyHandle, double value) { try { - var expected = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(expectedHandle); - var actual = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(actualHandle); - UnityEngine.Assertions.Assert.AreEqual(expected, actual); + var key = (string)NativeScript.Bindings.ObjectStore.Get(keyHandle); + var returnValue = NativeScript.Bindings.StructStore>.Store(new System.Collections.Generic.KeyValuePair(key, value)); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineMonoBehaviourPropertyGetTransformDelegate))] - static int UnityEngineMonoBehaviourPropertyGetTransform(int thisHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate))] + static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(int thisHandle) { try { - var thiz = (UnityEngine.MonoBehaviour)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.transform; + var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); + var returnValue = thiz.Key; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) @@ -4424,82 +4523,82 @@ static int UnityEngineMonoBehaviourPropertyGetTransform(int thisHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate))] - static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(ref int bufferLength, ref int numBuffers) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate))] + static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(int thisHandle) { try { - UnityEngine.AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers); + var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); + var returnValue = thiz.Value; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - bufferLength = default(int); - numBuffers = default(int); + return default(double); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - bufferLength = default(int); - numBuffers = default(int); + return default(double); } } - [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate))] - static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(int hostId, ref int addressHandle, ref int port, ref byte error) + [MonoPInvokeCallback(typeof(BoxKeyValuePairSystemString_SystemDoubleDelegate))] + static int BoxKeyValuePairSystemString_SystemDouble(int valHandle) { try { - var address = (string)NativeScript.Bindings.ObjectStore.Get(addressHandle); - UnityEngine.Networking.NetworkTransport.GetBroadcastConnectionInfo(hostId, out address, out port, out error); - int addressHandleNew = NativeScript.Bindings.ObjectStore.GetHandle(address); - addressHandle = addressHandleNew; + var val = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - addressHandle = default(int); - port = default(int); - error = default(byte); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - addressHandle = default(int); - port = default(int); - error = default(byte); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodInitDelegate))] - static void UnityEngineNetworkingNetworkTransportMethodInit() + [MonoPInvokeCallback(typeof(UnboxKeyValuePairSystemString_SystemDoubleDelegate))] + static int UnboxKeyValuePairSystemString_SystemDouble(int valHandle) { try { - UnityEngine.Networking.NetworkTransport.Init(); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore>.Store((System.Collections.Generic.KeyValuePair)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxQuaternionDelegate))] - static int BoxQuaternion(ref UnityEngine.Quaternion val) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate))] + static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(int valueHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.LinkedListNode(value)); return returnValue; } catch (System.NullReferenceException ex) @@ -4516,77 +4615,81 @@ static int BoxQuaternion(ref UnityEngine.Quaternion val) } } - [MonoPInvokeCallback(typeof(UnboxQuaternionDelegate))] - static UnityEngine.Quaternion UnboxQuaternion(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate))] + static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(int thisHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Quaternion)val; - return returnValue; + var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Value; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Quaternion); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Quaternion); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertyGetItemDelegate))] - static float UnityEngineMatrix4x4PropertyGetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate))] + static void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(int thisHandle, int valueHandle) { try { - var returnValue = thiz[row, row]; - return returnValue; + var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.Value = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); } } - [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertySetItemDelegate))] - static void UnityEngineMatrix4x4PropertySetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column, float value) + [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate))] + static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(int valueHandle) { try { - thiz[row, column] = column; + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Runtime.CompilerServices.StrongBox(value)); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxMatrix4x4Delegate))] - static int BoxMatrix4x4(ref UnityEngine.Matrix4x4 val) + [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate))] + static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int thisHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Value; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -4602,35 +4705,34 @@ static int BoxMatrix4x4(ref UnityEngine.Matrix4x4 val) } } - [MonoPInvokeCallback(typeof(UnboxMatrix4x4Delegate))] - static UnityEngine.Matrix4x4 UnboxMatrix4x4(int valHandle) + [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate))] + static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int thisHandle, int valueHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Matrix4x4)val; - return returnValue; + var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.Value = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Matrix4x4); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Matrix4x4); } } - [MonoPInvokeCallback(typeof(BoxQueryTriggerInteractionDelegate))] - static int BoxQueryTriggerInteraction(UnityEngine.QueryTriggerInteraction val) + [MonoPInvokeCallback(typeof(SystemExceptionConstructorSystemStringDelegate))] + static int SystemExceptionConstructorSystemString(int messageHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var message = (string)NativeScript.Bindings.ObjectStore.Get(messageHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Exception(message)); return returnValue; } catch (System.NullReferenceException ex) @@ -4647,37 +4749,36 @@ static int BoxQueryTriggerInteraction(UnityEngine.QueryTriggerInteraction val) } } - [MonoPInvokeCallback(typeof(UnboxQueryTriggerInteractionDelegate))] - static UnityEngine.QueryTriggerInteraction UnboxQueryTriggerInteraction(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineScreenPropertyGetResolutionsDelegate))] + static int UnityEngineScreenPropertyGetResolutions() { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.QueryTriggerInteraction)val; - return returnValue; + var returnValue = UnityEngine.Screen.resolutions; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.QueryTriggerInteraction); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.QueryTriggerInteraction); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate))] - static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int handle) + [MonoPInvokeCallback(typeof(ReleaseUnityEngineRayDelegate))] + static void ReleaseUnityEngineRay(int handle) { try { if (handle != 0) { - NativeScript.Bindings.StructStore>.Remove(handle); + NativeScript.Bindings.StructStore.Remove(handle); } } catch (System.NullReferenceException ex) @@ -4692,13 +4793,12 @@ static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate))] - static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(int keyHandle, double value) + [MonoPInvokeCallback(typeof(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate))] + static int UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction) { try { - var key = (string)NativeScript.Bindings.ObjectStore.Get(keyHandle); - var returnValue = NativeScript.Bindings.StructStore>.Store(new System.Collections.Generic.KeyValuePair(key, value)); + var returnValue = NativeScript.Bindings.StructStore.Store(new UnityEngine.Ray(origin, direction)); return returnValue; } catch (System.NullReferenceException ex) @@ -4715,14 +4815,14 @@ static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstruc } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate))] - static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(int thisHandle) + [MonoPInvokeCallback(typeof(BoxRayDelegate))] + static int BoxRay(int valHandle) { try { - var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); - var returnValue = thiz.Key; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var val = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -4738,36 +4838,37 @@ static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleProperty } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate))] - static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(int thisHandle) + [MonoPInvokeCallback(typeof(UnboxRayDelegate))] + static int UnboxRay(int valHandle) { try { - var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); - var returnValue = thiz.Value; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Ray)val); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxKeyValuePairSystemString_SystemDoubleDelegate))] - static int BoxKeyValuePairSystemString_SystemDouble(int valHandle) + [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1Delegate))] + static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1(int rayHandle, int resultsHandle) { try { - var val = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + var ray = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(rayHandle); + var results = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(resultsHandle); + var returnValue = UnityEngine.Physics.RaycastNonAlloc(ray, results); return returnValue; } catch (System.NullReferenceException ex) @@ -4784,13 +4885,35 @@ static int BoxKeyValuePairSystemString_SystemDouble(int valHandle) } } - [MonoPInvokeCallback(typeof(UnboxKeyValuePairSystemString_SystemDoubleDelegate))] - static int UnboxKeyValuePairSystemString_SystemDouble(int valHandle) + [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate))] + static int UnityEnginePhysicsMethodRaycastAllUnityEngineRay(int rayHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore>.Store((System.Collections.Generic.KeyValuePair)val); + var ray = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(rayHandle); + var returnValue = UnityEngine.Physics.RaycastAll(ray); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnityEngineGradientConstructorDelegate))] + static int UnityEngineGradientConstructor() + { + try + { + var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.Gradient()); return returnValue; } catch (System.NullReferenceException ex) @@ -4807,13 +4930,14 @@ static int UnboxKeyValuePairSystemString_SystemDouble(int valHandle) } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringConstructorDelegate))] - static int SystemCollectionsGenericListSystemStringConstructor() + [MonoPInvokeCallback(typeof(UnityEngineGradientPropertyGetColorKeysDelegate))] + static int UnityEngineGradientPropertyGetColorKeys(int thisHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); - return returnValue; + var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.colorKeys; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -4829,79 +4953,80 @@ static int SystemCollectionsGenericListSystemStringConstructor() } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertyGetItemDelegate))] - static int SystemCollectionsGenericListSystemStringPropertyGetItem(int thisHandle, int index) + [MonoPInvokeCallback(typeof(UnityEngineGradientPropertySetColorKeysDelegate))] + static void UnityEngineGradientPropertySetColorKeys(int thisHandle, int valueHandle) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index]; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.colorKeys = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertySetItemDelegate))] - static void SystemCollectionsGenericListSystemStringPropertySetItem(int thisHandle, int index, int valueHandle) + [MonoPInvokeCallback(typeof(SystemAppDomainSetupConstructorDelegate))] + static int SystemAppDomainSetupConstructor() { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz[index] = value; + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.AppDomainSetup()); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate))] - static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int thisHandle, int itemHandle) + [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertyGetAppDomainInitializerDelegate))] + static int SystemAppDomainSetupPropertyGetAppDomainInitializer(int thisHandle) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); - thiz.Add(item); + var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.AppDomainInitializer; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate))] - static void SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) + [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertySetAppDomainInitializerDelegate))] + static void SystemAppDomainSetupPropertySetAppDomainInitializer(int thisHandle, int valueHandle) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); - thiz.Sort(comparer); + var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.AppDomainInitializer = value; } catch (System.NullReferenceException ex) { @@ -4915,58 +5040,53 @@ static void SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsG } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32ConstructorDelegate))] - static int SystemCollectionsGenericListSystemInt32Constructor() + [MonoPInvokeCallback(typeof(UnityEngineApplicationAddEventOnBeforeRenderDelegate))] + static void UnityEngineApplicationAddEventOnBeforeRender(int delHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); - return returnValue; + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.Application.onBeforeRender += del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate))] - static int SystemCollectionsGenericListSystemInt32PropertyGetItem(int thisHandle, int index) + [MonoPInvokeCallback(typeof(UnityEngineApplicationRemoveEventOnBeforeRenderDelegate))] + static void UnityEngineApplicationRemoveEventOnBeforeRender(int delHandle) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index]; - return returnValue; + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.Application.onBeforeRender += del; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertySetItemDelegate))] - static void SystemCollectionsGenericListSystemInt32PropertySetItem(int thisHandle, int index, int value) + [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate))] + static void UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(int delHandle) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz[index] = value; + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; } catch (System.NullReferenceException ex) { @@ -4980,13 +5100,13 @@ static void SystemCollectionsGenericListSystemInt32PropertySetItem(int thisHandl } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate))] - static void SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(int thisHandle, int item) + [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate))] + static void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(int delHandle) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Add(item); + var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); + UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; } catch (System.NullReferenceException ex) { @@ -5000,14 +5120,15 @@ static void SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(int this } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate))] - static void SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) + [MonoPInvokeCallback(typeof(ReleaseUnityEngineSceneManagementSceneDelegate))] + static void ReleaseUnityEngineSceneManagementScene(int handle) { try { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); - thiz.Sort(comparer); + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } } catch (System.NullReferenceException ex) { @@ -5021,13 +5142,13 @@ static void SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGe } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate))] - static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(int valueHandle) + [MonoPInvokeCallback(typeof(BoxSceneDelegate))] + static int BoxScene(int valHandle) { try { - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.LinkedListNode(value)); + var val = (UnityEngine.SceneManagement.Scene)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } catch (System.NullReferenceException ex) @@ -5044,14 +5165,14 @@ static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemSt } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate))] - static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(int thisHandle) + [MonoPInvokeCallback(typeof(UnboxSceneDelegate))] + static int UnboxScene(int valHandle) { try { - var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Value; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.SceneManagement.Scene)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -5067,58 +5188,58 @@ static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(in } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate))] - static void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(BoxLoadSceneModeDelegate))] + static int BoxLoadSceneMode(UnityEngine.SceneManagement.LoadSceneMode val) { try { - var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.Value = value; + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate))] - static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(int valueHandle) + [MonoPInvokeCallback(typeof(UnboxLoadSceneModeDelegate))] + static UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneMode(int valHandle) { try { - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Runtime.CompilerServices.StrongBox(value)); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.SceneManagement.LoadSceneMode)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.SceneManagement.LoadSceneMode); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(UnityEngine.SceneManagement.LoadSceneMode); } } - [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate))] - static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int thisHandle) + [MonoPInvokeCallback(typeof(BoxPrimitiveTypeDelegate))] + static int BoxPrimitiveType(UnityEngine.PrimitiveType val) { try { - var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Value; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -5134,57 +5255,58 @@ static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int t } } - [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate))] - static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(UnboxPrimitiveTypeDelegate))] + static UnityEngine.PrimitiveType UnboxPrimitiveType(int valHandle) { try { - var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.Value = value; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.PrimitiveType)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.PrimitiveType); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.PrimitiveType); } } - [MonoPInvokeCallback(typeof(SystemExceptionConstructorSystemStringDelegate))] - static int SystemExceptionConstructorSystemString(int messageHandle) + [MonoPInvokeCallback(typeof(UnityEngineTimePropertyGetDeltaTimeDelegate))] + static float UnityEngineTimePropertyGetDeltaTime() { try { - var message = (string)NativeScript.Bindings.ObjectStore.Get(messageHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Exception(message)); + var returnValue = UnityEngine.Time.deltaTime; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + return default(float); } } - [MonoPInvokeCallback(typeof(UnityEngineScreenPropertyGetResolutionsDelegate))] - static int UnityEngineScreenPropertyGetResolutions() + [MonoPInvokeCallback(typeof(BoxFileModeDelegate))] + static int BoxFileMode(System.IO.FileMode val) { try { - var returnValue = UnityEngine.Screen.resolutions; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { @@ -5200,173 +5322,160 @@ static int UnityEngineScreenPropertyGetResolutions() } } - [MonoPInvokeCallback(typeof(ReleaseUnityEngineRayDelegate))] - static void ReleaseUnityEngineRay(int handle) + [MonoPInvokeCallback(typeof(UnboxFileModeDelegate))] + static System.IO.FileMode UnboxFileMode(int valHandle) { try { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (System.IO.FileMode)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(System.IO.FileMode); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(System.IO.FileMode); } } - [MonoPInvokeCallback(typeof(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate))] - static int UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericBaseIComparerSystemInt32ConstructorDelegate))] + static void SystemCollectionsGenericBaseIComparerSystemInt32Constructor(int cppHandle, ref int handle) { try { - var returnValue = NativeScript.Bindings.StructStore.Store(new UnityEngine.Ray(origin, direction)); - return returnValue; + var thiz = new SystemCollectionsGenericBaseIComparerSystemInt32(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + handle = default(int); } } - [MonoPInvokeCallback(typeof(BoxRayDelegate))] - static int BoxRay(int valHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericBaseIComparerSystemInt32Delegate))] + static void ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(int handle) { try { - var val = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxRayDelegate))] - static int UnboxRay(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericBaseIComparerSystemStringConstructorDelegate))] + static void SystemCollectionsGenericBaseIComparerSystemStringConstructor(int cppHandle, ref int handle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Ray)val); - return returnValue; + var thiz = new SystemCollectionsGenericBaseIComparerSystemString(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + handle = default(int); } } - [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1Delegate))] - static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1(int rayHandle, int resultsHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericBaseIComparerSystemStringDelegate))] + static void ReleaseSystemCollectionsGenericBaseIComparerSystemString(int handle) { try { - var ray = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(rayHandle); - var results = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(resultsHandle); - var returnValue = UnityEngine.Physics.RaycastNonAlloc(ray, results); - return returnValue; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate))] - static int UnityEnginePhysicsMethodRaycastAllUnityEngineRay(int rayHandle) + [MonoPInvokeCallback(typeof(SystemBaseStringComparerConstructorDelegate))] + static void SystemBaseStringComparerConstructor(int cppHandle, ref int handle) { try { - var ray = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(rayHandle); - var returnValue = UnityEngine.Physics.RaycastAll(ray); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = new SystemBaseStringComparer(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + handle = default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineGradientConstructorDelegate))] - static int UnityEngineGradientConstructor() + [MonoPInvokeCallback(typeof(ReleaseSystemBaseStringComparerDelegate))] + static void ReleaseSystemBaseStringComparer(int handle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.Gradient()); - return returnValue; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineGradientPropertyGetColorKeysDelegate))] - static int UnityEngineGradientPropertyGetColorKeys(int thisHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsQueuePropertyGetCountDelegate))] + static int SystemCollectionsQueuePropertyGetCount(int thisHandle) { try { - var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.colorKeys; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = (System.Collections.Queue)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Count; + return returnValue; } catch (System.NullReferenceException ex) { @@ -5382,80 +5491,75 @@ static int UnityEngineGradientPropertyGetColorKeys(int thisHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineGradientPropertySetColorKeysDelegate))] - static void UnityEngineGradientPropertySetColorKeys(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsBaseQueueConstructorDelegate))] + static void SystemCollectionsBaseQueueConstructor(int cppHandle, ref int handle) { try { - var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.colorKeys = value; + var thiz = new SystemCollectionsBaseQueue(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } } - [MonoPInvokeCallback(typeof(SystemAppDomainSetupConstructorDelegate))] - static int SystemAppDomainSetupConstructor() + [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsBaseQueueDelegate))] + static void ReleaseSystemCollectionsBaseQueue(int handle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.AppDomainSetup()); - return returnValue; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertyGetAppDomainInitializerDelegate))] - static int SystemAppDomainSetupPropertyGetAppDomainInitializer(int thisHandle) + [MonoPInvokeCallback(typeof(SystemComponentModelDesignBaseIComponentChangeServiceConstructorDelegate))] + static void SystemComponentModelDesignBaseIComponentChangeServiceConstructor(int cppHandle, ref int handle) { try { - var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.AppDomainInitializer; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var thiz = new SystemComponentModelDesignBaseIComponentChangeService(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); + handle = default(int); } } - [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertySetAppDomainInitializerDelegate))] - static void SystemAppDomainSetupPropertySetAppDomainInitializer(int thisHandle, int valueHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemComponentModelDesignBaseIComponentChangeServiceDelegate))] + static void ReleaseSystemComponentModelDesignBaseIComponentChangeService(int handle) { try { - var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.AppDomainInitializer = value; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -5469,33 +5573,36 @@ static void SystemAppDomainSetupPropertySetAppDomainInitializer(int thisHandle, } } - [MonoPInvokeCallback(typeof(UnityEngineApplicationAddEventOnBeforeRenderDelegate))] - static void UnityEngineApplicationAddEventOnBeforeRender(int delHandle) + [MonoPInvokeCallback(typeof(SystemIOFileStreamConstructorSystemString_SystemIOFileModeDelegate))] + static int SystemIOFileStreamConstructorSystemString_SystemIOFileMode(int pathHandle, System.IO.FileMode mode) { try { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.Application.onBeforeRender += del; + var path = (string)NativeScript.Bindings.ObjectStore.Get(pathHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.IO.FileStream(path, mode)); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineApplicationRemoveEventOnBeforeRenderDelegate))] - static void UnityEngineApplicationRemoveEventOnBeforeRender(int delHandle) + [MonoPInvokeCallback(typeof(SystemIOFileStreamMethodWriteByteSystemByteDelegate))] + static void SystemIOFileStreamMethodWriteByteSystemByte(int thisHandle, byte value) { try { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.Application.onBeforeRender += del; + var thiz = (System.IO.FileStream)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.WriteByte(value); } catch (System.NullReferenceException ex) { @@ -5509,33 +5616,35 @@ static void UnityEngineApplicationRemoveEventOnBeforeRender(int delHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate))] - static void UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(int delHandle) + [MonoPInvokeCallback(typeof(SystemIOBaseFileStreamConstructorSystemString_SystemIOFileModeDelegate))] + static void SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode(int cppHandle, ref int handle, int pathHandle, System.IO.FileMode mode) { try { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; + var path = (string)NativeScript.Bindings.ObjectStore.Get(pathHandle); + var thiz = new SystemIOBaseFileStream(cppHandle, path, mode); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate))] - static void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(int delHandle) + [MonoPInvokeCallback(typeof(ReleaseSystemIOBaseFileStreamDelegate))] + static void ReleaseSystemIOBaseFileStream(int handle) { try { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; + NativeScript.Bindings.ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -5549,14 +5658,14 @@ static void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(int del } } - [MonoPInvokeCallback(typeof(ReleaseUnityEngineSceneManagementSceneDelegate))] - static void ReleaseUnityEngineSceneManagementScene(int handle) + [MonoPInvokeCallback(typeof(ReleaseUnityEnginePlayablesPlayableHandleDelegate))] + static void ReleaseUnityEnginePlayablesPlayableHandle(int handle) { try { if (handle != 0) { - NativeScript.Bindings.StructStore.Remove(handle); + NativeScript.Bindings.StructStore.Remove(handle); } } catch (System.NullReferenceException ex) @@ -5571,12 +5680,12 @@ static void ReleaseUnityEngineSceneManagementScene(int handle) } } - [MonoPInvokeCallback(typeof(BoxSceneDelegate))] - static int BoxScene(int valHandle) + [MonoPInvokeCallback(typeof(BoxPlayableHandleDelegate))] + static int BoxPlayableHandle(int valHandle) { try { - var val = (UnityEngine.SceneManagement.Scene)NativeScript.Bindings.StructStore.Get(valHandle); + var val = (UnityEngine.Playables.PlayableHandle)NativeScript.Bindings.StructStore.Get(valHandle); var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); return returnValue; } @@ -5594,13 +5703,13 @@ static int BoxScene(int valHandle) } } - [MonoPInvokeCallback(typeof(UnboxSceneDelegate))] - static int UnboxScene(int valHandle) + [MonoPInvokeCallback(typeof(UnboxPlayableHandleDelegate))] + static int UnboxPlayableHandle(int valHandle) { try { var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.SceneManagement.Scene)val); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Playables.PlayableHandle)val); return returnValue; } catch (System.NullReferenceException ex) @@ -5617,13 +5726,14 @@ static int UnboxScene(int valHandle) } } - [MonoPInvokeCallback(typeof(BoxLoadSceneModeDelegate))] - static int BoxLoadSceneMode(UnityEngine.SceneManagement.LoadSceneMode val) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrentDelegate))] + static int SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent(int thisHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -5639,36 +5749,14 @@ static int BoxLoadSceneMode(UnityEngine.SceneManagement.LoadSceneMode val) } } - [MonoPInvokeCallback(typeof(UnboxLoadSceneModeDelegate))] - static UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneMode(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.SceneManagement.LoadSceneMode)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.SceneManagement.LoadSceneMode); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.SceneManagement.LoadSceneMode); - } - } - - [MonoPInvokeCallback(typeof(BoxPrimitiveTypeDelegate))] - static int BoxPrimitiveType(UnityEngine.PrimitiveType val) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumeratorDelegate))] + static int SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator(int thisHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetEnumerator(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -5684,53 +5772,58 @@ static int BoxPrimitiveType(UnityEngine.PrimitiveType val) } } - [MonoPInvokeCallback(typeof(UnboxPrimitiveTypeDelegate))] - static UnityEngine.PrimitiveType UnboxPrimitiveType(int valHandle) + [MonoPInvokeCallback(typeof(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1Delegate))] + static int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1(int eHandle, int nameHandle, int classesHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.PrimitiveType)val; - return returnValue; + var e = (UnityEngine.Experimental.UIElements.VisualElement)NativeScript.Bindings.ObjectStore.Get(eHandle); + var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); + var classes = (string[])NativeScript.Bindings.ObjectStore.Get(classesHandle); + var returnValue = UnityEngine.Experimental.UIElements.UQueryExtensions.Q(e, name, classes); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.PrimitiveType); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.PrimitiveType); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineTimePropertyGetDeltaTimeDelegate))] - static float UnityEngineTimePropertyGetDeltaTime() + [MonoPInvokeCallback(typeof(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringDelegate))] + static int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString(int eHandle, int nameHandle, int classNameHandle) { try { - var returnValue = UnityEngine.Time.deltaTime; - return returnValue; + var e = (UnityEngine.Experimental.UIElements.VisualElement)NativeScript.Bindings.ObjectStore.Get(eHandle); + var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); + var className = (string)NativeScript.Bindings.ObjectStore.Get(classNameHandle); + var returnValue = UnityEngine.Experimental.UIElements.UQueryExtensions.Q(e, name, className); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxFileModeDelegate))] - static int BoxFileMode(System.IO.FileMode val) + [MonoPInvokeCallback(typeof(BoxInteractionSourcePositionAccuracyDelegate))] + static int BoxInteractionSourcePositionAccuracy(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy val) { try { @@ -5751,160 +5844,176 @@ static int BoxFileMode(System.IO.FileMode val) } } - [MonoPInvokeCallback(typeof(UnboxFileModeDelegate))] - static System.IO.FileMode UnboxFileMode(int valHandle) + [MonoPInvokeCallback(typeof(UnboxInteractionSourcePositionAccuracyDelegate))] + static UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy UnboxInteractionSourcePositionAccuracy(int valHandle) { try { var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (System.IO.FileMode)val; + var returnValue = (UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy)val; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(System.IO.FileMode); + return default(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(System.IO.FileMode); + return default(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericBaseIComparerSystemInt32ConstructorDelegate))] - static void SystemCollectionsGenericBaseIComparerSystemInt32Constructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(BoxInteractionSourceNodeDelegate))] + static int BoxInteractionSourceNode(UnityEngine.XR.WSA.Input.InteractionSourceNode val) { try { - var thiz = new SystemCollectionsGenericBaseIComparerSystemInt32(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericBaseIComparerSystemInt32Delegate))] - static void ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(int handle) + [MonoPInvokeCallback(typeof(UnboxInteractionSourceNodeDelegate))] + static UnityEngine.XR.WSA.Input.InteractionSourceNode UnboxInteractionSourceNode(int valHandle) { try { - NativeScript.Bindings.ObjectStore.Remove(handle); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.XR.WSA.Input.InteractionSourceNode)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.XR.WSA.Input.InteractionSourceNode); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.XR.WSA.Input.InteractionSourceNode); } } - [MonoPInvokeCallback(typeof(SystemCollectionsGenericBaseIComparerSystemStringConstructorDelegate))] - static void SystemCollectionsGenericBaseIComparerSystemStringConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(ReleaseUnityEngineXRWSAInputInteractionSourcePoseDelegate))] + static void ReleaseUnityEngineXRWSAInputInteractionSourcePose(int handle) { try { - var thiz = new SystemCollectionsGenericBaseIComparerSystemString(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericBaseIComparerSystemStringDelegate))] - static void ReleaseSystemCollectionsGenericBaseIComparerSystemString(int handle) + [MonoPInvokeCallback(typeof(UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNodeDelegate))] + static bool UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode(int thisHandle, out UnityEngine.Quaternion rotation, UnityEngine.XR.WSA.Input.InteractionSourceNode node) { try { - NativeScript.Bindings.ObjectStore.Remove(handle); + var thiz = (UnityEngine.XR.WSA.Input.InteractionSourcePose)NativeScript.Bindings.StructStore.Get(thisHandle); + var returnValue = thiz.TryGetRotation(out rotation, node); + NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + rotation = default(UnityEngine.Quaternion); + return default(bool); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + rotation = default(UnityEngine.Quaternion); + return default(bool); } } - [MonoPInvokeCallback(typeof(SystemBaseStringComparerConstructorDelegate))] - static void SystemBaseStringComparerConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(BoxInteractionSourcePoseDelegate))] + static int BoxInteractionSourcePose(int valHandle) { try { - var thiz = new SystemBaseStringComparer(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var val = (UnityEngine.XR.WSA.Input.InteractionSourcePose)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemBaseStringComparerDelegate))] - static void ReleaseSystemBaseStringComparer(int handle) + [MonoPInvokeCallback(typeof(UnboxInteractionSourcePoseDelegate))] + static int UnboxInteractionSourcePose(int valHandle) { try { - NativeScript.Bindings.ObjectStore.Remove(handle); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.XR.WSA.Input.InteractionSourcePose)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemCollectionsQueuePropertyGetCountDelegate))] - static int SystemCollectionsQueuePropertyGetCount(int thisHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrentDelegate))] + static int SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent(int thisHandle) { try { - var thiz = (System.Collections.Queue)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Count; - return returnValue; + var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -5920,96 +6029,106 @@ static int SystemCollectionsQueuePropertyGetCount(int thisHandle) } } - [MonoPInvokeCallback(typeof(SystemCollectionsBaseQueueConstructorDelegate))] - static void SystemCollectionsBaseQueueConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrentDelegate))] + static int SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent(int thisHandle) { try { - var thiz = new SystemCollectionsBaseQueue(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsBaseQueueDelegate))] - static void ReleaseSystemCollectionsBaseQueue(int handle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrentDelegate))] + static float SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent(int thisHandle) { try { - NativeScript.Bindings.ObjectStore.Remove(handle); + var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignBaseIComponentChangeServiceConstructorDelegate))] - static void SystemComponentModelDesignBaseIComponentChangeServiceConstructor(int cppHandle, ref int handle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrentDelegate))] + static int SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent(int thisHandle) { try { - var thiz = new SystemComponentModelDesignBaseIComponentChangeService(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return NativeScript.Bindings.StructStore.Store(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemComponentModelDesignBaseIComponentChangeServiceDelegate))] - static void ReleaseSystemComponentModelDesignBaseIComponentChangeService(int handle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrentDelegate))] + static UnityEngine.GradientColorKey SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent(int thisHandle) { try { - NativeScript.Bindings.ObjectStore.Remove(handle); + var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.GradientColorKey); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.GradientColorKey); } } - [MonoPInvokeCallback(typeof(SystemIOFileStreamConstructorSystemString_SystemIOFileModeDelegate))] - static int SystemIOFileStreamConstructorSystemString_SystemIOFileMode(int pathHandle, System.IO.FileMode mode) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrentDelegate))] + static int SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent(int thisHandle) { try { - var path = (string)NativeScript.Bindings.ObjectStore.Get(pathHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.IO.FileStream(path, mode)); - return returnValue; + var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; + return NativeScript.Bindings.StructStore.Store(returnValue); } catch (System.NullReferenceException ex) { @@ -6025,98 +6144,106 @@ static int SystemIOFileStreamConstructorSystemString_SystemIOFileMode(int pathHa } } - [MonoPInvokeCallback(typeof(SystemIOFileStreamMethodWriteByteSystemByteDelegate))] - static void SystemIOFileStreamMethodWriteByteSystemByte(int thisHandle, byte value) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumeratorDelegate))] + static int SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator(int thisHandle) { try { - var thiz = (System.IO.FileStream)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.WriteByte(value); + var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetEnumerator(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemIOBaseFileStreamConstructorSystemString_SystemIOFileModeDelegate))] - static void SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode(int cppHandle, ref int handle, int pathHandle, System.IO.FileMode mode) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumeratorDelegate))] + static int SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator(int thisHandle) { try { - var path = (string)NativeScript.Bindings.ObjectStore.Get(pathHandle); - var thiz = new SystemIOBaseFileStream(cppHandle, path, mode); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetEnumerator(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemIOBaseFileStreamDelegate))] - static void ReleaseSystemIOBaseFileStream(int handle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumeratorDelegate))] + static int SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator(int thisHandle) { try { - NativeScript.Bindings.ObjectStore.Remove(handle); + var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetEnumerator(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseUnityEnginePlayablesPlayableHandleDelegate))] - static void ReleaseUnityEnginePlayablesPlayableHandle(int handle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumeratorDelegate))] + static int SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator(int thisHandle) { try { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } + var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetEnumerator(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(BoxPlayableHandleDelegate))] - static int BoxPlayableHandle(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumeratorDelegate))] + static int SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator(int thisHandle) { try { - var val = (UnityEngine.Playables.PlayableHandle)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetEnumerator(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -6132,14 +6259,14 @@ static int BoxPlayableHandle(int valHandle) } } - [MonoPInvokeCallback(typeof(UnboxPlayableHandleDelegate))] - static int UnboxPlayableHandle(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumeratorDelegate))] + static int SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator(int thisHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Playables.PlayableHandle)val); - return returnValue; + var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.GetEnumerator(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { @@ -6155,16 +6282,13 @@ static int UnboxPlayableHandle(int valHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1Delegate))] - static int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1(int eHandle, int nameHandle, int classesHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringConstructorDelegate))] + static int SystemCollectionsGenericListSystemStringConstructor() { try { - var e = (UnityEngine.Experimental.UIElements.VisualElement)NativeScript.Bindings.ObjectStore.Get(eHandle); - var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); - var classes = (string[])NativeScript.Bindings.ObjectStore.Get(classesHandle); - var returnValue = UnityEngine.Experimental.UIElements.UQueryExtensions.Q(e, name, classes); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); + return returnValue; } catch (System.NullReferenceException ex) { @@ -6180,15 +6304,13 @@ static int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineEx } } - [MonoPInvokeCallback(typeof(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringDelegate))] - static int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString(int eHandle, int nameHandle, int classNameHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertyGetItemDelegate))] + static int SystemCollectionsGenericListSystemStringPropertyGetItem(int thisHandle, int index) { try { - var e = (UnityEngine.Experimental.UIElements.VisualElement)NativeScript.Bindings.ObjectStore.Get(eHandle); - var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); - var className = (string)NativeScript.Bindings.ObjectStore.Get(classNameHandle); - var returnValue = UnityEngine.Experimental.UIElements.UQueryExtensions.Q(e, name, className); + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index]; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) @@ -6205,187 +6327,172 @@ static int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineEx } } - [MonoPInvokeCallback(typeof(BoxInteractionSourcePositionAccuracyDelegate))] - static int BoxInteractionSourcePositionAccuracy(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy val) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertySetItemDelegate))] + static void SystemCollectionsGenericListSystemStringPropertySetItem(int thisHandle, int index, int valueHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz[index] = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxInteractionSourcePositionAccuracyDelegate))] - static UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy UnboxInteractionSourcePositionAccuracy(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate))] + static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int thisHandle, int itemHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy)val; - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); + thiz.Add(item); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy); } } - [MonoPInvokeCallback(typeof(BoxInteractionSourceNodeDelegate))] - static int BoxInteractionSourceNode(UnityEngine.XR.WSA.Input.InteractionSourceNode val) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate))] + static void SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) { try { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); + thiz.Sort(comparer); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxInteractionSourceNodeDelegate))] - static UnityEngine.XR.WSA.Input.InteractionSourceNode UnboxInteractionSourceNode(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32ConstructorDelegate))] + static int SystemCollectionsGenericListSystemInt32Constructor() { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.XR.WSA.Input.InteractionSourceNode)val; + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.XR.WSA.Input.InteractionSourceNode); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.XR.WSA.Input.InteractionSourceNode); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseUnityEngineXRWSAInputInteractionSourcePoseDelegate))] - static void ReleaseUnityEngineXRWSAInputInteractionSourcePose(int handle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate))] + static int SystemCollectionsGenericListSystemInt32PropertyGetItem(int thisHandle, int index) { try { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz[index]; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNodeDelegate))] - static bool UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode(int thisHandle, out UnityEngine.Quaternion rotation, UnityEngine.XR.WSA.Input.InteractionSourceNode node) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertySetItemDelegate))] + static void SystemCollectionsGenericListSystemInt32PropertySetItem(int thisHandle, int index, int value) { try { - var thiz = (UnityEngine.XR.WSA.Input.InteractionSourcePose)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.TryGetRotation(out rotation, node); - NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz[index] = value; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - rotation = default(UnityEngine.Quaternion); - return default(bool); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - rotation = default(UnityEngine.Quaternion); - return default(bool); } } - [MonoPInvokeCallback(typeof(BoxInteractionSourcePoseDelegate))] - static int BoxInteractionSourcePose(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate))] + static void SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(int thisHandle, int item) { try { - var val = (UnityEngine.XR.WSA.Input.InteractionSourcePose)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.Add(item); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } - [MonoPInvokeCallback(typeof(UnboxInteractionSourcePoseDelegate))] - static int UnboxInteractionSourcePose(int valHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate))] + static void SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) { try { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.XR.WSA.Input.InteractionSourcePose)val); - return returnValue; + var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); + thiz.Sort(comparer); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); } } diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 2b6735c..49283b8 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -186,7 +186,7 @@ class StringBuilders new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppGlobalStateAndFunctions = new StringBuilder(InitialStringBuilderCapacity); - public readonly StringBuilder CppBoxingMethodDeclarations = + public readonly StringBuilder CppUnboxingMethodDeclarations = new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppStringDefaultParams = new StringBuilder(InitialStringBuilderCapacity); @@ -601,7 +601,16 @@ static void DoPostCompileWork(bool canRefreshAssetDb) // Generate boxing and unboxing for primitive types foreach (Type type in PRIMITIVE_TYPES) { - AppendBoxingUnboxing( + string dummyString; + ParameterInfo[] dummyParams; + AppendBoxingBindings( + type, + TypeKind.Primitive, + null, + builders, + out dummyString, + out dummyParams); + AppendUnboxing( type, TypeKind.Primitive, null, @@ -965,7 +974,9 @@ static Type[] GetDirectInterfaces(Type type) static void AddCppCtorInitType(Type type, List types) { - if (type.BaseType != null && type.BaseType != typeof(object)) + if (type.BaseType != null + && type.BaseType != typeof(object) + && type.BaseType != typeof(ValueType)) { AddCppCtorInitType(type.BaseType, types); } @@ -1341,7 +1352,7 @@ static int AppendType( AppendEnum( type, builders); - AppendBoxingUnboxing( + AppendUnboxing( type, typeKind, null, @@ -1387,7 +1398,7 @@ static int AppendType( builders); if (typeKind != TypeKind.Class) { - AppendBoxingUnboxing( + AppendUnboxing( genericType, typeKind, typeParams, @@ -1412,7 +1423,7 @@ static int AppendType( builders); if (typeKind != TypeKind.Class) { - AppendBoxingUnboxing( + AppendUnboxing( type, typeKind, null, @@ -1618,16 +1629,47 @@ static void AppendType( builders.CppTypeDeclarations); // C++ type definition (beginning) - Type baseType = type.BaseType ?? typeof(object); Type[] interfaceTypes = GetDirectInterfaces(type); + string baseTypeName; + string baseTypeNamespace; + Type[] baseTypeTypeParams; + switch (typeKind) + { + case TypeKind.FullStruct: + baseTypeName = null; + baseTypeNamespace = null; + baseTypeTypeParams = null; + break; + case TypeKind.ManagedStruct: + if (interfaceTypes.Length == 0) + { + baseTypeName = "ManagedType"; + baseTypeNamespace = "Plugin"; + baseTypeTypeParams = null; + } + else + { + baseTypeName = null; + baseTypeNamespace = null; + baseTypeTypeParams = null; + } + break; + default: + Type baseType = type.BaseType ?? typeof(object); + baseTypeName = baseType.Name; + baseTypeNamespace = baseType.Namespace; + baseTypeTypeParams = baseType.GetGenericArguments(); + break; + } + AppendCppTypeDefinitionBegin( type.Name, type.Namespace, typeKind, typeParams, - baseType.Name, - baseType.Namespace, - baseType.GetGenericArguments(), + baseTypeName, + baseTypeNamespace, + baseTypeTypeParams, interfaceTypes, isStatic, indent, @@ -1642,9 +1684,9 @@ static void AppendType( type.Namespace, typeKind, typeParams, - baseType.Name, - baseType.Namespace, - baseType.GetGenericArguments(), + baseTypeName, + baseTypeNamespace, + baseTypeTypeParams, cppCtorInterfaceTypes, isStatic, (extraIndent, subject) => {}, @@ -1725,6 +1767,7 @@ static void AppendType( } } + // Events if (jsonType.Events != null) { foreach (JsonEvent jsonEvent in jsonType.Events) @@ -1761,6 +1804,17 @@ static void AppendType( } } + // Boxing + if (typeKind != TypeKind.Class) + { + AppendBoxing( + type, + typeKind, + typeParams, + indent, + builders); + } + // C++ type definition (ending) AppendCppTypeDefinitionEnd( isStatic, @@ -1883,24 +1937,39 @@ static void AppendEnum( Type type, StringBuilders builders) { - // C++ type declaration (actually definition) - int indent = AppendNamespaceBeginning( + // C++ type declaration + int indent = AppendCppTypeDeclaration( type.Namespace, + type.Name, + false, + null, builders.CppTypeDeclarations); - AppendIndent( + + // C++ type definition (begin) + AppendCppTypeDefinitionBegin( + type.Name, + type.Namespace, + TypeKind.FullStruct, + null, + null, + null, + null, + null, + false, indent, - builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append("enum struct "); - builders.CppTypeDeclarations.Append(type.Name); - builders.CppTypeDeclarations.Append(" : "); - AppendCppTypeName( - Enum.GetUnderlyingType(type), - builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append('\n'); + builders.CppTypeDefinitions); AppendIndent( - indent, - builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append("{\n"); + indent + 1, + builders.CppTypeDefinitions); + + // Primitive type field + Type underlyingType = Enum.GetUnderlyingType(type); + AppendCppPrimitiveTypeName( + underlyingType, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append(" Value;\n"); + + // Enumerator fields FieldInfo[] fields = type.GetFields( BindingFlags.Static | BindingFlags.Public); @@ -1909,32 +1978,295 @@ static void AppendEnum( FieldInfo field = fields[i]; AppendIndent( indent + 1, - builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append(field.Name); - builders.CppTypeDeclarations.Append(" = "); - builders.CppTypeDeclarations.Append( - field.GetRawConstantValue()); - if (i != fields.Length - 1) - { - builders.CppTypeDeclarations.Append(','); - } - builders.CppTypeDeclarations.Append('\n'); + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("static const "); + AppendCppTypeName( + type, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append(' '); + builders.CppTypeDefinitions.Append(field.Name); + builders.CppTypeDefinitions.Append(";\n"); } + + // Constructor from primitive type + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("explicit "); + builders.CppTypeDefinitions.Append(type.Name); + builders.CppTypeDefinitions.Append('('); + AppendCppPrimitiveTypeName( + underlyingType, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append(" value);\n"); + + // Conversion operator to primitive type + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("explicit operator "); + AppendCppPrimitiveTypeName( + underlyingType, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("() const;\n"); + + // Equality operator + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("bool operator==("); + builders.CppTypeDefinitions.Append(type.Name); + builders.CppTypeDefinitions.Append(" other);\n"); + + // Inequality operator + AppendIndent( + indent + 1, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("bool operator!=("); + builders.CppTypeDefinitions.Append(type.Name); + builders.CppTypeDefinitions.Append(" other);\n"); + + AppendNamespaceBeginning( + type.Namespace, + builders.CppMethodDefinitions); + + // Constructor from primitive type AppendIndent( indent, - builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append("};\n"); + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(type.Name); + builders.CppMethodDefinitions.Append("::"); + builders.CppMethodDefinitions.Append(type.Name); + builders.CppMethodDefinitions.Append('('); + AppendCppPrimitiveTypeName( + underlyingType, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(" value)\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(": Value(value)\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + + // Conversion operator to primitive type + AppendIndent( + indent, + builders.CppMethodDefinitions); + AppendCppTypeName( + type, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("::operator "); + AppendCppPrimitiveTypeName( + underlyingType, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("() const\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("return Value;\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + + // Equality operator + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("bool "); + AppendCppTypeName( + type, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("::operator==("); + builders.CppMethodDefinitions.Append(type.Name); + builders.CppMethodDefinitions.Append(" other)\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("return Value == other.Value;\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + + // Inequality operator + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("bool "); + AppendCppTypeName( + type, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("::operator!=("); + builders.CppMethodDefinitions.Append(type.Name); + builders.CppMethodDefinitions.Append(" other)\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("return Value != other.Value;\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append('\n'); + + AppendBoxing( + type, + TypeKind.Enum, + null, + indent, + builders); + AppendNamespaceEnding( indent, - builders.CppTypeDeclarations); - builders.CppTypeDeclarations.Append('\n'); + builders.CppMethodDefinitions); + AppendIndent( + indent, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append("};\n"); + AppendNamespaceEnding( + indent, + builders.CppTypeDefinitions); + builders.CppTypeDefinitions.Append('\n'); + + // Static initialization + for (int i = 0; i < fields.Length; ++i) + { + FieldInfo field = fields[i]; + builders.CppMethodDefinitions.Append("const "); + AppendCppTypeName( + type, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append(' '); + AppendCppTypeName( + type, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("::"); + builders.CppMethodDefinitions.Append(field.Name); + builders.CppMethodDefinitions.Append('('); + builders.CppMethodDefinitions.Append( + field.GetRawConstantValue()); + builders.CppMethodDefinitions.Append(");\n"); + } + builders.CppMethodDefinitions.Append('\n'); } - static void AppendBoxingUnboxing( + static void AppendBoxing( Type type, TypeKind typeKind, Type[] typeParams, + int indent, StringBuilders builders) + { + string boxFuncName; + ParameterInfo[] boxCppParams; + AppendBoxingBindings( + type, + typeKind, + typeParams, + builders, + out boxFuncName, + out boxCppParams); + + for (Type baseType = type.BaseType; + baseType != null; + baseType = baseType.BaseType) + { + string boxMethodDefinitionName; + string boxMethodDeclarationName; + AppendCppBoxingMethodNames( + baseType, + builders.TempStrBuilder, + out boxMethodDefinitionName, + out boxMethodDeclarationName); + AppendCppBoxingMethodDeclaration( + baseType, + baseType.GetGenericArguments(), + boxMethodDeclarationName, + boxCppParams, + indent + 1, + builders.CppTypeDefinitions); + AppendCppBoxingMethodDefinition( + type, + typeParams, + baseType, + typeKind, + boxMethodDefinitionName, + boxFuncName, + boxCppParams, + indent, + builders.CppMethodDefinitions); + } + foreach (Type interfaceType in type.GetInterfaces()) + { + string boxMethodDefinitionName; + string boxMethodDeclarationName; + AppendCppBoxingMethodNames( + interfaceType, + builders.TempStrBuilder, + out boxMethodDefinitionName, + out boxMethodDeclarationName); + AppendCppBoxingMethodDeclaration( + interfaceType, + interfaceType.GetGenericArguments(), + boxMethodDeclarationName, + boxCppParams, + indent + 1, + builders.CppTypeDefinitions); + AppendCppBoxingMethodDefinition( + type, + typeParams, + interfaceType, + typeKind, + boxMethodDefinitionName, + boxFuncName, + boxCppParams, + indent, + builders.CppMethodDefinitions); + } + } + + static void AppendBoxingBindings( + Type type, + TypeKind typeKind, + Type[] typeParams, + StringBuilders builders, + out string boxFuncName, + out ParameterInfo[] boxCppParams) { builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("Box"); @@ -1944,12 +2276,100 @@ static void AppendBoxingUnboxing( AppendTypeNames( typeParams, builders.TempStrBuilder); - string boxFuncName = builders.TempStrBuilder.ToString(); + boxFuncName = builders.TempStrBuilder.ToString(); builders.TempStrBuilder[0] = char.ToLower( builders.TempStrBuilder[0]); string boxFuncNameLower = builders.TempStrBuilder.ToString(); + ParameterInfo[] boxParams = { + new ParameterInfo + { + Name = "val", + ParameterType = type, + DereferencedParameterType = type, + IsOut = false, + IsRef = false, + Kind = typeKind + } + }; + + boxCppParams = new ParameterInfo[0]; + + // C# init params + AppendCsharpInitParam( + boxFuncNameLower, + builders.CsharpInitParams); + + // C# delegate types + AppendCsharpDelegateType( + boxFuncName, + true, + type, + typeKind, + typeof(object), + boxParams, + builders.CsharpDelegateTypes); + + // C# init call args + AppendCsharpInitCallArg( + boxFuncName, + builders.CsharpInitCall); + + // C# box function + AppendCsharpFunctionBeginning( + typeof(object), + boxFuncName, + true, + TypeKind.Class, + typeof(object), + boxParams, + builders.CsharpFunctions); + builders.CsharpFunctions.Append( + "NativeScript.Bindings.ObjectStore.Store((object)val);"); + AppendCsharpFunctionReturn( + boxParams, + typeof(object), + TypeKind.Class, + null, + true, + builders.CsharpFunctions); + + // C++ function pointers + AppendCppFunctionPointerDefinition( + boxFuncName, + true, + type.Name, + type.Namespace, + typeKind, + boxParams, + typeof(object), + builders.CppFunctionPointers); + + // C++ init params + AppendCppInitParam( + boxFuncNameLower, + true, + type.Name, + type.Namespace, + typeKind, + boxParams, + typeof(object), + builders.CppInitParams); + + // C++ init body + AppendCppInitBody( + boxFuncName, + boxFuncNameLower, + builders.CppInitBody); + } + + static void AppendUnboxing( + Type type, + TypeKind typeKind, + Type[] typeParams, + StringBuilders builders) + { builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("Unbox"); AppendTypeNameWithoutSuffixes( @@ -1976,18 +2396,6 @@ static void AppendBoxingUnboxing( builders.TempStrBuilder.Append(unboxMethodDefinitionName); string unboxMethodDeclarationName = builders.TempStrBuilder.ToString(); - ParameterInfo[] boxParams = { - new ParameterInfo - { - Name = "val", - ParameterType = type, - DereferencedParameterType = type, - IsOut = false, - IsRef = false, - Kind = typeKind - } - }; - ParameterInfo[] unboxParams = { new ParameterInfo { @@ -2003,22 +2411,11 @@ static void AppendBoxingUnboxing( ParameterInfo[] unboxCppParams = new ParameterInfo[0]; // C# init params - AppendCsharpInitParam( - boxFuncNameLower, - builders.CsharpInitParams); AppendCsharpInitParam( unboxFuncNameLower, builders.CsharpInitParams); // C# delegate types - AppendCsharpDelegateType( - boxFuncName, - true, - type, - typeKind, - typeof(object), - boxParams, - builders.CsharpDelegateTypes); AppendCsharpDelegateType( unboxFuncName, true, @@ -2029,32 +2426,10 @@ static void AppendBoxingUnboxing( builders.CsharpDelegateTypes); // C# init call args - AppendCsharpInitCallArg( - boxFuncName, - builders.CsharpInitCall); AppendCsharpInitCallArg( unboxFuncName, builders.CsharpInitCall); - // C# box function - AppendCsharpFunctionBeginning( - typeof(object), - boxFuncName, - true, - TypeKind.Class, - typeof(object), - boxParams, - builders.CsharpFunctions); - builders.CsharpFunctions.Append( - "NativeScript.Bindings.ObjectStore.Store((object)val);"); - AppendCsharpFunctionReturn( - boxParams, - typeof(object), - TypeKind.Class, - null, - true, - builders.CsharpFunctions); - // C# unbox function AppendCsharpFunctionBeginning( typeof(object), @@ -2094,15 +2469,6 @@ static void AppendBoxingUnboxing( builders.CsharpFunctions); // C++ function pointers - AppendCppFunctionPointerDefinition( - boxFuncName, - true, - type.Name, - type.Namespace, - typeKind, - boxParams, - typeof(object), - builders.CppFunctionPointers); AppendCppFunctionPointerDefinition( unboxFuncName, true, @@ -2113,103 +2479,23 @@ static void AppendBoxingUnboxing( type, builders.CppFunctionPointers); - // C++ method declarations - AppendIndent( - 2, - builders.CppBoxingMethodDeclarations); - AppendCppMethodDeclaration( - "Object", - false, - false, - false, - null, - typeParams, - null, - boxParams, - builders.CppBoxingMethodDeclarations); + // C++ unbox method declaration and definition AppendIndent( 2, - builders.CppBoxingMethodDeclarations); + builders.CppUnboxingMethodDeclarations); AppendCppMethodDeclaration( unboxMethodDeclarationName, false, - false, - false, - null, - typeParams, - null, - unboxCppParams, - builders.CppBoxingMethodDeclarations); - - // C++ method definitions (begin) - int indent = AppendNamespaceBeginning( - "System", - builders.CppMethodDefinitions); - - // C++ box method definition - AppendCppMethodDefinitionBegin( - "Object", - null, - "Object", - null, - null, - boxParams, - indent, - builders.CppMethodDefinitions); - AppendIndent( - indent, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); - AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("int32_t handle = Plugin::"); - builders.CppMethodDefinitions.Append(boxFuncName); - builders.CppMethodDefinitions.Append("(val"); - if (typeKind == TypeKind.ManagedStruct) - { - builders.CppMethodDefinitions.Append(".Handle"); - } - builders.CppMethodDefinitions.Append(");\n"); - AppendCppUnhandledExceptionHandling( - indent + 1, - builders.CppMethodDefinitions); - AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "if (handle)\n"); - AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "{\n"); - AppendIndent( - indent + 2, - builders.CppMethodDefinitions); - AppendReferenceManagedHandleFunctionCall( - "Object", - "System", - TypeKind.Class, - null, - "handle", - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(";\n"); - AppendIndent( - indent + 2, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Handle = handle;\n"); - AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "}\n"); - AppendIndent( - indent, + false, + false, + null, + typeParams, + null, + unboxCppParams, + builders.CppUnboxingMethodDeclarations); + int indent = AppendNamespaceBeginning( + "System", builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n\t\n"); - - // C++ unbox method definition AppendCppMethodDefinitionBegin( "Object", null, @@ -2255,15 +2541,6 @@ static void AppendBoxingUnboxing( builders.CppMethodDefinitions); // C++ init params - AppendCppInitParam( - boxFuncNameLower, - true, - type.Name, - type.Namespace, - typeKind, - boxParams, - typeof(object), - builders.CppInitParams); AppendCppInitParam( unboxFuncNameLower, true, @@ -2275,16 +2552,144 @@ static void AppendBoxingUnboxing( builders.CppInitParams); // C++ init body - AppendCppInitBody( - boxFuncName, - boxFuncNameLower, - builders.CppInitBody); AppendCppInitBody( unboxFuncName, unboxFuncNameLower, builders.CppInitBody); } + static void AppendCppBoxingMethodNames( + Type baseType, + StringBuilder tempBuilder, + out string boxMethodDefinitionName, + out string boxMethodDeclarationName) + { + tempBuilder.Length = 0; + tempBuilder.Append("operator "); + AppendCppTypeName( + baseType, + tempBuilder); + boxMethodDefinitionName = tempBuilder.ToString(); + + tempBuilder.Length = 0; + tempBuilder.Append("explicit "); + tempBuilder.Append(boxMethodDefinitionName); + boxMethodDeclarationName = tempBuilder.ToString(); + } + + static void AppendCppBoxingMethodDeclaration( + Type type, + Type[] typeParams, + string boxMethodDeclarationName, + ParameterInfo[] boxCppParams, + int indent, + StringBuilder output) + { + AppendIndent( + indent, + output); + AppendCppMethodDeclaration( + boxMethodDeclarationName, + false, + false, + false, + null, + typeParams, + null, + boxCppParams, + output); + } + + static void AppendCppBoxingMethodDefinition( + Type enclosingType, + Type[] enclosingTypeTypeParams, + Type boxedType, + TypeKind typeKind, + string boxMethodDefinitionName, + string boxFuncName, + ParameterInfo[] boxCppParams, + int indent, + StringBuilder output) + { + AppendCppMethodDefinitionBegin( + enclosingType.Name, + null, + boxMethodDefinitionName, + enclosingTypeTypeParams, + null, + boxCppParams, + indent, + output); + AppendIndent( + indent, + output); + output.Append("{\n"); + AppendIndent( + indent + 1, + output); + output.Append("int32_t handle = Plugin::"); + output.Append(boxFuncName); + output.Append('('); + if (typeKind == TypeKind.ManagedStruct) + { + output.Append("Handle"); + } + else + { + output.Append("*this"); + } + output.Append(");\n"); + AppendCppUnhandledExceptionHandling( + indent + 1, + output); + AppendIndent( + indent + 1, + output); + output.Append( + "if (handle)\n"); + AppendIndent( + indent + 1, + output); + output.Append( + "{\n"); + AppendIndent( + indent + 2, + output); + AppendReferenceManagedHandleFunctionCall( + "Object", + "System", + TypeKind.Class, + null, + "handle", + output); + output.Append(";\n"); + AppendIndent( + indent + 2, + output); + output.Append("return "); + AppendCppTypeName( + boxedType, + output); + output.Append("(Plugin::InternalUse::Only, handle);\n"); + AppendIndent( + indent + 1, + output); + output.Append( + "}\n"); + AppendIndent( + indent + 1, + output); + output.Append("return nullptr;\n"); + AppendIndent( + indent, + output); + output.Append("}\n"); + AppendIndent( + indent, + output); + output.Append('\n'); + } + static void AppendHandleStoreTypeName( Type type, StringBuilder output) @@ -5202,7 +5607,7 @@ static void AppendArrayElementProxy( builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append(cppElementProxyTypeName); builders.CppTypeDefinitions.Append( - "(Plugin::InternalUse iu, int32_t handle, "); + "(Plugin::InternalUse, int32_t handle, "); for (int i = 0; i < rank; ++i) { builders.CppTypeDefinitions.Append("int32_t index"); @@ -5269,7 +5674,7 @@ static void AppendArrayElementProxy( builders.CppMethodDefinitions.Append('_'); builders.CppMethodDefinitions.Append(maxRank); builders.CppMethodDefinitions.Append( - "(Plugin::InternalUse iu, int32_t handle, "); + "(Plugin::InternalUse, int32_t handle, "); for (int i = 0; i < rank; ++i) { builders.CppMethodDefinitions.Append("int32_t index"); @@ -8640,6 +9045,11 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( case TypeKind.ManagedStruct: output.Append("int32_t"); break; + case TypeKind.Primitive: + AppendCppPrimitiveTypeName( + method.ReturnType, + output); + break; default: AppendCppTypeName( method.ReturnType, @@ -8670,6 +9080,13 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( output.Append(param.Name); output.Append("Handle"); break; + case TypeKind.Primitive: + AppendCppPrimitiveTypeName( + param.ParameterType, + output); + output.Append(' '); + output.Append(param.Name); + break; default: AppendCppTypeName( param.ParameterType, @@ -9378,7 +9795,7 @@ static void AppendCppBaseTypeHandleConstructor( cppTypeName, output); output.Append( - "(Plugin::InternalUse iu, int32_t handle)\n"); + "(Plugin::InternalUse, int32_t handle)\n"); string separator = ": "; foreach (Type interfaceType in interfaceTypes) { @@ -9747,7 +10164,7 @@ static void AppendCppBaseTypeConstructor( AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("int32_t* handle = &Handle;\n"); + output.Append("System::Int32* handle = (System::Int32*)&Handle;\n"); AppendIndent( cppMethodDefinitionsIndent + 1, output); @@ -9757,7 +10174,7 @@ static void AppendCppBaseTypeConstructor( AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("int32_t* classHandle = &ClassHandle;\n"); + output.Append("System::Int32* classHandle = (System::Int32*)&ClassHandle;\n"); } AppendCppPluginFunctionCall( true, @@ -10965,7 +11382,6 @@ static void AppendCppTypeDefinitionBegin( switch (typeKind) { case TypeKind.Class: - case TypeKind.ManagedStruct: // Only add the base type if it's not System.Object or // there are no interfaces (since they always extend it) string separator = " : virtual "; @@ -11002,6 +11418,9 @@ static void AppendCppTypeDefinitionBegin( } } break; + case TypeKind.ManagedStruct: + output.Append(" : Plugin::ManagedType"); + break; } } output.Append('\n'); @@ -11034,7 +11453,7 @@ static void AppendCppTypeDefinitionBegin( typeParams, output); output.Append( - "(Plugin::InternalUse iu, int32_t handle);\n"); + "(Plugin::InternalUse, int32_t handle);\n"); // Copy constructor AppendIndent(indent + 1, output); @@ -11212,18 +11631,21 @@ static int AppendCppMethodDefinitionsBegin( enclosingTypeName, output); output.Append("(decltype(nullptr))\n"); - string separator = ": "; - foreach (Type interfaceType in interfaceTypes) + if (enclosingTypeKind == TypeKind.Class) { - AppendIndent( - indent + 1, - output); - output.Append(separator); - AppendCppTypeName( - interfaceType, - output); - output.Append("(nullptr)\n"); - separator = ", "; + string separator = ": "; + foreach (Type interfaceType in interfaceTypes) + { + AppendIndent( + indent + 1, + output); + output.Append(separator); + AppendCppTypeName( + interfaceType, + output); + output.Append("(nullptr)\n"); + separator = ", "; + } } AppendIndent(indent, output); output.Append("{\n"); @@ -11245,19 +11667,22 @@ static int AppendCppMethodDefinitionsBegin( AppendTypeNameWithoutGenericSuffix( enclosingTypeName, output); - output.Append("(Plugin::InternalUse iu, int32_t handle)\n"); - separator = ": "; - foreach (Type interfaceType in interfaceTypes) + output.Append("(Plugin::InternalUse, int32_t handle)\n"); + if (enclosingTypeKind == TypeKind.Class) { - AppendIndent( - indent + 1, - output); - output.Append(separator); - AppendCppTypeName( - interfaceType, - output); - output.Append("(nullptr)\n"); - separator = ", "; + string separator = ": "; + foreach (Type interfaceType in interfaceTypes) + { + AppendIndent( + indent + 1, + output); + output.Append(separator); + AppendCppTypeName( + interfaceType, + output); + output.Append("(nullptr)\n"); + separator = ", "; + } } AppendIndent(indent, output); output.Append("{\n"); @@ -12390,7 +12815,7 @@ static void AppendCppMethodDefinitionBegin( string enclosingTypeName, Type returnType, string methodName, - Type[] typeTypeParams, + Type[] enclosingTypeTypeParams, Type[] methodTypeParams, ParameterInfo[] parameters, int indent, @@ -12421,7 +12846,7 @@ static void AppendCppMethodDefinitionBegin( enclosingTypeName, output); AppendCppTypeParameters( - typeTypeParams, + enclosingTypeTypeParams, output); output.Append("::"); @@ -12532,10 +12957,21 @@ static void AppendCppPluginFunctionCall( switch (param.Kind) { case TypeKind.FullStruct: - case TypeKind.Primitive: case TypeKind.Enum: output.Append(param.Name); break; + case TypeKind.Primitive: + if (param.IsOut || param.IsRef) + { + output.Append("&"); + output.Append(param.Name); + output.Append("->Value"); + } + else + { + output.Append(param.Name); + } + break; default: if (param.IsOut || param.IsRef) { @@ -12714,6 +13150,14 @@ static void AppendCppFunctionPointer( switch (param.Kind) { case TypeKind.Primitive: + AppendCppPrimitiveTypeName( + param.DereferencedParameterType, + output); + if (param.IsOut || param.IsRef) + { + output.Append('*'); + } + break; case TypeKind.Enum: AppendCppTypeName( param.DereferencedParameterType, @@ -12950,35 +13394,35 @@ static void AppendCppTypeName( } else if (type == typeof(sbyte)) { - output.Append("int8_t"); + output.Append("System::SByte"); } else if (type == typeof(byte)) { - output.Append("uint8_t"); + output.Append("System::Byte"); } else if (type == typeof(short)) { - output.Append("int16_t"); + output.Append("System::Int16"); } else if (type == typeof(ushort)) { - output.Append("uint16_t"); + output.Append("System::UInt16"); } else if (type == typeof(int)) { - output.Append("int32_t"); + output.Append("System::Int32"); } else if (type == typeof(uint)) { - output.Append("uint32_t"); + output.Append("System::UInt32"); } else if (type == typeof(long)) { - output.Append("int64_t"); + output.Append("System::Int64"); } else if (type == typeof(ulong)) { - output.Append("uint64_t"); + output.Append("System::UInt64"); } else if (type == typeof(char)) { @@ -12986,11 +13430,11 @@ static void AppendCppTypeName( } else if (type == typeof(float)) { - output.Append("float"); + output.Append("System::Single"); } else if (type == typeof(double)) { - output.Append("double"); + output.Append("System::Double"); } else if (type == typeof(string)) { @@ -13059,6 +13503,72 @@ static void AppendCppTypeName( output); } + static void AppendCppPrimitiveTypeName( + Type type, + StringBuilder output) + { + if (type == typeof(void)) + { + output.Append("void"); + } + else if (type == typeof(bool)) + { + output.Append("uint32_t"); // C# bool is 4 bytes + } + else if (type == typeof(sbyte)) + { + output.Append("int8_t"); + } + else if (type == typeof(byte)) + { + output.Append("uint8_t"); + } + else if (type == typeof(short)) + { + output.Append("int16_t"); + } + else if (type == typeof(ushort)) + { + output.Append("uint16_t"); + } + else if (type == typeof(int)) + { + output.Append("int32_t"); + } + else if (type == typeof(uint)) + { + output.Append("uint32_t"); + } + else if (type == typeof(long)) + { + output.Append("int64_t"); + } + else if (type == typeof(ulong)) + { + output.Append("uint64_t"); + } + else if (type == typeof(char)) + { + output.Append("uint16_t"); // C# char is 2 bytes + } + else if (type == typeof(float)) + { + output.Append("float"); + } + else if (type == typeof(double)) + { + output.Append("double"); + } + else if (type == typeof(IntPtr)) + { + output.Append("void*"); + } + else + { + throw new Exception(type + " is not a C++ primitive"); + } + } + static void RemoveTrailingChars( StringBuilders builders) { @@ -13084,7 +13594,7 @@ static void RemoveTrailingChars( RemoveTrailingChars(builders.CppInitBodyFirstBoot); RemoveTrailingChars(builders.CppMonoBehaviourMessages); RemoveTrailingChars(builders.CppGlobalStateAndFunctions); - RemoveTrailingChars(builders.CppBoxingMethodDeclarations); + RemoveTrailingChars(builders.CppUnboxingMethodDeclarations); } // Remove trailing chars (e.g. commas) for last elements @@ -13227,9 +13737,9 @@ static void InjectBuilders( builders.CppGlobalStateAndFunctions.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN BOXING METHOD DECLARATIONS*/\n", - "\n\t\t/*END BOXING METHOD DECLARATIONS*/", - builders.CppBoxingMethodDeclarations.ToString()); + "/*BEGIN UNBOXING METHOD DECLARATIONS*/\n", + "\n\t\t/*END UNBOXING METHOD DECLARATIONS*/", + builders.CppUnboxingMethodDeclarations.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, "/*BEGIN STRING DEFAULT PARAMETERS*/\n", diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 7e8f7a3..aaf5ac5 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -3,6 +3,23 @@ "DOTNET_DLLS/System.Xml.dll" ], "Types": [ + { + "Name": " System.IFormattable" + }, + { + "Name": " System.IConvertible" + }, + { + "Name": " System.IComparable", + "Methods": [ + { + "Name": "CompareTo", + "ParamTypes": [ + "System.Object" + ] + } + ] + }, { "Name": " System.IDisposable", "Methods": [ @@ -117,6 +134,11 @@ }, { "Name": "UnityEngine.Resolution", + "Constructors": [ + { + "ParamTypes": [] + } + ], "Properties": [ { "Name": "width", @@ -165,158 +187,6 @@ } ] }, - { - "Name": "System.Collections.Generic.IEnumerator`1", - "GenericParams": [ - { - "Types": [ - "System.String" - ] - }, - { - "Types": [ - "System.Int32" - ] - }, - { - "Types": [ - "System.Single" - ] - }, - { - "Types": [ - "UnityEngine.RaycastHit" - ] - }, - { - "Types": [ - "UnityEngine.GradientColorKey" - ] - }, - { - "Types": [ - "UnityEngine.Resolution" - ] - } - ], - "Properties": [ - { - "Name": "Current", - "Get": {} - } - ] - }, - { - "Name": "System.Collections.Generic.IEnumerable`1", - "GenericParams": [ - { - "Types": [ - "System.String" - ] - }, - { - "Types": [ - "System.Int32" - ] - }, - { - "Types": [ - "System.Single" - ] - }, - { - "Types": [ - "UnityEngine.RaycastHit" - ] - }, - { - "Types": [ - "UnityEngine.GradientColorKey" - ] - }, - { - "Types": [ - "UnityEngine.Resolution" - ] - } - ], - "Methods": [ - { - "Name": "GetEnumerator", - "ParamTypes": [] - } - ] - }, - { - "Name": "System.Collections.Generic.ICollection`1", - "GenericParams": [ - { - "Types": [ - "System.String" - ] - }, - { - "Types": [ - "System.Int32" - ] - }, - { - "Types": [ - "System.Single" - ] - }, - { - "Types": [ - "UnityEngine.RaycastHit" - ] - }, - { - "Types": [ - "UnityEngine.GradientColorKey" - ] - }, - { - "Types": [ - "UnityEngine.Resolution" - ] - } - ] - }, - { - "Name": "System.Collections.Generic.IList`1", - "GenericParams": [ - { - "Types": [ - "System.String" - ] - }, - { - "Types": [ - "System.Int32" - ] - }, - { - "Types": [ - "System.Single" - ] - }, - { - "Types": [ - "UnityEngine.RaycastHit" - ] - }, - { - "Types": [ - "UnityEngine.GradientColorKey" - ] - }, - { - "Types": [ - "UnityEngine.Resolution" - ] - } - ] - }, { "Name": "System.Runtime.Serialization.ISerializable" }, @@ -382,6 +252,12 @@ { "Name": "UnityEngine.Experimental.UIElements.IEventHandler" }, + { + "Name": "UnityEngine.Experimental.UIElements.CallbackEventHandler" + }, + { + "Name": "UnityEngine.Experimental.UIElements.Focusable" + }, { "Name": "UnityEngine.Experimental.UIElements.IStyle" }, @@ -602,47 +478,6 @@ } ] }, - { - "Name": "System.Collections.Generic.List`1", - "GenericParams": [ - { - "Types": [ - "System.String" - ] - }, - { - "Types": [ - "System.Int32" - ] - } - ], - "Constructors": [ - { - "ParamTypes": [] - } - ], - "Properties": [ - { - "Name": "Item", - "Get": {}, - "Set": {} - } - ], - "Methods": [ - { - "Name": "Add", - "ParamTypes": [ - "T" - ] - }, - { - "Name": "Sort", - "ParamTypes": [ - "System.Collections.Generic.IComparer`1" - ] - } - ] - }, { "Name": "System.Collections.Generic.LinkedListNode`1", "GenericParams": [ @@ -687,27 +522,6 @@ } ] }, - { - "Name": "System.Collections.ObjectModel.Collection`1", - "GenericParams": [ - { - "Types": [ - "System.Int32" - ] - } - ] - }, - { - "Name": "System.Collections.ObjectModel.KeyedCollection`2", - "GenericParams": [ - { - "Types": [ - "System.String", - "System.Int32" - ] - } - ] - }, { "Name": "System.Exception", "Constructors": [ @@ -958,7 +772,45 @@ "Name": "UnityEngine.Playables.PlayableHandle" }, { - "Name": "UnityEngine.Experimental.UIElements.CallbackEventHandler" + "Name": "UnityEngine.Experimental.UIElements.ITransform" + }, + { + "Name": "UnityEngine.Experimental.UIElements.IUIElementDataWatch" + }, + { + "Name": "UnityEngine.Experimental.UIElements.IVisualElementScheduler" + }, + { + "Name": "System.Collections.Generic.IEnumerator`1", + "GenericParams": [ + { + "Types": [ + "UnityEngine.Experimental.UIElements.VisualElement" + ] + } + ], + "Properties": [ + { + "Name": "Current", + "Get": {} + } + ] + }, + { + "Name": "System.Collections.Generic.IEnumerable`1", + "GenericParams": [ + { + "Types": [ + "UnityEngine.Experimental.UIElements.VisualElement" + ] + } + ], + "Methods": [ + { + "Name": "GetEnumerator", + "ParamTypes": [] + } + ] }, { "Name": "UnityEngine.Experimental.UIElements.VisualElement" @@ -1001,6 +853,220 @@ ] } ] + }, + { + "Name": "System.Collections.Generic.IEnumerator`1", + "GenericParams": [ + { + "Types": [ + "System.String" + ] + }, + { + "Types": [ + "System.Int32" + ] + }, + { + "Types": [ + "System.Single" + ] + }, + { + "Types": [ + "UnityEngine.RaycastHit" + ] + }, + { + "Types": [ + "UnityEngine.GradientColorKey" + ] + }, + { + "Types": [ + "UnityEngine.Resolution" + ] + } + ], + "Properties": [ + { + "Name": "Current", + "Get": {} + } + ] + }, + { + "Name": "System.Collections.Generic.IEnumerable`1", + "GenericParams": [ + { + "Types": [ + "System.String" + ] + }, + { + "Types": [ + "System.Int32" + ] + }, + { + "Types": [ + "System.Single" + ] + }, + { + "Types": [ + "UnityEngine.RaycastHit" + ] + }, + { + "Types": [ + "UnityEngine.GradientColorKey" + ] + }, + { + "Types": [ + "UnityEngine.Resolution" + ] + } + ], + "Methods": [ + { + "Name": "GetEnumerator", + "ParamTypes": [] + } + ] + }, + { + "Name": "System.Collections.Generic.ICollection`1", + "GenericParams": [ + { + "Types": [ + "System.String" + ] + }, + { + "Types": [ + "System.Int32" + ] + }, + { + "Types": [ + "System.Single" + ] + }, + { + "Types": [ + "UnityEngine.RaycastHit" + ] + }, + { + "Types": [ + "UnityEngine.GradientColorKey" + ] + }, + { + "Types": [ + "UnityEngine.Resolution" + ] + } + ] + }, + { + "Name": "System.Collections.Generic.IList`1", + "GenericParams": [ + { + "Types": [ + "System.String" + ] + }, + { + "Types": [ + "System.Int32" + ] + }, + { + "Types": [ + "System.Single" + ] + }, + { + "Types": [ + "UnityEngine.RaycastHit" + ] + }, + { + "Types": [ + "UnityEngine.GradientColorKey" + ] + }, + { + "Types": [ + "UnityEngine.Resolution" + ] + } + ] + }, + { + "Name": "System.Collections.Generic.List`1", + "GenericParams": [ + { + "Types": [ + "System.String" + ] + }, + { + "Types": [ + "System.Int32" + ] + } + ], + "Constructors": [ + { + "ParamTypes": [] + } + ], + "Properties": [ + { + "Name": "Item", + "Get": {}, + "Set": {} + } + ], + "Methods": [ + { + "Name": "Add", + "ParamTypes": [ + "T" + ] + }, + { + "Name": "Sort", + "ParamTypes": [ + "System.Collections.Generic.IComparer`1" + ] + } + ] + }, + { + "Name": "System.Collections.ObjectModel.Collection`1", + "GenericParams": [ + { + "Types": [ + "System.Int32" + ] + } + ] + }, + { + "Name": "System.Collections.ObjectModel.KeyedCollection`2", + "GenericParams": [ + { + "Types": [ + "System.String", + "System.Int32" + ] + } + ] } ], "MonoBehaviours": [ diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index a44f151..796ae83 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -52,7 +52,7 @@ void MyGame::MonoBehaviours::TestScript::Awake() Debug::Log(message); } -void MyGame::MonoBehaviours::TestScript::OnAnimatorIK(int32_t param0) +void MyGame::MonoBehaviours::TestScript::OnAnimatorIK(Int32 param0) { String message("C++ TestScript OnAnimatorIK"); Debug::Log(message); diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 875abad..795eec0 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -31,53 +31,6 @@ #define DLLEXPORT extern "C" #endif -//////////////////////////////////////////////////////////////// -// Global variables -//////////////////////////////////////////////////////////////// - -namespace Plugin -{ - System::String NullString(nullptr); -} - -//////////////////////////////////////////////////////////////// -// Support for using IEnumerable with range for loops -//////////////////////////////////////////////////////////////// - -namespace Plugin -{ - // End iterators are dummies full of null - EnumerableIterator::EnumerableIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - // Begin iterators keep track of an IEnumerator - EnumerableIterator::EnumerableIterator( - System::Collections::IEnumerable& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - EnumerableIterator& EnumerableIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool EnumerableIterator::operator!=(const EnumerableIterator& other) - { - return hasMore; - } - - System::Object EnumerableIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - //////////////////////////////////////////////////////////////// // C# functions for C++ to call //////////////////////////////////////////////////////////////// @@ -91,9 +44,10 @@ namespace Plugin int32_t (*EnumerableGetEnumerator)(int32_t handle); /*BEGIN FUNCTION POINTERS*/ + System::Int32 (*SystemIComparableMethodCompareToSystemObject)(int32_t thisHandle, int32_t objHandle); void (*SystemIDisposableMethodDispose)(int32_t thisHandle); UnityEngine::Vector3 (*UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z); - float (*UnityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz); + System::Single (*UnityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz); void (*UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ); UnityEngine::Vector3 (*UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b); UnityEngine::Vector3 (*UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a); @@ -112,11 +66,12 @@ namespace Plugin int32_t (*BoxGradientColorKey)(UnityEngine::GradientColorKey& val); UnityEngine::GradientColorKey (*UnboxGradientColorKey)(int32_t valHandle); void (*ReleaseUnityEngineResolution)(int32_t handle); - int32_t (*UnityEngineResolutionPropertyGetWidth)(int32_t thisHandle); + int32_t (*UnityEngineResolutionConstructor)(); + System::Int32 (*UnityEngineResolutionPropertyGetWidth)(int32_t thisHandle); void (*UnityEngineResolutionPropertySetWidth)(int32_t thisHandle, int32_t value); - int32_t (*UnityEngineResolutionPropertyGetHeight)(int32_t thisHandle); + System::Int32 (*UnityEngineResolutionPropertyGetHeight)(int32_t thisHandle); void (*UnityEngineResolutionPropertySetHeight)(int32_t thisHandle, int32_t value); - int32_t (*UnityEngineResolutionPropertyGetRefreshRate)(int32_t thisHandle); + System::Int32 (*UnityEngineResolutionPropertyGetRefreshRate)(int32_t thisHandle); void (*UnityEngineResolutionPropertySetRefreshRate)(int32_t thisHandle, int32_t value); int32_t (*BoxResolution)(int32_t valHandle); int32_t (*UnboxResolution)(int32_t valHandle); @@ -128,27 +83,15 @@ namespace Plugin int32_t (*UnboxRaycastHit)(int32_t valHandle); int32_t (*SystemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle); int32_t (*SystemCollectionsIEnumeratorMethodMoveNext)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent)(int32_t thisHandle); - float (*SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent)(int32_t thisHandle); - UnityEngine::GradientColorKey (*SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator)(int32_t thisHandle); void (*ReleaseUnityEnginePlayablesPlayableGraph)(int32_t handle); int32_t (*BoxPlayableGraph)(int32_t valHandle); int32_t (*UnboxPlayableGraph)(int32_t valHandle); void (*ReleaseUnityEngineAnimationsAnimationMixerPlayable)(int32_t handle); - int32_t (*UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)(int32_t graphHandle, int32_t inputCount, System::Boolean normalizeWeights); + int32_t (*UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)(int32_t graphHandle, int32_t inputCount, uint32_t normalizeWeights); int32_t (*BoxAnimationMixerPlayable)(int32_t valHandle); int32_t (*UnboxAnimationMixerPlayable)(int32_t valHandle); int32_t (*SystemDiagnosticsStopwatchConstructor)(); - int64_t (*SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle); + System::Int64 (*SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle); void (*SystemDiagnosticsStopwatchMethodStart)(int32_t thisHandle); void (*SystemDiagnosticsStopwatchMethodReset)(int32_t thisHandle); int32_t (*UnityEngineGameObjectConstructor)(); @@ -159,7 +102,7 @@ namespace Plugin int32_t (*UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)(UnityEngine::PrimitiveType type); void (*UnityEngineDebugMethodLogSystemObject)(int32_t messageHandle); int32_t (*UnityEngineAssertionsAssertFieldGetRaiseExceptions)(); - void (*UnityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value); + void (*UnityEngineAssertionsAssertFieldSetRaiseExceptions)(uint32_t value); void (*UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString)(int32_t expectedHandle, int32_t actualHandle); void (*UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject)(int32_t expectedHandle, int32_t actualHandle); int32_t (*UnityEngineMonoBehaviourPropertyGetTransform)(int32_t thisHandle); @@ -168,7 +111,7 @@ namespace Plugin void (*UnityEngineNetworkingNetworkTransportMethodInit)(); int32_t (*BoxQuaternion)(UnityEngine::Quaternion& val); UnityEngine::Quaternion (*UnboxQuaternion)(int32_t valHandle); - float (*UnityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column); + System::Single (*UnityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column); void (*UnityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value); int32_t (*BoxMatrix4x4)(UnityEngine::Matrix4x4& val); UnityEngine::Matrix4x4 (*UnboxMatrix4x4)(int32_t valHandle); @@ -177,19 +120,9 @@ namespace Plugin void (*ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)(int32_t handle); int32_t (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble)(int32_t keyHandle, double value); int32_t (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)(int32_t thisHandle); - double (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle); + System::Double (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle); int32_t (*BoxKeyValuePairSystemString_SystemDouble)(int32_t valHandle); int32_t (*UnboxKeyValuePairSystemString_SystemDouble)(int32_t valHandle); - int32_t (*SystemCollectionsGenericListSystemStringConstructor)(); - int32_t (*SystemCollectionsGenericListSystemStringPropertyGetItem)(int32_t thisHandle, int32_t index); - void (*SystemCollectionsGenericListSystemStringPropertySetItem)(int32_t thisHandle, int32_t index, int32_t valueHandle); - void (*SystemCollectionsGenericListSystemStringMethodAddSystemString)(int32_t thisHandle, int32_t itemHandle); - void (*SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle); - int32_t (*SystemCollectionsGenericListSystemInt32Constructor)(); - int32_t (*SystemCollectionsGenericListSystemInt32PropertyGetItem)(int32_t thisHandle, int32_t index); - void (*SystemCollectionsGenericListSystemInt32PropertySetItem)(int32_t thisHandle, int32_t index, int32_t value); - void (*SystemCollectionsGenericListSystemInt32MethodAddSystemInt32)(int32_t thisHandle, int32_t item); - void (*SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle); int32_t (*SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)(int32_t valueHandle); int32_t (*SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue)(int32_t thisHandle); void (*SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue)(int32_t thisHandle, int32_t valueHandle); @@ -202,7 +135,7 @@ namespace Plugin int32_t (*UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); int32_t (*BoxRay)(int32_t valHandle); int32_t (*UnboxRay)(int32_t valHandle); - int32_t (*UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1)(int32_t rayHandle, int32_t resultsHandle); + System::Int32 (*UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1)(int32_t rayHandle, int32_t resultsHandle); int32_t (*UnityEnginePhysicsMethodRaycastAllUnityEngineRay)(int32_t rayHandle); int32_t (*UnityEngineGradientConstructor)(); int32_t (*UnityEngineGradientPropertyGetColorKeys)(int32_t thisHandle); @@ -221,7 +154,7 @@ namespace Plugin UnityEngine::SceneManagement::LoadSceneMode (*UnboxLoadSceneMode)(int32_t valHandle); int32_t (*BoxPrimitiveType)(UnityEngine::PrimitiveType val); UnityEngine::PrimitiveType (*UnboxPrimitiveType)(int32_t valHandle); - float (*UnityEngineTimePropertyGetDeltaTime)(); + System::Single (*UnityEngineTimePropertyGetDeltaTime)(); int32_t (*BoxFileMode)(System::IO::FileMode val); System::IO::FileMode (*UnboxFileMode)(int32_t valHandle); void (*ReleaseSystemCollectionsGenericBaseIComparerSystemInt32)(int32_t handle); @@ -230,7 +163,7 @@ namespace Plugin void (*SystemCollectionsGenericBaseIComparerSystemStringConstructor)(int32_t cppHandle, int32_t* handle); void (*ReleaseSystemBaseStringComparer)(int32_t handle); void (*SystemBaseStringComparerConstructor)(int32_t cppHandle, int32_t* handle); - int32_t (*SystemCollectionsQueuePropertyGetCount)(int32_t thisHandle); + System::Int32 (*SystemCollectionsQueuePropertyGetCount)(int32_t thisHandle); void (*ReleaseSystemCollectionsBaseQueue)(int32_t handle); void (*SystemCollectionsBaseQueueConstructor)(int32_t cppHandle, int32_t* handle); void (*ReleaseSystemComponentModelDesignBaseIComponentChangeService)(int32_t handle); @@ -242,6 +175,8 @@ namespace Plugin void (*ReleaseUnityEnginePlayablesPlayableHandle)(int32_t handle); int32_t (*BoxPlayableHandle)(int32_t valHandle); int32_t (*UnboxPlayableHandle)(int32_t valHandle); + int32_t (*SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator)(int32_t thisHandle); int32_t (*UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1)(int32_t eHandle, int32_t nameHandle, int32_t classesHandle); int32_t (*UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString)(int32_t eHandle, int32_t nameHandle, int32_t classNameHandle); int32_t (*BoxInteractionSourcePositionAccuracy)(UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy val); @@ -252,43 +187,65 @@ namespace Plugin int32_t (*UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode)(int32_t thisHandle, UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node); int32_t (*BoxInteractionSourcePose)(int32_t valHandle); int32_t (*UnboxInteractionSourcePose)(int32_t valHandle); - int32_t (*BoxBoolean)(System::Boolean val); + int32_t (*SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent)(int32_t thisHandle); + System::Int32 (*SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent)(int32_t thisHandle); + System::Single (*SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent)(int32_t thisHandle); + UnityEngine::GradientColorKey (*SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator)(int32_t thisHandle); + int32_t (*SystemCollectionsGenericListSystemStringConstructor)(); + int32_t (*SystemCollectionsGenericListSystemStringPropertyGetItem)(int32_t thisHandle, int32_t index); + void (*SystemCollectionsGenericListSystemStringPropertySetItem)(int32_t thisHandle, int32_t index, int32_t valueHandle); + void (*SystemCollectionsGenericListSystemStringMethodAddSystemString)(int32_t thisHandle, int32_t itemHandle); + void (*SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle); + int32_t (*SystemCollectionsGenericListSystemInt32Constructor)(); + System::Int32 (*SystemCollectionsGenericListSystemInt32PropertyGetItem)(int32_t thisHandle, int32_t index); + void (*SystemCollectionsGenericListSystemInt32PropertySetItem)(int32_t thisHandle, int32_t index, int32_t value); + void (*SystemCollectionsGenericListSystemInt32MethodAddSystemInt32)(int32_t thisHandle, int32_t item); + void (*SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle); + int32_t (*BoxBoolean)(uint32_t val); int32_t (*UnboxBoolean)(int32_t valHandle); int32_t (*BoxSByte)(int8_t val); - int8_t (*UnboxSByte)(int32_t valHandle); + System::SByte (*UnboxSByte)(int32_t valHandle); int32_t (*BoxByte)(uint8_t val); - uint8_t (*UnboxByte)(int32_t valHandle); + System::Byte (*UnboxByte)(int32_t valHandle); int32_t (*BoxInt16)(int16_t val); - int16_t (*UnboxInt16)(int32_t valHandle); + System::Int16 (*UnboxInt16)(int32_t valHandle); int32_t (*BoxUInt16)(uint16_t val); - uint16_t (*UnboxUInt16)(int32_t valHandle); + System::UInt16 (*UnboxUInt16)(int32_t valHandle); int32_t (*BoxInt32)(int32_t val); - int32_t (*UnboxInt32)(int32_t valHandle); + System::Int32 (*UnboxInt32)(int32_t valHandle); int32_t (*BoxUInt32)(uint32_t val); - uint32_t (*UnboxUInt32)(int32_t valHandle); + System::UInt32 (*UnboxUInt32)(int32_t valHandle); int32_t (*BoxInt64)(int64_t val); - int64_t (*UnboxInt64)(int32_t valHandle); + System::Int64 (*UnboxInt64)(int32_t valHandle); int32_t (*BoxUInt64)(uint64_t val); - uint64_t (*UnboxUInt64)(int32_t valHandle); - int32_t (*BoxChar)(System::Char val); + System::UInt64 (*UnboxUInt64)(int32_t valHandle); + int32_t (*BoxChar)(uint16_t val); int16_t (*UnboxChar)(int32_t valHandle); int32_t (*BoxSingle)(float val); - float (*UnboxSingle)(int32_t valHandle); + System::Single (*UnboxSingle)(int32_t valHandle); int32_t (*BoxDouble)(double val); - double (*UnboxDouble)(int32_t valHandle); + System::Double (*UnboxDouble)(int32_t valHandle); int32_t (*SystemSystemInt32Array1Constructor1)(int32_t length0); - int32_t (*SystemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0); + System::Int32 (*SystemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*SystemInt32Array1SetItem1)(int32_t thisHandle, int32_t index0, int32_t item); int32_t (*SystemSystemSingleArray1Constructor1)(int32_t length0); - float (*SystemSingleArray1GetItem1)(int32_t thisHandle, int32_t index0); + System::Single (*SystemSingleArray1GetItem1)(int32_t thisHandle, int32_t index0); int32_t (*SystemSingleArray1SetItem1)(int32_t thisHandle, int32_t index0, float item); int32_t (*SystemSystemSingleArray2Constructor2)(int32_t length0, int32_t length1); int32_t (*SystemSystemSingleArray2GetLength2)(int32_t thisHandle, int32_t dimension); - float (*SystemSingleArray2GetItem2)(int32_t thisHandle, int32_t index0, int32_t index1); + System::Single (*SystemSingleArray2GetItem2)(int32_t thisHandle, int32_t index0, int32_t index1); int32_t (*SystemSingleArray2SetItem2)(int32_t thisHandle, int32_t index0, int32_t index1, float item); int32_t (*SystemSystemSingleArray3Constructor3)(int32_t length0, int32_t length1, int32_t length2); int32_t (*SystemSystemSingleArray3GetLength3)(int32_t thisHandle, int32_t dimension); - float (*SystemSingleArray3GetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2); + System::Single (*SystemSingleArray3GetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2); int32_t (*SystemSingleArray3SetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2, float item); int32_t (*SystemSystemStringArray1Constructor1)(int32_t length0); int32_t (*SystemStringArray1GetItem1)(int32_t thisHandle, int32_t index0); @@ -321,7 +278,7 @@ namespace Plugin void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd)(int32_t thisHandle, int32_t delHandle); void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove)(int32_t thisHandle, int32_t delHandle); - double (*SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)(int32_t thisHandle, int32_t arg1, float arg2); + System::Double (*SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)(int32_t thisHandle, int32_t arg1, float arg2); void (*ReleaseSystemFuncSystemInt16_SystemInt32_SystemString)(int32_t handle, int32_t classHandle); void (*SystemFuncSystemInt16_SystemInt32_SystemStringConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); void (*SystemFuncSystemInt16_SystemInt32_SystemStringAdd)(int32_t thisHandle, int32_t delHandle); @@ -366,4343 +323,3011 @@ namespace Plugin } //////////////////////////////////////////////////////////////// -// Reference counting of managed objects +// Global variables //////////////////////////////////////////////////////////////// namespace Plugin { - int32_t RefCountsLenClass; - int32_t* RefCountsClass; + System::String NullString(nullptr); +} - void ReferenceManagedClass(int32_t handle) +//////////////////////////////////////////////////////////////// +// Plugin Types +//////////////////////////////////////////////////////////////// + +namespace Plugin +{ + ManagedType::ManagedType() + : Handle(0) + { + } + + ManagedType::ManagedType(decltype(nullptr)) + : Handle(0) + { + } + + ManagedType::ManagedType(Plugin::InternalUse iu, int32_t handle) + : Handle(handle) { - assert(handle >= 0 && handle < RefCountsLenClass); - if (handle != 0) - { - RefCountsClass[handle]++; - } } +} - void DereferenceManagedClass(int32_t handle) +//////////////////////////////////////////////////////////////// +// C# Primitive Types +//////////////////////////////////////////////////////////////// + +namespace System +{ + Boolean::Boolean() + : Value(0) { - assert(handle >= 0 && handle < RefCountsLenClass); - if (handle != 0) - { - int32_t numRemain = --RefCountsClass[handle]; - if (numRemain == 0) - { - ReleaseObject(handle); - } - } } - bool DereferenceManagedClassNoRelease(int32_t handle) + Boolean::Boolean(bool value) + : Value((int32_t)value) { - assert(handle >= 0 && handle < RefCountsLenClass); - if (handle != 0) - { - int32_t numRemain = --RefCountsClass[handle]; - if (numRemain == 0) - { - return true; - } - } - return false; } - /*BEGIN GLOBAL STATE AND FUNCTIONS*/ - int32_t RefCountsLenUnityEngineResolution; - int32_t* RefCountsUnityEngineResolution; + Boolean::Boolean(int32_t value) + : Value(value) + { + } - void ReferenceManagedUnityEngineResolution(int32_t handle) + Boolean::Boolean(uint32_t value) + : Value(value) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineResolution); - if (handle != 0) - { - RefCountsUnityEngineResolution[handle]++; - } } - void DereferenceManagedUnityEngineResolution(int32_t handle) + Boolean::operator bool() const { - assert(handle >= 0 && handle < RefCountsLenUnityEngineResolution); - if (handle != 0) - { - int32_t numRemain = --RefCountsUnityEngineResolution[handle]; - if (numRemain == 0) - { - ReleaseUnityEngineResolution(handle); - } - } + return (bool)Value; } - int32_t RefCountsLenUnityEngineRaycastHit; - int32_t* RefCountsUnityEngineRaycastHit; + Boolean::operator int32_t() const + { + return Value; + } - void ReferenceManagedUnityEngineRaycastHit(int32_t handle) + Boolean::operator uint32_t() const { - assert(handle >= 0 && handle < RefCountsLenUnityEngineRaycastHit); - if (handle != 0) - { - RefCountsUnityEngineRaycastHit[handle]++; - } + return Value; } - void DereferenceManagedUnityEngineRaycastHit(int32_t handle) + Boolean::operator Object() const { - assert(handle >= 0 && handle < RefCountsLenUnityEngineRaycastHit); - if (handle != 0) - { - int32_t numRemain = --RefCountsUnityEngineRaycastHit[handle]; - if (numRemain == 0) - { - ReleaseUnityEngineRaycastHit(handle); - } - } + return Object(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value)); } - int32_t RefCountsLenUnityEnginePlayablesPlayableGraph; - int32_t* RefCountsUnityEnginePlayablesPlayableGraph; + Boolean::operator ValueType() const + { + return ValueType(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value)); + } - void ReferenceManagedUnityEnginePlayablesPlayableGraph(int32_t handle) + Boolean::operator IComparable() const { - assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableGraph); - if (handle != 0) - { - RefCountsUnityEnginePlayablesPlayableGraph[handle]++; - } + return IComparable(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value)); } - void DereferenceManagedUnityEnginePlayablesPlayableGraph(int32_t handle) + Boolean::operator IFormattable() const { - assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableGraph); - if (handle != 0) - { - int32_t numRemain = --RefCountsUnityEnginePlayablesPlayableGraph[handle]; - if (numRemain == 0) - { - ReleaseUnityEnginePlayablesPlayableGraph(handle); - } - } + return IFormattable(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value)); } - int32_t RefCountsLenUnityEngineAnimationsAnimationMixerPlayable; - int32_t* RefCountsUnityEngineAnimationsAnimationMixerPlayable; + Boolean::operator IConvertible() const + { + return IConvertible(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value)); + } - void ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(int32_t handle) + Char::Char() + : Value(0) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineAnimationsAnimationMixerPlayable); - if (handle != 0) - { - RefCountsUnityEngineAnimationsAnimationMixerPlayable[handle]++; - } } - void DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(int32_t handle) + Char::Char(char value) + : Value(value) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineAnimationsAnimationMixerPlayable); - if (handle != 0) - { - int32_t numRemain = --RefCountsUnityEngineAnimationsAnimationMixerPlayable[handle]; - if (numRemain == 0) - { - ReleaseUnityEngineAnimationsAnimationMixerPlayable(handle); - } - } } - int32_t RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; - int32_t* RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; + Char::Char(int16_t value) + : Value(value) + { + } - void ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int32_t handle) + Char::operator int16_t() const { - assert(handle >= 0 && handle < RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble); - if (handle != 0) - { - RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble[handle]++; - } + return Value; } - void DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int32_t handle) + Char::operator Object() const { - assert(handle >= 0 && handle < RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble); - if (handle != 0) - { - int32_t numRemain = --RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble[handle]; - if (numRemain == 0) - { - ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(handle); - } - } + return Object(Plugin::InternalUse::Only, Plugin::BoxChar(Value)); } - int32_t RefCountsLenUnityEngineRay; - int32_t* RefCountsUnityEngineRay; + Char::operator ValueType() const + { + return ValueType(Plugin::InternalUse::Only, Plugin::BoxChar(Value)); + } - void ReferenceManagedUnityEngineRay(int32_t handle) + Char::operator IComparable() const { - assert(handle >= 0 && handle < RefCountsLenUnityEngineRay); - if (handle != 0) - { - RefCountsUnityEngineRay[handle]++; - } + return IComparable(Plugin::InternalUse::Only, Plugin::BoxChar(Value)); } - void DereferenceManagedUnityEngineRay(int32_t handle) + Char::operator IFormattable() const { - assert(handle >= 0 && handle < RefCountsLenUnityEngineRay); - if (handle != 0) - { - int32_t numRemain = --RefCountsUnityEngineRay[handle]; - if (numRemain == 0) - { - ReleaseUnityEngineRay(handle); - } - } + return IFormattable(Plugin::InternalUse::Only, Plugin::BoxChar(Value)); } - int32_t RefCountsLenUnityEngineSceneManagementScene; - int32_t* RefCountsUnityEngineSceneManagementScene; - - void ReferenceManagedUnityEngineSceneManagementScene(int32_t handle) + Char::operator IConvertible() const { - assert(handle >= 0 && handle < RefCountsLenUnityEngineSceneManagementScene); - if (handle != 0) - { - RefCountsUnityEngineSceneManagementScene[handle]++; - } + return IConvertible(Plugin::InternalUse::Only, Plugin::BoxChar(Value)); } - - void DereferenceManagedUnityEngineSceneManagementScene(int32_t handle) + + SByte::SByte() + : Value(0) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineSceneManagementScene); - if (handle != 0) - { - int32_t numRemain = --RefCountsUnityEngineSceneManagementScene[handle]; - if (numRemain == 0) - { - ReleaseUnityEngineSceneManagementScene(handle); - } - } } - int32_t SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize; - System::Collections::Generic::BaseIComparer** SystemCollectionsGenericBaseIComparerSystemInt32FreeList; - System::Collections::Generic::BaseIComparer** NextFreeSystemCollectionsGenericBaseIComparerSystemInt32; + SByte::SByte(int8_t val) + : Value(val) + { + } - int32_t StoreSystemCollectionsGenericBaseIComparerSystemInt32(System::Collections::Generic::BaseIComparer* del) + SByte::operator int8_t() const { - assert(NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 != nullptr); - System::Collections::Generic::BaseIComparer** pNext = NextFreeSystemCollectionsGenericBaseIComparerSystemInt32; - NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 = (System::Collections::Generic::BaseIComparer**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemCollectionsGenericBaseIComparerSystemInt32FreeList); + return Value; } - System::Collections::Generic::BaseIComparer* GetSystemCollectionsGenericBaseIComparerSystemInt32(int32_t handle) + SByte::operator Object() const { - assert(handle >= 0 && handle < SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize); - return SystemCollectionsGenericBaseIComparerSystemInt32FreeList[handle]; + return Object(Plugin::InternalUse::Only, Plugin::BoxSByte(Value)); } - void RemoveSystemCollectionsGenericBaseIComparerSystemInt32(int32_t handle) + SByte::operator ValueType() const { - System::Collections::Generic::BaseIComparer** pRelease = SystemCollectionsGenericBaseIComparerSystemInt32FreeList + handle; - *pRelease = (System::Collections::Generic::BaseIComparer*)NextFreeSystemCollectionsGenericBaseIComparerSystemInt32; - NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 = pRelease; + return ValueType(Plugin::InternalUse::Only, Plugin::BoxSByte(Value)); } - int32_t SystemCollectionsGenericBaseIComparerSystemStringFreeListSize; - System::Collections::Generic::BaseIComparer** SystemCollectionsGenericBaseIComparerSystemStringFreeList; - System::Collections::Generic::BaseIComparer** NextFreeSystemCollectionsGenericBaseIComparerSystemString; - int32_t StoreSystemCollectionsGenericBaseIComparerSystemString(System::Collections::Generic::BaseIComparer* del) + SByte::operator IComparable() const { - assert(NextFreeSystemCollectionsGenericBaseIComparerSystemString != nullptr); - System::Collections::Generic::BaseIComparer** pNext = NextFreeSystemCollectionsGenericBaseIComparerSystemString; - NextFreeSystemCollectionsGenericBaseIComparerSystemString = (System::Collections::Generic::BaseIComparer**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemCollectionsGenericBaseIComparerSystemStringFreeList); + return IComparable(Plugin::InternalUse::Only, Plugin::BoxSByte(Value)); } - System::Collections::Generic::BaseIComparer* GetSystemCollectionsGenericBaseIComparerSystemString(int32_t handle) + SByte::operator IFormattable() const { - assert(handle >= 0 && handle < SystemCollectionsGenericBaseIComparerSystemStringFreeListSize); - return SystemCollectionsGenericBaseIComparerSystemStringFreeList[handle]; + return IFormattable(Plugin::InternalUse::Only, Plugin::BoxSByte(Value)); } - void RemoveSystemCollectionsGenericBaseIComparerSystemString(int32_t handle) + SByte::operator IConvertible() const + { + return IConvertible(Plugin::InternalUse::Only, Plugin::BoxSByte(Value)); + } + + Byte::Byte() + : Value(0) { - System::Collections::Generic::BaseIComparer** pRelease = SystemCollectionsGenericBaseIComparerSystemStringFreeList + handle; - *pRelease = (System::Collections::Generic::BaseIComparer*)NextFreeSystemCollectionsGenericBaseIComparerSystemString; - NextFreeSystemCollectionsGenericBaseIComparerSystemString = pRelease; } - int32_t SystemBaseStringComparerFreeListSize; - System::BaseStringComparer** SystemBaseStringComparerFreeList; - System::BaseStringComparer** NextFreeSystemBaseStringComparer; - int32_t StoreSystemBaseStringComparer(System::BaseStringComparer* del) + Byte::Byte(uint8_t value) + : Value(value) { - assert(NextFreeSystemBaseStringComparer != nullptr); - System::BaseStringComparer** pNext = NextFreeSystemBaseStringComparer; - NextFreeSystemBaseStringComparer = (System::BaseStringComparer**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemBaseStringComparerFreeList); } - System::BaseStringComparer* GetSystemBaseStringComparer(int32_t handle) + Byte::operator uint8_t() const { - assert(handle >= 0 && handle < SystemBaseStringComparerFreeListSize); - return SystemBaseStringComparerFreeList[handle]; + return Value; } - void RemoveSystemBaseStringComparer(int32_t handle) + Byte::operator Object() const { - System::BaseStringComparer** pRelease = SystemBaseStringComparerFreeList + handle; - *pRelease = (System::BaseStringComparer*)NextFreeSystemBaseStringComparer; - NextFreeSystemBaseStringComparer = pRelease; + return Object(Plugin::InternalUse::Only, Plugin::BoxByte(Value)); } - int32_t SystemCollectionsBaseQueueFreeListSize; - System::Collections::BaseQueue** SystemCollectionsBaseQueueFreeList; - System::Collections::BaseQueue** NextFreeSystemCollectionsBaseQueue; - int32_t StoreSystemCollectionsBaseQueue(System::Collections::BaseQueue* del) + Byte::operator ValueType() const { - assert(NextFreeSystemCollectionsBaseQueue != nullptr); - System::Collections::BaseQueue** pNext = NextFreeSystemCollectionsBaseQueue; - NextFreeSystemCollectionsBaseQueue = (System::Collections::BaseQueue**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemCollectionsBaseQueueFreeList); + return ValueType(Plugin::InternalUse::Only, Plugin::BoxByte(Value)); } - System::Collections::BaseQueue* GetSystemCollectionsBaseQueue(int32_t handle) + Byte::operator IComparable() const { - assert(handle >= 0 && handle < SystemCollectionsBaseQueueFreeListSize); - return SystemCollectionsBaseQueueFreeList[handle]; + return IComparable(Plugin::InternalUse::Only, Plugin::BoxByte(Value)); } - void RemoveSystemCollectionsBaseQueue(int32_t handle) + Byte::operator IFormattable() const { - System::Collections::BaseQueue** pRelease = SystemCollectionsBaseQueueFreeList + handle; - *pRelease = (System::Collections::BaseQueue*)NextFreeSystemCollectionsBaseQueue; - NextFreeSystemCollectionsBaseQueue = pRelease; + return IFormattable(Plugin::InternalUse::Only, Plugin::BoxByte(Value)); } - int32_t SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize; - System::ComponentModel::Design::BaseIComponentChangeService** SystemComponentModelDesignBaseIComponentChangeServiceFreeList; - System::ComponentModel::Design::BaseIComponentChangeService** NextFreeSystemComponentModelDesignBaseIComponentChangeService; - int32_t StoreSystemComponentModelDesignBaseIComponentChangeService(System::ComponentModel::Design::BaseIComponentChangeService* del) + Byte::operator IConvertible() const + { + return IConvertible(Plugin::InternalUse::Only, Plugin::BoxByte(Value)); + } + + Int16::Int16() + : Value(0) { - assert(NextFreeSystemComponentModelDesignBaseIComponentChangeService != nullptr); - System::ComponentModel::Design::BaseIComponentChangeService** pNext = NextFreeSystemComponentModelDesignBaseIComponentChangeService; - NextFreeSystemComponentModelDesignBaseIComponentChangeService = (System::ComponentModel::Design::BaseIComponentChangeService**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemComponentModelDesignBaseIComponentChangeServiceFreeList); } - System::ComponentModel::Design::BaseIComponentChangeService* GetSystemComponentModelDesignBaseIComponentChangeService(int32_t handle) + Int16::Int16(int16_t value) + : Value(value) { - assert(handle >= 0 && handle < SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize); - return SystemComponentModelDesignBaseIComponentChangeServiceFreeList[handle]; } - void RemoveSystemComponentModelDesignBaseIComponentChangeService(int32_t handle) + Int16::operator int16_t() const { - System::ComponentModel::Design::BaseIComponentChangeService** pRelease = SystemComponentModelDesignBaseIComponentChangeServiceFreeList + handle; - *pRelease = (System::ComponentModel::Design::BaseIComponentChangeService*)NextFreeSystemComponentModelDesignBaseIComponentChangeService; - NextFreeSystemComponentModelDesignBaseIComponentChangeService = pRelease; + return Value; } - int32_t SystemIOBaseFileStreamFreeListSize; - System::IO::BaseFileStream** SystemIOBaseFileStreamFreeList; - System::IO::BaseFileStream** NextFreeSystemIOBaseFileStream; - int32_t StoreSystemIOBaseFileStream(System::IO::BaseFileStream* del) + Int16::operator Object() const { - assert(NextFreeSystemIOBaseFileStream != nullptr); - System::IO::BaseFileStream** pNext = NextFreeSystemIOBaseFileStream; - NextFreeSystemIOBaseFileStream = (System::IO::BaseFileStream**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemIOBaseFileStreamFreeList); + return Object(Plugin::InternalUse::Only, Plugin::BoxInt16(Value)); } - System::IO::BaseFileStream* GetSystemIOBaseFileStream(int32_t handle) + Int16::operator ValueType() const { - assert(handle >= 0 && handle < SystemIOBaseFileStreamFreeListSize); - return SystemIOBaseFileStreamFreeList[handle]; + return ValueType(Plugin::InternalUse::Only, Plugin::BoxInt16(Value)); } - void RemoveSystemIOBaseFileStream(int32_t handle) + Int16::operator IComparable() const { - System::IO::BaseFileStream** pRelease = SystemIOBaseFileStreamFreeList + handle; - *pRelease = (System::IO::BaseFileStream*)NextFreeSystemIOBaseFileStream; - NextFreeSystemIOBaseFileStream = pRelease; + return IComparable(Plugin::InternalUse::Only, Plugin::BoxInt16(Value)); } - int32_t RefCountsLenUnityEnginePlayablesPlayableHandle; - int32_t* RefCountsUnityEnginePlayablesPlayableHandle; - void ReferenceManagedUnityEnginePlayablesPlayableHandle(int32_t handle) + Int16::operator IFormattable() const { - assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableHandle); - if (handle != 0) - { - RefCountsUnityEnginePlayablesPlayableHandle[handle]++; - } + return IFormattable(Plugin::InternalUse::Only, Plugin::BoxInt16(Value)); } - void DereferenceManagedUnityEnginePlayablesPlayableHandle(int32_t handle) + Int16::operator IConvertible() const + { + return IConvertible(Plugin::InternalUse::Only, Plugin::BoxInt16(Value)); + } + + UInt16::UInt16() + : Value(0) { - assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableHandle); - if (handle != 0) - { - int32_t numRemain = --RefCountsUnityEnginePlayablesPlayableHandle[handle]; - if (numRemain == 0) - { - ReleaseUnityEnginePlayablesPlayableHandle(handle); - } - } } - int32_t RefCountsLenUnityEngineXRWSAInputInteractionSourcePose; - int32_t* RefCountsUnityEngineXRWSAInputInteractionSourcePose; + UInt16::UInt16(uint16_t value) + : Value(value) + { + } - void ReferenceManagedUnityEngineXRWSAInputInteractionSourcePose(int32_t handle) + UInt16::operator uint16_t() const { - assert(handle >= 0 && handle < RefCountsLenUnityEngineXRWSAInputInteractionSourcePose); - if (handle != 0) - { - RefCountsUnityEngineXRWSAInputInteractionSourcePose[handle]++; - } + return Value; } - void DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(int32_t handle) + UInt16::operator Object() const { - assert(handle >= 0 && handle < RefCountsLenUnityEngineXRWSAInputInteractionSourcePose); - if (handle != 0) - { - int32_t numRemain = --RefCountsUnityEngineXRWSAInputInteractionSourcePose[handle]; - if (numRemain == 0) - { - ReleaseUnityEngineXRWSAInputInteractionSourcePose(handle); - } - } + return Object(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value)); } - int32_t SystemActionFreeListSize; - System::Action** SystemActionFreeList; - System::Action** NextFreeSystemAction; + UInt16::operator ValueType() const + { + return ValueType(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value)); + } - int32_t StoreSystemAction(System::Action* del) + UInt16::operator IComparable() const { - assert(NextFreeSystemAction != nullptr); - System::Action** pNext = NextFreeSystemAction; - NextFreeSystemAction = (System::Action**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemActionFreeList); + return IComparable(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value)); } - System::Action* GetSystemAction(int32_t handle) + UInt16::operator IFormattable() const { - assert(handle >= 0 && handle < SystemActionFreeListSize); - return SystemActionFreeList[handle]; + return IFormattable(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value)); } - void RemoveSystemAction(int32_t handle) + UInt16::operator IConvertible() const + { + return IConvertible(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value)); + } + + Int32::Int32() + : Value(0) { - System::Action** pRelease = SystemActionFreeList + handle; - *pRelease = (System::Action*)NextFreeSystemAction; - NextFreeSystemAction = pRelease; } - int32_t SystemActionSystemSingleFreeListSize; - System::Action1** SystemActionSystemSingleFreeList; - System::Action1** NextFreeSystemActionSystemSingle; - int32_t StoreSystemActionSystemSingle(System::Action1* del) + Int32::Int32(int32_t value) + : Value(value) { - assert(NextFreeSystemActionSystemSingle != nullptr); - System::Action1** pNext = NextFreeSystemActionSystemSingle; - NextFreeSystemActionSystemSingle = (System::Action1**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemActionSystemSingleFreeList); } - System::Action1* GetSystemActionSystemSingle(int32_t handle) + Int32::operator int32_t() const { - assert(handle >= 0 && handle < SystemActionSystemSingleFreeListSize); - return SystemActionSystemSingleFreeList[handle]; + return Value; } - void RemoveSystemActionSystemSingle(int32_t handle) + Int32::operator Object() const { - System::Action1** pRelease = SystemActionSystemSingleFreeList + handle; - *pRelease = (System::Action1*)NextFreeSystemActionSystemSingle; - NextFreeSystemActionSystemSingle = pRelease; + return Object(Plugin::InternalUse::Only, Plugin::BoxInt32(Value)); } - int32_t SystemActionSystemSingle_SystemSingleFreeListSize; - System::Action2** SystemActionSystemSingle_SystemSingleFreeList; - System::Action2** NextFreeSystemActionSystemSingle_SystemSingle; - int32_t StoreSystemActionSystemSingle_SystemSingle(System::Action2* del) + Int32::operator ValueType() const { - assert(NextFreeSystemActionSystemSingle_SystemSingle != nullptr); - System::Action2** pNext = NextFreeSystemActionSystemSingle_SystemSingle; - NextFreeSystemActionSystemSingle_SystemSingle = (System::Action2**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemActionSystemSingle_SystemSingleFreeList); + return ValueType(Plugin::InternalUse::Only, Plugin::BoxInt32(Value)); } - System::Action2* GetSystemActionSystemSingle_SystemSingle(int32_t handle) + Int32::operator IComparable() const { - assert(handle >= 0 && handle < SystemActionSystemSingle_SystemSingleFreeListSize); - return SystemActionSystemSingle_SystemSingleFreeList[handle]; + return IComparable(Plugin::InternalUse::Only, Plugin::BoxInt32(Value)); } - void RemoveSystemActionSystemSingle_SystemSingle(int32_t handle) + Int32::operator IFormattable() const { - System::Action2** pRelease = SystemActionSystemSingle_SystemSingleFreeList + handle; - *pRelease = (System::Action2*)NextFreeSystemActionSystemSingle_SystemSingle; - NextFreeSystemActionSystemSingle_SystemSingle = pRelease; + return IFormattable(Plugin::InternalUse::Only, Plugin::BoxInt32(Value)); } - int32_t SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize; - System::Func3** SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList; - System::Func3** NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble; - int32_t StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(System::Func3* del) + Int32::operator IConvertible() const + { + return IConvertible(Plugin::InternalUse::Only, Plugin::BoxInt32(Value)); + } + + UInt32::UInt32() + : Value(0) { - assert(NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble != nullptr); - System::Func3** pNext = NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble; - NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble = (System::Func3**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList); } - System::Func3* GetSystemFuncSystemInt32_SystemSingle_SystemDouble(int32_t handle) + UInt32::UInt32(uint32_t value) + : Value(value) { - assert(handle >= 0 && handle < SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize); - return SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[handle]; } - void RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(int32_t handle) + UInt32::operator uint32_t() const { - System::Func3** pRelease = SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + handle; - *pRelease = (System::Func3*)NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble; - NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble = pRelease; + return Value; } - int32_t SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize; - System::Func3** SystemFuncSystemInt16_SystemInt32_SystemStringFreeList; - System::Func3** NextFreeSystemFuncSystemInt16_SystemInt32_SystemString; - int32_t StoreSystemFuncSystemInt16_SystemInt32_SystemString(System::Func3* del) + UInt32::operator Object() const { - assert(NextFreeSystemFuncSystemInt16_SystemInt32_SystemString != nullptr); - System::Func3** pNext = NextFreeSystemFuncSystemInt16_SystemInt32_SystemString; - NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = (System::Func3**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemFuncSystemInt16_SystemInt32_SystemStringFreeList); + return Object(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value)); } - System::Func3* GetSystemFuncSystemInt16_SystemInt32_SystemString(int32_t handle) + UInt32::operator ValueType() const { - assert(handle >= 0 && handle < SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize); - return SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[handle]; + return ValueType(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value)); } - void RemoveSystemFuncSystemInt16_SystemInt32_SystemString(int32_t handle) + UInt32::operator IComparable() const { - System::Func3** pRelease = SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + handle; - *pRelease = (System::Func3*)NextFreeSystemFuncSystemInt16_SystemInt32_SystemString; - NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = pRelease; + return IComparable(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value)); } - int32_t SystemAppDomainInitializerFreeListSize; - System::AppDomainInitializer** SystemAppDomainInitializerFreeList; - System::AppDomainInitializer** NextFreeSystemAppDomainInitializer; - int32_t StoreSystemAppDomainInitializer(System::AppDomainInitializer* del) + UInt32::operator IFormattable() const { - assert(NextFreeSystemAppDomainInitializer != nullptr); - System::AppDomainInitializer** pNext = NextFreeSystemAppDomainInitializer; - NextFreeSystemAppDomainInitializer = (System::AppDomainInitializer**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemAppDomainInitializerFreeList); + return IFormattable(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value)); } - System::AppDomainInitializer* GetSystemAppDomainInitializer(int32_t handle) + UInt32::operator IConvertible() const + { + return IConvertible(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value)); + } + + Int64::Int64() + : Value(0) { - assert(handle >= 0 && handle < SystemAppDomainInitializerFreeListSize); - return SystemAppDomainInitializerFreeList[handle]; } - void RemoveSystemAppDomainInitializer(int32_t handle) + Int64::Int64(int64_t value) + : Value(value) { - System::AppDomainInitializer** pRelease = SystemAppDomainInitializerFreeList + handle; - *pRelease = (System::AppDomainInitializer*)NextFreeSystemAppDomainInitializer; - NextFreeSystemAppDomainInitializer = pRelease; } - int32_t UnityEngineEventsUnityActionFreeListSize; - UnityEngine::Events::UnityAction** UnityEngineEventsUnityActionFreeList; - UnityEngine::Events::UnityAction** NextFreeUnityEngineEventsUnityAction; - int32_t StoreUnityEngineEventsUnityAction(UnityEngine::Events::UnityAction* del) + Int64::operator int64_t() const { - assert(NextFreeUnityEngineEventsUnityAction != nullptr); - UnityEngine::Events::UnityAction** pNext = NextFreeUnityEngineEventsUnityAction; - NextFreeUnityEngineEventsUnityAction = (UnityEngine::Events::UnityAction**)*pNext; - *pNext = del; - return (int32_t)(pNext - UnityEngineEventsUnityActionFreeList); + return Value; } - UnityEngine::Events::UnityAction* GetUnityEngineEventsUnityAction(int32_t handle) + Int64::operator Object() const { - assert(handle >= 0 && handle < UnityEngineEventsUnityActionFreeListSize); - return UnityEngineEventsUnityActionFreeList[handle]; + return Object(Plugin::InternalUse::Only, Plugin::BoxInt64(Value)); } - void RemoveUnityEngineEventsUnityAction(int32_t handle) + Int64::operator ValueType() const { - UnityEngine::Events::UnityAction** pRelease = UnityEngineEventsUnityActionFreeList + handle; - *pRelease = (UnityEngine::Events::UnityAction*)NextFreeUnityEngineEventsUnityAction; - NextFreeUnityEngineEventsUnityAction = pRelease; + return ValueType(Plugin::InternalUse::Only, Plugin::BoxInt64(Value)); } - int32_t UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize; - UnityEngine::Events::UnityAction2** UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList; - UnityEngine::Events::UnityAction2** NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; - int32_t StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(UnityEngine::Events::UnityAction2* del) + Int64::operator IComparable() const { - assert(NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode != nullptr); - UnityEngine::Events::UnityAction2** pNext = NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; - NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = (UnityEngine::Events::UnityAction2**)*pNext; - *pNext = del; - return (int32_t)(pNext - UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList); + return IComparable(Plugin::InternalUse::Only, Plugin::BoxInt64(Value)); } - UnityEngine::Events::UnityAction2* GetUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int32_t handle) + Int64::operator IFormattable() const { - assert(handle >= 0 && handle < UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize); - return UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList[handle]; + return IFormattable(Plugin::InternalUse::Only, Plugin::BoxInt64(Value)); } - void RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int32_t handle) + Int64::operator IConvertible() const + { + return IConvertible(Plugin::InternalUse::Only, Plugin::BoxInt64(Value)); + } + + UInt64::UInt64() + : Value(0) { - UnityEngine::Events::UnityAction2** pRelease = UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList + handle; - *pRelease = (UnityEngine::Events::UnityAction2*)NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; - NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = pRelease; } - int32_t SystemComponentModelDesignComponentEventHandlerFreeListSize; - System::ComponentModel::Design::ComponentEventHandler** SystemComponentModelDesignComponentEventHandlerFreeList; - System::ComponentModel::Design::ComponentEventHandler** NextFreeSystemComponentModelDesignComponentEventHandler; - int32_t StoreSystemComponentModelDesignComponentEventHandler(System::ComponentModel::Design::ComponentEventHandler* del) + UInt64::UInt64(uint64_t value) + : Value(value) { - assert(NextFreeSystemComponentModelDesignComponentEventHandler != nullptr); - System::ComponentModel::Design::ComponentEventHandler** pNext = NextFreeSystemComponentModelDesignComponentEventHandler; - NextFreeSystemComponentModelDesignComponentEventHandler = (System::ComponentModel::Design::ComponentEventHandler**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemComponentModelDesignComponentEventHandlerFreeList); } - System::ComponentModel::Design::ComponentEventHandler* GetSystemComponentModelDesignComponentEventHandler(int32_t handle) + UInt64::operator uint64_t() const { - assert(handle >= 0 && handle < SystemComponentModelDesignComponentEventHandlerFreeListSize); - return SystemComponentModelDesignComponentEventHandlerFreeList[handle]; + return Value; } - void RemoveSystemComponentModelDesignComponentEventHandler(int32_t handle) + UInt64::operator Object() const { - System::ComponentModel::Design::ComponentEventHandler** pRelease = SystemComponentModelDesignComponentEventHandlerFreeList + handle; - *pRelease = (System::ComponentModel::Design::ComponentEventHandler*)NextFreeSystemComponentModelDesignComponentEventHandler; - NextFreeSystemComponentModelDesignComponentEventHandler = pRelease; + return Object(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value)); } - int32_t SystemComponentModelDesignComponentChangingEventHandlerFreeListSize; - System::ComponentModel::Design::ComponentChangingEventHandler** SystemComponentModelDesignComponentChangingEventHandlerFreeList; - System::ComponentModel::Design::ComponentChangingEventHandler** NextFreeSystemComponentModelDesignComponentChangingEventHandler; - int32_t StoreSystemComponentModelDesignComponentChangingEventHandler(System::ComponentModel::Design::ComponentChangingEventHandler* del) + UInt64::operator ValueType() const { - assert(NextFreeSystemComponentModelDesignComponentChangingEventHandler != nullptr); - System::ComponentModel::Design::ComponentChangingEventHandler** pNext = NextFreeSystemComponentModelDesignComponentChangingEventHandler; - NextFreeSystemComponentModelDesignComponentChangingEventHandler = (System::ComponentModel::Design::ComponentChangingEventHandler**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemComponentModelDesignComponentChangingEventHandlerFreeList); + return ValueType(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value)); } - System::ComponentModel::Design::ComponentChangingEventHandler* GetSystemComponentModelDesignComponentChangingEventHandler(int32_t handle) + UInt64::operator IComparable() const { - assert(handle >= 0 && handle < SystemComponentModelDesignComponentChangingEventHandlerFreeListSize); - return SystemComponentModelDesignComponentChangingEventHandlerFreeList[handle]; + return IComparable(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value)); } - void RemoveSystemComponentModelDesignComponentChangingEventHandler(int32_t handle) + UInt64::operator IFormattable() const { - System::ComponentModel::Design::ComponentChangingEventHandler** pRelease = SystemComponentModelDesignComponentChangingEventHandlerFreeList + handle; - *pRelease = (System::ComponentModel::Design::ComponentChangingEventHandler*)NextFreeSystemComponentModelDesignComponentChangingEventHandler; - NextFreeSystemComponentModelDesignComponentChangingEventHandler = pRelease; + return IFormattable(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value)); } - int32_t SystemComponentModelDesignComponentChangedEventHandlerFreeListSize; - System::ComponentModel::Design::ComponentChangedEventHandler** SystemComponentModelDesignComponentChangedEventHandlerFreeList; - System::ComponentModel::Design::ComponentChangedEventHandler** NextFreeSystemComponentModelDesignComponentChangedEventHandler; - int32_t StoreSystemComponentModelDesignComponentChangedEventHandler(System::ComponentModel::Design::ComponentChangedEventHandler* del) + UInt64::operator IConvertible() const + { + return IConvertible(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value)); + } + + Single::Single() + : Value(0.0f) { - assert(NextFreeSystemComponentModelDesignComponentChangedEventHandler != nullptr); - System::ComponentModel::Design::ComponentChangedEventHandler** pNext = NextFreeSystemComponentModelDesignComponentChangedEventHandler; - NextFreeSystemComponentModelDesignComponentChangedEventHandler = (System::ComponentModel::Design::ComponentChangedEventHandler**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemComponentModelDesignComponentChangedEventHandlerFreeList); } - System::ComponentModel::Design::ComponentChangedEventHandler* GetSystemComponentModelDesignComponentChangedEventHandler(int32_t handle) + Single::Single(float value) + : Value(value) { - assert(handle >= 0 && handle < SystemComponentModelDesignComponentChangedEventHandlerFreeListSize); - return SystemComponentModelDesignComponentChangedEventHandlerFreeList[handle]; } - void RemoveSystemComponentModelDesignComponentChangedEventHandler(int32_t handle) + Single::operator float() const { - System::ComponentModel::Design::ComponentChangedEventHandler** pRelease = SystemComponentModelDesignComponentChangedEventHandlerFreeList + handle; - *pRelease = (System::ComponentModel::Design::ComponentChangedEventHandler*)NextFreeSystemComponentModelDesignComponentChangedEventHandler; - NextFreeSystemComponentModelDesignComponentChangedEventHandler = pRelease; + return Value; } - int32_t SystemComponentModelDesignComponentRenameEventHandlerFreeListSize; - System::ComponentModel::Design::ComponentRenameEventHandler** SystemComponentModelDesignComponentRenameEventHandlerFreeList; - System::ComponentModel::Design::ComponentRenameEventHandler** NextFreeSystemComponentModelDesignComponentRenameEventHandler; - int32_t StoreSystemComponentModelDesignComponentRenameEventHandler(System::ComponentModel::Design::ComponentRenameEventHandler* del) + Single::operator Object() const { - assert(NextFreeSystemComponentModelDesignComponentRenameEventHandler != nullptr); - System::ComponentModel::Design::ComponentRenameEventHandler** pNext = NextFreeSystemComponentModelDesignComponentRenameEventHandler; - NextFreeSystemComponentModelDesignComponentRenameEventHandler = (System::ComponentModel::Design::ComponentRenameEventHandler**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemComponentModelDesignComponentRenameEventHandlerFreeList); + return Object(Plugin::InternalUse::Only, Plugin::BoxSingle(Value)); } - System::ComponentModel::Design::ComponentRenameEventHandler* GetSystemComponentModelDesignComponentRenameEventHandler(int32_t handle) + Single::operator ValueType() const { - assert(handle >= 0 && handle < SystemComponentModelDesignComponentRenameEventHandlerFreeListSize); - return SystemComponentModelDesignComponentRenameEventHandlerFreeList[handle]; + return ValueType(Plugin::InternalUse::Only, Plugin::BoxSingle(Value)); } - void RemoveSystemComponentModelDesignComponentRenameEventHandler(int32_t handle) + Single::operator IComparable() const { - System::ComponentModel::Design::ComponentRenameEventHandler** pRelease = SystemComponentModelDesignComponentRenameEventHandlerFreeList + handle; - *pRelease = (System::ComponentModel::Design::ComponentRenameEventHandler*)NextFreeSystemComponentModelDesignComponentRenameEventHandler; - NextFreeSystemComponentModelDesignComponentRenameEventHandler = pRelease; + return IComparable(Plugin::InternalUse::Only, Plugin::BoxSingle(Value)); } - /*END GLOBAL STATE AND FUNCTIONS*/ -} - -namespace Plugin -{ - // An unhandled exception caused by C++ calling into C# - System::Exception* unhandledCsharpException = nullptr; -} - -//////////////////////////////////////////////////////////////// -// Mirrors of C# types. These wrap the C# functions to present -// a similiar API as in C#. -//////////////////////////////////////////////////////////////// - -namespace System -{ - Object::Object() - : Handle(0) + + Single::operator IFormattable() const { + return IFormattable(Plugin::InternalUse::Only, Plugin::BoxSingle(Value)); } - Object::Object(Plugin::InternalUse iu, int32_t handle) - : Handle(handle) + Single::operator IConvertible() const + { + return IConvertible(Plugin::InternalUse::Only, Plugin::BoxSingle(Value)); + } + + Double::Double() + : Value(0.0) { } - Object::Object(decltype(nullptr)) - : Handle(0) + Double::Double(double value) + : Value(value) { } - bool Object::operator==(decltype(nullptr)) const + Double::operator double() const { - return Handle == 0; + return Value; } - bool Object::operator!=(decltype(nullptr)) const + Double::operator Object() const { - return Handle != 0; + return Object(Plugin::InternalUse::Only, Plugin::BoxDouble(Value)); } - void Object::ThrowReferenceToThis() + Double::operator ValueType() const { - throw *this; + return ValueType(Plugin::InternalUse::Only, Plugin::BoxDouble(Value)); } - ValueType::ValueType(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) + Double::operator IComparable() const { + return IComparable(Plugin::InternalUse::Only, Plugin::BoxDouble(Value)); } - ValueType::ValueType(decltype(nullptr)) - : Object(nullptr) + Double::operator IFormattable() const { + return IFormattable(Plugin::InternalUse::Only, Plugin::BoxDouble(Value)); } - String::String(decltype(nullptr)) - : Object(Plugin::InternalUse::Only, 0) + Double::operator IConvertible() const + { + return IConvertible(Plugin::InternalUse::Only, Plugin::BoxDouble(Value)); + } +} + +//////////////////////////////////////////////////////////////// +// Support for using IEnumerable with range for loops +//////////////////////////////////////////////////////////////// + +namespace Plugin +{ + // End iterators are dummies full of null + EnumerableIterator::EnumerableIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) { } - String::String(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) + // Begin iterators keep track of an IEnumerator + EnumerableIterator::EnumerableIterator( + System::Collections::IEnumerable& enumerable) + : enumerator(enumerable.GetEnumerator()) { - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } + hasMore = enumerator.MoveNext(); } - String::String(const String& other) - : Object(Plugin::InternalUse::Only, other.Handle) + EnumerableIterator& EnumerableIterator::operator++() { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } + hasMore = enumerator.MoveNext(); + return *this; } - String::String(String&& other) - : Object(Plugin::InternalUse::Only, other.Handle) + bool EnumerableIterator::operator!=(const EnumerableIterator& other) { - other.Handle = 0; + return hasMore; } - String::~String() + System::Object EnumerableIterator::operator*() { - if (Handle) + return enumerator.GetCurrent(); + } +} + +//////////////////////////////////////////////////////////////// +// Reference counting of managed objects +//////////////////////////////////////////////////////////////// + +namespace Plugin +{ + int32_t RefCountsLenClass; + int32_t* RefCountsClass; + + void ReferenceManagedClass(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenClass); + if (handle != 0) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + RefCountsClass[handle]++; } } - - String& String::operator=(const String& other) + + void DereferenceManagedClass(int32_t handle) { - if (Handle != other.Handle) + assert(handle >= 0 && handle < RefCountsLenClass); + if (handle != 0) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - if (Handle) + int32_t numRemain = --RefCountsClass[handle]; + if (numRemain == 0) { - Plugin::ReferenceManagedClass(Handle); + ReleaseObject(handle); } } - return *this; } - String& String::operator=(decltype(nullptr)) + bool DereferenceManagedClassNoRelease(int32_t handle) { - if (Handle) + assert(handle >= 0 && handle < RefCountsLenClass); + if (handle != 0) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + int32_t numRemain = --RefCountsClass[handle]; + if (numRemain == 0) + { + return true; + } } - return *this; + return false; } - String& String::operator=(String&& other) + /*BEGIN GLOBAL STATE AND FUNCTIONS*/ + int32_t RefCountsLenUnityEngineResolution; + int32_t* RefCountsUnityEngineResolution; + + void ReferenceManagedUnityEngineResolution(int32_t handle) { - if (Handle) + assert(handle >= 0 && handle < RefCountsLenUnityEngineResolution); + if (handle != 0) { - Plugin::DereferenceManagedClass(Handle); + RefCountsUnityEngineResolution[handle]++; } - Handle = other.Handle; - other.Handle = 0; - return *this; } - String::String(const char* chars) - : Object(Plugin::InternalUse::Only, Plugin::StringNew(chars)) + void DereferenceManagedUnityEngineResolution(int32_t handle) { + assert(handle >= 0 && handle < RefCountsLenUnityEngineResolution); + if (handle != 0) + { + int32_t numRemain = --RefCountsUnityEngineResolution[handle]; + if (numRemain == 0) + { + ReleaseUnityEngineResolution(handle); + } + } } - ICloneable::ICloneable(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) - { - } + int32_t RefCountsLenUnityEngineRaycastHit; + int32_t* RefCountsUnityEngineRaycastHit; - ICloneable::ICloneable(decltype(nullptr)) - : Object(nullptr) + void ReferenceManagedUnityEngineRaycastHit(int32_t handle) { + assert(handle >= 0 && handle < RefCountsLenUnityEngineRaycastHit); + if (handle != 0) + { + RefCountsUnityEngineRaycastHit[handle]++; + } } - namespace Collections + void DereferenceManagedUnityEngineRaycastHit(int32_t handle) { - IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) - { - } - - IEnumerable::IEnumerable(decltype(nullptr)) - : Object(nullptr) - { - } - - IEnumerator IEnumerable::GetEnumerator() - { - return IEnumerator( - Plugin::InternalUse::Only, - Plugin::EnumerableGetEnumerator(Handle)); - } - - Plugin::EnumerableIterator begin( - System::Collections::IEnumerable& enumerable) - { - return Plugin::EnumerableIterator(enumerable); - } - - Plugin::EnumerableIterator end( - System::Collections::IEnumerable& enumerable) - { - return Plugin::EnumerableIterator(nullptr); - } - - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) - , IEnumerable(nullptr) - { - } - - ICollection::ICollection(decltype(nullptr)) - : Object(nullptr) - , IEnumerable(nullptr) - { - } - - IList::IList(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) - , IEnumerable(nullptr) - , ICollection(nullptr) - { - } - - IList::IList(decltype(nullptr)) - : Object(nullptr) - , IEnumerable(nullptr) - , ICollection(nullptr) + assert(handle >= 0 && handle < RefCountsLenUnityEngineRaycastHit); + if (handle != 0) { + int32_t numRemain = --RefCountsUnityEngineRaycastHit[handle]; + if (numRemain == 0) + { + ReleaseUnityEngineRaycastHit(handle); + } } } - Array::Array(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) - , ICloneable(nullptr) - , Collections::IEnumerable(nullptr) - , Collections::ICollection(nullptr) - , Collections::IList(nullptr) - { - } + int32_t RefCountsLenUnityEnginePlayablesPlayableGraph; + int32_t* RefCountsUnityEnginePlayablesPlayableGraph; - Array::Array(decltype(nullptr)) - : Object(nullptr) - , ICloneable(nullptr) - , Collections::IEnumerable(nullptr) - , Collections::ICollection(nullptr) - , Collections::IList(nullptr) + void ReferenceManagedUnityEnginePlayablesPlayableGraph(int32_t handle) { + assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableGraph); + if (handle != 0) + { + RefCountsUnityEnginePlayablesPlayableGraph[handle]++; + } } - int32_t Array::GetLength() + void DereferenceManagedUnityEnginePlayablesPlayableGraph(int32_t handle) { - return Plugin::ArrayGetLength(Handle); + assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableGraph); + if (handle != 0) + { + int32_t numRemain = --RefCountsUnityEnginePlayablesPlayableGraph[handle]; + if (numRemain == 0) + { + ReleaseUnityEnginePlayablesPlayableGraph(handle); + } + } } - int32_t Array::GetRank() - { - return 0; - } -} - -/*BEGIN METHOD DEFINITIONS*/ -namespace System -{ - IDisposable::IDisposable(decltype(nullptr)) - { - } + int32_t RefCountsLenUnityEngineAnimationsAnimationMixerPlayable; + int32_t* RefCountsUnityEngineAnimationsAnimationMixerPlayable; - IDisposable::IDisposable(Plugin::InternalUse iu, int32_t handle) + void ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(int32_t handle) { - Handle = handle; - if (handle) + assert(handle >= 0 && handle < RefCountsLenUnityEngineAnimationsAnimationMixerPlayable); + if (handle != 0) { - Plugin::ReferenceManagedClass(handle); + RefCountsUnityEngineAnimationsAnimationMixerPlayable[handle]++; } } - IDisposable::IDisposable(const IDisposable& other) - : IDisposable(Plugin::InternalUse::Only, other.Handle) + void DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(int32_t handle) { + assert(handle >= 0 && handle < RefCountsLenUnityEngineAnimationsAnimationMixerPlayable); + if (handle != 0) + { + int32_t numRemain = --RefCountsUnityEngineAnimationsAnimationMixerPlayable[handle]; + if (numRemain == 0) + { + ReleaseUnityEngineAnimationsAnimationMixerPlayable(handle); + } + } } - IDisposable::IDisposable(IDisposable&& other) - : IDisposable(Plugin::InternalUse::Only, other.Handle) + int32_t RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; + int32_t* RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; + + void ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int32_t handle) { - other.Handle = 0; + assert(handle >= 0 && handle < RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble); + if (handle != 0) + { + RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble[handle]++; + } } - IDisposable::~IDisposable() + void DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int32_t handle) { - if (Handle) + assert(handle >= 0 && handle < RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble); + if (handle != 0) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + int32_t numRemain = --RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble[handle]; + if (numRemain == 0) + { + ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(handle); + } } } - IDisposable& IDisposable::operator=(const IDisposable& other) + int32_t RefCountsLenUnityEngineRay; + int32_t* RefCountsUnityEngineRay; + + void ReferenceManagedUnityEngineRay(int32_t handle) { - if (this->Handle) + assert(handle >= 0 && handle < RefCountsLenUnityEngineRay); + if (handle != 0) { - Plugin::DereferenceManagedClass(this->Handle); + RefCountsUnityEngineRay[handle]++; } - this->Handle = other.Handle; - if (this->Handle) + } + + void DereferenceManagedUnityEngineRay(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEngineRay); + if (handle != 0) { - Plugin::ReferenceManagedClass(this->Handle); + int32_t numRemain = --RefCountsUnityEngineRay[handle]; + if (numRemain == 0) + { + ReleaseUnityEngineRay(handle); + } } - return *this; } - IDisposable& IDisposable::operator=(decltype(nullptr)) + int32_t RefCountsLenUnityEngineSceneManagementScene; + int32_t* RefCountsUnityEngineSceneManagementScene; + + void ReferenceManagedUnityEngineSceneManagementScene(int32_t handle) { - if (Handle) + assert(handle >= 0 && handle < RefCountsLenUnityEngineSceneManagementScene); + if (handle != 0) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + RefCountsUnityEngineSceneManagementScene[handle]++; } - return *this; } - IDisposable& IDisposable::operator=(IDisposable&& other) + void DereferenceManagedUnityEngineSceneManagementScene(int32_t handle) { - if (Handle) + assert(handle >= 0 && handle < RefCountsLenUnityEngineSceneManagementScene); + if (handle != 0) { - Plugin::DereferenceManagedClass(Handle); + int32_t numRemain = --RefCountsUnityEngineSceneManagementScene[handle]; + if (numRemain == 0) + { + ReleaseUnityEngineSceneManagementScene(handle); + } } - Handle = other.Handle; - other.Handle = 0; - return *this; } - bool IDisposable::operator==(const IDisposable& other) const + int32_t SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize; + System::Collections::Generic::BaseIComparer** SystemCollectionsGenericBaseIComparerSystemInt32FreeList; + System::Collections::Generic::BaseIComparer** NextFreeSystemCollectionsGenericBaseIComparerSystemInt32; + + int32_t StoreSystemCollectionsGenericBaseIComparerSystemInt32(System::Collections::Generic::BaseIComparer* del) { - return Handle == other.Handle; + assert(NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 != nullptr); + System::Collections::Generic::BaseIComparer** pNext = NextFreeSystemCollectionsGenericBaseIComparerSystemInt32; + NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 = (System::Collections::Generic::BaseIComparer**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemCollectionsGenericBaseIComparerSystemInt32FreeList); } - bool IDisposable::operator!=(const IDisposable& other) const + System::Collections::Generic::BaseIComparer* GetSystemCollectionsGenericBaseIComparerSystemInt32(int32_t handle) { - return Handle != other.Handle; + assert(handle >= 0 && handle < SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize); + return SystemCollectionsGenericBaseIComparerSystemInt32FreeList[handle]; } - void IDisposable::Dispose() + void RemoveSystemCollectionsGenericBaseIComparerSystemInt32(int32_t handle) { - Plugin::SystemIDisposableMethodDispose(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + System::Collections::Generic::BaseIComparer** pRelease = SystemCollectionsGenericBaseIComparerSystemInt32FreeList + handle; + *pRelease = (System::Collections::Generic::BaseIComparer*)NextFreeSystemCollectionsGenericBaseIComparerSystemInt32; + NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 = pRelease; } -} - -namespace UnityEngine -{ - Vector3::Vector3() + int32_t SystemCollectionsGenericBaseIComparerSystemStringFreeListSize; + System::Collections::Generic::BaseIComparer** SystemCollectionsGenericBaseIComparerSystemStringFreeList; + System::Collections::Generic::BaseIComparer** NextFreeSystemCollectionsGenericBaseIComparerSystemString; + + int32_t StoreSystemCollectionsGenericBaseIComparerSystemString(System::Collections::Generic::BaseIComparer* del) { + assert(NextFreeSystemCollectionsGenericBaseIComparerSystemString != nullptr); + System::Collections::Generic::BaseIComparer** pNext = NextFreeSystemCollectionsGenericBaseIComparerSystemString; + NextFreeSystemCollectionsGenericBaseIComparerSystemString = (System::Collections::Generic::BaseIComparer**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemCollectionsGenericBaseIComparerSystemStringFreeList); } - Vector3::Vector3(float x, float y, float z) + System::Collections::Generic::BaseIComparer* GetSystemCollectionsGenericBaseIComparerSystemString(int32_t handle) { - auto returnValue = Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(x, y, z); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - *this = returnValue; + assert(handle >= 0 && handle < SystemCollectionsGenericBaseIComparerSystemStringFreeListSize); + return SystemCollectionsGenericBaseIComparerSystemStringFreeList[handle]; } - float Vector3::GetMagnitude() + void RemoveSystemCollectionsGenericBaseIComparerSystemString(int32_t handle) { - auto returnValue = Plugin::UnityEngineVector3PropertyGetMagnitude(this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; + System::Collections::Generic::BaseIComparer** pRelease = SystemCollectionsGenericBaseIComparerSystemStringFreeList + handle; + *pRelease = (System::Collections::Generic::BaseIComparer*)NextFreeSystemCollectionsGenericBaseIComparerSystemString; + NextFreeSystemCollectionsGenericBaseIComparerSystemString = pRelease; } + int32_t SystemBaseStringComparerFreeListSize; + System::BaseStringComparer** SystemBaseStringComparerFreeList; + System::BaseStringComparer** NextFreeSystemBaseStringComparer; - void Vector3::Set(float newX, float newY, float newZ) + int32_t StoreSystemBaseStringComparer(System::BaseStringComparer* del) { - Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(this, newX, newY, newZ); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + assert(NextFreeSystemBaseStringComparer != nullptr); + System::BaseStringComparer** pNext = NextFreeSystemBaseStringComparer; + NextFreeSystemBaseStringComparer = (System::BaseStringComparer**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemBaseStringComparerFreeList); } - UnityEngine::Vector3 Vector3::operator+(UnityEngine::Vector3& a) + System::BaseStringComparer* GetSystemBaseStringComparer(int32_t handle) { - auto returnValue = Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(*this, a); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; + assert(handle >= 0 && handle < SystemBaseStringComparerFreeListSize); + return SystemBaseStringComparerFreeList[handle]; } - UnityEngine::Vector3 Vector3::operator-() + void RemoveSystemBaseStringComparer(int32_t handle) { - auto returnValue = Plugin::UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; + System::BaseStringComparer** pRelease = SystemBaseStringComparerFreeList + handle; + *pRelease = (System::BaseStringComparer*)NextFreeSystemBaseStringComparer; + NextFreeSystemBaseStringComparer = pRelease; } -} - -namespace System -{ - Object::Object(UnityEngine::Vector3& val) + int32_t SystemCollectionsBaseQueueFreeListSize; + System::Collections::BaseQueue** SystemCollectionsBaseQueueFreeList; + System::Collections::BaseQueue** NextFreeSystemCollectionsBaseQueue; + + int32_t StoreSystemCollectionsBaseQueue(System::Collections::BaseQueue* del) { - int32_t handle = Plugin::BoxVector3(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } + assert(NextFreeSystemCollectionsBaseQueue != nullptr); + System::Collections::BaseQueue** pNext = NextFreeSystemCollectionsBaseQueue; + NextFreeSystemCollectionsBaseQueue = (System::Collections::BaseQueue**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemCollectionsBaseQueueFreeList); } - Object::operator UnityEngine::Vector3() + System::Collections::BaseQueue* GetSystemCollectionsBaseQueue(int32_t handle) { - UnityEngine::Vector3 returnVal(Plugin::UnboxVector3(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; + assert(handle >= 0 && handle < SystemCollectionsBaseQueueFreeListSize); + return SystemCollectionsBaseQueueFreeList[handle]; } -} - -namespace UnityEngine -{ - Object::Object(decltype(nullptr)) + + void RemoveSystemCollectionsBaseQueue(int32_t handle) { + System::Collections::BaseQueue** pRelease = SystemCollectionsBaseQueueFreeList + handle; + *pRelease = (System::Collections::BaseQueue*)NextFreeSystemCollectionsBaseQueue; + NextFreeSystemCollectionsBaseQueue = pRelease; } + int32_t SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize; + System::ComponentModel::Design::BaseIComponentChangeService** SystemComponentModelDesignBaseIComponentChangeServiceFreeList; + System::ComponentModel::Design::BaseIComponentChangeService** NextFreeSystemComponentModelDesignBaseIComponentChangeService; - Object::Object(Plugin::InternalUse iu, int32_t handle) + int32_t StoreSystemComponentModelDesignBaseIComponentChangeService(System::ComponentModel::Design::BaseIComponentChangeService* del) { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } + assert(NextFreeSystemComponentModelDesignBaseIComponentChangeService != nullptr); + System::ComponentModel::Design::BaseIComponentChangeService** pNext = NextFreeSystemComponentModelDesignBaseIComponentChangeService; + NextFreeSystemComponentModelDesignBaseIComponentChangeService = (System::ComponentModel::Design::BaseIComponentChangeService**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemComponentModelDesignBaseIComponentChangeServiceFreeList); } - Object::Object(const Object& other) - : Object(Plugin::InternalUse::Only, other.Handle) + System::ComponentModel::Design::BaseIComponentChangeService* GetSystemComponentModelDesignBaseIComponentChangeService(int32_t handle) { + assert(handle >= 0 && handle < SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize); + return SystemComponentModelDesignBaseIComponentChangeServiceFreeList[handle]; } - Object::Object(Object&& other) - : Object(Plugin::InternalUse::Only, other.Handle) + void RemoveSystemComponentModelDesignBaseIComponentChangeService(int32_t handle) { - other.Handle = 0; + System::ComponentModel::Design::BaseIComponentChangeService** pRelease = SystemComponentModelDesignBaseIComponentChangeServiceFreeList + handle; + *pRelease = (System::ComponentModel::Design::BaseIComponentChangeService*)NextFreeSystemComponentModelDesignBaseIComponentChangeService; + NextFreeSystemComponentModelDesignBaseIComponentChangeService = pRelease; + } + int32_t SystemIOBaseFileStreamFreeListSize; + System::IO::BaseFileStream** SystemIOBaseFileStreamFreeList; + System::IO::BaseFileStream** NextFreeSystemIOBaseFileStream; + + int32_t StoreSystemIOBaseFileStream(System::IO::BaseFileStream* del) + { + assert(NextFreeSystemIOBaseFileStream != nullptr); + System::IO::BaseFileStream** pNext = NextFreeSystemIOBaseFileStream; + NextFreeSystemIOBaseFileStream = (System::IO::BaseFileStream**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemIOBaseFileStreamFreeList); } - Object::~Object() + System::IO::BaseFileStream* GetSystemIOBaseFileStream(int32_t handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } + assert(handle >= 0 && handle < SystemIOBaseFileStreamFreeListSize); + return SystemIOBaseFileStreamFreeList[handle]; } - Object& Object::operator=(const Object& other) + void RemoveSystemIOBaseFileStream(int32_t handle) { - if (this->Handle) + System::IO::BaseFileStream** pRelease = SystemIOBaseFileStreamFreeList + handle; + *pRelease = (System::IO::BaseFileStream*)NextFreeSystemIOBaseFileStream; + NextFreeSystemIOBaseFileStream = pRelease; + } + int32_t RefCountsLenUnityEnginePlayablesPlayableHandle; + int32_t* RefCountsUnityEnginePlayablesPlayableHandle; + + void ReferenceManagedUnityEnginePlayablesPlayableHandle(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableHandle); + if (handle != 0) { - Plugin::DereferenceManagedClass(this->Handle); + RefCountsUnityEnginePlayablesPlayableHandle[handle]++; } - this->Handle = other.Handle; - if (this->Handle) + } + + void DereferenceManagedUnityEnginePlayablesPlayableHandle(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableHandle); + if (handle != 0) { - Plugin::ReferenceManagedClass(this->Handle); + int32_t numRemain = --RefCountsUnityEnginePlayablesPlayableHandle[handle]; + if (numRemain == 0) + { + ReleaseUnityEnginePlayablesPlayableHandle(handle); + } } - return *this; } - Object& Object::operator=(decltype(nullptr)) + int32_t RefCountsLenUnityEngineXRWSAInputInteractionSourcePose; + int32_t* RefCountsUnityEngineXRWSAInputInteractionSourcePose; + + void ReferenceManagedUnityEngineXRWSAInputInteractionSourcePose(int32_t handle) { - if (Handle) + assert(handle >= 0 && handle < RefCountsLenUnityEngineXRWSAInputInteractionSourcePose); + if (handle != 0) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + RefCountsUnityEngineXRWSAInputInteractionSourcePose[handle]++; } - return *this; } - Object& Object::operator=(Object&& other) + void DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(int32_t handle) { - if (Handle) + assert(handle >= 0 && handle < RefCountsLenUnityEngineXRWSAInputInteractionSourcePose); + if (handle != 0) { - Plugin::DereferenceManagedClass(Handle); + int32_t numRemain = --RefCountsUnityEngineXRWSAInputInteractionSourcePose[handle]; + if (numRemain == 0) + { + ReleaseUnityEngineXRWSAInputInteractionSourcePose(handle); + } } - Handle = other.Handle; - other.Handle = 0; - return *this; } - bool Object::operator==(const Object& other) const + int32_t SystemActionFreeListSize; + System::Action** SystemActionFreeList; + System::Action** NextFreeSystemAction; + + int32_t StoreSystemAction(System::Action* del) { - return Handle == other.Handle; + assert(NextFreeSystemAction != nullptr); + System::Action** pNext = NextFreeSystemAction; + NextFreeSystemAction = (System::Action**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemActionFreeList); } - bool Object::operator!=(const Object& other) const + System::Action* GetSystemAction(int32_t handle) { - return Handle != other.Handle; + assert(handle >= 0 && handle < SystemActionFreeListSize); + return SystemActionFreeList[handle]; } - System::String Object::GetName() + void RemoveSystemAction(int32_t handle) { - auto returnValue = Plugin::UnityEngineObjectPropertyGetName(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); + System::Action** pRelease = SystemActionFreeList + handle; + *pRelease = (System::Action*)NextFreeSystemAction; + NextFreeSystemAction = pRelease; } + int32_t SystemActionSystemSingleFreeListSize; + System::Action1** SystemActionSystemSingleFreeList; + System::Action1** NextFreeSystemActionSystemSingle; - void Object::SetName(System::String& value) + int32_t StoreSystemActionSystemSingle(System::Action1* del) { - Plugin::UnityEngineObjectPropertySetName(Handle, value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + assert(NextFreeSystemActionSystemSingle != nullptr); + System::Action1** pNext = NextFreeSystemActionSystemSingle; + NextFreeSystemActionSystemSingle = (System::Action1**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemActionSystemSingleFreeList); } - System::Boolean Object::operator==(UnityEngine::Object& x) + System::Action1* GetSystemActionSystemSingle(int32_t handle) { - auto returnValue = Plugin::UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject(Handle, x.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; + assert(handle >= 0 && handle < SystemActionSystemSingleFreeListSize); + return SystemActionSystemSingleFreeList[handle]; } - Object::operator System::Boolean() - { - auto returnValue = Plugin::UnityEngineObjectMethodop_ImplicitUnityEngineObject(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } -} - -namespace UnityEngine -{ - Component::Component(decltype(nullptr)) - : UnityEngine::Object(nullptr) + void RemoveSystemActionSystemSingle(int32_t handle) { + System::Action1** pRelease = SystemActionSystemSingleFreeList + handle; + *pRelease = (System::Action1*)NextFreeSystemActionSystemSingle; + NextFreeSystemActionSystemSingle = pRelease; } + int32_t SystemActionSystemSingle_SystemSingleFreeListSize; + System::Action2** SystemActionSystemSingle_SystemSingleFreeList; + System::Action2** NextFreeSystemActionSystemSingle_SystemSingle; - Component::Component(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::Object(nullptr) + int32_t StoreSystemActionSystemSingle_SystemSingle(System::Action2* del) { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } + assert(NextFreeSystemActionSystemSingle_SystemSingle != nullptr); + System::Action2** pNext = NextFreeSystemActionSystemSingle_SystemSingle; + NextFreeSystemActionSystemSingle_SystemSingle = (System::Action2**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemActionSystemSingle_SystemSingleFreeList); } - Component::Component(const Component& other) - : Component(Plugin::InternalUse::Only, other.Handle) + System::Action2* GetSystemActionSystemSingle_SystemSingle(int32_t handle) { + assert(handle >= 0 && handle < SystemActionSystemSingle_SystemSingleFreeListSize); + return SystemActionSystemSingle_SystemSingleFreeList[handle]; } - Component::Component(Component&& other) - : Component(Plugin::InternalUse::Only, other.Handle) + void RemoveSystemActionSystemSingle_SystemSingle(int32_t handle) { - other.Handle = 0; + System::Action2** pRelease = SystemActionSystemSingle_SystemSingleFreeList + handle; + *pRelease = (System::Action2*)NextFreeSystemActionSystemSingle_SystemSingle; + NextFreeSystemActionSystemSingle_SystemSingle = pRelease; } + int32_t SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize; + System::Func3** SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList; + System::Func3** NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble; - Component::~Component() + int32_t StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(System::Func3* del) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } + assert(NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble != nullptr); + System::Func3** pNext = NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble; + NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble = (System::Func3**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList); } - Component& Component::operator=(const Component& other) + System::Func3* GetSystemFuncSystemInt32_SystemSingle_SystemDouble(int32_t handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; + assert(handle >= 0 && handle < SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize); + return SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[handle]; } - Component& Component::operator=(decltype(nullptr)) + void RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(int32_t handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; + System::Func3** pRelease = SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + handle; + *pRelease = (System::Func3*)NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble; + NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble = pRelease; } + int32_t SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize; + System::Func3** SystemFuncSystemInt16_SystemInt32_SystemStringFreeList; + System::Func3** NextFreeSystemFuncSystemInt16_SystemInt32_SystemString; - Component& Component::operator=(Component&& other) + int32_t StoreSystemFuncSystemInt16_SystemInt32_SystemString(System::Func3* del) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; + assert(NextFreeSystemFuncSystemInt16_SystemInt32_SystemString != nullptr); + System::Func3** pNext = NextFreeSystemFuncSystemInt16_SystemInt32_SystemString; + NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = (System::Func3**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemFuncSystemInt16_SystemInt32_SystemStringFreeList); } - bool Component::operator==(const Component& other) const + System::Func3* GetSystemFuncSystemInt16_SystemInt32_SystemString(int32_t handle) { - return Handle == other.Handle; + assert(handle >= 0 && handle < SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize); + return SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[handle]; } - bool Component::operator!=(const Component& other) const + void RemoveSystemFuncSystemInt16_SystemInt32_SystemString(int32_t handle) { - return Handle != other.Handle; + System::Func3** pRelease = SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + handle; + *pRelease = (System::Func3*)NextFreeSystemFuncSystemInt16_SystemInt32_SystemString; + NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = pRelease; } + int32_t SystemAppDomainInitializerFreeListSize; + System::AppDomainInitializer** SystemAppDomainInitializerFreeList; + System::AppDomainInitializer** NextFreeSystemAppDomainInitializer; - UnityEngine::Transform Component::GetTransform() + int32_t StoreSystemAppDomainInitializer(System::AppDomainInitializer* del) { - auto returnValue = Plugin::UnityEngineComponentPropertyGetTransform(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); + assert(NextFreeSystemAppDomainInitializer != nullptr); + System::AppDomainInitializer** pNext = NextFreeSystemAppDomainInitializer; + NextFreeSystemAppDomainInitializer = (System::AppDomainInitializer**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemAppDomainInitializerFreeList); } -} - -namespace UnityEngine -{ - Transform::Transform(decltype(nullptr)) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) - , System::Collections::IEnumerable(nullptr) + + System::AppDomainInitializer* GetSystemAppDomainInitializer(int32_t handle) { + assert(handle >= 0 && handle < SystemAppDomainInitializerFreeListSize); + return SystemAppDomainInitializerFreeList[handle]; } - Transform::Transform(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) - , System::Collections::IEnumerable(nullptr) + void RemoveSystemAppDomainInitializer(int32_t handle) { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } + System::AppDomainInitializer** pRelease = SystemAppDomainInitializerFreeList + handle; + *pRelease = (System::AppDomainInitializer*)NextFreeSystemAppDomainInitializer; + NextFreeSystemAppDomainInitializer = pRelease; } + int32_t UnityEngineEventsUnityActionFreeListSize; + UnityEngine::Events::UnityAction** UnityEngineEventsUnityActionFreeList; + UnityEngine::Events::UnityAction** NextFreeUnityEngineEventsUnityAction; - Transform::Transform(const Transform& other) - : Transform(Plugin::InternalUse::Only, other.Handle) + int32_t StoreUnityEngineEventsUnityAction(UnityEngine::Events::UnityAction* del) { + assert(NextFreeUnityEngineEventsUnityAction != nullptr); + UnityEngine::Events::UnityAction** pNext = NextFreeUnityEngineEventsUnityAction; + NextFreeUnityEngineEventsUnityAction = (UnityEngine::Events::UnityAction**)*pNext; + *pNext = del; + return (int32_t)(pNext - UnityEngineEventsUnityActionFreeList); } - Transform::Transform(Transform&& other) - : Transform(Plugin::InternalUse::Only, other.Handle) + UnityEngine::Events::UnityAction* GetUnityEngineEventsUnityAction(int32_t handle) { - other.Handle = 0; + assert(handle >= 0 && handle < UnityEngineEventsUnityActionFreeListSize); + return UnityEngineEventsUnityActionFreeList[handle]; } - Transform::~Transform() + void RemoveUnityEngineEventsUnityAction(int32_t handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } + UnityEngine::Events::UnityAction** pRelease = UnityEngineEventsUnityActionFreeList + handle; + *pRelease = (UnityEngine::Events::UnityAction*)NextFreeUnityEngineEventsUnityAction; + NextFreeUnityEngineEventsUnityAction = pRelease; } + int32_t UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize; + UnityEngine::Events::UnityAction2** UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList; + UnityEngine::Events::UnityAction2** NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; - Transform& Transform::operator=(const Transform& other) + int32_t StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(UnityEngine::Events::UnityAction2* del) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; + assert(NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode != nullptr); + UnityEngine::Events::UnityAction2** pNext = NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; + NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = (UnityEngine::Events::UnityAction2**)*pNext; + *pNext = del; + return (int32_t)(pNext - UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList); } - Transform& Transform::operator=(decltype(nullptr)) + UnityEngine::Events::UnityAction2* GetUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int32_t handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; + assert(handle >= 0 && handle < UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize); + return UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList[handle]; } - Transform& Transform::operator=(Transform&& other) + void RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int32_t handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; + UnityEngine::Events::UnityAction2** pRelease = UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList + handle; + *pRelease = (UnityEngine::Events::UnityAction2*)NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; + NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = pRelease; } + int32_t SystemComponentModelDesignComponentEventHandlerFreeListSize; + System::ComponentModel::Design::ComponentEventHandler** SystemComponentModelDesignComponentEventHandlerFreeList; + System::ComponentModel::Design::ComponentEventHandler** NextFreeSystemComponentModelDesignComponentEventHandler; - bool Transform::operator==(const Transform& other) const + int32_t StoreSystemComponentModelDesignComponentEventHandler(System::ComponentModel::Design::ComponentEventHandler* del) { - return Handle == other.Handle; + assert(NextFreeSystemComponentModelDesignComponentEventHandler != nullptr); + System::ComponentModel::Design::ComponentEventHandler** pNext = NextFreeSystemComponentModelDesignComponentEventHandler; + NextFreeSystemComponentModelDesignComponentEventHandler = (System::ComponentModel::Design::ComponentEventHandler**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemComponentModelDesignComponentEventHandlerFreeList); } - bool Transform::operator!=(const Transform& other) const + System::ComponentModel::Design::ComponentEventHandler* GetSystemComponentModelDesignComponentEventHandler(int32_t handle) { - return Handle != other.Handle; + assert(handle >= 0 && handle < SystemComponentModelDesignComponentEventHandlerFreeListSize); + return SystemComponentModelDesignComponentEventHandlerFreeList[handle]; } - UnityEngine::Vector3 Transform::GetPosition() + void RemoveSystemComponentModelDesignComponentEventHandler(int32_t handle) { - auto returnValue = Plugin::UnityEngineTransformPropertyGetPosition(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; + System::ComponentModel::Design::ComponentEventHandler** pRelease = SystemComponentModelDesignComponentEventHandlerFreeList + handle; + *pRelease = (System::ComponentModel::Design::ComponentEventHandler*)NextFreeSystemComponentModelDesignComponentEventHandler; + NextFreeSystemComponentModelDesignComponentEventHandler = pRelease; } + int32_t SystemComponentModelDesignComponentChangingEventHandlerFreeListSize; + System::ComponentModel::Design::ComponentChangingEventHandler** SystemComponentModelDesignComponentChangingEventHandlerFreeList; + System::ComponentModel::Design::ComponentChangingEventHandler** NextFreeSystemComponentModelDesignComponentChangingEventHandler; - void Transform::SetPosition(UnityEngine::Vector3& value) + int32_t StoreSystemComponentModelDesignComponentChangingEventHandler(System::ComponentModel::Design::ComponentChangingEventHandler* del) { - Plugin::UnityEngineTransformPropertySetPosition(Handle, value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + assert(NextFreeSystemComponentModelDesignComponentChangingEventHandler != nullptr); + System::ComponentModel::Design::ComponentChangingEventHandler** pNext = NextFreeSystemComponentModelDesignComponentChangingEventHandler; + NextFreeSystemComponentModelDesignComponentChangingEventHandler = (System::ComponentModel::Design::ComponentChangingEventHandler**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemComponentModelDesignComponentChangingEventHandlerFreeList); } - void Transform::SetParent(UnityEngine::Transform& parent) + System::ComponentModel::Design::ComponentChangingEventHandler* GetSystemComponentModelDesignComponentChangingEventHandler(int32_t handle) { - Plugin::UnityEngineTransformMethodSetParentUnityEngineTransform(Handle, parent.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + assert(handle >= 0 && handle < SystemComponentModelDesignComponentChangingEventHandlerFreeListSize); + return SystemComponentModelDesignComponentChangingEventHandlerFreeList[handle]; } -} - -namespace UnityEngine -{ - Color::Color() + + void RemoveSystemComponentModelDesignComponentChangingEventHandler(int32_t handle) { + System::ComponentModel::Design::ComponentChangingEventHandler** pRelease = SystemComponentModelDesignComponentChangingEventHandlerFreeList + handle; + *pRelease = (System::ComponentModel::Design::ComponentChangingEventHandler*)NextFreeSystemComponentModelDesignComponentChangingEventHandler; + NextFreeSystemComponentModelDesignComponentChangingEventHandler = pRelease; } -} - -namespace System -{ - Object::Object(UnityEngine::Color& val) + int32_t SystemComponentModelDesignComponentChangedEventHandlerFreeListSize; + System::ComponentModel::Design::ComponentChangedEventHandler** SystemComponentModelDesignComponentChangedEventHandlerFreeList; + System::ComponentModel::Design::ComponentChangedEventHandler** NextFreeSystemComponentModelDesignComponentChangedEventHandler; + + int32_t StoreSystemComponentModelDesignComponentChangedEventHandler(System::ComponentModel::Design::ComponentChangedEventHandler* del) { - int32_t handle = Plugin::BoxColor(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } + assert(NextFreeSystemComponentModelDesignComponentChangedEventHandler != nullptr); + System::ComponentModel::Design::ComponentChangedEventHandler** pNext = NextFreeSystemComponentModelDesignComponentChangedEventHandler; + NextFreeSystemComponentModelDesignComponentChangedEventHandler = (System::ComponentModel::Design::ComponentChangedEventHandler**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemComponentModelDesignComponentChangedEventHandlerFreeList); } - Object::operator UnityEngine::Color() + System::ComponentModel::Design::ComponentChangedEventHandler* GetSystemComponentModelDesignComponentChangedEventHandler(int32_t handle) { - UnityEngine::Color returnVal(Plugin::UnboxColor(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; + assert(handle >= 0 && handle < SystemComponentModelDesignComponentChangedEventHandlerFreeListSize); + return SystemComponentModelDesignComponentChangedEventHandlerFreeList[handle]; + } + + void RemoveSystemComponentModelDesignComponentChangedEventHandler(int32_t handle) + { + System::ComponentModel::Design::ComponentChangedEventHandler** pRelease = SystemComponentModelDesignComponentChangedEventHandlerFreeList + handle; + *pRelease = (System::ComponentModel::Design::ComponentChangedEventHandler*)NextFreeSystemComponentModelDesignComponentChangedEventHandler; + NextFreeSystemComponentModelDesignComponentChangedEventHandler = pRelease; + } + int32_t SystemComponentModelDesignComponentRenameEventHandlerFreeListSize; + System::ComponentModel::Design::ComponentRenameEventHandler** SystemComponentModelDesignComponentRenameEventHandlerFreeList; + System::ComponentModel::Design::ComponentRenameEventHandler** NextFreeSystemComponentModelDesignComponentRenameEventHandler; + + int32_t StoreSystemComponentModelDesignComponentRenameEventHandler(System::ComponentModel::Design::ComponentRenameEventHandler* del) + { + assert(NextFreeSystemComponentModelDesignComponentRenameEventHandler != nullptr); + System::ComponentModel::Design::ComponentRenameEventHandler** pNext = NextFreeSystemComponentModelDesignComponentRenameEventHandler; + NextFreeSystemComponentModelDesignComponentRenameEventHandler = (System::ComponentModel::Design::ComponentRenameEventHandler**)*pNext; + *pNext = del; + return (int32_t)(pNext - SystemComponentModelDesignComponentRenameEventHandlerFreeList); } + + System::ComponentModel::Design::ComponentRenameEventHandler* GetSystemComponentModelDesignComponentRenameEventHandler(int32_t handle) + { + assert(handle >= 0 && handle < SystemComponentModelDesignComponentRenameEventHandlerFreeListSize); + return SystemComponentModelDesignComponentRenameEventHandlerFreeList[handle]; + } + + void RemoveSystemComponentModelDesignComponentRenameEventHandler(int32_t handle) + { + System::ComponentModel::Design::ComponentRenameEventHandler** pRelease = SystemComponentModelDesignComponentRenameEventHandlerFreeList + handle; + *pRelease = (System::ComponentModel::Design::ComponentRenameEventHandler*)NextFreeSystemComponentModelDesignComponentRenameEventHandler; + NextFreeSystemComponentModelDesignComponentRenameEventHandler = pRelease; + } + /*END GLOBAL STATE AND FUNCTIONS*/ } -namespace UnityEngine +namespace Plugin { - GradientColorKey::GradientColorKey() - { - } + // An unhandled exception caused by C++ calling into C# + System::Exception* unhandledCsharpException = nullptr; } +//////////////////////////////////////////////////////////////// +// Mirrors of C# types. These wrap the C# functions to present +// a similiar API as in C#. +//////////////////////////////////////////////////////////////// + namespace System { - Object::Object(UnityEngine::GradientColorKey& val) + Object::Object() + : Plugin::ManagedType(nullptr) { - int32_t handle = Plugin::BoxGradientColorKey(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } } - Object::operator UnityEngine::GradientColorKey() + Object::Object(Plugin::InternalUse iu, int32_t handle) + : ManagedType(Plugin::InternalUse::Only, handle) { - UnityEngine::GradientColorKey returnVal(Plugin::UnboxGradientColorKey(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; } -} - -namespace UnityEngine -{ - Resolution::Resolution(decltype(nullptr)) - : System::ValueType(nullptr) + + Object::Object(decltype(nullptr)) + : ManagedType(nullptr) { } - Resolution::Resolution(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(nullptr) + bool Object::operator==(decltype(nullptr)) const + { + return Handle == 0; + } + + bool Object::operator!=(decltype(nullptr)) const + { + return Handle != 0; + } + + void Object::ThrowReferenceToThis() + { + throw *this; + } + + ValueType::ValueType(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) + { + } + + ValueType::ValueType(decltype(nullptr)) + : Object(nullptr) + { + } + + Enum::Enum(Plugin::InternalUse iu, int32_t handle) + : ValueType(iu, handle) + { + } + + Enum::Enum(decltype(nullptr)) + : ValueType(nullptr) + { + } + + String::String(decltype(nullptr)) + : Object(Plugin::InternalUse::Only, 0) + { + } + + String::String(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) { - Handle = handle; if (handle) { - Plugin::ReferenceManagedUnityEngineResolution(Handle); + Plugin::ReferenceManagedClass(handle); } } - Resolution::Resolution(const Resolution& other) - : Resolution(Plugin::InternalUse::Only, other.Handle) + String::String(const String& other) + : Object(Plugin::InternalUse::Only, other.Handle) { + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } - Resolution::Resolution(Resolution&& other) - : Resolution(Plugin::InternalUse::Only, other.Handle) + String::String(String&& other) + : Object(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - Resolution::~Resolution() + String::~String() { if (Handle) { - Plugin::DereferenceManagedUnityEngineResolution(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } } - Resolution& Resolution::operator=(const Resolution& other) + String& String::operator=(const String& other) { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEngineResolution(Handle); - } - this->Handle = other.Handle; - if (this->Handle) + if (Handle != other.Handle) { - Plugin::ReferenceManagedUnityEngineResolution(Handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } return *this; } - Resolution& Resolution::operator=(decltype(nullptr)) + String& String::operator=(decltype(nullptr)) { if (Handle) { - Plugin::DereferenceManagedUnityEngineResolution(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; } - Resolution& Resolution::operator=(Resolution&& other) + String& String::operator=(String&& other) { if (Handle) { - Plugin::DereferenceManagedUnityEngineResolution(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool Resolution::operator==(const Resolution& other) const + String::String(const char* chars) + : Object(Plugin::InternalUse::Only, Plugin::StringNew(chars)) { - return Handle == other.Handle; } - bool Resolution::operator!=(const Resolution& other) const + ICloneable::ICloneable(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) { - return Handle != other.Handle; } - int32_t Resolution::GetWidth() + ICloneable::ICloneable(decltype(nullptr)) + : Object(nullptr) { - auto returnValue = Plugin::UnityEngineResolutionPropertyGetWidth(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; } - void Resolution::SetWidth(int32_t value) + namespace Collections { - Plugin::UnityEngineResolutionPropertySetWidth(Handle, value); - if (Plugin::unhandledCsharpException) + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } - } - - int32_t Resolution::GetHeight() - { - auto returnValue = Plugin::UnityEngineResolutionPropertyGetHeight(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + + IEnumerable::IEnumerable(decltype(nullptr)) + : Object(nullptr) + { } - return returnValue; - } - - void Resolution::SetHeight(int32_t value) - { - Plugin::UnityEngineResolutionPropertySetHeight(Handle, value); - if (Plugin::unhandledCsharpException) + + IEnumerator IEnumerable::GetEnumerator() { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return IEnumerator( + Plugin::InternalUse::Only, + Plugin::EnumerableGetEnumerator(Handle)); } - } - - int32_t Resolution::GetRefreshRate() - { - auto returnValue = Plugin::UnityEngineResolutionPropertyGetRefreshRate(Handle); - if (Plugin::unhandledCsharpException) + + Plugin::EnumerableIterator begin( + System::Collections::IEnumerable& enumerable) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Plugin::EnumerableIterator(enumerable); } - return returnValue; - } - - void Resolution::SetRefreshRate(int32_t value) - { - Plugin::UnityEngineResolutionPropertySetRefreshRate(Handle, value); - if (Plugin::unhandledCsharpException) + + Plugin::EnumerableIterator end( + System::Collections::IEnumerable& enumerable) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Plugin::EnumerableIterator(nullptr); } - } -} - -namespace System -{ - Object::Object(UnityEngine::Resolution& val) - { - int32_t handle = Plugin::BoxResolution(val.Handle); - if (Plugin::unhandledCsharpException) + + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) + , IEnumerable(nullptr) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } - if (handle) + + ICollection::ICollection(decltype(nullptr)) + : Object(nullptr) + , IEnumerable(nullptr) + { + } + + IList::IList(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) + , IEnumerable(nullptr) + , ICollection(nullptr) + { + } + + IList::IList(decltype(nullptr)) + : Object(nullptr) + , IEnumerable(nullptr) + , ICollection(nullptr) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; } } - Object::operator UnityEngine::Resolution() + Array::Array(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) + , ICloneable(nullptr) + , Collections::IEnumerable(nullptr) + , Collections::ICollection(nullptr) + , Collections::IList(nullptr) { - UnityEngine::Resolution returnVal(Plugin::InternalUse::Only, Plugin::UnboxResolution(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; + } + + Array::Array(decltype(nullptr)) + : Object(nullptr) + , ICloneable(nullptr) + , Collections::IEnumerable(nullptr) + , Collections::ICollection(nullptr) + , Collections::IList(nullptr) + { + } + + int32_t Array::GetLength() + { + return Plugin::ArrayGetLength(Handle); + } + + int32_t Array::GetRank() + { + return 0; } } -namespace UnityEngine +/*BEGIN METHOD DEFINITIONS*/ +namespace System { - RaycastHit::RaycastHit(decltype(nullptr)) - : System::ValueType(nullptr) + IFormattable::IFormattable(decltype(nullptr)) { } - RaycastHit::RaycastHit(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(nullptr) + IFormattable::IFormattable(Plugin::InternalUse, int32_t handle) { Handle = handle; if (handle) { - Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); + Plugin::ReferenceManagedClass(handle); } } - RaycastHit::RaycastHit(const RaycastHit& other) - : RaycastHit(Plugin::InternalUse::Only, other.Handle) + IFormattable::IFormattable(const IFormattable& other) + : IFormattable(Plugin::InternalUse::Only, other.Handle) { } - RaycastHit::RaycastHit(RaycastHit&& other) - : RaycastHit(Plugin::InternalUse::Only, other.Handle) + IFormattable::IFormattable(IFormattable&& other) + : IFormattable(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - RaycastHit::~RaycastHit() + IFormattable::~IFormattable() { if (Handle) { - Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } } - RaycastHit& RaycastHit::operator=(const RaycastHit& other) + IFormattable& IFormattable::operator=(const IFormattable& other) { if (this->Handle) { - Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); + Plugin::DereferenceManagedClass(this->Handle); } this->Handle = other.Handle; if (this->Handle) { - Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); + Plugin::ReferenceManagedClass(this->Handle); } return *this; } - RaycastHit& RaycastHit::operator=(decltype(nullptr)) + IFormattable& IFormattable::operator=(decltype(nullptr)) { if (Handle) { - Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; } - RaycastHit& RaycastHit::operator=(RaycastHit&& other) + IFormattable& IFormattable::operator=(IFormattable&& other) { if (Handle) { - Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool RaycastHit::operator==(const RaycastHit& other) const + bool IFormattable::operator==(const IFormattable& other) const { return Handle == other.Handle; } - bool RaycastHit::operator!=(const RaycastHit& other) const + bool IFormattable::operator!=(const IFormattable& other) const { return Handle != other.Handle; } +} + +namespace System +{ + IConvertible::IConvertible(decltype(nullptr)) + { + } - UnityEngine::Vector3 RaycastHit::GetPoint() + IConvertible::IConvertible(Plugin::InternalUse, int32_t handle) { - auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetPoint(Handle); - if (Plugin::unhandledCsharpException) + Handle = handle; + if (handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(handle); } - return returnValue; } - void RaycastHit::SetPoint(UnityEngine::Vector3& value) + IConvertible::IConvertible(const IConvertible& other) + : IConvertible(Plugin::InternalUse::Only, other.Handle) { - Plugin::UnityEngineRaycastHitPropertySetPoint(Handle, value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } } - UnityEngine::Transform RaycastHit::GetTransform() + IConvertible::IConvertible(IConvertible&& other) + : IConvertible(Plugin::InternalUse::Only, other.Handle) { - auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetTransform(Handle); - if (Plugin::unhandledCsharpException) + other.Handle = 0; + } + + IConvertible::~IConvertible() + { + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); } -} - -namespace System -{ - Object::Object(UnityEngine::RaycastHit& val) + + IConvertible& IConvertible::operator=(const IConvertible& other) { - int32_t handle = Plugin::BoxRaycastHit(val.Handle); - if (Plugin::unhandledCsharpException) + if (this->Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(this->Handle); } - if (handle) + this->Handle = other.Handle; + if (this->Handle) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } - Object::operator UnityEngine::RaycastHit() + IConvertible& IConvertible::operator=(decltype(nullptr)) { - UnityEngine::RaycastHit returnVal(Plugin::InternalUse::Only, Plugin::UnboxRaycastHit(Handle)); - if (Plugin::unhandledCsharpException) + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - return returnVal; + return *this; + } + + IConvertible& IConvertible::operator=(IConvertible&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IConvertible::operator==(const IConvertible& other) const + { + return Handle == other.Handle; + } + + bool IConvertible::operator!=(const IConvertible& other) const + { + return Handle != other.Handle; } } namespace System { - namespace Collections + IComparable::IComparable(decltype(nullptr)) { - IEnumerator::IEnumerator(decltype(nullptr)) + } + + IComparable::IComparable(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) { + Plugin::ReferenceManagedClass(handle); } - - IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) + } + + IComparable::IComparable(const IComparable& other) + : IComparable(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparable::IComparable(IComparable&& other) + : IComparable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparable::~IComparable() + { + if (Handle) { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) + } + + IComparable& IComparable::operator=(const IComparable& other) + { + if (this->Handle) { + Plugin::DereferenceManagedClass(this->Handle); } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) + this->Handle = other.Handle; + if (this->Handle) { - other.Handle = 0; + Plugin::ReferenceManagedClass(this->Handle); } - - IEnumerator::~IEnumerator() + return *this; + } + + IComparable& IComparable::operator=(decltype(nullptr)) + { + if (Handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) + return *this; + } + + IComparable& IComparable::operator=(IComparable&& other) + { + if (Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; + Plugin::DereferenceManagedClass(Handle); } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparable::operator==(const IComparable& other) const + { + return Handle == other.Handle; + } + + bool IComparable::operator!=(const IComparable& other) const + { + return Handle != other.Handle; + } + + System::Int32 IComparable::CompareTo(System::Object& obj) + { + auto returnValue = Plugin::SystemIComparableMethodCompareToSystemObject(Handle, obj.Handle); + if (Plugin::unhandledCsharpException) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) + return returnValue; + } +} + +namespace System +{ + IDisposable::IDisposable(decltype(nullptr)) + { + } + + IDisposable::IDisposable(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; + Plugin::ReferenceManagedClass(handle); } - - bool IEnumerator::operator==(const IEnumerator& other) const + } + + IDisposable::IDisposable(const IDisposable& other) + : IDisposable(Plugin::InternalUse::Only, other.Handle) + { + } + + IDisposable::IDisposable(IDisposable&& other) + : IDisposable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IDisposable::~IDisposable() + { + if (Handle) { - return Handle == other.Handle; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - bool IEnumerator::operator!=(const IEnumerator& other) const + } + + IDisposable& IDisposable::operator=(const IDisposable& other) + { + if (this->Handle) { - return Handle != other.Handle; + Plugin::DereferenceManagedClass(this->Handle); } - - System::Object IEnumerator::GetCurrent() + this->Handle = other.Handle; + if (this->Handle) { - auto returnValue = Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Object(Plugin::InternalUse::Only, returnValue); + Plugin::ReferenceManagedClass(this->Handle); } - - System::Boolean IEnumerator::MoveNext() + return *this; + } + + IDisposable& IDisposable::operator=(decltype(nullptr)) + { + if (Handle) { - auto returnValue = Plugin::SystemCollectionsIEnumeratorMethodMoveNext(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IDisposable& IDisposable::operator=(IDisposable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IDisposable::operator==(const IDisposable& other) const + { + return Handle == other.Handle; + } + + bool IDisposable::operator!=(const IDisposable& other) const + { + return Handle != other.Handle; + } + + void IDisposable::Dispose() + { + Plugin::SystemIDisposableMethodDispose(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } } } -namespace System +namespace UnityEngine { - namespace Collections + Vector3::Vector3() { - namespace Generic + } + + Vector3::Vector3(System::Single x, System::Single y, System::Single z) + { + auto returnValue = Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(x, y, z); + if (Plugin::unhandledCsharpException) { - IEnumerator::IEnumerator(decltype(nullptr)) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerator::operator==(const IEnumerator& other) const - { - return Handle == other.Handle; - } - - bool IEnumerator::operator!=(const IEnumerator& other) const - { - return Handle != other.Handle; - } - - System::String IEnumerator::GetCurrent() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + *this = returnValue; + } + + System::Single Vector3::GetMagnitude() + { + auto returnValue = Plugin::UnityEngineVector3PropertyGetMagnitude(this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + void Vector3::Set(System::Single newX, System::Single newY, System::Single newZ) + { + Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(this, newX, newY, newZ); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + UnityEngine::Vector3 Vector3::operator+(UnityEngine::Vector3& a) + { + auto returnValue = Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(*this, a); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + UnityEngine::Vector3 Vector3::operator-() + { + auto returnValue = Plugin::UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + Vector3::operator System::ValueType() + { + int32_t handle = Plugin::BoxVector3(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + Vector3::operator System::Object() + { + int32_t handle = Plugin::BoxVector3(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); } + return nullptr; } } namespace System { - namespace Collections + Object::operator UnityEngine::Vector3() { - namespace Generic + UnityEngine::Vector3 returnVal(Plugin::UnboxVector3(Handle)); + if (Plugin::unhandledCsharpException) { - IEnumerator::IEnumerator(decltype(nullptr)) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerator::operator==(const IEnumerator& other) const - { - return Handle == other.Handle; - } - - bool IEnumerator::operator!=(const IEnumerator& other) const - { - return Handle != other.Handle; - } - - int32_t IEnumerator::GetCurrent() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnVal; } } -namespace System +namespace UnityEngine { - namespace Collections + Object::Object(decltype(nullptr)) { - namespace Generic + } + + Object::Object(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) { - IEnumerator::IEnumerator(decltype(nullptr)) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerator::operator==(const IEnumerator& other) const - { - return Handle == other.Handle; - } - - bool IEnumerator::operator!=(const IEnumerator& other) const - { - return Handle != other.Handle; - } - - float IEnumerator::GetCurrent() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } + Plugin::ReferenceManagedClass(handle); } } -} - -namespace System -{ - namespace Collections + + Object::Object(const Object& other) + : Object(Plugin::InternalUse::Only, other.Handle) { - namespace Generic + } + + Object::Object(Object&& other) + : Object(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Object::~Object() + { + if (Handle) { - IEnumerator::IEnumerator(decltype(nullptr)) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerator::operator==(const IEnumerator& other) const - { - return Handle == other.Handle; - } - - bool IEnumerator::operator!=(const IEnumerator& other) const - { - return Handle != other.Handle; - } - - UnityEngine::RaycastHit IEnumerator::GetCurrent() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::RaycastHit(Plugin::InternalUse::Only, returnValue); - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } -} - -namespace System -{ - namespace Collections + + Object& Object::operator=(const Object& other) { - namespace Generic + if (this->Handle) { - IEnumerator::IEnumerator(decltype(nullptr)) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerator::operator==(const IEnumerator& other) const - { - return Handle == other.Handle; - } - - bool IEnumerator::operator!=(const IEnumerator& other) const - { - return Handle != other.Handle; - } - - UnityEngine::GradientColorKey IEnumerator::GetCurrent() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } -} - -namespace System -{ - namespace Collections + + Object& Object::operator=(decltype(nullptr)) { - namespace Generic + if (Handle) { - IEnumerator::IEnumerator(decltype(nullptr)) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse iu, int32_t handle) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerator::operator==(const IEnumerator& other) const - { - return Handle == other.Handle; - } - - bool IEnumerator::operator!=(const IEnumerator& other) const - { - return Handle != other.Handle; - } - - UnityEngine::Resolution IEnumerator::GetCurrent() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Resolution(Plugin::InternalUse::Only, returnValue); - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } + return *this; } -} - -namespace System -{ - namespace Collections + + Object& Object::operator=(Object&& other) { - namespace Generic + if (Handle) { - IEnumerable::IEnumerable(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - { - } - - IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerable::~IEnumerable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerable& IEnumerable::operator=(const IEnumerable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerable& IEnumerable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerable& IEnumerable::operator=(IEnumerable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerable::operator==(const IEnumerable& other) const - { - return Handle == other.Handle; - } - - bool IEnumerable::operator!=(const IEnumerable& other) const - { - return Handle != other.Handle; - } - - System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); - } + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; } -} - -namespace System -{ - namespace Collections + + bool Object::operator==(const Object& other) const { - namespace Generic - { - IEnumerable::IEnumerable(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - { - } - - IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerable::~IEnumerable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerable& IEnumerable::operator=(const IEnumerable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerable& IEnumerable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerable& IEnumerable::operator=(IEnumerable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerable::operator==(const IEnumerable& other) const - { - return Handle == other.Handle; - } - - bool IEnumerable::operator!=(const IEnumerable& other) const - { - return Handle != other.Handle; - } - - System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); - } + return Handle == other.Handle; + } + + bool Object::operator!=(const Object& other) const + { + return Handle != other.Handle; + } + + System::String Object::GetName() + { + auto returnValue = Plugin::UnityEngineObjectPropertyGetName(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return System::String(Plugin::InternalUse::Only, returnValue); } -} - -namespace System -{ - namespace Collections + + void Object::SetName(System::String& value) { - namespace Generic + Plugin::UnityEngineObjectPropertySetName(Handle, value.Handle); + if (Plugin::unhandledCsharpException) { - IEnumerable::IEnumerable(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - { - } - - IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerable::~IEnumerable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerable& IEnumerable::operator=(const IEnumerable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerable& IEnumerable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerable& IEnumerable::operator=(IEnumerable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerable::operator==(const IEnumerable& other) const - { - return Handle == other.Handle; - } - - bool IEnumerable::operator!=(const IEnumerable& other) const - { - return Handle != other.Handle; - } - - System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + System::Boolean Object::operator==(UnityEngine::Object& x) + { + auto returnValue = Plugin::UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject(Handle, x.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + Object::operator System::Boolean() + { + auto returnValue = Plugin::UnityEngineObjectMethodop_ImplicitUnityEngineObject(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnValue; } } -namespace System +namespace UnityEngine { - namespace Collections + Component::Component(decltype(nullptr)) + : UnityEngine::Object(nullptr) { - namespace Generic + } + + Component::Component(Plugin::InternalUse, int32_t handle) + : UnityEngine::Object(nullptr) + { + Handle = handle; + if (handle) { - IEnumerable::IEnumerable(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - { - } - - IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerable::~IEnumerable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerable& IEnumerable::operator=(const IEnumerable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerable& IEnumerable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerable& IEnumerable::operator=(IEnumerable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerable::operator==(const IEnumerable& other) const - { - return Handle == other.Handle; - } - - bool IEnumerable::operator!=(const IEnumerable& other) const - { - return Handle != other.Handle; - } - - System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); - } + Plugin::ReferenceManagedClass(handle); } } -} - -namespace System -{ - namespace Collections + + Component::Component(const Component& other) + : Component(Plugin::InternalUse::Only, other.Handle) { - namespace Generic + } + + Component::Component(Component&& other) + : Component(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Component::~Component() + { + if (Handle) { - IEnumerable::IEnumerable(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - { - } - - IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerable::~IEnumerable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerable& IEnumerable::operator=(const IEnumerable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerable& IEnumerable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerable& IEnumerable::operator=(IEnumerable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerable::operator==(const IEnumerable& other) const - { - return Handle == other.Handle; - } - - bool IEnumerable::operator!=(const IEnumerable& other) const - { - return Handle != other.Handle; - } - - System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Component& Component::operator=(const Component& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Component& Component::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Component& Component::operator=(Component&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Component::operator==(const Component& other) const + { + return Handle == other.Handle; + } + + bool Component::operator!=(const Component& other) const + { + return Handle != other.Handle; + } + + UnityEngine::Transform Component::GetTransform() + { + auto returnValue = Plugin::UnityEngineComponentPropertyGetTransform(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); } } -namespace System +namespace UnityEngine { - namespace Collections + Transform::Transform(decltype(nullptr)) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , System::Collections::IEnumerable(nullptr) { - namespace Generic + } + + Transform::Transform(Plugin::InternalUse, int32_t handle) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , System::Collections::IEnumerable(nullptr) + { + Handle = handle; + if (handle) { - IEnumerable::IEnumerable(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - { - } - - IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerable::~IEnumerable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerable& IEnumerable::operator=(const IEnumerable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerable& IEnumerable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerable& IEnumerable::operator=(IEnumerable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerable::operator==(const IEnumerable& other) const - { - return Handle == other.Handle; - } - - bool IEnumerable::operator!=(const IEnumerable& other) const - { - return Handle != other.Handle; - } - - System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); - } + Plugin::ReferenceManagedClass(handle); } } -} - -namespace System -{ - namespace Collections + + Transform::Transform(const Transform& other) + : Transform(Plugin::InternalUse::Only, other.Handle) { - namespace Generic - { - ICollection::ICollection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - } - - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - } - - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ICollection::~ICollection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ICollection& ICollection::operator=(const ICollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ICollection& ICollection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ICollection& ICollection::operator=(ICollection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ICollection::operator==(const ICollection& other) const - { - return Handle == other.Handle; - } - - bool ICollection::operator!=(const ICollection& other) const - { - return Handle != other.Handle; - } - } } -} - -namespace Plugin -{ - SystemCollectionsGenericICollectionSystemStringIterator::SystemCollectionsGenericICollectionSystemStringIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) + + Transform::Transform(Transform&& other) + : Transform(Plugin::InternalUse::Only, other.Handle) { + other.Handle = 0; } - SystemCollectionsGenericICollectionSystemStringIterator::SystemCollectionsGenericICollectionSystemStringIterator(System::Collections::Generic::ICollection& enumerable) - : enumerator(enumerable.GetEnumerator()) + Transform::~Transform() { - hasMore = enumerator.MoveNext(); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - SystemCollectionsGenericICollectionSystemStringIterator::~SystemCollectionsGenericICollectionSystemStringIterator() + Transform& Transform::operator=(const Transform& other) { - if (enumerator != nullptr) + if (this->Handle) { - enumerator.Dispose(); + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } - SystemCollectionsGenericICollectionSystemStringIterator& SystemCollectionsGenericICollectionSystemStringIterator::operator++() + Transform& Transform::operator=(decltype(nullptr)) { - hasMore = enumerator.MoveNext(); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } return *this; } - bool SystemCollectionsGenericICollectionSystemStringIterator::operator!=(const SystemCollectionsGenericICollectionSystemStringIterator& other) + Transform& Transform::operator=(Transform&& other) { - return hasMore; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - System::String SystemCollectionsGenericICollectionSystemStringIterator::operator*() + bool Transform::operator==(const Transform& other) const { - return enumerator.GetCurrent(); + return Handle == other.Handle; } -} - -namespace System -{ - namespace Collections + + bool Transform::operator!=(const Transform& other) const { - namespace Generic + return Handle != other.Handle; + } + + UnityEngine::Vector3 Transform::GetPosition() + { + auto returnValue = Plugin::UnityEngineTransformPropertyGetPosition(Handle); + if (Plugin::unhandledCsharpException) { - Plugin::SystemCollectionsGenericICollectionSystemStringIterator begin(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionSystemStringIterator(enumerable); - } - - Plugin::SystemCollectionsGenericICollectionSystemStringIterator end(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionSystemStringIterator(nullptr); - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnValue; } -} - -namespace System -{ - namespace Collections + + void Transform::SetPosition(UnityEngine::Vector3& value) { - namespace Generic + Plugin::UnityEngineTransformPropertySetPosition(Handle, value); + if (Plugin::unhandledCsharpException) { - ICollection::ICollection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - } - - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - } - - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ICollection::~ICollection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ICollection& ICollection::operator=(const ICollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ICollection& ICollection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ICollection& ICollection::operator=(ICollection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ICollection::operator==(const ICollection& other) const - { - return Handle == other.Handle; - } - - bool ICollection::operator!=(const ICollection& other) const - { - return Handle != other.Handle; - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void Transform::SetParent(UnityEngine::Transform& parent) + { + Plugin::UnityEngineTransformMethodSetParentUnityEngineTransform(Handle, parent.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } } } -namespace Plugin +namespace UnityEngine { - SystemCollectionsGenericICollectionSystemInt32Iterator::SystemCollectionsGenericICollectionSystemInt32Iterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) + Color::Color() { } - SystemCollectionsGenericICollectionSystemInt32Iterator::SystemCollectionsGenericICollectionSystemInt32Iterator(System::Collections::Generic::ICollection& enumerable) - : enumerator(enumerable.GetEnumerator()) + Color::operator System::ValueType() { - hasMore = enumerator.MoveNext(); + int32_t handle = Plugin::BoxColor(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; } - SystemCollectionsGenericICollectionSystemInt32Iterator::~SystemCollectionsGenericICollectionSystemInt32Iterator() + Color::operator System::Object() { - if (enumerator != nullptr) + int32_t handle = Plugin::BoxColor(*this); + if (Plugin::unhandledCsharpException) { - enumerator.Dispose(); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; + } +} + +namespace System +{ + Object::operator UnityEngine::Color() + { + UnityEngine::Color returnVal(Plugin::UnboxColor(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnVal; } - - SystemCollectionsGenericICollectionSystemInt32Iterator& SystemCollectionsGenericICollectionSystemInt32Iterator::operator++() +} + +namespace UnityEngine +{ + GradientColorKey::GradientColorKey() { - hasMore = enumerator.MoveNext(); - return *this; } - bool SystemCollectionsGenericICollectionSystemInt32Iterator::operator!=(const SystemCollectionsGenericICollectionSystemInt32Iterator& other) + GradientColorKey::operator System::ValueType() { - return hasMore; + int32_t handle = Plugin::BoxGradientColorKey(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; } - int32_t SystemCollectionsGenericICollectionSystemInt32Iterator::operator*() + GradientColorKey::operator System::Object() { - return enumerator.GetCurrent(); + int32_t handle = Plugin::BoxGradientColorKey(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; } } namespace System { - namespace Collections + Object::operator UnityEngine::GradientColorKey() { - namespace Generic + UnityEngine::GradientColorKey returnVal(Plugin::UnboxGradientColorKey(Handle)); + if (Plugin::unhandledCsharpException) { - Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator begin(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator(enumerable); - } - - Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator end(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator(nullptr); - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnVal; } } -namespace System +namespace UnityEngine { - namespace Collections + Resolution::Resolution(decltype(nullptr)) { - namespace Generic + } + + Resolution::Resolution(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) { - ICollection::ICollection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - } - - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - } - - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ICollection::~ICollection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ICollection& ICollection::operator=(const ICollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ICollection& ICollection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ICollection& ICollection::operator=(ICollection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ICollection::operator==(const ICollection& other) const - { - return Handle == other.Handle; - } - - bool ICollection::operator!=(const ICollection& other) const - { - return Handle != other.Handle; - } + Plugin::ReferenceManagedUnityEngineResolution(Handle); } } -} - -namespace Plugin -{ - SystemCollectionsGenericICollectionSystemSingleIterator::SystemCollectionsGenericICollectionSystemSingleIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) + + Resolution::Resolution(const Resolution& other) + : Resolution(Plugin::InternalUse::Only, other.Handle) { } - SystemCollectionsGenericICollectionSystemSingleIterator::SystemCollectionsGenericICollectionSystemSingleIterator(System::Collections::Generic::ICollection& enumerable) - : enumerator(enumerable.GetEnumerator()) + Resolution::Resolution(Resolution&& other) + : Resolution(Plugin::InternalUse::Only, other.Handle) { - hasMore = enumerator.MoveNext(); + other.Handle = 0; } - SystemCollectionsGenericICollectionSystemSingleIterator::~SystemCollectionsGenericICollectionSystemSingleIterator() + Resolution::~Resolution() { - if (enumerator != nullptr) + if (Handle) { - enumerator.Dispose(); + Plugin::DereferenceManagedUnityEngineResolution(Handle); + Handle = 0; } } - SystemCollectionsGenericICollectionSystemSingleIterator& SystemCollectionsGenericICollectionSystemSingleIterator::operator++() + Resolution& Resolution::operator=(const Resolution& other) { - hasMore = enumerator.MoveNext(); + if (this->Handle) + { + Plugin::DereferenceManagedUnityEngineResolution(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEngineResolution(Handle); + } return *this; } - bool SystemCollectionsGenericICollectionSystemSingleIterator::operator!=(const SystemCollectionsGenericICollectionSystemSingleIterator& other) - { - return hasMore; - } - - float SystemCollectionsGenericICollectionSystemSingleIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections + Resolution& Resolution::operator=(decltype(nullptr)) { - namespace Generic + if (Handle) { - Plugin::SystemCollectionsGenericICollectionSystemSingleIterator begin(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionSystemSingleIterator(enumerable); - } - - Plugin::SystemCollectionsGenericICollectionSystemSingleIterator end(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionSystemSingleIterator(nullptr); - } + Plugin::DereferenceManagedUnityEngineResolution(Handle); + Handle = 0; } + return *this; } -} - -namespace System -{ - namespace Collections + + Resolution& Resolution::operator=(Resolution&& other) { - namespace Generic + if (Handle) { - ICollection::ICollection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - } - - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - } - - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ICollection::~ICollection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ICollection& ICollection::operator=(const ICollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ICollection& ICollection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ICollection& ICollection::operator=(ICollection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ICollection::operator==(const ICollection& other) const - { - return Handle == other.Handle; - } - - bool ICollection::operator!=(const ICollection& other) const - { - return Handle != other.Handle; - } + Plugin::DereferenceManagedUnityEngineResolution(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; } -} - -namespace Plugin -{ - SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) + + bool Resolution::operator==(const Resolution& other) const { + return Handle == other.Handle; } - SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(System::Collections::Generic::ICollection& enumerable) - : enumerator(enumerable.GetEnumerator()) + bool Resolution::operator!=(const Resolution& other) const { - hasMore = enumerator.MoveNext(); + return Handle != other.Handle; } - SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::~SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator() + Resolution::Resolution() { - if (enumerator != nullptr) + auto returnValue = Plugin::UnityEngineResolutionConstructor(); + if (Plugin::unhandledCsharpException) { - enumerator.Dispose(); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedUnityEngineResolution(Handle); } } - SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::operator++() + System::Int32 Resolution::GetWidth() { - hasMore = enumerator.MoveNext(); - return *this; + auto returnValue = Plugin::UnityEngineResolutionPropertyGetWidth(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; } - bool SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::operator!=(const SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& other) + void Resolution::SetWidth(System::Int32 value) { - return hasMore; + Plugin::UnityEngineResolutionPropertySetWidth(Handle, value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - UnityEngine::RaycastHit SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections + System::Int32 Resolution::GetHeight() { - namespace Generic + auto returnValue = Plugin::UnityEngineResolutionPropertyGetHeight(Handle); + if (Plugin::unhandledCsharpException) { - Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator begin(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(enumerable); - } - - Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator end(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(nullptr); - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnValue; } -} - -namespace System -{ - namespace Collections + + void Resolution::SetHeight(System::Int32 value) { - namespace Generic + Plugin::UnityEngineResolutionPropertySetHeight(Handle, value); + if (Plugin::unhandledCsharpException) { - ICollection::ICollection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - } - - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - } - - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ICollection::~ICollection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ICollection& ICollection::operator=(const ICollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ICollection& ICollection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ICollection& ICollection::operator=(ICollection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ICollection::operator==(const ICollection& other) const - { - return Handle == other.Handle; - } - - bool ICollection::operator!=(const ICollection& other) const - { - return Handle != other.Handle; - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } } -} - -namespace Plugin -{ - SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(System::Collections::Generic::ICollection& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::~SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator() + System::Int32 Resolution::GetRefreshRate() { - if (enumerator != nullptr) + auto returnValue = Plugin::UnityEngineResolutionPropertyGetRefreshRate(Handle); + if (Plugin::unhandledCsharpException) { - enumerator.Dispose(); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnValue; } - SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::operator++() + void Resolution::SetRefreshRate(System::Int32 value) { - hasMore = enumerator.MoveNext(); - return *this; + Plugin::UnityEngineResolutionPropertySetRefreshRate(Handle, value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - bool SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::operator!=(const SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& other) + Resolution::operator System::ValueType() { - return hasMore; + int32_t handle = Plugin::BoxResolution(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; } - UnityEngine::GradientColorKey SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::operator*() + Resolution::operator System::Object() { - return enumerator.GetCurrent(); + int32_t handle = Plugin::BoxResolution(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; } } namespace System { - namespace Collections + Object::operator UnityEngine::Resolution() { - namespace Generic + UnityEngine::Resolution returnVal(Plugin::InternalUse::Only, Plugin::UnboxResolution(Handle)); + if (Plugin::unhandledCsharpException) { - Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(enumerable); - } - - Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator end(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(nullptr); - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnVal; } } -namespace System +namespace UnityEngine { - namespace Collections + RaycastHit::RaycastHit(decltype(nullptr)) { - namespace Generic + } + + RaycastHit::RaycastHit(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) { - ICollection::ICollection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - } - - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - } - - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ICollection::~ICollection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ICollection& ICollection::operator=(const ICollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ICollection& ICollection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ICollection& ICollection::operator=(ICollection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ICollection::operator==(const ICollection& other) const - { - return Handle == other.Handle; - } - - bool ICollection::operator!=(const ICollection& other) const - { - return Handle != other.Handle; - } + Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); } } -} - -namespace Plugin -{ - SystemCollectionsGenericICollectionUnityEngineResolutionIterator::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) + + RaycastHit::RaycastHit(const RaycastHit& other) + : RaycastHit(Plugin::InternalUse::Only, other.Handle) { } - SystemCollectionsGenericICollectionUnityEngineResolutionIterator::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(System::Collections::Generic::ICollection& enumerable) - : enumerator(enumerable.GetEnumerator()) + RaycastHit::RaycastHit(RaycastHit&& other) + : RaycastHit(Plugin::InternalUse::Only, other.Handle) { - hasMore = enumerator.MoveNext(); + other.Handle = 0; } - SystemCollectionsGenericICollectionUnityEngineResolutionIterator::~SystemCollectionsGenericICollectionUnityEngineResolutionIterator() + RaycastHit::~RaycastHit() { - if (enumerator != nullptr) + if (Handle) { - enumerator.Dispose(); + Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); + Handle = 0; } } - SystemCollectionsGenericICollectionUnityEngineResolutionIterator& SystemCollectionsGenericICollectionUnityEngineResolutionIterator::operator++() + RaycastHit& RaycastHit::operator=(const RaycastHit& other) { - hasMore = enumerator.MoveNext(); + if (this->Handle) + { + Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); + } return *this; } - bool SystemCollectionsGenericICollectionUnityEngineResolutionIterator::operator!=(const SystemCollectionsGenericICollectionUnityEngineResolutionIterator& other) - { - return hasMore; - } - - UnityEngine::Resolution SystemCollectionsGenericICollectionUnityEngineResolutionIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections + RaycastHit& RaycastHit::operator=(decltype(nullptr)) { - namespace Generic + if (Handle) { - Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator begin(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(enumerable); - } - - Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator end(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(nullptr); - } + Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); + Handle = 0; } + return *this; } -} - -namespace System -{ - namespace Collections + + RaycastHit& RaycastHit::operator=(RaycastHit&& other) { - namespace Generic + if (Handle) { - IList::IList(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - { - } - - IList::IList(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IList::IList(const IList& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - } - - IList::IList(IList&& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IList::~IList() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IList& IList::operator=(const IList& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IList& IList::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IList& IList::operator=(IList&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IList::operator==(const IList& other) const - { - return Handle == other.Handle; - } - - bool IList::operator!=(const IList& other) const - { - return Handle != other.Handle; - } + Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; } -} - -namespace Plugin -{ - SystemCollectionsGenericIListSystemStringIterator::SystemCollectionsGenericIListSystemStringIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) + + bool RaycastHit::operator==(const RaycastHit& other) const { + return Handle == other.Handle; } - SystemCollectionsGenericIListSystemStringIterator::SystemCollectionsGenericIListSystemStringIterator(System::Collections::Generic::IList& enumerable) - : enumerator(enumerable.GetEnumerator()) + bool RaycastHit::operator!=(const RaycastHit& other) const { - hasMore = enumerator.MoveNext(); + return Handle != other.Handle; } - SystemCollectionsGenericIListSystemStringIterator::~SystemCollectionsGenericIListSystemStringIterator() + UnityEngine::Vector3 RaycastHit::GetPoint() { - if (enumerator != nullptr) + auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetPoint(Handle); + if (Plugin::unhandledCsharpException) { - enumerator.Dispose(); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnValue; } - SystemCollectionsGenericIListSystemStringIterator& SystemCollectionsGenericIListSystemStringIterator::operator++() + void RaycastHit::SetPoint(UnityEngine::Vector3& value) { - hasMore = enumerator.MoveNext(); - return *this; + Plugin::UnityEngineRaycastHitPropertySetPoint(Handle, value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - bool SystemCollectionsGenericIListSystemStringIterator::operator!=(const SystemCollectionsGenericIListSystemStringIterator& other) + UnityEngine::Transform RaycastHit::GetTransform() { - return hasMore; + auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetTransform(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); } - System::String SystemCollectionsGenericIListSystemStringIterator::operator*() + RaycastHit::operator System::ValueType() { - return enumerator.GetCurrent(); + int32_t handle = Plugin::BoxRaycastHit(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; } -} - -namespace System -{ - namespace Collections + + RaycastHit::operator System::Object() { - namespace Generic + int32_t handle = Plugin::BoxRaycastHit(Handle); + if (Plugin::unhandledCsharpException) { - Plugin::SystemCollectionsGenericIListSystemStringIterator begin(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListSystemStringIterator(enumerable); - } - - Plugin::SystemCollectionsGenericIListSystemStringIterator end(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListSystemStringIterator(nullptr); - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); } + return nullptr; } } namespace System { - namespace Collections + Object::operator UnityEngine::RaycastHit() { - namespace Generic + UnityEngine::RaycastHit returnVal(Plugin::InternalUse::Only, Plugin::UnboxRaycastHit(Handle)); + if (Plugin::unhandledCsharpException) { - IList::IList(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + namespace Collections + { + IEnumerator::IEnumerator(decltype(nullptr)) + { + } + + IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerator::~IEnumerator() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerator& IEnumerator::operator=(const IEnumerator& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerator& IEnumerator::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerator& IEnumerator::operator=(IEnumerator&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerator::operator==(const IEnumerator& other) const + { + return Handle == other.Handle; + } + + bool IEnumerator::operator!=(const IEnumerator& other) const + { + return Handle != other.Handle; + } + + System::Object IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Object(Plugin::InternalUse::Only, returnValue); + } + + System::Boolean IEnumerator::MoveNext() + { + auto returnValue = Plugin::SystemCollectionsIEnumeratorMethodMoveNext(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + } +} + +namespace System +{ + namespace Runtime + { + namespace Serialization + { + ISerializable::ISerializable(decltype(nullptr)) { } - IList::IList(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) + ISerializable::ISerializable(Plugin::InternalUse, int32_t handle) { Handle = handle; if (handle) @@ -4711,18 +3336,18 @@ namespace System } } - IList::IList(const IList& other) - : IList(Plugin::InternalUse::Only, other.Handle) + ISerializable::ISerializable(const ISerializable& other) + : ISerializable(Plugin::InternalUse::Only, other.Handle) { } - IList::IList(IList&& other) - : IList(Plugin::InternalUse::Only, other.Handle) + ISerializable::ISerializable(ISerializable&& other) + : ISerializable(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IList::~IList() + ISerializable::~ISerializable() { if (Handle) { @@ -4731,7 +3356,7 @@ namespace System } } - IList& IList::operator=(const IList& other) + ISerializable& ISerializable::operator=(const ISerializable& other) { if (this->Handle) { @@ -4745,7 +3370,7 @@ namespace System return *this; } - IList& IList::operator=(decltype(nullptr)) + ISerializable& ISerializable::operator=(decltype(nullptr)) { if (Handle) { @@ -4755,7 +3380,7 @@ namespace System return *this; } - IList& IList::operator=(IList&& other) + ISerializable& ISerializable::operator=(ISerializable&& other) { if (Handle) { @@ -4766,12 +3391,12 @@ namespace System return *this; } - bool IList::operator==(const IList& other) const + bool ISerializable::operator==(const ISerializable& other) const { return Handle == other.Handle; } - bool IList::operator!=(const IList& other) const + bool ISerializable::operator!=(const ISerializable& other) const { return Handle != other.Handle; } @@ -4779,81 +3404,17 @@ namespace System } } -namespace Plugin -{ - SystemCollectionsGenericIListSystemInt32Iterator::SystemCollectionsGenericIListSystemInt32Iterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericIListSystemInt32Iterator::SystemCollectionsGenericIListSystemInt32Iterator(System::Collections::Generic::IList& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericIListSystemInt32Iterator::~SystemCollectionsGenericIListSystemInt32Iterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericIListSystemInt32Iterator& SystemCollectionsGenericIListSystemInt32Iterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericIListSystemInt32Iterator::operator!=(const SystemCollectionsGenericIListSystemInt32Iterator& other) - { - return hasMore; - } - - int32_t SystemCollectionsGenericIListSystemInt32Iterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericIListSystemInt32Iterator begin(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListSystemInt32Iterator(enumerable); - } - - Plugin::SystemCollectionsGenericIListSystemInt32Iterator end(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListSystemInt32Iterator(nullptr); - } - } - } -} - namespace System { - namespace Collections + namespace Runtime { - namespace Generic + namespace InteropServices { - IList::IList(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) + _Exception::_Exception(decltype(nullptr)) { } - IList::IList(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) + _Exception::_Exception(Plugin::InternalUse, int32_t handle) { Handle = handle; if (handle) @@ -4862,18 +3423,18 @@ namespace System } } - IList::IList(const IList& other) - : IList(Plugin::InternalUse::Only, other.Handle) + _Exception::_Exception(const _Exception& other) + : _Exception(Plugin::InternalUse::Only, other.Handle) { } - IList::IList(IList&& other) - : IList(Plugin::InternalUse::Only, other.Handle) + _Exception::_Exception(_Exception&& other) + : _Exception(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IList::~IList() + _Exception::~_Exception() { if (Handle) { @@ -4882,7 +3443,7 @@ namespace System } } - IList& IList::operator=(const IList& other) + _Exception& _Exception::operator=(const _Exception& other) { if (this->Handle) { @@ -4896,7 +3457,7 @@ namespace System return *this; } - IList& IList::operator=(decltype(nullptr)) + _Exception& _Exception::operator=(decltype(nullptr)) { if (Handle) { @@ -4906,7 +3467,7 @@ namespace System return *this; } - IList& IList::operator=(IList&& other) + _Exception& _Exception::operator=(_Exception&& other) { if (Handle) { @@ -4917,12 +3478,12 @@ namespace System return *this; } - bool IList::operator==(const IList& other) const + bool _Exception::operator==(const _Exception& other) const { return Handle == other.Handle; } - bool IList::operator!=(const IList& other) const + bool _Exception::operator!=(const _Exception& other) const { return Handle != other.Handle; } @@ -4930,60 +3491,251 @@ namespace System } } -namespace Plugin +namespace System { - SystemCollectionsGenericIListSystemSingleIterator::SystemCollectionsGenericIListSystemSingleIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericIListSystemSingleIterator::SystemCollectionsGenericIListSystemSingleIterator(System::Collections::Generic::IList& enumerable) - : enumerator(enumerable.GetEnumerator()) + IAppDomainSetup::IAppDomainSetup(decltype(nullptr)) { - hasMore = enumerator.MoveNext(); } - SystemCollectionsGenericIListSystemSingleIterator::~SystemCollectionsGenericIListSystemSingleIterator() + IAppDomainSetup::IAppDomainSetup(Plugin::InternalUse, int32_t handle) { - if (enumerator != nullptr) + Handle = handle; + if (handle) { - enumerator.Dispose(); + Plugin::ReferenceManagedClass(handle); } } - SystemCollectionsGenericIListSystemSingleIterator& SystemCollectionsGenericIListSystemSingleIterator::operator++() + IAppDomainSetup::IAppDomainSetup(const IAppDomainSetup& other) + : IAppDomainSetup(Plugin::InternalUse::Only, other.Handle) { - hasMore = enumerator.MoveNext(); - return *this; } - bool SystemCollectionsGenericIListSystemSingleIterator::operator!=(const SystemCollectionsGenericIListSystemSingleIterator& other) + IAppDomainSetup::IAppDomainSetup(IAppDomainSetup&& other) + : IAppDomainSetup(Plugin::InternalUse::Only, other.Handle) { - return hasMore; + other.Handle = 0; } - float SystemCollectionsGenericIListSystemSingleIterator::operator*() + IAppDomainSetup::~IAppDomainSetup() { - return enumerator.GetCurrent(); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } -} - -namespace System -{ - namespace Collections + + IAppDomainSetup& IAppDomainSetup::operator=(const IAppDomainSetup& other) { - namespace Generic + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IAppDomainSetup& IAppDomainSetup::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IAppDomainSetup& IAppDomainSetup::operator=(IAppDomainSetup&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IAppDomainSetup::operator==(const IAppDomainSetup& other) const + { + return Handle == other.Handle; + } + + bool IAppDomainSetup::operator!=(const IAppDomainSetup& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + namespace Collections + { + IComparer::IComparer(decltype(nullptr)) + { + } + + IComparer::IComparer(Plugin::InternalUse, int32_t handle) { - Plugin::SystemCollectionsGenericIListSystemSingleIterator begin(System::Collections::Generic::IList& enumerable) + Handle = handle; + if (handle) { - return Plugin::SystemCollectionsGenericIListSystemSingleIterator(enumerable); + Plugin::ReferenceManagedClass(handle); } - - Plugin::SystemCollectionsGenericIListSystemSingleIterator end(System::Collections::Generic::IList& enumerable) + } + + IComparer::IComparer(const IComparer& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparer::IComparer(IComparer&& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparer::~IComparer() + { + if (Handle) { - return Plugin::SystemCollectionsGenericIListSystemSingleIterator(nullptr); + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparer& IComparer::operator=(const IComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparer& IComparer::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparer& IComparer::operator=(IComparer&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparer::operator==(const IComparer& other) const + { + return Handle == other.Handle; + } + + bool IComparer::operator!=(const IComparer& other) const + { + return Handle != other.Handle; + } + } +} + +namespace System +{ + namespace Collections + { + IEqualityComparer::IEqualityComparer(decltype(nullptr)) + { + } + + IEqualityComparer::IEqualityComparer(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEqualityComparer::IEqualityComparer(const IEqualityComparer& other) + : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) + { + } + + IEqualityComparer::IEqualityComparer(IEqualityComparer&& other) + : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEqualityComparer::~IEqualityComparer() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEqualityComparer& IEqualityComparer::operator=(const IEqualityComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEqualityComparer& IEqualityComparer::operator=(IEqualityComparer&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEqualityComparer::operator==(const IEqualityComparer& other) const + { + return Handle == other.Handle; + } + + bool IEqualityComparer::operator!=(const IEqualityComparer& other) const + { + return Handle != other.Handle; } } } @@ -4994,17 +3746,11 @@ namespace System { namespace Generic { - IList::IList(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) + IEqualityComparer::IEqualityComparer(decltype(nullptr)) { } - IList::IList(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) + IEqualityComparer::IEqualityComparer(Plugin::InternalUse, int32_t handle) { Handle = handle; if (handle) @@ -5013,18 +3759,18 @@ namespace System } } - IList::IList(const IList& other) - : IList(Plugin::InternalUse::Only, other.Handle) + IEqualityComparer::IEqualityComparer(const IEqualityComparer& other) + : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) { } - IList::IList(IList&& other) - : IList(Plugin::InternalUse::Only, other.Handle) + IEqualityComparer::IEqualityComparer(IEqualityComparer&& other) + : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IList::~IList() + IEqualityComparer::~IEqualityComparer() { if (Handle) { @@ -5033,7 +3779,7 @@ namespace System } } - IList& IList::operator=(const IList& other) + IEqualityComparer& IEqualityComparer::operator=(const IEqualityComparer& other) { if (this->Handle) { @@ -5047,7 +3793,7 @@ namespace System return *this; } - IList& IList::operator=(decltype(nullptr)) + IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr)) { if (Handle) { @@ -5057,7 +3803,7 @@ namespace System return *this; } - IList& IList::operator=(IList&& other) + IEqualityComparer& IEqualityComparer::operator=(IEqualityComparer&& other) { if (Handle) { @@ -5068,12 +3814,12 @@ namespace System return *this; } - bool IList::operator==(const IList& other) const + bool IEqualityComparer::operator==(const IEqualityComparer& other) const { return Handle == other.Handle; } - bool IList::operator!=(const IList& other) const + bool IEqualityComparer::operator!=(const IEqualityComparer& other) const { return Handle != other.Handle; } @@ -5081,81 +3827,17 @@ namespace System } } -namespace Plugin +namespace System { - SystemCollectionsGenericIListUnityEngineRaycastHitIterator::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericIListUnityEngineRaycastHitIterator::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(System::Collections::Generic::IList& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericIListUnityEngineRaycastHitIterator::~SystemCollectionsGenericIListUnityEngineRaycastHitIterator() + namespace Collections { - if (enumerator != nullptr) + namespace Generic { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericIListUnityEngineRaycastHitIterator& SystemCollectionsGenericIListUnityEngineRaycastHitIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericIListUnityEngineRaycastHitIterator::operator!=(const SystemCollectionsGenericIListUnityEngineRaycastHitIterator& other) - { - return hasMore; - } - - UnityEngine::RaycastHit SystemCollectionsGenericIListUnityEngineRaycastHitIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator begin(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(enumerable); - } - - Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator end(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IList::IList(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) + IEqualityComparer::IEqualityComparer(decltype(nullptr)) { } - IList::IList(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) + IEqualityComparer::IEqualityComparer(Plugin::InternalUse, int32_t handle) { Handle = handle; if (handle) @@ -5164,18 +3846,18 @@ namespace System } } - IList::IList(const IList& other) - : IList(Plugin::InternalUse::Only, other.Handle) + IEqualityComparer::IEqualityComparer(const IEqualityComparer& other) + : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) { } - IList::IList(IList&& other) - : IList(Plugin::InternalUse::Only, other.Handle) + IEqualityComparer::IEqualityComparer(IEqualityComparer&& other) + : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IList::~IList() + IEqualityComparer::~IEqualityComparer() { if (Handle) { @@ -5184,7 +3866,7 @@ namespace System } } - IList& IList::operator=(const IList& other) + IEqualityComparer& IEqualityComparer::operator=(const IEqualityComparer& other) { if (this->Handle) { @@ -5198,7 +3880,7 @@ namespace System return *this; } - IList& IList::operator=(decltype(nullptr)) + IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr)) { if (Handle) { @@ -5208,7 +3890,7 @@ namespace System return *this; } - IList& IList::operator=(IList&& other) + IEqualityComparer& IEqualityComparer::operator=(IEqualityComparer&& other) { if (Handle) { @@ -5219,12 +3901,12 @@ namespace System return *this; } - bool IList::operator==(const IList& other) const + bool IEqualityComparer::operator==(const IEqualityComparer& other) const { return Handle == other.Handle; } - bool IList::operator!=(const IList& other) const + bool IEqualityComparer::operator!=(const IEqualityComparer& other) const { return Handle != other.Handle; } @@ -5232,255 +3914,532 @@ namespace System } } -namespace Plugin +namespace UnityEngine { - SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(System::Collections::Generic::IList& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::~SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator() + namespace Playables { - if (enumerator != nullptr) + PlayableGraph::PlayableGraph(decltype(nullptr)) { - enumerator.Dispose(); } - } - - SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::operator!=(const SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& other) - { - return hasMore; - } - - UnityEngine::GradientColorKey SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic + + PlayableGraph::PlayableGraph(Plugin::InternalUse, int32_t handle) { - Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(enumerable); - } - - Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator end(System::Collections::Generic::IList& enumerable) + Handle = handle; + if (handle) { - return Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(nullptr); + Plugin::ReferenceManagedUnityEnginePlayablesPlayableGraph(Handle); } } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic + + PlayableGraph::PlayableGraph(const PlayableGraph& other) + : PlayableGraph(Plugin::InternalUse::Only, other.Handle) { - IList::IList(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) + } + + PlayableGraph::PlayableGraph(PlayableGraph&& other) + : PlayableGraph(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + PlayableGraph::~PlayableGraph() + { + if (Handle) { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + Handle = 0; } - - IList::IList(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) + } + + PlayableGraph& PlayableGraph::operator=(const PlayableGraph& other) + { + if (this->Handle) { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } + Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); } - - IList::IList(const IList& other) - : IList(Plugin::InternalUse::Only, other.Handle) + this->Handle = other.Handle; + if (this->Handle) { + Plugin::ReferenceManagedUnityEnginePlayablesPlayableGraph(Handle); } - - IList::IList(IList&& other) - : IList(Plugin::InternalUse::Only, other.Handle) + return *this; + } + + PlayableGraph& PlayableGraph::operator=(decltype(nullptr)) + { + if (Handle) { - other.Handle = 0; + Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + Handle = 0; } - - IList::~IList() + return *this; + } + + PlayableGraph& PlayableGraph::operator=(PlayableGraph&& other) + { + if (Handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } + Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); } - - IList& IList::operator=(const IList& other) + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool PlayableGraph::operator==(const PlayableGraph& other) const + { + return Handle == other.Handle; + } + + bool PlayableGraph::operator!=(const PlayableGraph& other) const + { + return Handle != other.Handle; + } + + PlayableGraph::operator System::ValueType() + { + int32_t handle = Plugin::BoxPlayableGraph(Handle); + if (Plugin::unhandledCsharpException) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - IList& IList::operator=(decltype(nullptr)) + if (handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); } - - IList& IList::operator=(IList&& other) + return nullptr; + } + + PlayableGraph::operator System::Object() + { + int32_t handle = Plugin::BoxPlayableGraph(Handle); + if (Plugin::unhandledCsharpException) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - bool IList::operator==(const IList& other) const + if (handle) { - return Handle == other.Handle; + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); } - - bool IList::operator!=(const IList& other) const + return nullptr; + } + } +} + +namespace System +{ + Object::operator UnityEngine::Playables::PlayableGraph() + { + UnityEngine::Playables::PlayableGraph returnVal(Plugin::InternalUse::Only, Plugin::UnboxPlayableGraph(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace UnityEngine +{ + namespace Playables + { + IPlayable::IPlayable(decltype(nullptr)) + { + } + + IPlayable::IPlayable(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) { - return Handle != other.Handle; + Plugin::ReferenceManagedClass(handle); + } + } + + IPlayable::IPlayable(const IPlayable& other) + : IPlayable(Plugin::InternalUse::Only, other.Handle) + { + } + + IPlayable::IPlayable(IPlayable&& other) + : IPlayable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IPlayable::~IPlayable() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IPlayable& IPlayable::operator=(const IPlayable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IPlayable& IPlayable::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IPlayable& IPlayable::operator=(IPlayable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IPlayable::operator==(const IPlayable& other) const + { + return Handle == other.Handle; + } + + bool IPlayable::operator!=(const IPlayable& other) const + { + return Handle != other.Handle; } } } -namespace Plugin +namespace System { - SystemCollectionsGenericIListUnityEngineResolutionIterator::SystemCollectionsGenericIListUnityEngineResolutionIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) + IEquatable::IEquatable(decltype(nullptr)) { } - SystemCollectionsGenericIListUnityEngineResolutionIterator::SystemCollectionsGenericIListUnityEngineResolutionIterator(System::Collections::Generic::IList& enumerable) - : enumerator(enumerable.GetEnumerator()) + IEquatable::IEquatable(Plugin::InternalUse, int32_t handle) { - hasMore = enumerator.MoveNext(); + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - SystemCollectionsGenericIListUnityEngineResolutionIterator::~SystemCollectionsGenericIListUnityEngineResolutionIterator() + IEquatable::IEquatable(const IEquatable& other) + : IEquatable(Plugin::InternalUse::Only, other.Handle) { - if (enumerator != nullptr) + } + + IEquatable::IEquatable(IEquatable&& other) + : IEquatable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable::~IEquatable() + { + if (Handle) { - enumerator.Dispose(); + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } - SystemCollectionsGenericIListUnityEngineResolutionIterator& SystemCollectionsGenericIListUnityEngineResolutionIterator::operator++() + IEquatable& IEquatable::operator=(const IEquatable& other) { - hasMore = enumerator.MoveNext(); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } return *this; } - bool SystemCollectionsGenericIListUnityEngineResolutionIterator::operator!=(const SystemCollectionsGenericIListUnityEngineResolutionIterator& other) + IEquatable& IEquatable::operator=(decltype(nullptr)) { - return hasMore; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - UnityEngine::Resolution SystemCollectionsGenericIListUnityEngineResolutionIterator::operator*() + IEquatable& IEquatable::operator=(IEquatable&& other) { - return enumerator.GetCurrent(); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable::operator==(const IEquatable& other) const + { + return Handle == other.Handle; + } + + bool IEquatable::operator!=(const IEquatable& other) const + { + return Handle != other.Handle; } } -namespace System +namespace UnityEngine { - namespace Collections + namespace Animations { - namespace Generic + AnimationMixerPlayable::AnimationMixerPlayable(decltype(nullptr)) { - Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator begin(System::Collections::Generic::IList& enumerable) + } + + AnimationMixerPlayable::AnimationMixerPlayable(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) { - return Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator(enumerable); + Plugin::ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); } - - Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator end(System::Collections::Generic::IList& enumerable) + } + + AnimationMixerPlayable::AnimationMixerPlayable(const AnimationMixerPlayable& other) + : AnimationMixerPlayable(Plugin::InternalUse::Only, other.Handle) + { + } + + AnimationMixerPlayable::AnimationMixerPlayable(AnimationMixerPlayable&& other) + : AnimationMixerPlayable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + AnimationMixerPlayable::~AnimationMixerPlayable() + { + if (Handle) { - return Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator(nullptr); + Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + Handle = 0; } } - } -} - -namespace System -{ - namespace Runtime - { - namespace Serialization + + AnimationMixerPlayable& AnimationMixerPlayable::operator=(const AnimationMixerPlayable& other) { - ISerializable::ISerializable(decltype(nullptr)) + if (this->Handle) { + Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); } - - ISerializable::ISerializable(Plugin::InternalUse iu, int32_t handle) + this->Handle = other.Handle; + if (this->Handle) { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } + Plugin::ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); } - - ISerializable::ISerializable(const ISerializable& other) - : ISerializable(Plugin::InternalUse::Only, other.Handle) + return *this; + } + + AnimationMixerPlayable& AnimationMixerPlayable::operator=(decltype(nullptr)) + { + if (Handle) { + Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); + Handle = 0; } - - ISerializable::ISerializable(ISerializable&& other) - : ISerializable(Plugin::InternalUse::Only, other.Handle) + return *this; + } + + AnimationMixerPlayable& AnimationMixerPlayable::operator=(AnimationMixerPlayable&& other) + { + if (Handle) { - other.Handle = 0; + Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); } - - ISerializable::~ISerializable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool AnimationMixerPlayable::operator==(const AnimationMixerPlayable& other) const + { + return Handle == other.Handle; + } + + bool AnimationMixerPlayable::operator!=(const AnimationMixerPlayable& other) const + { + return Handle != other.Handle; + } + + UnityEngine::Animations::AnimationMixerPlayable AnimationMixerPlayable::Create(UnityEngine::Playables::PlayableGraph& graph, System::Int32 inputCount, System::Boolean normalizeWeights) + { + auto returnValue = Plugin::UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean(graph.Handle, inputCount, normalizeWeights); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Animations::AnimationMixerPlayable(Plugin::InternalUse::Only, returnValue); + } + + AnimationMixerPlayable::operator System::ValueType() + { + int32_t handle = Plugin::BoxAnimationMixerPlayable(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + AnimationMixerPlayable::operator System::Object() + { + int32_t handle = Plugin::BoxAnimationMixerPlayable(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + AnimationMixerPlayable::operator UnityEngine::Playables::IPlayable() + { + int32_t handle = Plugin::BoxAnimationMixerPlayable(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return UnityEngine::Playables::IPlayable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + AnimationMixerPlayable::operator System::IEquatable() + { + int32_t handle = Plugin::BoxAnimationMixerPlayable(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IEquatable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + } +} + +namespace System +{ + Object::operator UnityEngine::Animations::AnimationMixerPlayable() + { + UnityEngine::Animations::AnimationMixerPlayable returnVal(Plugin::InternalUse::Only, Plugin::UnboxAnimationMixerPlayable(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + namespace Runtime + { + namespace CompilerServices + { + IStrongBox::IStrongBox(decltype(nullptr)) + { + } + + IStrongBox::IStrongBox(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IStrongBox::IStrongBox(const IStrongBox& other) + : IStrongBox(Plugin::InternalUse::Only, other.Handle) + { + } + + IStrongBox::IStrongBox(IStrongBox&& other) + : IStrongBox(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IStrongBox::~IStrongBox() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); Handle = 0; } } - ISerializable& ISerializable::operator=(const ISerializable& other) + IStrongBox& IStrongBox::operator=(const IStrongBox& other) { if (this->Handle) { @@ -5494,7 +4453,7 @@ namespace System return *this; } - ISerializable& ISerializable::operator=(decltype(nullptr)) + IStrongBox& IStrongBox::operator=(decltype(nullptr)) { if (Handle) { @@ -5504,7 +4463,7 @@ namespace System return *this; } - ISerializable& ISerializable::operator=(ISerializable&& other) + IStrongBox& IStrongBox::operator=(IStrongBox&& other) { if (Handle) { @@ -5515,12 +4474,12 @@ namespace System return *this; } - bool ISerializable::operator==(const ISerializable& other) const + bool IStrongBox::operator==(const IStrongBox& other) const { return Handle == other.Handle; } - bool ISerializable::operator!=(const ISerializable& other) const + bool IStrongBox::operator!=(const IStrongBox& other) const { return Handle != other.Handle; } @@ -5528,17 +4487,17 @@ namespace System } } -namespace System +namespace UnityEngine { - namespace Runtime + namespace Experimental { - namespace InteropServices + namespace UIElements { - _Exception::_Exception(decltype(nullptr)) + IEventHandler::IEventHandler(decltype(nullptr)) { } - _Exception::_Exception(Plugin::InternalUse iu, int32_t handle) + IEventHandler::IEventHandler(Plugin::InternalUse, int32_t handle) { Handle = handle; if (handle) @@ -5547,18 +4506,18 @@ namespace System } } - _Exception::_Exception(const _Exception& other) - : _Exception(Plugin::InternalUse::Only, other.Handle) + IEventHandler::IEventHandler(const IEventHandler& other) + : IEventHandler(Plugin::InternalUse::Only, other.Handle) { } - _Exception::_Exception(_Exception&& other) - : _Exception(Plugin::InternalUse::Only, other.Handle) + IEventHandler::IEventHandler(IEventHandler&& other) + : IEventHandler(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - _Exception::~_Exception() + IEventHandler::~IEventHandler() { if (Handle) { @@ -5567,7 +4526,7 @@ namespace System } } - _Exception& _Exception::operator=(const _Exception& other) + IEventHandler& IEventHandler::operator=(const IEventHandler& other) { if (this->Handle) { @@ -5581,7 +4540,7 @@ namespace System return *this; } - _Exception& _Exception::operator=(decltype(nullptr)) + IEventHandler& IEventHandler::operator=(decltype(nullptr)) { if (Handle) { @@ -5591,7 +4550,7 @@ namespace System return *this; } - _Exception& _Exception::operator=(_Exception&& other) + IEventHandler& IEventHandler::operator=(IEventHandler&& other) { if (Handle) { @@ -5602,12 +4561,12 @@ namespace System return *this; } - bool _Exception::operator==(const _Exception& other) const + bool IEventHandler::operator==(const IEventHandler& other) const { return Handle == other.Handle; } - bool _Exception::operator!=(const _Exception& other) const + bool IEventHandler::operator!=(const IEventHandler& other) const { return Handle != other.Handle; } @@ -5615,266 +4574,110 @@ namespace System } } -namespace System +namespace UnityEngine { - IAppDomainSetup::IAppDomainSetup(decltype(nullptr)) - { - } - - IAppDomainSetup::IAppDomainSetup(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IAppDomainSetup::IAppDomainSetup(const IAppDomainSetup& other) - : IAppDomainSetup(Plugin::InternalUse::Only, other.Handle) - { - } - - IAppDomainSetup::IAppDomainSetup(IAppDomainSetup&& other) - : IAppDomainSetup(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IAppDomainSetup::~IAppDomainSetup() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IAppDomainSetup& IAppDomainSetup::operator=(const IAppDomainSetup& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IAppDomainSetup& IAppDomainSetup::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IAppDomainSetup& IAppDomainSetup::operator=(IAppDomainSetup&& other) + namespace Experimental { - if (Handle) + namespace UIElements { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IAppDomainSetup::operator==(const IAppDomainSetup& other) const - { - return Handle == other.Handle; - } - - bool IAppDomainSetup::operator!=(const IAppDomainSetup& other) const - { - return Handle != other.Handle; - } -} - -namespace System -{ - namespace Collections - { - IComparer::IComparer(decltype(nullptr)) - { - } - - IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IComparer::IComparer(const IComparer& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) - { - } - - IComparer::IComparer(IComparer&& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IComparer::~IComparer() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IComparer& IComparer::operator=(const IComparer& other) - { - if (this->Handle) + CallbackEventHandler::CallbackEventHandler(decltype(nullptr)) + : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) { - Plugin::DereferenceManagedClass(this->Handle); } - this->Handle = other.Handle; - if (this->Handle) + + CallbackEventHandler::CallbackEventHandler(Plugin::InternalUse, int32_t handle) + : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) { - Plugin::ReferenceManagedClass(this->Handle); + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - return *this; - } - - IComparer& IComparer::operator=(decltype(nullptr)) - { - if (Handle) + + CallbackEventHandler::CallbackEventHandler(const CallbackEventHandler& other) + : CallbackEventHandler(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; } - return *this; - } - - IComparer& IComparer::operator=(IComparer&& other) - { - if (Handle) + + CallbackEventHandler::CallbackEventHandler(CallbackEventHandler&& other) + : CallbackEventHandler(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(Handle); + other.Handle = 0; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IComparer::operator==(const IComparer& other) const - { - return Handle == other.Handle; - } - - bool IComparer::operator!=(const IComparer& other) const - { - return Handle != other.Handle; - } - } -} - -namespace System -{ - namespace Collections - { - IEqualityComparer::IEqualityComparer(decltype(nullptr)) - { - } - - IEqualityComparer::IEqualityComparer(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) + + CallbackEventHandler::~CallbackEventHandler() { - Plugin::ReferenceManagedClass(handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - } - - IEqualityComparer::IEqualityComparer(const IEqualityComparer& other) - : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) - { - } - - IEqualityComparer::IEqualityComparer(IEqualityComparer&& other) - : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEqualityComparer::~IEqualityComparer() - { - if (Handle) + + CallbackEventHandler& CallbackEventHandler::operator=(const CallbackEventHandler& other) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - } - - IEqualityComparer& IEqualityComparer::operator=(const IEqualityComparer& other) - { - if (this->Handle) + + CallbackEventHandler& CallbackEventHandler::operator=(decltype(nullptr)) { - Plugin::DereferenceManagedClass(this->Handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - this->Handle = other.Handle; - if (this->Handle) + + CallbackEventHandler& CallbackEventHandler::operator=(CallbackEventHandler&& other) { - Plugin::ReferenceManagedClass(this->Handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - return *this; - } - - IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr)) - { - if (Handle) + + bool CallbackEventHandler::operator==(const CallbackEventHandler& other) const { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + return Handle == other.Handle; } - return *this; - } - - IEqualityComparer& IEqualityComparer::operator=(IEqualityComparer&& other) - { - if (Handle) + + bool CallbackEventHandler::operator!=(const CallbackEventHandler& other) const { - Plugin::DereferenceManagedClass(Handle); + return Handle != other.Handle; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEqualityComparer::operator==(const IEqualityComparer& other) const - { - return Handle == other.Handle; - } - - bool IEqualityComparer::operator!=(const IEqualityComparer& other) const - { - return Handle != other.Handle; } } } -namespace System +namespace UnityEngine { - namespace Collections + namespace Experimental { - namespace Generic + namespace UIElements { - IEqualityComparer::IEqualityComparer(decltype(nullptr)) + Focusable::Focusable(decltype(nullptr)) + : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) + , UnityEngine::Experimental::UIElements::CallbackEventHandler(nullptr) { } - IEqualityComparer::IEqualityComparer(Plugin::InternalUse iu, int32_t handle) + Focusable::Focusable(Plugin::InternalUse, int32_t handle) + : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) + , UnityEngine::Experimental::UIElements::CallbackEventHandler(nullptr) { Handle = handle; if (handle) @@ -5883,18 +4686,18 @@ namespace System } } - IEqualityComparer::IEqualityComparer(const IEqualityComparer& other) - : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) + Focusable::Focusable(const Focusable& other) + : Focusable(Plugin::InternalUse::Only, other.Handle) { } - IEqualityComparer::IEqualityComparer(IEqualityComparer&& other) - : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) + Focusable::Focusable(Focusable&& other) + : Focusable(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IEqualityComparer::~IEqualityComparer() + Focusable::~Focusable() { if (Handle) { @@ -5903,7 +4706,7 @@ namespace System } } - IEqualityComparer& IEqualityComparer::operator=(const IEqualityComparer& other) + Focusable& Focusable::operator=(const Focusable& other) { if (this->Handle) { @@ -5917,7 +4720,7 @@ namespace System return *this; } - IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr)) + Focusable& Focusable::operator=(decltype(nullptr)) { if (Handle) { @@ -5927,7 +4730,7 @@ namespace System return *this; } - IEqualityComparer& IEqualityComparer::operator=(IEqualityComparer&& other) + Focusable& Focusable::operator=(Focusable&& other) { if (Handle) { @@ -5938,12 +4741,12 @@ namespace System return *this; } - bool IEqualityComparer::operator==(const IEqualityComparer& other) const + bool Focusable::operator==(const Focusable& other) const { return Handle == other.Handle; } - bool IEqualityComparer::operator!=(const IEqualityComparer& other) const + bool Focusable::operator!=(const Focusable& other) const { return Handle != other.Handle; } @@ -5951,17 +4754,17 @@ namespace System } } -namespace System +namespace UnityEngine { - namespace Collections + namespace Experimental { - namespace Generic + namespace UIElements { - IEqualityComparer::IEqualityComparer(decltype(nullptr)) + IStyle::IStyle(decltype(nullptr)) { } - IEqualityComparer::IEqualityComparer(Plugin::InternalUse iu, int32_t handle) + IStyle::IStyle(Plugin::InternalUse, int32_t handle) { Handle = handle; if (handle) @@ -5970,18 +4773,18 @@ namespace System } } - IEqualityComparer::IEqualityComparer(const IEqualityComparer& other) - : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) + IStyle::IStyle(const IStyle& other) + : IStyle(Plugin::InternalUse::Only, other.Handle) { } - IEqualityComparer::IEqualityComparer(IEqualityComparer&& other) - : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) + IStyle::IStyle(IStyle&& other) + : IStyle(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IEqualityComparer::~IEqualityComparer() + IStyle::~IStyle() { if (Handle) { @@ -5990,7 +4793,7 @@ namespace System } } - IEqualityComparer& IEqualityComparer::operator=(const IEqualityComparer& other) + IStyle& IStyle::operator=(const IStyle& other) { if (this->Handle) { @@ -6004,7 +4807,7 @@ namespace System return *this; } - IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr)) + IStyle& IStyle::operator=(decltype(nullptr)) { if (Handle) { @@ -6014,7 +4817,7 @@ namespace System return *this; } - IEqualityComparer& IEqualityComparer::operator=(IEqualityComparer&& other) + IStyle& IStyle::operator=(IStyle&& other) { if (Handle) { @@ -6025,12 +4828,12 @@ namespace System return *this; } - bool IEqualityComparer::operator==(const IEqualityComparer& other) const + bool IStyle::operator==(const IStyle& other) const { return Handle == other.Handle; } - bool IEqualityComparer::operator!=(const IEqualityComparer& other) const + bool IStyle::operator!=(const IStyle& other) const { return Handle != other.Handle; } @@ -6038,216 +4841,153 @@ namespace System } } -namespace UnityEngine +namespace System { - namespace Playables + namespace Diagnostics { - PlayableGraph::PlayableGraph(decltype(nullptr)) - : System::ValueType(nullptr) + Stopwatch::Stopwatch(decltype(nullptr)) { } - PlayableGraph::PlayableGraph(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(nullptr) + Stopwatch::Stopwatch(Plugin::InternalUse, int32_t handle) { Handle = handle; if (handle) { - Plugin::ReferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + Plugin::ReferenceManagedClass(handle); } } - PlayableGraph::PlayableGraph(const PlayableGraph& other) - : PlayableGraph(Plugin::InternalUse::Only, other.Handle) + Stopwatch::Stopwatch(const Stopwatch& other) + : Stopwatch(Plugin::InternalUse::Only, other.Handle) { } - PlayableGraph::PlayableGraph(PlayableGraph&& other) - : PlayableGraph(Plugin::InternalUse::Only, other.Handle) + Stopwatch::Stopwatch(Stopwatch&& other) + : Stopwatch(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - PlayableGraph::~PlayableGraph() + Stopwatch::~Stopwatch() { if (Handle) { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } } - PlayableGraph& PlayableGraph::operator=(const PlayableGraph& other) + Stopwatch& Stopwatch::operator=(const Stopwatch& other) { if (this->Handle) { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + Plugin::DereferenceManagedClass(this->Handle); } this->Handle = other.Handle; if (this->Handle) { - Plugin::ReferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + Plugin::ReferenceManagedClass(this->Handle); } return *this; } - PlayableGraph& PlayableGraph::operator=(decltype(nullptr)) + Stopwatch& Stopwatch::operator=(decltype(nullptr)) { if (Handle) { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; } - PlayableGraph& PlayableGraph::operator=(PlayableGraph&& other) + Stopwatch& Stopwatch::operator=(Stopwatch&& other) { if (Handle) { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool PlayableGraph::operator==(const PlayableGraph& other) const + bool Stopwatch::operator==(const Stopwatch& other) const { return Handle == other.Handle; } - bool PlayableGraph::operator!=(const PlayableGraph& other) const + bool Stopwatch::operator!=(const Stopwatch& other) const { return Handle != other.Handle; } - } -} - -namespace System -{ - Object::Object(UnityEngine::Playables::PlayableGraph& val) - { - int32_t handle = Plugin::BoxPlayableGraph(val.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator UnityEngine::Playables::PlayableGraph() - { - UnityEngine::Playables::PlayableGraph returnVal(Plugin::InternalUse::Only, Plugin::UnboxPlayableGraph(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - namespace Playables - { - IPlayable::IPlayable(decltype(nullptr)) - { - } - IPlayable::IPlayable(Plugin::InternalUse iu, int32_t handle) + Stopwatch::Stopwatch() { - Handle = handle; - if (handle) + auto returnValue = Plugin::SystemDiagnosticsStopwatchConstructor(); + if (Plugin::unhandledCsharpException) { - Plugin::ReferenceManagedClass(handle); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - } - - IPlayable::IPlayable(const IPlayable& other) - : IPlayable(Plugin::InternalUse::Only, other.Handle) - { - } - - IPlayable::IPlayable(IPlayable&& other) - : IPlayable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IPlayable::~IPlayable() - { - if (Handle) + Handle = returnValue; + if (returnValue) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + Plugin::ReferenceManagedClass(returnValue); } } - IPlayable& IPlayable::operator=(const IPlayable& other) + System::Int64 Stopwatch::GetElapsedMilliseconds() { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + auto returnValue = Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(Handle); + if (Plugin::unhandledCsharpException) { - Plugin::ReferenceManagedClass(this->Handle); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - return *this; + return returnValue; } - IPlayable& IPlayable::operator=(decltype(nullptr)) + void Stopwatch::Start() { - if (Handle) + Plugin::SystemDiagnosticsStopwatchMethodStart(Handle); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - return *this; } - - IPlayable& IPlayable::operator=(IPlayable&& other) + + void Stopwatch::Reset() { - if (Handle) + Plugin::SystemDiagnosticsStopwatchMethodReset(Handle); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IPlayable::operator==(const IPlayable& other) const - { - return Handle == other.Handle; - } - - bool IPlayable::operator!=(const IPlayable& other) const - { - return Handle != other.Handle; } } } -namespace System +namespace UnityEngine { - IEquatable::IEquatable(decltype(nullptr)) + GameObject::GameObject(decltype(nullptr)) + : UnityEngine::Object(nullptr) { } - IEquatable::IEquatable(Plugin::InternalUse iu, int32_t handle) + GameObject::GameObject(Plugin::InternalUse, int32_t handle) + : UnityEngine::Object(nullptr) { Handle = handle; if (handle) @@ -6256,18 +4996,18 @@ namespace System } } - IEquatable::IEquatable(const IEquatable& other) - : IEquatable(Plugin::InternalUse::Only, other.Handle) + GameObject::GameObject(const GameObject& other) + : GameObject(Plugin::InternalUse::Only, other.Handle) { } - IEquatable::IEquatable(IEquatable&& other) - : IEquatable(Plugin::InternalUse::Only, other.Handle) + GameObject::GameObject(GameObject&& other) + : GameObject(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IEquatable::~IEquatable() + GameObject::~GameObject() { if (Handle) { @@ -6276,7 +5016,7 @@ namespace System } } - IEquatable& IEquatable::operator=(const IEquatable& other) + GameObject& GameObject::operator=(const GameObject& other) { if (this->Handle) { @@ -6290,7 +5030,7 @@ namespace System return *this; } - IEquatable& IEquatable::operator=(decltype(nullptr)) + GameObject& GameObject::operator=(decltype(nullptr)) { if (Handle) { @@ -6300,7 +5040,7 @@ namespace System return *this; } - IEquatable& IEquatable::operator=(IEquatable&& other) + GameObject& GameObject::operator=(GameObject&& other) { if (Handle) { @@ -6311,142 +5051,188 @@ namespace System return *this; } - bool IEquatable::operator==(const IEquatable& other) const + bool GameObject::operator==(const GameObject& other) const { return Handle == other.Handle; } - bool IEquatable::operator!=(const IEquatable& other) const + bool GameObject::operator!=(const GameObject& other) const { return Handle != other.Handle; } -} - -namespace UnityEngine -{ - namespace Animations + + GameObject::GameObject() + : UnityEngine::Object(nullptr) { - AnimationMixerPlayable::AnimationMixerPlayable(decltype(nullptr)) - : System::ValueType(nullptr) - , System::IEquatable(nullptr) - , UnityEngine::Playables::IPlayable(nullptr) + auto returnValue = Plugin::UnityEngineGameObjectConstructor(); + if (Plugin::unhandledCsharpException) { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - AnimationMixerPlayable::AnimationMixerPlayable(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(nullptr) - , System::IEquatable(nullptr) - , UnityEngine::Playables::IPlayable(nullptr) + Handle = returnValue; + if (returnValue) { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); - } + Plugin::ReferenceManagedClass(returnValue); } - - AnimationMixerPlayable::AnimationMixerPlayable(const AnimationMixerPlayable& other) - : AnimationMixerPlayable(Plugin::InternalUse::Only, other.Handle) + } + + GameObject::GameObject(System::String& name) + : UnityEngine::Object(nullptr) + { + auto returnValue = Plugin::UnityEngineGameObjectConstructorSystemString(name.Handle); + if (Plugin::unhandledCsharpException) { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - AnimationMixerPlayable::AnimationMixerPlayable(AnimationMixerPlayable&& other) - : AnimationMixerPlayable(Plugin::InternalUse::Only, other.Handle) + Handle = returnValue; + if (returnValue) { - other.Handle = 0; + Plugin::ReferenceManagedClass(returnValue); } - - AnimationMixerPlayable::~AnimationMixerPlayable() + } + + UnityEngine::Transform GameObject::GetTransform() + { + auto returnValue = Plugin::UnityEngineGameObjectPropertyGetTransform(Handle); + if (Plugin::unhandledCsharpException) { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); - Handle = 0; - } + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - AnimationMixerPlayable& AnimationMixerPlayable::operator=(const AnimationMixerPlayable& other) + return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); + } + + template<> MyGame::MonoBehaviours::TestScript GameObject::AddComponent() + { + auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(Handle); + if (Plugin::unhandledCsharpException) { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); - } - return *this; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - AnimationMixerPlayable& AnimationMixerPlayable::operator=(decltype(nullptr)) + return MyGame::MonoBehaviours::TestScript(Plugin::InternalUse::Only, returnValue); + } + + template<> MyGame::MonoBehaviours::AnotherScript GameObject::AddComponent() + { + auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript(Handle); + if (Plugin::unhandledCsharpException) { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); - Handle = 0; - } - return *this; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - AnimationMixerPlayable& AnimationMixerPlayable::operator=(AnimationMixerPlayable&& other) + return MyGame::MonoBehaviours::AnotherScript(Plugin::InternalUse::Only, returnValue); + } + + UnityEngine::GameObject GameObject::CreatePrimitive(UnityEngine::PrimitiveType type) + { + auto returnValue = Plugin::UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(type); + if (Plugin::unhandledCsharpException) { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - bool AnimationMixerPlayable::operator==(const AnimationMixerPlayable& other) const + return UnityEngine::GameObject(Plugin::InternalUse::Only, returnValue); + } +} + +namespace UnityEngine +{ + Debug::Debug(decltype(nullptr)) + { + } + + Debug::Debug(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) { - return Handle == other.Handle; + Plugin::ReferenceManagedClass(handle); } - - bool AnimationMixerPlayable::operator!=(const AnimationMixerPlayable& other) const + } + + Debug::Debug(const Debug& other) + : Debug(Plugin::InternalUse::Only, other.Handle) + { + } + + Debug::Debug(Debug&& other) + : Debug(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Debug::~Debug() + { + if (Handle) { - return Handle != other.Handle; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - UnityEngine::Animations::AnimationMixerPlayable AnimationMixerPlayable::Create(UnityEngine::Playables::PlayableGraph& graph, int32_t inputCount, System::Boolean normalizeWeights) + } + + Debug& Debug::operator=(const Debug& other) + { + if (this->Handle) { - auto returnValue = Plugin::UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean(graph.Handle, inputCount, normalizeWeights); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Animations::AnimationMixerPlayable(Plugin::InternalUse::Only, returnValue); + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } -} - -namespace System -{ - Object::Object(UnityEngine::Animations::AnimationMixerPlayable& val) + + Debug& Debug::operator=(decltype(nullptr)) { - int32_t handle = Plugin::BoxAnimationMixerPlayable(val.Handle); - if (Plugin::unhandledCsharpException) + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - if (handle) + return *this; + } + + Debug& Debug::operator=(Debug&& other) + { + if (Handle) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; } - Object::operator UnityEngine::Animations::AnimationMixerPlayable() + bool Debug::operator==(const Debug& other) const { - UnityEngine::Animations::AnimationMixerPlayable returnVal(Plugin::InternalUse::Only, Plugin::UnboxAnimationMixerPlayable(Handle)); + return Handle == other.Handle; + } + + bool Debug::operator!=(const Debug& other) const + { + return Handle != other.Handle; + } + + void Debug::Log(System::Object& message) + { + Plugin::UnityEngineDebugMethodLogSystemObject(message.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -6454,92 +5240,59 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return returnVal; } } -namespace System +namespace UnityEngine { - namespace Runtime + namespace Assertions { - namespace CompilerServices + System::Boolean Assert::GetRaiseExceptions() { - IStrongBox::IStrongBox(decltype(nullptr)) - { - } - - IStrongBox::IStrongBox(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IStrongBox::IStrongBox(const IStrongBox& other) - : IStrongBox(Plugin::InternalUse::Only, other.Handle) - { - } - - IStrongBox::IStrongBox(IStrongBox&& other) - : IStrongBox(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IStrongBox::~IStrongBox() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IStrongBox& IStrongBox::operator=(const IStrongBox& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IStrongBox& IStrongBox::operator=(decltype(nullptr)) + auto returnValue = Plugin::UnityEngineAssertionsAssertFieldGetRaiseExceptions(); + if (Plugin::unhandledCsharpException) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - IStrongBox& IStrongBox::operator=(IStrongBox&& other) + return returnValue; + } + + void Assert::SetRaiseExceptions(System::Boolean value) + { + Plugin::UnityEngineAssertionsAssertFieldSetRaiseExceptions(value); + if (Plugin::unhandledCsharpException) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - bool IStrongBox::operator==(const IStrongBox& other) const + } + + template<> void Assert::AreEqual(System::String& expected, System::String& actual) + { + Plugin::UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(expected.Handle, actual.Handle); + if (Plugin::unhandledCsharpException) { - return Handle == other.Handle; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - bool IStrongBox::operator!=(const IStrongBox& other) const + } + + template<> void Assert::AreEqual(UnityEngine::GameObject& expected, UnityEngine::GameObject& actual) + { + Plugin::UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(expected.Handle, actual.Handle); + if (Plugin::unhandledCsharpException) { - return Handle != other.Handle; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } } } @@ -6547,325 +5300,96 @@ namespace System namespace UnityEngine { - namespace Experimental + Collision::Collision(decltype(nullptr)) { - namespace UIElements - { - IEventHandler::IEventHandler(decltype(nullptr)) - { - } - - IEventHandler::IEventHandler(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEventHandler::IEventHandler(const IEventHandler& other) - : IEventHandler(Plugin::InternalUse::Only, other.Handle) - { - } - - IEventHandler::IEventHandler(IEventHandler&& other) - : IEventHandler(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEventHandler::~IEventHandler() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEventHandler& IEventHandler::operator=(const IEventHandler& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEventHandler& IEventHandler::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEventHandler& IEventHandler::operator=(IEventHandler&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEventHandler::operator==(const IEventHandler& other) const - { - return Handle == other.Handle; - } - - bool IEventHandler::operator!=(const IEventHandler& other) const - { - return Handle != other.Handle; - } - } } -} - -namespace UnityEngine -{ - namespace Experimental + + Collision::Collision(Plugin::InternalUse, int32_t handle) { - namespace UIElements + Handle = handle; + if (handle) { - IStyle::IStyle(decltype(nullptr)) - { - } - - IStyle::IStyle(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IStyle::IStyle(const IStyle& other) - : IStyle(Plugin::InternalUse::Only, other.Handle) - { - } - - IStyle::IStyle(IStyle&& other) - : IStyle(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IStyle::~IStyle() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IStyle& IStyle::operator=(const IStyle& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IStyle& IStyle::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IStyle& IStyle::operator=(IStyle&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IStyle::operator==(const IStyle& other) const - { - return Handle == other.Handle; - } - - bool IStyle::operator!=(const IStyle& other) const - { - return Handle != other.Handle; - } + Plugin::ReferenceManagedClass(handle); } } -} - -namespace System -{ - namespace Diagnostics + + Collision::Collision(const Collision& other) + : Collision(Plugin::InternalUse::Only, other.Handle) { - Stopwatch::Stopwatch(decltype(nullptr)) - { - } - - Stopwatch::Stopwatch(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Stopwatch::Stopwatch(const Stopwatch& other) - : Stopwatch(Plugin::InternalUse::Only, other.Handle) + } + + Collision::Collision(Collision&& other) + : Collision(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Collision::~Collision() + { + if (Handle) { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - Stopwatch::Stopwatch(Stopwatch&& other) - : Stopwatch(Plugin::InternalUse::Only, other.Handle) + } + + Collision& Collision::operator=(const Collision& other) + { + if (this->Handle) { - other.Handle = 0; + Plugin::DereferenceManagedClass(this->Handle); } - - Stopwatch::~Stopwatch() + this->Handle = other.Handle; + if (this->Handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } + Plugin::ReferenceManagedClass(this->Handle); } - - Stopwatch& Stopwatch::operator=(const Stopwatch& other) + return *this; + } + + Collision& Collision::operator=(decltype(nullptr)) + { + if (Handle) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - Stopwatch& Stopwatch::operator=(decltype(nullptr)) + return *this; + } + + Collision& Collision::operator=(Collision&& other) + { + if (Handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Stopwatch& Stopwatch::operator=(Stopwatch&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Stopwatch::operator==(const Stopwatch& other) const - { - return Handle == other.Handle; - } - - bool Stopwatch::operator!=(const Stopwatch& other) const - { - return Handle != other.Handle; - } - - Stopwatch::Stopwatch() - { - auto returnValue = Plugin::SystemDiagnosticsStopwatchConstructor(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - int64_t Stopwatch::GetElapsedMilliseconds() - { - auto returnValue = Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void Stopwatch::Start() - { - Plugin::SystemDiagnosticsStopwatchMethodStart(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; + } - void Stopwatch::Reset() - { - Plugin::SystemDiagnosticsStopwatchMethodReset(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + bool Collision::operator==(const Collision& other) const + { + return Handle == other.Handle; + } + + bool Collision::operator!=(const Collision& other) const + { + return Handle != other.Handle; } } namespace UnityEngine { - GameObject::GameObject(decltype(nullptr)) + Behaviour::Behaviour(decltype(nullptr)) : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) { } - GameObject::GameObject(Plugin::InternalUse iu, int32_t handle) + Behaviour::Behaviour(Plugin::InternalUse, int32_t handle) : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) { Handle = handle; if (handle) @@ -6874,18 +5398,18 @@ namespace UnityEngine } } - GameObject::GameObject(const GameObject& other) - : GameObject(Plugin::InternalUse::Only, other.Handle) + Behaviour::Behaviour(const Behaviour& other) + : Behaviour(Plugin::InternalUse::Only, other.Handle) { } - GameObject::GameObject(GameObject&& other) - : GameObject(Plugin::InternalUse::Only, other.Handle) + Behaviour::Behaviour(Behaviour&& other) + : Behaviour(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - GameObject::~GameObject() + Behaviour::~Behaviour() { if (Handle) { @@ -6894,7 +5418,7 @@ namespace UnityEngine } } - GameObject& GameObject::operator=(const GameObject& other) + Behaviour& Behaviour::operator=(const Behaviour& other) { if (this->Handle) { @@ -6908,7 +5432,7 @@ namespace UnityEngine return *this; } - GameObject& GameObject::operator=(decltype(nullptr)) + Behaviour& Behaviour::operator=(decltype(nullptr)) { if (Handle) { @@ -6918,7 +5442,7 @@ namespace UnityEngine return *this; } - GameObject& GameObject::operator=(GameObject&& other) + Behaviour& Behaviour::operator=(Behaviour&& other) { if (Handle) { @@ -6929,94 +5453,106 @@ namespace UnityEngine return *this; } - bool GameObject::operator==(const GameObject& other) const + bool Behaviour::operator==(const Behaviour& other) const { return Handle == other.Handle; } - bool GameObject::operator!=(const GameObject& other) const + bool Behaviour::operator!=(const Behaviour& other) const { return Handle != other.Handle; } +} + +namespace UnityEngine +{ + MonoBehaviour::MonoBehaviour(decltype(nullptr)) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) + { + } - GameObject::GameObject() + MonoBehaviour::MonoBehaviour(Plugin::InternalUse, int32_t handle) : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) { - auto returnValue = Plugin::UnityEngineGameObjectConstructor(); - if (Plugin::unhandledCsharpException) + Handle = handle; + if (handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(handle); } - Handle = returnValue; - if (returnValue) + } + + MonoBehaviour::MonoBehaviour(const MonoBehaviour& other) + : MonoBehaviour(Plugin::InternalUse::Only, other.Handle) + { + } + + MonoBehaviour::MonoBehaviour(MonoBehaviour&& other) + : MonoBehaviour(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + MonoBehaviour::~MonoBehaviour() + { + if (Handle) { - Plugin::ReferenceManagedClass(returnValue); + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } - GameObject::GameObject(System::String& name) - : UnityEngine::Object(nullptr) + MonoBehaviour& MonoBehaviour::operator=(const MonoBehaviour& other) { - auto returnValue = Plugin::UnityEngineGameObjectConstructorSystemString(name.Handle); - if (Plugin::unhandledCsharpException) + if (this->Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(this->Handle); } - Handle = returnValue; - if (returnValue) + this->Handle = other.Handle; + if (this->Handle) { - Plugin::ReferenceManagedClass(returnValue); + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } - UnityEngine::Transform GameObject::GetTransform() + MonoBehaviour& MonoBehaviour::operator=(decltype(nullptr)) { - auto returnValue = Plugin::UnityEngineGameObjectPropertyGetTransform(Handle); - if (Plugin::unhandledCsharpException) + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); + return *this; } - template<> MyGame::MonoBehaviours::TestScript GameObject::AddComponent() + MonoBehaviour& MonoBehaviour::operator=(MonoBehaviour&& other) { - auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(Handle); - if (Plugin::unhandledCsharpException) + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); } - return MyGame::MonoBehaviours::TestScript(Plugin::InternalUse::Only, returnValue); + Handle = other.Handle; + other.Handle = 0; + return *this; } - template<> MyGame::MonoBehaviours::AnotherScript GameObject::AddComponent() + bool MonoBehaviour::operator==(const MonoBehaviour& other) const { - auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return MyGame::MonoBehaviours::AnotherScript(Plugin::InternalUse::Only, returnValue); + return Handle == other.Handle; } - UnityEngine::GameObject GameObject::CreatePrimitive(UnityEngine::PrimitiveType type) + bool MonoBehaviour::operator!=(const MonoBehaviour& other) const { - auto returnValue = Plugin::UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(type); + return Handle != other.Handle; + } + + UnityEngine::Transform MonoBehaviour::GetTransform() + { + auto returnValue = Plugin::UnityEngineMonoBehaviourPropertyGetTransform(Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7024,17 +5560,17 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return UnityEngine::GameObject(Plugin::InternalUse::Only, returnValue); + return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); } } namespace UnityEngine { - Debug::Debug(decltype(nullptr)) + AudioSettings::AudioSettings(decltype(nullptr)) { } - Debug::Debug(Plugin::InternalUse iu, int32_t handle) + AudioSettings::AudioSettings(Plugin::InternalUse, int32_t handle) { Handle = handle; if (handle) @@ -7043,18 +5579,18 @@ namespace UnityEngine } } - Debug::Debug(const Debug& other) - : Debug(Plugin::InternalUse::Only, other.Handle) + AudioSettings::AudioSettings(const AudioSettings& other) + : AudioSettings(Plugin::InternalUse::Only, other.Handle) { } - Debug::Debug(Debug&& other) - : Debug(Plugin::InternalUse::Only, other.Handle) + AudioSettings::AudioSettings(AudioSettings&& other) + : AudioSettings(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - Debug::~Debug() + AudioSettings::~AudioSettings() { if (Handle) { @@ -7063,7 +5599,7 @@ namespace UnityEngine } } - Debug& Debug::operator=(const Debug& other) + AudioSettings& AudioSettings::operator=(const AudioSettings& other) { if (this->Handle) { @@ -7077,7 +5613,7 @@ namespace UnityEngine return *this; } - Debug& Debug::operator=(decltype(nullptr)) + AudioSettings& AudioSettings::operator=(decltype(nullptr)) { if (Handle) { @@ -7087,7 +5623,7 @@ namespace UnityEngine return *this; } - Debug& Debug::operator=(Debug&& other) + AudioSettings& AudioSettings::operator=(AudioSettings&& other) { if (Handle) { @@ -7098,19 +5634,19 @@ namespace UnityEngine return *this; } - bool Debug::operator==(const Debug& other) const + bool AudioSettings::operator==(const AudioSettings& other) const { return Handle == other.Handle; } - bool Debug::operator!=(const Debug& other) const + bool AudioSettings::operator!=(const AudioSettings& other) const { return Handle != other.Handle; } - void Debug::Log(System::Object& message) + void AudioSettings::GetDSPBufferSize(System::Int32* bufferLength, System::Int32* numBuffers) { - Plugin::UnityEngineDebugMethodLogSystemObject(message.Handle); + Plugin::UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(&bufferLength->Value, &numBuffers->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7123,36 +5659,90 @@ namespace UnityEngine namespace UnityEngine { - namespace Assertions + namespace Networking { - System::Boolean Assert::GetRaiseExceptions() + NetworkTransport::NetworkTransport(decltype(nullptr)) { - auto returnValue = Plugin::UnityEngineAssertionsAssertFieldGetRaiseExceptions(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; } - void Assert::SetRaiseExceptions(System::Boolean value) + NetworkTransport::NetworkTransport(Plugin::InternalUse, int32_t handle) { - Plugin::UnityEngineAssertionsAssertFieldSetRaiseExceptions(value); - if (Plugin::unhandledCsharpException) + Handle = handle; + if (handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(handle); } } - template<> void Assert::AreEqual(System::String& expected, System::String& actual) + NetworkTransport::NetworkTransport(const NetworkTransport& other) + : NetworkTransport(Plugin::InternalUse::Only, other.Handle) { - Plugin::UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(expected.Handle, actual.Handle); + } + + NetworkTransport::NetworkTransport(NetworkTransport&& other) + : NetworkTransport(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + NetworkTransport::~NetworkTransport() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + NetworkTransport& NetworkTransport::operator=(const NetworkTransport& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + NetworkTransport& NetworkTransport::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + NetworkTransport& NetworkTransport::operator=(NetworkTransport&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool NetworkTransport::operator==(const NetworkTransport& other) const + { + return Handle == other.Handle; + } + + bool NetworkTransport::operator!=(const NetworkTransport& other) const + { + return Handle != other.Handle; + } + + void NetworkTransport::GetBroadcastConnectionInfo(System::Int32 hostId, System::String* address, System::Int32* port, System::Byte* error) + { + int32_t addressHandle = address->Handle; + Plugin::UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(hostId, &addressHandle, &port->Value, &error->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7160,11 +5750,20 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } + if (address->Handle) + { + Plugin::DereferenceManagedClass(address->Handle); + } + address->Handle = addressHandle; + if (address->Handle) + { + Plugin::ReferenceManagedClass(address->Handle); + } } - template<> void Assert::AreEqual(UnityEngine::GameObject& expected, UnityEngine::GameObject& actual) + void NetworkTransport::Init() { - Plugin::UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(expected.Handle, actual.Handle); + Plugin::UnityEngineNetworkingNetworkTransportMethodInit(); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7178,259 +5777,226 @@ namespace UnityEngine namespace UnityEngine { - Collision::Collision(decltype(nullptr)) + Quaternion::Quaternion() { } - Collision::Collision(Plugin::InternalUse iu, int32_t handle) + Quaternion::operator System::ValueType() { - Handle = handle; + int32_t handle = Plugin::BoxQuaternion(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (handle) { Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); } + return nullptr; } - Collision::Collision(const Collision& other) - : Collision(Plugin::InternalUse::Only, other.Handle) - { - } - - Collision::Collision(Collision&& other) - : Collision(Plugin::InternalUse::Only, other.Handle) + Quaternion::operator System::Object() { - other.Handle = 0; + int32_t handle = Plugin::BoxQuaternion(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; } - - Collision::~Collision() +} + +namespace System +{ + Object::operator UnityEngine::Quaternion() { - if (Handle) + UnityEngine::Quaternion returnVal(Plugin::UnboxQuaternion(Handle)); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnVal; + } +} + +namespace UnityEngine +{ + Matrix4x4::Matrix4x4() + { } - Collision& Collision::operator=(const Collision& other) + System::Single Matrix4x4::GetItem(System::Int32 row, System::Int32 column) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + auto returnValue = Plugin::UnityEngineMatrix4x4PropertyGetItem(this, row, column); + if (Plugin::unhandledCsharpException) { - Plugin::ReferenceManagedClass(this->Handle); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - return *this; + return returnValue; } - Collision& Collision::operator=(decltype(nullptr)) + void Matrix4x4::SetItem(System::Int32 row, System::Int32 column, System::Single value) { - if (Handle) + Plugin::UnityEngineMatrix4x4PropertySetItem(this, row, column, value); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - return *this; } - Collision& Collision::operator=(Collision&& other) + Matrix4x4::operator System::ValueType() { - if (Handle) + int32_t handle = Plugin::BoxMatrix4x4(*this); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - Handle = other.Handle; - other.Handle = 0; - return *this; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; } - bool Collision::operator==(const Collision& other) const + Matrix4x4::operator System::Object() { - return Handle == other.Handle; + int32_t handle = Plugin::BoxMatrix4x4(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; } - - bool Collision::operator!=(const Collision& other) const +} + +namespace System +{ + Object::operator UnityEngine::Matrix4x4() { - return Handle != other.Handle; + UnityEngine::Matrix4x4 returnVal(Plugin::UnboxMatrix4x4(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; } } namespace UnityEngine { - Behaviour::Behaviour(decltype(nullptr)) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) + QueryTriggerInteraction::QueryTriggerInteraction(int32_t value) + : Value(value) { } - Behaviour::Behaviour(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) + UnityEngine::QueryTriggerInteraction::operator int32_t() const { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } + return Value; } - Behaviour::Behaviour(const Behaviour& other) - : Behaviour(Plugin::InternalUse::Only, other.Handle) + bool UnityEngine::QueryTriggerInteraction::operator==(QueryTriggerInteraction other) { + return Value == other.Value; } - Behaviour::Behaviour(Behaviour&& other) - : Behaviour(Plugin::InternalUse::Only, other.Handle) + bool UnityEngine::QueryTriggerInteraction::operator!=(QueryTriggerInteraction other) { - other.Handle = 0; + return Value != other.Value; } - Behaviour::~Behaviour() + QueryTriggerInteraction::operator System::Enum() { - if (Handle) + int32_t handle = Plugin::BoxQueryTriggerInteraction(*this); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Enum(Plugin::InternalUse::Only, handle); } + return nullptr; } - Behaviour& Behaviour::operator=(const Behaviour& other) + QueryTriggerInteraction::operator System::ValueType() { - if (this->Handle) + int32_t handle = Plugin::BoxQueryTriggerInteraction(*this); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(this->Handle); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Behaviour& Behaviour::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Behaviour& Behaviour::operator=(Behaviour&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Behaviour::operator==(const Behaviour& other) const - { - return Handle == other.Handle; - } - - bool Behaviour::operator!=(const Behaviour& other) const - { - return Handle != other.Handle; - } -} - -namespace UnityEngine -{ - MonoBehaviour::MonoBehaviour(decltype(nullptr)) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) - , UnityEngine::Behaviour(nullptr) - { - } - - MonoBehaviour::MonoBehaviour(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) - , UnityEngine::Behaviour(nullptr) - { - Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); } + return nullptr; } - MonoBehaviour::MonoBehaviour(const MonoBehaviour& other) - : MonoBehaviour(Plugin::InternalUse::Only, other.Handle) - { - } - - MonoBehaviour::MonoBehaviour(MonoBehaviour&& other) - : MonoBehaviour(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - MonoBehaviour::~MonoBehaviour() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - MonoBehaviour& MonoBehaviour::operator=(const MonoBehaviour& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - MonoBehaviour& MonoBehaviour::operator=(decltype(nullptr)) + QueryTriggerInteraction::operator System::Object() { - if (Handle) + int32_t handle = Plugin::BoxQueryTriggerInteraction(*this); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - return *this; - } - - MonoBehaviour& MonoBehaviour::operator=(MonoBehaviour&& other) - { - if (Handle) + if (handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool MonoBehaviour::operator==(const MonoBehaviour& other) const - { - return Handle == other.Handle; - } - - bool MonoBehaviour::operator!=(const MonoBehaviour& other) const - { - return Handle != other.Handle; + return nullptr; } - UnityEngine::Transform MonoBehaviour::GetTransform() + QueryTriggerInteraction::operator System::IFormattable() { - auto returnValue = Plugin::UnityEngineMonoBehaviourPropertyGetTransform(Handle); + int32_t handle = Plugin::BoxQueryTriggerInteraction(*this); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7438,93 +6004,60 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); - } -} - -namespace UnityEngine -{ - AudioSettings::AudioSettings(decltype(nullptr)) - { - } - - AudioSettings::AudioSettings(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); + return System::IFormattable(Plugin::InternalUse::Only, handle); } + return nullptr; } - AudioSettings::AudioSettings(const AudioSettings& other) - : AudioSettings(Plugin::InternalUse::Only, other.Handle) - { - } - - AudioSettings::AudioSettings(AudioSettings&& other) - : AudioSettings(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - AudioSettings::~AudioSettings() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - AudioSettings& AudioSettings::operator=(const AudioSettings& other) + QueryTriggerInteraction::operator System::IConvertible() { - if (this->Handle) + int32_t handle = Plugin::BoxQueryTriggerInteraction(*this); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(this->Handle); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - this->Handle = other.Handle; - if (this->Handle) + if (handle) { - Plugin::ReferenceManagedClass(this->Handle); + Plugin::ReferenceManagedClass(handle); + return System::IConvertible(Plugin::InternalUse::Only, handle); } - return *this; + return nullptr; } - AudioSettings& AudioSettings::operator=(decltype(nullptr)) + QueryTriggerInteraction::operator System::IComparable() { - if (Handle) + int32_t handle = Plugin::BoxQueryTriggerInteraction(*this); + if (Plugin::unhandledCsharpException) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - return *this; - } - - AudioSettings& AudioSettings::operator=(AudioSettings&& other) - { - if (Handle) + if (handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::ReferenceManagedClass(handle); + return System::IComparable(Plugin::InternalUse::Only, handle); } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool AudioSettings::operator==(const AudioSettings& other) const - { - return Handle == other.Handle; - } - - bool AudioSettings::operator!=(const AudioSettings& other) const - { - return Handle != other.Handle; + return nullptr; } - void AudioSettings::GetDSPBufferSize(int32_t* bufferLength, int32_t* numBuffers) +} +const UnityEngine::QueryTriggerInteraction UnityEngine::QueryTriggerInteraction::UseGlobal(0); +const UnityEngine::QueryTriggerInteraction UnityEngine::QueryTriggerInteraction::Ignore(1); +const UnityEngine::QueryTriggerInteraction UnityEngine::QueryTriggerInteraction::Collide(2); + +namespace System +{ + Object::operator UnityEngine::QueryTriggerInteraction() { - Plugin::UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(bufferLength, numBuffers); + UnityEngine::QueryTriggerInteraction returnVal(Plugin::UnboxQueryTriggerInteraction(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7532,298 +6065,41 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } + return returnVal; } } -namespace UnityEngine +namespace System { - namespace Networking + namespace Collections { - NetworkTransport::NetworkTransport(decltype(nullptr)) - { - } - - NetworkTransport::NetworkTransport(Plugin::InternalUse iu, int32_t handle) + namespace Generic { - Handle = handle; - if (handle) + KeyValuePair::KeyValuePair(decltype(nullptr)) { - Plugin::ReferenceManagedClass(handle); } - } - - NetworkTransport::NetworkTransport(const NetworkTransport& other) - : NetworkTransport(Plugin::InternalUse::Only, other.Handle) - { - } - - NetworkTransport::NetworkTransport(NetworkTransport&& other) - : NetworkTransport(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - NetworkTransport::~NetworkTransport() - { - if (Handle) + + KeyValuePair::KeyValuePair(Plugin::InternalUse, int32_t handle) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); + } } - } - - NetworkTransport& NetworkTransport::operator=(const NetworkTransport& other) - { - if (this->Handle) + + KeyValuePair::KeyValuePair(const KeyValuePair& other) + : KeyValuePair(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(this->Handle); } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - NetworkTransport& NetworkTransport::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - NetworkTransport& NetworkTransport::operator=(NetworkTransport&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool NetworkTransport::operator==(const NetworkTransport& other) const - { - return Handle == other.Handle; - } - - bool NetworkTransport::operator!=(const NetworkTransport& other) const - { - return Handle != other.Handle; - } - - void NetworkTransport::GetBroadcastConnectionInfo(int32_t hostId, System::String* address, int32_t* port, uint8_t* error) - { - int32_t addressHandle = address->Handle; - Plugin::UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(hostId, &addressHandle, port, error); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (address->Handle) - { - Plugin::DereferenceManagedClass(address->Handle); - } - address->Handle = addressHandle; - if (address->Handle) - { - Plugin::ReferenceManagedClass(address->Handle); - } - } - - void NetworkTransport::Init() - { - Plugin::UnityEngineNetworkingNetworkTransportMethodInit(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } -} - -namespace UnityEngine -{ - Quaternion::Quaternion() - { - } -} - -namespace System -{ - Object::Object(UnityEngine::Quaternion& val) - { - int32_t handle = Plugin::BoxQuaternion(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator UnityEngine::Quaternion() - { - UnityEngine::Quaternion returnVal(Plugin::UnboxQuaternion(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - Matrix4x4::Matrix4x4() - { - } - - float Matrix4x4::GetItem(int32_t row, int32_t column) - { - auto returnValue = Plugin::UnityEngineMatrix4x4PropertyGetItem(this, row, column); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void Matrix4x4::SetItem(int32_t row, int32_t column, float value) - { - Plugin::UnityEngineMatrix4x4PropertySetItem(this, row, column, value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } -} - -namespace System -{ - Object::Object(UnityEngine::Matrix4x4& val) - { - int32_t handle = Plugin::BoxMatrix4x4(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator UnityEngine::Matrix4x4() - { - UnityEngine::Matrix4x4 returnVal(Plugin::UnboxMatrix4x4(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::Object(UnityEngine::QueryTriggerInteraction val) - { - int32_t handle = Plugin::BoxQueryTriggerInteraction(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator UnityEngine::QueryTriggerInteraction() - { - UnityEngine::QueryTriggerInteraction returnVal(Plugin::UnboxQueryTriggerInteraction(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - KeyValuePair::KeyValuePair(decltype(nullptr)) - : System::ValueType(nullptr) - { - } - - KeyValuePair::KeyValuePair(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); - } - } - - KeyValuePair::KeyValuePair(const KeyValuePair& other) - : KeyValuePair(Plugin::InternalUse::Only, other.Handle) - { - } - - KeyValuePair::KeyValuePair(KeyValuePair&& other) - : KeyValuePair(Plugin::InternalUse::Only, other.Handle) + + KeyValuePair::KeyValuePair(KeyValuePair&& other) + : KeyValuePair(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - KeyValuePair::~KeyValuePair() + KeyValuePair::~KeyValuePair() { if (Handle) { @@ -7832,7 +6108,7 @@ namespace System } } - KeyValuePair& KeyValuePair::operator=(const KeyValuePair& other) + KeyValuePair& KeyValuePair::operator=(const KeyValuePair& other) { if (this->Handle) { @@ -7846,7 +6122,7 @@ namespace System return *this; } - KeyValuePair& KeyValuePair::operator=(decltype(nullptr)) + KeyValuePair& KeyValuePair::operator=(decltype(nullptr)) { if (Handle) { @@ -7856,7 +6132,7 @@ namespace System return *this; } - KeyValuePair& KeyValuePair::operator=(KeyValuePair&& other) + KeyValuePair& KeyValuePair::operator=(KeyValuePair&& other) { if (Handle) { @@ -7867,18 +6143,17 @@ namespace System return *this; } - bool KeyValuePair::operator==(const KeyValuePair& other) const + bool KeyValuePair::operator==(const KeyValuePair& other) const { return Handle == other.Handle; } - bool KeyValuePair::operator!=(const KeyValuePair& other) const + bool KeyValuePair::operator!=(const KeyValuePair& other) const { return Handle != other.Handle; } - KeyValuePair::KeyValuePair(System::String& key, double value) - : System::ValueType(nullptr) + KeyValuePair::KeyValuePair(System::String& key, System::Double value) { auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(key.Handle, value); if (Plugin::unhandledCsharpException) @@ -7895,7 +6170,7 @@ namespace System } } - System::String KeyValuePair::GetKey() + System::String KeyValuePair::GetKey() { auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(Handle); if (Plugin::unhandledCsharpException) @@ -7908,7 +6183,7 @@ namespace System return System::String(Plugin::InternalUse::Only, returnValue); } - double KeyValuePair::GetValue() + System::Double KeyValuePair::GetValue() { auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(Handle); if (Plugin::unhandledCsharpException) @@ -7920,32 +6195,51 @@ namespace System } return returnValue; } + + KeyValuePair::operator System::ValueType() + { + int32_t handle = Plugin::BoxKeyValuePairSystemString_SystemDouble(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + KeyValuePair::operator System::Object() + { + int32_t handle = Plugin::BoxKeyValuePairSystemString_SystemDouble(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; + } } } } namespace System { - Object::Object(System::Collections::Generic::KeyValuePair& val) + Object::operator System::Collections::Generic::KeyValuePair() { - int32_t handle = Plugin::BoxKeyValuePairSystemString_SystemDouble(val.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator System::Collections::Generic::KeyValuePair() - { - System::Collections::Generic::KeyValuePair returnVal(Plugin::InternalUse::Only, Plugin::UnboxKeyValuePairSystemString_SystemDouble(Handle)); + System::Collections::Generic::KeyValuePair returnVal(Plugin::InternalUse::Only, Plugin::UnboxKeyValuePairSystemString_SystemDouble(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -7963,23 +6257,11 @@ namespace System { namespace Generic { - List::List(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) + LinkedListNode::LinkedListNode(decltype(nullptr)) { } - List::List(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) + LinkedListNode::LinkedListNode(Plugin::InternalUse, int32_t handle) { Handle = handle; if (handle) @@ -7988,18 +6270,18 @@ namespace System } } - List::List(const List& other) - : List(Plugin::InternalUse::Only, other.Handle) + LinkedListNode::LinkedListNode(const LinkedListNode& other) + : LinkedListNode(Plugin::InternalUse::Only, other.Handle) { } - List::List(List&& other) - : List(Plugin::InternalUse::Only, other.Handle) + LinkedListNode::LinkedListNode(LinkedListNode&& other) + : LinkedListNode(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - List::~List() + LinkedListNode::~LinkedListNode() { if (Handle) { @@ -8008,7 +6290,7 @@ namespace System } } - List& List::operator=(const List& other) + LinkedListNode& LinkedListNode::operator=(const LinkedListNode& other) { if (this->Handle) { @@ -8022,7 +6304,7 @@ namespace System return *this; } - List& List::operator=(decltype(nullptr)) + LinkedListNode& LinkedListNode::operator=(decltype(nullptr)) { if (Handle) { @@ -8032,7 +6314,7 @@ namespace System return *this; } - List& List::operator=(List&& other) + LinkedListNode& LinkedListNode::operator=(LinkedListNode&& other) { if (Handle) { @@ -8043,25 +6325,19 @@ namespace System return *this; } - bool List::operator==(const List& other) const + bool LinkedListNode::operator==(const LinkedListNode& other) const { return Handle == other.Handle; } - bool List::operator!=(const List& other) const + bool LinkedListNode::operator!=(const LinkedListNode& other) const { return Handle != other.Handle; } - List::List() - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) + LinkedListNode::LinkedListNode(System::String& value) { - auto returnValue = Plugin::SystemCollectionsGenericListSystemStringConstructor(); + auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(value.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8076,9 +6352,9 @@ namespace System } } - System::String List::GetItem(int32_t index) + System::String LinkedListNode::GetValue() { - auto returnValue = Plugin::SystemCollectionsGenericListSystemStringPropertyGetItem(Handle, index); + auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8089,33 +6365,9 @@ namespace System return System::String(Plugin::InternalUse::Only, returnValue); } - void List::SetItem(int32_t index, System::String& value) - { - Plugin::SystemCollectionsGenericListSystemStringPropertySetItem(Handle, index, value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void List::Add(System::String& item) - { - Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString(Handle, item.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void List::Sort(System::Collections::Generic::IComparer& comparer) + void LinkedListNode::SetValue(System::String& value) { - Plugin::SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); + Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(Handle, value.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8128,87 +6380,19 @@ namespace System } } -namespace Plugin -{ - SystemCollectionsGenericListSystemStringIterator::SystemCollectionsGenericListSystemStringIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericListSystemStringIterator::SystemCollectionsGenericListSystemStringIterator(System::Collections::Generic::List& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericListSystemStringIterator::~SystemCollectionsGenericListSystemStringIterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericListSystemStringIterator& SystemCollectionsGenericListSystemStringIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericListSystemStringIterator::operator!=(const SystemCollectionsGenericListSystemStringIterator& other) - { - return hasMore; - } - - System::String SystemCollectionsGenericListSystemStringIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericListSystemStringIterator begin(System::Collections::Generic::List& enumerable) - { - return Plugin::SystemCollectionsGenericListSystemStringIterator(enumerable); - } - - Plugin::SystemCollectionsGenericListSystemStringIterator end(System::Collections::Generic::List& enumerable) - { - return Plugin::SystemCollectionsGenericListSystemStringIterator(nullptr); - } - } - } -} - namespace System { - namespace Collections + namespace Runtime { - namespace Generic + namespace CompilerServices { - List::List(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) + StrongBox::StrongBox(decltype(nullptr)) + : System::Runtime::CompilerServices::IStrongBox(nullptr) { } - List::List(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) + StrongBox::StrongBox(Plugin::InternalUse, int32_t handle) + : System::Runtime::CompilerServices::IStrongBox(nullptr) { Handle = handle; if (handle) @@ -8217,18 +6401,18 @@ namespace System } } - List::List(const List& other) - : List(Plugin::InternalUse::Only, other.Handle) + StrongBox::StrongBox(const StrongBox& other) + : StrongBox(Plugin::InternalUse::Only, other.Handle) { } - List::List(List&& other) - : List(Plugin::InternalUse::Only, other.Handle) + StrongBox::StrongBox(StrongBox&& other) + : StrongBox(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - List::~List() + StrongBox::~StrongBox() { if (Handle) { @@ -8237,7 +6421,7 @@ namespace System } } - List& List::operator=(const List& other) + StrongBox& StrongBox::operator=(const StrongBox& other) { if (this->Handle) { @@ -8251,7 +6435,7 @@ namespace System return *this; } - List& List::operator=(decltype(nullptr)) + StrongBox& StrongBox::operator=(decltype(nullptr)) { if (Handle) { @@ -8261,7 +6445,7 @@ namespace System return *this; } - List& List::operator=(List&& other) + StrongBox& StrongBox::operator=(StrongBox&& other) { if (Handle) { @@ -8272,25 +6456,20 @@ namespace System return *this; } - bool List::operator==(const List& other) const + bool StrongBox::operator==(const StrongBox& other) const { return Handle == other.Handle; } - bool List::operator!=(const List& other) const + bool StrongBox::operator!=(const StrongBox& other) const { return Handle != other.Handle; } - List::List() - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) + StrongBox::StrongBox(System::String& value) + : System::Runtime::CompilerServices::IStrongBox(nullptr) { - auto returnValue = Plugin::SystemCollectionsGenericListSystemInt32Constructor(); + auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(value.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8305,22 +6484,9 @@ namespace System } } - int32_t List::GetItem(int32_t index) - { - auto returnValue = Plugin::SystemCollectionsGenericListSystemInt32PropertyGetItem(Handle, index); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void List::SetItem(int32_t index, int32_t value) + System::String StrongBox::GetValue() { - Plugin::SystemCollectionsGenericListSystemInt32PropertySetItem(Handle, index, value); + auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8328,23 +6494,12 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } + return System::String(Plugin::InternalUse::Only, returnValue); } - void List::Add(int32_t item) - { - Plugin::SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(Handle, item); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void List::Sort(System::Collections::Generic::IComparer& comparer) + void StrongBox::SetValue(System::String& value) { - Plugin::SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); + Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(Handle, value.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -8357,652 +6512,293 @@ namespace System } } -namespace Plugin +namespace System { - SystemCollectionsGenericListSystemInt32Iterator::SystemCollectionsGenericListSystemInt32Iterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericListSystemInt32Iterator::SystemCollectionsGenericListSystemInt32Iterator(System::Collections::Generic::List& enumerable) - : enumerator(enumerable.GetEnumerator()) + Exception::Exception(decltype(nullptr)) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) { - hasMore = enumerator.MoveNext(); } - SystemCollectionsGenericListSystemInt32Iterator::~SystemCollectionsGenericListSystemInt32Iterator() + Exception::Exception(Plugin::InternalUse, int32_t handle) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) { - if (enumerator != nullptr) + Handle = handle; + if (handle) { - enumerator.Dispose(); + Plugin::ReferenceManagedClass(handle); } } - SystemCollectionsGenericListSystemInt32Iterator& SystemCollectionsGenericListSystemInt32Iterator::operator++() + Exception::Exception(const Exception& other) + : Exception(Plugin::InternalUse::Only, other.Handle) { - hasMore = enumerator.MoveNext(); - return *this; } - bool SystemCollectionsGenericListSystemInt32Iterator::operator!=(const SystemCollectionsGenericListSystemInt32Iterator& other) + Exception::Exception(Exception&& other) + : Exception(Plugin::InternalUse::Only, other.Handle) { - return hasMore; + other.Handle = 0; } - int32_t SystemCollectionsGenericListSystemInt32Iterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections + Exception::~Exception() { - namespace Generic + if (Handle) { - Plugin::SystemCollectionsGenericListSystemInt32Iterator begin(System::Collections::Generic::List& enumerable) - { - return Plugin::SystemCollectionsGenericListSystemInt32Iterator(enumerable); - } - - Plugin::SystemCollectionsGenericListSystemInt32Iterator end(System::Collections::Generic::List& enumerable) - { - return Plugin::SystemCollectionsGenericListSystemInt32Iterator(nullptr); - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } -} - -namespace System -{ - namespace Collections + + Exception& Exception::operator=(const Exception& other) { - namespace Generic + if (this->Handle) { - LinkedListNode::LinkedListNode(decltype(nullptr)) - { - } - - LinkedListNode::LinkedListNode(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - LinkedListNode::LinkedListNode(const LinkedListNode& other) - : LinkedListNode(Plugin::InternalUse::Only, other.Handle) - { - } - - LinkedListNode::LinkedListNode(LinkedListNode&& other) - : LinkedListNode(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - LinkedListNode::~LinkedListNode() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - LinkedListNode& LinkedListNode::operator=(const LinkedListNode& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - LinkedListNode& LinkedListNode::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - LinkedListNode& LinkedListNode::operator=(LinkedListNode&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool LinkedListNode::operator==(const LinkedListNode& other) const - { - return Handle == other.Handle; - } - - bool LinkedListNode::operator!=(const LinkedListNode& other) const - { - return Handle != other.Handle; - } - - LinkedListNode::LinkedListNode(System::String& value) - { - auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - System::String LinkedListNode::GetValue() - { - auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); - } - - void LinkedListNode::SetValue(System::String& value) - { - Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(Handle, value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Exception& Exception::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Exception& Exception::operator=(Exception&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Exception::operator==(const Exception& other) const + { + return Handle == other.Handle; + } + + bool Exception::operator!=(const Exception& other) const + { + return Handle != other.Handle; + } + + Exception::Exception(System::String& message) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + { + auto returnValue = Plugin::SystemExceptionConstructorSystemString(message.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); } } } namespace System { - namespace Runtime + SystemException::SystemException(decltype(nullptr)) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + , System::Exception(nullptr) { - namespace CompilerServices + } + + SystemException::SystemException(Plugin::InternalUse, int32_t handle) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + , System::Exception(nullptr) + { + Handle = handle; + if (handle) { - StrongBox::StrongBox(decltype(nullptr)) - : System::Runtime::CompilerServices::IStrongBox(nullptr) - { - } - - StrongBox::StrongBox(Plugin::InternalUse iu, int32_t handle) - : System::Runtime::CompilerServices::IStrongBox(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - StrongBox::StrongBox(const StrongBox& other) - : StrongBox(Plugin::InternalUse::Only, other.Handle) - { - } - - StrongBox::StrongBox(StrongBox&& other) - : StrongBox(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - StrongBox::~StrongBox() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - StrongBox& StrongBox::operator=(const StrongBox& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - StrongBox& StrongBox::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - StrongBox& StrongBox::operator=(StrongBox&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool StrongBox::operator==(const StrongBox& other) const - { - return Handle == other.Handle; - } - - bool StrongBox::operator!=(const StrongBox& other) const - { - return Handle != other.Handle; - } - - StrongBox::StrongBox(System::String& value) - : System::Runtime::CompilerServices::IStrongBox(nullptr) - { - auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - System::String StrongBox::GetValue() - { - auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); - } - - void StrongBox::SetValue(System::String& value) - { - Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(Handle, value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + Plugin::ReferenceManagedClass(handle); } } -} - -namespace System -{ - namespace Collections + + SystemException::SystemException(const SystemException& other) + : SystemException(Plugin::InternalUse::Only, other.Handle) { - namespace ObjectModel - { - Collection::Collection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - } - - Collection::Collection(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Collection::Collection(const Collection& other) - : Collection(Plugin::InternalUse::Only, other.Handle) - { - } - - Collection::Collection(Collection&& other) - : Collection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Collection::~Collection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Collection& Collection::operator=(const Collection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Collection& Collection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Collection& Collection::operator=(Collection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Collection::operator==(const Collection& other) const - { - return Handle == other.Handle; - } - - bool Collection::operator!=(const Collection& other) const - { - return Handle != other.Handle; - } - } } -} - -namespace Plugin -{ - SystemCollectionsObjectModelCollectionSystemInt32Iterator::SystemCollectionsObjectModelCollectionSystemInt32Iterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) + + SystemException::SystemException(SystemException&& other) + : SystemException(Plugin::InternalUse::Only, other.Handle) { + other.Handle = 0; } - SystemCollectionsObjectModelCollectionSystemInt32Iterator::SystemCollectionsObjectModelCollectionSystemInt32Iterator(System::Collections::ObjectModel::Collection& enumerable) - : enumerator(enumerable.GetEnumerator()) + SystemException::~SystemException() { - hasMore = enumerator.MoveNext(); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - SystemCollectionsObjectModelCollectionSystemInt32Iterator::~SystemCollectionsObjectModelCollectionSystemInt32Iterator() + SystemException& SystemException::operator=(const SystemException& other) { - if (enumerator != nullptr) + if (this->Handle) { - enumerator.Dispose(); + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } - SystemCollectionsObjectModelCollectionSystemInt32Iterator& SystemCollectionsObjectModelCollectionSystemInt32Iterator::operator++() + SystemException& SystemException::operator=(decltype(nullptr)) { - hasMore = enumerator.MoveNext(); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } return *this; } - bool SystemCollectionsObjectModelCollectionSystemInt32Iterator::operator!=(const SystemCollectionsObjectModelCollectionSystemInt32Iterator& other) + SystemException& SystemException::operator=(SystemException&& other) { - return hasMore; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - int32_t SystemCollectionsObjectModelCollectionSystemInt32Iterator::operator*() + bool SystemException::operator==(const SystemException& other) const { - return enumerator.GetCurrent(); + return Handle == other.Handle; + } + + bool SystemException::operator!=(const SystemException& other) const + { + return Handle != other.Handle; } } namespace System { - namespace Collections + NullReferenceException::NullReferenceException(decltype(nullptr)) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + , System::Exception(nullptr) + , System::SystemException(nullptr) { - namespace ObjectModel + } + + NullReferenceException::NullReferenceException(Plugin::InternalUse, int32_t handle) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + , System::Exception(nullptr) + , System::SystemException(nullptr) + { + Handle = handle; + if (handle) { - Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator begin(System::Collections::ObjectModel::Collection& enumerable) - { - return Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator(enumerable); - } - - Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator end(System::Collections::ObjectModel::Collection& enumerable) - { - return Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator(nullptr); - } + Plugin::ReferenceManagedClass(handle); } } -} - -namespace System -{ - namespace Collections + + NullReferenceException::NullReferenceException(const NullReferenceException& other) + : NullReferenceException(Plugin::InternalUse::Only, other.Handle) { - namespace ObjectModel + } + + NullReferenceException::NullReferenceException(NullReferenceException&& other) + : NullReferenceException(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + NullReferenceException::~NullReferenceException() + { + if (Handle) { - KeyedCollection::KeyedCollection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - , System::Collections::ObjectModel::Collection(nullptr) - { - } - - KeyedCollection::KeyedCollection(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - , System::Collections::ObjectModel::Collection(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - KeyedCollection::KeyedCollection(const KeyedCollection& other) - : KeyedCollection(Plugin::InternalUse::Only, other.Handle) - { - } - - KeyedCollection::KeyedCollection(KeyedCollection&& other) - : KeyedCollection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - KeyedCollection::~KeyedCollection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - KeyedCollection& KeyedCollection::operator=(const KeyedCollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - KeyedCollection& KeyedCollection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - KeyedCollection& KeyedCollection::operator=(KeyedCollection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool KeyedCollection::operator==(const KeyedCollection& other) const - { - return Handle == other.Handle; - } - - bool KeyedCollection::operator!=(const KeyedCollection& other) const - { - return Handle != other.Handle; - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } -} - -namespace Plugin -{ - SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(System::Collections::ObjectModel::KeyedCollection& enumerable) - : enumerator(enumerable.GetEnumerator()) + NullReferenceException& NullReferenceException::operator=(const NullReferenceException& other) { - hasMore = enumerator.MoveNext(); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::~SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator() + NullReferenceException& NullReferenceException::operator=(decltype(nullptr)) { - if (enumerator != nullptr) + if (Handle) { - enumerator.Dispose(); + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } + return *this; } - SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::operator++() + NullReferenceException& NullReferenceException::operator=(NullReferenceException&& other) { - hasMore = enumerator.MoveNext(); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; return *this; } - bool SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::operator!=(const SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& other) + bool NullReferenceException::operator==(const NullReferenceException& other) const { - return hasMore; + return Handle == other.Handle; } - int32_t SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections + bool NullReferenceException::operator!=(const NullReferenceException& other) const { - namespace ObjectModel - { - Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator begin(System::Collections::ObjectModel::KeyedCollection& enumerable) - { - return Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(enumerable); - } - - Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator end(System::Collections::ObjectModel::KeyedCollection& enumerable) - { - return Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(nullptr); - } - } + return Handle != other.Handle; } } -namespace System +namespace UnityEngine { - Exception::Exception(decltype(nullptr)) - : System::Runtime::InteropServices::_Exception(nullptr) - , System::Runtime::Serialization::ISerializable(nullptr) + Screen::Screen(decltype(nullptr)) { } - Exception::Exception(Plugin::InternalUse iu, int32_t handle) - : System::Runtime::InteropServices::_Exception(nullptr) - , System::Runtime::Serialization::ISerializable(nullptr) + Screen::Screen(Plugin::InternalUse, int32_t handle) { Handle = handle; if (handle) @@ -9011,18 +6807,18 @@ namespace System } } - Exception::Exception(const Exception& other) - : Exception(Plugin::InternalUse::Only, other.Handle) + Screen::Screen(const Screen& other) + : Screen(Plugin::InternalUse::Only, other.Handle) { } - Exception::Exception(Exception&& other) - : Exception(Plugin::InternalUse::Only, other.Handle) + Screen::Screen(Screen&& other) + : Screen(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - Exception::~Exception() + Screen::~Screen() { if (Handle) { @@ -9031,7 +6827,7 @@ namespace System } } - Exception& Exception::operator=(const Exception& other) + Screen& Screen::operator=(const Screen& other) { if (this->Handle) { @@ -9045,7 +6841,7 @@ namespace System return *this; } - Exception& Exception::operator=(decltype(nullptr)) + Screen& Screen::operator=(decltype(nullptr)) { if (Handle) { @@ -9055,7 +6851,7 @@ namespace System return *this; } - Exception& Exception::operator=(Exception&& other) + Screen& Screen::operator=(Screen&& other) { if (Handle) { @@ -9066,21 +6862,19 @@ namespace System return *this; } - bool Exception::operator==(const Exception& other) const + bool Screen::operator==(const Screen& other) const { return Handle == other.Handle; } - bool Exception::operator!=(const Exception& other) const + bool Screen::operator!=(const Screen& other) const { return Handle != other.Handle; } - Exception::Exception(System::String& message) - : System::Runtime::InteropServices::_Exception(nullptr) - , System::Runtime::Serialization::ISerializable(nullptr) + System::Array1 Screen::GetResolutions() { - auto returnValue = Plugin::SystemExceptionConstructorSystemString(message.Handle); + auto returnValue = Plugin::UnityEngineScreenPropertyGetResolutions(); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9088,136 +6882,187 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } + return System::Array1(Plugin::InternalUse::Only, returnValue); } } -namespace System +namespace UnityEngine { - SystemException::SystemException(decltype(nullptr)) - : System::Runtime::InteropServices::_Exception(nullptr) - , System::Runtime::Serialization::ISerializable(nullptr) - , System::Exception(nullptr) + Ray::Ray(decltype(nullptr)) { } - SystemException::SystemException(Plugin::InternalUse iu, int32_t handle) - : System::Runtime::InteropServices::_Exception(nullptr) - , System::Runtime::Serialization::ISerializable(nullptr) - , System::Exception(nullptr) + Ray::Ray(Plugin::InternalUse, int32_t handle) { Handle = handle; if (handle) { - Plugin::ReferenceManagedClass(handle); + Plugin::ReferenceManagedUnityEngineRay(Handle); } } - SystemException::SystemException(const SystemException& other) - : SystemException(Plugin::InternalUse::Only, other.Handle) + Ray::Ray(const Ray& other) + : Ray(Plugin::InternalUse::Only, other.Handle) { } - SystemException::SystemException(SystemException&& other) - : SystemException(Plugin::InternalUse::Only, other.Handle) + Ray::Ray(Ray&& other) + : Ray(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - SystemException::~SystemException() + Ray::~Ray() { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedUnityEngineRay(Handle); Handle = 0; } } - SystemException& SystemException::operator=(const SystemException& other) + Ray& Ray::operator=(const Ray& other) { if (this->Handle) { - Plugin::DereferenceManagedClass(this->Handle); + Plugin::DereferenceManagedUnityEngineRay(Handle); } this->Handle = other.Handle; if (this->Handle) { - Plugin::ReferenceManagedClass(this->Handle); + Plugin::ReferenceManagedUnityEngineRay(Handle); } return *this; } - SystemException& SystemException::operator=(decltype(nullptr)) + Ray& Ray::operator=(decltype(nullptr)) { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedUnityEngineRay(Handle); Handle = 0; } return *this; } - SystemException& SystemException::operator=(SystemException&& other) + Ray& Ray::operator=(Ray&& other) { if (Handle) { - Plugin::DereferenceManagedClass(Handle); + Plugin::DereferenceManagedUnityEngineRay(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool SystemException::operator==(const SystemException& other) const + bool Ray::operator==(const Ray& other) const { return Handle == other.Handle; } - bool SystemException::operator!=(const SystemException& other) const + bool Ray::operator!=(const Ray& other) const { return Handle != other.Handle; } -} - -namespace System -{ - NullReferenceException::NullReferenceException(decltype(nullptr)) - : System::Runtime::InteropServices::_Exception(nullptr) - , System::Runtime::Serialization::ISerializable(nullptr) - , System::Exception(nullptr) - , System::SystemException(nullptr) + + Ray::Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction) { + auto returnValue = Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(origin, direction); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedUnityEngineRay(Handle); + } } - NullReferenceException::NullReferenceException(Plugin::InternalUse iu, int32_t handle) - : System::Runtime::InteropServices::_Exception(nullptr) - , System::Runtime::Serialization::ISerializable(nullptr) - , System::Exception(nullptr) - , System::SystemException(nullptr) + Ray::operator System::ValueType() { - Handle = handle; + int32_t handle = Plugin::BoxRay(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } if (handle) { Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); } + return nullptr; } - NullReferenceException::NullReferenceException(const NullReferenceException& other) - : NullReferenceException(Plugin::InternalUse::Only, other.Handle) - { - } - - NullReferenceException::NullReferenceException(NullReferenceException&& other) - : NullReferenceException(Plugin::InternalUse::Only, other.Handle) + Ray::operator System::Object() + { + int32_t handle = Plugin::BoxRay(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; + } +} + +namespace System +{ + Object::operator UnityEngine::Ray() + { + UnityEngine::Ray returnVal(Plugin::InternalUse::Only, Plugin::UnboxRay(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace UnityEngine +{ + Physics::Physics(decltype(nullptr)) + { + } + + Physics::Physics(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Physics::Physics(const Physics& other) + : Physics(Plugin::InternalUse::Only, other.Handle) + { + } + + Physics::Physics(Physics&& other) + : Physics(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - NullReferenceException::~NullReferenceException() + Physics::~Physics() { if (Handle) { @@ -9226,7 +7071,7 @@ namespace System } } - NullReferenceException& NullReferenceException::operator=(const NullReferenceException& other) + Physics& Physics::operator=(const Physics& other) { if (this->Handle) { @@ -9240,7 +7085,7 @@ namespace System return *this; } - NullReferenceException& NullReferenceException::operator=(decltype(nullptr)) + Physics& Physics::operator=(decltype(nullptr)) { if (Handle) { @@ -9250,7 +7095,7 @@ namespace System return *this; } - NullReferenceException& NullReferenceException::operator=(NullReferenceException&& other) + Physics& Physics::operator=(Physics&& other) { if (Handle) { @@ -9261,24 +7106,175 @@ namespace System return *this; } - bool NullReferenceException::operator==(const NullReferenceException& other) const + bool Physics::operator==(const Physics& other) const { return Handle == other.Handle; } - bool NullReferenceException::operator!=(const NullReferenceException& other) const + bool Physics::operator!=(const Physics& other) const { return Handle != other.Handle; } + + System::Int32 Physics::RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1& results) + { + auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1(ray.Handle, results.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + System::Array1 Physics::RaycastAll(UnityEngine::Ray& ray) + { + auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ray.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Array1(Plugin::InternalUse::Only, returnValue); + } } namespace UnityEngine { - Screen::Screen(decltype(nullptr)) + Gradient::Gradient(decltype(nullptr)) + { + } + + Gradient::Gradient(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Gradient::Gradient(const Gradient& other) + : Gradient(Plugin::InternalUse::Only, other.Handle) + { + } + + Gradient::Gradient(Gradient&& other) + : Gradient(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Gradient::~Gradient() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Gradient& Gradient::operator=(const Gradient& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Gradient& Gradient::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Gradient& Gradient::operator=(Gradient&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Gradient::operator==(const Gradient& other) const + { + return Handle == other.Handle; + } + + bool Gradient::operator!=(const Gradient& other) const + { + return Handle != other.Handle; + } + + Gradient::Gradient() + { + auto returnValue = Plugin::UnityEngineGradientConstructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + System::Array1 Gradient::GetColorKeys() + { + auto returnValue = Plugin::UnityEngineGradientPropertyGetColorKeys(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Array1(Plugin::InternalUse::Only, returnValue); + } + + void Gradient::SetColorKeys(System::Array1& value) + { + Plugin::UnityEngineGradientPropertySetColorKeys(Handle, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace System +{ + AppDomainSetup::AppDomainSetup(decltype(nullptr)) + : System::IAppDomainSetup(nullptr) { } - Screen::Screen(Plugin::InternalUse iu, int32_t handle) + AppDomainSetup::AppDomainSetup(Plugin::InternalUse, int32_t handle) + : System::IAppDomainSetup(nullptr) { Handle = handle; if (handle) @@ -9286,427 +7282,4028 @@ namespace UnityEngine Plugin::ReferenceManagedClass(handle); } } - - Screen::Screen(const Screen& other) - : Screen(Plugin::InternalUse::Only, other.Handle) - { - } - - Screen::Screen(Screen&& other) - : Screen(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Screen::~Screen() + + AppDomainSetup::AppDomainSetup(const AppDomainSetup& other) + : AppDomainSetup(Plugin::InternalUse::Only, other.Handle) + { + } + + AppDomainSetup::AppDomainSetup(AppDomainSetup&& other) + : AppDomainSetup(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + AppDomainSetup::~AppDomainSetup() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + AppDomainSetup& AppDomainSetup::operator=(const AppDomainSetup& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + AppDomainSetup& AppDomainSetup::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + AppDomainSetup& AppDomainSetup::operator=(AppDomainSetup&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool AppDomainSetup::operator==(const AppDomainSetup& other) const + { + return Handle == other.Handle; + } + + bool AppDomainSetup::operator!=(const AppDomainSetup& other) const + { + return Handle != other.Handle; + } + + AppDomainSetup::AppDomainSetup() + : System::IAppDomainSetup(nullptr) + { + auto returnValue = Plugin::SystemAppDomainSetupConstructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + System::AppDomainInitializer AppDomainSetup::GetAppDomainInitializer() + { + auto returnValue = Plugin::SystemAppDomainSetupPropertyGetAppDomainInitializer(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::AppDomainInitializer(Plugin::InternalUse::Only, returnValue); + } + + void AppDomainSetup::SetAppDomainInitializer(System::AppDomainInitializer& value) + { + Plugin::SystemAppDomainSetupPropertySetAppDomainInitializer(Handle, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace UnityEngine +{ + Application::Application(decltype(nullptr)) + { + } + + Application::Application(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Application::Application(const Application& other) + : Application(Plugin::InternalUse::Only, other.Handle) + { + } + + Application::Application(Application&& other) + : Application(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Application::~Application() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Application& Application::operator=(const Application& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Application& Application::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Application& Application::operator=(Application&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Application::operator==(const Application& other) const + { + return Handle == other.Handle; + } + + bool Application::operator!=(const Application& other) const + { + return Handle != other.Handle; + } + + void Application::AddOnBeforeRender(UnityEngine::Events::UnityAction& del) + { + Plugin::UnityEngineApplicationAddEventOnBeforeRender(del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void Application::RemoveOnBeforeRender(UnityEngine::Events::UnityAction& del) + { + Plugin::UnityEngineApplicationRemoveEventOnBeforeRender(del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace UnityEngine +{ + namespace SceneManagement + { + SceneManager::SceneManager(decltype(nullptr)) + { + } + + SceneManager::SceneManager(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + SceneManager::SceneManager(const SceneManager& other) + : SceneManager(Plugin::InternalUse::Only, other.Handle) + { + } + + SceneManager::SceneManager(SceneManager&& other) + : SceneManager(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + SceneManager::~SceneManager() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + SceneManager& SceneManager::operator=(const SceneManager& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + SceneManager& SceneManager::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + SceneManager& SceneManager::operator=(SceneManager&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool SceneManager::operator==(const SceneManager& other) const + { + return Handle == other.Handle; + } + + bool SceneManager::operator!=(const SceneManager& other) const + { + return Handle != other.Handle; + } + + void SceneManager::AddSceneLoaded(UnityEngine::Events::UnityAction2& del) + { + Plugin::UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void SceneManager::RemoveSceneLoaded(UnityEngine::Events::UnityAction2& del) + { + Plugin::UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(del.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } +} + +namespace UnityEngine +{ + namespace SceneManagement + { + Scene::Scene(decltype(nullptr)) + { + } + + Scene::Scene(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedUnityEngineSceneManagementScene(Handle); + } + } + + Scene::Scene(const Scene& other) + : Scene(Plugin::InternalUse::Only, other.Handle) + { + } + + Scene::Scene(Scene&& other) + : Scene(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Scene::~Scene() + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); + Handle = 0; + } + } + + Scene& Scene::operator=(const Scene& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEngineSceneManagementScene(Handle); + } + return *this; + } + + Scene& Scene::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); + Handle = 0; + } + return *this; + } + + Scene& Scene::operator=(Scene&& other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Scene::operator==(const Scene& other) const + { + return Handle == other.Handle; + } + + bool Scene::operator!=(const Scene& other) const + { + return Handle != other.Handle; + } + + Scene::operator System::ValueType() + { + int32_t handle = Plugin::BoxScene(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + Scene::operator System::Object() + { + int32_t handle = Plugin::BoxScene(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + } +} + +namespace System +{ + Object::operator UnityEngine::SceneManagement::Scene() + { + UnityEngine::SceneManagement::Scene returnVal(Plugin::InternalUse::Only, Plugin::UnboxScene(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace UnityEngine +{ + namespace SceneManagement + { + LoadSceneMode::LoadSceneMode(int32_t value) + : Value(value) + { + } + + UnityEngine::SceneManagement::LoadSceneMode::operator int32_t() const + { + return Value; + } + + bool UnityEngine::SceneManagement::LoadSceneMode::operator==(LoadSceneMode other) + { + return Value == other.Value; + } + + bool UnityEngine::SceneManagement::LoadSceneMode::operator!=(LoadSceneMode other) + { + return Value != other.Value; + } + + LoadSceneMode::operator System::Enum() + { + int32_t handle = Plugin::BoxLoadSceneMode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Enum(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + LoadSceneMode::operator System::ValueType() + { + int32_t handle = Plugin::BoxLoadSceneMode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + LoadSceneMode::operator System::Object() + { + int32_t handle = Plugin::BoxLoadSceneMode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + LoadSceneMode::operator System::IFormattable() + { + int32_t handle = Plugin::BoxLoadSceneMode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IFormattable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + LoadSceneMode::operator System::IConvertible() + { + int32_t handle = Plugin::BoxLoadSceneMode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IConvertible(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + LoadSceneMode::operator System::IComparable() + { + int32_t handle = Plugin::BoxLoadSceneMode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IComparable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + } +} +const UnityEngine::SceneManagement::LoadSceneMode UnityEngine::SceneManagement::LoadSceneMode::Single(0); +const UnityEngine::SceneManagement::LoadSceneMode UnityEngine::SceneManagement::LoadSceneMode::Additive(1); + +namespace System +{ + Object::operator UnityEngine::SceneManagement::LoadSceneMode() + { + UnityEngine::SceneManagement::LoadSceneMode returnVal(Plugin::UnboxLoadSceneMode(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + EventArgs::EventArgs(decltype(nullptr)) + { + } + + EventArgs::EventArgs(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + EventArgs::EventArgs(const EventArgs& other) + : EventArgs(Plugin::InternalUse::Only, other.Handle) + { + } + + EventArgs::EventArgs(EventArgs&& other) + : EventArgs(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + EventArgs::~EventArgs() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + EventArgs& EventArgs::operator=(const EventArgs& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + EventArgs& EventArgs::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + EventArgs& EventArgs::operator=(EventArgs&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool EventArgs::operator==(const EventArgs& other) const + { + return Handle == other.Handle; + } + + bool EventArgs::operator!=(const EventArgs& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + ComponentEventArgs::ComponentEventArgs(decltype(nullptr)) + : System::EventArgs(nullptr) + { + } + + ComponentEventArgs::ComponentEventArgs(Plugin::InternalUse, int32_t handle) + : System::EventArgs(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ComponentEventArgs::ComponentEventArgs(const ComponentEventArgs& other) + : ComponentEventArgs(Plugin::InternalUse::Only, other.Handle) + { + } + + ComponentEventArgs::ComponentEventArgs(ComponentEventArgs&& other) + : ComponentEventArgs(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ComponentEventArgs::~ComponentEventArgs() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ComponentEventArgs& ComponentEventArgs::operator=(const ComponentEventArgs& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ComponentEventArgs& ComponentEventArgs::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ComponentEventArgs& ComponentEventArgs::operator=(ComponentEventArgs&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ComponentEventArgs::operator==(const ComponentEventArgs& other) const + { + return Handle == other.Handle; + } + + bool ComponentEventArgs::operator!=(const ComponentEventArgs& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + ComponentChangingEventArgs::ComponentChangingEventArgs(decltype(nullptr)) + : System::EventArgs(nullptr) + { + } + + ComponentChangingEventArgs::ComponentChangingEventArgs(Plugin::InternalUse, int32_t handle) + : System::EventArgs(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ComponentChangingEventArgs::ComponentChangingEventArgs(const ComponentChangingEventArgs& other) + : ComponentChangingEventArgs(Plugin::InternalUse::Only, other.Handle) + { + } + + ComponentChangingEventArgs::ComponentChangingEventArgs(ComponentChangingEventArgs&& other) + : ComponentChangingEventArgs(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ComponentChangingEventArgs::~ComponentChangingEventArgs() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(const ComponentChangingEventArgs& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(ComponentChangingEventArgs&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ComponentChangingEventArgs::operator==(const ComponentChangingEventArgs& other) const + { + return Handle == other.Handle; + } + + bool ComponentChangingEventArgs::operator!=(const ComponentChangingEventArgs& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + ComponentChangedEventArgs::ComponentChangedEventArgs(decltype(nullptr)) + : System::EventArgs(nullptr) + { + } + + ComponentChangedEventArgs::ComponentChangedEventArgs(Plugin::InternalUse, int32_t handle) + : System::EventArgs(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ComponentChangedEventArgs::ComponentChangedEventArgs(const ComponentChangedEventArgs& other) + : ComponentChangedEventArgs(Plugin::InternalUse::Only, other.Handle) + { + } + + ComponentChangedEventArgs::ComponentChangedEventArgs(ComponentChangedEventArgs&& other) + : ComponentChangedEventArgs(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ComponentChangedEventArgs::~ComponentChangedEventArgs() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(const ComponentChangedEventArgs& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(ComponentChangedEventArgs&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ComponentChangedEventArgs::operator==(const ComponentChangedEventArgs& other) const + { + return Handle == other.Handle; + } + + bool ComponentChangedEventArgs::operator!=(const ComponentChangedEventArgs& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + ComponentRenameEventArgs::ComponentRenameEventArgs(decltype(nullptr)) + : System::EventArgs(nullptr) + { + } + + ComponentRenameEventArgs::ComponentRenameEventArgs(Plugin::InternalUse, int32_t handle) + : System::EventArgs(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ComponentRenameEventArgs::ComponentRenameEventArgs(const ComponentRenameEventArgs& other) + : ComponentRenameEventArgs(Plugin::InternalUse::Only, other.Handle) + { + } + + ComponentRenameEventArgs::ComponentRenameEventArgs(ComponentRenameEventArgs&& other) + : ComponentRenameEventArgs(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ComponentRenameEventArgs::~ComponentRenameEventArgs() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(const ComponentRenameEventArgs& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(ComponentRenameEventArgs&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ComponentRenameEventArgs::operator==(const ComponentRenameEventArgs& other) const + { + return Handle == other.Handle; + } + + bool ComponentRenameEventArgs::operator!=(const ComponentRenameEventArgs& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace System +{ + namespace ComponentModel + { + MemberDescriptor::MemberDescriptor(decltype(nullptr)) + { + } + + MemberDescriptor::MemberDescriptor(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + MemberDescriptor::MemberDescriptor(const MemberDescriptor& other) + : MemberDescriptor(Plugin::InternalUse::Only, other.Handle) + { + } + + MemberDescriptor::MemberDescriptor(MemberDescriptor&& other) + : MemberDescriptor(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + MemberDescriptor::~MemberDescriptor() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + MemberDescriptor& MemberDescriptor::operator=(const MemberDescriptor& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + MemberDescriptor& MemberDescriptor::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + MemberDescriptor& MemberDescriptor::operator=(MemberDescriptor&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool MemberDescriptor::operator==(const MemberDescriptor& other) const + { + return Handle == other.Handle; + } + + bool MemberDescriptor::operator!=(const MemberDescriptor& other) const + { + return Handle != other.Handle; + } + } +} + +namespace UnityEngine +{ + PrimitiveType::PrimitiveType(int32_t value) + : Value(value) + { + } + + UnityEngine::PrimitiveType::operator int32_t() const + { + return Value; + } + + bool UnityEngine::PrimitiveType::operator==(PrimitiveType other) + { + return Value == other.Value; + } + + bool UnityEngine::PrimitiveType::operator!=(PrimitiveType other) + { + return Value != other.Value; + } + + PrimitiveType::operator System::Enum() + { + int32_t handle = Plugin::BoxPrimitiveType(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Enum(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + PrimitiveType::operator System::ValueType() + { + int32_t handle = Plugin::BoxPrimitiveType(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + PrimitiveType::operator System::Object() + { + int32_t handle = Plugin::BoxPrimitiveType(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + PrimitiveType::operator System::IFormattable() + { + int32_t handle = Plugin::BoxPrimitiveType(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IFormattable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + PrimitiveType::operator System::IConvertible() + { + int32_t handle = Plugin::BoxPrimitiveType(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IConvertible(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + PrimitiveType::operator System::IComparable() + { + int32_t handle = Plugin::BoxPrimitiveType(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IComparable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + +} +const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Sphere(0); +const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Capsule(1); +const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Cylinder(2); +const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Cube(3); +const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Plane(4); +const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Quad(5); + +namespace System +{ + Object::operator UnityEngine::PrimitiveType() + { + UnityEngine::PrimitiveType returnVal(Plugin::UnboxPrimitiveType(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace UnityEngine +{ + Time::Time(decltype(nullptr)) + { + } + + Time::Time(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Time::Time(const Time& other) + : Time(Plugin::InternalUse::Only, other.Handle) + { + } + + Time::Time(Time&& other) + : Time(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Time::~Time() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Time& Time::operator=(const Time& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Time& Time::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Time& Time::operator=(Time&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Time::operator==(const Time& other) const + { + return Handle == other.Handle; + } + + bool Time::operator!=(const Time& other) const + { + return Handle != other.Handle; + } + + System::Single Time::GetDeltaTime() + { + auto returnValue = Plugin::UnityEngineTimePropertyGetDeltaTime(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } +} + +namespace System +{ + namespace IO + { + FileMode::FileMode(int32_t value) + : Value(value) + { + } + + System::IO::FileMode::operator int32_t() const + { + return Value; + } + + bool System::IO::FileMode::operator==(FileMode other) + { + return Value == other.Value; + } + + bool System::IO::FileMode::operator!=(FileMode other) + { + return Value != other.Value; + } + + FileMode::operator System::Enum() + { + int32_t handle = Plugin::BoxFileMode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Enum(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + FileMode::operator System::ValueType() + { + int32_t handle = Plugin::BoxFileMode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + FileMode::operator System::Object() + { + int32_t handle = Plugin::BoxFileMode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + FileMode::operator System::IFormattable() + { + int32_t handle = Plugin::BoxFileMode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IFormattable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + FileMode::operator System::IConvertible() + { + int32_t handle = Plugin::BoxFileMode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IConvertible(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + FileMode::operator System::IComparable() + { + int32_t handle = Plugin::BoxFileMode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IComparable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + } +} +const System::IO::FileMode System::IO::FileMode::CreateNew(1); +const System::IO::FileMode System::IO::FileMode::Create(2); +const System::IO::FileMode System::IO::FileMode::Open(3); +const System::IO::FileMode System::IO::FileMode::OpenOrCreate(4); +const System::IO::FileMode System::IO::FileMode::Truncate(5); +const System::IO::FileMode System::IO::FileMode::Append(6); + +namespace System +{ + Object::operator System::IO::FileMode() + { + System::IO::FileMode returnVal(Plugin::UnboxFileMode(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + MarshalByRefObject::MarshalByRefObject(decltype(nullptr)) + { + } + + MarshalByRefObject::MarshalByRefObject(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + MarshalByRefObject::MarshalByRefObject(const MarshalByRefObject& other) + : MarshalByRefObject(Plugin::InternalUse::Only, other.Handle) + { + } + + MarshalByRefObject::MarshalByRefObject(MarshalByRefObject&& other) + : MarshalByRefObject(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + MarshalByRefObject::~MarshalByRefObject() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + MarshalByRefObject& MarshalByRefObject::operator=(const MarshalByRefObject& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + MarshalByRefObject& MarshalByRefObject::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + MarshalByRefObject& MarshalByRefObject::operator=(MarshalByRefObject&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool MarshalByRefObject::operator==(const MarshalByRefObject& other) const + { + return Handle == other.Handle; + } + + bool MarshalByRefObject::operator!=(const MarshalByRefObject& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + namespace IO + { + Stream::Stream(decltype(nullptr)) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + { + } + + Stream::Stream(Plugin::InternalUse, int32_t handle) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Stream::Stream(const Stream& other) + : Stream(Plugin::InternalUse::Only, other.Handle) + { + } + + Stream::Stream(Stream&& other) + : Stream(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Stream::~Stream() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Stream& Stream::operator=(const Stream& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Stream& Stream::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Stream& Stream::operator=(Stream&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Stream::operator==(const Stream& other) const + { + return Handle == other.Handle; + } + + bool Stream::operator!=(const Stream& other) const + { + return Handle != other.Handle; + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + IComparer::IComparer(decltype(nullptr)) + { + } + + IComparer::IComparer(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparer::IComparer(const IComparer& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparer::IComparer(IComparer&& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparer::~IComparer() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparer& IComparer::operator=(const IComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparer& IComparer::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparer& IComparer::operator=(IComparer&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparer::operator==(const IComparer& other) const + { + return Handle == other.Handle; + } + + bool IComparer::operator!=(const IComparer& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + IComparer::IComparer(decltype(nullptr)) + { + } + + IComparer::IComparer(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparer::IComparer(const IComparer& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparer::IComparer(IComparer&& other) + : IComparer(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparer::~IComparer() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparer& IComparer::operator=(const IComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparer& IComparer::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparer& IComparer::operator=(IComparer&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparer::operator==(const IComparer& other) const + { + return Handle == other.Handle; + } + + bool IComparer::operator!=(const IComparer& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + BaseIComparer::BaseIComparer() + : System::Collections::Generic::IComparer(nullptr) + { + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); + System::Int32* handle = (System::Int32*)&Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemCollectionsGenericBaseIComparerSystemInt32Constructor(cppHandle, &handle->Value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + BaseIComparer::BaseIComparer(decltype(nullptr)) + : System::Collections::Generic::IComparer(nullptr) + { + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); + } + + BaseIComparer::BaseIComparer(const BaseIComparer& other) + : System::Collections::Generic::IComparer(nullptr) + { + Handle = other.Handle; + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + BaseIComparer::BaseIComparer(BaseIComparer&& other) + : System::Collections::Generic::IComparer(nullptr) + { + Handle = other.Handle; + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + BaseIComparer::BaseIComparer(Plugin::InternalUse, int32_t handle) + : System::Collections::Generic::IComparer(nullptr) + { + Handle = handle; + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + BaseIComparer::~BaseIComparer() + { + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + BaseIComparer& BaseIComparer::operator=(const BaseIComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + BaseIComparer& BaseIComparer::operator=(decltype(nullptr)) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + BaseIComparer& BaseIComparer::operator=(BaseIComparer&& other) + { + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool BaseIComparer::operator==(const BaseIComparer& other) const + { + return Handle == other.Handle; + } + + bool BaseIComparer::operator!=(const BaseIComparer& other) const + { + return Handle != other.Handle; + } + + System::Int32 BaseIComparer::Compare(System::Int32 x, System::Int32 y) + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemInt32Compare(int32_t cppHandle, int32_t x, int32_t y) + { + try + { + return Plugin::GetSystemCollectionsGenericBaseIComparerSystemInt32(cppHandle)->Compare(x, y); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + BaseIComparer::BaseIComparer() + : System::Collections::Generic::IComparer(nullptr) + { + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); + System::Int32* handle = (System::Int32*)&Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemCollectionsGenericBaseIComparerSystemStringConstructor(cppHandle, &handle->Value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + BaseIComparer::BaseIComparer(decltype(nullptr)) + : System::Collections::Generic::IComparer(nullptr) + { + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); + } + + BaseIComparer::BaseIComparer(const BaseIComparer& other) + : System::Collections::Generic::IComparer(nullptr) + { + Handle = other.Handle; + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + BaseIComparer::BaseIComparer(BaseIComparer&& other) + : System::Collections::Generic::IComparer(nullptr) + { + Handle = other.Handle; + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + BaseIComparer::BaseIComparer(Plugin::InternalUse, int32_t handle) + : System::Collections::Generic::IComparer(nullptr) + { + Handle = handle; + CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + BaseIComparer::~BaseIComparer() + { + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + BaseIComparer& BaseIComparer::operator=(const BaseIComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + BaseIComparer& BaseIComparer::operator=(decltype(nullptr)) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + BaseIComparer& BaseIComparer::operator=(BaseIComparer&& other) + { + Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool BaseIComparer::operator==(const BaseIComparer& other) const + { + return Handle == other.Handle; + } + + bool BaseIComparer::operator!=(const BaseIComparer& other) const + { + return Handle != other.Handle; + } + + System::Int32 BaseIComparer::Compare(System::String& x, System::String& y) + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemStringCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + { + try + { + auto x = System::String(Plugin::InternalUse::Only, xHandle); + auto y = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemCollectionsGenericBaseIComparerSystemString(cppHandle)->Compare(x, y); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + } + } +} + +namespace System +{ + StringComparer::StringComparer(decltype(nullptr)) + : System::Collections::IComparer(nullptr) + , System::Collections::Generic::IComparer(nullptr) + , System::Collections::IEqualityComparer(nullptr) + , System::Collections::Generic::IEqualityComparer(nullptr) + { + } + + StringComparer::StringComparer(Plugin::InternalUse, int32_t handle) + : System::Collections::IComparer(nullptr) + , System::Collections::Generic::IComparer(nullptr) + , System::Collections::IEqualityComparer(nullptr) + , System::Collections::Generic::IEqualityComparer(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + StringComparer::StringComparer(const StringComparer& other) + : StringComparer(Plugin::InternalUse::Only, other.Handle) + { + } + + StringComparer::StringComparer(StringComparer&& other) + : StringComparer(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + StringComparer::~StringComparer() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + StringComparer& StringComparer::operator=(const StringComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + StringComparer& StringComparer::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + StringComparer& StringComparer::operator=(StringComparer&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool StringComparer::operator==(const StringComparer& other) const + { + return Handle == other.Handle; + } + + bool StringComparer::operator!=(const StringComparer& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + BaseStringComparer::BaseStringComparer() + : System::Collections::IComparer(nullptr) + , System::Collections::Generic::IComparer(nullptr) + , System::Collections::IEqualityComparer(nullptr) + , System::Collections::Generic::IEqualityComparer(nullptr) + , System::StringComparer(nullptr) + { + CppHandle = Plugin::StoreSystemBaseStringComparer(this); + System::Int32* handle = (System::Int32*)&Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemBaseStringComparerConstructor(cppHandle, &handle->Value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemBaseStringComparer(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + BaseStringComparer::BaseStringComparer(decltype(nullptr)) + : System::Collections::IComparer(nullptr) + , System::Collections::Generic::IComparer(nullptr) + , System::Collections::IEqualityComparer(nullptr) + , System::Collections::Generic::IEqualityComparer(nullptr) + , System::StringComparer(nullptr) + { + CppHandle = Plugin::StoreSystemBaseStringComparer(this); + } + + BaseStringComparer::BaseStringComparer(const BaseStringComparer& other) + : System::Collections::IComparer(nullptr) + , System::Collections::Generic::IComparer(nullptr) + , System::Collections::IEqualityComparer(nullptr) + , System::Collections::Generic::IEqualityComparer(nullptr) + , System::StringComparer(nullptr) + { + Handle = other.Handle; + CppHandle = Plugin::StoreSystemBaseStringComparer(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + BaseStringComparer::BaseStringComparer(BaseStringComparer&& other) + : System::Collections::IComparer(nullptr) + , System::Collections::Generic::IComparer(nullptr) + , System::Collections::IEqualityComparer(nullptr) + , System::Collections::Generic::IEqualityComparer(nullptr) + , System::StringComparer(nullptr) + { + Handle = other.Handle; + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + BaseStringComparer::BaseStringComparer(Plugin::InternalUse, int32_t handle) + : System::Collections::IComparer(nullptr) + , System::Collections::Generic::IComparer(nullptr) + , System::Collections::IEqualityComparer(nullptr) + , System::Collections::Generic::IEqualityComparer(nullptr) + , System::StringComparer(nullptr) + { + Handle = handle; + CppHandle = Plugin::StoreSystemBaseStringComparer(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + BaseStringComparer::~BaseStringComparer() + { + Plugin::RemoveSystemBaseStringComparer(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemBaseStringComparer(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + BaseStringComparer& BaseStringComparer::operator=(const BaseStringComparer& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + BaseStringComparer& BaseStringComparer::operator=(decltype(nullptr)) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemBaseStringComparer(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + BaseStringComparer& BaseStringComparer::operator=(BaseStringComparer&& other) + { + Plugin::RemoveSystemBaseStringComparer(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemBaseStringComparer(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool BaseStringComparer::operator==(const BaseStringComparer& other) const + { + return Handle == other.Handle; + } + + bool BaseStringComparer::operator!=(const BaseStringComparer& other) const + { + return Handle != other.Handle; + } + + System::Int32 BaseStringComparer::Compare(System::String& x, System::String& y) + { + return {}; + } + + DLLEXPORT int32_t SystemStringComparerCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + { + try + { + auto x = System::String(Plugin::InternalUse::Only, xHandle); + auto y = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemBaseStringComparer(cppHandle)->Compare(x, y); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::StringComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + System::Boolean BaseStringComparer::Equals(System::String& x, System::String& y) + { + return {}; + } + + DLLEXPORT int32_t SystemStringComparerEquals(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + { + try + { + auto x = System::String(Plugin::InternalUse::Only, xHandle); + auto y = System::String(Plugin::InternalUse::Only, yHandle); + return Plugin::GetSystemBaseStringComparer(cppHandle)->Equals(x, y); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::StringComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + + System::Int32 BaseStringComparer::GetHashCode(System::String& obj) + { + return {}; + } + + DLLEXPORT int32_t SystemStringComparerGetHashCode(int32_t cppHandle, int32_t objHandle) + { + try + { + auto obj = System::String(Plugin::InternalUse::Only, objHandle); + return Plugin::GetSystemBaseStringComparer(cppHandle)->GetHashCode(obj); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::StringComparer"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } +} + +namespace System +{ + namespace Collections + { + Queue::Queue(decltype(nullptr)) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + { + } + + Queue::Queue(Plugin::InternalUse, int32_t handle) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + Queue::Queue(const Queue& other) + : Queue(Plugin::InternalUse::Only, other.Handle) + { + } + + Queue::Queue(Queue&& other) + : Queue(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Queue::~Queue() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + Queue& Queue::operator=(const Queue& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Queue& Queue::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Queue& Queue::operator=(Queue&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Queue::operator==(const Queue& other) const + { + return Handle == other.Handle; + } + + bool Queue::operator!=(const Queue& other) const + { + return Handle != other.Handle; + } + + System::Int32 Queue::GetCount() + { + auto returnValue = Plugin::SystemCollectionsQueuePropertyGetCount(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + } +} + +namespace System +{ + namespace Collections + { + BaseQueue::BaseQueue() + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::Queue(nullptr) + { + CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); + System::Int32* handle = (System::Int32*)&Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemCollectionsBaseQueueConstructor(cppHandle, &handle->Value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemCollectionsBaseQueue(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + BaseQueue::BaseQueue(decltype(nullptr)) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::Queue(nullptr) + { + CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); + } + + BaseQueue::BaseQueue(const BaseQueue& other) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::Queue(nullptr) + { + Handle = other.Handle; + CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + BaseQueue::BaseQueue(BaseQueue&& other) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::Queue(nullptr) + { + Handle = other.Handle; + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + BaseQueue::BaseQueue(Plugin::InternalUse, int32_t handle) + : System::ICloneable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::Queue(nullptr) + { + Handle = handle; + CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + BaseQueue::~BaseQueue() + { + Plugin::RemoveSystemCollectionsBaseQueue(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsBaseQueue(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + BaseQueue& BaseQueue::operator=(const BaseQueue& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + BaseQueue& BaseQueue::operator=(decltype(nullptr)) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsBaseQueue(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + BaseQueue& BaseQueue::operator=(BaseQueue&& other) + { + Plugin::RemoveSystemCollectionsBaseQueue(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemCollectionsBaseQueue(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool BaseQueue::operator==(const BaseQueue& other) const + { + return Handle == other.Handle; + } + + bool BaseQueue::operator!=(const BaseQueue& other) const + { + return Handle != other.Handle; + } + + System::Int32 BaseQueue::GetCount() + { + return {}; + } + + DLLEXPORT int32_t SystemCollectionsQueueGetCount(int32_t cppHandle) + { + try + { + return Plugin::GetSystemCollectionsBaseQueue(cppHandle)->GetCount(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + return {}; + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::Collections::Queue"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + return {}; + } + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + IComponentChangeService::IComponentChangeService(decltype(nullptr)) + { + } + + IComponentChangeService::IComponentChangeService(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComponentChangeService::IComponentChangeService(const IComponentChangeService& other) + : IComponentChangeService(Plugin::InternalUse::Only, other.Handle) + { + } + + IComponentChangeService::IComponentChangeService(IComponentChangeService&& other) + : IComponentChangeService(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComponentChangeService::~IComponentChangeService() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComponentChangeService& IComponentChangeService::operator=(const IComponentChangeService& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComponentChangeService& IComponentChangeService::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComponentChangeService& IComponentChangeService::operator=(IComponentChangeService&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComponentChangeService::operator==(const IComponentChangeService& other) const + { + return Handle == other.Handle; + } + + bool IComponentChangeService::operator!=(const IComponentChangeService& other) const + { + return Handle != other.Handle; + } + } + } +} + +namespace System +{ + namespace ComponentModel + { + namespace Design + { + BaseIComponentChangeService::BaseIComponentChangeService() + : System::ComponentModel::Design::IComponentChangeService(nullptr) + { + CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); + System::Int32* handle = (System::Int32*)&Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemComponentModelDesignBaseIComponentChangeServiceConstructor(cppHandle, &handle->Value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemComponentModelDesignBaseIComponentChangeService(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + BaseIComponentChangeService::BaseIComponentChangeService(decltype(nullptr)) + : System::ComponentModel::Design::IComponentChangeService(nullptr) + { + CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); + } + + BaseIComponentChangeService::BaseIComponentChangeService(const BaseIComponentChangeService& other) + : System::ComponentModel::Design::IComponentChangeService(nullptr) + { + Handle = other.Handle; + CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + BaseIComponentChangeService::BaseIComponentChangeService(BaseIComponentChangeService&& other) + : System::ComponentModel::Design::IComponentChangeService(nullptr) + { + Handle = other.Handle; + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; + } + + BaseIComponentChangeService::BaseIComponentChangeService(Plugin::InternalUse, int32_t handle) + : System::ComponentModel::Design::IComponentChangeService(nullptr) + { + Handle = handle; + CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + } + + BaseIComponentChangeService::~BaseIComponentChangeService() + { + Plugin::RemoveSystemComponentModelDesignBaseIComponentChangeService(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + } + + BaseIComponentChangeService& BaseIComponentChangeService::operator=(const BaseIComponentChangeService& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + BaseIComponentChangeService& BaseIComponentChangeService::operator=(decltype(nullptr)) + { + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = 0; + return *this; + } + + BaseIComponentChangeService& BaseIComponentChangeService::operator=(BaseIComponentChangeService&& other) + { + Plugin::RemoveSystemComponentModelDesignBaseIComponentChangeService(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool BaseIComponentChangeService::operator==(const BaseIComponentChangeService& other) const + { + return Handle == other.Handle; + } + + bool BaseIComponentChangeService::operator!=(const BaseIComponentChangeService& other) const + { + return Handle != other.Handle; + } + + void BaseIComponentChangeService::OnComponentChanged(System::Object& component, System::ComponentModel::MemberDescriptor& member, System::Object& oldValue, System::Object& newValue) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceOnComponentChanged(int32_t cppHandle, int32_t componentHandle, int32_t memberHandle, int32_t oldValueHandle, int32_t newValueHandle) + { + try + { + auto component = System::Object(Plugin::InternalUse::Only, componentHandle); + auto member = System::ComponentModel::MemberDescriptor(Plugin::InternalUse::Only, memberHandle); + auto oldValue = System::Object(Plugin::InternalUse::Only, oldValueHandle); + auto newValue = System::Object(Plugin::InternalUse::Only, newValueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->OnComponentChanged(component, member, oldValue, newValue); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::OnComponentChanging(System::Object& component, System::ComponentModel::MemberDescriptor& member) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceOnComponentChanging(int32_t cppHandle, int32_t componentHandle, int32_t memberHandle) + { + try + { + auto component = System::Object(Plugin::InternalUse::Only, componentHandle); + auto member = System::ComponentModel::MemberDescriptor(Plugin::InternalUse::Only, memberHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->OnComponentChanging(component, member); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::AddComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentAdded(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentAdded(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::RemoveComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentAdded(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::AddComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentAdding(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentAdding(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::RemoveComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentAdding(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::AddComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentChanged(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto value = System::ComponentModel::Design::ComponentChangedEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentChanged(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::RemoveComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanged(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto value = System::ComponentModel::Design::ComponentChangedEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentChanged(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::AddComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentChanging(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto value = System::ComponentModel::Design::ComponentChangingEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentChanging(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::RemoveComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanging(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto value = System::ComponentModel::Design::ComponentChangingEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentChanging(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::AddComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentRemoved(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentRemoved(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::RemoveComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoved(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentRemoved(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::AddComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentRemoving(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentRemoving(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::RemoveComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentRemoving(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::AddComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentRename(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto value = System::ComponentModel::Design::ComponentRenameEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentRename(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + + void BaseIComponentChangeService::RemoveComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value) + { + } + + DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename(int32_t cppHandle, int32_t valueHandle) + { + try + { + auto value = System::ComponentModel::Design::ComponentRenameEventHandler(Plugin::InternalUse::Only, valueHandle); + Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentRename(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } + } + } + } +} + +namespace System +{ + namespace IO { - if (Handle) + FileStream::FileStream(decltype(nullptr)) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; } - } - - Screen& Screen::operator=(const Screen& other) - { - if (this->Handle) + + FileStream::FileStream(Plugin::InternalUse, int32_t handle) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) { - Plugin::DereferenceManagedClass(this->Handle); + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - this->Handle = other.Handle; - if (this->Handle) + + FileStream::FileStream(const FileStream& other) + : FileStream(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(this->Handle); } - return *this; - } - - Screen& Screen::operator=(decltype(nullptr)) - { - if (Handle) + + FileStream::FileStream(FileStream&& other) + : FileStream(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + other.Handle = 0; } - return *this; - } - - Screen& Screen::operator=(Screen&& other) - { - if (Handle) + + FileStream::~FileStream() { - Plugin::DereferenceManagedClass(Handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Screen::operator==(const Screen& other) const - { - return Handle == other.Handle; - } - - bool Screen::operator!=(const Screen& other) const - { - return Handle != other.Handle; - } - - System::Array1 Screen::GetResolutions() - { - auto returnValue = Plugin::UnityEngineScreenPropertyGetResolutions(); - if (Plugin::unhandledCsharpException) + + FileStream& FileStream::operator=(const FileStream& other) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - return System::Array1(Plugin::InternalUse::Only, returnValue); - } -} - -namespace UnityEngine -{ - Ray::Ray(decltype(nullptr)) - : System::ValueType(nullptr) - { - } - - Ray::Ray(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(nullptr) - { - Handle = handle; - if (handle) + + FileStream& FileStream::operator=(decltype(nullptr)) { - Plugin::ReferenceManagedUnityEngineRay(Handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - } - - Ray::Ray(const Ray& other) - : Ray(Plugin::InternalUse::Only, other.Handle) - { - } - - Ray::Ray(Ray&& other) - : Ray(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Ray::~Ray() - { - if (Handle) + + FileStream& FileStream::operator=(FileStream&& other) { - Plugin::DereferenceManagedUnityEngineRay(Handle); - Handle = 0; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - } - - Ray& Ray::operator=(const Ray& other) - { - if (this->Handle) + + bool FileStream::operator==(const FileStream& other) const { - Plugin::DereferenceManagedUnityEngineRay(Handle); + return Handle == other.Handle; } - this->Handle = other.Handle; - if (this->Handle) + + bool FileStream::operator!=(const FileStream& other) const { - Plugin::ReferenceManagedUnityEngineRay(Handle); + return Handle != other.Handle; } - return *this; - } - - Ray& Ray::operator=(decltype(nullptr)) - { - if (Handle) + + FileStream::FileStream(System::String& path, System::IO::FileMode mode) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) { - Plugin::DereferenceManagedUnityEngineRay(Handle); - Handle = 0; + auto returnValue = Plugin::SystemIOFileStreamConstructorSystemString_SystemIOFileMode(path.Handle, mode); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } } - return *this; - } - - Ray& Ray::operator=(Ray&& other) - { - if (Handle) + + void FileStream::WriteByte(System::Byte value) { - Plugin::DereferenceManagedUnityEngineRay(Handle); + Plugin::SystemIOFileStreamMethodWriteByteSystemByte(Handle, value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Ray::operator==(const Ray& other) const - { - return Handle == other.Handle; - } - - bool Ray::operator!=(const Ray& other) const - { - return Handle != other.Handle; } - - Ray::Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction) - : System::ValueType(nullptr) +} + +namespace System +{ + namespace IO { - auto returnValue = Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(origin, direction); - if (Plugin::unhandledCsharpException) + BaseFileStream::BaseFileStream(System::String& path, System::IO::FileMode mode) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) + , System::IO::FileStream(nullptr) + { + CppHandle = Plugin::StoreSystemIOBaseFileStream(this); + System::Int32* handle = (System::Int32*)&Handle; + int32_t cppHandle = CppHandle; + Plugin::SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode(cppHandle, &handle->Value, path.Handle, mode); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveSystemIOBaseFileStream(CppHandle); + CppHandle = 0; + } + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + BaseFileStream::BaseFileStream(decltype(nullptr)) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) + , System::IO::FileStream(nullptr) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + CppHandle = Plugin::StoreSystemIOBaseFileStream(this); } - Handle = returnValue; - if (returnValue) + + BaseFileStream::BaseFileStream(const BaseFileStream& other) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) + , System::IO::FileStream(nullptr) { - Plugin::ReferenceManagedUnityEngineRay(Handle); + Handle = other.Handle; + CppHandle = Plugin::StoreSystemIOBaseFileStream(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } - } -} - -namespace System -{ - Object::Object(UnityEngine::Ray& val) - { - int32_t handle = Plugin::BoxRay(val.Handle); - if (Plugin::unhandledCsharpException) + + BaseFileStream::BaseFileStream(BaseFileStream&& other) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) + , System::IO::FileStream(nullptr) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Handle = other.Handle; + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; } - if (handle) + + BaseFileStream::BaseFileStream(Plugin::InternalUse, int32_t handle) + : System::MarshalByRefObject(nullptr) + , System::IDisposable(nullptr) + , System::IO::Stream(nullptr) + , System::IO::FileStream(nullptr) { - Plugin::ReferenceManagedClass(handle); Handle = handle; + CppHandle = Plugin::StoreSystemIOBaseFileStream(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } - } - - Object::operator UnityEngine::Ray() - { - UnityEngine::Ray returnVal(Plugin::InternalUse::Only, Plugin::UnboxRay(Handle)); - if (Plugin::unhandledCsharpException) + + BaseFileStream::~BaseFileStream() { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::RemoveSystemIOBaseFileStream(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemIOBaseFileStream(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } } - return returnVal; - } -} - -namespace UnityEngine -{ - Physics::Physics(decltype(nullptr)) - { - } - - Physics::Physics(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) + + BaseFileStream& BaseFileStream::operator=(const BaseFileStream& other) { - Plugin::ReferenceManagedClass(handle); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - } - - Physics::Physics(const Physics& other) - : Physics(Plugin::InternalUse::Only, other.Handle) - { - } - - Physics::Physics(Physics&& other) - : Physics(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Physics::~Physics() - { - if (Handle) + + BaseFileStream& BaseFileStream::operator=(decltype(nullptr)) { - Plugin::DereferenceManagedClass(Handle); + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemIOBaseFileStream(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } Handle = 0; + return *this; } - } - - Physics& Physics::operator=(const Physics& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + + BaseFileStream& BaseFileStream::operator=(BaseFileStream&& other) { - Plugin::ReferenceManagedClass(this->Handle); + Plugin::RemoveSystemIOBaseFileStream(CppHandle); + CppHandle = 0; + if (Handle) + { + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseSystemIOBaseFileStream(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - return *this; - } - - Physics& Physics::operator=(decltype(nullptr)) - { - if (Handle) + + bool BaseFileStream::operator==(const BaseFileStream& other) const { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + return Handle == other.Handle; } - return *this; - } - - Physics& Physics::operator=(Physics&& other) - { - if (Handle) + + bool BaseFileStream::operator!=(const BaseFileStream& other) const { - Plugin::DereferenceManagedClass(Handle); + return Handle != other.Handle; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Physics::operator==(const Physics& other) const - { - return Handle == other.Handle; - } - - bool Physics::operator!=(const Physics& other) const - { - return Handle != other.Handle; - } - - int32_t Physics::RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1& results) - { - auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1(ray.Handle, results.Handle); - if (Plugin::unhandledCsharpException) + + void BaseFileStream::WriteByte(System::Byte value) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } - return returnValue; - } - - System::Array1 Physics::RaycastAll(UnityEngine::Ray& ray) - { - auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ray.Handle); - if (Plugin::unhandledCsharpException) + + DLLEXPORT void SystemIOFileStreamWriteByte(int32_t cppHandle, uint8_t value) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + try + { + Plugin::GetSystemIOBaseFileStream(cppHandle)->WriteByte(value); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking System::IO::FileStream"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); + } } - return System::Array1(Plugin::InternalUse::Only, returnValue); } } namespace UnityEngine { - Gradient::Gradient(decltype(nullptr)) - { - } - - Gradient::Gradient(Plugin::InternalUse iu, int32_t handle) + namespace Playables { - Handle = handle; - if (handle) + PlayableHandle::PlayableHandle(decltype(nullptr)) { - Plugin::ReferenceManagedClass(handle); } - } - - Gradient::Gradient(const Gradient& other) - : Gradient(Plugin::InternalUse::Only, other.Handle) - { - } - - Gradient::Gradient(Gradient&& other) - : Gradient(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Gradient::~Gradient() - { - if (Handle) + + PlayableHandle::PlayableHandle(Plugin::InternalUse, int32_t handle) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + } } - } - - Gradient& Gradient::operator=(const Gradient& other) - { - if (this->Handle) + + PlayableHandle::PlayableHandle(const PlayableHandle& other) + : PlayableHandle(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(this->Handle); } - this->Handle = other.Handle; - if (this->Handle) + + PlayableHandle::PlayableHandle(PlayableHandle&& other) + : PlayableHandle(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(this->Handle); + other.Handle = 0; } - return *this; - } - - Gradient& Gradient::operator=(decltype(nullptr)) - { - if (Handle) + + PlayableHandle::~PlayableHandle() { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + if (Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + Handle = 0; + } } - return *this; - } - - Gradient& Gradient::operator=(Gradient&& other) - { - if (Handle) + + PlayableHandle& PlayableHandle::operator=(const PlayableHandle& other) { - Plugin::DereferenceManagedClass(Handle); + if (this->Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + } + return *this; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Gradient::operator==(const Gradient& other) const - { - return Handle == other.Handle; - } - - bool Gradient::operator!=(const Gradient& other) const - { - return Handle != other.Handle; - } - - Gradient::Gradient() - { - auto returnValue = Plugin::UnityEngineGradientConstructor(); - if (Plugin::unhandledCsharpException) + + PlayableHandle& PlayableHandle::operator=(decltype(nullptr)) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + if (Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + Handle = 0; + } + return *this; } - Handle = returnValue; - if (returnValue) + + PlayableHandle& PlayableHandle::operator=(PlayableHandle&& other) { - Plugin::ReferenceManagedClass(returnValue); + if (Handle) + { + Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool PlayableHandle::operator==(const PlayableHandle& other) const + { + return Handle == other.Handle; + } + + bool PlayableHandle::operator!=(const PlayableHandle& other) const + { + return Handle != other.Handle; + } + + PlayableHandle::operator System::ValueType() + { + int32_t handle = Plugin::BoxPlayableHandle(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + PlayableHandle::operator System::Object() + { + int32_t handle = Plugin::BoxPlayableHandle(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; } } - - System::Array1 Gradient::GetColorKeys() +} + +namespace System +{ + Object::operator UnityEngine::Playables::PlayableHandle() { - auto returnValue = Plugin::UnityEngineGradientPropertyGetColorKeys(Handle); + UnityEngine::Playables::PlayableHandle returnVal(Plugin::InternalUse::Only, Plugin::UnboxPlayableHandle(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -9714,356 +11311,635 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return System::Array1(Plugin::InternalUse::Only, returnValue); + return returnVal; } - - void Gradient::SetColorKeys(System::Array1& value) +} + +namespace UnityEngine +{ + namespace Experimental { - Plugin::UnityEngineGradientPropertySetColorKeys(Handle, value.Handle); - if (Plugin::unhandledCsharpException) + namespace UIElements { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + ITransform::ITransform(decltype(nullptr)) + { + } + + ITransform::ITransform(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ITransform::ITransform(const ITransform& other) + : ITransform(Plugin::InternalUse::Only, other.Handle) + { + } + + ITransform::ITransform(ITransform&& other) + : ITransform(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ITransform::~ITransform() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ITransform& ITransform::operator=(const ITransform& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ITransform& ITransform::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ITransform& ITransform::operator=(ITransform&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ITransform::operator==(const ITransform& other) const + { + return Handle == other.Handle; + } + + bool ITransform::operator!=(const ITransform& other) const + { + return Handle != other.Handle; + } } } } -namespace System +namespace UnityEngine { - AppDomainSetup::AppDomainSetup(decltype(nullptr)) - : System::IAppDomainSetup(nullptr) - { - } - - AppDomainSetup::AppDomainSetup(Plugin::InternalUse iu, int32_t handle) - : System::IAppDomainSetup(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - AppDomainSetup::AppDomainSetup(const AppDomainSetup& other) - : AppDomainSetup(Plugin::InternalUse::Only, other.Handle) - { - } - - AppDomainSetup::AppDomainSetup(AppDomainSetup&& other) - : AppDomainSetup(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - AppDomainSetup::~AppDomainSetup() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - AppDomainSetup& AppDomainSetup::operator=(const AppDomainSetup& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - AppDomainSetup& AppDomainSetup::operator=(decltype(nullptr)) + namespace Experimental { - if (Handle) + namespace UIElements { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + IUIElementDataWatch::IUIElementDataWatch(decltype(nullptr)) + { + } + + IUIElementDataWatch::IUIElementDataWatch(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IUIElementDataWatch::IUIElementDataWatch(const IUIElementDataWatch& other) + : IUIElementDataWatch(Plugin::InternalUse::Only, other.Handle) + { + } + + IUIElementDataWatch::IUIElementDataWatch(IUIElementDataWatch&& other) + : IUIElementDataWatch(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IUIElementDataWatch::~IUIElementDataWatch() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IUIElementDataWatch& IUIElementDataWatch::operator=(const IUIElementDataWatch& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IUIElementDataWatch& IUIElementDataWatch::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IUIElementDataWatch& IUIElementDataWatch::operator=(IUIElementDataWatch&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IUIElementDataWatch::operator==(const IUIElementDataWatch& other) const + { + return Handle == other.Handle; + } + + bool IUIElementDataWatch::operator!=(const IUIElementDataWatch& other) const + { + return Handle != other.Handle; + } } - return *this; } - - AppDomainSetup& AppDomainSetup::operator=(AppDomainSetup&& other) +} + +namespace UnityEngine +{ + namespace Experimental { - if (Handle) + namespace UIElements { - Plugin::DereferenceManagedClass(Handle); + IVisualElementScheduler::IVisualElementScheduler(decltype(nullptr)) + { + } + + IVisualElementScheduler::IVisualElementScheduler(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IVisualElementScheduler::IVisualElementScheduler(const IVisualElementScheduler& other) + : IVisualElementScheduler(Plugin::InternalUse::Only, other.Handle) + { + } + + IVisualElementScheduler::IVisualElementScheduler(IVisualElementScheduler&& other) + : IVisualElementScheduler(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IVisualElementScheduler::~IVisualElementScheduler() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IVisualElementScheduler& IVisualElementScheduler::operator=(const IVisualElementScheduler& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IVisualElementScheduler& IVisualElementScheduler::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IVisualElementScheduler& IVisualElementScheduler::operator=(IVisualElementScheduler&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IVisualElementScheduler::operator==(const IVisualElementScheduler& other) const + { + return Handle == other.Handle; + } + + bool IVisualElementScheduler::operator!=(const IVisualElementScheduler& other) const + { + return Handle != other.Handle; + } } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool AppDomainSetup::operator==(const AppDomainSetup& other) const - { - return Handle == other.Handle; } - - bool AppDomainSetup::operator!=(const AppDomainSetup& other) const - { - return Handle != other.Handle; - } - - AppDomainSetup::AppDomainSetup() - : System::IAppDomainSetup(nullptr) +} + +namespace System +{ + namespace Collections { - auto returnValue = Plugin::SystemAppDomainSetupConstructor(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) + namespace Generic { - Plugin::ReferenceManagedClass(returnValue); + IEnumerator::IEnumerator(decltype(nullptr)) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) + { + } + + IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerator::~IEnumerator() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerator& IEnumerator::operator=(const IEnumerator& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerator& IEnumerator::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerator& IEnumerator::operator=(IEnumerator&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerator::operator==(const IEnumerator& other) const + { + return Handle == other.Handle; + } + + bool IEnumerator::operator!=(const IEnumerator& other) const + { + return Handle != other.Handle; + } + + UnityEngine::Experimental::UIElements::VisualElement IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Experimental::UIElements::VisualElement(Plugin::InternalUse::Only, returnValue); + } } } - - System::AppDomainInitializer AppDomainSetup::GetAppDomainInitializer() +} + +namespace System +{ + namespace Collections { - auto returnValue = Plugin::SystemAppDomainSetupPropertyGetAppDomainInitializer(Handle); - if (Plugin::unhandledCsharpException) + namespace Generic { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + IEnumerable::IEnumerable(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + { + } + + IEnumerable::IEnumerable(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerable::~IEnumerable() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerable& IEnumerable::operator=(const IEnumerable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerable& IEnumerable::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerable& IEnumerable::operator=(IEnumerable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerable::operator==(const IEnumerable& other) const + { + return Handle == other.Handle; + } + + bool IEnumerable::operator!=(const IEnumerable& other) const + { + return Handle != other.Handle; + } + + System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); + } } - return System::AppDomainInitializer(Plugin::InternalUse::Only, returnValue); } - - void AppDomainSetup::SetAppDomainInitializer(System::AppDomainInitializer& value) +} + +namespace UnityEngine +{ + namespace Experimental { - Plugin::SystemAppDomainSetupPropertySetAppDomainInitializer(Handle, value.Handle); - if (Plugin::unhandledCsharpException) + namespace UIElements { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + VisualElement::VisualElement(decltype(nullptr)) + : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) + , UnityEngine::Experimental::UIElements::CallbackEventHandler(nullptr) + , UnityEngine::Experimental::UIElements::Focusable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , UnityEngine::Experimental::UIElements::IStyle(nullptr) + , UnityEngine::Experimental::UIElements::ITransform(nullptr) + , UnityEngine::Experimental::UIElements::IUIElementDataWatch(nullptr) + , UnityEngine::Experimental::UIElements::IVisualElementScheduler(nullptr) + { + } + + VisualElement::VisualElement(Plugin::InternalUse, int32_t handle) + : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) + , UnityEngine::Experimental::UIElements::CallbackEventHandler(nullptr) + , UnityEngine::Experimental::UIElements::Focusable(nullptr) + , System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , UnityEngine::Experimental::UIElements::IStyle(nullptr) + , UnityEngine::Experimental::UIElements::ITransform(nullptr) + , UnityEngine::Experimental::UIElements::IUIElementDataWatch(nullptr) + , UnityEngine::Experimental::UIElements::IVisualElementScheduler(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + VisualElement::VisualElement(const VisualElement& other) + : VisualElement(Plugin::InternalUse::Only, other.Handle) + { + } + + VisualElement::VisualElement(VisualElement&& other) + : VisualElement(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + VisualElement::~VisualElement() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + VisualElement& VisualElement::operator=(const VisualElement& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + VisualElement& VisualElement::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + VisualElement& VisualElement::operator=(VisualElement&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool VisualElement::operator==(const VisualElement& other) const + { + return Handle == other.Handle; + } + + bool VisualElement::operator!=(const VisualElement& other) const + { + return Handle != other.Handle; + } } } } -namespace UnityEngine +namespace Plugin { - Application::Application(decltype(nullptr)) - { - } - - Application::Application(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Application::Application(const Application& other) - : Application(Plugin::InternalUse::Only, other.Handle) - { - } - - Application::Application(Application&& other) - : Application(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Application::~Application() + UnityEngineExperimentalUIElementsVisualElementIterator::UnityEngineExperimentalUIElementsVisualElementIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } } - Application& Application::operator=(const Application& other) + UnityEngineExperimentalUIElementsVisualElementIterator::UnityEngineExperimentalUIElementsVisualElementIterator(UnityEngine::Experimental::UIElements::VisualElement& enumerable) + : enumerator(enumerable.GetEnumerator()) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; + hasMore = enumerator.MoveNext(); } - Application& Application::operator=(decltype(nullptr)) + UnityEngineExperimentalUIElementsVisualElementIterator::~UnityEngineExperimentalUIElementsVisualElementIterator() { - if (Handle) + if (enumerator != nullptr) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + enumerator.Dispose(); } - return *this; } - Application& Application::operator=(Application&& other) + UnityEngineExperimentalUIElementsVisualElementIterator& UnityEngineExperimentalUIElementsVisualElementIterator::operator++() { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; + hasMore = enumerator.MoveNext(); return *this; } - bool Application::operator==(const Application& other) const - { - return Handle == other.Handle; - } - - bool Application::operator!=(const Application& other) const - { - return Handle != other.Handle; - } - - void Application::AddOnBeforeRender(UnityEngine::Events::UnityAction& del) + bool UnityEngineExperimentalUIElementsVisualElementIterator::operator!=(const UnityEngineExperimentalUIElementsVisualElementIterator& other) { - Plugin::UnityEngineApplicationAddEventOnBeforeRender(del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + return hasMore; } - void Application::RemoveOnBeforeRender(UnityEngine::Events::UnityAction& del) + UnityEngine::Experimental::UIElements::VisualElement UnityEngineExperimentalUIElementsVisualElementIterator::operator*() { - Plugin::UnityEngineApplicationRemoveEventOnBeforeRender(del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + return enumerator.GetCurrent(); } } namespace UnityEngine { - namespace SceneManagement + namespace Experimental { - SceneManager::SceneManager(decltype(nullptr)) - { - } - - SceneManager::SceneManager(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - SceneManager::SceneManager(const SceneManager& other) - : SceneManager(Plugin::InternalUse::Only, other.Handle) - { - } - - SceneManager::SceneManager(SceneManager&& other) - : SceneManager(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - SceneManager::~SceneManager() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - SceneManager& SceneManager::operator=(const SceneManager& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - SceneManager& SceneManager::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - SceneManager& SceneManager::operator=(SceneManager&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool SceneManager::operator==(const SceneManager& other) const - { - return Handle == other.Handle; - } - - bool SceneManager::operator!=(const SceneManager& other) const - { - return Handle != other.Handle; - } - - void SceneManager::AddSceneLoaded(UnityEngine::Events::UnityAction2& del) + namespace UIElements { - Plugin::UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(del.Handle); - if (Plugin::unhandledCsharpException) + Plugin::UnityEngineExperimentalUIElementsVisualElementIterator begin(UnityEngine::Experimental::UIElements::VisualElement& enumerable) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Plugin::UnityEngineExperimentalUIElementsVisualElementIterator(enumerable); } - } - - void SceneManager::RemoveSceneLoaded(UnityEngine::Events::UnityAction2& del) - { - Plugin::UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(del.Handle); - if (Plugin::unhandledCsharpException) + + Plugin::UnityEngineExperimentalUIElementsVisualElementIterator end(UnityEngine::Experimental::UIElements::VisualElement& enumerable) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Plugin::UnityEngineExperimentalUIElementsVisualElementIterator(nullptr); } } } @@ -10071,112 +11947,188 @@ namespace UnityEngine namespace UnityEngine { - namespace SceneManagement + namespace Experimental { - Scene::Scene(decltype(nullptr)) - : System::ValueType(nullptr) - { - } - - Scene::Scene(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedUnityEngineSceneManagementScene(Handle); - } - } - - Scene::Scene(const Scene& other) - : Scene(Plugin::InternalUse::Only, other.Handle) - { - } - - Scene::Scene(Scene&& other) - : Scene(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Scene::~Scene() - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); - Handle = 0; - } - } - - Scene& Scene::operator=(const Scene& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEngineSceneManagementScene(Handle); - } - return *this; - } - - Scene& Scene::operator=(decltype(nullptr)) + namespace UIElements { - if (Handle) + UnityEngine::Experimental::UIElements::VisualElement UQueryExtensions::Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name, System::Array1& classes) { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); - Handle = 0; - } - return *this; - } - - Scene& Scene::operator=(Scene&& other) - { - if (Handle) + auto returnValue = Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1(e.Handle, name.Handle, classes.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Experimental::UIElements::VisualElement(Plugin::InternalUse::Only, returnValue); + } + + UnityEngine::Experimental::UIElements::VisualElement UQueryExtensions::Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name, System::String& className) { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); + auto returnValue = Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString(e.Handle, name.Handle, className.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Experimental::UIElements::VisualElement(Plugin::InternalUse::Only, returnValue); } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Scene::operator==(const Scene& other) const - { - return Handle == other.Handle; - } - - bool Scene::operator!=(const Scene& other) const - { - return Handle != other.Handle; } } } -namespace System +namespace UnityEngine { - Object::Object(UnityEngine::SceneManagement::Scene& val) + namespace XR { - int32_t handle = Plugin::BoxScene(val.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) + namespace WSA { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + namespace Input + { + InteractionSourcePositionAccuracy::InteractionSourcePositionAccuracy(int32_t value) + : Value(value) + { + } + + UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy::operator int32_t() const + { + return Value; + } + + bool UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy::operator==(InteractionSourcePositionAccuracy other) + { + return Value == other.Value; + } + + bool UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy::operator!=(InteractionSourcePositionAccuracy other) + { + return Value != other.Value; + } + + InteractionSourcePositionAccuracy::operator System::Enum() + { + int32_t handle = Plugin::BoxInteractionSourcePositionAccuracy(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Enum(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + InteractionSourcePositionAccuracy::operator System::ValueType() + { + int32_t handle = Plugin::BoxInteractionSourcePositionAccuracy(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + InteractionSourcePositionAccuracy::operator System::Object() + { + int32_t handle = Plugin::BoxInteractionSourcePositionAccuracy(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + InteractionSourcePositionAccuracy::operator System::IFormattable() + { + int32_t handle = Plugin::BoxInteractionSourcePositionAccuracy(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IFormattable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + InteractionSourcePositionAccuracy::operator System::IConvertible() + { + int32_t handle = Plugin::BoxInteractionSourcePositionAccuracy(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IConvertible(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + InteractionSourcePositionAccuracy::operator System::IComparable() + { + int32_t handle = Plugin::BoxInteractionSourcePositionAccuracy(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IComparable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + } } } - - Object::operator UnityEngine::SceneManagement::Scene() +} +const UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy::None(0); +const UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy::Approximate(1); +const UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy::High(2); + +namespace System +{ + Object::operator UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy() { - UnityEngine::SceneManagement::Scene returnVal(Plugin::InternalUse::Only, Plugin::UnboxScene(Handle)); + UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy returnVal(Plugin::UnboxInteractionSourcePositionAccuracy(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -10188,28 +12140,154 @@ namespace System } } -namespace System +namespace UnityEngine { - Object::Object(UnityEngine::SceneManagement::LoadSceneMode val) + namespace XR { - int32_t handle = Plugin::BoxLoadSceneMode(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) + namespace WSA { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + namespace Input + { + InteractionSourceNode::InteractionSourceNode(int32_t value) + : Value(value) + { + } + + UnityEngine::XR::WSA::Input::InteractionSourceNode::operator int32_t() const + { + return Value; + } + + bool UnityEngine::XR::WSA::Input::InteractionSourceNode::operator==(InteractionSourceNode other) + { + return Value == other.Value; + } + + bool UnityEngine::XR::WSA::Input::InteractionSourceNode::operator!=(InteractionSourceNode other) + { + return Value != other.Value; + } + + InteractionSourceNode::operator System::Enum() + { + int32_t handle = Plugin::BoxInteractionSourceNode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Enum(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + InteractionSourceNode::operator System::ValueType() + { + int32_t handle = Plugin::BoxInteractionSourceNode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + InteractionSourceNode::operator System::Object() + { + int32_t handle = Plugin::BoxInteractionSourceNode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + InteractionSourceNode::operator System::IFormattable() + { + int32_t handle = Plugin::BoxInteractionSourceNode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IFormattable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + InteractionSourceNode::operator System::IConvertible() + { + int32_t handle = Plugin::BoxInteractionSourceNode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IConvertible(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + InteractionSourceNode::operator System::IComparable() + { + int32_t handle = Plugin::BoxInteractionSourceNode(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IComparable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + } } } - - Object::operator UnityEngine::SceneManagement::LoadSceneMode() +} +const UnityEngine::XR::WSA::Input::InteractionSourceNode UnityEngine::XR::WSA::Input::InteractionSourceNode::Grip(0); +const UnityEngine::XR::WSA::Input::InteractionSourceNode UnityEngine::XR::WSA::Input::InteractionSourceNode::Pointer(1); + +namespace System +{ + Object::operator UnityEngine::XR::WSA::Input::InteractionSourceNode() { - UnityEngine::SceneManagement::LoadSceneMode returnVal(Plugin::UnboxLoadSceneMode(Handle)); + UnityEngine::XR::WSA::Input::InteractionSourceNode returnVal(Plugin::UnboxInteractionSourceNode(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -10221,100 +12299,384 @@ namespace System } } -namespace System +namespace UnityEngine { - EventArgs::EventArgs(decltype(nullptr)) - { - } - - EventArgs::EventArgs(Plugin::InternalUse iu, int32_t handle) + namespace XR { - Handle = handle; - if (handle) + namespace WSA { - Plugin::ReferenceManagedClass(handle); - } - } - - EventArgs::EventArgs(const EventArgs& other) - : EventArgs(Plugin::InternalUse::Only, other.Handle) - { - } - - EventArgs::EventArgs(EventArgs&& other) - : EventArgs(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } + namespace Input + { + InteractionSourcePose::InteractionSourcePose(decltype(nullptr)) + { + } + + InteractionSourcePose::InteractionSourcePose(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); + } + } + + InteractionSourcePose::InteractionSourcePose(const InteractionSourcePose& other) + : InteractionSourcePose(Plugin::InternalUse::Only, other.Handle) + { + } + + InteractionSourcePose::InteractionSourcePose(InteractionSourcePose&& other) + : InteractionSourcePose(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + InteractionSourcePose::~InteractionSourcePose() + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); + Handle = 0; + } + } + + InteractionSourcePose& InteractionSourcePose::operator=(const InteractionSourcePose& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); + } + return *this; + } + + InteractionSourcePose& InteractionSourcePose::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); + Handle = 0; + } + return *this; + } + + InteractionSourcePose& InteractionSourcePose::operator=(InteractionSourcePose&& other) + { + if (Handle) + { + Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool InteractionSourcePose::operator==(const InteractionSourcePose& other) const + { + return Handle == other.Handle; + } + + bool InteractionSourcePose::operator!=(const InteractionSourcePose& other) const + { + return Handle != other.Handle; + } + + System::Boolean InteractionSourcePose::TryGetRotation(UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node) + { + auto returnValue = Plugin::UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode(Handle, rotation, node); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } - EventArgs::~EventArgs() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + InteractionSourcePose::operator System::ValueType() + { + int32_t handle = Plugin::BoxInteractionSourcePose(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + InteractionSourcePose::operator System::Object() + { + int32_t handle = Plugin::BoxInteractionSourcePose(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + } } } - - EventArgs& EventArgs::operator=(const EventArgs& other) +} + +namespace System +{ + Object::operator UnityEngine::XR::WSA::Input::InteractionSourcePose() { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + UnityEngine::XR::WSA::Input::InteractionSourcePose returnVal(Plugin::InternalUse::Only, Plugin::UnboxInteractionSourcePose(Handle)); + if (Plugin::unhandledCsharpException) { - Plugin::ReferenceManagedClass(this->Handle); + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - return *this; + return returnVal; } - - EventArgs& EventArgs::operator=(decltype(nullptr)) +} + +namespace System +{ + namespace Collections { - if (Handle) + namespace Generic { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + IEnumerator::IEnumerator(decltype(nullptr)) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) + { + } + + IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerator::~IEnumerator() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerator& IEnumerator::operator=(const IEnumerator& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerator& IEnumerator::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerator& IEnumerator::operator=(IEnumerator&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerator::operator==(const IEnumerator& other) const + { + return Handle == other.Handle; + } + + bool IEnumerator::operator!=(const IEnumerator& other) const + { + return Handle != other.Handle; + } + + System::String IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::String(Plugin::InternalUse::Only, returnValue); + } } - return *this; } - - EventArgs& EventArgs::operator=(EventArgs&& other) +} + +namespace System +{ + namespace Collections { - if (Handle) + namespace Generic { - Plugin::DereferenceManagedClass(Handle); + IEnumerator::IEnumerator(decltype(nullptr)) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) + { + } + + IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerator::~IEnumerator() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerator& IEnumerator::operator=(const IEnumerator& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerator& IEnumerator::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerator& IEnumerator::operator=(IEnumerator&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerator::operator==(const IEnumerator& other) const + { + return Handle == other.Handle; + } + + bool IEnumerator::operator!=(const IEnumerator& other) const + { + return Handle != other.Handle; + } + + System::Int32 IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool EventArgs::operator==(const EventArgs& other) const - { - return Handle == other.Handle; - } - - bool EventArgs::operator!=(const EventArgs& other) const - { - return Handle != other.Handle; } } namespace System { - namespace ComponentModel + namespace Collections { - namespace Design + namespace Generic { - ComponentEventArgs::ComponentEventArgs(decltype(nullptr)) - : System::EventArgs(nullptr) + IEnumerator::IEnumerator(decltype(nullptr)) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { } - ComponentEventArgs::ComponentEventArgs(Plugin::InternalUse iu, int32_t handle) - : System::EventArgs(nullptr) + IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { Handle = handle; if (handle) @@ -10323,18 +12685,18 @@ namespace System } } - ComponentEventArgs::ComponentEventArgs(const ComponentEventArgs& other) - : ComponentEventArgs(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { } - ComponentEventArgs::ComponentEventArgs(ComponentEventArgs&& other) - : ComponentEventArgs(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - ComponentEventArgs::~ComponentEventArgs() + IEnumerator::~IEnumerator() { if (Handle) { @@ -10343,7 +12705,7 @@ namespace System } } - ComponentEventArgs& ComponentEventArgs::operator=(const ComponentEventArgs& other) + IEnumerator& IEnumerator::operator=(const IEnumerator& other) { if (this->Handle) { @@ -10357,7 +12719,7 @@ namespace System return *this; } - ComponentEventArgs& ComponentEventArgs::operator=(decltype(nullptr)) + IEnumerator& IEnumerator::operator=(decltype(nullptr)) { if (Handle) { @@ -10367,7 +12729,7 @@ namespace System return *this; } - ComponentEventArgs& ComponentEventArgs::operator=(ComponentEventArgs&& other) + IEnumerator& IEnumerator::operator=(IEnumerator&& other) { if (Handle) { @@ -10378,32 +12740,47 @@ namespace System return *this; } - bool ComponentEventArgs::operator==(const ComponentEventArgs& other) const + bool IEnumerator::operator==(const IEnumerator& other) const { return Handle == other.Handle; } - bool ComponentEventArgs::operator!=(const ComponentEventArgs& other) const + bool IEnumerator::operator!=(const IEnumerator& other) const { return Handle != other.Handle; } + + System::Single IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } } } } namespace System { - namespace ComponentModel + namespace Collections { - namespace Design + namespace Generic { - ComponentChangingEventArgs::ComponentChangingEventArgs(decltype(nullptr)) - : System::EventArgs(nullptr) + IEnumerator::IEnumerator(decltype(nullptr)) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { } - ComponentChangingEventArgs::ComponentChangingEventArgs(Plugin::InternalUse iu, int32_t handle) - : System::EventArgs(nullptr) + IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { Handle = handle; if (handle) @@ -10412,18 +12789,18 @@ namespace System } } - ComponentChangingEventArgs::ComponentChangingEventArgs(const ComponentChangingEventArgs& other) - : ComponentChangingEventArgs(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { } - ComponentChangingEventArgs::ComponentChangingEventArgs(ComponentChangingEventArgs&& other) - : ComponentChangingEventArgs(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - ComponentChangingEventArgs::~ComponentChangingEventArgs() + IEnumerator::~IEnumerator() { if (Handle) { @@ -10432,7 +12809,7 @@ namespace System } } - ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(const ComponentChangingEventArgs& other) + IEnumerator& IEnumerator::operator=(const IEnumerator& other) { if (this->Handle) { @@ -10446,7 +12823,7 @@ namespace System return *this; } - ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(decltype(nullptr)) + IEnumerator& IEnumerator::operator=(decltype(nullptr)) { if (Handle) { @@ -10456,7 +12833,7 @@ namespace System return *this; } - ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(ComponentChangingEventArgs&& other) + IEnumerator& IEnumerator::operator=(IEnumerator&& other) { if (Handle) { @@ -10467,32 +12844,47 @@ namespace System return *this; } - bool ComponentChangingEventArgs::operator==(const ComponentChangingEventArgs& other) const + bool IEnumerator::operator==(const IEnumerator& other) const { return Handle == other.Handle; } - bool ComponentChangingEventArgs::operator!=(const ComponentChangingEventArgs& other) const + bool IEnumerator::operator!=(const IEnumerator& other) const { return Handle != other.Handle; } + + UnityEngine::RaycastHit IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::RaycastHit(Plugin::InternalUse::Only, returnValue); + } } } } namespace System { - namespace ComponentModel + namespace Collections { - namespace Design + namespace Generic { - ComponentChangedEventArgs::ComponentChangedEventArgs(decltype(nullptr)) - : System::EventArgs(nullptr) + IEnumerator::IEnumerator(decltype(nullptr)) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { } - ComponentChangedEventArgs::ComponentChangedEventArgs(Plugin::InternalUse iu, int32_t handle) - : System::EventArgs(nullptr) + IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { Handle = handle; if (handle) @@ -10501,18 +12893,18 @@ namespace System } } - ComponentChangedEventArgs::ComponentChangedEventArgs(const ComponentChangedEventArgs& other) - : ComponentChangedEventArgs(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { } - ComponentChangedEventArgs::ComponentChangedEventArgs(ComponentChangedEventArgs&& other) - : ComponentChangedEventArgs(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - ComponentChangedEventArgs::~ComponentChangedEventArgs() + IEnumerator::~IEnumerator() { if (Handle) { @@ -10521,7 +12913,7 @@ namespace System } } - ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(const ComponentChangedEventArgs& other) + IEnumerator& IEnumerator::operator=(const IEnumerator& other) { if (this->Handle) { @@ -10535,7 +12927,7 @@ namespace System return *this; } - ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(decltype(nullptr)) + IEnumerator& IEnumerator::operator=(decltype(nullptr)) { if (Handle) { @@ -10545,7 +12937,7 @@ namespace System return *this; } - ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(ComponentChangedEventArgs&& other) + IEnumerator& IEnumerator::operator=(IEnumerator&& other) { if (Handle) { @@ -10556,32 +12948,47 @@ namespace System return *this; } - bool ComponentChangedEventArgs::operator==(const ComponentChangedEventArgs& other) const + bool IEnumerator::operator==(const IEnumerator& other) const { return Handle == other.Handle; } - bool ComponentChangedEventArgs::operator!=(const ComponentChangedEventArgs& other) const + bool IEnumerator::operator!=(const IEnumerator& other) const { return Handle != other.Handle; } + + UnityEngine::GradientColorKey IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } } } } namespace System { - namespace ComponentModel + namespace Collections { - namespace Design + namespace Generic { - ComponentRenameEventArgs::ComponentRenameEventArgs(decltype(nullptr)) - : System::EventArgs(nullptr) + IEnumerator::IEnumerator(decltype(nullptr)) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { } - ComponentRenameEventArgs::ComponentRenameEventArgs(Plugin::InternalUse iu, int32_t handle) - : System::EventArgs(nullptr) + IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) + : System::IDisposable(nullptr) + , System::Collections::IEnumerator(nullptr) { Handle = handle; if (handle) @@ -10590,18 +12997,18 @@ namespace System } } - ComponentRenameEventArgs::ComponentRenameEventArgs(const ComponentRenameEventArgs& other) - : ComponentRenameEventArgs(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { } - ComponentRenameEventArgs::ComponentRenameEventArgs(ComponentRenameEventArgs&& other) - : ComponentRenameEventArgs(Plugin::InternalUse::Only, other.Handle) + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - ComponentRenameEventArgs::~ComponentRenameEventArgs() + IEnumerator::~IEnumerator() { if (Handle) { @@ -10610,7 +13017,7 @@ namespace System } } - ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(const ComponentRenameEventArgs& other) + IEnumerator& IEnumerator::operator=(const IEnumerator& other) { if (this->Handle) { @@ -10624,7 +13031,7 @@ namespace System return *this; } - ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(decltype(nullptr)) + IEnumerator& IEnumerator::operator=(decltype(nullptr)) { if (Handle) { @@ -10634,7 +13041,7 @@ namespace System return *this; } - ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(ComponentRenameEventArgs&& other) + IEnumerator& IEnumerator::operator=(IEnumerator&& other) { if (Handle) { @@ -10645,428 +13052,538 @@ namespace System return *this; } - bool ComponentRenameEventArgs::operator==(const ComponentRenameEventArgs& other) const + bool IEnumerator::operator==(const IEnumerator& other) const { return Handle == other.Handle; } - bool ComponentRenameEventArgs::operator!=(const ComponentRenameEventArgs& other) const + bool IEnumerator::operator!=(const IEnumerator& other) const { return Handle != other.Handle; } + + UnityEngine::Resolution IEnumerator::GetCurrent() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Resolution(Plugin::InternalUse::Only, returnValue); + } } } } namespace System { - namespace ComponentModel + namespace Collections { - MemberDescriptor::MemberDescriptor(decltype(nullptr)) - { - } - - MemberDescriptor::MemberDescriptor(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - MemberDescriptor::MemberDescriptor(const MemberDescriptor& other) - : MemberDescriptor(Plugin::InternalUse::Only, other.Handle) - { - } - - MemberDescriptor::MemberDescriptor(MemberDescriptor&& other) - : MemberDescriptor(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - MemberDescriptor::~MemberDescriptor() + namespace Generic { - if (Handle) + IEnumerable::IEnumerable(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; } - } - - MemberDescriptor& MemberDescriptor::operator=(const MemberDescriptor& other) - { - if (this->Handle) + + IEnumerable::IEnumerable(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) { - Plugin::DereferenceManagedClass(this->Handle); + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - this->Handle = other.Handle; - if (this->Handle) + + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(this->Handle); } - return *this; - } - - MemberDescriptor& MemberDescriptor::operator=(decltype(nullptr)) - { - if (Handle) + + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + other.Handle = 0; } - return *this; - } - - MemberDescriptor& MemberDescriptor::operator=(MemberDescriptor&& other) - { - if (Handle) + + IEnumerable::~IEnumerable() { - Plugin::DereferenceManagedClass(Handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerable& IEnumerable::operator=(const IEnumerable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerable& IEnumerable::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerable& IEnumerable::operator=(IEnumerable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerable::operator==(const IEnumerable& other) const + { + return Handle == other.Handle; + } + + bool IEnumerable::operator!=(const IEnumerable& other) const + { + return Handle != other.Handle; + } + + System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool MemberDescriptor::operator==(const MemberDescriptor& other) const - { - return Handle == other.Handle; - } - - bool MemberDescriptor::operator!=(const MemberDescriptor& other) const - { - return Handle != other.Handle; - } - } -} - -namespace System -{ - Object::Object(UnityEngine::PrimitiveType val) - { - int32_t handle = Plugin::BoxPrimitiveType(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator UnityEngine::PrimitiveType() - { - UnityEngine::PrimitiveType returnVal(Plugin::UnboxPrimitiveType(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - Time::Time(decltype(nullptr)) - { - } - - Time::Time(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Time::Time(const Time& other) - : Time(Plugin::InternalUse::Only, other.Handle) - { - } - - Time::Time(Time&& other) - : Time(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Time::~Time() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Time& Time::operator=(const Time& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Time& Time::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Time& Time::operator=(Time&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Time::operator==(const Time& other) const - { - return Handle == other.Handle; - } - - bool Time::operator!=(const Time& other) const - { - return Handle != other.Handle; - } - - float Time::GetDeltaTime() - { - auto returnValue = Plugin::UnityEngineTimePropertyGetDeltaTime(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; } - return returnValue; } } namespace System { - Object::Object(System::IO::FileMode val) - { - int32_t handle = Plugin::BoxFileMode(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator System::IO::FileMode() + namespace Collections { - System::IO::FileMode returnVal(Plugin::UnboxFileMode(Handle)); - if (Plugin::unhandledCsharpException) + namespace Generic { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + IEnumerable::IEnumerable(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + { + } + + IEnumerable::IEnumerable(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerable::~IEnumerable() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerable& IEnumerable::operator=(const IEnumerable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerable& IEnumerable::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerable& IEnumerable::operator=(IEnumerable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerable::operator==(const IEnumerable& other) const + { + return Handle == other.Handle; + } + + bool IEnumerable::operator!=(const IEnumerable& other) const + { + return Handle != other.Handle; + } + + System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); + } } - return returnVal; } } namespace System { - MarshalByRefObject::MarshalByRefObject(decltype(nullptr)) - { - } - - MarshalByRefObject::MarshalByRefObject(Plugin::InternalUse iu, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - MarshalByRefObject::MarshalByRefObject(const MarshalByRefObject& other) - : MarshalByRefObject(Plugin::InternalUse::Only, other.Handle) - { - } - - MarshalByRefObject::MarshalByRefObject(MarshalByRefObject&& other) - : MarshalByRefObject(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - MarshalByRefObject::~MarshalByRefObject() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - MarshalByRefObject& MarshalByRefObject::operator=(const MarshalByRefObject& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - MarshalByRefObject& MarshalByRefObject::operator=(decltype(nullptr)) + namespace Collections { - if (Handle) + namespace Generic { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + IEnumerable::IEnumerable(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + { + } + + IEnumerable::IEnumerable(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerable::~IEnumerable() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerable& IEnumerable::operator=(const IEnumerable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerable& IEnumerable::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerable& IEnumerable::operator=(IEnumerable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerable::operator==(const IEnumerable& other) const + { + return Handle == other.Handle; + } + + bool IEnumerable::operator!=(const IEnumerable& other) const + { + return Handle != other.Handle; + } + + System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); + } } - return *this; } - - MarshalByRefObject& MarshalByRefObject::operator=(MarshalByRefObject&& other) +} + +namespace System +{ + namespace Collections { - if (Handle) + namespace Generic { - Plugin::DereferenceManagedClass(Handle); + IEnumerable::IEnumerable(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + { + } + + IEnumerable::IEnumerable(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + } + + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerable::~IEnumerable() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerable& IEnumerable::operator=(const IEnumerable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerable& IEnumerable::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerable& IEnumerable::operator=(IEnumerable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerable::operator==(const IEnumerable& other) const + { + return Handle == other.Handle; + } + + bool IEnumerable::operator!=(const IEnumerable& other) const + { + return Handle != other.Handle; + } + + System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); + } } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool MarshalByRefObject::operator==(const MarshalByRefObject& other) const - { - return Handle == other.Handle; - } - - bool MarshalByRefObject::operator!=(const MarshalByRefObject& other) const - { - return Handle != other.Handle; } } namespace System { - namespace IO + namespace Collections { - Stream::Stream(decltype(nullptr)) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - { - } - - Stream::Stream(Plugin::InternalUse iu, int32_t handle) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) + namespace Generic { - Handle = handle; - if (handle) + IEnumerable::IEnumerable(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) { - Plugin::ReferenceManagedClass(handle); } - } - - Stream::Stream(const Stream& other) - : Stream(Plugin::InternalUse::Only, other.Handle) - { - } - - Stream::Stream(Stream&& other) - : Stream(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Stream::~Stream() - { - if (Handle) + + IEnumerable::IEnumerable(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - } - - Stream& Stream::operator=(const Stream& other) - { - if (this->Handle) + + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(this->Handle); } - this->Handle = other.Handle; - if (this->Handle) + + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEnumerable::~IEnumerable() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEnumerable& IEnumerable::operator=(const IEnumerable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEnumerable& IEnumerable::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEnumerable& IEnumerable::operator=(IEnumerable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEnumerable::operator==(const IEnumerable& other) const { - Plugin::ReferenceManagedClass(this->Handle); + return Handle == other.Handle; } - return *this; - } - - Stream& Stream::operator=(decltype(nullptr)) - { - if (Handle) + + bool IEnumerable::operator!=(const IEnumerable& other) const { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + return Handle != other.Handle; } - return *this; - } - - Stream& Stream::operator=(Stream&& other) - { - if (Handle) + + System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() { - Plugin::DereferenceManagedClass(Handle); + auto returnValue = Plugin::SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Stream::operator==(const Stream& other) const - { - return Handle == other.Handle; - } - - bool Stream::operator!=(const Stream& other) const - { - return Handle != other.Handle; } } } @@ -11077,11 +13594,13 @@ namespace System { namespace Generic { - IComparer::IComparer(decltype(nullptr)) + IEnumerable::IEnumerable(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) { } - IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) + IEnumerable::IEnumerable(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) { Handle = handle; if (handle) @@ -11090,18 +13609,18 @@ namespace System } } - IComparer::IComparer(const IComparer& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) + IEnumerable::IEnumerable(const IEnumerable& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { } - IComparer::IComparer(IComparer&& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) + IEnumerable::IEnumerable(IEnumerable&& other) + : IEnumerable(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IComparer::~IComparer() + IEnumerable::~IEnumerable() { if (Handle) { @@ -11110,7 +13629,7 @@ namespace System } } - IComparer& IComparer::operator=(const IComparer& other) + IEnumerable& IEnumerable::operator=(const IEnumerable& other) { if (this->Handle) { @@ -11124,7 +13643,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(decltype(nullptr)) + IEnumerable& IEnumerable::operator=(decltype(nullptr)) { if (Handle) { @@ -11134,7 +13653,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(IComparer&& other) + IEnumerable& IEnumerable::operator=(IEnumerable&& other) { if (Handle) { @@ -11145,15 +13664,28 @@ namespace System return *this; } - bool IComparer::operator==(const IComparer& other) const + bool IEnumerable::operator==(const IEnumerable& other) const { return Handle == other.Handle; } - bool IComparer::operator!=(const IComparer& other) const + bool IEnumerable::operator!=(const IEnumerable& other) const { return Handle != other.Handle; } + + System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() + { + auto returnValue = Plugin::SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); + } } } } @@ -11164,11 +13696,15 @@ namespace System { namespace Generic { - IComparer::IComparer(decltype(nullptr)) + ICollection::ICollection(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { } - IComparer::IComparer(Plugin::InternalUse iu, int32_t handle) + ICollection::ICollection(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { Handle = handle; if (handle) @@ -11177,18 +13713,18 @@ namespace System } } - IComparer::IComparer(const IComparer& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { } - IComparer::IComparer(IComparer&& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IComparer::~IComparer() + ICollection::~ICollection() { if (Handle) { @@ -11197,7 +13733,7 @@ namespace System } } - IComparer& IComparer::operator=(const IComparer& other) + ICollection& ICollection::operator=(const ICollection& other) { if (this->Handle) { @@ -11211,7 +13747,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(decltype(nullptr)) + ICollection& ICollection::operator=(decltype(nullptr)) { if (Handle) { @@ -11221,7 +13757,7 @@ namespace System return *this; } - IComparer& IComparer::operator=(IComparer&& other) + ICollection& ICollection::operator=(ICollection&& other) { if (Handle) { @@ -11232,12 +13768,12 @@ namespace System return *this; } - bool IComparer::operator==(const IComparer& other) const + bool ICollection::operator==(const ICollection& other) const { return Handle == other.Handle; } - bool IComparer::operator!=(const IComparer& other) const + bool ICollection::operator!=(const ICollection& other) const { return Handle != other.Handle; } @@ -11245,104 +13781,108 @@ namespace System } } +namespace Plugin +{ + SystemCollectionsGenericICollectionSystemStringIterator::SystemCollectionsGenericICollectionSystemStringIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericICollectionSystemStringIterator::SystemCollectionsGenericICollectionSystemStringIterator(System::Collections::Generic::ICollection& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericICollectionSystemStringIterator::~SystemCollectionsGenericICollectionSystemStringIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericICollectionSystemStringIterator& SystemCollectionsGenericICollectionSystemStringIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericICollectionSystemStringIterator::operator!=(const SystemCollectionsGenericICollectionSystemStringIterator& other) + { + return hasMore; + } + + System::String SystemCollectionsGenericICollectionSystemStringIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + namespace System { namespace Collections { namespace Generic { - BaseIComparer::BaseIComparer() - : System::Collections::Generic::IComparer(nullptr) + Plugin::SystemCollectionsGenericICollectionSystemStringIterator begin(System::Collections::Generic::ICollection& enumerable) { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); - int32_t* handle = &Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsGenericBaseIComparerSystemInt32Constructor(cppHandle, handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + return Plugin::SystemCollectionsGenericICollectionSystemStringIterator(enumerable); } - BaseIComparer::BaseIComparer(decltype(nullptr)) - : System::Collections::Generic::IComparer(nullptr) + Plugin::SystemCollectionsGenericICollectionSystemStringIterator end(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionSystemStringIterator(nullptr); + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + ICollection::ICollection(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); } - BaseIComparer::BaseIComparer(const BaseIComparer& other) - : System::Collections::Generic::IComparer(nullptr) + ICollection::ICollection(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); - if (Handle) + Handle = handle; + if (handle) { - Plugin::ReferenceManagedClass(Handle); + Plugin::ReferenceManagedClass(handle); } } - BaseIComparer::BaseIComparer(BaseIComparer&& other) - : System::Collections::Generic::IComparer(nullptr) + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { - Handle = other.Handle; - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; } - BaseIComparer::BaseIComparer(Plugin::InternalUse iu, int32_t handle) - : System::Collections::Generic::IComparer(nullptr) + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { - Handle = handle; - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } + other.Handle = 0; } - BaseIComparer::~BaseIComparer() + ICollection::~ICollection() { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; + Plugin::DereferenceManagedClass(Handle); Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } } - BaseIComparer& BaseIComparer::operator=(const BaseIComparer& other) + ICollection& ICollection::operator=(const ICollection& other) { if (this->Handle) { @@ -11356,86 +13896,93 @@ namespace System return *this; } - BaseIComparer& BaseIComparer::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - Handle = 0; - return *this; - } - - BaseIComparer& BaseIComparer::operator=(BaseIComparer&& other) + ICollection& ICollection::operator=(decltype(nullptr)) { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ICollection& ICollection::operator=(ICollection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool BaseIComparer::operator==(const BaseIComparer& other) const + bool ICollection::operator==(const ICollection& other) const { return Handle == other.Handle; } - bool BaseIComparer::operator!=(const BaseIComparer& other) const + bool ICollection::operator!=(const ICollection& other) const { return Handle != other.Handle; } - - int32_t BaseIComparer::Compare(int32_t x, int32_t y) + } + } +} + +namespace Plugin +{ + SystemCollectionsGenericICollectionSystemInt32Iterator::SystemCollectionsGenericICollectionSystemInt32Iterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericICollectionSystemInt32Iterator::SystemCollectionsGenericICollectionSystemInt32Iterator(System::Collections::Generic::ICollection& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericICollectionSystemInt32Iterator::~SystemCollectionsGenericICollectionSystemInt32Iterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericICollectionSystemInt32Iterator& SystemCollectionsGenericICollectionSystemInt32Iterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericICollectionSystemInt32Iterator::operator!=(const SystemCollectionsGenericICollectionSystemInt32Iterator& other) + { + return hasMore; + } + + System::Int32 SystemCollectionsGenericICollectionSystemInt32Iterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator begin(System::Collections::Generic::ICollection& enumerable) { - return {}; + return Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator(enumerable); } - DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemInt32Compare(int32_t cppHandle, int32_t x, int32_t y) + Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator end(System::Collections::Generic::ICollection& enumerable) { - try - { - return Plugin::GetSystemCollectionsGenericBaseIComparerSystemInt32(cppHandle)->Compare(x, y); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } + return Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator(nullptr); } } } @@ -11447,98 +13994,44 @@ namespace System { namespace Generic { - BaseIComparer::BaseIComparer() - : System::Collections::Generic::IComparer(nullptr) - { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); - int32_t* handle = &Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsGenericBaseIComparerSystemStringConstructor(cppHandle, handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - BaseIComparer::BaseIComparer(decltype(nullptr)) - : System::Collections::Generic::IComparer(nullptr) + ICollection::ICollection(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); } - BaseIComparer::BaseIComparer(const BaseIComparer& other) - : System::Collections::Generic::IComparer(nullptr) + ICollection::ICollection(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); - if (Handle) + Handle = handle; + if (handle) { - Plugin::ReferenceManagedClass(Handle); + Plugin::ReferenceManagedClass(handle); } } - BaseIComparer::BaseIComparer(BaseIComparer&& other) - : System::Collections::Generic::IComparer(nullptr) + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { - Handle = other.Handle; - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; } - BaseIComparer::BaseIComparer(Plugin::InternalUse iu, int32_t handle) - : System::Collections::Generic::IComparer(nullptr) + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { - Handle = handle; - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } + other.Handle = 0; } - BaseIComparer::~BaseIComparer() + ICollection::~ICollection() { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; + Plugin::DereferenceManagedClass(Handle); Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } } - BaseIComparer& BaseIComparer::operator=(const BaseIComparer& other) + ICollection& ICollection::operator=(const ICollection& other) { if (this->Handle) { @@ -11552,443 +14045,243 @@ namespace System return *this; } - BaseIComparer& BaseIComparer::operator=(decltype(nullptr)) + ICollection& ICollection::operator=(decltype(nullptr)) { if (Handle) { - int32_t handle = Handle; + Plugin::DereferenceManagedClass(Handle); Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } - Handle = 0; return *this; } - BaseIComparer& BaseIComparer::operator=(BaseIComparer&& other) + ICollection& ICollection::operator=(ICollection&& other) { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - - bool BaseIComparer::operator==(const BaseIComparer& other) const - { - return Handle == other.Handle; - } - - bool BaseIComparer::operator!=(const BaseIComparer& other) const - { - return Handle != other.Handle; - } - - int32_t BaseIComparer::Compare(System::String& x, System::String& y) - { - return {}; - } - - DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemStringCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) - { - try - { - auto x = System::String(Plugin::InternalUse::Only, xHandle); - auto y = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemCollectionsGenericBaseIComparerSystemString(cppHandle)->Compare(x, y); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } - } - } -} - -namespace System -{ - StringComparer::StringComparer(decltype(nullptr)) - : System::Collections::IComparer(nullptr) - , System::Collections::Generic::IComparer(nullptr) - , System::Collections::IEqualityComparer(nullptr) - , System::Collections::Generic::IEqualityComparer(nullptr) - { - } - - StringComparer::StringComparer(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IComparer(nullptr) - , System::Collections::Generic::IComparer(nullptr) - , System::Collections::IEqualityComparer(nullptr) - , System::Collections::Generic::IEqualityComparer(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - StringComparer::StringComparer(const StringComparer& other) - : StringComparer(Plugin::InternalUse::Only, other.Handle) - { - } - - StringComparer::StringComparer(StringComparer&& other) - : StringComparer(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; + + bool ICollection::operator==(const ICollection& other) const + { + return Handle == other.Handle; + } + + bool ICollection::operator!=(const ICollection& other) const + { + return Handle != other.Handle; + } + } } - - StringComparer::~StringComparer() +} + +namespace Plugin +{ + SystemCollectionsGenericICollectionSystemSingleIterator::SystemCollectionsGenericICollectionSystemSingleIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } } - StringComparer& StringComparer::operator=(const StringComparer& other) + SystemCollectionsGenericICollectionSystemSingleIterator::SystemCollectionsGenericICollectionSystemSingleIterator(System::Collections::Generic::ICollection& enumerable) + : enumerator(enumerable.GetEnumerator()) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; + hasMore = enumerator.MoveNext(); } - StringComparer& StringComparer::operator=(decltype(nullptr)) + SystemCollectionsGenericICollectionSystemSingleIterator::~SystemCollectionsGenericICollectionSystemSingleIterator() { - if (Handle) + if (enumerator != nullptr) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + enumerator.Dispose(); } - return *this; } - StringComparer& StringComparer::operator=(StringComparer&& other) + SystemCollectionsGenericICollectionSystemSingleIterator& SystemCollectionsGenericICollectionSystemSingleIterator::operator++() { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; + hasMore = enumerator.MoveNext(); return *this; } - bool StringComparer::operator==(const StringComparer& other) const + bool SystemCollectionsGenericICollectionSystemSingleIterator::operator!=(const SystemCollectionsGenericICollectionSystemSingleIterator& other) { - return Handle == other.Handle; + return hasMore; } - bool StringComparer::operator!=(const StringComparer& other) const + System::Single SystemCollectionsGenericICollectionSystemSingleIterator::operator*() { - return Handle != other.Handle; + return enumerator.GetCurrent(); } } namespace System { - BaseStringComparer::BaseStringComparer() - : System::Collections::IComparer(nullptr) - , System::Collections::Generic::IComparer(nullptr) - , System::Collections::IEqualityComparer(nullptr) - , System::Collections::Generic::IEqualityComparer(nullptr) - , System::StringComparer(nullptr) - { - CppHandle = Plugin::StoreSystemBaseStringComparer(this); - int32_t* handle = &Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemBaseStringComparerConstructor(cppHandle, handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemBaseStringComparer(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - BaseStringComparer::BaseStringComparer(decltype(nullptr)) - : System::Collections::IComparer(nullptr) - , System::Collections::Generic::IComparer(nullptr) - , System::Collections::IEqualityComparer(nullptr) - , System::Collections::Generic::IEqualityComparer(nullptr) - , System::StringComparer(nullptr) - { - CppHandle = Plugin::StoreSystemBaseStringComparer(this); - } - - BaseStringComparer::BaseStringComparer(const BaseStringComparer& other) - : System::Collections::IComparer(nullptr) - , System::Collections::Generic::IComparer(nullptr) - , System::Collections::IEqualityComparer(nullptr) - , System::Collections::Generic::IEqualityComparer(nullptr) - , System::StringComparer(nullptr) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemBaseStringComparer(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - BaseStringComparer::BaseStringComparer(BaseStringComparer&& other) - : System::Collections::IComparer(nullptr) - , System::Collections::Generic::IComparer(nullptr) - , System::Collections::IEqualityComparer(nullptr) - , System::Collections::Generic::IEqualityComparer(nullptr) - , System::StringComparer(nullptr) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - BaseStringComparer::BaseStringComparer(Plugin::InternalUse iu, int32_t handle) - : System::Collections::IComparer(nullptr) - , System::Collections::Generic::IComparer(nullptr) - , System::Collections::IEqualityComparer(nullptr) - , System::Collections::Generic::IEqualityComparer(nullptr) - , System::StringComparer(nullptr) + namespace Collections { - Handle = handle; - CppHandle = Plugin::StoreSystemBaseStringComparer(this); - if (Handle) + namespace Generic { - Plugin::ReferenceManagedClass(Handle); + Plugin::SystemCollectionsGenericICollectionSystemSingleIterator begin(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionSystemSingleIterator(enumerable); + } + + Plugin::SystemCollectionsGenericICollectionSystemSingleIterator end(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionSystemSingleIterator(nullptr); + } } } - - BaseStringComparer::~BaseStringComparer() +} + +namespace System +{ + namespace Collections { - Plugin::RemoveSystemBaseStringComparer(CppHandle); - CppHandle = 0; - if (Handle) + namespace Generic { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + ICollection::ICollection(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { - Plugin::ReleaseSystemBaseStringComparer(handle); - if (Plugin::unhandledCsharpException) + } + + ICollection::ICollection(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + { + Handle = handle; + if (handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(handle); } } - } - } - - BaseStringComparer& BaseStringComparer::operator=(const BaseStringComparer& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - BaseStringComparer& BaseStringComparer::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReleaseSystemBaseStringComparer(handle); - if (Plugin::unhandledCsharpException) + } + + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ICollection::~ICollection() + { + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } - } - Handle = 0; - return *this; - } - - BaseStringComparer& BaseStringComparer::operator=(BaseStringComparer&& other) - { - Plugin::RemoveSystemBaseStringComparer(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + + ICollection& ICollection::operator=(const ICollection& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ICollection& ICollection::operator=(decltype(nullptr)) { - Plugin::ReleaseSystemBaseStringComparer(handle); - if (Plugin::unhandledCsharpException) + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ICollection& ICollection::operator=(ICollection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ICollection::operator==(const ICollection& other) const + { + return Handle == other.Handle; + } + + bool ICollection::operator!=(const ICollection& other) const + { + return Handle != other.Handle; } } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool BaseStringComparer::operator==(const BaseStringComparer& other) const - { - return Handle == other.Handle; } - - bool BaseStringComparer::operator!=(const BaseStringComparer& other) const +} + +namespace Plugin +{ + SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) { - return Handle != other.Handle; } - int32_t BaseStringComparer::Compare(System::String& x, System::String& y) + SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(System::Collections::Generic::ICollection& enumerable) + : enumerator(enumerable.GetEnumerator()) { - return {}; + hasMore = enumerator.MoveNext(); } - DLLEXPORT int32_t SystemStringComparerCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::~SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator() { - try - { - auto x = System::String(Plugin::InternalUse::Only, xHandle); - auto y = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemBaseStringComparer(cppHandle)->Compare(x, y); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) + if (enumerator != nullptr) { - System::String msg = "Unhandled exception invoking System::StringComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + enumerator.Dispose(); } } - System::Boolean BaseStringComparer::Equals(System::String& x, System::String& y) + SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::operator++() { - return {}; + hasMore = enumerator.MoveNext(); + return *this; } - DLLEXPORT int32_t SystemStringComparerEquals(int32_t cppHandle, int32_t xHandle, int32_t yHandle) + bool SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::operator!=(const SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& other) { - try - { - auto x = System::String(Plugin::InternalUse::Only, xHandle); - auto y = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemBaseStringComparer(cppHandle)->Equals(x, y); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::StringComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } + return hasMore; } - int32_t BaseStringComparer::GetHashCode(System::String& obj) + UnityEngine::RaycastHit SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::operator*() { - return {}; + return enumerator.GetCurrent(); } - - DLLEXPORT int32_t SystemStringComparerGetHashCode(int32_t cppHandle, int32_t objHandle) +} + +namespace System +{ + namespace Collections { - try - { - auto obj = System::String(Plugin::InternalUse::Only, objHandle); - return Plugin::GetSystemBaseStringComparer(cppHandle)->GetHashCode(obj); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) + namespace Generic { - System::String msg = "Unhandled exception invoking System::StringComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator begin(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(enumerable); + } + + Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator end(System::Collections::Generic::ICollection& enumerable) + { + return Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(nullptr); + } } } } @@ -11997,308 +14290,295 @@ namespace System { namespace Collections { - Queue::Queue(decltype(nullptr)) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - { - } - - Queue::Queue(Plugin::InternalUse iu, int32_t handle) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) + namespace Generic { - Handle = handle; - if (handle) + ICollection::ICollection(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { - Plugin::ReferenceManagedClass(handle); } - } - - Queue::Queue(const Queue& other) - : Queue(Plugin::InternalUse::Only, other.Handle) - { - } - - Queue::Queue(Queue&& other) - : Queue(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Queue::~Queue() - { - if (Handle) + + ICollection::ICollection(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - } - - Queue& Queue::operator=(const Queue& other) - { - if (this->Handle) + + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(this->Handle); } - this->Handle = other.Handle; - if (this->Handle) + + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(this->Handle); + other.Handle = 0; } - return *this; - } - - Queue& Queue::operator=(decltype(nullptr)) - { - if (Handle) + + ICollection::~ICollection() { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - return *this; - } - - Queue& Queue::operator=(Queue&& other) - { - if (Handle) + + ICollection& ICollection::operator=(const ICollection& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ICollection& ICollection::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ICollection& ICollection::operator=(ICollection&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ICollection::operator==(const ICollection& other) const + { + return Handle == other.Handle; + } + + bool ICollection::operator!=(const ICollection& other) const { - Plugin::DereferenceManagedClass(Handle); + return Handle != other.Handle; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Queue::operator==(const Queue& other) const - { - return Handle == other.Handle; - } - - bool Queue::operator!=(const Queue& other) const - { - return Handle != other.Handle; } - - int32_t Queue::GetCount() + } +} + +namespace Plugin +{ + SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(System::Collections::Generic::ICollection& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::~SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator() + { + if (enumerator != nullptr) { - auto returnValue = Plugin::SystemCollectionsQueuePropertyGetCount(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; + enumerator.Dispose(); } } + + SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::operator!=(const SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& other) + { + return hasMore; + } + + UnityEngine::GradientColorKey SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::operator*() + { + return enumerator.GetCurrent(); + } } namespace System { namespace Collections { - BaseQueue::BaseQueue() - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::Queue(nullptr) + namespace Generic { - CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); - int32_t* handle = &Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsBaseQueueConstructor(cppHandle, handle); - if (Plugin::unhandledCsharpException) + Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::ICollection& enumerable) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(enumerable); } - if (Handle) + + Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator end(System::Collections::Generic::ICollection& enumerable) { - Plugin::ReferenceManagedClass(Handle); + return Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(nullptr); } - else + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + ICollection::ICollection(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { - Plugin::RemoveSystemCollectionsBaseQueue(CppHandle); - CppHandle = 0; } - if (Plugin::unhandledCsharpException) + + ICollection::ICollection(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - } - - BaseQueue::BaseQueue(decltype(nullptr)) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::Queue(nullptr) - { - CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); - } - - BaseQueue::BaseQueue(const BaseQueue& other) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::Queue(nullptr) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); - if (Handle) + + ICollection::ICollection(const ICollection& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(Handle); } - } - - BaseQueue::BaseQueue(BaseQueue&& other) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::Queue(nullptr) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - BaseQueue::BaseQueue(Plugin::InternalUse iu, int32_t handle) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::Queue(nullptr) - { - Handle = handle; - CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); - if (Handle) + + ICollection::ICollection(ICollection&& other) + : ICollection(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(Handle); + other.Handle = 0; } - } - - BaseQueue::~BaseQueue() - { - Plugin::RemoveSystemCollectionsBaseQueue(CppHandle); - CppHandle = 0; - if (Handle) + + ICollection::~ICollection() { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + if (Handle) { - Plugin::ReleaseSystemCollectionsBaseQueue(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } - } - - BaseQueue& BaseQueue::operator=(const BaseQueue& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) + + ICollection& ICollection::operator=(const ICollection& other) { - Plugin::ReferenceManagedClass(this->Handle); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - return *this; - } - - BaseQueue& BaseQueue::operator=(decltype(nullptr)) - { - if (Handle) + + ICollection& ICollection::operator=(decltype(nullptr)) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + if (Handle) { - Plugin::ReleaseSystemCollectionsBaseQueue(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } + return *this; } - Handle = 0; - return *this; - } - - BaseQueue& BaseQueue::operator=(BaseQueue&& other) - { - Plugin::RemoveSystemCollectionsBaseQueue(CppHandle); - CppHandle = 0; - if (Handle) + + ICollection& ICollection::operator=(ICollection&& other) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + if (Handle) { - Plugin::ReleaseSystemCollectionsBaseQueue(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ICollection::operator==(const ICollection& other) const + { + return Handle == other.Handle; + } + + bool ICollection::operator!=(const ICollection& other) const + { + return Handle != other.Handle; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool BaseQueue::operator==(const BaseQueue& other) const - { - return Handle == other.Handle; - } - - bool BaseQueue::operator!=(const BaseQueue& other) const - { - return Handle != other.Handle; } - - int32_t BaseQueue::GetCount() + } +} + +namespace Plugin +{ + SystemCollectionsGenericICollectionUnityEngineResolutionIterator::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericICollectionUnityEngineResolutionIterator::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(System::Collections::Generic::ICollection& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericICollectionUnityEngineResolutionIterator::~SystemCollectionsGenericICollectionUnityEngineResolutionIterator() + { + if (enumerator != nullptr) { - return {}; + enumerator.Dispose(); } - - DLLEXPORT int32_t SystemCollectionsQueueGetCount(int32_t cppHandle) + } + + SystemCollectionsGenericICollectionUnityEngineResolutionIterator& SystemCollectionsGenericICollectionUnityEngineResolutionIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericICollectionUnityEngineResolutionIterator::operator!=(const SystemCollectionsGenericICollectionUnityEngineResolutionIterator& other) + { + return hasMore; + } + + UnityEngine::Resolution SystemCollectionsGenericICollectionUnityEngineResolutionIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic { - try - { - return Plugin::GetSystemCollectionsBaseQueue(cppHandle)->GetCount(); - } - catch (System::Exception ex) + Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator begin(System::Collections::Generic::ICollection& enumerable) { - Plugin::SetException(ex.Handle); - return {}; + return Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(enumerable); } - catch (...) + + Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator end(System::Collections::Generic::ICollection& enumerable) { - System::String msg = "Unhandled exception invoking System::Collections::Queue"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; + return Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(nullptr); } } } @@ -12306,15 +14586,21 @@ namespace System namespace System { - namespace ComponentModel + namespace Collections { - namespace Design + namespace Generic { - IComponentChangeService::IComponentChangeService(decltype(nullptr)) + IList::IList(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { } - IComponentChangeService::IComponentChangeService(Plugin::InternalUse iu, int32_t handle) + IList::IList(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { Handle = handle; if (handle) @@ -12323,18 +14609,18 @@ namespace System } } - IComponentChangeService::IComponentChangeService(const IComponentChangeService& other) - : IComponentChangeService(Plugin::InternalUse::Only, other.Handle) + IList::IList(const IList& other) + : IList(Plugin::InternalUse::Only, other.Handle) { } - IComponentChangeService::IComponentChangeService(IComponentChangeService&& other) - : IComponentChangeService(Plugin::InternalUse::Only, other.Handle) + IList::IList(IList&& other) + : IList(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IComponentChangeService::~IComponentChangeService() + IList::~IList() { if (Handle) { @@ -12343,7 +14629,7 @@ namespace System } } - IComponentChangeService& IComponentChangeService::operator=(const IComponentChangeService& other) + IList& IList::operator=(const IList& other) { if (this->Handle) { @@ -12357,7 +14643,7 @@ namespace System return *this; } - IComponentChangeService& IComponentChangeService::operator=(decltype(nullptr)) + IList& IList::operator=(decltype(nullptr)) { if (Handle) { @@ -12367,7 +14653,7 @@ namespace System return *this; } - IComponentChangeService& IComponentChangeService::operator=(IComponentChangeService&& other) + IList& IList::operator=(IList&& other) { if (Handle) { @@ -12378,12 +14664,12 @@ namespace System return *this; } - bool IComponentChangeService::operator==(const IComponentChangeService& other) const + bool IList::operator==(const IList& other) const { return Handle == other.Handle; } - bool IComponentChangeService::operator!=(const IComponentChangeService& other) const + bool IList::operator!=(const IList& other) const { return Handle != other.Handle; } @@ -12391,104 +14677,110 @@ namespace System } } +namespace Plugin +{ + SystemCollectionsGenericIListSystemStringIterator::SystemCollectionsGenericIListSystemStringIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericIListSystemStringIterator::SystemCollectionsGenericIListSystemStringIterator(System::Collections::Generic::IList& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericIListSystemStringIterator::~SystemCollectionsGenericIListSystemStringIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericIListSystemStringIterator& SystemCollectionsGenericIListSystemStringIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericIListSystemStringIterator::operator!=(const SystemCollectionsGenericIListSystemStringIterator& other) + { + return hasMore; + } + + System::String SystemCollectionsGenericIListSystemStringIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + namespace System { - namespace ComponentModel + namespace Collections { - namespace Design + namespace Generic { - BaseIComponentChangeService::BaseIComponentChangeService() - : System::ComponentModel::Design::IComponentChangeService(nullptr) + Plugin::SystemCollectionsGenericIListSystemStringIterator begin(System::Collections::Generic::IList& enumerable) { - CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); - int32_t* handle = &Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemComponentModelDesignBaseIComponentChangeServiceConstructor(cppHandle, handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemComponentModelDesignBaseIComponentChangeService(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + return Plugin::SystemCollectionsGenericIListSystemStringIterator(enumerable); } - BaseIComponentChangeService::BaseIComponentChangeService(decltype(nullptr)) - : System::ComponentModel::Design::IComponentChangeService(nullptr) + Plugin::SystemCollectionsGenericIListSystemStringIterator end(System::Collections::Generic::IList& enumerable) + { + return Plugin::SystemCollectionsGenericIListSystemStringIterator(nullptr); + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + IList::IList(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { - CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); } - BaseIComponentChangeService::BaseIComponentChangeService(const BaseIComponentChangeService& other) - : System::ComponentModel::Design::IComponentChangeService(nullptr) + IList::IList(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); - if (Handle) + Handle = handle; + if (handle) { - Plugin::ReferenceManagedClass(Handle); + Plugin::ReferenceManagedClass(handle); } } - BaseIComponentChangeService::BaseIComponentChangeService(BaseIComponentChangeService&& other) - : System::ComponentModel::Design::IComponentChangeService(nullptr) + IList::IList(const IList& other) + : IList(Plugin::InternalUse::Only, other.Handle) { - Handle = other.Handle; - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; } - BaseIComponentChangeService::BaseIComponentChangeService(Plugin::InternalUse iu, int32_t handle) - : System::ComponentModel::Design::IComponentChangeService(nullptr) + IList::IList(IList&& other) + : IList(Plugin::InternalUse::Only, other.Handle) { - Handle = handle; - CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } + other.Handle = 0; } - BaseIComponentChangeService::~BaseIComponentChangeService() + IList::~IList() { - Plugin::RemoveSystemComponentModelDesignBaseIComponentChangeService(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } - BaseIComponentChangeService& BaseIComponentChangeService::operator=(const BaseIComponentChangeService& other) + IList& IList::operator=(const IList& other) { if (this->Handle) { @@ -12502,897 +14794,954 @@ namespace System return *this; } - BaseIComponentChangeService& BaseIComponentChangeService::operator=(decltype(nullptr)) + IList& IList::operator=(decltype(nullptr)) { if (Handle) { - int32_t handle = Handle; + Plugin::DereferenceManagedClass(Handle); Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } } - Handle = 0; return *this; } - BaseIComponentChangeService& BaseIComponentChangeService::operator=(BaseIComponentChangeService&& other) + IList& IList::operator=(IList&& other) { - Plugin::RemoveSystemComponentModelDesignBaseIComponentChangeService(CppHandle); - CppHandle = 0; if (Handle) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool BaseIComponentChangeService::operator==(const BaseIComponentChangeService& other) const + bool IList::operator==(const IList& other) const { return Handle == other.Handle; } - bool BaseIComponentChangeService::operator!=(const BaseIComponentChangeService& other) const + bool IList::operator!=(const IList& other) const { return Handle != other.Handle; } - - void BaseIComponentChangeService::OnComponentChanged(System::Object& component, System::ComponentModel::MemberDescriptor& member, System::Object& oldValue, System::Object& newValue) + } + } +} + +namespace Plugin +{ + SystemCollectionsGenericIListSystemInt32Iterator::SystemCollectionsGenericIListSystemInt32Iterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericIListSystemInt32Iterator::SystemCollectionsGenericIListSystemInt32Iterator(System::Collections::Generic::IList& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericIListSystemInt32Iterator::~SystemCollectionsGenericIListSystemInt32Iterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericIListSystemInt32Iterator& SystemCollectionsGenericIListSystemInt32Iterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericIListSystemInt32Iterator::operator!=(const SystemCollectionsGenericIListSystemInt32Iterator& other) + { + return hasMore; + } + + System::Int32 SystemCollectionsGenericIListSystemInt32Iterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListSystemInt32Iterator begin(System::Collections::Generic::IList& enumerable) { + return Plugin::SystemCollectionsGenericIListSystemInt32Iterator(enumerable); } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceOnComponentChanged(int32_t cppHandle, int32_t componentHandle, int32_t memberHandle, int32_t oldValueHandle, int32_t newValueHandle) + Plugin::SystemCollectionsGenericIListSystemInt32Iterator end(System::Collections::Generic::IList& enumerable) { - try - { - auto component = System::Object(Plugin::InternalUse::Only, componentHandle); - auto member = System::ComponentModel::MemberDescriptor(Plugin::InternalUse::Only, memberHandle); - auto oldValue = System::Object(Plugin::InternalUse::Only, oldValueHandle); - auto newValue = System::Object(Plugin::InternalUse::Only, newValueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->OnComponentChanged(component, member, oldValue, newValue); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } + return Plugin::SystemCollectionsGenericIListSystemInt32Iterator(nullptr); } - - void BaseIComponentChangeService::OnComponentChanging(System::Object& component, System::ComponentModel::MemberDescriptor& member) + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + IList::IList(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceOnComponentChanging(int32_t cppHandle, int32_t componentHandle, int32_t memberHandle) + IList::IList(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { - try - { - auto component = System::Object(Plugin::InternalUse::Only, componentHandle); - auto member = System::ComponentModel::MemberDescriptor(Plugin::InternalUse::Only, memberHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->OnComponentChanging(component, member); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) + Handle = handle; + if (handle) { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); + Plugin::ReferenceManagedClass(handle); } } - void BaseIComponentChangeService::AddComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value) + IList::IList(const IList& other) + : IList(Plugin::InternalUse::Only, other.Handle) { } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentAdded(int32_t cppHandle, int32_t valueHandle) + IList::IList(IList&& other) + : IList(Plugin::InternalUse::Only, other.Handle) { - try + other.Handle = 0; + } + + IList::~IList() + { + if (Handle) { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentAdded(value); + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - catch (System::Exception ex) + } + + IList& IList::operator=(const IList& other) + { + if (this->Handle) { - Plugin::SetException(ex.Handle); + Plugin::DereferenceManagedClass(this->Handle); } - catch (...) + this->Handle = other.Handle; + if (this->Handle) { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } - void BaseIComponentChangeService::RemoveComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value) + IList& IList::operator=(decltype(nullptr)) { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded(int32_t cppHandle, int32_t valueHandle) + IList& IList::operator=(IList&& other) { - try - { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentAdded(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) + if (Handle) { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; } - void BaseIComponentChangeService::AddComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value) + bool IList::operator==(const IList& other) const { + return Handle == other.Handle; } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentAdding(int32_t cppHandle, int32_t valueHandle) + bool IList::operator!=(const IList& other) const { - try - { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentAdding(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } + return Handle != other.Handle; } - - void BaseIComponentChangeService::RemoveComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value) + } + } +} + +namespace Plugin +{ + SystemCollectionsGenericIListSystemSingleIterator::SystemCollectionsGenericIListSystemSingleIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericIListSystemSingleIterator::SystemCollectionsGenericIListSystemSingleIterator(System::Collections::Generic::IList& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericIListSystemSingleIterator::~SystemCollectionsGenericIListSystemSingleIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericIListSystemSingleIterator& SystemCollectionsGenericIListSystemSingleIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericIListSystemSingleIterator::operator!=(const SystemCollectionsGenericIListSystemSingleIterator& other) + { + return hasMore; + } + + System::Single SystemCollectionsGenericIListSystemSingleIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListSystemSingleIterator begin(System::Collections::Generic::IList& enumerable) { + return Plugin::SystemCollectionsGenericIListSystemSingleIterator(enumerable); } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding(int32_t cppHandle, int32_t valueHandle) + Plugin::SystemCollectionsGenericIListSystemSingleIterator end(System::Collections::Generic::IList& enumerable) { - try - { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentAdding(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } + return Plugin::SystemCollectionsGenericIListSystemSingleIterator(nullptr); } - - void BaseIComponentChangeService::AddComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value) + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + IList::IList(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentChanged(int32_t cppHandle, int32_t valueHandle) + IList::IList(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { - try - { - auto value = System::ComponentModel::Design::ComponentChangedEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentChanged(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) + Handle = handle; + if (handle) { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); + Plugin::ReferenceManagedClass(handle); } } - void BaseIComponentChangeService::RemoveComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value) + IList::IList(const IList& other) + : IList(Plugin::InternalUse::Only, other.Handle) { } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanged(int32_t cppHandle, int32_t valueHandle) + IList::IList(IList&& other) + : IList(Plugin::InternalUse::Only, other.Handle) { - try - { - auto value = System::ComponentModel::Design::ComponentChangedEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentChanged(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } + other.Handle = 0; } - void BaseIComponentChangeService::AddComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value) + IList::~IList() { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentChanging(int32_t cppHandle, int32_t valueHandle) + IList& IList::operator=(const IList& other) { - try - { - auto value = System::ComponentModel::Design::ComponentChangingEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentChanging(value); - } - catch (System::Exception ex) + if (this->Handle) { - Plugin::SetException(ex.Handle); + Plugin::DereferenceManagedClass(this->Handle); } - catch (...) + this->Handle = other.Handle; + if (this->Handle) { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } - void BaseIComponentChangeService::RemoveComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value) + IList& IList::operator=(decltype(nullptr)) { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanging(int32_t cppHandle, int32_t valueHandle) + IList& IList::operator=(IList&& other) { - try - { - auto value = System::ComponentModel::Design::ComponentChangingEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentChanging(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) + if (Handle) { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; } - void BaseIComponentChangeService::AddComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value) + bool IList::operator==(const IList& other) const { + return Handle == other.Handle; } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentRemoved(int32_t cppHandle, int32_t valueHandle) + bool IList::operator!=(const IList& other) const { - try - { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentRemoved(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } + return Handle != other.Handle; } - - void BaseIComponentChangeService::RemoveComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value) + } + } +} + +namespace Plugin +{ + SystemCollectionsGenericIListUnityEngineRaycastHitIterator::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericIListUnityEngineRaycastHitIterator::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(System::Collections::Generic::IList& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericIListUnityEngineRaycastHitIterator::~SystemCollectionsGenericIListUnityEngineRaycastHitIterator() + { + if (enumerator != nullptr) + { + enumerator.Dispose(); + } + } + + SystemCollectionsGenericIListUnityEngineRaycastHitIterator& SystemCollectionsGenericIListUnityEngineRaycastHitIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericIListUnityEngineRaycastHitIterator::operator!=(const SystemCollectionsGenericIListUnityEngineRaycastHitIterator& other) + { + return hasMore; + } + + UnityEngine::RaycastHit SystemCollectionsGenericIListUnityEngineRaycastHitIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator begin(System::Collections::Generic::IList& enumerable) { + return Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(enumerable); } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoved(int32_t cppHandle, int32_t valueHandle) + Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator end(System::Collections::Generic::IList& enumerable) { - try - { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentRemoved(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } + return Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(nullptr); } - - void BaseIComponentChangeService::AddComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value) + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + IList::IList(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentRemoving(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentRemoving(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) + IList::IList(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + { + Handle = handle; + if (handle) { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); + Plugin::ReferenceManagedClass(handle); } } - void BaseIComponentChangeService::RemoveComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value) + IList::IList(const IList& other) + : IList(Plugin::InternalUse::Only, other.Handle) { } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving(int32_t cppHandle, int32_t valueHandle) + IList::IList(IList&& other) + : IList(Plugin::InternalUse::Only, other.Handle) { - try + other.Handle = 0; + } + + IList::~IList() + { + if (Handle) { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentRemoving(value); + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - catch (System::Exception ex) + } + + IList& IList::operator=(const IList& other) + { + if (this->Handle) { - Plugin::SetException(ex.Handle); + Plugin::DereferenceManagedClass(this->Handle); } - catch (...) + this->Handle = other.Handle; + if (this->Handle) { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } - void BaseIComponentChangeService::AddComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value) + IList& IList::operator=(decltype(nullptr)) { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentRename(int32_t cppHandle, int32_t valueHandle) + IList& IList::operator=(IList&& other) { - try - { - auto value = System::ComponentModel::Design::ComponentRenameEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentRename(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) + if (Handle) { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; } - void BaseIComponentChangeService::RemoveComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value) + bool IList::operator==(const IList& other) const { + return Handle == other.Handle; } - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename(int32_t cppHandle, int32_t valueHandle) + bool IList::operator!=(const IList& other) const { - try - { - auto value = System::ComponentModel::Design::ComponentRenameEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentRename(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } + return Handle != other.Handle; } } } } -namespace System +namespace Plugin { - namespace IO + SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) { - FileStream::FileStream(decltype(nullptr)) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) + } + + SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(System::Collections::Generic::IList& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::~SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator() + { + if (enumerator != nullptr) { + enumerator.Dispose(); } - - FileStream::FileStream(Plugin::InternalUse iu, int32_t handle) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) + } + + SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::operator!=(const SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& other) + { + return hasMore; + } + + UnityEngine::GradientColorKey SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic { - Handle = handle; - if (handle) + Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::IList& enumerable) { - Plugin::ReferenceManagedClass(handle); + return Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(enumerable); } - } - - FileStream::FileStream(const FileStream& other) - : FileStream(Plugin::InternalUse::Only, other.Handle) - { - } - - FileStream::FileStream(FileStream&& other) - : FileStream(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - FileStream::~FileStream() - { - if (Handle) + + Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator end(System::Collections::Generic::IList& enumerable) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + return Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(nullptr); } } - - FileStream& FileStream::operator=(const FileStream& other) + } +} + +namespace System +{ + namespace Collections + { + namespace Generic { - if (this->Handle) + IList::IList(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { - Plugin::DereferenceManagedClass(this->Handle); } - this->Handle = other.Handle; - if (this->Handle) + + IList::IList(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) { - Plugin::ReferenceManagedClass(this->Handle); + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - return *this; - } - - FileStream& FileStream::operator=(decltype(nullptr)) - { - if (Handle) + + IList::IList(const IList& other) + : IList(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; } - return *this; - } - - FileStream& FileStream::operator=(FileStream&& other) - { - if (Handle) + + IList::IList(IList&& other) + : IList(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(Handle); + other.Handle = 0; + } + + IList::~IList() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IList& IList::operator=(const IList& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IList& IList::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IList& IList::operator=(IList&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool FileStream::operator==(const FileStream& other) const - { - return Handle == other.Handle; - } - - bool FileStream::operator!=(const FileStream& other) const - { - return Handle != other.Handle; - } - - FileStream::FileStream(System::String& path, System::IO::FileMode mode) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) - { - auto returnValue = Plugin::SystemIOFileStreamConstructorSystemString_SystemIOFileMode(path.Handle, mode); - if (Plugin::unhandledCsharpException) + + bool IList::operator==(const IList& other) const { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Handle == other.Handle; } - Handle = returnValue; - if (returnValue) + + bool IList::operator!=(const IList& other) const { - Plugin::ReferenceManagedClass(returnValue); + return Handle != other.Handle; } } - - void FileStream::WriteByte(uint8_t value) + } +} + +namespace Plugin +{ + SystemCollectionsGenericIListUnityEngineResolutionIterator::SystemCollectionsGenericIListUnityEngineResolutionIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) + { + } + + SystemCollectionsGenericIListUnityEngineResolutionIterator::SystemCollectionsGenericIListUnityEngineResolutionIterator(System::Collections::Generic::IList& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericIListUnityEngineResolutionIterator::~SystemCollectionsGenericIListUnityEngineResolutionIterator() + { + if (enumerator != nullptr) { - Plugin::SystemIOFileStreamMethodWriteByteSystemByte(Handle, value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + enumerator.Dispose(); } } + + SystemCollectionsGenericIListUnityEngineResolutionIterator& SystemCollectionsGenericIListUnityEngineResolutionIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericIListUnityEngineResolutionIterator::operator!=(const SystemCollectionsGenericIListUnityEngineResolutionIterator& other) + { + return hasMore; + } + + UnityEngine::Resolution SystemCollectionsGenericIListUnityEngineResolutionIterator::operator*() + { + return enumerator.GetCurrent(); + } } namespace System { - namespace IO + namespace Collections { - BaseFileStream::BaseFileStream(System::String& path, System::IO::FileMode mode) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) - , System::IO::FileStream(nullptr) + namespace Generic { - CppHandle = Plugin::StoreSystemIOBaseFileStream(this); - int32_t* handle = &Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode(cppHandle, handle, path.Handle, mode); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemIOBaseFileStream(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) + Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator begin(System::Collections::Generic::IList& enumerable) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + return Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator(enumerable); } - } - - BaseFileStream::BaseFileStream(decltype(nullptr)) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) - , System::IO::FileStream(nullptr) - { - CppHandle = Plugin::StoreSystemIOBaseFileStream(this); - } - - BaseFileStream::BaseFileStream(const BaseFileStream& other) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) - , System::IO::FileStream(nullptr) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemIOBaseFileStream(this); - if (Handle) + + Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator end(System::Collections::Generic::IList& enumerable) { - Plugin::ReferenceManagedClass(Handle); + return Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator(nullptr); } } - - BaseFileStream::BaseFileStream(BaseFileStream&& other) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) - , System::IO::FileStream(nullptr) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - BaseFileStream::BaseFileStream(Plugin::InternalUse iu, int32_t handle) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) - , System::IO::FileStream(nullptr) + } +} + +namespace System +{ + namespace Collections + { + namespace Generic { - Handle = handle; - CppHandle = Plugin::StoreSystemIOBaseFileStream(this); - if (Handle) + List::List(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { - Plugin::ReferenceManagedClass(Handle); } - } - - BaseFileStream::~BaseFileStream() - { - Plugin::RemoveSystemIOBaseFileStream(CppHandle); - CppHandle = 0; - if (Handle) + + List::List(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + Handle = handle; + if (handle) { - Plugin::ReleaseSystemIOBaseFileStream(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + Plugin::ReferenceManagedClass(handle); } } - } - - BaseFileStream& BaseFileStream::operator=(const BaseFileStream& other) - { - if (this->Handle) + + List::List(const List& other) + : List(Plugin::InternalUse::Only, other.Handle) { - Plugin::DereferenceManagedClass(this->Handle); } - this->Handle = other.Handle; - if (this->Handle) + + List::List(List&& other) + : List(Plugin::InternalUse::Only, other.Handle) { - Plugin::ReferenceManagedClass(this->Handle); + other.Handle = 0; } - return *this; - } - - BaseFileStream& BaseFileStream::operator=(decltype(nullptr)) - { - if (Handle) + + List::~List() { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemIOBaseFileStream(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - Handle = 0; - return *this; - } - - BaseFileStream& BaseFileStream::operator=(BaseFileStream&& other) - { - Plugin::RemoveSystemIOBaseFileStream(CppHandle); - CppHandle = 0; - if (Handle) + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + List& List::operator=(const List& other) { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) + if (this->Handle) { - Plugin::ReleaseSystemIOBaseFileStream(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool BaseFileStream::operator==(const BaseFileStream& other) const - { - return Handle == other.Handle; - } - - bool BaseFileStream::operator!=(const BaseFileStream& other) const - { - return Handle != other.Handle; - } - - void BaseFileStream::WriteByte(uint8_t value) - { - } - - DLLEXPORT void SystemIOFileStreamWriteByte(int32_t cppHandle, uint8_t value) - { - try + + List& List::operator=(decltype(nullptr)) { - Plugin::GetSystemIOBaseFileStream(cppHandle)->WriteByte(value); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - catch (System::Exception ex) + + List& List::operator=(List&& other) { - Plugin::SetException(ex.Handle); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - catch (...) + + bool List::operator==(const List& other) const { - System::String msg = "Unhandled exception invoking System::IO::FileStream"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); + return Handle == other.Handle; } - } - } -} - -namespace UnityEngine -{ - namespace Playables - { - PlayableHandle::PlayableHandle(decltype(nullptr)) - : System::ValueType(nullptr) - { - } - - PlayableHandle::PlayableHandle(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(nullptr) - { - Handle = handle; - if (handle) + + bool List::operator!=(const List& other) const { - Plugin::ReferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + return Handle != other.Handle; } - } - - PlayableHandle::PlayableHandle(const PlayableHandle& other) - : PlayableHandle(Plugin::InternalUse::Only, other.Handle) - { - } - - PlayableHandle::PlayableHandle(PlayableHandle&& other) - : PlayableHandle(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - PlayableHandle::~PlayableHandle() - { - if (Handle) + + List::List() + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); - Handle = 0; + auto returnValue = Plugin::SystemCollectionsGenericListSystemStringConstructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } } - } - - PlayableHandle& PlayableHandle::operator=(const PlayableHandle& other) - { - if (this->Handle) + + System::String List::GetItem(System::Int32 index) { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + auto returnValue = Plugin::SystemCollectionsGenericListSystemStringPropertyGetItem(Handle, index); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::String(Plugin::InternalUse::Only, returnValue); } - this->Handle = other.Handle; - if (this->Handle) + + void List::SetItem(System::Int32 index, System::String& value) { - Plugin::ReferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + Plugin::SystemCollectionsGenericListSystemStringPropertySetItem(Handle, index, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - return *this; - } - - PlayableHandle& PlayableHandle::operator=(decltype(nullptr)) - { - if (Handle) + + void List::Add(System::String& item) { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); - Handle = 0; + Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString(Handle, item.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - return *this; - } - - PlayableHandle& PlayableHandle::operator=(PlayableHandle&& other) - { - if (Handle) + + void List::Sort(System::Collections::Generic::IComparer& comparer) { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); + Plugin::SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool PlayableHandle::operator==(const PlayableHandle& other) const - { - return Handle == other.Handle; - } - - bool PlayableHandle::operator!=(const PlayableHandle& other) const - { - return Handle != other.Handle; } } } -namespace System +namespace Plugin { - Object::Object(UnityEngine::Playables::PlayableHandle& val) + SystemCollectionsGenericListSystemStringIterator::SystemCollectionsGenericListSystemStringIterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) { - int32_t handle = Plugin::BoxPlayableHandle(val.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) + } + + SystemCollectionsGenericListSystemStringIterator::SystemCollectionsGenericListSystemStringIterator(System::Collections::Generic::List& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericListSystemStringIterator::~SystemCollectionsGenericListSystemStringIterator() + { + if (enumerator != nullptr) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + enumerator.Dispose(); } } - Object::operator UnityEngine::Playables::PlayableHandle() + SystemCollectionsGenericListSystemStringIterator& SystemCollectionsGenericListSystemStringIterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericListSystemStringIterator::operator!=(const SystemCollectionsGenericListSystemStringIterator& other) + { + return hasMore; + } + + System::String SystemCollectionsGenericListSystemStringIterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections { - UnityEngine::Playables::PlayableHandle returnVal(Plugin::InternalUse::Only, Plugin::UnboxPlayableHandle(Handle)); - if (Plugin::unhandledCsharpException) + namespace Generic { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::SystemCollectionsGenericListSystemStringIterator begin(System::Collections::Generic::List& enumerable) + { + return Plugin::SystemCollectionsGenericListSystemStringIterator(enumerable); + } + + Plugin::SystemCollectionsGenericListSystemStringIterator end(System::Collections::Generic::List& enumerable) + { + return Plugin::SystemCollectionsGenericListSystemStringIterator(nullptr); + } } - return returnVal; } } -namespace UnityEngine +namespace System { - namespace Experimental + namespace Collections { - namespace UIElements + namespace Generic { - CallbackEventHandler::CallbackEventHandler(decltype(nullptr)) - : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) + List::List(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { } - CallbackEventHandler::CallbackEventHandler(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) + List::List(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { Handle = handle; if (handle) @@ -13401,18 +15750,18 @@ namespace UnityEngine } } - CallbackEventHandler::CallbackEventHandler(const CallbackEventHandler& other) - : CallbackEventHandler(Plugin::InternalUse::Only, other.Handle) + List::List(const List& other) + : List(Plugin::InternalUse::Only, other.Handle) { } - CallbackEventHandler::CallbackEventHandler(CallbackEventHandler&& other) - : CallbackEventHandler(Plugin::InternalUse::Only, other.Handle) + List::List(List&& other) + : List(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - CallbackEventHandler::~CallbackEventHandler() + List::~List() { if (Handle) { @@ -13421,7 +15770,7 @@ namespace UnityEngine } } - CallbackEventHandler& CallbackEventHandler::operator=(const CallbackEventHandler& other) + List& List::operator=(const List& other) { if (this->Handle) { @@ -13435,7 +15784,7 @@ namespace UnityEngine return *this; } - CallbackEventHandler& CallbackEventHandler::operator=(decltype(nullptr)) + List& List::operator=(decltype(nullptr)) { if (Handle) { @@ -13445,7 +15794,7 @@ namespace UnityEngine return *this; } - CallbackEventHandler& CallbackEventHandler::operator=(CallbackEventHandler&& other) + List& List::operator=(List&& other) { if (Handle) { @@ -13456,36 +15805,172 @@ namespace UnityEngine return *this; } - bool CallbackEventHandler::operator==(const CallbackEventHandler& other) const + bool List::operator==(const List& other) const { return Handle == other.Handle; } - bool CallbackEventHandler::operator!=(const CallbackEventHandler& other) const + bool List::operator!=(const List& other) const { return Handle != other.Handle; } + + List::List() + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) + { + auto returnValue = Plugin::SystemCollectionsGenericListSystemInt32Constructor(); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } + } + + System::Int32 List::GetItem(System::Int32 index) + { + auto returnValue = Plugin::SystemCollectionsGenericListSystemInt32PropertyGetItem(Handle, index); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; + } + + void List::SetItem(System::Int32 index, System::Int32 value) + { + Plugin::SystemCollectionsGenericListSystemInt32PropertySetItem(Handle, index, value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void List::Add(System::Int32 item) + { + Plugin::SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(Handle, item); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } + + void List::Sort(System::Collections::Generic::IComparer& comparer) + { + Plugin::SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } } } -namespace UnityEngine +namespace Plugin { - namespace Experimental + SystemCollectionsGenericListSystemInt32Iterator::SystemCollectionsGenericListSystemInt32Iterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) { - namespace UIElements + } + + SystemCollectionsGenericListSystemInt32Iterator::SystemCollectionsGenericListSystemInt32Iterator(System::Collections::Generic::List& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); + } + + SystemCollectionsGenericListSystemInt32Iterator::~SystemCollectionsGenericListSystemInt32Iterator() + { + if (enumerator != nullptr) { - VisualElement::VisualElement(decltype(nullptr)) - : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) - , UnityEngine::Experimental::UIElements::CallbackEventHandler(nullptr) - , UnityEngine::Experimental::UIElements::IStyle(nullptr) + enumerator.Dispose(); + } + } + + SystemCollectionsGenericListSystemInt32Iterator& SystemCollectionsGenericListSystemInt32Iterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsGenericListSystemInt32Iterator::operator!=(const SystemCollectionsGenericListSystemInt32Iterator& other) + { + return hasMore; + } + + System::Int32 SystemCollectionsGenericListSystemInt32Iterator::operator*() + { + return enumerator.GetCurrent(); + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericListSystemInt32Iterator begin(System::Collections::Generic::List& enumerable) { + return Plugin::SystemCollectionsGenericListSystemInt32Iterator(enumerable); } - VisualElement::VisualElement(Plugin::InternalUse iu, int32_t handle) - : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) - , UnityEngine::Experimental::UIElements::CallbackEventHandler(nullptr) - , UnityEngine::Experimental::UIElements::IStyle(nullptr) + Plugin::SystemCollectionsGenericListSystemInt32Iterator end(System::Collections::Generic::List& enumerable) + { + return Plugin::SystemCollectionsGenericListSystemInt32Iterator(nullptr); + } + } + } +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + Collection::Collection(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) + { + } + + Collection::Collection(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { Handle = handle; if (handle) @@ -13494,18 +15979,18 @@ namespace UnityEngine } } - VisualElement::VisualElement(const VisualElement& other) - : VisualElement(Plugin::InternalUse::Only, other.Handle) + Collection::Collection(const Collection& other) + : Collection(Plugin::InternalUse::Only, other.Handle) { } - VisualElement::VisualElement(VisualElement&& other) - : VisualElement(Plugin::InternalUse::Only, other.Handle) + Collection::Collection(Collection&& other) + : Collection(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - VisualElement::~VisualElement() + Collection::~Collection() { if (Handle) { @@ -13514,7 +15999,7 @@ namespace UnityEngine } } - VisualElement& VisualElement::operator=(const VisualElement& other) + Collection& Collection::operator=(const Collection& other) { if (this->Handle) { @@ -13528,7 +16013,7 @@ namespace UnityEngine return *this; } - VisualElement& VisualElement::operator=(decltype(nullptr)) + Collection& Collection::operator=(decltype(nullptr)) { if (Handle) { @@ -13538,7 +16023,7 @@ namespace UnityEngine return *this; } - VisualElement& VisualElement::operator=(VisualElement&& other) + Collection& Collection::operator=(Collection&& other) { if (Handle) { @@ -13549,12 +16034,12 @@ namespace UnityEngine return *this; } - bool VisualElement::operator==(const VisualElement& other) const + bool Collection::operator==(const Collection& other) const { return Handle == other.Handle; } - bool VisualElement::operator!=(const VisualElement& other) const + bool Collection::operator!=(const Collection& other) const { return Handle != other.Handle; } @@ -13562,300 +16047,228 @@ namespace UnityEngine } } -namespace UnityEngine +namespace Plugin { - namespace Experimental + SystemCollectionsObjectModelCollectionSystemInt32Iterator::SystemCollectionsObjectModelCollectionSystemInt32Iterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) { - namespace UIElements - { - UnityEngine::Experimental::UIElements::VisualElement UQueryExtensions::Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name, System::Array1& classes) - { - auto returnValue = Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1(e.Handle, name.Handle, classes.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Experimental::UIElements::VisualElement(Plugin::InternalUse::Only, returnValue); - } + } - UnityEngine::Experimental::UIElements::VisualElement UQueryExtensions::Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name, System::String& className) - { - auto returnValue = Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString(e.Handle, name.Handle, className.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Experimental::UIElements::VisualElement(Plugin::InternalUse::Only, returnValue); - } - } + SystemCollectionsObjectModelCollectionSystemInt32Iterator::SystemCollectionsObjectModelCollectionSystemInt32Iterator(System::Collections::ObjectModel::Collection& enumerable) + : enumerator(enumerable.GetEnumerator()) + { + hasMore = enumerator.MoveNext(); } -} - -namespace System -{ - Object::Object(UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy val) + + SystemCollectionsObjectModelCollectionSystemInt32Iterator::~SystemCollectionsObjectModelCollectionSystemInt32Iterator() { - int32_t handle = Plugin::BoxInteractionSourcePositionAccuracy(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) + if (enumerator != nullptr) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + enumerator.Dispose(); } } - Object::operator UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy() + SystemCollectionsObjectModelCollectionSystemInt32Iterator& SystemCollectionsObjectModelCollectionSystemInt32Iterator::operator++() + { + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsObjectModelCollectionSystemInt32Iterator::operator!=(const SystemCollectionsObjectModelCollectionSystemInt32Iterator& other) + { + return hasMore; + } + + System::Int32 SystemCollectionsObjectModelCollectionSystemInt32Iterator::operator*() { - UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy returnVal(Plugin::UnboxInteractionSourcePositionAccuracy(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; + return enumerator.GetCurrent(); } } namespace System { - Object::Object(UnityEngine::XR::WSA::Input::InteractionSourceNode val) - { - int32_t handle = Plugin::BoxInteractionSourceNode(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator UnityEngine::XR::WSA::Input::InteractionSourceNode() + namespace Collections { - UnityEngine::XR::WSA::Input::InteractionSourceNode returnVal(Plugin::UnboxInteractionSourceNode(Handle)); - if (Plugin::unhandledCsharpException) + namespace ObjectModel { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator begin(System::Collections::ObjectModel::Collection& enumerable) + { + return Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator(enumerable); + } + + Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator end(System::Collections::ObjectModel::Collection& enumerable) + { + return Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator(nullptr); + } } - return returnVal; } } -namespace UnityEngine +namespace System { - namespace XR + namespace Collections { - namespace WSA + namespace ObjectModel { - namespace Input + KeyedCollection::KeyedCollection(decltype(nullptr)) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) + , System::Collections::ObjectModel::Collection(nullptr) { - InteractionSourcePose::InteractionSourcePose(decltype(nullptr)) - : System::ValueType(nullptr) - { - } - - InteractionSourcePose::InteractionSourcePose(Plugin::InternalUse iu, int32_t handle) - : System::ValueType(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); - } - } - - InteractionSourcePose::InteractionSourcePose(const InteractionSourcePose& other) - : InteractionSourcePose(Plugin::InternalUse::Only, other.Handle) - { - } - - InteractionSourcePose::InteractionSourcePose(InteractionSourcePose&& other) - : InteractionSourcePose(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - InteractionSourcePose::~InteractionSourcePose() - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); - Handle = 0; - } - } - - InteractionSourcePose& InteractionSourcePose::operator=(const InteractionSourcePose& other) + } + + KeyedCollection::KeyedCollection(Plugin::InternalUse, int32_t handle) + : System::Collections::IEnumerable(nullptr) + , System::Collections::ICollection(nullptr) + , System::Collections::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) + , System::Collections::ObjectModel::Collection(nullptr) + { + Handle = handle; + if (handle) { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); - } - return *this; + Plugin::ReferenceManagedClass(handle); } - - InteractionSourcePose& InteractionSourcePose::operator=(decltype(nullptr)) + } + + KeyedCollection::KeyedCollection(const KeyedCollection& other) + : KeyedCollection(Plugin::InternalUse::Only, other.Handle) + { + } + + KeyedCollection::KeyedCollection(KeyedCollection&& other) + : KeyedCollection(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + KeyedCollection::~KeyedCollection() + { + if (Handle) { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); - Handle = 0; - } - return *this; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - InteractionSourcePose& InteractionSourcePose::operator=(InteractionSourcePose&& other) + } + + KeyedCollection& KeyedCollection::operator=(const KeyedCollection& other) + { + if (this->Handle) { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; + Plugin::DereferenceManagedClass(this->Handle); } - - bool InteractionSourcePose::operator==(const InteractionSourcePose& other) const + this->Handle = other.Handle; + if (this->Handle) { - return Handle == other.Handle; + Plugin::ReferenceManagedClass(this->Handle); } - - bool InteractionSourcePose::operator!=(const InteractionSourcePose& other) const + return *this; + } + + KeyedCollection& KeyedCollection::operator=(decltype(nullptr)) + { + if (Handle) { - return Handle != other.Handle; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - - System::Boolean InteractionSourcePose::TryGetRotation(UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node) + return *this; + } + + KeyedCollection& KeyedCollection::operator=(KeyedCollection&& other) + { + if (Handle) { - auto returnValue = Plugin::UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode(Handle, rotation, node); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool KeyedCollection::operator==(const KeyedCollection& other) const + { + return Handle == other.Handle; + } + + bool KeyedCollection::operator!=(const KeyedCollection& other) const + { + return Handle != other.Handle; } } } } -namespace System +namespace Plugin { - Object::Object(UnityEngine::XR::WSA::Input::InteractionSourcePose& val) + SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(decltype(nullptr)) + : enumerator(nullptr) + , hasMore(false) { - int32_t handle = Plugin::BoxInteractionSourcePose(val.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } } - Object::operator UnityEngine::XR::WSA::Input::InteractionSourcePose() + SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(System::Collections::ObjectModel::KeyedCollection& enumerable) + : enumerator(enumerable.GetEnumerator()) { - UnityEngine::XR::WSA::Input::InteractionSourcePose returnVal(Plugin::InternalUse::Only, Plugin::UnboxInteractionSourcePose(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; + hasMore = enumerator.MoveNext(); } -} - -namespace System -{ - Object::Object(System::Boolean val) + + SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::~SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator() { - int32_t handle = Plugin::BoxBoolean(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) + if (enumerator != nullptr) { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + enumerator.Dispose(); } } - Object::operator System::Boolean() + SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::operator++() { - System::Boolean returnVal(Plugin::UnboxBoolean(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; + hasMore = enumerator.MoveNext(); + return *this; + } + + bool SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::operator!=(const SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& other) + { + return hasMore; + } + + System::Int32 SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::operator*() + { + return enumerator.GetCurrent(); } } namespace System { - Object::Object(int8_t val) + namespace Collections { - int32_t handle = Plugin::BoxSByte(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) + namespace ObjectModel { - Plugin::ReferenceManagedClass(handle); - Handle = handle; + Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator begin(System::Collections::ObjectModel::KeyedCollection& enumerable) + { + return Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(enumerable); + } + + Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator end(System::Collections::ObjectModel::KeyedCollection& enumerable) + { + return Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(nullptr); + } } } - - Object::operator int8_t() +} + +namespace System +{ + Object::operator System::Boolean() { - int8_t returnVal(Plugin::UnboxSByte(Handle)); + System::Boolean returnVal(Plugin::UnboxBoolean(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -13869,26 +16282,9 @@ namespace System namespace System { - Object::Object(uint8_t val) - { - int32_t handle = Plugin::BoxByte(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator uint8_t() + Object::operator System::SByte() { - uint8_t returnVal(Plugin::UnboxByte(Handle)); + System::SByte returnVal(Plugin::UnboxSByte(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -13902,26 +16298,9 @@ namespace System namespace System { - Object::Object(int16_t val) - { - int32_t handle = Plugin::BoxInt16(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator int16_t() + Object::operator System::Byte() { - int16_t returnVal(Plugin::UnboxInt16(Handle)); + System::Byte returnVal(Plugin::UnboxByte(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -13935,26 +16314,9 @@ namespace System namespace System { - Object::Object(uint16_t val) - { - int32_t handle = Plugin::BoxUInt16(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator uint16_t() + Object::operator System::Int16() { - uint16_t returnVal(Plugin::UnboxUInt16(Handle)); + System::Int16 returnVal(Plugin::UnboxInt16(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -13968,26 +16330,9 @@ namespace System namespace System { - Object::Object(int32_t val) - { - int32_t handle = Plugin::BoxInt32(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator int32_t() + Object::operator System::UInt16() { - int32_t returnVal(Plugin::UnboxInt32(Handle)); + System::UInt16 returnVal(Plugin::UnboxUInt16(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -14001,26 +16346,9 @@ namespace System namespace System { - Object::Object(uint32_t val) - { - int32_t handle = Plugin::BoxUInt32(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator uint32_t() + Object::operator System::Int32() { - uint32_t returnVal(Plugin::UnboxUInt32(Handle)); + System::Int32 returnVal(Plugin::UnboxInt32(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -14034,26 +16362,9 @@ namespace System namespace System { - Object::Object(int64_t val) - { - int32_t handle = Plugin::BoxInt64(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator int64_t() + Object::operator System::UInt32() { - int64_t returnVal(Plugin::UnboxInt64(Handle)); + System::UInt32 returnVal(Plugin::UnboxUInt32(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -14067,26 +16378,9 @@ namespace System namespace System { - Object::Object(uint64_t val) - { - int32_t handle = Plugin::BoxUInt64(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator uint64_t() + Object::operator System::Int64() { - uint64_t returnVal(Plugin::UnboxUInt64(Handle)); + System::Int64 returnVal(Plugin::UnboxInt64(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -14100,9 +16394,9 @@ namespace System namespace System { - Object::Object(System::Char val) + Object::operator System::UInt64() { - int32_t handle = Plugin::BoxChar(val); + System::UInt64 returnVal(Plugin::UnboxUInt64(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -14110,13 +16404,12 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } + return returnVal; } - +} + +namespace System +{ Object::operator System::Char() { System::Char returnVal(Plugin::UnboxChar(Handle)); @@ -14133,26 +16426,9 @@ namespace System namespace System { - Object::Object(float val) + Object::operator System::Single() { - int32_t handle = Plugin::BoxSingle(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator float() - { - float returnVal(Plugin::UnboxSingle(Handle)); + System::Single returnVal(Plugin::UnboxSingle(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -14166,26 +16442,9 @@ namespace System namespace System { - Object::Object(double val) - { - int32_t handle = Plugin::BoxDouble(val); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - Handle = handle; - } - } - - Object::operator double() + Object::operator System::Double() { - double returnVal(Plugin::UnboxDouble(Handle)); + System::Double returnVal(Plugin::UnboxDouble(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -14209,7 +16468,7 @@ namespace MyGame { } - TestScript::TestScript(Plugin::InternalUse iu, int32_t handle) + TestScript::TestScript(Plugin::InternalUse, int32_t handle) : UnityEngine::Object(nullptr) , UnityEngine::Component(nullptr) , UnityEngine::Behaviour(nullptr) @@ -14301,7 +16560,7 @@ namespace MyGame { } - AnotherScript::AnotherScript(Plugin::InternalUse iu, int32_t handle) + AnotherScript::AnotherScript(Plugin::InternalUse, int32_t handle) : UnityEngine::Object(nullptr) , UnityEngine::Component(nullptr) , UnityEngine::Behaviour(nullptr) @@ -14383,13 +16642,13 @@ namespace MyGame namespace Plugin { - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0) { Handle = handle; Index0 = index0; } - void ArrayElementProxy1_1::operator=(int32_t item) + void ArrayElementProxy1_1::operator=(System::Int32 item) { Plugin::SystemInt32Array1SetItem1(Handle, Index0, item); if (Plugin::unhandledCsharpException) @@ -14401,7 +16660,7 @@ namespace Plugin } } - ArrayElementProxy1_1::operator int32_t() + ArrayElementProxy1_1::operator System::Int32() { auto returnValue = Plugin::SystemInt32Array1GetItem1(Handle, Index0); if (Plugin::unhandledCsharpException) @@ -14417,28 +16676,28 @@ namespace Plugin namespace System { - Array1::Array1(decltype(nullptr)) + Array1::Array1(decltype(nullptr)) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) , System::Collections::IList(nullptr) , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { this->InternalLength = 0; } - Array1::Array1(Plugin::InternalUse iu, int32_t handle) + Array1::Array1(Plugin::InternalUse, int32_t handle) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) , System::Collections::IList(nullptr) , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { Handle = handle; if (handle) @@ -14448,13 +16707,13 @@ namespace System this->InternalLength = 0; } - Array1::Array1(const Array1& other) + Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; } - Array1::Array1(Array1&& other) + Array1::Array1(Array1&& other) : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; @@ -14462,7 +16721,7 @@ namespace System other.InternalLength = 0; } - Array1::~Array1() + Array1::~Array1() { if (Handle) { @@ -14471,7 +16730,7 @@ namespace System } } - Array1& Array1::operator=(const Array1& other) + Array1& Array1::operator=(const Array1& other) { if (this->Handle) { @@ -14486,7 +16745,7 @@ namespace System return *this; } - Array1& Array1::operator=(decltype(nullptr)) + Array1& Array1::operator=(decltype(nullptr)) { if (Handle) { @@ -14496,7 +16755,7 @@ namespace System return *this; } - Array1& Array1::operator=(Array1&& other) + Array1& Array1::operator=(Array1&& other) { if (Handle) { @@ -14509,25 +16768,25 @@ namespace System return *this; } - bool Array1::operator==(const Array1& other) const + bool Array1::operator==(const Array1& other) const { return Handle == other.Handle; } - bool Array1::operator!=(const Array1& other) const + bool Array1::operator!=(const Array1& other) const { return Handle != other.Handle; } - Array1::Array1(int32_t length0) + Array1::Array1(System::Int32 length0) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) , System::Collections::IList(nullptr) , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { auto returnValue = Plugin::SystemSystemInt32Array1Constructor1(length0); if (Plugin::unhandledCsharpException) @@ -14545,7 +16804,7 @@ namespace System } } - int32_t Array1::GetLength() + System::Int32 Array1::GetLength() { int32_t returnVal = InternalLength; if (returnVal == 0) @@ -14556,20 +16815,20 @@ namespace System return returnVal; } - int32_t Array1::GetRank() + System::Int32 Array1::GetRank() { return 1; } - Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) + Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) { - return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); + return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); } } namespace Plugin { - SystemInt32Array1Iterator::SystemInt32Array1Iterator(System::Array1& array, int32_t index) + SystemInt32Array1Iterator::SystemInt32Array1Iterator(System::Array1& array, int32_t index) : array(array) , index(index) { @@ -14586,7 +16845,7 @@ namespace Plugin return index != other.index; } - int32_t SystemInt32Array1Iterator::operator*() + System::Int32 SystemInt32Array1Iterator::operator*() { return array[index]; } @@ -14594,12 +16853,12 @@ namespace Plugin namespace System { - Plugin::SystemInt32Array1Iterator begin(System::Array1& array) + Plugin::SystemInt32Array1Iterator begin(System::Array1& array) { return Plugin::SystemInt32Array1Iterator(array, 0); } - Plugin::SystemInt32Array1Iterator end(System::Array1& array) + Plugin::SystemInt32Array1Iterator end(System::Array1& array) { return Plugin::SystemInt32Array1Iterator(array, array.GetLength() - 1); } @@ -14607,13 +16866,13 @@ namespace System namespace Plugin { - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0) { Handle = handle; Index0 = index0; } - void ArrayElementProxy1_1::operator=(float item) + void ArrayElementProxy1_1::operator=(System::Single item) { Plugin::SystemSingleArray1SetItem1(Handle, Index0, item); if (Plugin::unhandledCsharpException) @@ -14625,7 +16884,7 @@ namespace Plugin } } - ArrayElementProxy1_1::operator float() + ArrayElementProxy1_1::operator System::Single() { auto returnValue = Plugin::SystemSingleArray1GetItem1(Handle, Index0); if (Plugin::unhandledCsharpException) @@ -14641,28 +16900,28 @@ namespace Plugin namespace Plugin { - ArrayElementProxy1_2::ArrayElementProxy1_2(Plugin::InternalUse iu, int32_t handle, int32_t index0) + ArrayElementProxy1_2::ArrayElementProxy1_2(Plugin::InternalUse, int32_t handle, int32_t index0) { Handle = handle; Index0 = index0; } - Plugin::ArrayElementProxy2_2 Plugin::ArrayElementProxy1_2::operator[](int32_t index) + Plugin::ArrayElementProxy2_2 Plugin::ArrayElementProxy1_2::operator[](int32_t index) { - return Plugin::ArrayElementProxy2_2(Plugin::InternalUse::Only, Handle, Index0, index); + return Plugin::ArrayElementProxy2_2(Plugin::InternalUse::Only, Handle, Index0, index); } } namespace Plugin { - ArrayElementProxy2_2::ArrayElementProxy2_2(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1) + ArrayElementProxy2_2::ArrayElementProxy2_2(Plugin::InternalUse, int32_t handle, int32_t index0, int32_t index1) { Handle = handle; Index0 = index0; Index1 = index1; } - void ArrayElementProxy2_2::operator=(float item) + void ArrayElementProxy2_2::operator=(System::Single item) { Plugin::SystemSingleArray2SetItem2(Handle, Index0, Index1, item); if (Plugin::unhandledCsharpException) @@ -14674,7 +16933,7 @@ namespace Plugin } } - ArrayElementProxy2_2::operator float() + ArrayElementProxy2_2::operator System::Single() { auto returnValue = Plugin::SystemSingleArray2GetItem2(Handle, Index0, Index1); if (Plugin::unhandledCsharpException) @@ -14690,36 +16949,36 @@ namespace Plugin namespace Plugin { - ArrayElementProxy1_3::ArrayElementProxy1_3(Plugin::InternalUse iu, int32_t handle, int32_t index0) + ArrayElementProxy1_3::ArrayElementProxy1_3(Plugin::InternalUse, int32_t handle, int32_t index0) { Handle = handle; Index0 = index0; } - Plugin::ArrayElementProxy2_3 Plugin::ArrayElementProxy1_3::operator[](int32_t index) + Plugin::ArrayElementProxy2_3 Plugin::ArrayElementProxy1_3::operator[](int32_t index) { - return Plugin::ArrayElementProxy2_3(Plugin::InternalUse::Only, Handle, Index0, index); + return Plugin::ArrayElementProxy2_3(Plugin::InternalUse::Only, Handle, Index0, index); } } namespace Plugin { - ArrayElementProxy2_3::ArrayElementProxy2_3(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1) + ArrayElementProxy2_3::ArrayElementProxy2_3(Plugin::InternalUse, int32_t handle, int32_t index0, int32_t index1) { Handle = handle; Index0 = index0; Index1 = index1; } - Plugin::ArrayElementProxy3_3 Plugin::ArrayElementProxy2_3::operator[](int32_t index) + Plugin::ArrayElementProxy3_3 Plugin::ArrayElementProxy2_3::operator[](int32_t index) { - return Plugin::ArrayElementProxy3_3(Plugin::InternalUse::Only, Handle, Index0, Index1, index); + return Plugin::ArrayElementProxy3_3(Plugin::InternalUse::Only, Handle, Index0, Index1, index); } } namespace Plugin { - ArrayElementProxy3_3::ArrayElementProxy3_3(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1, int32_t index2) + ArrayElementProxy3_3::ArrayElementProxy3_3(Plugin::InternalUse, int32_t handle, int32_t index0, int32_t index1, int32_t index2) { Handle = handle; Index0 = index0; @@ -14727,7 +16986,7 @@ namespace Plugin Index2 = index2; } - void ArrayElementProxy3_3::operator=(float item) + void ArrayElementProxy3_3::operator=(System::Single item) { Plugin::SystemSingleArray3SetItem3(Handle, Index0, Index1, Index2, item); if (Plugin::unhandledCsharpException) @@ -14739,7 +16998,7 @@ namespace Plugin } } - ArrayElementProxy3_3::operator float() + ArrayElementProxy3_3::operator System::Single() { auto returnValue = Plugin::SystemSingleArray3GetItem3(Handle, Index0, Index1, Index2); if (Plugin::unhandledCsharpException) @@ -14755,28 +17014,28 @@ namespace Plugin namespace System { - Array1::Array1(decltype(nullptr)) + Array1::Array1(decltype(nullptr)) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) , System::Collections::IList(nullptr) , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { this->InternalLength = 0; } - Array1::Array1(Plugin::InternalUse iu, int32_t handle) + Array1::Array1(Plugin::InternalUse, int32_t handle) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) , System::Collections::IList(nullptr) , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { Handle = handle; if (handle) @@ -14786,13 +17045,13 @@ namespace System this->InternalLength = 0; } - Array1::Array1(const Array1& other) + Array1::Array1(const Array1& other) : Array1(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; } - Array1::Array1(Array1&& other) + Array1::Array1(Array1&& other) : Array1(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; @@ -14800,7 +17059,7 @@ namespace System other.InternalLength = 0; } - Array1::~Array1() + Array1::~Array1() { if (Handle) { @@ -14809,7 +17068,7 @@ namespace System } } - Array1& Array1::operator=(const Array1& other) + Array1& Array1::operator=(const Array1& other) { if (this->Handle) { @@ -14824,7 +17083,7 @@ namespace System return *this; } - Array1& Array1::operator=(decltype(nullptr)) + Array1& Array1::operator=(decltype(nullptr)) { if (Handle) { @@ -14834,7 +17093,7 @@ namespace System return *this; } - Array1& Array1::operator=(Array1&& other) + Array1& Array1::operator=(Array1&& other) { if (Handle) { @@ -14847,25 +17106,25 @@ namespace System return *this; } - bool Array1::operator==(const Array1& other) const + bool Array1::operator==(const Array1& other) const { return Handle == other.Handle; } - bool Array1::operator!=(const Array1& other) const + bool Array1::operator!=(const Array1& other) const { return Handle != other.Handle; } - Array1::Array1(int32_t length0) + Array1::Array1(System::Int32 length0) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) , System::Collections::IList(nullptr) , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) + , System::Collections::Generic::IEnumerable(nullptr) + , System::Collections::Generic::ICollection(nullptr) + , System::Collections::Generic::IList(nullptr) { auto returnValue = Plugin::SystemSystemSingleArray1Constructor1(length0); if (Plugin::unhandledCsharpException) @@ -14883,7 +17142,7 @@ namespace System } } - int32_t Array1::GetLength() + System::Int32 Array1::GetLength() { int32_t returnVal = InternalLength; if (returnVal == 0) @@ -14894,20 +17153,20 @@ namespace System return returnVal; } - int32_t Array1::GetRank() + System::Int32 Array1::GetRank() { return 1; } - Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) + Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) { - return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); + return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); } } namespace Plugin { - SystemSingleArray1Iterator::SystemSingleArray1Iterator(System::Array1& array, int32_t index) + SystemSingleArray1Iterator::SystemSingleArray1Iterator(System::Array1& array, int32_t index) : array(array) , index(index) { @@ -14924,7 +17183,7 @@ namespace Plugin return index != other.index; } - float SystemSingleArray1Iterator::operator*() + System::Single SystemSingleArray1Iterator::operator*() { return array[index]; } @@ -14932,12 +17191,12 @@ namespace Plugin namespace System { - Plugin::SystemSingleArray1Iterator begin(System::Array1& array) + Plugin::SystemSingleArray1Iterator begin(System::Array1& array) { return Plugin::SystemSingleArray1Iterator(array, 0); } - Plugin::SystemSingleArray1Iterator end(System::Array1& array) + Plugin::SystemSingleArray1Iterator end(System::Array1& array) { return Plugin::SystemSingleArray1Iterator(array, array.GetLength() - 1); } @@ -14945,7 +17204,7 @@ namespace System namespace System { - Array2::Array2(decltype(nullptr)) + Array2::Array2(decltype(nullptr)) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -14957,7 +17216,7 @@ namespace System this->InternalLengths[1] = 0; } - Array2::Array2(Plugin::InternalUse iu, int32_t handle) + Array2::Array2(Plugin::InternalUse, int32_t handle) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -14974,7 +17233,7 @@ namespace System this->InternalLengths[1] = 0; } - Array2::Array2(const Array2& other) + Array2::Array2(const Array2& other) : Array2(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; @@ -14982,7 +17241,7 @@ namespace System InternalLengths[1] = other.InternalLengths[1]; } - Array2::Array2(Array2&& other) + Array2::Array2(Array2&& other) : Array2(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; @@ -14994,7 +17253,7 @@ namespace System other.InternalLengths[1] = 0; } - Array2::~Array2() + Array2::~Array2() { if (Handle) { @@ -15003,7 +17262,7 @@ namespace System } } - Array2& Array2::operator=(const Array2& other) + Array2& Array2::operator=(const Array2& other) { if (this->Handle) { @@ -15020,7 +17279,7 @@ namespace System return *this; } - Array2& Array2::operator=(decltype(nullptr)) + Array2& Array2::operator=(decltype(nullptr)) { if (Handle) { @@ -15030,7 +17289,7 @@ namespace System return *this; } - Array2& Array2::operator=(Array2&& other) + Array2& Array2::operator=(Array2&& other) { if (Handle) { @@ -15047,17 +17306,17 @@ namespace System return *this; } - bool Array2::operator==(const Array2& other) const + bool Array2::operator==(const Array2& other) const { return Handle == other.Handle; } - bool Array2::operator!=(const Array2& other) const + bool Array2::operator!=(const Array2& other) const { return Handle != other.Handle; } - Array2::Array2(int32_t length0, int32_t length1) + Array2::Array2(System::Int32 length0, System::Int32 length1) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -15082,7 +17341,7 @@ namespace System } } - int32_t Array2::GetLength() + System::Int32 Array2::GetLength() { int32_t returnVal = InternalLength; if (returnVal == 0) @@ -15093,7 +17352,7 @@ namespace System return returnVal; } - int32_t Array2::GetLength(int32_t dimension) + System::Int32 Array2::GetLength(System::Int32 dimension) { assert(dimension >= 0 && dimension < 2); int32_t length = InternalLengths[dimension]; @@ -15113,20 +17372,20 @@ namespace System return returnValue; } - int32_t Array2::GetRank() + System::Int32 Array2::GetRank() { return 2; } - Plugin::ArrayElementProxy1_2 System::Array2::operator[](int32_t index) + Plugin::ArrayElementProxy1_2 System::Array2::operator[](int32_t index) { - return Plugin::ArrayElementProxy1_2(Plugin::InternalUse::Only, Handle, index); + return Plugin::ArrayElementProxy1_2(Plugin::InternalUse::Only, Handle, index); } } namespace System { - Array3::Array3(decltype(nullptr)) + Array3::Array3(decltype(nullptr)) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -15139,7 +17398,7 @@ namespace System this->InternalLengths[2] = 0; } - Array3::Array3(Plugin::InternalUse iu, int32_t handle) + Array3::Array3(Plugin::InternalUse, int32_t handle) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -15157,7 +17416,7 @@ namespace System this->InternalLengths[2] = 0; } - Array3::Array3(const Array3& other) + Array3::Array3(const Array3& other) : Array3(Plugin::InternalUse::Only, other.Handle) { InternalLength = other.InternalLength; @@ -15166,7 +17425,7 @@ namespace System InternalLengths[2] = other.InternalLengths[2]; } - Array3::Array3(Array3&& other) + Array3::Array3(Array3&& other) : Array3(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; @@ -15180,7 +17439,7 @@ namespace System other.InternalLengths[2] = 0; } - Array3::~Array3() + Array3::~Array3() { if (Handle) { @@ -15189,7 +17448,7 @@ namespace System } } - Array3& Array3::operator=(const Array3& other) + Array3& Array3::operator=(const Array3& other) { if (this->Handle) { @@ -15207,7 +17466,7 @@ namespace System return *this; } - Array3& Array3::operator=(decltype(nullptr)) + Array3& Array3::operator=(decltype(nullptr)) { if (Handle) { @@ -15217,7 +17476,7 @@ namespace System return *this; } - Array3& Array3::operator=(Array3&& other) + Array3& Array3::operator=(Array3&& other) { if (Handle) { @@ -15236,17 +17495,17 @@ namespace System return *this; } - bool Array3::operator==(const Array3& other) const + bool Array3::operator==(const Array3& other) const { return Handle == other.Handle; } - bool Array3::operator!=(const Array3& other) const + bool Array3::operator!=(const Array3& other) const { return Handle != other.Handle; } - Array3::Array3(int32_t length0, int32_t length1, int32_t length2) + Array3::Array3(System::Int32 length0, System::Int32 length1, System::Int32 length2) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -15272,7 +17531,7 @@ namespace System } } - int32_t Array3::GetLength() + System::Int32 Array3::GetLength() { int32_t returnVal = InternalLength; if (returnVal == 0) @@ -15283,7 +17542,7 @@ namespace System return returnVal; } - int32_t Array3::GetLength(int32_t dimension) + System::Int32 Array3::GetLength(System::Int32 dimension) { assert(dimension >= 0 && dimension < 3); int32_t length = InternalLengths[dimension]; @@ -15303,20 +17562,20 @@ namespace System return returnValue; } - int32_t Array3::GetRank() + System::Int32 Array3::GetRank() { return 3; } - Plugin::ArrayElementProxy1_3 System::Array3::operator[](int32_t index) + Plugin::ArrayElementProxy1_3 System::Array3::operator[](int32_t index) { - return Plugin::ArrayElementProxy1_3(Plugin::InternalUse::Only, Handle, index); + return Plugin::ArrayElementProxy1_3(Plugin::InternalUse::Only, Handle, index); } } namespace Plugin { - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0) { Handle = handle; Index0 = index0; @@ -15363,7 +17622,7 @@ namespace System this->InternalLength = 0; } - Array1::Array1(Plugin::InternalUse iu, int32_t handle) + Array1::Array1(Plugin::InternalUse, int32_t handle) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -15452,7 +17711,7 @@ namespace System return Handle != other.Handle; } - Array1::Array1(int32_t length0) + Array1::Array1(System::Int32 length0) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -15478,7 +17737,7 @@ namespace System } } - int32_t Array1::GetLength() + System::Int32 Array1::GetLength() { int32_t returnVal = InternalLength; if (returnVal == 0) @@ -15489,7 +17748,7 @@ namespace System return returnVal; } - int32_t Array1::GetRank() + System::Int32 Array1::GetRank() { return 1; } @@ -15540,7 +17799,7 @@ namespace System namespace Plugin { - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0) { Handle = handle; Index0 = index0; @@ -15587,7 +17846,7 @@ namespace System this->InternalLength = 0; } - Array1::Array1(Plugin::InternalUse iu, int32_t handle) + Array1::Array1(Plugin::InternalUse, int32_t handle) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -15676,7 +17935,7 @@ namespace System return Handle != other.Handle; } - Array1::Array1(int32_t length0) + Array1::Array1(System::Int32 length0) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -15702,7 +17961,7 @@ namespace System } } - int32_t Array1::GetLength() + System::Int32 Array1::GetLength() { int32_t returnVal = InternalLength; if (returnVal == 0) @@ -15713,7 +17972,7 @@ namespace System return returnVal; } - int32_t Array1::GetRank() + System::Int32 Array1::GetRank() { return 1; } @@ -15764,7 +18023,7 @@ namespace System namespace Plugin { - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0) { Handle = handle; Index0 = index0; @@ -15811,7 +18070,7 @@ namespace System this->InternalLength = 0; } - Array1::Array1(Plugin::InternalUse iu, int32_t handle) + Array1::Array1(Plugin::InternalUse, int32_t handle) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -15900,7 +18159,7 @@ namespace System return Handle != other.Handle; } - Array1::Array1(int32_t length0) + Array1::Array1(System::Int32 length0) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -15926,7 +18185,7 @@ namespace System } } - int32_t Array1::GetLength() + System::Int32 Array1::GetLength() { int32_t returnVal = InternalLength; if (returnVal == 0) @@ -15937,7 +18196,7 @@ namespace System return returnVal; } - int32_t Array1::GetRank() + System::Int32 Array1::GetRank() { return 1; } @@ -15988,7 +18247,7 @@ namespace System namespace Plugin { - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0) + ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0) { Handle = handle; Index0 = index0; @@ -16035,7 +18294,7 @@ namespace System this->InternalLength = 0; } - Array1::Array1(Plugin::InternalUse iu, int32_t handle) + Array1::Array1(Plugin::InternalUse, int32_t handle) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -16124,7 +18383,7 @@ namespace System return Handle != other.Handle; } - Array1::Array1(int32_t length0) + Array1::Array1(System::Int32 length0) : System::ICloneable(nullptr) , System::Collections::IEnumerable(nullptr) , System::Collections::ICollection(nullptr) @@ -16150,7 +18409,7 @@ namespace System } } - int32_t Array1::GetLength() + System::Int32 Array1::GetLength() { int32_t returnVal = InternalLength; if (returnVal == 0) @@ -16161,7 +18420,7 @@ namespace System return returnVal; } - int32_t Array1::GetRank() + System::Int32 Array1::GetRank() { return 1; } @@ -16215,10 +18474,10 @@ namespace System Action::Action() { CppHandle = Plugin::StoreSystemAction(this); - int32_t* handle = &Handle; + System::Int32* handle = (System::Int32*)&Handle; int32_t cppHandle = CppHandle; - int32_t* classHandle = &ClassHandle; - Plugin::SystemActionConstructor(cppHandle, handle, classHandle); + System::Int32* classHandle = (System::Int32*)&ClassHandle; + Plugin::SystemActionConstructor(cppHandle, &handle->Value, &classHandle->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -16272,7 +18531,7 @@ namespace System other.ClassHandle = 0; } - Action::Action(Plugin::InternalUse iu, int32_t handle) + Action::Action(Plugin::InternalUse, int32_t handle) { Handle = handle; CppHandle = Plugin::StoreSystemAction(this); @@ -16447,13 +18706,13 @@ namespace System namespace System { - Action1::Action1() + Action1::Action1() { CppHandle = Plugin::StoreSystemActionSystemSingle(this); - int32_t* handle = &Handle; + System::Int32* handle = (System::Int32*)&Handle; int32_t cppHandle = CppHandle; - int32_t* classHandle = &ClassHandle; - Plugin::SystemActionSystemSingleConstructor(cppHandle, handle, classHandle); + System::Int32* classHandle = (System::Int32*)&ClassHandle; + Plugin::SystemActionSystemSingleConstructor(cppHandle, &handle->Value, &classHandle->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -16480,13 +18739,13 @@ namespace System } } - Action1::Action1(decltype(nullptr)) + Action1::Action1(decltype(nullptr)) { CppHandle = Plugin::StoreSystemActionSystemSingle(this); ClassHandle = 0; } - Action1::Action1(const Action1& other) + Action1::Action1(const Action1& other) { Handle = other.Handle; CppHandle = Plugin::StoreSystemActionSystemSingle(this); @@ -16497,7 +18756,7 @@ namespace System ClassHandle = other.ClassHandle; } - Action1::Action1(Action1&& other) + Action1::Action1(Action1&& other) { Handle = other.Handle; CppHandle = other.CppHandle; @@ -16507,7 +18766,7 @@ namespace System other.ClassHandle = 0; } - Action1::Action1(Plugin::InternalUse iu, int32_t handle) + Action1::Action1(Plugin::InternalUse, int32_t handle) { Handle = handle; CppHandle = Plugin::StoreSystemActionSystemSingle(this); @@ -16518,7 +18777,7 @@ namespace System ClassHandle = 0; } - Action1::~Action1() + Action1::~Action1() { Plugin::RemoveSystemActionSystemSingle(CppHandle); CppHandle = 0; @@ -16542,7 +18801,7 @@ namespace System } } - Action1& Action1::operator=(const Action1& other) + Action1& Action1::operator=(const Action1& other) { if (this->Handle) { @@ -16557,7 +18816,7 @@ namespace System return *this; } - Action1& Action1::operator=(decltype(nullptr)) + Action1& Action1::operator=(decltype(nullptr)) { if (Handle) { @@ -16582,7 +18841,7 @@ namespace System return *this; } - Action1& Action1::operator=(Action1&& other) + Action1& Action1::operator=(Action1&& other) { Plugin::RemoveSystemActionSystemSingle(CppHandle); CppHandle = 0; @@ -16611,17 +18870,17 @@ namespace System return *this; } - bool Action1::operator==(const Action1& other) const + bool Action1::operator==(const Action1& other) const { return Handle == other.Handle; } - bool Action1::operator!=(const Action1& other) const + bool Action1::operator!=(const Action1& other) const { return Handle != other.Handle; } - void Action1::operator+=(System::Action1& del) + void Action1::operator+=(System::Action1& del) { Plugin::SystemActionSystemSingleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -16633,7 +18892,7 @@ namespace System } } - void Action1::operator-=(System::Action1& del) + void Action1::operator-=(System::Action1& del) { Plugin::SystemActionSystemSingleRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -16645,7 +18904,7 @@ namespace System } } - void Action1::operator()(float obj) + void Action1::operator()(System::Single obj) { } @@ -16661,13 +18920,13 @@ namespace System } catch (...) { - System::String msg = "Unhandled exception invoking System::Action1"; + System::String msg = "Unhandled exception invoking System::Action1"; System::Exception ex(msg); Plugin::SetException(ex.Handle); } } - void Action1::Invoke(float obj) + void Action1::Invoke(System::Single obj) { Plugin::SystemActionSystemSingleInvoke(Handle, obj); if (Plugin::unhandledCsharpException) @@ -16682,13 +18941,13 @@ namespace System namespace System { - Action2::Action2() + Action2::Action2() { CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); - int32_t* handle = &Handle; + System::Int32* handle = (System::Int32*)&Handle; int32_t cppHandle = CppHandle; - int32_t* classHandle = &ClassHandle; - Plugin::SystemActionSystemSingle_SystemSingleConstructor(cppHandle, handle, classHandle); + System::Int32* classHandle = (System::Int32*)&ClassHandle; + Plugin::SystemActionSystemSingle_SystemSingleConstructor(cppHandle, &handle->Value, &classHandle->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -16715,13 +18974,13 @@ namespace System } } - Action2::Action2(decltype(nullptr)) + Action2::Action2(decltype(nullptr)) { CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); ClassHandle = 0; } - Action2::Action2(const Action2& other) + Action2::Action2(const Action2& other) { Handle = other.Handle; CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); @@ -16732,7 +18991,7 @@ namespace System ClassHandle = other.ClassHandle; } - Action2::Action2(Action2&& other) + Action2::Action2(Action2&& other) { Handle = other.Handle; CppHandle = other.CppHandle; @@ -16742,7 +19001,7 @@ namespace System other.ClassHandle = 0; } - Action2::Action2(Plugin::InternalUse iu, int32_t handle) + Action2::Action2(Plugin::InternalUse, int32_t handle) { Handle = handle; CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); @@ -16753,7 +19012,7 @@ namespace System ClassHandle = 0; } - Action2::~Action2() + Action2::~Action2() { Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); CppHandle = 0; @@ -16777,7 +19036,7 @@ namespace System } } - Action2& Action2::operator=(const Action2& other) + Action2& Action2::operator=(const Action2& other) { if (this->Handle) { @@ -16792,7 +19051,7 @@ namespace System return *this; } - Action2& Action2::operator=(decltype(nullptr)) + Action2& Action2::operator=(decltype(nullptr)) { if (Handle) { @@ -16817,7 +19076,7 @@ namespace System return *this; } - Action2& Action2::operator=(Action2&& other) + Action2& Action2::operator=(Action2&& other) { Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); CppHandle = 0; @@ -16846,17 +19105,17 @@ namespace System return *this; } - bool Action2::operator==(const Action2& other) const + bool Action2::operator==(const Action2& other) const { return Handle == other.Handle; } - bool Action2::operator!=(const Action2& other) const + bool Action2::operator!=(const Action2& other) const { return Handle != other.Handle; } - void Action2::operator+=(System::Action2& del) + void Action2::operator+=(System::Action2& del) { Plugin::SystemActionSystemSingle_SystemSingleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -16868,7 +19127,7 @@ namespace System } } - void Action2::operator-=(System::Action2& del) + void Action2::operator-=(System::Action2& del) { Plugin::SystemActionSystemSingle_SystemSingleRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -16880,7 +19139,7 @@ namespace System } } - void Action2::operator()(float arg1, float arg2) + void Action2::operator()(System::Single arg1, System::Single arg2) { } @@ -16896,13 +19155,13 @@ namespace System } catch (...) { - System::String msg = "Unhandled exception invoking System::Action2"; + System::String msg = "Unhandled exception invoking System::Action2"; System::Exception ex(msg); Plugin::SetException(ex.Handle); } } - void Action2::Invoke(float arg1, float arg2) + void Action2::Invoke(System::Single arg1, System::Single arg2) { Plugin::SystemActionSystemSingle_SystemSingleInvoke(Handle, arg1, arg2); if (Plugin::unhandledCsharpException) @@ -16917,13 +19176,13 @@ namespace System namespace System { - Func3::Func3() + Func3::Func3() { CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); - int32_t* handle = &Handle; + System::Int32* handle = (System::Int32*)&Handle; int32_t cppHandle = CppHandle; - int32_t* classHandle = &ClassHandle; - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(cppHandle, handle, classHandle); + System::Int32* classHandle = (System::Int32*)&ClassHandle; + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(cppHandle, &handle->Value, &classHandle->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -16950,13 +19209,13 @@ namespace System } } - Func3::Func3(decltype(nullptr)) + Func3::Func3(decltype(nullptr)) { CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); ClassHandle = 0; } - Func3::Func3(const Func3& other) + Func3::Func3(const Func3& other) { Handle = other.Handle; CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); @@ -16967,7 +19226,7 @@ namespace System ClassHandle = other.ClassHandle; } - Func3::Func3(Func3&& other) + Func3::Func3(Func3&& other) { Handle = other.Handle; CppHandle = other.CppHandle; @@ -16977,7 +19236,7 @@ namespace System other.ClassHandle = 0; } - Func3::Func3(Plugin::InternalUse iu, int32_t handle) + Func3::Func3(Plugin::InternalUse, int32_t handle) { Handle = handle; CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); @@ -16988,7 +19247,7 @@ namespace System ClassHandle = 0; } - Func3::~Func3() + Func3::~Func3() { Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); CppHandle = 0; @@ -17012,7 +19271,7 @@ namespace System } } - Func3& Func3::operator=(const Func3& other) + Func3& Func3::operator=(const Func3& other) { if (this->Handle) { @@ -17027,7 +19286,7 @@ namespace System return *this; } - Func3& Func3::operator=(decltype(nullptr)) + Func3& Func3::operator=(decltype(nullptr)) { if (Handle) { @@ -17052,7 +19311,7 @@ namespace System return *this; } - Func3& Func3::operator=(Func3&& other) + Func3& Func3::operator=(Func3&& other) { Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); CppHandle = 0; @@ -17081,17 +19340,17 @@ namespace System return *this; } - bool Func3::operator==(const Func3& other) const + bool Func3::operator==(const Func3& other) const { return Handle == other.Handle; } - bool Func3::operator!=(const Func3& other) const + bool Func3::operator!=(const Func3& other) const { return Handle != other.Handle; } - void Func3::operator+=(System::Func3& del) + void Func3::operator+=(System::Func3& del) { Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -17103,7 +19362,7 @@ namespace System } } - void Func3::operator-=(System::Func3& del) + void Func3::operator-=(System::Func3& del) { Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -17115,7 +19374,7 @@ namespace System } } - double Func3::operator()(int32_t arg1, float arg2) + System::Double Func3::operator()(System::Int32 arg1, System::Single arg2) { return {}; } @@ -17133,14 +19392,14 @@ namespace System } catch (...) { - System::String msg = "Unhandled exception invoking System::Func3"; + System::String msg = "Unhandled exception invoking System::Func3"; System::Exception ex(msg); Plugin::SetException(ex.Handle); return {}; } } - double Func3::Invoke(int32_t arg1, float arg2) + System::Double Func3::Invoke(System::Int32 arg1, System::Single arg2) { auto returnValue = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(Handle, arg1, arg2); if (Plugin::unhandledCsharpException) @@ -17156,13 +19415,13 @@ namespace System namespace System { - Func3::Func3() + Func3::Func3() { CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); - int32_t* handle = &Handle; + System::Int32* handle = (System::Int32*)&Handle; int32_t cppHandle = CppHandle; - int32_t* classHandle = &ClassHandle; - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(cppHandle, handle, classHandle); + System::Int32* classHandle = (System::Int32*)&ClassHandle; + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(cppHandle, &handle->Value, &classHandle->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -17189,13 +19448,13 @@ namespace System } } - Func3::Func3(decltype(nullptr)) + Func3::Func3(decltype(nullptr)) { CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); ClassHandle = 0; } - Func3::Func3(const Func3& other) + Func3::Func3(const Func3& other) { Handle = other.Handle; CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); @@ -17206,7 +19465,7 @@ namespace System ClassHandle = other.ClassHandle; } - Func3::Func3(Func3&& other) + Func3::Func3(Func3&& other) { Handle = other.Handle; CppHandle = other.CppHandle; @@ -17216,7 +19475,7 @@ namespace System other.ClassHandle = 0; } - Func3::Func3(Plugin::InternalUse iu, int32_t handle) + Func3::Func3(Plugin::InternalUse, int32_t handle) { Handle = handle; CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); @@ -17227,7 +19486,7 @@ namespace System ClassHandle = 0; } - Func3::~Func3() + Func3::~Func3() { Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); CppHandle = 0; @@ -17251,7 +19510,7 @@ namespace System } } - Func3& Func3::operator=(const Func3& other) + Func3& Func3::operator=(const Func3& other) { if (this->Handle) { @@ -17266,7 +19525,7 @@ namespace System return *this; } - Func3& Func3::operator=(decltype(nullptr)) + Func3& Func3::operator=(decltype(nullptr)) { if (Handle) { @@ -17291,7 +19550,7 @@ namespace System return *this; } - Func3& Func3::operator=(Func3&& other) + Func3& Func3::operator=(Func3&& other) { Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); CppHandle = 0; @@ -17320,17 +19579,17 @@ namespace System return *this; } - bool Func3::operator==(const Func3& other) const + bool Func3::operator==(const Func3& other) const { return Handle == other.Handle; } - bool Func3::operator!=(const Func3& other) const + bool Func3::operator!=(const Func3& other) const { return Handle != other.Handle; } - void Func3::operator+=(System::Func3& del) + void Func3::operator+=(System::Func3& del) { Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -17342,7 +19601,7 @@ namespace System } } - void Func3::operator-=(System::Func3& del) + void Func3::operator-=(System::Func3& del) { Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove(Handle, del.Handle); if (Plugin::unhandledCsharpException) @@ -17354,7 +19613,7 @@ namespace System } } - System::String Func3::operator()(int16_t arg1, int32_t arg2) + System::String Func3::operator()(System::Int16 arg1, System::Int32 arg2) { return nullptr; } @@ -17372,14 +19631,14 @@ namespace System } catch (...) { - System::String msg = "Unhandled exception invoking System::Func3"; + System::String msg = "Unhandled exception invoking System::Func3"; System::Exception ex(msg); Plugin::SetException(ex.Handle); return {}; } } - System::String Func3::Invoke(int16_t arg1, int32_t arg2) + System::String Func3::Invoke(System::Int16 arg1, System::Int32 arg2) { auto returnValue = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(Handle, arg1, arg2); if (Plugin::unhandledCsharpException) @@ -17398,10 +19657,10 @@ namespace System AppDomainInitializer::AppDomainInitializer() { CppHandle = Plugin::StoreSystemAppDomainInitializer(this); - int32_t* handle = &Handle; + System::Int32* handle = (System::Int32*)&Handle; int32_t cppHandle = CppHandle; - int32_t* classHandle = &ClassHandle; - Plugin::SystemAppDomainInitializerConstructor(cppHandle, handle, classHandle); + System::Int32* classHandle = (System::Int32*)&ClassHandle; + Plugin::SystemAppDomainInitializerConstructor(cppHandle, &handle->Value, &classHandle->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -17455,7 +19714,7 @@ namespace System other.ClassHandle = 0; } - AppDomainInitializer::AppDomainInitializer(Plugin::InternalUse iu, int32_t handle) + AppDomainInitializer::AppDomainInitializer(Plugin::InternalUse, int32_t handle) { Handle = handle; CppHandle = Plugin::StoreSystemAppDomainInitializer(this); @@ -17636,10 +19895,10 @@ namespace UnityEngine UnityAction::UnityAction() { CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); - int32_t* handle = &Handle; + System::Int32* handle = (System::Int32*)&Handle; int32_t cppHandle = CppHandle; - int32_t* classHandle = &ClassHandle; - Plugin::UnityEngineEventsUnityActionConstructor(cppHandle, handle, classHandle); + System::Int32* classHandle = (System::Int32*)&ClassHandle; + Plugin::UnityEngineEventsUnityActionConstructor(cppHandle, &handle->Value, &classHandle->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -17693,7 +19952,7 @@ namespace UnityEngine other.ClassHandle = 0; } - UnityAction::UnityAction(Plugin::InternalUse iu, int32_t handle) + UnityAction::UnityAction(Plugin::InternalUse, int32_t handle) { Handle = handle; CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); @@ -17874,10 +20133,10 @@ namespace UnityEngine UnityAction2::UnityAction2() { CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); - int32_t* handle = &Handle; + System::Int32* handle = (System::Int32*)&Handle; int32_t cppHandle = CppHandle; - int32_t* classHandle = &ClassHandle; - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor(cppHandle, handle, classHandle); + System::Int32* classHandle = (System::Int32*)&ClassHandle; + Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor(cppHandle, &handle->Value, &classHandle->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -17931,7 +20190,7 @@ namespace UnityEngine other.ClassHandle = 0; } - UnityAction2::UnityAction2(Plugin::InternalUse iu, int32_t handle) + UnityAction2::UnityAction2(Plugin::InternalUse, int32_t handle) { Handle = handle; CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); @@ -18115,10 +20374,10 @@ namespace System ComponentEventHandler::ComponentEventHandler() { CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); - int32_t* handle = &Handle; + System::Int32* handle = (System::Int32*)&Handle; int32_t cppHandle = CppHandle; - int32_t* classHandle = &ClassHandle; - Plugin::SystemComponentModelDesignComponentEventHandlerConstructor(cppHandle, handle, classHandle); + System::Int32* classHandle = (System::Int32*)&ClassHandle; + Plugin::SystemComponentModelDesignComponentEventHandlerConstructor(cppHandle, &handle->Value, &classHandle->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -18172,7 +20431,7 @@ namespace System other.ClassHandle = 0; } - ComponentEventHandler::ComponentEventHandler(Plugin::InternalUse iu, int32_t handle) + ComponentEventHandler::ComponentEventHandler(Plugin::InternalUse, int32_t handle) { Handle = handle; CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); @@ -18358,10 +20617,10 @@ namespace System ComponentChangingEventHandler::ComponentChangingEventHandler() { CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); - int32_t* handle = &Handle; + System::Int32* handle = (System::Int32*)&Handle; int32_t cppHandle = CppHandle; - int32_t* classHandle = &ClassHandle; - Plugin::SystemComponentModelDesignComponentChangingEventHandlerConstructor(cppHandle, handle, classHandle); + System::Int32* classHandle = (System::Int32*)&ClassHandle; + Plugin::SystemComponentModelDesignComponentChangingEventHandlerConstructor(cppHandle, &handle->Value, &classHandle->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -18415,7 +20674,7 @@ namespace System other.ClassHandle = 0; } - ComponentChangingEventHandler::ComponentChangingEventHandler(Plugin::InternalUse iu, int32_t handle) + ComponentChangingEventHandler::ComponentChangingEventHandler(Plugin::InternalUse, int32_t handle) { Handle = handle; CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); @@ -18601,10 +20860,10 @@ namespace System ComponentChangedEventHandler::ComponentChangedEventHandler() { CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); - int32_t* handle = &Handle; + System::Int32* handle = (System::Int32*)&Handle; int32_t cppHandle = CppHandle; - int32_t* classHandle = &ClassHandle; - Plugin::SystemComponentModelDesignComponentChangedEventHandlerConstructor(cppHandle, handle, classHandle); + System::Int32* classHandle = (System::Int32*)&ClassHandle; + Plugin::SystemComponentModelDesignComponentChangedEventHandlerConstructor(cppHandle, &handle->Value, &classHandle->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -18658,7 +20917,7 @@ namespace System other.ClassHandle = 0; } - ComponentChangedEventHandler::ComponentChangedEventHandler(Plugin::InternalUse iu, int32_t handle) + ComponentChangedEventHandler::ComponentChangedEventHandler(Plugin::InternalUse, int32_t handle) { Handle = handle; CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); @@ -18844,10 +21103,10 @@ namespace System ComponentRenameEventHandler::ComponentRenameEventHandler() { CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); - int32_t* handle = &Handle; + System::Int32* handle = (System::Int32*)&Handle; int32_t cppHandle = CppHandle; - int32_t* classHandle = &ClassHandle; - Plugin::SystemComponentModelDesignComponentRenameEventHandlerConstructor(cppHandle, handle, classHandle); + System::Int32* classHandle = (System::Int32*)&ClassHandle; + Plugin::SystemComponentModelDesignComponentRenameEventHandlerConstructor(cppHandle, &handle->Value, &classHandle->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -18901,7 +21160,7 @@ namespace System other.ClassHandle = 0; } - ComponentRenameEventHandler::ComponentRenameEventHandler(Plugin::InternalUse iu, int32_t handle) + ComponentRenameEventHandler::ComponentRenameEventHandler(Plugin::InternalUse, int32_t handle) { Handle = handle; CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); @@ -19137,9 +21396,10 @@ DLLEXPORT void Init( int32_t (*enumerableGetEnumerator)(int32_t handle), /*BEGIN INIT PARAMS*/ int32_t maxManagedObjects, + System::Int32 (*systemIComparableMethodCompareToSystemObject)(int32_t thisHandle, int32_t objHandle), void (*systemIDisposableMethodDispose)(int32_t thisHandle), UnityEngine::Vector3 (*unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z), - float (*unityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz), + System::Single (*unityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz), void (*unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ), UnityEngine::Vector3 (*unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b), UnityEngine::Vector3 (*unityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a), @@ -19158,11 +21418,12 @@ DLLEXPORT void Init( int32_t (*boxGradientColorKey)(UnityEngine::GradientColorKey& val), UnityEngine::GradientColorKey (*unboxGradientColorKey)(int32_t valHandle), void (*releaseUnityEngineResolution)(int32_t handle), - int32_t (*unityEngineResolutionPropertyGetWidth)(int32_t thisHandle), + int32_t (*unityEngineResolutionConstructor)(), + System::Int32 (*unityEngineResolutionPropertyGetWidth)(int32_t thisHandle), void (*unityEngineResolutionPropertySetWidth)(int32_t thisHandle, int32_t value), - int32_t (*unityEngineResolutionPropertyGetHeight)(int32_t thisHandle), + System::Int32 (*unityEngineResolutionPropertyGetHeight)(int32_t thisHandle), void (*unityEngineResolutionPropertySetHeight)(int32_t thisHandle, int32_t value), - int32_t (*unityEngineResolutionPropertyGetRefreshRate)(int32_t thisHandle), + System::Int32 (*unityEngineResolutionPropertyGetRefreshRate)(int32_t thisHandle), void (*unityEngineResolutionPropertySetRefreshRate)(int32_t thisHandle, int32_t value), int32_t (*boxResolution)(int32_t valHandle), int32_t (*unboxResolution)(int32_t valHandle), @@ -19174,27 +21435,15 @@ DLLEXPORT void Init( int32_t (*unboxRaycastHit)(int32_t valHandle), int32_t (*systemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle), int32_t (*systemCollectionsIEnumeratorMethodMoveNext)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent)(int32_t thisHandle), - float (*systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent)(int32_t thisHandle), - UnityEngine::GradientColorKey (*systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator)(int32_t thisHandle), void (*releaseUnityEnginePlayablesPlayableGraph)(int32_t handle), int32_t (*boxPlayableGraph)(int32_t valHandle), int32_t (*unboxPlayableGraph)(int32_t valHandle), void (*releaseUnityEngineAnimationsAnimationMixerPlayable)(int32_t handle), - int32_t (*unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)(int32_t graphHandle, int32_t inputCount, System::Boolean normalizeWeights), + int32_t (*unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)(int32_t graphHandle, int32_t inputCount, uint32_t normalizeWeights), int32_t (*boxAnimationMixerPlayable)(int32_t valHandle), int32_t (*unboxAnimationMixerPlayable)(int32_t valHandle), int32_t (*systemDiagnosticsStopwatchConstructor)(), - int64_t (*systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle), + System::Int64 (*systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle), void (*systemDiagnosticsStopwatchMethodStart)(int32_t thisHandle), void (*systemDiagnosticsStopwatchMethodReset)(int32_t thisHandle), int32_t (*unityEngineGameObjectConstructor)(), @@ -19205,7 +21454,7 @@ DLLEXPORT void Init( int32_t (*unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)(UnityEngine::PrimitiveType type), void (*unityEngineDebugMethodLogSystemObject)(int32_t messageHandle), int32_t (*unityEngineAssertionsAssertFieldGetRaiseExceptions)(), - void (*unityEngineAssertionsAssertFieldSetRaiseExceptions)(System::Boolean value), + void (*unityEngineAssertionsAssertFieldSetRaiseExceptions)(uint32_t value), void (*unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString)(int32_t expectedHandle, int32_t actualHandle), void (*unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject)(int32_t expectedHandle, int32_t actualHandle), int32_t (*unityEngineMonoBehaviourPropertyGetTransform)(int32_t thisHandle), @@ -19214,7 +21463,7 @@ DLLEXPORT void Init( void (*unityEngineNetworkingNetworkTransportMethodInit)(), int32_t (*boxQuaternion)(UnityEngine::Quaternion& val), UnityEngine::Quaternion (*unboxQuaternion)(int32_t valHandle), - float (*unityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column), + System::Single (*unityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column), void (*unityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value), int32_t (*boxMatrix4x4)(UnityEngine::Matrix4x4& val), UnityEngine::Matrix4x4 (*unboxMatrix4x4)(int32_t valHandle), @@ -19223,19 +21472,9 @@ DLLEXPORT void Init( void (*releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)(int32_t handle), int32_t (*systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble)(int32_t keyHandle, double value), int32_t (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)(int32_t thisHandle), - double (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle), + System::Double (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle), int32_t (*boxKeyValuePairSystemString_SystemDouble)(int32_t valHandle), int32_t (*unboxKeyValuePairSystemString_SystemDouble)(int32_t valHandle), - int32_t (*systemCollectionsGenericListSystemStringConstructor)(), - int32_t (*systemCollectionsGenericListSystemStringPropertyGetItem)(int32_t thisHandle, int32_t index), - void (*systemCollectionsGenericListSystemStringPropertySetItem)(int32_t thisHandle, int32_t index, int32_t valueHandle), - void (*systemCollectionsGenericListSystemStringMethodAddSystemString)(int32_t thisHandle, int32_t itemHandle), - void (*systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle), - int32_t (*systemCollectionsGenericListSystemInt32Constructor)(), - int32_t (*systemCollectionsGenericListSystemInt32PropertyGetItem)(int32_t thisHandle, int32_t index), - void (*systemCollectionsGenericListSystemInt32PropertySetItem)(int32_t thisHandle, int32_t index, int32_t value), - void (*systemCollectionsGenericListSystemInt32MethodAddSystemInt32)(int32_t thisHandle, int32_t item), - void (*systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle), int32_t (*systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)(int32_t valueHandle), int32_t (*systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue)(int32_t thisHandle), void (*systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue)(int32_t thisHandle, int32_t valueHandle), @@ -19248,7 +21487,7 @@ DLLEXPORT void Init( int32_t (*unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction), int32_t (*boxRay)(int32_t valHandle), int32_t (*unboxRay)(int32_t valHandle), - int32_t (*unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1)(int32_t rayHandle, int32_t resultsHandle), + System::Int32 (*unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1)(int32_t rayHandle, int32_t resultsHandle), int32_t (*unityEnginePhysicsMethodRaycastAllUnityEngineRay)(int32_t rayHandle), int32_t (*unityEngineGradientConstructor)(), int32_t (*unityEngineGradientPropertyGetColorKeys)(int32_t thisHandle), @@ -19267,7 +21506,7 @@ DLLEXPORT void Init( UnityEngine::SceneManagement::LoadSceneMode (*unboxLoadSceneMode)(int32_t valHandle), int32_t (*boxPrimitiveType)(UnityEngine::PrimitiveType val), UnityEngine::PrimitiveType (*unboxPrimitiveType)(int32_t valHandle), - float (*unityEngineTimePropertyGetDeltaTime)(), + System::Single (*unityEngineTimePropertyGetDeltaTime)(), int32_t (*boxFileMode)(System::IO::FileMode val), System::IO::FileMode (*unboxFileMode)(int32_t valHandle), void (*releaseSystemCollectionsGenericBaseIComparerSystemInt32)(int32_t handle), @@ -19276,7 +21515,7 @@ DLLEXPORT void Init( void (*systemCollectionsGenericBaseIComparerSystemStringConstructor)(int32_t cppHandle, int32_t* handle), void (*releaseSystemBaseStringComparer)(int32_t handle), void (*systemBaseStringComparerConstructor)(int32_t cppHandle, int32_t* handle), - int32_t (*systemCollectionsQueuePropertyGetCount)(int32_t thisHandle), + System::Int32 (*systemCollectionsQueuePropertyGetCount)(int32_t thisHandle), void (*releaseSystemCollectionsBaseQueue)(int32_t handle), void (*systemCollectionsBaseQueueConstructor)(int32_t cppHandle, int32_t* handle), void (*releaseSystemComponentModelDesignBaseIComponentChangeService)(int32_t handle), @@ -19288,6 +21527,8 @@ DLLEXPORT void Init( void (*releaseUnityEnginePlayablesPlayableHandle)(int32_t handle), int32_t (*boxPlayableHandle)(int32_t valHandle), int32_t (*unboxPlayableHandle)(int32_t valHandle), + int32_t (*systemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator)(int32_t thisHandle), int32_t (*unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1)(int32_t eHandle, int32_t nameHandle, int32_t classesHandle), int32_t (*unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString)(int32_t eHandle, int32_t nameHandle, int32_t classNameHandle), int32_t (*boxInteractionSourcePositionAccuracy)(UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy val), @@ -19298,43 +21539,65 @@ DLLEXPORT void Init( int32_t (*unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode)(int32_t thisHandle, UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node), int32_t (*boxInteractionSourcePose)(int32_t valHandle), int32_t (*unboxInteractionSourcePose)(int32_t valHandle), - int32_t (*boxBoolean)(System::Boolean val), + int32_t (*systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent)(int32_t thisHandle), + System::Int32 (*systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent)(int32_t thisHandle), + System::Single (*systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent)(int32_t thisHandle), + UnityEngine::GradientColorKey (*systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator)(int32_t thisHandle), + int32_t (*systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator)(int32_t thisHandle), + int32_t (*systemCollectionsGenericListSystemStringConstructor)(), + int32_t (*systemCollectionsGenericListSystemStringPropertyGetItem)(int32_t thisHandle, int32_t index), + void (*systemCollectionsGenericListSystemStringPropertySetItem)(int32_t thisHandle, int32_t index, int32_t valueHandle), + void (*systemCollectionsGenericListSystemStringMethodAddSystemString)(int32_t thisHandle, int32_t itemHandle), + void (*systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle), + int32_t (*systemCollectionsGenericListSystemInt32Constructor)(), + System::Int32 (*systemCollectionsGenericListSystemInt32PropertyGetItem)(int32_t thisHandle, int32_t index), + void (*systemCollectionsGenericListSystemInt32PropertySetItem)(int32_t thisHandle, int32_t index, int32_t value), + void (*systemCollectionsGenericListSystemInt32MethodAddSystemInt32)(int32_t thisHandle, int32_t item), + void (*systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle), + int32_t (*boxBoolean)(uint32_t val), int32_t (*unboxBoolean)(int32_t valHandle), int32_t (*boxSByte)(int8_t val), - int8_t (*unboxSByte)(int32_t valHandle), + System::SByte (*unboxSByte)(int32_t valHandle), int32_t (*boxByte)(uint8_t val), - uint8_t (*unboxByte)(int32_t valHandle), + System::Byte (*unboxByte)(int32_t valHandle), int32_t (*boxInt16)(int16_t val), - int16_t (*unboxInt16)(int32_t valHandle), + System::Int16 (*unboxInt16)(int32_t valHandle), int32_t (*boxUInt16)(uint16_t val), - uint16_t (*unboxUInt16)(int32_t valHandle), + System::UInt16 (*unboxUInt16)(int32_t valHandle), int32_t (*boxInt32)(int32_t val), - int32_t (*unboxInt32)(int32_t valHandle), + System::Int32 (*unboxInt32)(int32_t valHandle), int32_t (*boxUInt32)(uint32_t val), - uint32_t (*unboxUInt32)(int32_t valHandle), + System::UInt32 (*unboxUInt32)(int32_t valHandle), int32_t (*boxInt64)(int64_t val), - int64_t (*unboxInt64)(int32_t valHandle), + System::Int64 (*unboxInt64)(int32_t valHandle), int32_t (*boxUInt64)(uint64_t val), - uint64_t (*unboxUInt64)(int32_t valHandle), - int32_t (*boxChar)(System::Char val), + System::UInt64 (*unboxUInt64)(int32_t valHandle), + int32_t (*boxChar)(uint16_t val), int16_t (*unboxChar)(int32_t valHandle), int32_t (*boxSingle)(float val), - float (*unboxSingle)(int32_t valHandle), + System::Single (*unboxSingle)(int32_t valHandle), int32_t (*boxDouble)(double val), - double (*unboxDouble)(int32_t valHandle), + System::Double (*unboxDouble)(int32_t valHandle), int32_t (*systemSystemInt32Array1Constructor1)(int32_t length0), - int32_t (*systemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0), + System::Int32 (*systemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*systemInt32Array1SetItem1)(int32_t thisHandle, int32_t index0, int32_t item), int32_t (*systemSystemSingleArray1Constructor1)(int32_t length0), - float (*systemSingleArray1GetItem1)(int32_t thisHandle, int32_t index0), + System::Single (*systemSingleArray1GetItem1)(int32_t thisHandle, int32_t index0), int32_t (*systemSingleArray1SetItem1)(int32_t thisHandle, int32_t index0, float item), int32_t (*systemSystemSingleArray2Constructor2)(int32_t length0, int32_t length1), int32_t (*systemSystemSingleArray2GetLength2)(int32_t thisHandle, int32_t dimension), - float (*systemSingleArray2GetItem2)(int32_t thisHandle, int32_t index0, int32_t index1), + System::Single (*systemSingleArray2GetItem2)(int32_t thisHandle, int32_t index0, int32_t index1), int32_t (*systemSingleArray2SetItem2)(int32_t thisHandle, int32_t index0, int32_t index1, float item), int32_t (*systemSystemSingleArray3Constructor3)(int32_t length0, int32_t length1, int32_t length2), int32_t (*systemSystemSingleArray3GetLength3)(int32_t thisHandle, int32_t dimension), - float (*systemSingleArray3GetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2), + System::Single (*systemSingleArray3GetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2), int32_t (*systemSingleArray3SetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2, float item), int32_t (*systemSystemStringArray1Constructor1)(int32_t length0), int32_t (*systemStringArray1GetItem1)(int32_t thisHandle, int32_t index0), @@ -19367,7 +21630,7 @@ DLLEXPORT void Init( void (*systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), void (*systemFuncSystemInt32_SystemSingle_SystemDoubleAdd)(int32_t thisHandle, int32_t delHandle), void (*systemFuncSystemInt32_SystemSingle_SystemDoubleRemove)(int32_t thisHandle, int32_t delHandle), - double (*systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)(int32_t thisHandle, int32_t arg1, float arg2), + System::Double (*systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)(int32_t thisHandle, int32_t arg1, float arg2), void (*releaseSystemFuncSystemInt16_SystemInt32_SystemString)(int32_t handle, int32_t classHandle), void (*systemFuncSystemInt16_SystemInt32_SystemStringConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), void (*systemFuncSystemInt16_SystemInt32_SystemStringAdd)(int32_t thisHandle, int32_t delHandle), @@ -19424,6 +21687,7 @@ DLLEXPORT void Init( Plugin::ArrayGetLength = arrayGetLength; Plugin::EnumerableGetEnumerator = enumerableGetEnumerator; /*BEGIN INIT BODY*/ + Plugin::SystemIComparableMethodCompareToSystemObject = systemIComparableMethodCompareToSystemObject; Plugin::SystemIDisposableMethodDispose = systemIDisposableMethodDispose; Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle = unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle; Plugin::UnityEngineVector3PropertyGetMagnitude = unityEngineVector3PropertyGetMagnitude; @@ -19448,6 +21712,7 @@ DLLEXPORT void Init( Plugin::RefCountsUnityEngineResolution = (int32_t*)curMemory; curMemory += 1000 * sizeof(int32_t); Plugin::RefCountsLenUnityEngineResolution = 1000; + Plugin::UnityEngineResolutionConstructor = unityEngineResolutionConstructor; Plugin::UnityEngineResolutionPropertyGetWidth = unityEngineResolutionPropertyGetWidth; Plugin::UnityEngineResolutionPropertySetWidth = unityEngineResolutionPropertySetWidth; Plugin::UnityEngineResolutionPropertyGetHeight = unityEngineResolutionPropertyGetHeight; @@ -19467,18 +21732,6 @@ DLLEXPORT void Init( Plugin::UnboxRaycastHit = unboxRaycastHit; Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent = systemCollectionsIEnumeratorPropertyGetCurrent; Plugin::SystemCollectionsIEnumeratorMethodMoveNext = systemCollectionsIEnumeratorMethodMoveNext; - Plugin::SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent = systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent; - Plugin::SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent = systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent; - Plugin::SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent = systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent; - Plugin::SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent = systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent; - Plugin::SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent = systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent; - Plugin::SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent = systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent; - Plugin::SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator = systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator; - Plugin::SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator = systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator; - Plugin::SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator = systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator; - Plugin::SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator = systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator; - Plugin::SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator = systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator; - Plugin::SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator = systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator; Plugin::ReleaseUnityEnginePlayablesPlayableGraph = releaseUnityEnginePlayablesPlayableGraph; Plugin::RefCountsUnityEnginePlayablesPlayableGraph = (int32_t*)curMemory; curMemory += 1000 * sizeof(int32_t); @@ -19528,16 +21781,6 @@ DLLEXPORT void Init( Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue; Plugin::BoxKeyValuePairSystemString_SystemDouble = boxKeyValuePairSystemString_SystemDouble; Plugin::UnboxKeyValuePairSystemString_SystemDouble = unboxKeyValuePairSystemString_SystemDouble; - Plugin::SystemCollectionsGenericListSystemStringConstructor = systemCollectionsGenericListSystemStringConstructor; - Plugin::SystemCollectionsGenericListSystemStringPropertyGetItem = systemCollectionsGenericListSystemStringPropertyGetItem; - Plugin::SystemCollectionsGenericListSystemStringPropertySetItem = systemCollectionsGenericListSystemStringPropertySetItem; - Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString = systemCollectionsGenericListSystemStringMethodAddSystemString; - Plugin::SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer = systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer; - Plugin::SystemCollectionsGenericListSystemInt32Constructor = systemCollectionsGenericListSystemInt32Constructor; - Plugin::SystemCollectionsGenericListSystemInt32PropertyGetItem = systemCollectionsGenericListSystemInt32PropertyGetItem; - Plugin::SystemCollectionsGenericListSystemInt32PropertySetItem = systemCollectionsGenericListSystemInt32PropertySetItem; - Plugin::SystemCollectionsGenericListSystemInt32MethodAddSystemInt32 = systemCollectionsGenericListSystemInt32MethodAddSystemInt32; - Plugin::SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer = systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer; Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString = systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString; Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue = systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue; Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue = systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue; @@ -19579,8 +21822,8 @@ DLLEXPORT void Init( Plugin::BoxFileMode = boxFileMode; Plugin::UnboxFileMode = unboxFileMode; Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize = 1000; - Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList = (System::Collections::Generic::BaseIComparer**)curMemory; - curMemory += 1000 * sizeof(System::Collections::Generic::BaseIComparer*); + Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList = (System::Collections::Generic::BaseIComparer**)curMemory; + curMemory += 1000 * sizeof(System::Collections::Generic::BaseIComparer*); Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32 = releaseSystemCollectionsGenericBaseIComparerSystemInt32; Plugin::SystemCollectionsGenericBaseIComparerSystemInt32Constructor = systemCollectionsGenericBaseIComparerSystemInt32Constructor; @@ -19623,6 +21866,8 @@ DLLEXPORT void Init( Plugin::RefCountsLenUnityEnginePlayablesPlayableHandle = 1000; Plugin::BoxPlayableHandle = boxPlayableHandle; Plugin::UnboxPlayableHandle = unboxPlayableHandle; + Plugin::SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent = systemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent; + Plugin::SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator = systemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator; Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1 = unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1; Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString = unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString; Plugin::BoxInteractionSourcePositionAccuracy = boxInteractionSourcePositionAccuracy; @@ -19636,6 +21881,28 @@ DLLEXPORT void Init( Plugin::UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode = unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode; Plugin::BoxInteractionSourcePose = boxInteractionSourcePose; Plugin::UnboxInteractionSourcePose = unboxInteractionSourcePose; + Plugin::SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent = systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent; + Plugin::SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent = systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent; + Plugin::SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent = systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent; + Plugin::SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent = systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent; + Plugin::SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent = systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent; + Plugin::SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent = systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent; + Plugin::SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator = systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator; + Plugin::SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator = systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator; + Plugin::SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator = systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator; + Plugin::SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator = systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator; + Plugin::SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator = systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator; + Plugin::SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator = systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator; + Plugin::SystemCollectionsGenericListSystemStringConstructor = systemCollectionsGenericListSystemStringConstructor; + Plugin::SystemCollectionsGenericListSystemStringPropertyGetItem = systemCollectionsGenericListSystemStringPropertyGetItem; + Plugin::SystemCollectionsGenericListSystemStringPropertySetItem = systemCollectionsGenericListSystemStringPropertySetItem; + Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString = systemCollectionsGenericListSystemStringMethodAddSystemString; + Plugin::SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer = systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer; + Plugin::SystemCollectionsGenericListSystemInt32Constructor = systemCollectionsGenericListSystemInt32Constructor; + Plugin::SystemCollectionsGenericListSystemInt32PropertyGetItem = systemCollectionsGenericListSystemInt32PropertyGetItem; + Plugin::SystemCollectionsGenericListSystemInt32PropertySetItem = systemCollectionsGenericListSystemInt32PropertySetItem; + Plugin::SystemCollectionsGenericListSystemInt32MethodAddSystemInt32 = systemCollectionsGenericListSystemInt32MethodAddSystemInt32; + Plugin::SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer = systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer; Plugin::BoxBoolean = boxBoolean; Plugin::UnboxBoolean = unboxBoolean; Plugin::BoxSByte = boxSByte; @@ -19696,8 +21963,8 @@ DLLEXPORT void Init( Plugin::SystemActionRemove = systemActionRemove; Plugin::SystemActionInvoke = systemActionInvoke; Plugin::SystemActionSystemSingleFreeListSize = 1000; - Plugin::SystemActionSystemSingleFreeList = (System::Action1**)curMemory; - curMemory += 1000 * sizeof(System::Action1*); + Plugin::SystemActionSystemSingleFreeList = (System::Action1**)curMemory; + curMemory += 1000 * sizeof(System::Action1*); Plugin::ReleaseSystemActionSystemSingle = releaseSystemActionSystemSingle; Plugin::SystemActionSystemSingleConstructor = systemActionSystemSingleConstructor; @@ -19705,8 +21972,8 @@ DLLEXPORT void Init( Plugin::SystemActionSystemSingleRemove = systemActionSystemSingleRemove; Plugin::SystemActionSystemSingleInvoke = systemActionSystemSingleInvoke; Plugin::SystemActionSystemSingle_SystemSingleFreeListSize = 100; - Plugin::SystemActionSystemSingle_SystemSingleFreeList = (System::Action2**)curMemory; - curMemory += 100 * sizeof(System::Action2*); + Plugin::SystemActionSystemSingle_SystemSingleFreeList = (System::Action2**)curMemory; + curMemory += 100 * sizeof(System::Action2*); Plugin::ReleaseSystemActionSystemSingle_SystemSingle = releaseSystemActionSystemSingle_SystemSingle; Plugin::SystemActionSystemSingle_SystemSingleConstructor = systemActionSystemSingle_SystemSingleConstructor; @@ -19714,8 +21981,8 @@ DLLEXPORT void Init( Plugin::SystemActionSystemSingle_SystemSingleRemove = systemActionSystemSingle_SystemSingleRemove; Plugin::SystemActionSystemSingle_SystemSingleInvoke = systemActionSystemSingle_SystemSingleInvoke; Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize = 50; - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList = (System::Func3**)curMemory; - curMemory += 50 * sizeof(System::Func3*); + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList = (System::Func3**)curMemory; + curMemory += 50 * sizeof(System::Func3*); Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble = releaseSystemFuncSystemInt32_SystemSingle_SystemDouble; Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor = systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor; @@ -19723,8 +21990,8 @@ DLLEXPORT void Init( Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove = systemFuncSystemInt32_SystemSingle_SystemDoubleRemove; Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke = systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke; Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize = 25; - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList = (System::Func3**)curMemory; - curMemory += 25 * sizeof(System::Func3*); + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList = (System::Func3**)curMemory; + curMemory += 25 * sizeof(System::Func3*); Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString = releaseSystemFuncSystemInt16_SystemInt32_SystemString; Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor = systemFuncSystemInt16_SystemInt32_SystemStringConstructor; @@ -19797,7 +22064,7 @@ DLLEXPORT void Init( /*END INIT BODY*/ // Make sure there was enough memory - int32_t usedMemory = curMemory - (uint8_t*)memory; + int32_t usedMemory = (int32_t)(curMemory - (uint8_t*)memory); if (usedMemory > memorySize) { System::String msg = "Plugin memory size is too low"; @@ -19813,7 +22080,7 @@ DLLEXPORT void Init( /*BEGIN INIT BODY FIRST BOOT*/ for (int32_t i = 0, end = Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize - 1; i < end; ++i) { - Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList[i] = (System::Collections::Generic::BaseIComparer*)(Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList + i + 1); + Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList[i] = (System::Collections::Generic::BaseIComparer*)(Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList + i + 1); } Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList[Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize - 1] = nullptr; Plugin::NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 = Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList + 1; @@ -19862,28 +22129,28 @@ DLLEXPORT void Init( for (int32_t i = 0, end = Plugin::SystemActionSystemSingleFreeListSize - 1; i < end; ++i) { - Plugin::SystemActionSystemSingleFreeList[i] = (System::Action1*)(Plugin::SystemActionSystemSingleFreeList + i + 1); + Plugin::SystemActionSystemSingleFreeList[i] = (System::Action1*)(Plugin::SystemActionSystemSingleFreeList + i + 1); } Plugin::SystemActionSystemSingleFreeList[Plugin::SystemActionSystemSingleFreeListSize - 1] = nullptr; Plugin::NextFreeSystemActionSystemSingle = Plugin::SystemActionSystemSingleFreeList + 1; for (int32_t i = 0, end = Plugin::SystemActionSystemSingle_SystemSingleFreeListSize - 1; i < end; ++i) { - Plugin::SystemActionSystemSingle_SystemSingleFreeList[i] = (System::Action2*)(Plugin::SystemActionSystemSingle_SystemSingleFreeList + i + 1); + Plugin::SystemActionSystemSingle_SystemSingleFreeList[i] = (System::Action2*)(Plugin::SystemActionSystemSingle_SystemSingleFreeList + i + 1); } Plugin::SystemActionSystemSingle_SystemSingleFreeList[Plugin::SystemActionSystemSingle_SystemSingleFreeListSize - 1] = nullptr; Plugin::NextFreeSystemActionSystemSingle_SystemSingle = Plugin::SystemActionSystemSingle_SystemSingleFreeList + 1; for (int32_t i = 0, end = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize - 1; i < end; ++i) { - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[i] = (System::Func3*)(Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + i + 1); + Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[i] = (System::Func3*)(Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + i + 1); } Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize - 1] = nullptr; Plugin::NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + 1; for (int32_t i = 0, end = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize - 1; i < end; ++i) { - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[i] = (System::Func3*)(Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + i + 1); + Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[i] = (System::Func3*)(Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + i + 1); } Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize - 1] = nullptr; Plugin::NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + 1; @@ -19943,7 +22210,7 @@ DLLEXPORT void Init( { PluginMain( curMemory, - memorySize - usedMemory, + (int32_t)(memorySize - usedMemory), initMode == InitMode::FirstBoot); } catch (System::Exception ex) @@ -19987,7 +22254,7 @@ DLLEXPORT void MyGameMonoBehavioursTestScriptAwake(int32_t thisHandle) } -DLLEXPORT void MyGameMonoBehavioursTestScriptOnAnimatorIK(int32_t thisHandle, int32_t param0) +DLLEXPORT void MyGameMonoBehavioursTestScriptOnAnimatorIK(int32_t thisHandle, System::Int32 param0) { MyGame::MonoBehaviours::TestScript thiz(Plugin::InternalUse::Only, thisHandle); try diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index d2fdae9..4ce8ff7 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -14,16 +14,31 @@ #include //////////////////////////////////////////////////////////////// -// Plugin internals +// Plugin internals. Do not name these in game code as they may +// change without warning. For example: +// // Good. Uses behavior, not names. +// int x = myArray[5]; +// // Bad. Directly uses names. +// ArrayElementProxy1_1 proxy = myArray[5]; +// int x = proxy; //////////////////////////////////////////////////////////////// namespace Plugin { - enum class InternalUse + enum struct InternalUse { Only }; + struct ManagedType + { + int32_t Handle; + + ManagedType(); + ManagedType(decltype(nullptr)); + ManagedType(InternalUse, int32_t handle); + }; + template struct ArrayElementProxy1_1; template struct ArrayElementProxy1_2; @@ -46,179 +61,227 @@ namespace Plugin } //////////////////////////////////////////////////////////////// -// C# struct types +// C# basic types //////////////////////////////////////////////////////////////// namespace System { + struct Object; + struct ValueType; + struct Enum; + struct String; + struct Array; + template struct Array1; + template struct Array2; + template struct Array3; + template struct Array4; + template struct Array5; + struct IComparable; + struct IFormattable; + struct IConvertible; + // .NET booleans are four bytes long - // This struct makes them feel like C++'s bool type + // This struct makes them feel like C++'s bool, int32_t, and uint32_t types struct Boolean { int32_t Value; - Boolean() - : Value(0) - { - } - - Boolean(const Boolean& other) - : Value(other.Value) - { - } - - Boolean(const Boolean&& other) - : Value(other.Value) - { - } - - Boolean(bool value) - : Value((int32_t)value) - { - } - - Boolean(int32_t value) - : Value(value) - { - } - - operator bool() const - { - return (bool)Value; - } - - operator int32_t() const - { - return Value; - } - - bool operator==(const Boolean other) const - { - return Value == other.Value; - } - - bool operator!=(const Boolean other) const - { - return Value != other.Value; - } - - bool operator==(const bool other) const - { - return Value == other; - } - - bool operator!=(const bool other) const - { - return Value != other; - } + Boolean(); + Boolean(bool value); + Boolean(int32_t value); + Boolean(uint32_t value); + operator bool() const; + operator int32_t() const; + operator uint32_t() const; + explicit operator Object() const; + explicit operator ValueType() const; + explicit operator IComparable() const; + explicit operator IFormattable() const; + explicit operator IConvertible() const; }; // .NET chars are two bytes long - // This struct helps them interoperate with C++'s char type + // This struct helps them interoperate with C++'s char and int16_t types struct Char { int16_t Value; - Char() - : Value(0) - { - } + Char(); + Char(char value); + Char(int16_t value); + operator int16_t() const; + explicit operator Object() const; + explicit operator ValueType() const; + explicit operator IComparable() const; + explicit operator IFormattable() const; + explicit operator IConvertible() const; + }; + + struct SByte + { + int8_t Value; - Char(const Char& other) - : Value(other.Value) - { - } + SByte(); + SByte(int8_t value); + operator int8_t() const; + explicit operator Object() const; + explicit operator ValueType() const; + explicit operator IComparable() const; + explicit operator IFormattable() const; + explicit operator IConvertible() const; + }; + + struct Byte + { + uint8_t Value; - Char(const Char&& other) - : Value(other.Value) - { - } + Byte(); + Byte(uint8_t value); + operator uint8_t() const; + explicit operator Object() const; + explicit operator ValueType() const; + explicit operator IComparable() const; + explicit operator IFormattable() const; + explicit operator IConvertible() const; + }; + + struct Int16 + { + int16_t Value; - Char(char value) - : Value(value) - { - } + Int16(); + Int16(int16_t value); + operator int16_t() const; + explicit operator Object() const; + explicit operator ValueType() const; + explicit operator IComparable() const; + explicit operator IFormattable() const; + explicit operator IConvertible() const; + }; + + struct UInt16 + { + uint16_t Value; - Char(int16_t value) - : Value(value) - { - } + UInt16(); + UInt16(uint16_t value); + operator uint16_t() const; + explicit operator Object() const; + explicit operator ValueType() const; + explicit operator IComparable() const; + explicit operator IFormattable() const; + explicit operator IConvertible() const; + }; + + struct Int32 + { + int32_t Value; - operator bool() const - { - return (bool)Value; - } + Int32(); + Int32(int32_t value); + operator int32_t() const; + explicit operator Object() const; + explicit operator ValueType() const; + explicit operator IComparable() const; + explicit operator IFormattable() const; + explicit operator IConvertible() const; + }; + + struct UInt32 + { + uint32_t Value; - operator int16_t() const - { - return Value; - } + UInt32(); + UInt32(uint32_t value); + operator uint32_t() const; + explicit operator Object() const; + explicit operator ValueType() const; + explicit operator IComparable() const; + explicit operator IFormattable() const; + explicit operator IConvertible() const; + }; + + struct Int64 + { + int64_t Value; - bool operator==(const Char other) const - { - return Value == other.Value; - } + Int64(); + Int64(int64_t value); + operator int64_t() const; + explicit operator Object() const; + explicit operator ValueType() const; + explicit operator IComparable() const; + explicit operator IFormattable() const; + explicit operator IConvertible() const; + }; + + struct UInt64 + { + uint64_t Value; - bool operator!=(const Char other) const - { - return Value != other.Value; - } + UInt64(); + UInt64(uint64_t value); + operator uint64_t() const; + explicit operator Object() const; + explicit operator ValueType() const; + explicit operator IComparable() const; + explicit operator IFormattable() const; + explicit operator IConvertible() const; + }; + + struct Single + { + float Value; - bool operator==(const char other) const - { - return Value == other; - } + Single(); + Single(float value); + operator float() const; + explicit operator Object() const; + explicit operator ValueType() const; + explicit operator IComparable() const; + explicit operator IFormattable() const; + explicit operator IConvertible() const; + }; + + struct Double + { + double Value; - bool operator!=(const char other) const - { - return Value != other; - } + Double(); + Double(double value); + operator double() const; + explicit operator Object() const; + explicit operator ValueType() const; + explicit operator IComparable() const; + explicit operator IFormattable() const; + explicit operator IConvertible() const; }; } -//////////////////////////////////////////////////////////////// -// C# type declarations -//////////////////////////////////////////////////////////////// - +/*BEGIN TEMPLATE DECLARATIONS*/ namespace System { - struct Object; - struct ValueType; - struct String; - struct Array; - template struct Array1; - template struct Array2; - template struct Array3; - template struct Array4; - template struct Array5; + namespace Collections + { + namespace Generic + { + template struct IEqualityComparer; + } + } } -//////////////////////////////////////////////////////////////// -// C# type aliases -//////////////////////////////////////////////////////////////// - namespace System { - using SByte = int8_t; - using Byte = uint8_t; - using Int16 = int16_t; - using UInt16 = uint16_t; - using Int32 = int32_t; - using UInt32 = uint32_t; - using Int64 = int64_t; - using UInt64 = uint64_t; - using Single = float; - using Double = double; + template struct IEquatable; } -/*BEGIN TEMPLATE DECLARATIONS*/ namespace System { namespace Collections { namespace Generic { - template struct IEnumerator; + template struct KeyValuePair; } } } @@ -229,18 +292,18 @@ namespace System { namespace Generic { - template struct IEnumerable; + template struct LinkedListNode; } } } namespace System { - namespace Collections + namespace Runtime { - namespace Generic + namespace CompilerServices { - template struct ICollection; + template struct StrongBox; } } } @@ -251,7 +314,7 @@ namespace System { namespace Generic { - template struct IList; + template struct IComparer; } } } @@ -262,14 +325,20 @@ namespace System { namespace Generic { - template struct IEqualityComparer; + template struct BaseIComparer; } } } namespace System { - template struct IEquatable; + namespace Collections + { + namespace Generic + { + template struct BaseIComparer; + } + } } namespace System @@ -278,7 +347,7 @@ namespace System { namespace Generic { - template struct KeyValuePair; + template struct IEnumerator; } } } @@ -289,7 +358,7 @@ namespace System { namespace Generic { - template struct List; + template struct IEnumerable; } } } @@ -300,18 +369,18 @@ namespace System { namespace Generic { - template struct LinkedListNode; + template struct IEnumerator; } } } namespace System { - namespace Runtime + namespace Collections { - namespace CompilerServices + namespace Generic { - template struct StrongBox; + template struct IEnumerable; } } } @@ -320,9 +389,9 @@ namespace System { namespace Collections { - namespace ObjectModel + namespace Generic { - template struct Collection; + template struct ICollection; } } } @@ -331,9 +400,9 @@ namespace System { namespace Collections { - namespace ObjectModel + namespace Generic { - template struct KeyedCollection; + template struct IList; } } } @@ -344,7 +413,7 @@ namespace System { namespace Generic { - template struct IComparer; + template struct List; } } } @@ -353,9 +422,9 @@ namespace System { namespace Collections { - namespace Generic + namespace ObjectModel { - template struct BaseIComparer; + template struct Collection; } } } @@ -364,9 +433,9 @@ namespace System { namespace Collections { - namespace Generic + namespace ObjectModel { - template struct BaseIComparer; + template struct KeyedCollection; } } } @@ -401,6 +470,21 @@ namespace UnityEngine /*END TEMPLATE DECLARATIONS*/ /*BEGIN TYPE DECLARATIONS*/ +namespace System +{ + struct IFormattable; +} + +namespace System +{ + struct IConvertible; +} + +namespace System +{ + struct IComparable; +} + namespace System { struct IDisposable; @@ -543,6 +627,28 @@ namespace UnityEngine } } +namespace UnityEngine +{ + namespace Experimental + { + namespace UIElements + { + struct CallbackEventHandler; + } + } +} + +namespace UnityEngine +{ + namespace Experimental + { + namespace UIElements + { + struct Focusable; + } + } +} + namespace UnityEngine { namespace Experimental @@ -622,12 +728,7 @@ namespace UnityEngine namespace UnityEngine { - enum struct QueryTriggerInteraction : int32_t - { - UseGlobal = 0, - Ignore = 1, - Collide = 2 - }; + struct QueryTriggerInteraction; } namespace System @@ -695,11 +796,7 @@ namespace UnityEngine { namespace SceneManagement { - enum struct LoadSceneMode : int32_t - { - Single = 0, - Additive = 1 - }; + struct LoadSceneMode; } } @@ -762,15 +859,7 @@ namespace System namespace UnityEngine { - enum struct PrimitiveType : int32_t - { - Sphere = 0, - Capsule = 1, - Cylinder = 2, - Cube = 3, - Plane = 4, - Quad = 5 - }; + struct PrimitiveType; } namespace UnityEngine @@ -782,15 +871,7 @@ namespace System { namespace IO { - enum struct FileMode : int32_t - { - CreateNew = 1, - Create = 2, - Open = 3, - OpenOrCreate = 4, - Truncate = 5, - Append = 6 - }; + struct FileMode; } } @@ -885,7 +966,29 @@ namespace UnityEngine { namespace UIElements { - struct CallbackEventHandler; + struct ITransform; + } + } +} + +namespace UnityEngine +{ + namespace Experimental + { + namespace UIElements + { + struct IUIElementDataWatch; + } + } +} + +namespace UnityEngine +{ + namespace Experimental + { + namespace UIElements + { + struct IVisualElementScheduler; } } } @@ -922,12 +1025,7 @@ namespace UnityEngine { namespace Input { - enum struct InteractionSourcePositionAccuracy : int32_t - { - None = 0, - Approximate = 1, - High = 2 - }; + struct InteractionSourcePositionAccuracy; } } } @@ -941,11 +1039,7 @@ namespace UnityEngine { namespace Input { - enum struct InteractionSourceNode : int32_t - { - Grip = 0, - Pointer = 1 - }; + struct InteractionSourceNode; } } } @@ -1051,7 +1145,7 @@ namespace System { namespace Generic { - template<> struct IEnumerator; + template<> struct IEqualityComparer; } } } @@ -1062,20 +1156,14 @@ namespace System { namespace Generic { - template<> struct IEnumerator; + template<> struct IEqualityComparer; } } } namespace System { - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator; - } - } + template<> struct IEquatable; } namespace System @@ -1084,7 +1172,7 @@ namespace System { namespace Generic { - template<> struct IEnumerator; + template<> struct KeyValuePair; } } } @@ -1095,7 +1183,18 @@ namespace System { namespace Generic { - template<> struct IEnumerator; + template<> struct LinkedListNode; + } + } +} + +namespace System +{ + namespace Runtime + { + namespace CompilerServices + { + template<> struct StrongBox; } } } @@ -1106,7 +1205,7 @@ namespace System { namespace Generic { - template<> struct IEnumerator; + template<> struct IComparer; } } } @@ -1117,7 +1216,7 @@ namespace System { namespace Generic { - template<> struct IEnumerable; + template<> struct IComparer; } } } @@ -1128,7 +1227,7 @@ namespace System { namespace Generic { - template<> struct IEnumerable; + template<> struct BaseIComparer; } } } @@ -1139,7 +1238,7 @@ namespace System { namespace Generic { - template<> struct IEnumerable; + template<> struct BaseIComparer; } } } @@ -1150,7 +1249,7 @@ namespace System { namespace Generic { - template<> struct IEnumerable; + template<> struct IEnumerator; } } } @@ -1161,7 +1260,7 @@ namespace System { namespace Generic { - template<> struct IEnumerable; + template<> struct IEnumerable; } } } @@ -1172,7 +1271,7 @@ namespace System { namespace Generic { - template<> struct IEnumerable; + template<> struct IEnumerator; } } } @@ -1183,7 +1282,7 @@ namespace System { namespace Generic { - template<> struct ICollection; + template<> struct IEnumerator; } } } @@ -1194,7 +1293,7 @@ namespace System { namespace Generic { - template<> struct ICollection; + template<> struct IEnumerator; } } } @@ -1205,7 +1304,7 @@ namespace System { namespace Generic { - template<> struct ICollection; + template<> struct IEnumerator; } } } @@ -1216,7 +1315,7 @@ namespace System { namespace Generic { - template<> struct ICollection; + template<> struct IEnumerator; } } } @@ -1227,7 +1326,7 @@ namespace System { namespace Generic { - template<> struct ICollection; + template<> struct IEnumerator; } } } @@ -1238,7 +1337,7 @@ namespace System { namespace Generic { - template<> struct ICollection; + template<> struct IEnumerable; } } } @@ -1249,7 +1348,7 @@ namespace System { namespace Generic { - template<> struct IList; + template<> struct IEnumerable; } } } @@ -1260,7 +1359,7 @@ namespace System { namespace Generic { - template<> struct IList; + template<> struct IEnumerable; } } } @@ -1271,7 +1370,7 @@ namespace System { namespace Generic { - template<> struct IList; + template<> struct IEnumerable; } } } @@ -1282,7 +1381,7 @@ namespace System { namespace Generic { - template<> struct IList; + template<> struct IEnumerable; } } } @@ -1293,7 +1392,7 @@ namespace System { namespace Generic { - template<> struct IList; + template<> struct IEnumerable; } } } @@ -1304,7 +1403,7 @@ namespace System { namespace Generic { - template<> struct IList; + template<> struct ICollection; } } } @@ -1315,7 +1414,7 @@ namespace System { namespace Generic { - template<> struct IEqualityComparer; + template<> struct ICollection; } } } @@ -1326,14 +1425,20 @@ namespace System { namespace Generic { - template<> struct IEqualityComparer; + template<> struct ICollection; } } } namespace System { - template<> struct IEquatable; + namespace Collections + { + namespace Generic + { + template<> struct ICollection; + } + } } namespace System @@ -1342,7 +1447,7 @@ namespace System { namespace Generic { - template<> struct KeyValuePair; + template<> struct ICollection; } } } @@ -1353,7 +1458,7 @@ namespace System { namespace Generic { - template<> struct List; + template<> struct ICollection; } } } @@ -1364,7 +1469,7 @@ namespace System { namespace Generic { - template<> struct List; + template<> struct IList; } } } @@ -1375,18 +1480,18 @@ namespace System { namespace Generic { - template<> struct LinkedListNode; + template<> struct IList; } } } namespace System { - namespace Runtime + namespace Collections { - namespace CompilerServices + namespace Generic { - template<> struct StrongBox; + template<> struct IList; } } } @@ -1395,9 +1500,9 @@ namespace System { namespace Collections { - namespace ObjectModel + namespace Generic { - template<> struct Collection; + template<> struct IList; } } } @@ -1406,9 +1511,9 @@ namespace System { namespace Collections { - namespace ObjectModel + namespace Generic { - template<> struct KeyedCollection; + template<> struct IList; } } } @@ -1419,7 +1524,7 @@ namespace System { namespace Generic { - template<> struct IComparer; + template<> struct IList; } } } @@ -1430,7 +1535,7 @@ namespace System { namespace Generic { - template<> struct IComparer; + template<> struct List; } } } @@ -1441,7 +1546,7 @@ namespace System { namespace Generic { - template<> struct BaseIComparer; + template<> struct List; } } } @@ -1450,66 +1555,77 @@ namespace System { namespace Collections { - namespace Generic + namespace ObjectModel { - template<> struct BaseIComparer; + template<> struct Collection; + } + } +} + +namespace System +{ + namespace Collections + { + namespace ObjectModel + { + template<> struct KeyedCollection; } } } namespace Plugin { - template<> struct ArrayElementProxy1_1; + template<> struct ArrayElementProxy1_1; } namespace System { - template<> struct Array1; + template<> struct Array1; } namespace Plugin { - template<> struct ArrayElementProxy1_1; + template<> struct ArrayElementProxy1_1; } namespace Plugin { - template<> struct ArrayElementProxy1_2; + template<> struct ArrayElementProxy1_2; } namespace Plugin { - template<> struct ArrayElementProxy2_2; + template<> struct ArrayElementProxy2_2; } namespace Plugin { - template<> struct ArrayElementProxy1_3; + template<> struct ArrayElementProxy1_3; } namespace Plugin { - template<> struct ArrayElementProxy2_3; + template<> struct ArrayElementProxy2_3; } namespace Plugin { - template<> struct ArrayElementProxy3_3; + template<> struct ArrayElementProxy3_3; } namespace System { - template<> struct Array1; + template<> struct Array1; } namespace System { - template<> struct Array2; + template<> struct Array2; } namespace System { - template<> struct Array3; + template<> struct Array3; } namespace Plugin @@ -1554,22 +1670,22 @@ namespace System namespace System { - template<> struct Action1; + template<> struct Action1; } namespace System { - template<> struct Action2; + template<> struct Action2; } namespace System { - template<> struct Func3; + template<> struct Func3; } namespace System { - template<> struct Func3; + template<> struct Func3; } namespace UnityEngine @@ -1587,9 +1703,8 @@ namespace UnityEngine namespace System { - struct Object + struct Object : Plugin::ManagedType { - int32_t Handle; Object(); Object(Plugin::InternalUse iu, int32_t handle); Object(decltype(nullptr)); @@ -1598,72 +1713,40 @@ namespace System bool operator!=(decltype(nullptr)) const; virtual void ThrowReferenceToThis(); - /*BEGIN BOXING METHOD DECLARATIONS*/ - Object(UnityEngine::Vector3& val); + /*BEGIN UNBOXING METHOD DECLARATIONS*/ explicit operator UnityEngine::Vector3(); - Object(UnityEngine::Color& val); explicit operator UnityEngine::Color(); - Object(UnityEngine::GradientColorKey& val); explicit operator UnityEngine::GradientColorKey(); - Object(UnityEngine::Resolution& val); explicit operator UnityEngine::Resolution(); - Object(UnityEngine::RaycastHit& val); explicit operator UnityEngine::RaycastHit(); - Object(UnityEngine::Playables::PlayableGraph& val); explicit operator UnityEngine::Playables::PlayableGraph(); - Object(UnityEngine::Animations::AnimationMixerPlayable& val); explicit operator UnityEngine::Animations::AnimationMixerPlayable(); - Object(UnityEngine::Quaternion& val); explicit operator UnityEngine::Quaternion(); - Object(UnityEngine::Matrix4x4& val); explicit operator UnityEngine::Matrix4x4(); - Object(UnityEngine::QueryTriggerInteraction val); explicit operator UnityEngine::QueryTriggerInteraction(); - Object(System::Collections::Generic::KeyValuePair& val); - explicit operator System::Collections::Generic::KeyValuePair(); - Object(UnityEngine::Ray& val); + explicit operator System::Collections::Generic::KeyValuePair(); explicit operator UnityEngine::Ray(); - Object(UnityEngine::SceneManagement::Scene& val); explicit operator UnityEngine::SceneManagement::Scene(); - Object(UnityEngine::SceneManagement::LoadSceneMode val); explicit operator UnityEngine::SceneManagement::LoadSceneMode(); - Object(UnityEngine::PrimitiveType val); explicit operator UnityEngine::PrimitiveType(); - Object(System::IO::FileMode val); explicit operator System::IO::FileMode(); - Object(UnityEngine::Playables::PlayableHandle& val); explicit operator UnityEngine::Playables::PlayableHandle(); - Object(UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy val); explicit operator UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy(); - Object(UnityEngine::XR::WSA::Input::InteractionSourceNode val); explicit operator UnityEngine::XR::WSA::Input::InteractionSourceNode(); - Object(UnityEngine::XR::WSA::Input::InteractionSourcePose& val); explicit operator UnityEngine::XR::WSA::Input::InteractionSourcePose(); - Object(System::Boolean val); explicit operator System::Boolean(); - Object(int8_t val); - explicit operator int8_t(); - Object(uint8_t val); - explicit operator uint8_t(); - Object(int16_t val); - explicit operator int16_t(); - Object(uint16_t val); - explicit operator uint16_t(); - Object(int32_t val); - explicit operator int32_t(); - Object(uint32_t val); - explicit operator uint32_t(); - Object(int64_t val); - explicit operator int64_t(); - Object(uint64_t val); - explicit operator uint64_t(); - Object(System::Char val); + explicit operator System::SByte(); + explicit operator System::Byte(); + explicit operator System::Int16(); + explicit operator System::UInt16(); + explicit operator System::Int32(); + explicit operator System::UInt32(); + explicit operator System::Int64(); + explicit operator System::UInt64(); explicit operator System::Char(); - Object(float val); - explicit operator float(); - Object(double val); - explicit operator double(); - /*END BOXING METHOD DECLARATIONS*/ + explicit operator System::Single(); + explicit operator System::Double(); + /*END UNBOXING METHOD DECLARATIONS*/ }; struct ValueType : virtual Object @@ -1672,6 +1755,12 @@ namespace System ValueType(decltype(nullptr)); }; + struct Enum : virtual ValueType + { + Enum(Plugin::InternalUse iu, int32_t handle); + Enum(decltype(nullptr)); + }; + struct String : virtual Object { String(Plugin::InternalUse iu, int32_t handle); @@ -1732,12 +1821,64 @@ namespace Plugin } /*BEGIN TYPE DEFINITIONS*/ +namespace System +{ + struct IFormattable : virtual System::Object + { + IFormattable(decltype(nullptr)); + IFormattable(Plugin::InternalUse, int32_t handle); + IFormattable(const IFormattable& other); + IFormattable(IFormattable&& other); + virtual ~IFormattable(); + IFormattable& operator=(const IFormattable& other); + IFormattable& operator=(decltype(nullptr)); + IFormattable& operator=(IFormattable&& other); + bool operator==(const IFormattable& other) const; + bool operator!=(const IFormattable& other) const; + }; +} + +namespace System +{ + struct IConvertible : virtual System::Object + { + IConvertible(decltype(nullptr)); + IConvertible(Plugin::InternalUse, int32_t handle); + IConvertible(const IConvertible& other); + IConvertible(IConvertible&& other); + virtual ~IConvertible(); + IConvertible& operator=(const IConvertible& other); + IConvertible& operator=(decltype(nullptr)); + IConvertible& operator=(IConvertible&& other); + bool operator==(const IConvertible& other) const; + bool operator!=(const IConvertible& other) const; + }; +} + +namespace System +{ + struct IComparable : virtual System::Object + { + IComparable(decltype(nullptr)); + IComparable(Plugin::InternalUse, int32_t handle); + IComparable(const IComparable& other); + IComparable(IComparable&& other); + virtual ~IComparable(); + IComparable& operator=(const IComparable& other); + IComparable& operator=(decltype(nullptr)); + IComparable& operator=(IComparable&& other); + bool operator==(const IComparable& other) const; + bool operator!=(const IComparable& other) const; + System::Int32 CompareTo(System::Object& obj); + }; +} + namespace System { struct IDisposable : virtual System::Object { IDisposable(decltype(nullptr)); - IDisposable(Plugin::InternalUse iu, int32_t handle); + IDisposable(Plugin::InternalUse, int32_t handle); IDisposable(const IDisposable& other); IDisposable(IDisposable&& other); virtual ~IDisposable(); @@ -1755,14 +1896,16 @@ namespace UnityEngine struct Vector3 { Vector3(); - Vector3(float x, float y, float z); - float GetMagnitude(); - float x; - float y; - float z; - void Set(float newX, float newY, float newZ); + Vector3(System::Single x, System::Single y, System::Single z); + System::Single GetMagnitude(); + System::Single x; + System::Single y; + System::Single z; + void Set(System::Single newX, System::Single newY, System::Single newZ); UnityEngine::Vector3 operator+(UnityEngine::Vector3& a); UnityEngine::Vector3 operator-(); + explicit operator System::ValueType(); + explicit operator System::Object(); }; } @@ -1771,7 +1914,7 @@ namespace UnityEngine struct Object : virtual System::Object { Object(decltype(nullptr)); - Object(Plugin::InternalUse iu, int32_t handle); + Object(Plugin::InternalUse, int32_t handle); Object(const Object& other); Object(Object&& other); virtual ~Object(); @@ -1792,7 +1935,7 @@ namespace UnityEngine struct Component : virtual UnityEngine::Object { Component(decltype(nullptr)); - Component(Plugin::InternalUse iu, int32_t handle); + Component(Plugin::InternalUse, int32_t handle); Component(const Component& other); Component(Component&& other); virtual ~Component(); @@ -1810,7 +1953,7 @@ namespace UnityEngine struct Transform : virtual UnityEngine::Component, virtual System::Collections::IEnumerable { Transform(decltype(nullptr)); - Transform(Plugin::InternalUse iu, int32_t handle); + Transform(Plugin::InternalUse, int32_t handle); Transform(const Transform& other); Transform(Transform&& other); virtual ~Transform(); @@ -1830,10 +1973,12 @@ namespace UnityEngine struct Color { Color(); - float r; - float g; - float b; - float a; + System::Single r; + System::Single g; + System::Single b; + System::Single a; + explicit operator System::ValueType(); + explicit operator System::Object(); }; } @@ -1843,16 +1988,18 @@ namespace UnityEngine { GradientColorKey(); UnityEngine::Color color; - float time; + System::Single time; + explicit operator System::ValueType(); + explicit operator System::Object(); }; } namespace UnityEngine { - struct Resolution : virtual System::ValueType + struct Resolution : Plugin::ManagedType { Resolution(decltype(nullptr)); - Resolution(Plugin::InternalUse iu, int32_t handle); + Resolution(Plugin::InternalUse, int32_t handle); Resolution(const Resolution& other); Resolution(Resolution&& other); virtual ~Resolution(); @@ -1861,21 +2008,24 @@ namespace UnityEngine Resolution& operator=(Resolution&& other); bool operator==(const Resolution& other) const; bool operator!=(const Resolution& other) const; - int32_t GetWidth(); - void SetWidth(int32_t value); - int32_t GetHeight(); - void SetHeight(int32_t value); - int32_t GetRefreshRate(); - void SetRefreshRate(int32_t value); + Resolution(); + System::Int32 GetWidth(); + void SetWidth(System::Int32 value); + System::Int32 GetHeight(); + void SetHeight(System::Int32 value); + System::Int32 GetRefreshRate(); + void SetRefreshRate(System::Int32 value); + explicit operator System::ValueType(); + explicit operator System::Object(); }; } namespace UnityEngine { - struct RaycastHit : virtual System::ValueType + struct RaycastHit : Plugin::ManagedType { RaycastHit(decltype(nullptr)); - RaycastHit(Plugin::InternalUse iu, int32_t handle); + RaycastHit(Plugin::InternalUse, int32_t handle); RaycastHit(const RaycastHit& other); RaycastHit(RaycastHit&& other); virtual ~RaycastHit(); @@ -1887,6 +2037,8 @@ namespace UnityEngine UnityEngine::Vector3 GetPoint(); void SetPoint(UnityEngine::Vector3& value); UnityEngine::Transform GetTransform(); + explicit operator System::ValueType(); + explicit operator System::Object(); }; } @@ -1897,7 +2049,7 @@ namespace System struct IEnumerator : virtual System::Object { IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse iu, int32_t handle); + IEnumerator(Plugin::InternalUse, int32_t handle); IEnumerator(const IEnumerator& other); IEnumerator(IEnumerator&& other); virtual ~IEnumerator(); @@ -1914,23 +2066,22 @@ namespace System namespace System { - namespace Collections + namespace Runtime { - namespace Generic + namespace Serialization { - template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator + struct ISerializable : virtual System::Object { - IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse iu, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr)); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - System::String GetCurrent(); + ISerializable(decltype(nullptr)); + ISerializable(Plugin::InternalUse, int32_t handle); + ISerializable(const ISerializable& other); + ISerializable(ISerializable&& other); + virtual ~ISerializable(); + ISerializable& operator=(const ISerializable& other); + ISerializable& operator=(decltype(nullptr)); + ISerializable& operator=(ISerializable&& other); + bool operator==(const ISerializable& other) const; + bool operator!=(const ISerializable& other) const; }; } } @@ -1938,23 +2089,22 @@ namespace System namespace System { - namespace Collections + namespace Runtime { - namespace Generic + namespace InteropServices { - template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator + struct _Exception : virtual System::Object { - IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse iu, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr)); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - int32_t GetCurrent(); + _Exception(decltype(nullptr)); + _Exception(Plugin::InternalUse, int32_t handle); + _Exception(const _Exception& other); + _Exception(_Exception&& other); + virtual ~_Exception(); + _Exception& operator=(const _Exception& other); + _Exception& operator=(decltype(nullptr)); + _Exception& operator=(_Exception&& other); + bool operator==(const _Exception& other) const; + bool operator!=(const _Exception& other) const; }; } } @@ -1962,49 +2112,38 @@ namespace System namespace System { - namespace Collections + struct IAppDomainSetup : virtual System::Object { - namespace Generic - { - template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator - { - IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse iu, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr)); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - float GetCurrent(); - }; - } - } + IAppDomainSetup(decltype(nullptr)); + IAppDomainSetup(Plugin::InternalUse, int32_t handle); + IAppDomainSetup(const IAppDomainSetup& other); + IAppDomainSetup(IAppDomainSetup&& other); + virtual ~IAppDomainSetup(); + IAppDomainSetup& operator=(const IAppDomainSetup& other); + IAppDomainSetup& operator=(decltype(nullptr)); + IAppDomainSetup& operator=(IAppDomainSetup&& other); + bool operator==(const IAppDomainSetup& other) const; + bool operator!=(const IAppDomainSetup& other) const; + }; } namespace System { namespace Collections { - namespace Generic + struct IComparer : virtual System::Object { - template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator - { - IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse iu, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr)); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - UnityEngine::RaycastHit GetCurrent(); - }; - } + IComparer(decltype(nullptr)); + IComparer(Plugin::InternalUse, int32_t handle); + IComparer(const IComparer& other); + IComparer(IComparer&& other); + virtual ~IComparer(); + IComparer& operator=(const IComparer& other); + IComparer& operator=(decltype(nullptr)); + IComparer& operator=(IComparer&& other); + bool operator==(const IComparer& other) const; + bool operator!=(const IComparer& other) const; + }; } } @@ -2012,23 +2151,19 @@ namespace System { namespace Collections { - namespace Generic + struct IEqualityComparer : virtual System::Object { - template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator - { - IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse iu, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr)); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - UnityEngine::GradientColorKey GetCurrent(); - }; - } + IEqualityComparer(decltype(nullptr)); + IEqualityComparer(Plugin::InternalUse, int32_t handle); + IEqualityComparer(const IEqualityComparer& other); + IEqualityComparer(IEqualityComparer&& other); + virtual ~IEqualityComparer(); + IEqualityComparer& operator=(const IEqualityComparer& other); + IEqualityComparer& operator=(decltype(nullptr)); + IEqualityComparer& operator=(IEqualityComparer&& other); + bool operator==(const IEqualityComparer& other) const; + bool operator!=(const IEqualityComparer& other) const; + }; } } @@ -2038,19 +2173,18 @@ namespace System { namespace Generic { - template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator + template<> struct IEqualityComparer : virtual System::Object { - IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse iu, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr)); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - UnityEngine::Resolution GetCurrent(); + IEqualityComparer(decltype(nullptr)); + IEqualityComparer(Plugin::InternalUse, int32_t handle); + IEqualityComparer(const IEqualityComparer& other); + IEqualityComparer(IEqualityComparer&& other); + virtual ~IEqualityComparer(); + IEqualityComparer& operator=(const IEqualityComparer& other); + IEqualityComparer& operator=(decltype(nullptr)); + IEqualityComparer& operator=(IEqualityComparer&& other); + bool operator==(const IEqualityComparer& other) const; + bool operator!=(const IEqualityComparer& other) const; }; } } @@ -2062,442 +2196,452 @@ namespace System { namespace Generic { - template<> struct IEnumerable : virtual System::Collections::IEnumerable + template<> struct IEqualityComparer : virtual System::Object { - IEnumerable(decltype(nullptr)); - IEnumerable(Plugin::InternalUse iu, int32_t handle); - IEnumerable(const IEnumerable& other); - IEnumerable(IEnumerable&& other); - virtual ~IEnumerable(); - IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr)); - IEnumerable& operator=(IEnumerable&& other); - bool operator==(const IEnumerable& other) const; - bool operator!=(const IEnumerable& other) const; - System::Collections::Generic::IEnumerator GetEnumerator(); + IEqualityComparer(decltype(nullptr)); + IEqualityComparer(Plugin::InternalUse, int32_t handle); + IEqualityComparer(const IEqualityComparer& other); + IEqualityComparer(IEqualityComparer&& other); + virtual ~IEqualityComparer(); + IEqualityComparer& operator=(const IEqualityComparer& other); + IEqualityComparer& operator=(decltype(nullptr)); + IEqualityComparer& operator=(IEqualityComparer&& other); + bool operator==(const IEqualityComparer& other) const; + bool operator!=(const IEqualityComparer& other) const; }; } } } -namespace System +namespace UnityEngine { - namespace Collections + namespace Playables { - namespace Generic + struct PlayableGraph : Plugin::ManagedType { - template<> struct IEnumerable : virtual System::Collections::IEnumerable - { - IEnumerable(decltype(nullptr)); - IEnumerable(Plugin::InternalUse iu, int32_t handle); - IEnumerable(const IEnumerable& other); - IEnumerable(IEnumerable&& other); - virtual ~IEnumerable(); - IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr)); - IEnumerable& operator=(IEnumerable&& other); - bool operator==(const IEnumerable& other) const; - bool operator!=(const IEnumerable& other) const; - System::Collections::Generic::IEnumerator GetEnumerator(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable : virtual System::Collections::IEnumerable - { - IEnumerable(decltype(nullptr)); - IEnumerable(Plugin::InternalUse iu, int32_t handle); - IEnumerable(const IEnumerable& other); - IEnumerable(IEnumerable&& other); - virtual ~IEnumerable(); - IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr)); - IEnumerable& operator=(IEnumerable&& other); - bool operator==(const IEnumerable& other) const; - bool operator!=(const IEnumerable& other) const; - System::Collections::Generic::IEnumerator GetEnumerator(); - }; - } + PlayableGraph(decltype(nullptr)); + PlayableGraph(Plugin::InternalUse, int32_t handle); + PlayableGraph(const PlayableGraph& other); + PlayableGraph(PlayableGraph&& other); + virtual ~PlayableGraph(); + PlayableGraph& operator=(const PlayableGraph& other); + PlayableGraph& operator=(decltype(nullptr)); + PlayableGraph& operator=(PlayableGraph&& other); + bool operator==(const PlayableGraph& other) const; + bool operator!=(const PlayableGraph& other) const; + explicit operator System::ValueType(); + explicit operator System::Object(); + }; } } -namespace System +namespace UnityEngine { - namespace Collections + namespace Playables { - namespace Generic + struct IPlayable : virtual System::Object { - template<> struct IEnumerable : virtual System::Collections::IEnumerable - { - IEnumerable(decltype(nullptr)); - IEnumerable(Plugin::InternalUse iu, int32_t handle); - IEnumerable(const IEnumerable& other); - IEnumerable(IEnumerable&& other); - virtual ~IEnumerable(); - IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr)); - IEnumerable& operator=(IEnumerable&& other); - bool operator==(const IEnumerable& other) const; - bool operator!=(const IEnumerable& other) const; - System::Collections::Generic::IEnumerator GetEnumerator(); - }; - } + IPlayable(decltype(nullptr)); + IPlayable(Plugin::InternalUse, int32_t handle); + IPlayable(const IPlayable& other); + IPlayable(IPlayable&& other); + virtual ~IPlayable(); + IPlayable& operator=(const IPlayable& other); + IPlayable& operator=(decltype(nullptr)); + IPlayable& operator=(IPlayable&& other); + bool operator==(const IPlayable& other) const; + bool operator!=(const IPlayable& other) const; + }; } } namespace System { - namespace Collections + template<> struct IEquatable : virtual System::Object { - namespace Generic + IEquatable(decltype(nullptr)); + IEquatable(Plugin::InternalUse, int32_t handle); + IEquatable(const IEquatable& other); + IEquatable(IEquatable&& other); + virtual ~IEquatable(); + IEquatable& operator=(const IEquatable& other); + IEquatable& operator=(decltype(nullptr)); + IEquatable& operator=(IEquatable&& other); + bool operator==(const IEquatable& other) const; + bool operator!=(const IEquatable& other) const; + }; +} + +namespace UnityEngine +{ + namespace Animations + { + struct AnimationMixerPlayable : Plugin::ManagedType { - template<> struct IEnumerable : virtual System::Collections::IEnumerable - { - IEnumerable(decltype(nullptr)); - IEnumerable(Plugin::InternalUse iu, int32_t handle); - IEnumerable(const IEnumerable& other); - IEnumerable(IEnumerable&& other); - virtual ~IEnumerable(); - IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr)); - IEnumerable& operator=(IEnumerable&& other); - bool operator==(const IEnumerable& other) const; - bool operator!=(const IEnumerable& other) const; - System::Collections::Generic::IEnumerator GetEnumerator(); - }; - } + AnimationMixerPlayable(decltype(nullptr)); + AnimationMixerPlayable(Plugin::InternalUse, int32_t handle); + AnimationMixerPlayable(const AnimationMixerPlayable& other); + AnimationMixerPlayable(AnimationMixerPlayable&& other); + virtual ~AnimationMixerPlayable(); + AnimationMixerPlayable& operator=(const AnimationMixerPlayable& other); + AnimationMixerPlayable& operator=(decltype(nullptr)); + AnimationMixerPlayable& operator=(AnimationMixerPlayable&& other); + bool operator==(const AnimationMixerPlayable& other) const; + bool operator!=(const AnimationMixerPlayable& other) const; + static UnityEngine::Animations::AnimationMixerPlayable Create(UnityEngine::Playables::PlayableGraph& graph, System::Int32 inputCount = 0, System::Boolean normalizeWeights = false); + explicit operator System::ValueType(); + explicit operator System::Object(); + explicit operator UnityEngine::Playables::IPlayable(); + explicit operator System::IEquatable(); + }; } } namespace System { - namespace Collections + namespace Runtime { - namespace Generic + namespace CompilerServices { - template<> struct IEnumerable : virtual System::Collections::IEnumerable + struct IStrongBox : virtual System::Object { - IEnumerable(decltype(nullptr)); - IEnumerable(Plugin::InternalUse iu, int32_t handle); - IEnumerable(const IEnumerable& other); - IEnumerable(IEnumerable&& other); - virtual ~IEnumerable(); - IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr)); - IEnumerable& operator=(IEnumerable&& other); - bool operator==(const IEnumerable& other) const; - bool operator!=(const IEnumerable& other) const; - System::Collections::Generic::IEnumerator GetEnumerator(); + IStrongBox(decltype(nullptr)); + IStrongBox(Plugin::InternalUse, int32_t handle); + IStrongBox(const IStrongBox& other); + IStrongBox(IStrongBox&& other); + virtual ~IStrongBox(); + IStrongBox& operator=(const IStrongBox& other); + IStrongBox& operator=(decltype(nullptr)); + IStrongBox& operator=(IStrongBox&& other); + bool operator==(const IStrongBox& other) const; + bool operator!=(const IStrongBox& other) const; }; } } } -namespace System +namespace UnityEngine { - namespace Collections + namespace Experimental { - namespace Generic + namespace UIElements { - template<> struct ICollection : virtual System::Collections::Generic::IEnumerable + struct IEventHandler : virtual System::Object { - ICollection(decltype(nullptr)); - ICollection(Plugin::InternalUse iu, int32_t handle); - ICollection(const ICollection& other); - ICollection(ICollection&& other); - virtual ~ICollection(); - ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr)); - ICollection& operator=(ICollection&& other); - bool operator==(const ICollection& other) const; - bool operator!=(const ICollection& other) const; + IEventHandler(decltype(nullptr)); + IEventHandler(Plugin::InternalUse, int32_t handle); + IEventHandler(const IEventHandler& other); + IEventHandler(IEventHandler&& other); + virtual ~IEventHandler(); + IEventHandler& operator=(const IEventHandler& other); + IEventHandler& operator=(decltype(nullptr)); + IEventHandler& operator=(IEventHandler&& other); + bool operator==(const IEventHandler& other) const; + bool operator!=(const IEventHandler& other) const; }; } } } -namespace Plugin -{ - struct SystemCollectionsGenericICollectionSystemStringIterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericICollectionSystemStringIterator(decltype(nullptr)); - SystemCollectionsGenericICollectionSystemStringIterator(System::Collections::Generic::ICollection& enumerable); - ~SystemCollectionsGenericICollectionSystemStringIterator(); - SystemCollectionsGenericICollectionSystemStringIterator& operator++(); - bool operator!=(const SystemCollectionsGenericICollectionSystemStringIterator& other); - System::String operator*(); - }; -} - -namespace System +namespace UnityEngine { - namespace Collections + namespace Experimental { - namespace Generic + namespace UIElements { - Plugin::SystemCollectionsGenericICollectionSystemStringIterator begin(System::Collections::Generic::ICollection& enumerable); - Plugin::SystemCollectionsGenericICollectionSystemStringIterator end(System::Collections::Generic::ICollection& enumerable); + struct CallbackEventHandler : virtual UnityEngine::Experimental::UIElements::IEventHandler + { + CallbackEventHandler(decltype(nullptr)); + CallbackEventHandler(Plugin::InternalUse, int32_t handle); + CallbackEventHandler(const CallbackEventHandler& other); + CallbackEventHandler(CallbackEventHandler&& other); + virtual ~CallbackEventHandler(); + CallbackEventHandler& operator=(const CallbackEventHandler& other); + CallbackEventHandler& operator=(decltype(nullptr)); + CallbackEventHandler& operator=(CallbackEventHandler&& other); + bool operator==(const CallbackEventHandler& other) const; + bool operator!=(const CallbackEventHandler& other) const; + }; } } } -namespace System +namespace UnityEngine { - namespace Collections + namespace Experimental { - namespace Generic + namespace UIElements { - template<> struct ICollection : virtual System::Collections::Generic::IEnumerable + struct Focusable : virtual UnityEngine::Experimental::UIElements::CallbackEventHandler, virtual UnityEngine::Experimental::UIElements::IEventHandler { - ICollection(decltype(nullptr)); - ICollection(Plugin::InternalUse iu, int32_t handle); - ICollection(const ICollection& other); - ICollection(ICollection&& other); - virtual ~ICollection(); - ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr)); - ICollection& operator=(ICollection&& other); - bool operator==(const ICollection& other) const; - bool operator!=(const ICollection& other) const; + Focusable(decltype(nullptr)); + Focusable(Plugin::InternalUse, int32_t handle); + Focusable(const Focusable& other); + Focusable(Focusable&& other); + virtual ~Focusable(); + Focusable& operator=(const Focusable& other); + Focusable& operator=(decltype(nullptr)); + Focusable& operator=(Focusable&& other); + bool operator==(const Focusable& other) const; + bool operator!=(const Focusable& other) const; }; } } } -namespace Plugin -{ - struct SystemCollectionsGenericICollectionSystemInt32Iterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericICollectionSystemInt32Iterator(decltype(nullptr)); - SystemCollectionsGenericICollectionSystemInt32Iterator(System::Collections::Generic::ICollection& enumerable); - ~SystemCollectionsGenericICollectionSystemInt32Iterator(); - SystemCollectionsGenericICollectionSystemInt32Iterator& operator++(); - bool operator!=(const SystemCollectionsGenericICollectionSystemInt32Iterator& other); - int32_t operator*(); - }; -} - -namespace System +namespace UnityEngine { - namespace Collections + namespace Experimental { - namespace Generic + namespace UIElements { - Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator begin(System::Collections::Generic::ICollection& enumerable); - Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator end(System::Collections::Generic::ICollection& enumerable); + struct IStyle : virtual System::Object + { + IStyle(decltype(nullptr)); + IStyle(Plugin::InternalUse, int32_t handle); + IStyle(const IStyle& other); + IStyle(IStyle&& other); + virtual ~IStyle(); + IStyle& operator=(const IStyle& other); + IStyle& operator=(decltype(nullptr)); + IStyle& operator=(IStyle&& other); + bool operator==(const IStyle& other) const; + bool operator!=(const IStyle& other) const; + }; } } } namespace System { - namespace Collections + namespace Diagnostics { - namespace Generic + struct Stopwatch : virtual System::Object { - template<> struct ICollection : virtual System::Collections::Generic::IEnumerable - { - ICollection(decltype(nullptr)); - ICollection(Plugin::InternalUse iu, int32_t handle); - ICollection(const ICollection& other); - ICollection(ICollection&& other); - virtual ~ICollection(); - ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr)); - ICollection& operator=(ICollection&& other); - bool operator==(const ICollection& other) const; - bool operator!=(const ICollection& other) const; - }; - } + Stopwatch(decltype(nullptr)); + Stopwatch(Plugin::InternalUse, int32_t handle); + Stopwatch(const Stopwatch& other); + Stopwatch(Stopwatch&& other); + virtual ~Stopwatch(); + Stopwatch& operator=(const Stopwatch& other); + Stopwatch& operator=(decltype(nullptr)); + Stopwatch& operator=(Stopwatch&& other); + bool operator==(const Stopwatch& other) const; + bool operator!=(const Stopwatch& other) const; + Stopwatch(); + System::Int64 GetElapsedMilliseconds(); + void Start(); + void Reset(); + }; } } -namespace Plugin +namespace UnityEngine { - struct SystemCollectionsGenericICollectionSystemSingleIterator + struct GameObject : virtual UnityEngine::Object { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericICollectionSystemSingleIterator(decltype(nullptr)); - SystemCollectionsGenericICollectionSystemSingleIterator(System::Collections::Generic::ICollection& enumerable); - ~SystemCollectionsGenericICollectionSystemSingleIterator(); - SystemCollectionsGenericICollectionSystemSingleIterator& operator++(); - bool operator!=(const SystemCollectionsGenericICollectionSystemSingleIterator& other); - float operator*(); + GameObject(decltype(nullptr)); + GameObject(Plugin::InternalUse, int32_t handle); + GameObject(const GameObject& other); + GameObject(GameObject&& other); + virtual ~GameObject(); + GameObject& operator=(const GameObject& other); + GameObject& operator=(decltype(nullptr)); + GameObject& operator=(GameObject&& other); + bool operator==(const GameObject& other) const; + bool operator!=(const GameObject& other) const; + GameObject(); + GameObject(System::String& name); + UnityEngine::Transform GetTransform(); + template MT0 AddComponent(); + static UnityEngine::GameObject CreatePrimitive(UnityEngine::PrimitiveType type); }; } -namespace System +namespace UnityEngine { - namespace Collections + struct Debug : virtual System::Object { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionSystemSingleIterator begin(System::Collections::Generic::ICollection& enumerable); - Plugin::SystemCollectionsGenericICollectionSystemSingleIterator end(System::Collections::Generic::ICollection& enumerable); - } - } + Debug(decltype(nullptr)); + Debug(Plugin::InternalUse, int32_t handle); + Debug(const Debug& other); + Debug(Debug&& other); + virtual ~Debug(); + Debug& operator=(const Debug& other); + Debug& operator=(decltype(nullptr)); + Debug& operator=(Debug&& other); + bool operator==(const Debug& other) const; + bool operator!=(const Debug& other) const; + static void Log(System::Object& message); + }; } -namespace System +namespace UnityEngine { - namespace Collections + namespace Assertions { - namespace Generic + namespace Assert { - template<> struct ICollection : virtual System::Collections::Generic::IEnumerable - { - ICollection(decltype(nullptr)); - ICollection(Plugin::InternalUse iu, int32_t handle); - ICollection(const ICollection& other); - ICollection(ICollection&& other); - virtual ~ICollection(); - ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr)); - ICollection& operator=(ICollection&& other); - bool operator==(const ICollection& other) const; - bool operator!=(const ICollection& other) const; - }; + System::Boolean GetRaiseExceptions(); + void SetRaiseExceptions(System::Boolean value); + template void AreEqual(MT0& expected, MT0& actual); } } } -namespace Plugin +namespace UnityEngine { - struct SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator + struct Collision : virtual System::Object { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(decltype(nullptr)); - SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(System::Collections::Generic::ICollection& enumerable); - ~SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(); - SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& operator++(); - bool operator!=(const SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& other); - UnityEngine::RaycastHit operator*(); + Collision(decltype(nullptr)); + Collision(Plugin::InternalUse, int32_t handle); + Collision(const Collision& other); + Collision(Collision&& other); + virtual ~Collision(); + Collision& operator=(const Collision& other); + Collision& operator=(decltype(nullptr)); + Collision& operator=(Collision&& other); + bool operator==(const Collision& other) const; + bool operator!=(const Collision& other) const; }; } -namespace System +namespace UnityEngine { - namespace Collections + struct Behaviour : virtual UnityEngine::Component { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator begin(System::Collections::Generic::ICollection& enumerable); - Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator end(System::Collections::Generic::ICollection& enumerable); - } - } + Behaviour(decltype(nullptr)); + Behaviour(Plugin::InternalUse, int32_t handle); + Behaviour(const Behaviour& other); + Behaviour(Behaviour&& other); + virtual ~Behaviour(); + Behaviour& operator=(const Behaviour& other); + Behaviour& operator=(decltype(nullptr)); + Behaviour& operator=(Behaviour&& other); + bool operator==(const Behaviour& other) const; + bool operator!=(const Behaviour& other) const; + }; } -namespace System +namespace UnityEngine { - namespace Collections + struct MonoBehaviour : virtual UnityEngine::Behaviour { - namespace Generic - { - template<> struct ICollection : virtual System::Collections::Generic::IEnumerable - { - ICollection(decltype(nullptr)); - ICollection(Plugin::InternalUse iu, int32_t handle); - ICollection(const ICollection& other); - ICollection(ICollection&& other); - virtual ~ICollection(); - ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr)); - ICollection& operator=(ICollection&& other); - bool operator==(const ICollection& other) const; - bool operator!=(const ICollection& other) const; - }; - } - } + MonoBehaviour(decltype(nullptr)); + MonoBehaviour(Plugin::InternalUse, int32_t handle); + MonoBehaviour(const MonoBehaviour& other); + MonoBehaviour(MonoBehaviour&& other); + virtual ~MonoBehaviour(); + MonoBehaviour& operator=(const MonoBehaviour& other); + MonoBehaviour& operator=(decltype(nullptr)); + MonoBehaviour& operator=(MonoBehaviour&& other); + bool operator==(const MonoBehaviour& other) const; + bool operator!=(const MonoBehaviour& other) const; + UnityEngine::Transform GetTransform(); + }; } -namespace Plugin +namespace UnityEngine { - struct SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator + struct AudioSettings : virtual System::Object { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(decltype(nullptr)); - SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(System::Collections::Generic::ICollection& enumerable); - ~SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(); - SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& operator++(); - bool operator!=(const SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& other); - UnityEngine::GradientColorKey operator*(); + AudioSettings(decltype(nullptr)); + AudioSettings(Plugin::InternalUse, int32_t handle); + AudioSettings(const AudioSettings& other); + AudioSettings(AudioSettings&& other); + virtual ~AudioSettings(); + AudioSettings& operator=(const AudioSettings& other); + AudioSettings& operator=(decltype(nullptr)); + AudioSettings& operator=(AudioSettings&& other); + bool operator==(const AudioSettings& other) const; + bool operator!=(const AudioSettings& other) const; + static void GetDSPBufferSize(System::Int32* bufferLength, System::Int32* numBuffers); }; } -namespace System +namespace UnityEngine { - namespace Collections + namespace Networking { - namespace Generic + struct NetworkTransport : virtual System::Object { - Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::ICollection& enumerable); - Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator end(System::Collections::Generic::ICollection& enumerable); - } + NetworkTransport(decltype(nullptr)); + NetworkTransport(Plugin::InternalUse, int32_t handle); + NetworkTransport(const NetworkTransport& other); + NetworkTransport(NetworkTransport&& other); + virtual ~NetworkTransport(); + NetworkTransport& operator=(const NetworkTransport& other); + NetworkTransport& operator=(decltype(nullptr)); + NetworkTransport& operator=(NetworkTransport&& other); + bool operator==(const NetworkTransport& other) const; + bool operator!=(const NetworkTransport& other) const; + static void GetBroadcastConnectionInfo(System::Int32 hostId, System::String* address, System::Int32* port, System::Byte* error); + static void Init(); + }; } } -namespace System +namespace UnityEngine { - namespace Collections + struct Quaternion { - namespace Generic - { - template<> struct ICollection : virtual System::Collections::Generic::IEnumerable - { - ICollection(decltype(nullptr)); - ICollection(Plugin::InternalUse iu, int32_t handle); - ICollection(const ICollection& other); - ICollection(ICollection&& other); - virtual ~ICollection(); - ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr)); - ICollection& operator=(ICollection&& other); - bool operator==(const ICollection& other) const; - bool operator!=(const ICollection& other) const; - }; - } - } + Quaternion(); + System::Single x; + System::Single y; + System::Single z; + System::Single w; + explicit operator System::ValueType(); + explicit operator System::Object(); + }; } -namespace Plugin +namespace UnityEngine { - struct SystemCollectionsGenericICollectionUnityEngineResolutionIterator + struct Matrix4x4 { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericICollectionUnityEngineResolutionIterator(decltype(nullptr)); - SystemCollectionsGenericICollectionUnityEngineResolutionIterator(System::Collections::Generic::ICollection& enumerable); - ~SystemCollectionsGenericICollectionUnityEngineResolutionIterator(); - SystemCollectionsGenericICollectionUnityEngineResolutionIterator& operator++(); - bool operator!=(const SystemCollectionsGenericICollectionUnityEngineResolutionIterator& other); - UnityEngine::Resolution operator*(); + Matrix4x4(); + System::Single GetItem(System::Int32 row, System::Int32 column); + void SetItem(System::Int32 row, System::Int32 column, System::Single value); + System::Single m00; + System::Single m10; + System::Single m20; + System::Single m30; + System::Single m01; + System::Single m11; + System::Single m21; + System::Single m31; + System::Single m02; + System::Single m12; + System::Single m22; + System::Single m32; + System::Single m03; + System::Single m13; + System::Single m23; + System::Single m33; + explicit operator System::ValueType(); + explicit operator System::Object(); }; } -namespace System +namespace UnityEngine { - namespace Collections + struct QueryTriggerInteraction { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator begin(System::Collections::Generic::ICollection& enumerable); - Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator end(System::Collections::Generic::ICollection& enumerable); - } - } + int32_t Value; + static const UnityEngine::QueryTriggerInteraction UseGlobal; + static const UnityEngine::QueryTriggerInteraction Ignore; + static const UnityEngine::QueryTriggerInteraction Collide; + explicit QueryTriggerInteraction(int32_t value); + explicit operator int32_t() const; + bool operator==(QueryTriggerInteraction other); + bool operator!=(QueryTriggerInteraction other); + explicit operator System::Enum(); + explicit operator System::ValueType(); + explicit operator System::Object(); + explicit operator System::IFormattable(); + explicit operator System::IConvertible(); + explicit operator System::IComparable(); + }; } namespace System @@ -2506,318 +2650,396 @@ namespace System { namespace Generic { - template<> struct IList : virtual System::Collections::Generic::ICollection + template<> struct KeyValuePair : Plugin::ManagedType { - IList(decltype(nullptr)); - IList(Plugin::InternalUse iu, int32_t handle); - IList(const IList& other); - IList(IList&& other); - virtual ~IList(); - IList& operator=(const IList& other); - IList& operator=(decltype(nullptr)); - IList& operator=(IList&& other); - bool operator==(const IList& other) const; - bool operator!=(const IList& other) const; + KeyValuePair(decltype(nullptr)); + KeyValuePair(Plugin::InternalUse, int32_t handle); + KeyValuePair(const KeyValuePair& other); + KeyValuePair(KeyValuePair&& other); + virtual ~KeyValuePair(); + KeyValuePair& operator=(const KeyValuePair& other); + KeyValuePair& operator=(decltype(nullptr)); + KeyValuePair& operator=(KeyValuePair&& other); + bool operator==(const KeyValuePair& other) const; + bool operator!=(const KeyValuePair& other) const; + KeyValuePair(System::String& key, System::Double value); + System::String GetKey(); + System::Double GetValue(); + explicit operator System::ValueType(); + explicit operator System::Object(); }; } } } -namespace Plugin -{ - struct SystemCollectionsGenericIListSystemStringIterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericIListSystemStringIterator(decltype(nullptr)); - SystemCollectionsGenericIListSystemStringIterator(System::Collections::Generic::IList& enumerable); - ~SystemCollectionsGenericIListSystemStringIterator(); - SystemCollectionsGenericIListSystemStringIterator& operator++(); - bool operator!=(const SystemCollectionsGenericIListSystemStringIterator& other); - System::String operator*(); - }; -} - namespace System { namespace Collections { namespace Generic { - Plugin::SystemCollectionsGenericIListSystemStringIterator begin(System::Collections::Generic::IList& enumerable); - Plugin::SystemCollectionsGenericIListSystemStringIterator end(System::Collections::Generic::IList& enumerable); + template<> struct LinkedListNode : virtual System::Object + { + LinkedListNode(decltype(nullptr)); + LinkedListNode(Plugin::InternalUse, int32_t handle); + LinkedListNode(const LinkedListNode& other); + LinkedListNode(LinkedListNode&& other); + virtual ~LinkedListNode(); + LinkedListNode& operator=(const LinkedListNode& other); + LinkedListNode& operator=(decltype(nullptr)); + LinkedListNode& operator=(LinkedListNode&& other); + bool operator==(const LinkedListNode& other) const; + bool operator!=(const LinkedListNode& other) const; + LinkedListNode(System::String& value); + System::String GetValue(); + void SetValue(System::String& value); + }; } } } namespace System { - namespace Collections + namespace Runtime { - namespace Generic + namespace CompilerServices { - template<> struct IList : virtual System::Collections::Generic::ICollection + template<> struct StrongBox : virtual System::Runtime::CompilerServices::IStrongBox { - IList(decltype(nullptr)); - IList(Plugin::InternalUse iu, int32_t handle); - IList(const IList& other); - IList(IList&& other); - virtual ~IList(); - IList& operator=(const IList& other); - IList& operator=(decltype(nullptr)); - IList& operator=(IList&& other); - bool operator==(const IList& other) const; - bool operator!=(const IList& other) const; + StrongBox(decltype(nullptr)); + StrongBox(Plugin::InternalUse, int32_t handle); + StrongBox(const StrongBox& other); + StrongBox(StrongBox&& other); + virtual ~StrongBox(); + StrongBox& operator=(const StrongBox& other); + StrongBox& operator=(decltype(nullptr)); + StrongBox& operator=(StrongBox&& other); + bool operator==(const StrongBox& other) const; + bool operator!=(const StrongBox& other) const; + StrongBox(System::String& value); + System::String GetValue(); + void SetValue(System::String& value); }; } } } -namespace Plugin +namespace System { - struct SystemCollectionsGenericIListSystemInt32Iterator + struct Exception : virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericIListSystemInt32Iterator(decltype(nullptr)); - SystemCollectionsGenericIListSystemInt32Iterator(System::Collections::Generic::IList& enumerable); - ~SystemCollectionsGenericIListSystemInt32Iterator(); - SystemCollectionsGenericIListSystemInt32Iterator& operator++(); - bool operator!=(const SystemCollectionsGenericIListSystemInt32Iterator& other); - int32_t operator*(); + Exception(decltype(nullptr)); + Exception(Plugin::InternalUse, int32_t handle); + Exception(const Exception& other); + Exception(Exception&& other); + virtual ~Exception(); + Exception& operator=(const Exception& other); + Exception& operator=(decltype(nullptr)); + Exception& operator=(Exception&& other); + bool operator==(const Exception& other) const; + bool operator!=(const Exception& other) const; + Exception(System::String& message); }; } namespace System { - namespace Collections + struct SystemException : virtual System::Exception, virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable { - namespace Generic - { - Plugin::SystemCollectionsGenericIListSystemInt32Iterator begin(System::Collections::Generic::IList& enumerable); - Plugin::SystemCollectionsGenericIListSystemInt32Iterator end(System::Collections::Generic::IList& enumerable); - } - } + SystemException(decltype(nullptr)); + SystemException(Plugin::InternalUse, int32_t handle); + SystemException(const SystemException& other); + SystemException(SystemException&& other); + virtual ~SystemException(); + SystemException& operator=(const SystemException& other); + SystemException& operator=(decltype(nullptr)); + SystemException& operator=(SystemException&& other); + bool operator==(const SystemException& other) const; + bool operator!=(const SystemException& other) const; + }; } namespace System { - namespace Collections + struct NullReferenceException : virtual System::SystemException, virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable { - namespace Generic - { - template<> struct IList : virtual System::Collections::Generic::ICollection - { - IList(decltype(nullptr)); - IList(Plugin::InternalUse iu, int32_t handle); - IList(const IList& other); - IList(IList&& other); - virtual ~IList(); - IList& operator=(const IList& other); - IList& operator=(decltype(nullptr)); - IList& operator=(IList&& other); - bool operator==(const IList& other) const; - bool operator!=(const IList& other) const; - }; - } - } + NullReferenceException(decltype(nullptr)); + NullReferenceException(Plugin::InternalUse, int32_t handle); + NullReferenceException(const NullReferenceException& other); + NullReferenceException(NullReferenceException&& other); + virtual ~NullReferenceException(); + NullReferenceException& operator=(const NullReferenceException& other); + NullReferenceException& operator=(decltype(nullptr)); + NullReferenceException& operator=(NullReferenceException&& other); + bool operator==(const NullReferenceException& other) const; + bool operator!=(const NullReferenceException& other) const; + }; } -namespace Plugin +namespace UnityEngine { - struct SystemCollectionsGenericIListSystemSingleIterator + struct Screen : virtual System::Object { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericIListSystemSingleIterator(decltype(nullptr)); - SystemCollectionsGenericIListSystemSingleIterator(System::Collections::Generic::IList& enumerable); - ~SystemCollectionsGenericIListSystemSingleIterator(); - SystemCollectionsGenericIListSystemSingleIterator& operator++(); - bool operator!=(const SystemCollectionsGenericIListSystemSingleIterator& other); - float operator*(); + Screen(decltype(nullptr)); + Screen(Plugin::InternalUse, int32_t handle); + Screen(const Screen& other); + Screen(Screen&& other); + virtual ~Screen(); + Screen& operator=(const Screen& other); + Screen& operator=(decltype(nullptr)); + Screen& operator=(Screen&& other); + bool operator==(const Screen& other) const; + bool operator!=(const Screen& other) const; + static System::Array1 GetResolutions(); }; } -namespace System +namespace UnityEngine { - namespace Collections + struct Ray : Plugin::ManagedType { - namespace Generic - { - Plugin::SystemCollectionsGenericIListSystemSingleIterator begin(System::Collections::Generic::IList& enumerable); - Plugin::SystemCollectionsGenericIListSystemSingleIterator end(System::Collections::Generic::IList& enumerable); - } - } + Ray(decltype(nullptr)); + Ray(Plugin::InternalUse, int32_t handle); + Ray(const Ray& other); + Ray(Ray&& other); + virtual ~Ray(); + Ray& operator=(const Ray& other); + Ray& operator=(decltype(nullptr)); + Ray& operator=(Ray&& other); + bool operator==(const Ray& other) const; + bool operator!=(const Ray& other) const; + Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); + explicit operator System::ValueType(); + explicit operator System::Object(); + }; } -namespace System +namespace UnityEngine { - namespace Collections + struct Physics : virtual System::Object { - namespace Generic - { - template<> struct IList : virtual System::Collections::Generic::ICollection - { - IList(decltype(nullptr)); - IList(Plugin::InternalUse iu, int32_t handle); - IList(const IList& other); - IList(IList&& other); - virtual ~IList(); - IList& operator=(const IList& other); - IList& operator=(decltype(nullptr)); - IList& operator=(IList&& other); - bool operator==(const IList& other) const; - bool operator!=(const IList& other) const; - }; - } - } + Physics(decltype(nullptr)); + Physics(Plugin::InternalUse, int32_t handle); + Physics(const Physics& other); + Physics(Physics&& other); + virtual ~Physics(); + Physics& operator=(const Physics& other); + Physics& operator=(decltype(nullptr)); + Physics& operator=(Physics&& other); + bool operator==(const Physics& other) const; + bool operator!=(const Physics& other) const; + static System::Int32 RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1& results); + static System::Array1 RaycastAll(UnityEngine::Ray& ray); + }; } -namespace Plugin +namespace UnityEngine { - struct SystemCollectionsGenericIListUnityEngineRaycastHitIterator + struct Gradient : virtual System::Object { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericIListUnityEngineRaycastHitIterator(decltype(nullptr)); - SystemCollectionsGenericIListUnityEngineRaycastHitIterator(System::Collections::Generic::IList& enumerable); - ~SystemCollectionsGenericIListUnityEngineRaycastHitIterator(); - SystemCollectionsGenericIListUnityEngineRaycastHitIterator& operator++(); - bool operator!=(const SystemCollectionsGenericIListUnityEngineRaycastHitIterator& other); - UnityEngine::RaycastHit operator*(); + Gradient(decltype(nullptr)); + Gradient(Plugin::InternalUse, int32_t handle); + Gradient(const Gradient& other); + Gradient(Gradient&& other); + virtual ~Gradient(); + Gradient& operator=(const Gradient& other); + Gradient& operator=(decltype(nullptr)); + Gradient& operator=(Gradient&& other); + bool operator==(const Gradient& other) const; + bool operator!=(const Gradient& other) const; + Gradient(); + System::Array1 GetColorKeys(); + void SetColorKeys(System::Array1& value); }; } namespace System { - namespace Collections + struct AppDomainSetup : virtual System::IAppDomainSetup { - namespace Generic - { - Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator begin(System::Collections::Generic::IList& enumerable); - Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator end(System::Collections::Generic::IList& enumerable); - } - } + AppDomainSetup(decltype(nullptr)); + AppDomainSetup(Plugin::InternalUse, int32_t handle); + AppDomainSetup(const AppDomainSetup& other); + AppDomainSetup(AppDomainSetup&& other); + virtual ~AppDomainSetup(); + AppDomainSetup& operator=(const AppDomainSetup& other); + AppDomainSetup& operator=(decltype(nullptr)); + AppDomainSetup& operator=(AppDomainSetup&& other); + bool operator==(const AppDomainSetup& other) const; + bool operator!=(const AppDomainSetup& other) const; + AppDomainSetup(); + System::AppDomainInitializer GetAppDomainInitializer(); + void SetAppDomainInitializer(System::AppDomainInitializer& value); + }; } -namespace System +namespace UnityEngine { - namespace Collections + struct Application : virtual System::Object { - namespace Generic + Application(decltype(nullptr)); + Application(Plugin::InternalUse, int32_t handle); + Application(const Application& other); + Application(Application&& other); + virtual ~Application(); + Application& operator=(const Application& other); + Application& operator=(decltype(nullptr)); + Application& operator=(Application&& other); + bool operator==(const Application& other) const; + bool operator!=(const Application& other) const; + static void AddOnBeforeRender(UnityEngine::Events::UnityAction& del); + static void RemoveOnBeforeRender(UnityEngine::Events::UnityAction& del); + }; +} + +namespace UnityEngine +{ + namespace SceneManagement + { + struct SceneManager : virtual System::Object { - template<> struct IList : virtual System::Collections::Generic::ICollection - { - IList(decltype(nullptr)); - IList(Plugin::InternalUse iu, int32_t handle); - IList(const IList& other); - IList(IList&& other); - virtual ~IList(); - IList& operator=(const IList& other); - IList& operator=(decltype(nullptr)); - IList& operator=(IList&& other); - bool operator==(const IList& other) const; - bool operator!=(const IList& other) const; - }; - } + SceneManager(decltype(nullptr)); + SceneManager(Plugin::InternalUse, int32_t handle); + SceneManager(const SceneManager& other); + SceneManager(SceneManager&& other); + virtual ~SceneManager(); + SceneManager& operator=(const SceneManager& other); + SceneManager& operator=(decltype(nullptr)); + SceneManager& operator=(SceneManager&& other); + bool operator==(const SceneManager& other) const; + bool operator!=(const SceneManager& other) const; + static void AddSceneLoaded(UnityEngine::Events::UnityAction2& del); + static void RemoveSceneLoaded(UnityEngine::Events::UnityAction2& del); + }; } } -namespace Plugin +namespace UnityEngine { - struct SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator + namespace SceneManagement { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(decltype(nullptr)); - SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(System::Collections::Generic::IList& enumerable); - ~SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(); - SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& operator++(); - bool operator!=(const SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& other); - UnityEngine::GradientColorKey operator*(); - }; + struct Scene : Plugin::ManagedType + { + Scene(decltype(nullptr)); + Scene(Plugin::InternalUse, int32_t handle); + Scene(const Scene& other); + Scene(Scene&& other); + virtual ~Scene(); + Scene& operator=(const Scene& other); + Scene& operator=(decltype(nullptr)); + Scene& operator=(Scene&& other); + bool operator==(const Scene& other) const; + bool operator!=(const Scene& other) const; + explicit operator System::ValueType(); + explicit operator System::Object(); + }; + } } -namespace System +namespace UnityEngine { - namespace Collections + namespace SceneManagement { - namespace Generic - { - Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::IList& enumerable); - Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator end(System::Collections::Generic::IList& enumerable); - } + struct LoadSceneMode + { + int32_t Value; + static const UnityEngine::SceneManagement::LoadSceneMode Single; + static const UnityEngine::SceneManagement::LoadSceneMode Additive; + explicit LoadSceneMode(int32_t value); + explicit operator int32_t() const; + bool operator==(LoadSceneMode other); + bool operator!=(LoadSceneMode other); + explicit operator System::Enum(); + explicit operator System::ValueType(); + explicit operator System::Object(); + explicit operator System::IFormattable(); + explicit operator System::IConvertible(); + explicit operator System::IComparable(); + }; } } namespace System { - namespace Collections + struct EventArgs : virtual System::Object { - namespace Generic - { - template<> struct IList : virtual System::Collections::Generic::ICollection - { - IList(decltype(nullptr)); - IList(Plugin::InternalUse iu, int32_t handle); - IList(const IList& other); - IList(IList&& other); - virtual ~IList(); - IList& operator=(const IList& other); - IList& operator=(decltype(nullptr)); - IList& operator=(IList&& other); - bool operator==(const IList& other) const; - bool operator!=(const IList& other) const; - }; - } - } + EventArgs(decltype(nullptr)); + EventArgs(Plugin::InternalUse, int32_t handle); + EventArgs(const EventArgs& other); + EventArgs(EventArgs&& other); + virtual ~EventArgs(); + EventArgs& operator=(const EventArgs& other); + EventArgs& operator=(decltype(nullptr)); + EventArgs& operator=(EventArgs&& other); + bool operator==(const EventArgs& other) const; + bool operator!=(const EventArgs& other) const; + }; } -namespace Plugin +namespace System { - struct SystemCollectionsGenericIListUnityEngineResolutionIterator + namespace ComponentModel { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericIListUnityEngineResolutionIterator(decltype(nullptr)); - SystemCollectionsGenericIListUnityEngineResolutionIterator(System::Collections::Generic::IList& enumerable); - ~SystemCollectionsGenericIListUnityEngineResolutionIterator(); - SystemCollectionsGenericIListUnityEngineResolutionIterator& operator++(); - bool operator!=(const SystemCollectionsGenericIListUnityEngineResolutionIterator& other); - UnityEngine::Resolution operator*(); - }; + namespace Design + { + struct ComponentEventArgs : virtual System::EventArgs + { + ComponentEventArgs(decltype(nullptr)); + ComponentEventArgs(Plugin::InternalUse, int32_t handle); + ComponentEventArgs(const ComponentEventArgs& other); + ComponentEventArgs(ComponentEventArgs&& other); + virtual ~ComponentEventArgs(); + ComponentEventArgs& operator=(const ComponentEventArgs& other); + ComponentEventArgs& operator=(decltype(nullptr)); + ComponentEventArgs& operator=(ComponentEventArgs&& other); + bool operator==(const ComponentEventArgs& other) const; + bool operator!=(const ComponentEventArgs& other) const; + }; + } + } } namespace System { - namespace Collections + namespace ComponentModel { - namespace Generic + namespace Design { - Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator begin(System::Collections::Generic::IList& enumerable); - Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator end(System::Collections::Generic::IList& enumerable); + struct ComponentChangingEventArgs : virtual System::EventArgs + { + ComponentChangingEventArgs(decltype(nullptr)); + ComponentChangingEventArgs(Plugin::InternalUse, int32_t handle); + ComponentChangingEventArgs(const ComponentChangingEventArgs& other); + ComponentChangingEventArgs(ComponentChangingEventArgs&& other); + virtual ~ComponentChangingEventArgs(); + ComponentChangingEventArgs& operator=(const ComponentChangingEventArgs& other); + ComponentChangingEventArgs& operator=(decltype(nullptr)); + ComponentChangingEventArgs& operator=(ComponentChangingEventArgs&& other); + bool operator==(const ComponentChangingEventArgs& other) const; + bool operator!=(const ComponentChangingEventArgs& other) const; + }; } } } namespace System { - namespace Runtime + namespace ComponentModel { - namespace Serialization + namespace Design { - struct ISerializable : virtual System::Object + struct ComponentChangedEventArgs : virtual System::EventArgs { - ISerializable(decltype(nullptr)); - ISerializable(Plugin::InternalUse iu, int32_t handle); - ISerializable(const ISerializable& other); - ISerializable(ISerializable&& other); - virtual ~ISerializable(); - ISerializable& operator=(const ISerializable& other); - ISerializable& operator=(decltype(nullptr)); - ISerializable& operator=(ISerializable&& other); - bool operator==(const ISerializable& other) const; - bool operator!=(const ISerializable& other) const; + ComponentChangedEventArgs(decltype(nullptr)); + ComponentChangedEventArgs(Plugin::InternalUse, int32_t handle); + ComponentChangedEventArgs(const ComponentChangedEventArgs& other); + ComponentChangedEventArgs(ComponentChangedEventArgs&& other); + virtual ~ComponentChangedEventArgs(); + ComponentChangedEventArgs& operator=(const ComponentChangedEventArgs& other); + ComponentChangedEventArgs& operator=(decltype(nullptr)); + ComponentChangedEventArgs& operator=(ComponentChangedEventArgs&& other); + bool operator==(const ComponentChangedEventArgs& other) const; + bool operator!=(const ComponentChangedEventArgs& other) const; }; } } @@ -2825,22 +3047,22 @@ namespace System namespace System { - namespace Runtime + namespace ComponentModel { - namespace InteropServices + namespace Design { - struct _Exception : virtual System::Object + struct ComponentRenameEventArgs : virtual System::EventArgs { - _Exception(decltype(nullptr)); - _Exception(Plugin::InternalUse iu, int32_t handle); - _Exception(const _Exception& other); - _Exception(_Exception&& other); - virtual ~_Exception(); - _Exception& operator=(const _Exception& other); - _Exception& operator=(decltype(nullptr)); - _Exception& operator=(_Exception&& other); - bool operator==(const _Exception& other) const; - bool operator!=(const _Exception& other) const; + ComponentRenameEventArgs(decltype(nullptr)); + ComponentRenameEventArgs(Plugin::InternalUse, int32_t handle); + ComponentRenameEventArgs(const ComponentRenameEventArgs& other); + ComponentRenameEventArgs(ComponentRenameEventArgs&& other); + virtual ~ComponentRenameEventArgs(); + ComponentRenameEventArgs& operator=(const ComponentRenameEventArgs& other); + ComponentRenameEventArgs& operator=(decltype(nullptr)); + ComponentRenameEventArgs& operator=(ComponentRenameEventArgs&& other); + bool operator==(const ComponentRenameEventArgs& other) const; + bool operator!=(const ComponentRenameEventArgs& other) const; }; } } @@ -2848,57 +3070,126 @@ namespace System namespace System { - struct IAppDomainSetup : virtual System::Object + namespace ComponentModel { - IAppDomainSetup(decltype(nullptr)); - IAppDomainSetup(Plugin::InternalUse iu, int32_t handle); - IAppDomainSetup(const IAppDomainSetup& other); - IAppDomainSetup(IAppDomainSetup&& other); - virtual ~IAppDomainSetup(); - IAppDomainSetup& operator=(const IAppDomainSetup& other); - IAppDomainSetup& operator=(decltype(nullptr)); - IAppDomainSetup& operator=(IAppDomainSetup&& other); - bool operator==(const IAppDomainSetup& other) const; - bool operator!=(const IAppDomainSetup& other) const; + struct MemberDescriptor : virtual System::Object + { + MemberDescriptor(decltype(nullptr)); + MemberDescriptor(Plugin::InternalUse, int32_t handle); + MemberDescriptor(const MemberDescriptor& other); + MemberDescriptor(MemberDescriptor&& other); + virtual ~MemberDescriptor(); + MemberDescriptor& operator=(const MemberDescriptor& other); + MemberDescriptor& operator=(decltype(nullptr)); + MemberDescriptor& operator=(MemberDescriptor&& other); + bool operator==(const MemberDescriptor& other) const; + bool operator!=(const MemberDescriptor& other) const; + }; + } +} + +namespace UnityEngine +{ + struct PrimitiveType + { + int32_t Value; + static const UnityEngine::PrimitiveType Sphere; + static const UnityEngine::PrimitiveType Capsule; + static const UnityEngine::PrimitiveType Cylinder; + static const UnityEngine::PrimitiveType Cube; + static const UnityEngine::PrimitiveType Plane; + static const UnityEngine::PrimitiveType Quad; + explicit PrimitiveType(int32_t value); + explicit operator int32_t() const; + bool operator==(PrimitiveType other); + bool operator!=(PrimitiveType other); + explicit operator System::Enum(); + explicit operator System::ValueType(); + explicit operator System::Object(); + explicit operator System::IFormattable(); + explicit operator System::IConvertible(); + explicit operator System::IComparable(); + }; +} + +namespace UnityEngine +{ + struct Time : virtual System::Object + { + Time(decltype(nullptr)); + Time(Plugin::InternalUse, int32_t handle); + Time(const Time& other); + Time(Time&& other); + virtual ~Time(); + Time& operator=(const Time& other); + Time& operator=(decltype(nullptr)); + Time& operator=(Time&& other); + bool operator==(const Time& other) const; + bool operator!=(const Time& other) const; + static System::Single GetDeltaTime(); }; } namespace System { - namespace Collections + namespace IO { - struct IComparer : virtual System::Object - { - IComparer(decltype(nullptr)); - IComparer(Plugin::InternalUse iu, int32_t handle); - IComparer(const IComparer& other); - IComparer(IComparer&& other); - virtual ~IComparer(); - IComparer& operator=(const IComparer& other); - IComparer& operator=(decltype(nullptr)); - IComparer& operator=(IComparer&& other); - bool operator==(const IComparer& other) const; - bool operator!=(const IComparer& other) const; + struct FileMode + { + int32_t Value; + static const System::IO::FileMode CreateNew; + static const System::IO::FileMode Create; + static const System::IO::FileMode Open; + static const System::IO::FileMode OpenOrCreate; + static const System::IO::FileMode Truncate; + static const System::IO::FileMode Append; + explicit FileMode(int32_t value); + explicit operator int32_t() const; + bool operator==(FileMode other); + bool operator!=(FileMode other); + explicit operator System::Enum(); + explicit operator System::ValueType(); + explicit operator System::Object(); + explicit operator System::IFormattable(); + explicit operator System::IConvertible(); + explicit operator System::IComparable(); }; } } namespace System { - namespace Collections + struct MarshalByRefObject : virtual System::Object { - struct IEqualityComparer : virtual System::Object + MarshalByRefObject(decltype(nullptr)); + MarshalByRefObject(Plugin::InternalUse, int32_t handle); + MarshalByRefObject(const MarshalByRefObject& other); + MarshalByRefObject(MarshalByRefObject&& other); + virtual ~MarshalByRefObject(); + MarshalByRefObject& operator=(const MarshalByRefObject& other); + MarshalByRefObject& operator=(decltype(nullptr)); + MarshalByRefObject& operator=(MarshalByRefObject&& other); + bool operator==(const MarshalByRefObject& other) const; + bool operator!=(const MarshalByRefObject& other) const; + }; +} + +namespace System +{ + namespace IO + { + struct Stream : virtual System::MarshalByRefObject, virtual System::IDisposable { - IEqualityComparer(decltype(nullptr)); - IEqualityComparer(Plugin::InternalUse iu, int32_t handle); - IEqualityComparer(const IEqualityComparer& other); - IEqualityComparer(IEqualityComparer&& other); - virtual ~IEqualityComparer(); - IEqualityComparer& operator=(const IEqualityComparer& other); - IEqualityComparer& operator=(decltype(nullptr)); - IEqualityComparer& operator=(IEqualityComparer&& other); - bool operator==(const IEqualityComparer& other) const; - bool operator!=(const IEqualityComparer& other) const; + Stream(decltype(nullptr)); + Stream(Plugin::InternalUse, int32_t handle); + Stream(const Stream& other); + Stream(Stream&& other); + virtual ~Stream(); + Stream& operator=(const Stream& other); + Stream& operator=(decltype(nullptr)); + Stream& operator=(Stream&& other); + bool operator==(const Stream& other) const; + bool operator!=(const Stream& other) const; }; } } @@ -2909,18 +3200,18 @@ namespace System { namespace Generic { - template<> struct IEqualityComparer : virtual System::Object + template<> struct IComparer : virtual System::Object { - IEqualityComparer(decltype(nullptr)); - IEqualityComparer(Plugin::InternalUse iu, int32_t handle); - IEqualityComparer(const IEqualityComparer& other); - IEqualityComparer(IEqualityComparer&& other); - virtual ~IEqualityComparer(); - IEqualityComparer& operator=(const IEqualityComparer& other); - IEqualityComparer& operator=(decltype(nullptr)); - IEqualityComparer& operator=(IEqualityComparer&& other); - bool operator==(const IEqualityComparer& other) const; - bool operator!=(const IEqualityComparer& other) const; + IComparer(decltype(nullptr)); + IComparer(Plugin::InternalUse, int32_t handle); + IComparer(const IComparer& other); + IComparer(IComparer&& other); + virtual ~IComparer(); + IComparer& operator=(const IComparer& other); + IComparer& operator=(decltype(nullptr)); + IComparer& operator=(IComparer&& other); + bool operator==(const IComparer& other) const; + bool operator!=(const IComparer& other) const; }; } } @@ -2932,165 +3223,217 @@ namespace System { namespace Generic { - template<> struct IEqualityComparer : virtual System::Object + template<> struct IComparer : virtual System::Object { - IEqualityComparer(decltype(nullptr)); - IEqualityComparer(Plugin::InternalUse iu, int32_t handle); - IEqualityComparer(const IEqualityComparer& other); - IEqualityComparer(IEqualityComparer&& other); - virtual ~IEqualityComparer(); - IEqualityComparer& operator=(const IEqualityComparer& other); - IEqualityComparer& operator=(decltype(nullptr)); - IEqualityComparer& operator=(IEqualityComparer&& other); - bool operator==(const IEqualityComparer& other) const; - bool operator!=(const IEqualityComparer& other) const; + IComparer(decltype(nullptr)); + IComparer(Plugin::InternalUse, int32_t handle); + IComparer(const IComparer& other); + IComparer(IComparer&& other); + virtual ~IComparer(); + IComparer& operator=(const IComparer& other); + IComparer& operator=(decltype(nullptr)); + IComparer& operator=(IComparer&& other); + bool operator==(const IComparer& other) const; + bool operator!=(const IComparer& other) const; }; } } } -namespace UnityEngine +namespace System { - namespace Playables + namespace Collections { - struct PlayableGraph : virtual System::ValueType + namespace Generic { - PlayableGraph(decltype(nullptr)); - PlayableGraph(Plugin::InternalUse iu, int32_t handle); - PlayableGraph(const PlayableGraph& other); - PlayableGraph(PlayableGraph&& other); - virtual ~PlayableGraph(); - PlayableGraph& operator=(const PlayableGraph& other); - PlayableGraph& operator=(decltype(nullptr)); - PlayableGraph& operator=(PlayableGraph&& other); - bool operator==(const PlayableGraph& other) const; - bool operator!=(const PlayableGraph& other) const; - }; + template<> struct BaseIComparer : virtual System::Collections::Generic::IComparer + { + BaseIComparer(decltype(nullptr)); + BaseIComparer(Plugin::InternalUse, int32_t handle); + BaseIComparer(const BaseIComparer& other); + BaseIComparer(BaseIComparer&& other); + virtual ~BaseIComparer(); + BaseIComparer& operator=(const BaseIComparer& other); + BaseIComparer& operator=(decltype(nullptr)); + BaseIComparer& operator=(BaseIComparer&& other); + bool operator==(const BaseIComparer& other) const; + bool operator!=(const BaseIComparer& other) const; + int32_t CppHandle; + BaseIComparer(); + virtual System::Int32 Compare(System::Int32 x, System::Int32 y); + }; + } } } -namespace UnityEngine +namespace System { - namespace Playables + namespace Collections { - struct IPlayable : virtual System::Object + namespace Generic { - IPlayable(decltype(nullptr)); - IPlayable(Plugin::InternalUse iu, int32_t handle); - IPlayable(const IPlayable& other); - IPlayable(IPlayable&& other); - virtual ~IPlayable(); - IPlayable& operator=(const IPlayable& other); - IPlayable& operator=(decltype(nullptr)); - IPlayable& operator=(IPlayable&& other); - bool operator==(const IPlayable& other) const; - bool operator!=(const IPlayable& other) const; - }; + template<> struct BaseIComparer : virtual System::Collections::Generic::IComparer + { + BaseIComparer(decltype(nullptr)); + BaseIComparer(Plugin::InternalUse, int32_t handle); + BaseIComparer(const BaseIComparer& other); + BaseIComparer(BaseIComparer&& other); + virtual ~BaseIComparer(); + BaseIComparer& operator=(const BaseIComparer& other); + BaseIComparer& operator=(decltype(nullptr)); + BaseIComparer& operator=(BaseIComparer&& other); + bool operator==(const BaseIComparer& other) const; + bool operator!=(const BaseIComparer& other) const; + int32_t CppHandle; + BaseIComparer(); + virtual System::Int32 Compare(System::String& x, System::String& y); + }; + } } } namespace System { - template<> struct IEquatable : virtual System::Object + struct StringComparer : virtual System::Collections::IComparer, virtual System::Collections::Generic::IComparer, virtual System::Collections::IEqualityComparer, virtual System::Collections::Generic::IEqualityComparer { - IEquatable(decltype(nullptr)); - IEquatable(Plugin::InternalUse iu, int32_t handle); - IEquatable(const IEquatable& other); - IEquatable(IEquatable&& other); - virtual ~IEquatable(); - IEquatable& operator=(const IEquatable& other); - IEquatable& operator=(decltype(nullptr)); - IEquatable& operator=(IEquatable&& other); - bool operator==(const IEquatable& other) const; - bool operator!=(const IEquatable& other) const; + StringComparer(decltype(nullptr)); + StringComparer(Plugin::InternalUse, int32_t handle); + StringComparer(const StringComparer& other); + StringComparer(StringComparer&& other); + virtual ~StringComparer(); + StringComparer& operator=(const StringComparer& other); + StringComparer& operator=(decltype(nullptr)); + StringComparer& operator=(StringComparer&& other); + bool operator==(const StringComparer& other) const; + bool operator!=(const StringComparer& other) const; }; } -namespace UnityEngine +namespace System { - namespace Animations + struct BaseStringComparer : virtual System::StringComparer + { + BaseStringComparer(decltype(nullptr)); + BaseStringComparer(Plugin::InternalUse, int32_t handle); + BaseStringComparer(const BaseStringComparer& other); + BaseStringComparer(BaseStringComparer&& other); + virtual ~BaseStringComparer(); + BaseStringComparer& operator=(const BaseStringComparer& other); + BaseStringComparer& operator=(decltype(nullptr)); + BaseStringComparer& operator=(BaseStringComparer&& other); + bool operator==(const BaseStringComparer& other) const; + bool operator!=(const BaseStringComparer& other) const; + int32_t CppHandle; + BaseStringComparer(); + virtual System::Int32 Compare(System::String& x, System::String& y); + virtual System::Boolean Equals(System::String& x, System::String& y); + virtual System::Int32 GetHashCode(System::String& obj); + }; +} + +namespace System +{ + namespace Collections { - struct AnimationMixerPlayable : virtual System::ValueType, virtual System::IEquatable, virtual UnityEngine::Playables::IPlayable + struct Queue : virtual System::ICloneable, virtual System::Collections::ICollection { - AnimationMixerPlayable(decltype(nullptr)); - AnimationMixerPlayable(Plugin::InternalUse iu, int32_t handle); - AnimationMixerPlayable(const AnimationMixerPlayable& other); - AnimationMixerPlayable(AnimationMixerPlayable&& other); - virtual ~AnimationMixerPlayable(); - AnimationMixerPlayable& operator=(const AnimationMixerPlayable& other); - AnimationMixerPlayable& operator=(decltype(nullptr)); - AnimationMixerPlayable& operator=(AnimationMixerPlayable&& other); - bool operator==(const AnimationMixerPlayable& other) const; - bool operator!=(const AnimationMixerPlayable& other) const; - static UnityEngine::Animations::AnimationMixerPlayable Create(UnityEngine::Playables::PlayableGraph& graph, int32_t inputCount = 0, System::Boolean normalizeWeights = false); + Queue(decltype(nullptr)); + Queue(Plugin::InternalUse, int32_t handle); + Queue(const Queue& other); + Queue(Queue&& other); + virtual ~Queue(); + Queue& operator=(const Queue& other); + Queue& operator=(decltype(nullptr)); + Queue& operator=(Queue&& other); + bool operator==(const Queue& other) const; + bool operator!=(const Queue& other) const; + System::Int32 GetCount(); }; } } namespace System { - namespace Runtime + namespace Collections { - namespace CompilerServices + struct BaseQueue : virtual System::Collections::Queue { - struct IStrongBox : virtual System::Object - { - IStrongBox(decltype(nullptr)); - IStrongBox(Plugin::InternalUse iu, int32_t handle); - IStrongBox(const IStrongBox& other); - IStrongBox(IStrongBox&& other); - virtual ~IStrongBox(); - IStrongBox& operator=(const IStrongBox& other); - IStrongBox& operator=(decltype(nullptr)); - IStrongBox& operator=(IStrongBox&& other); - bool operator==(const IStrongBox& other) const; - bool operator!=(const IStrongBox& other) const; - }; - } + BaseQueue(decltype(nullptr)); + BaseQueue(Plugin::InternalUse, int32_t handle); + BaseQueue(const BaseQueue& other); + BaseQueue(BaseQueue&& other); + virtual ~BaseQueue(); + BaseQueue& operator=(const BaseQueue& other); + BaseQueue& operator=(decltype(nullptr)); + BaseQueue& operator=(BaseQueue&& other); + bool operator==(const BaseQueue& other) const; + bool operator!=(const BaseQueue& other) const; + int32_t CppHandle; + BaseQueue(); + virtual System::Int32 GetCount(); + }; } } -namespace UnityEngine +namespace System { - namespace Experimental + namespace ComponentModel { - namespace UIElements + namespace Design { - struct IEventHandler : virtual System::Object + struct IComponentChangeService : virtual System::Object { - IEventHandler(decltype(nullptr)); - IEventHandler(Plugin::InternalUse iu, int32_t handle); - IEventHandler(const IEventHandler& other); - IEventHandler(IEventHandler&& other); - virtual ~IEventHandler(); - IEventHandler& operator=(const IEventHandler& other); - IEventHandler& operator=(decltype(nullptr)); - IEventHandler& operator=(IEventHandler&& other); - bool operator==(const IEventHandler& other) const; - bool operator!=(const IEventHandler& other) const; + IComponentChangeService(decltype(nullptr)); + IComponentChangeService(Plugin::InternalUse, int32_t handle); + IComponentChangeService(const IComponentChangeService& other); + IComponentChangeService(IComponentChangeService&& other); + virtual ~IComponentChangeService(); + IComponentChangeService& operator=(const IComponentChangeService& other); + IComponentChangeService& operator=(decltype(nullptr)); + IComponentChangeService& operator=(IComponentChangeService&& other); + bool operator==(const IComponentChangeService& other) const; + bool operator!=(const IComponentChangeService& other) const; }; } } } -namespace UnityEngine +namespace System { - namespace Experimental + namespace ComponentModel { - namespace UIElements + namespace Design { - struct IStyle : virtual System::Object + struct BaseIComponentChangeService : virtual System::ComponentModel::Design::IComponentChangeService { - IStyle(decltype(nullptr)); - IStyle(Plugin::InternalUse iu, int32_t handle); - IStyle(const IStyle& other); - IStyle(IStyle&& other); - virtual ~IStyle(); - IStyle& operator=(const IStyle& other); - IStyle& operator=(decltype(nullptr)); - IStyle& operator=(IStyle&& other); - bool operator==(const IStyle& other) const; - bool operator!=(const IStyle& other) const; + BaseIComponentChangeService(decltype(nullptr)); + BaseIComponentChangeService(Plugin::InternalUse, int32_t handle); + BaseIComponentChangeService(const BaseIComponentChangeService& other); + BaseIComponentChangeService(BaseIComponentChangeService&& other); + virtual ~BaseIComponentChangeService(); + BaseIComponentChangeService& operator=(const BaseIComponentChangeService& other); + BaseIComponentChangeService& operator=(decltype(nullptr)); + BaseIComponentChangeService& operator=(BaseIComponentChangeService&& other); + bool operator==(const BaseIComponentChangeService& other) const; + bool operator!=(const BaseIComponentChangeService& other) const; + int32_t CppHandle; + BaseIComponentChangeService(); + virtual void OnComponentChanged(System::Object& component, System::ComponentModel::MemberDescriptor& member, System::Object& oldValue, System::Object& newValue); + virtual void OnComponentChanging(System::Object& component, System::ComponentModel::MemberDescriptor& member); + virtual void AddComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void RemoveComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void AddComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void RemoveComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void AddComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value); + virtual void RemoveComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value); + virtual void AddComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value); + virtual void RemoveComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value); + virtual void AddComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void RemoveComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void AddComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void RemoveComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value); + virtual void AddComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value); + virtual void RemoveComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value); }; } } @@ -3098,288 +3441,337 @@ namespace UnityEngine namespace System { - namespace Diagnostics + namespace IO { - struct Stopwatch : virtual System::Object + struct FileStream : virtual System::IO::Stream, virtual System::IDisposable { - Stopwatch(decltype(nullptr)); - Stopwatch(Plugin::InternalUse iu, int32_t handle); - Stopwatch(const Stopwatch& other); - Stopwatch(Stopwatch&& other); - virtual ~Stopwatch(); - Stopwatch& operator=(const Stopwatch& other); - Stopwatch& operator=(decltype(nullptr)); - Stopwatch& operator=(Stopwatch&& other); - bool operator==(const Stopwatch& other) const; - bool operator!=(const Stopwatch& other) const; - Stopwatch(); - int64_t GetElapsedMilliseconds(); - void Start(); - void Reset(); + FileStream(decltype(nullptr)); + FileStream(Plugin::InternalUse, int32_t handle); + FileStream(const FileStream& other); + FileStream(FileStream&& other); + virtual ~FileStream(); + FileStream& operator=(const FileStream& other); + FileStream& operator=(decltype(nullptr)); + FileStream& operator=(FileStream&& other); + bool operator==(const FileStream& other) const; + bool operator!=(const FileStream& other) const; + FileStream(System::String& path, System::IO::FileMode mode); + void WriteByte(System::Byte value); }; } } -namespace UnityEngine +namespace System { - struct GameObject : virtual UnityEngine::Object + namespace IO { - GameObject(decltype(nullptr)); - GameObject(Plugin::InternalUse iu, int32_t handle); - GameObject(const GameObject& other); - GameObject(GameObject&& other); - virtual ~GameObject(); - GameObject& operator=(const GameObject& other); - GameObject& operator=(decltype(nullptr)); - GameObject& operator=(GameObject&& other); - bool operator==(const GameObject& other) const; - bool operator!=(const GameObject& other) const; - GameObject(); - GameObject(System::String& name); - UnityEngine::Transform GetTransform(); - template MT0 AddComponent(); - static UnityEngine::GameObject CreatePrimitive(UnityEngine::PrimitiveType type); - }; + struct BaseFileStream : virtual System::IO::FileStream + { + BaseFileStream(decltype(nullptr)); + BaseFileStream(Plugin::InternalUse, int32_t handle); + BaseFileStream(const BaseFileStream& other); + BaseFileStream(BaseFileStream&& other); + virtual ~BaseFileStream(); + BaseFileStream& operator=(const BaseFileStream& other); + BaseFileStream& operator=(decltype(nullptr)); + BaseFileStream& operator=(BaseFileStream&& other); + bool operator==(const BaseFileStream& other) const; + bool operator!=(const BaseFileStream& other) const; + int32_t CppHandle; + BaseFileStream(System::String& path, System::IO::FileMode mode); + virtual void WriteByte(System::Byte value); + }; + } } namespace UnityEngine { - struct Debug : virtual System::Object + namespace Playables { - Debug(decltype(nullptr)); - Debug(Plugin::InternalUse iu, int32_t handle); - Debug(const Debug& other); - Debug(Debug&& other); - virtual ~Debug(); - Debug& operator=(const Debug& other); - Debug& operator=(decltype(nullptr)); - Debug& operator=(Debug&& other); - bool operator==(const Debug& other) const; - bool operator!=(const Debug& other) const; - static void Log(System::Object& message); - }; + struct PlayableHandle : Plugin::ManagedType + { + PlayableHandle(decltype(nullptr)); + PlayableHandle(Plugin::InternalUse, int32_t handle); + PlayableHandle(const PlayableHandle& other); + PlayableHandle(PlayableHandle&& other); + virtual ~PlayableHandle(); + PlayableHandle& operator=(const PlayableHandle& other); + PlayableHandle& operator=(decltype(nullptr)); + PlayableHandle& operator=(PlayableHandle&& other); + bool operator==(const PlayableHandle& other) const; + bool operator!=(const PlayableHandle& other) const; + explicit operator System::ValueType(); + explicit operator System::Object(); + }; + } } namespace UnityEngine { - namespace Assertions + namespace Experimental { - namespace Assert + namespace UIElements { - System::Boolean GetRaiseExceptions(); - void SetRaiseExceptions(System::Boolean value); - template void AreEqual(MT0& expected, MT0& actual); + struct ITransform : virtual System::Object + { + ITransform(decltype(nullptr)); + ITransform(Plugin::InternalUse, int32_t handle); + ITransform(const ITransform& other); + ITransform(ITransform&& other); + virtual ~ITransform(); + ITransform& operator=(const ITransform& other); + ITransform& operator=(decltype(nullptr)); + ITransform& operator=(ITransform&& other); + bool operator==(const ITransform& other) const; + bool operator!=(const ITransform& other) const; + }; } } } namespace UnityEngine { - struct Collision : virtual System::Object + namespace Experimental { - Collision(decltype(nullptr)); - Collision(Plugin::InternalUse iu, int32_t handle); - Collision(const Collision& other); - Collision(Collision&& other); - virtual ~Collision(); - Collision& operator=(const Collision& other); - Collision& operator=(decltype(nullptr)); - Collision& operator=(Collision&& other); - bool operator==(const Collision& other) const; - bool operator!=(const Collision& other) const; - }; + namespace UIElements + { + struct IUIElementDataWatch : virtual System::Object + { + IUIElementDataWatch(decltype(nullptr)); + IUIElementDataWatch(Plugin::InternalUse, int32_t handle); + IUIElementDataWatch(const IUIElementDataWatch& other); + IUIElementDataWatch(IUIElementDataWatch&& other); + virtual ~IUIElementDataWatch(); + IUIElementDataWatch& operator=(const IUIElementDataWatch& other); + IUIElementDataWatch& operator=(decltype(nullptr)); + IUIElementDataWatch& operator=(IUIElementDataWatch&& other); + bool operator==(const IUIElementDataWatch& other) const; + bool operator!=(const IUIElementDataWatch& other) const; + }; + } + } } namespace UnityEngine { - struct Behaviour : virtual UnityEngine::Component + namespace Experimental { - Behaviour(decltype(nullptr)); - Behaviour(Plugin::InternalUse iu, int32_t handle); - Behaviour(const Behaviour& other); - Behaviour(Behaviour&& other); - virtual ~Behaviour(); - Behaviour& operator=(const Behaviour& other); - Behaviour& operator=(decltype(nullptr)); - Behaviour& operator=(Behaviour&& other); - bool operator==(const Behaviour& other) const; - bool operator!=(const Behaviour& other) const; - }; + namespace UIElements + { + struct IVisualElementScheduler : virtual System::Object + { + IVisualElementScheduler(decltype(nullptr)); + IVisualElementScheduler(Plugin::InternalUse, int32_t handle); + IVisualElementScheduler(const IVisualElementScheduler& other); + IVisualElementScheduler(IVisualElementScheduler&& other); + virtual ~IVisualElementScheduler(); + IVisualElementScheduler& operator=(const IVisualElementScheduler& other); + IVisualElementScheduler& operator=(decltype(nullptr)); + IVisualElementScheduler& operator=(IVisualElementScheduler&& other); + bool operator==(const IVisualElementScheduler& other) const; + bool operator!=(const IVisualElementScheduler& other) const; + }; + } + } } -namespace UnityEngine +namespace System { - struct MonoBehaviour : virtual UnityEngine::Behaviour + namespace Collections { - MonoBehaviour(decltype(nullptr)); - MonoBehaviour(Plugin::InternalUse iu, int32_t handle); - MonoBehaviour(const MonoBehaviour& other); - MonoBehaviour(MonoBehaviour&& other); - virtual ~MonoBehaviour(); - MonoBehaviour& operator=(const MonoBehaviour& other); - MonoBehaviour& operator=(decltype(nullptr)); - MonoBehaviour& operator=(MonoBehaviour&& other); - bool operator==(const MonoBehaviour& other) const; - bool operator!=(const MonoBehaviour& other) const; - UnityEngine::Transform GetTransform(); - }; + namespace Generic + { + template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator + { + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + UnityEngine::Experimental::UIElements::VisualElement GetCurrent(); + }; + } + } } -namespace UnityEngine +namespace System { - struct AudioSettings : virtual System::Object + namespace Collections { - AudioSettings(decltype(nullptr)); - AudioSettings(Plugin::InternalUse iu, int32_t handle); - AudioSettings(const AudioSettings& other); - AudioSettings(AudioSettings&& other); - virtual ~AudioSettings(); - AudioSettings& operator=(const AudioSettings& other); - AudioSettings& operator=(decltype(nullptr)); - AudioSettings& operator=(AudioSettings&& other); - bool operator==(const AudioSettings& other) const; - bool operator!=(const AudioSettings& other) const; - static void GetDSPBufferSize(int32_t* bufferLength, int32_t* numBuffers); - }; + namespace Generic + { + template<> struct IEnumerable : virtual System::Collections::IEnumerable + { + IEnumerable(decltype(nullptr)); + IEnumerable(Plugin::InternalUse, int32_t handle); + IEnumerable(const IEnumerable& other); + IEnumerable(IEnumerable&& other); + virtual ~IEnumerable(); + IEnumerable& operator=(const IEnumerable& other); + IEnumerable& operator=(decltype(nullptr)); + IEnumerable& operator=(IEnumerable&& other); + bool operator==(const IEnumerable& other) const; + bool operator!=(const IEnumerable& other) const; + System::Collections::Generic::IEnumerator GetEnumerator(); + }; + } + } } namespace UnityEngine { - namespace Networking + namespace Experimental { - struct NetworkTransport : virtual System::Object + namespace UIElements { - NetworkTransport(decltype(nullptr)); - NetworkTransport(Plugin::InternalUse iu, int32_t handle); - NetworkTransport(const NetworkTransport& other); - NetworkTransport(NetworkTransport&& other); - virtual ~NetworkTransport(); - NetworkTransport& operator=(const NetworkTransport& other); - NetworkTransport& operator=(decltype(nullptr)); - NetworkTransport& operator=(NetworkTransport&& other); - bool operator==(const NetworkTransport& other) const; - bool operator!=(const NetworkTransport& other) const; - static void GetBroadcastConnectionInfo(int32_t hostId, System::String* address, int32_t* port, uint8_t* error); - static void Init(); - }; + struct VisualElement : virtual UnityEngine::Experimental::UIElements::Focusable, virtual System::Collections::Generic::IEnumerable, virtual UnityEngine::Experimental::UIElements::IEventHandler, virtual UnityEngine::Experimental::UIElements::IStyle, virtual UnityEngine::Experimental::UIElements::ITransform, virtual UnityEngine::Experimental::UIElements::IUIElementDataWatch, virtual UnityEngine::Experimental::UIElements::IVisualElementScheduler + { + VisualElement(decltype(nullptr)); + VisualElement(Plugin::InternalUse, int32_t handle); + VisualElement(const VisualElement& other); + VisualElement(VisualElement&& other); + virtual ~VisualElement(); + VisualElement& operator=(const VisualElement& other); + VisualElement& operator=(decltype(nullptr)); + VisualElement& operator=(VisualElement&& other); + bool operator==(const VisualElement& other) const; + bool operator!=(const VisualElement& other) const; + }; + } } } -namespace UnityEngine +namespace Plugin { - struct Quaternion + struct UnityEngineExperimentalUIElementsVisualElementIterator { - Quaternion(); - float x; - float y; - float z; - float w; + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + UnityEngineExperimentalUIElementsVisualElementIterator(decltype(nullptr)); + UnityEngineExperimentalUIElementsVisualElementIterator(UnityEngine::Experimental::UIElements::VisualElement& enumerable); + ~UnityEngineExperimentalUIElementsVisualElementIterator(); + UnityEngineExperimentalUIElementsVisualElementIterator& operator++(); + bool operator!=(const UnityEngineExperimentalUIElementsVisualElementIterator& other); + UnityEngine::Experimental::UIElements::VisualElement operator*(); }; } namespace UnityEngine { - struct Matrix4x4 + namespace Experimental { - Matrix4x4(); - float GetItem(int32_t row, int32_t column); - void SetItem(int32_t row, int32_t column, float value); - float m00; - float m10; - float m20; - float m30; - float m01; - float m11; - float m21; - float m31; - float m02; - float m12; - float m22; - float m32; - float m03; - float m13; - float m23; - float m33; - }; + namespace UIElements + { + Plugin::UnityEngineExperimentalUIElementsVisualElementIterator begin(UnityEngine::Experimental::UIElements::VisualElement& enumerable); + Plugin::UnityEngineExperimentalUIElementsVisualElementIterator end(UnityEngine::Experimental::UIElements::VisualElement& enumerable); + } + } } -namespace System +namespace UnityEngine { - namespace Collections + namespace Experimental { - namespace Generic + namespace UIElements { - template<> struct KeyValuePair : virtual System::ValueType + namespace UQueryExtensions { - KeyValuePair(decltype(nullptr)); - KeyValuePair(Plugin::InternalUse iu, int32_t handle); - KeyValuePair(const KeyValuePair& other); - KeyValuePair(KeyValuePair&& other); - virtual ~KeyValuePair(); - KeyValuePair& operator=(const KeyValuePair& other); - KeyValuePair& operator=(decltype(nullptr)); - KeyValuePair& operator=(KeyValuePair&& other); - bool operator==(const KeyValuePair& other) const; - bool operator!=(const KeyValuePair& other) const; - KeyValuePair(System::String& key, double value); - System::String GetKey(); - double GetValue(); - }; + UnityEngine::Experimental::UIElements::VisualElement Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name, System::Array1& classes); + UnityEngine::Experimental::UIElements::VisualElement Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name = Plugin::NullString, System::String& className = Plugin::NullString); + } } } } -namespace System +namespace UnityEngine { - namespace Collections + namespace XR { - namespace Generic + namespace WSA { - template<> struct List : virtual System::Collections::IList, virtual System::Collections::Generic::IList + namespace Input { - List(decltype(nullptr)); - List(Plugin::InternalUse iu, int32_t handle); - List(const List& other); - List(List&& other); - virtual ~List(); - List& operator=(const List& other); - List& operator=(decltype(nullptr)); - List& operator=(List&& other); - bool operator==(const List& other) const; - bool operator!=(const List& other) const; - List(); - System::String GetItem(int32_t index); - void SetItem(int32_t index, System::String& value); - void Add(System::String& item); - void Sort(System::Collections::Generic::IComparer& comparer); - }; + struct InteractionSourcePositionAccuracy + { + int32_t Value; + static const UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy None; + static const UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy Approximate; + static const UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy High; + explicit InteractionSourcePositionAccuracy(int32_t value); + explicit operator int32_t() const; + bool operator==(InteractionSourcePositionAccuracy other); + bool operator!=(InteractionSourcePositionAccuracy other); + explicit operator System::Enum(); + explicit operator System::ValueType(); + explicit operator System::Object(); + explicit operator System::IFormattable(); + explicit operator System::IConvertible(); + explicit operator System::IComparable(); + }; + } } } } -namespace Plugin +namespace UnityEngine { - struct SystemCollectionsGenericListSystemStringIterator + namespace XR { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericListSystemStringIterator(decltype(nullptr)); - SystemCollectionsGenericListSystemStringIterator(System::Collections::Generic::List& enumerable); - ~SystemCollectionsGenericListSystemStringIterator(); - SystemCollectionsGenericListSystemStringIterator& operator++(); - bool operator!=(const SystemCollectionsGenericListSystemStringIterator& other); - System::String operator*(); - }; + namespace WSA + { + namespace Input + { + struct InteractionSourceNode + { + int32_t Value; + static const UnityEngine::XR::WSA::Input::InteractionSourceNode Grip; + static const UnityEngine::XR::WSA::Input::InteractionSourceNode Pointer; + explicit InteractionSourceNode(int32_t value); + explicit operator int32_t() const; + bool operator==(InteractionSourceNode other); + bool operator!=(InteractionSourceNode other); + explicit operator System::Enum(); + explicit operator System::ValueType(); + explicit operator System::Object(); + explicit operator System::IFormattable(); + explicit operator System::IConvertible(); + explicit operator System::IComparable(); + }; + } + } + } } -namespace System +namespace UnityEngine { - namespace Collections + namespace XR { - namespace Generic + namespace WSA { - Plugin::SystemCollectionsGenericListSystemStringIterator begin(System::Collections::Generic::List& enumerable); - Plugin::SystemCollectionsGenericListSystemStringIterator end(System::Collections::Generic::List& enumerable); + namespace Input + { + struct InteractionSourcePose : Plugin::ManagedType + { + InteractionSourcePose(decltype(nullptr)); + InteractionSourcePose(Plugin::InternalUse, int32_t handle); + InteractionSourcePose(const InteractionSourcePose& other); + InteractionSourcePose(InteractionSourcePose&& other); + virtual ~InteractionSourcePose(); + InteractionSourcePose& operator=(const InteractionSourcePose& other); + InteractionSourcePose& operator=(decltype(nullptr)); + InteractionSourcePose& operator=(InteractionSourcePose&& other); + bool operator==(const InteractionSourcePose& other) const; + bool operator!=(const InteractionSourcePose& other) const; + System::Boolean TryGetRotation(UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node = UnityEngine::XR::WSA::Input::InteractionSourceNode::Grip); + explicit operator System::ValueType(); + explicit operator System::Object(); + }; + } } } } @@ -3390,41 +3782,46 @@ namespace System { namespace Generic { - template<> struct List : virtual System::Collections::IList, virtual System::Collections::Generic::IList + template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator { - List(decltype(nullptr)); - List(Plugin::InternalUse iu, int32_t handle); - List(const List& other); - List(List&& other); - virtual ~List(); - List& operator=(const List& other); - List& operator=(decltype(nullptr)); - List& operator=(List&& other); - bool operator==(const List& other) const; - bool operator!=(const List& other) const; - List(); - int32_t GetItem(int32_t index); - void SetItem(int32_t index, int32_t value); - void Add(int32_t item); - void Sort(System::Collections::Generic::IComparer& comparer); + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + System::String GetCurrent(); }; } } } -namespace Plugin +namespace System { - struct SystemCollectionsGenericListSystemInt32Iterator + namespace Collections { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericListSystemInt32Iterator(decltype(nullptr)); - SystemCollectionsGenericListSystemInt32Iterator(System::Collections::Generic::List& enumerable); - ~SystemCollectionsGenericListSystemInt32Iterator(); - SystemCollectionsGenericListSystemInt32Iterator& operator++(); - bool operator!=(const SystemCollectionsGenericListSystemInt32Iterator& other); - int32_t operator*(); - }; + namespace Generic + { + template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator + { + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + System::Int32 GetCurrent(); + }; + } + } } namespace System @@ -3433,8 +3830,20 @@ namespace System { namespace Generic { - Plugin::SystemCollectionsGenericListSystemInt32Iterator begin(System::Collections::Generic::List& enumerable); - Plugin::SystemCollectionsGenericListSystemInt32Iterator end(System::Collections::Generic::List& enumerable); + template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator + { + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + System::Single GetCurrent(); + }; } } } @@ -3445,21 +3854,19 @@ namespace System { namespace Generic { - template<> struct LinkedListNode : virtual System::Object + template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator { - LinkedListNode(decltype(nullptr)); - LinkedListNode(Plugin::InternalUse iu, int32_t handle); - LinkedListNode(const LinkedListNode& other); - LinkedListNode(LinkedListNode&& other); - virtual ~LinkedListNode(); - LinkedListNode& operator=(const LinkedListNode& other); - LinkedListNode& operator=(decltype(nullptr)); - LinkedListNode& operator=(LinkedListNode&& other); - bool operator==(const LinkedListNode& other) const; - bool operator!=(const LinkedListNode& other) const; - LinkedListNode(System::String& value); - System::String GetValue(); - void SetValue(System::String& value); + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + UnityEngine::RaycastHit GetCurrent(); }; } } @@ -3467,25 +3874,23 @@ namespace System namespace System { - namespace Runtime + namespace Collections { - namespace CompilerServices + namespace Generic { - template<> struct StrongBox : virtual System::Runtime::CompilerServices::IStrongBox + template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator { - StrongBox(decltype(nullptr)); - StrongBox(Plugin::InternalUse iu, int32_t handle); - StrongBox(const StrongBox& other); - StrongBox(StrongBox&& other); - virtual ~StrongBox(); - StrongBox& operator=(const StrongBox& other); - StrongBox& operator=(decltype(nullptr)); - StrongBox& operator=(StrongBox&& other); - bool operator==(const StrongBox& other) const; - bool operator!=(const StrongBox& other) const; - StrongBox(System::String& value); - System::String GetValue(); - void SetValue(System::String& value); + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + UnityEngine::GradientColorKey GetCurrent(); }; } } @@ -3495,48 +3900,70 @@ namespace System { namespace Collections { - namespace ObjectModel + namespace Generic { - template<> struct Collection : virtual System::Collections::IList, virtual System::Collections::Generic::IList + template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator { - Collection(decltype(nullptr)); - Collection(Plugin::InternalUse iu, int32_t handle); - Collection(const Collection& other); - Collection(Collection&& other); - virtual ~Collection(); - Collection& operator=(const Collection& other); - Collection& operator=(decltype(nullptr)); - Collection& operator=(Collection&& other); - bool operator==(const Collection& other) const; - bool operator!=(const Collection& other) const; + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + UnityEngine::Resolution GetCurrent(); }; } } } -namespace Plugin +namespace System { - struct SystemCollectionsObjectModelCollectionSystemInt32Iterator + namespace Collections { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsObjectModelCollectionSystemInt32Iterator(decltype(nullptr)); - SystemCollectionsObjectModelCollectionSystemInt32Iterator(System::Collections::ObjectModel::Collection& enumerable); - ~SystemCollectionsObjectModelCollectionSystemInt32Iterator(); - SystemCollectionsObjectModelCollectionSystemInt32Iterator& operator++(); - bool operator!=(const SystemCollectionsObjectModelCollectionSystemInt32Iterator& other); - int32_t operator*(); - }; + namespace Generic + { + template<> struct IEnumerable : virtual System::Collections::IEnumerable + { + IEnumerable(decltype(nullptr)); + IEnumerable(Plugin::InternalUse, int32_t handle); + IEnumerable(const IEnumerable& other); + IEnumerable(IEnumerable&& other); + virtual ~IEnumerable(); + IEnumerable& operator=(const IEnumerable& other); + IEnumerable& operator=(decltype(nullptr)); + IEnumerable& operator=(IEnumerable&& other); + bool operator==(const IEnumerable& other) const; + bool operator!=(const IEnumerable& other) const; + System::Collections::Generic::IEnumerator GetEnumerator(); + }; + } + } } namespace System { namespace Collections { - namespace ObjectModel + namespace Generic { - Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator begin(System::Collections::ObjectModel::Collection& enumerable); - Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator end(System::Collections::ObjectModel::Collection& enumerable); + template<> struct IEnumerable : virtual System::Collections::IEnumerable + { + IEnumerable(decltype(nullptr)); + IEnumerable(Plugin::InternalUse, int32_t handle); + IEnumerable(const IEnumerable& other); + IEnumerable(IEnumerable&& other); + virtual ~IEnumerable(); + IEnumerable& operator=(const IEnumerable& other); + IEnumerable& operator=(decltype(nullptr)); + IEnumerable& operator=(IEnumerable&& other); + bool operator==(const IEnumerable& other) const; + bool operator!=(const IEnumerable& other) const; + System::Collections::Generic::IEnumerator GetEnumerator(); + }; } } } @@ -3545,441 +3972,545 @@ namespace System { namespace Collections { - namespace ObjectModel + namespace Generic { - template<> struct KeyedCollection : virtual System::Collections::ObjectModel::Collection, virtual System::Collections::IList, virtual System::Collections::Generic::IList + template<> struct IEnumerable : virtual System::Collections::IEnumerable { - KeyedCollection(decltype(nullptr)); - KeyedCollection(Plugin::InternalUse iu, int32_t handle); - KeyedCollection(const KeyedCollection& other); - KeyedCollection(KeyedCollection&& other); - virtual ~KeyedCollection(); - KeyedCollection& operator=(const KeyedCollection& other); - KeyedCollection& operator=(decltype(nullptr)); - KeyedCollection& operator=(KeyedCollection&& other); - bool operator==(const KeyedCollection& other) const; - bool operator!=(const KeyedCollection& other) const; + IEnumerable(decltype(nullptr)); + IEnumerable(Plugin::InternalUse, int32_t handle); + IEnumerable(const IEnumerable& other); + IEnumerable(IEnumerable&& other); + virtual ~IEnumerable(); + IEnumerable& operator=(const IEnumerable& other); + IEnumerable& operator=(decltype(nullptr)); + IEnumerable& operator=(IEnumerable&& other); + bool operator==(const IEnumerable& other) const; + bool operator!=(const IEnumerable& other) const; + System::Collections::Generic::IEnumerator GetEnumerator(); }; } } } -namespace Plugin +namespace System { - struct SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator + namespace Collections { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(decltype(nullptr)); - SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(System::Collections::ObjectModel::KeyedCollection& enumerable); - ~SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(); - SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& operator++(); - bool operator!=(const SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& other); - int32_t operator*(); - }; + namespace Generic + { + template<> struct IEnumerable : virtual System::Collections::IEnumerable + { + IEnumerable(decltype(nullptr)); + IEnumerable(Plugin::InternalUse, int32_t handle); + IEnumerable(const IEnumerable& other); + IEnumerable(IEnumerable&& other); + virtual ~IEnumerable(); + IEnumerable& operator=(const IEnumerable& other); + IEnumerable& operator=(decltype(nullptr)); + IEnumerable& operator=(IEnumerable&& other); + bool operator==(const IEnumerable& other) const; + bool operator!=(const IEnumerable& other) const; + System::Collections::Generic::IEnumerator GetEnumerator(); + }; + } + } } namespace System { namespace Collections { - namespace ObjectModel + namespace Generic { - Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator begin(System::Collections::ObjectModel::KeyedCollection& enumerable); - Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator end(System::Collections::ObjectModel::KeyedCollection& enumerable); + template<> struct IEnumerable : virtual System::Collections::IEnumerable + { + IEnumerable(decltype(nullptr)); + IEnumerable(Plugin::InternalUse, int32_t handle); + IEnumerable(const IEnumerable& other); + IEnumerable(IEnumerable&& other); + virtual ~IEnumerable(); + IEnumerable& operator=(const IEnumerable& other); + IEnumerable& operator=(decltype(nullptr)); + IEnumerable& operator=(IEnumerable&& other); + bool operator==(const IEnumerable& other) const; + bool operator!=(const IEnumerable& other) const; + System::Collections::Generic::IEnumerator GetEnumerator(); + }; } } } namespace System { - struct Exception : virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable + namespace Collections { - Exception(decltype(nullptr)); - Exception(Plugin::InternalUse iu, int32_t handle); - Exception(const Exception& other); - Exception(Exception&& other); - virtual ~Exception(); - Exception& operator=(const Exception& other); - Exception& operator=(decltype(nullptr)); - Exception& operator=(Exception&& other); - bool operator==(const Exception& other) const; - bool operator!=(const Exception& other) const; - Exception(System::String& message); - }; + namespace Generic + { + template<> struct IEnumerable : virtual System::Collections::IEnumerable + { + IEnumerable(decltype(nullptr)); + IEnumerable(Plugin::InternalUse, int32_t handle); + IEnumerable(const IEnumerable& other); + IEnumerable(IEnumerable&& other); + virtual ~IEnumerable(); + IEnumerable& operator=(const IEnumerable& other); + IEnumerable& operator=(decltype(nullptr)); + IEnumerable& operator=(IEnumerable&& other); + bool operator==(const IEnumerable& other) const; + bool operator!=(const IEnumerable& other) const; + System::Collections::Generic::IEnumerator GetEnumerator(); + }; + } + } } namespace System { - struct SystemException : virtual System::Exception, virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable + namespace Collections { - SystemException(decltype(nullptr)); - SystemException(Plugin::InternalUse iu, int32_t handle); - SystemException(const SystemException& other); - SystemException(SystemException&& other); - virtual ~SystemException(); - SystemException& operator=(const SystemException& other); - SystemException& operator=(decltype(nullptr)); - SystemException& operator=(SystemException&& other); - bool operator==(const SystemException& other) const; - bool operator!=(const SystemException& other) const; + namespace Generic + { + template<> struct ICollection : virtual System::Collections::Generic::IEnumerable + { + ICollection(decltype(nullptr)); + ICollection(Plugin::InternalUse, int32_t handle); + ICollection(const ICollection& other); + ICollection(ICollection&& other); + virtual ~ICollection(); + ICollection& operator=(const ICollection& other); + ICollection& operator=(decltype(nullptr)); + ICollection& operator=(ICollection&& other); + bool operator==(const ICollection& other) const; + bool operator!=(const ICollection& other) const; + }; + } + } +} + +namespace Plugin +{ + struct SystemCollectionsGenericICollectionSystemStringIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericICollectionSystemStringIterator(decltype(nullptr)); + SystemCollectionsGenericICollectionSystemStringIterator(System::Collections::Generic::ICollection& enumerable); + ~SystemCollectionsGenericICollectionSystemStringIterator(); + SystemCollectionsGenericICollectionSystemStringIterator& operator++(); + bool operator!=(const SystemCollectionsGenericICollectionSystemStringIterator& other); + System::String operator*(); }; } namespace System { - struct NullReferenceException : virtual System::SystemException, virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable + namespace Collections { - NullReferenceException(decltype(nullptr)); - NullReferenceException(Plugin::InternalUse iu, int32_t handle); - NullReferenceException(const NullReferenceException& other); - NullReferenceException(NullReferenceException&& other); - virtual ~NullReferenceException(); - NullReferenceException& operator=(const NullReferenceException& other); - NullReferenceException& operator=(decltype(nullptr)); - NullReferenceException& operator=(NullReferenceException&& other); - bool operator==(const NullReferenceException& other) const; - bool operator!=(const NullReferenceException& other) const; - }; + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionSystemStringIterator begin(System::Collections::Generic::ICollection& enumerable); + Plugin::SystemCollectionsGenericICollectionSystemStringIterator end(System::Collections::Generic::ICollection& enumerable); + } + } } -namespace UnityEngine +namespace System { - struct Screen : virtual System::Object + namespace Collections { - Screen(decltype(nullptr)); - Screen(Plugin::InternalUse iu, int32_t handle); - Screen(const Screen& other); - Screen(Screen&& other); - virtual ~Screen(); - Screen& operator=(const Screen& other); - Screen& operator=(decltype(nullptr)); - Screen& operator=(Screen&& other); - bool operator==(const Screen& other) const; - bool operator!=(const Screen& other) const; - static System::Array1 GetResolutions(); - }; + namespace Generic + { + template<> struct ICollection : virtual System::Collections::Generic::IEnumerable + { + ICollection(decltype(nullptr)); + ICollection(Plugin::InternalUse, int32_t handle); + ICollection(const ICollection& other); + ICollection(ICollection&& other); + virtual ~ICollection(); + ICollection& operator=(const ICollection& other); + ICollection& operator=(decltype(nullptr)); + ICollection& operator=(ICollection&& other); + bool operator==(const ICollection& other) const; + bool operator!=(const ICollection& other) const; + }; + } + } } -namespace UnityEngine +namespace Plugin { - struct Ray : virtual System::ValueType + struct SystemCollectionsGenericICollectionSystemInt32Iterator { - Ray(decltype(nullptr)); - Ray(Plugin::InternalUse iu, int32_t handle); - Ray(const Ray& other); - Ray(Ray&& other); - virtual ~Ray(); - Ray& operator=(const Ray& other); - Ray& operator=(decltype(nullptr)); - Ray& operator=(Ray&& other); - bool operator==(const Ray& other) const; - bool operator!=(const Ray& other) const; - Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericICollectionSystemInt32Iterator(decltype(nullptr)); + SystemCollectionsGenericICollectionSystemInt32Iterator(System::Collections::Generic::ICollection& enumerable); + ~SystemCollectionsGenericICollectionSystemInt32Iterator(); + SystemCollectionsGenericICollectionSystemInt32Iterator& operator++(); + bool operator!=(const SystemCollectionsGenericICollectionSystemInt32Iterator& other); + System::Int32 operator*(); }; } -namespace UnityEngine +namespace System { - struct Physics : virtual System::Object + namespace Collections { - Physics(decltype(nullptr)); - Physics(Plugin::InternalUse iu, int32_t handle); - Physics(const Physics& other); - Physics(Physics&& other); - virtual ~Physics(); - Physics& operator=(const Physics& other); - Physics& operator=(decltype(nullptr)); - Physics& operator=(Physics&& other); - bool operator==(const Physics& other) const; - bool operator!=(const Physics& other) const; - static int32_t RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1& results); - static System::Array1 RaycastAll(UnityEngine::Ray& ray); - }; + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator begin(System::Collections::Generic::ICollection& enumerable); + Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator end(System::Collections::Generic::ICollection& enumerable); + } + } } -namespace UnityEngine +namespace System { - struct Gradient : virtual System::Object + namespace Collections { - Gradient(decltype(nullptr)); - Gradient(Plugin::InternalUse iu, int32_t handle); - Gradient(const Gradient& other); - Gradient(Gradient&& other); - virtual ~Gradient(); - Gradient& operator=(const Gradient& other); - Gradient& operator=(decltype(nullptr)); - Gradient& operator=(Gradient&& other); - bool operator==(const Gradient& other) const; - bool operator!=(const Gradient& other) const; - Gradient(); - System::Array1 GetColorKeys(); - void SetColorKeys(System::Array1& value); + namespace Generic + { + template<> struct ICollection : virtual System::Collections::Generic::IEnumerable + { + ICollection(decltype(nullptr)); + ICollection(Plugin::InternalUse, int32_t handle); + ICollection(const ICollection& other); + ICollection(ICollection&& other); + virtual ~ICollection(); + ICollection& operator=(const ICollection& other); + ICollection& operator=(decltype(nullptr)); + ICollection& operator=(ICollection&& other); + bool operator==(const ICollection& other) const; + bool operator!=(const ICollection& other) const; + }; + } + } +} + +namespace Plugin +{ + struct SystemCollectionsGenericICollectionSystemSingleIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericICollectionSystemSingleIterator(decltype(nullptr)); + SystemCollectionsGenericICollectionSystemSingleIterator(System::Collections::Generic::ICollection& enumerable); + ~SystemCollectionsGenericICollectionSystemSingleIterator(); + SystemCollectionsGenericICollectionSystemSingleIterator& operator++(); + bool operator!=(const SystemCollectionsGenericICollectionSystemSingleIterator& other); + System::Single operator*(); }; } namespace System { - struct AppDomainSetup : virtual System::IAppDomainSetup + namespace Collections { - AppDomainSetup(decltype(nullptr)); - AppDomainSetup(Plugin::InternalUse iu, int32_t handle); - AppDomainSetup(const AppDomainSetup& other); - AppDomainSetup(AppDomainSetup&& other); - virtual ~AppDomainSetup(); - AppDomainSetup& operator=(const AppDomainSetup& other); - AppDomainSetup& operator=(decltype(nullptr)); - AppDomainSetup& operator=(AppDomainSetup&& other); - bool operator==(const AppDomainSetup& other) const; - bool operator!=(const AppDomainSetup& other) const; - AppDomainSetup(); - System::AppDomainInitializer GetAppDomainInitializer(); - void SetAppDomainInitializer(System::AppDomainInitializer& value); - }; + namespace Generic + { + Plugin::SystemCollectionsGenericICollectionSystemSingleIterator begin(System::Collections::Generic::ICollection& enumerable); + Plugin::SystemCollectionsGenericICollectionSystemSingleIterator end(System::Collections::Generic::ICollection& enumerable); + } + } } -namespace UnityEngine +namespace System { - struct Application : virtual System::Object + namespace Collections { - Application(decltype(nullptr)); - Application(Plugin::InternalUse iu, int32_t handle); - Application(const Application& other); - Application(Application&& other); - virtual ~Application(); - Application& operator=(const Application& other); - Application& operator=(decltype(nullptr)); - Application& operator=(Application&& other); - bool operator==(const Application& other) const; - bool operator!=(const Application& other) const; - static void AddOnBeforeRender(UnityEngine::Events::UnityAction& del); - static void RemoveOnBeforeRender(UnityEngine::Events::UnityAction& del); + namespace Generic + { + template<> struct ICollection : virtual System::Collections::Generic::IEnumerable + { + ICollection(decltype(nullptr)); + ICollection(Plugin::InternalUse, int32_t handle); + ICollection(const ICollection& other); + ICollection(ICollection&& other); + virtual ~ICollection(); + ICollection& operator=(const ICollection& other); + ICollection& operator=(decltype(nullptr)); + ICollection& operator=(ICollection&& other); + bool operator==(const ICollection& other) const; + bool operator!=(const ICollection& other) const; + }; + } + } +} + +namespace Plugin +{ + struct SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(decltype(nullptr)); + SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(System::Collections::Generic::ICollection& enumerable); + ~SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(); + SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& operator++(); + bool operator!=(const SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& other); + UnityEngine::RaycastHit operator*(); }; } -namespace UnityEngine +namespace System { - namespace SceneManagement + namespace Collections { - struct SceneManager : virtual System::Object + namespace Generic { - SceneManager(decltype(nullptr)); - SceneManager(Plugin::InternalUse iu, int32_t handle); - SceneManager(const SceneManager& other); - SceneManager(SceneManager&& other); - virtual ~SceneManager(); - SceneManager& operator=(const SceneManager& other); - SceneManager& operator=(decltype(nullptr)); - SceneManager& operator=(SceneManager&& other); - bool operator==(const SceneManager& other) const; - bool operator!=(const SceneManager& other) const; - static void AddSceneLoaded(UnityEngine::Events::UnityAction2& del); - static void RemoveSceneLoaded(UnityEngine::Events::UnityAction2& del); - }; + Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator begin(System::Collections::Generic::ICollection& enumerable); + Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator end(System::Collections::Generic::ICollection& enumerable); + } } } -namespace UnityEngine +namespace System { - namespace SceneManagement + namespace Collections { - struct Scene : virtual System::ValueType + namespace Generic { - Scene(decltype(nullptr)); - Scene(Plugin::InternalUse iu, int32_t handle); - Scene(const Scene& other); - Scene(Scene&& other); - virtual ~Scene(); - Scene& operator=(const Scene& other); - Scene& operator=(decltype(nullptr)); - Scene& operator=(Scene&& other); - bool operator==(const Scene& other) const; - bool operator!=(const Scene& other) const; - }; + template<> struct ICollection : virtual System::Collections::Generic::IEnumerable + { + ICollection(decltype(nullptr)); + ICollection(Plugin::InternalUse, int32_t handle); + ICollection(const ICollection& other); + ICollection(ICollection&& other); + virtual ~ICollection(); + ICollection& operator=(const ICollection& other); + ICollection& operator=(decltype(nullptr)); + ICollection& operator=(ICollection&& other); + bool operator==(const ICollection& other) const; + bool operator!=(const ICollection& other) const; + }; + } } } -namespace System +namespace Plugin { - struct EventArgs : virtual System::Object + struct SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator { - EventArgs(decltype(nullptr)); - EventArgs(Plugin::InternalUse iu, int32_t handle); - EventArgs(const EventArgs& other); - EventArgs(EventArgs&& other); - virtual ~EventArgs(); - EventArgs& operator=(const EventArgs& other); - EventArgs& operator=(decltype(nullptr)); - EventArgs& operator=(EventArgs&& other); - bool operator==(const EventArgs& other) const; - bool operator!=(const EventArgs& other) const; + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(decltype(nullptr)); + SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(System::Collections::Generic::ICollection& enumerable); + ~SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(); + SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& operator++(); + bool operator!=(const SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& other); + UnityEngine::GradientColorKey operator*(); }; } namespace System { - namespace ComponentModel + namespace Collections { - namespace Design + namespace Generic { - struct ComponentEventArgs : virtual System::EventArgs + Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::ICollection& enumerable); + Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator end(System::Collections::Generic::ICollection& enumerable); + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct ICollection : virtual System::Collections::Generic::IEnumerable { - ComponentEventArgs(decltype(nullptr)); - ComponentEventArgs(Plugin::InternalUse iu, int32_t handle); - ComponentEventArgs(const ComponentEventArgs& other); - ComponentEventArgs(ComponentEventArgs&& other); - virtual ~ComponentEventArgs(); - ComponentEventArgs& operator=(const ComponentEventArgs& other); - ComponentEventArgs& operator=(decltype(nullptr)); - ComponentEventArgs& operator=(ComponentEventArgs&& other); - bool operator==(const ComponentEventArgs& other) const; - bool operator!=(const ComponentEventArgs& other) const; + ICollection(decltype(nullptr)); + ICollection(Plugin::InternalUse, int32_t handle); + ICollection(const ICollection& other); + ICollection(ICollection&& other); + virtual ~ICollection(); + ICollection& operator=(const ICollection& other); + ICollection& operator=(decltype(nullptr)); + ICollection& operator=(ICollection&& other); + bool operator==(const ICollection& other) const; + bool operator!=(const ICollection& other) const; }; } } } +namespace Plugin +{ + struct SystemCollectionsGenericICollectionUnityEngineResolutionIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericICollectionUnityEngineResolutionIterator(decltype(nullptr)); + SystemCollectionsGenericICollectionUnityEngineResolutionIterator(System::Collections::Generic::ICollection& enumerable); + ~SystemCollectionsGenericICollectionUnityEngineResolutionIterator(); + SystemCollectionsGenericICollectionUnityEngineResolutionIterator& operator++(); + bool operator!=(const SystemCollectionsGenericICollectionUnityEngineResolutionIterator& other); + UnityEngine::Resolution operator*(); + }; +} + namespace System { - namespace ComponentModel + namespace Collections { - namespace Design + namespace Generic { - struct ComponentChangingEventArgs : virtual System::EventArgs + Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator begin(System::Collections::Generic::ICollection& enumerable); + Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator end(System::Collections::Generic::ICollection& enumerable); + } + } +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + template<> struct IList : virtual System::Collections::Generic::ICollection { - ComponentChangingEventArgs(decltype(nullptr)); - ComponentChangingEventArgs(Plugin::InternalUse iu, int32_t handle); - ComponentChangingEventArgs(const ComponentChangingEventArgs& other); - ComponentChangingEventArgs(ComponentChangingEventArgs&& other); - virtual ~ComponentChangingEventArgs(); - ComponentChangingEventArgs& operator=(const ComponentChangingEventArgs& other); - ComponentChangingEventArgs& operator=(decltype(nullptr)); - ComponentChangingEventArgs& operator=(ComponentChangingEventArgs&& other); - bool operator==(const ComponentChangingEventArgs& other) const; - bool operator!=(const ComponentChangingEventArgs& other) const; + IList(decltype(nullptr)); + IList(Plugin::InternalUse, int32_t handle); + IList(const IList& other); + IList(IList&& other); + virtual ~IList(); + IList& operator=(const IList& other); + IList& operator=(decltype(nullptr)); + IList& operator=(IList&& other); + bool operator==(const IList& other) const; + bool operator!=(const IList& other) const; }; } } } +namespace Plugin +{ + struct SystemCollectionsGenericIListSystemStringIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericIListSystemStringIterator(decltype(nullptr)); + SystemCollectionsGenericIListSystemStringIterator(System::Collections::Generic::IList& enumerable); + ~SystemCollectionsGenericIListSystemStringIterator(); + SystemCollectionsGenericIListSystemStringIterator& operator++(); + bool operator!=(const SystemCollectionsGenericIListSystemStringIterator& other); + System::String operator*(); + }; +} + +namespace System +{ + namespace Collections + { + namespace Generic + { + Plugin::SystemCollectionsGenericIListSystemStringIterator begin(System::Collections::Generic::IList& enumerable); + Plugin::SystemCollectionsGenericIListSystemStringIterator end(System::Collections::Generic::IList& enumerable); + } + } +} + namespace System { - namespace ComponentModel + namespace Collections { - namespace Design + namespace Generic { - struct ComponentChangedEventArgs : virtual System::EventArgs + template<> struct IList : virtual System::Collections::Generic::ICollection { - ComponentChangedEventArgs(decltype(nullptr)); - ComponentChangedEventArgs(Plugin::InternalUse iu, int32_t handle); - ComponentChangedEventArgs(const ComponentChangedEventArgs& other); - ComponentChangedEventArgs(ComponentChangedEventArgs&& other); - virtual ~ComponentChangedEventArgs(); - ComponentChangedEventArgs& operator=(const ComponentChangedEventArgs& other); - ComponentChangedEventArgs& operator=(decltype(nullptr)); - ComponentChangedEventArgs& operator=(ComponentChangedEventArgs&& other); - bool operator==(const ComponentChangedEventArgs& other) const; - bool operator!=(const ComponentChangedEventArgs& other) const; + IList(decltype(nullptr)); + IList(Plugin::InternalUse, int32_t handle); + IList(const IList& other); + IList(IList&& other); + virtual ~IList(); + IList& operator=(const IList& other); + IList& operator=(decltype(nullptr)); + IList& operator=(IList&& other); + bool operator==(const IList& other) const; + bool operator!=(const IList& other) const; }; } } } -namespace System +namespace Plugin { - namespace ComponentModel + struct SystemCollectionsGenericIListSystemInt32Iterator { - namespace Design - { - struct ComponentRenameEventArgs : virtual System::EventArgs - { - ComponentRenameEventArgs(decltype(nullptr)); - ComponentRenameEventArgs(Plugin::InternalUse iu, int32_t handle); - ComponentRenameEventArgs(const ComponentRenameEventArgs& other); - ComponentRenameEventArgs(ComponentRenameEventArgs&& other); - virtual ~ComponentRenameEventArgs(); - ComponentRenameEventArgs& operator=(const ComponentRenameEventArgs& other); - ComponentRenameEventArgs& operator=(decltype(nullptr)); - ComponentRenameEventArgs& operator=(ComponentRenameEventArgs&& other); - bool operator==(const ComponentRenameEventArgs& other) const; - bool operator!=(const ComponentRenameEventArgs& other) const; - }; - } - } + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericIListSystemInt32Iterator(decltype(nullptr)); + SystemCollectionsGenericIListSystemInt32Iterator(System::Collections::Generic::IList& enumerable); + ~SystemCollectionsGenericIListSystemInt32Iterator(); + SystemCollectionsGenericIListSystemInt32Iterator& operator++(); + bool operator!=(const SystemCollectionsGenericIListSystemInt32Iterator& other); + System::Int32 operator*(); + }; } namespace System { - namespace ComponentModel + namespace Collections { - struct MemberDescriptor : virtual System::Object + namespace Generic { - MemberDescriptor(decltype(nullptr)); - MemberDescriptor(Plugin::InternalUse iu, int32_t handle); - MemberDescriptor(const MemberDescriptor& other); - MemberDescriptor(MemberDescriptor&& other); - virtual ~MemberDescriptor(); - MemberDescriptor& operator=(const MemberDescriptor& other); - MemberDescriptor& operator=(decltype(nullptr)); - MemberDescriptor& operator=(MemberDescriptor&& other); - bool operator==(const MemberDescriptor& other) const; - bool operator!=(const MemberDescriptor& other) const; - }; + Plugin::SystemCollectionsGenericIListSystemInt32Iterator begin(System::Collections::Generic::IList& enumerable); + Plugin::SystemCollectionsGenericIListSystemInt32Iterator end(System::Collections::Generic::IList& enumerable); + } } } -namespace UnityEngine +namespace System { - struct Time : virtual System::Object + namespace Collections { - Time(decltype(nullptr)); - Time(Plugin::InternalUse iu, int32_t handle); - Time(const Time& other); - Time(Time&& other); - virtual ~Time(); - Time& operator=(const Time& other); - Time& operator=(decltype(nullptr)); - Time& operator=(Time&& other); - bool operator==(const Time& other) const; - bool operator!=(const Time& other) const; - static float GetDeltaTime(); - }; + namespace Generic + { + template<> struct IList : virtual System::Collections::Generic::ICollection + { + IList(decltype(nullptr)); + IList(Plugin::InternalUse, int32_t handle); + IList(const IList& other); + IList(IList&& other); + virtual ~IList(); + IList& operator=(const IList& other); + IList& operator=(decltype(nullptr)); + IList& operator=(IList&& other); + bool operator==(const IList& other) const; + bool operator!=(const IList& other) const; + }; + } + } } -namespace System +namespace Plugin { - struct MarshalByRefObject : virtual System::Object + struct SystemCollectionsGenericIListSystemSingleIterator { - MarshalByRefObject(decltype(nullptr)); - MarshalByRefObject(Plugin::InternalUse iu, int32_t handle); - MarshalByRefObject(const MarshalByRefObject& other); - MarshalByRefObject(MarshalByRefObject&& other); - virtual ~MarshalByRefObject(); - MarshalByRefObject& operator=(const MarshalByRefObject& other); - MarshalByRefObject& operator=(decltype(nullptr)); - MarshalByRefObject& operator=(MarshalByRefObject&& other); - bool operator==(const MarshalByRefObject& other) const; - bool operator!=(const MarshalByRefObject& other) const; + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericIListSystemSingleIterator(decltype(nullptr)); + SystemCollectionsGenericIListSystemSingleIterator(System::Collections::Generic::IList& enumerable); + ~SystemCollectionsGenericIListSystemSingleIterator(); + SystemCollectionsGenericIListSystemSingleIterator& operator++(); + bool operator!=(const SystemCollectionsGenericIListSystemSingleIterator& other); + System::Single operator*(); }; } namespace System { - namespace IO + namespace Collections { - struct Stream : virtual System::MarshalByRefObject, virtual System::IDisposable + namespace Generic { - Stream(decltype(nullptr)); - Stream(Plugin::InternalUse iu, int32_t handle); - Stream(const Stream& other); - Stream(Stream&& other); - virtual ~Stream(); - Stream& operator=(const Stream& other); - Stream& operator=(decltype(nullptr)); - Stream& operator=(Stream&& other); - bool operator==(const Stream& other) const; - bool operator!=(const Stream& other) const; - }; + Plugin::SystemCollectionsGenericIListSystemSingleIterator begin(System::Collections::Generic::IList& enumerable); + Plugin::SystemCollectionsGenericIListSystemSingleIterator end(System::Collections::Generic::IList& enumerable); + } } } @@ -3989,42 +4520,46 @@ namespace System { namespace Generic { - template<> struct IComparer : virtual System::Object + template<> struct IList : virtual System::Collections::Generic::ICollection { - IComparer(decltype(nullptr)); - IComparer(Plugin::InternalUse iu, int32_t handle); - IComparer(const IComparer& other); - IComparer(IComparer&& other); - virtual ~IComparer(); - IComparer& operator=(const IComparer& other); - IComparer& operator=(decltype(nullptr)); - IComparer& operator=(IComparer&& other); - bool operator==(const IComparer& other) const; - bool operator!=(const IComparer& other) const; + IList(decltype(nullptr)); + IList(Plugin::InternalUse, int32_t handle); + IList(const IList& other); + IList(IList&& other); + virtual ~IList(); + IList& operator=(const IList& other); + IList& operator=(decltype(nullptr)); + IList& operator=(IList&& other); + bool operator==(const IList& other) const; + bool operator!=(const IList& other) const; }; } } } +namespace Plugin +{ + struct SystemCollectionsGenericIListUnityEngineRaycastHitIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericIListUnityEngineRaycastHitIterator(decltype(nullptr)); + SystemCollectionsGenericIListUnityEngineRaycastHitIterator(System::Collections::Generic::IList& enumerable); + ~SystemCollectionsGenericIListUnityEngineRaycastHitIterator(); + SystemCollectionsGenericIListUnityEngineRaycastHitIterator& operator++(); + bool operator!=(const SystemCollectionsGenericIListUnityEngineRaycastHitIterator& other); + UnityEngine::RaycastHit operator*(); + }; +} + namespace System { namespace Collections { namespace Generic { - template<> struct IComparer : virtual System::Object - { - IComparer(decltype(nullptr)); - IComparer(Plugin::InternalUse iu, int32_t handle); - IComparer(const IComparer& other); - IComparer(IComparer&& other); - virtual ~IComparer(); - IComparer& operator=(const IComparer& other); - IComparer& operator=(decltype(nullptr)); - IComparer& operator=(IComparer&& other); - bool operator==(const IComparer& other) const; - bool operator!=(const IComparer& other) const; - }; + Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator begin(System::Collections::Generic::IList& enumerable); + Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator end(System::Collections::Generic::IList& enumerable); } } } @@ -4035,88 +4570,85 @@ namespace System { namespace Generic { - template<> struct BaseIComparer : virtual System::Collections::Generic::IComparer + template<> struct IList : virtual System::Collections::Generic::ICollection { - BaseIComparer(decltype(nullptr)); - BaseIComparer(Plugin::InternalUse iu, int32_t handle); - BaseIComparer(const BaseIComparer& other); - BaseIComparer(BaseIComparer&& other); - virtual ~BaseIComparer(); - BaseIComparer& operator=(const BaseIComparer& other); - BaseIComparer& operator=(decltype(nullptr)); - BaseIComparer& operator=(BaseIComparer&& other); - bool operator==(const BaseIComparer& other) const; - bool operator!=(const BaseIComparer& other) const; - int32_t CppHandle; - BaseIComparer(); - virtual int32_t Compare(int32_t x, int32_t y); + IList(decltype(nullptr)); + IList(Plugin::InternalUse, int32_t handle); + IList(const IList& other); + IList(IList&& other); + virtual ~IList(); + IList& operator=(const IList& other); + IList& operator=(decltype(nullptr)); + IList& operator=(IList&& other); + bool operator==(const IList& other) const; + bool operator!=(const IList& other) const; }; } } } +namespace Plugin +{ + struct SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(decltype(nullptr)); + SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(System::Collections::Generic::IList& enumerable); + ~SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(); + SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& operator++(); + bool operator!=(const SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& other); + UnityEngine::GradientColorKey operator*(); + }; +} + namespace System { namespace Collections { namespace Generic { - template<> struct BaseIComparer : virtual System::Collections::Generic::IComparer - { - BaseIComparer(decltype(nullptr)); - BaseIComparer(Plugin::InternalUse iu, int32_t handle); - BaseIComparer(const BaseIComparer& other); - BaseIComparer(BaseIComparer&& other); - virtual ~BaseIComparer(); - BaseIComparer& operator=(const BaseIComparer& other); - BaseIComparer& operator=(decltype(nullptr)); - BaseIComparer& operator=(BaseIComparer&& other); - bool operator==(const BaseIComparer& other) const; - bool operator!=(const BaseIComparer& other) const; - int32_t CppHandle; - BaseIComparer(); - virtual int32_t Compare(System::String& x, System::String& y); - }; + Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::IList& enumerable); + Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator end(System::Collections::Generic::IList& enumerable); } } } namespace System { - struct StringComparer : virtual System::Collections::IComparer, virtual System::Collections::Generic::IComparer, virtual System::Collections::IEqualityComparer, virtual System::Collections::Generic::IEqualityComparer + namespace Collections { - StringComparer(decltype(nullptr)); - StringComparer(Plugin::InternalUse iu, int32_t handle); - StringComparer(const StringComparer& other); - StringComparer(StringComparer&& other); - virtual ~StringComparer(); - StringComparer& operator=(const StringComparer& other); - StringComparer& operator=(decltype(nullptr)); - StringComparer& operator=(StringComparer&& other); - bool operator==(const StringComparer& other) const; - bool operator!=(const StringComparer& other) const; - }; + namespace Generic + { + template<> struct IList : virtual System::Collections::Generic::ICollection + { + IList(decltype(nullptr)); + IList(Plugin::InternalUse, int32_t handle); + IList(const IList& other); + IList(IList&& other); + virtual ~IList(); + IList& operator=(const IList& other); + IList& operator=(decltype(nullptr)); + IList& operator=(IList&& other); + bool operator==(const IList& other) const; + bool operator!=(const IList& other) const; + }; + } + } } -namespace System +namespace Plugin { - struct BaseStringComparer : virtual System::StringComparer + struct SystemCollectionsGenericIListUnityEngineResolutionIterator { - BaseStringComparer(decltype(nullptr)); - BaseStringComparer(Plugin::InternalUse iu, int32_t handle); - BaseStringComparer(const BaseStringComparer& other); - BaseStringComparer(BaseStringComparer&& other); - virtual ~BaseStringComparer(); - BaseStringComparer& operator=(const BaseStringComparer& other); - BaseStringComparer& operator=(decltype(nullptr)); - BaseStringComparer& operator=(BaseStringComparer&& other); - bool operator==(const BaseStringComparer& other) const; - bool operator!=(const BaseStringComparer& other) const; - int32_t CppHandle; - BaseStringComparer(); - virtual int32_t Compare(System::String& x, System::String& y); - virtual System::Boolean Equals(System::String& x, System::String& y); - virtual int32_t GetHashCode(System::String& obj); + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericIListUnityEngineResolutionIterator(decltype(nullptr)); + SystemCollectionsGenericIListUnityEngineResolutionIterator(System::Collections::Generic::IList& enumerable); + ~SystemCollectionsGenericIListUnityEngineResolutionIterator(); + SystemCollectionsGenericIListUnityEngineResolutionIterator& operator++(); + bool operator!=(const SystemCollectionsGenericIListUnityEngineResolutionIterator& other); + UnityEngine::Resolution operator*(); }; } @@ -4124,20 +4656,11 @@ namespace System { namespace Collections { - struct Queue : virtual System::ICloneable, virtual System::Collections::ICollection + namespace Generic { - Queue(decltype(nullptr)); - Queue(Plugin::InternalUse iu, int32_t handle); - Queue(const Queue& other); - Queue(Queue&& other); - virtual ~Queue(); - Queue& operator=(const Queue& other); - Queue& operator=(decltype(nullptr)); - Queue& operator=(Queue&& other); - bool operator==(const Queue& other) const; - bool operator!=(const Queue& other) const; - int32_t GetCount(); - }; + Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator begin(System::Collections::Generic::IList& enumerable); + Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator end(System::Collections::Generic::IList& enumerable); + } } } @@ -4145,238 +4668,208 @@ namespace System { namespace Collections { - struct BaseQueue : virtual System::Collections::Queue + namespace Generic { - BaseQueue(decltype(nullptr)); - BaseQueue(Plugin::InternalUse iu, int32_t handle); - BaseQueue(const BaseQueue& other); - BaseQueue(BaseQueue&& other); - virtual ~BaseQueue(); - BaseQueue& operator=(const BaseQueue& other); - BaseQueue& operator=(decltype(nullptr)); - BaseQueue& operator=(BaseQueue&& other); - bool operator==(const BaseQueue& other) const; - bool operator!=(const BaseQueue& other) const; - int32_t CppHandle; - BaseQueue(); - virtual int32_t GetCount(); - }; + template<> struct List : virtual System::Collections::IList, virtual System::Collections::Generic::IList + { + List(decltype(nullptr)); + List(Plugin::InternalUse, int32_t handle); + List(const List& other); + List(List&& other); + virtual ~List(); + List& operator=(const List& other); + List& operator=(decltype(nullptr)); + List& operator=(List&& other); + bool operator==(const List& other) const; + bool operator!=(const List& other) const; + List(); + System::String GetItem(System::Int32 index); + void SetItem(System::Int32 index, System::String& value); + void Add(System::String& item); + void Sort(System::Collections::Generic::IComparer& comparer); + }; + } } } +namespace Plugin +{ + struct SystemCollectionsGenericListSystemStringIterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericListSystemStringIterator(decltype(nullptr)); + SystemCollectionsGenericListSystemStringIterator(System::Collections::Generic::List& enumerable); + ~SystemCollectionsGenericListSystemStringIterator(); + SystemCollectionsGenericListSystemStringIterator& operator++(); + bool operator!=(const SystemCollectionsGenericListSystemStringIterator& other); + System::String operator*(); + }; +} + namespace System { - namespace ComponentModel + namespace Collections { - namespace Design + namespace Generic { - struct IComponentChangeService : virtual System::Object - { - IComponentChangeService(decltype(nullptr)); - IComponentChangeService(Plugin::InternalUse iu, int32_t handle); - IComponentChangeService(const IComponentChangeService& other); - IComponentChangeService(IComponentChangeService&& other); - virtual ~IComponentChangeService(); - IComponentChangeService& operator=(const IComponentChangeService& other); - IComponentChangeService& operator=(decltype(nullptr)); - IComponentChangeService& operator=(IComponentChangeService&& other); - bool operator==(const IComponentChangeService& other) const; - bool operator!=(const IComponentChangeService& other) const; - }; + Plugin::SystemCollectionsGenericListSystemStringIterator begin(System::Collections::Generic::List& enumerable); + Plugin::SystemCollectionsGenericListSystemStringIterator end(System::Collections::Generic::List& enumerable); } } } namespace System { - namespace ComponentModel + namespace Collections { - namespace Design + namespace Generic { - struct BaseIComponentChangeService : virtual System::ComponentModel::Design::IComponentChangeService + template<> struct List : virtual System::Collections::IList, virtual System::Collections::Generic::IList { - BaseIComponentChangeService(decltype(nullptr)); - BaseIComponentChangeService(Plugin::InternalUse iu, int32_t handle); - BaseIComponentChangeService(const BaseIComponentChangeService& other); - BaseIComponentChangeService(BaseIComponentChangeService&& other); - virtual ~BaseIComponentChangeService(); - BaseIComponentChangeService& operator=(const BaseIComponentChangeService& other); - BaseIComponentChangeService& operator=(decltype(nullptr)); - BaseIComponentChangeService& operator=(BaseIComponentChangeService&& other); - bool operator==(const BaseIComponentChangeService& other) const; - bool operator!=(const BaseIComponentChangeService& other) const; - int32_t CppHandle; - BaseIComponentChangeService(); - virtual void OnComponentChanged(System::Object& component, System::ComponentModel::MemberDescriptor& member, System::Object& oldValue, System::Object& newValue); - virtual void OnComponentChanging(System::Object& component, System::ComponentModel::MemberDescriptor& member); - virtual void AddComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void RemoveComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void AddComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void RemoveComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void AddComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value); - virtual void RemoveComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value); - virtual void AddComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value); - virtual void RemoveComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value); - virtual void AddComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void RemoveComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void AddComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void RemoveComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void AddComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value); - virtual void RemoveComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value); + List(decltype(nullptr)); + List(Plugin::InternalUse, int32_t handle); + List(const List& other); + List(List&& other); + virtual ~List(); + List& operator=(const List& other); + List& operator=(decltype(nullptr)); + List& operator=(List&& other); + bool operator==(const List& other) const; + bool operator!=(const List& other) const; + List(); + System::Int32 GetItem(System::Int32 index); + void SetItem(System::Int32 index, System::Int32 value); + void Add(System::Int32 item); + void Sort(System::Collections::Generic::IComparer& comparer); }; } } } +namespace Plugin +{ + struct SystemCollectionsGenericListSystemInt32Iterator + { + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsGenericListSystemInt32Iterator(decltype(nullptr)); + SystemCollectionsGenericListSystemInt32Iterator(System::Collections::Generic::List& enumerable); + ~SystemCollectionsGenericListSystemInt32Iterator(); + SystemCollectionsGenericListSystemInt32Iterator& operator++(); + bool operator!=(const SystemCollectionsGenericListSystemInt32Iterator& other); + System::Int32 operator*(); + }; +} + namespace System { - namespace IO + namespace Collections { - struct FileStream : virtual System::IO::Stream, virtual System::IDisposable + namespace Generic { - FileStream(decltype(nullptr)); - FileStream(Plugin::InternalUse iu, int32_t handle); - FileStream(const FileStream& other); - FileStream(FileStream&& other); - virtual ~FileStream(); - FileStream& operator=(const FileStream& other); - FileStream& operator=(decltype(nullptr)); - FileStream& operator=(FileStream&& other); - bool operator==(const FileStream& other) const; - bool operator!=(const FileStream& other) const; - FileStream(System::String& path, System::IO::FileMode mode); - void WriteByte(uint8_t value); - }; + Plugin::SystemCollectionsGenericListSystemInt32Iterator begin(System::Collections::Generic::List& enumerable); + Plugin::SystemCollectionsGenericListSystemInt32Iterator end(System::Collections::Generic::List& enumerable); + } } } namespace System { - namespace IO + namespace Collections { - struct BaseFileStream : virtual System::IO::FileStream + namespace ObjectModel { - BaseFileStream(decltype(nullptr)); - BaseFileStream(Plugin::InternalUse iu, int32_t handle); - BaseFileStream(const BaseFileStream& other); - BaseFileStream(BaseFileStream&& other); - virtual ~BaseFileStream(); - BaseFileStream& operator=(const BaseFileStream& other); - BaseFileStream& operator=(decltype(nullptr)); - BaseFileStream& operator=(BaseFileStream&& other); - bool operator==(const BaseFileStream& other) const; - bool operator!=(const BaseFileStream& other) const; - int32_t CppHandle; - BaseFileStream(System::String& path, System::IO::FileMode mode); - virtual void WriteByte(uint8_t value); - }; + template<> struct Collection : virtual System::Collections::IList, virtual System::Collections::Generic::IList + { + Collection(decltype(nullptr)); + Collection(Plugin::InternalUse, int32_t handle); + Collection(const Collection& other); + Collection(Collection&& other); + virtual ~Collection(); + Collection& operator=(const Collection& other); + Collection& operator=(decltype(nullptr)); + Collection& operator=(Collection&& other); + bool operator==(const Collection& other) const; + bool operator!=(const Collection& other) const; + }; + } } } -namespace UnityEngine +namespace Plugin { - namespace Playables + struct SystemCollectionsObjectModelCollectionSystemInt32Iterator { - struct PlayableHandle : virtual System::ValueType - { - PlayableHandle(decltype(nullptr)); - PlayableHandle(Plugin::InternalUse iu, int32_t handle); - PlayableHandle(const PlayableHandle& other); - PlayableHandle(PlayableHandle&& other); - virtual ~PlayableHandle(); - PlayableHandle& operator=(const PlayableHandle& other); - PlayableHandle& operator=(decltype(nullptr)); - PlayableHandle& operator=(PlayableHandle&& other); - bool operator==(const PlayableHandle& other) const; - bool operator!=(const PlayableHandle& other) const; - }; - } + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsObjectModelCollectionSystemInt32Iterator(decltype(nullptr)); + SystemCollectionsObjectModelCollectionSystemInt32Iterator(System::Collections::ObjectModel::Collection& enumerable); + ~SystemCollectionsObjectModelCollectionSystemInt32Iterator(); + SystemCollectionsObjectModelCollectionSystemInt32Iterator& operator++(); + bool operator!=(const SystemCollectionsObjectModelCollectionSystemInt32Iterator& other); + System::Int32 operator*(); + }; } -namespace UnityEngine +namespace System { - namespace Experimental + namespace Collections { - namespace UIElements + namespace ObjectModel { - struct CallbackEventHandler : virtual UnityEngine::Experimental::UIElements::IEventHandler - { - CallbackEventHandler(decltype(nullptr)); - CallbackEventHandler(Plugin::InternalUse iu, int32_t handle); - CallbackEventHandler(const CallbackEventHandler& other); - CallbackEventHandler(CallbackEventHandler&& other); - virtual ~CallbackEventHandler(); - CallbackEventHandler& operator=(const CallbackEventHandler& other); - CallbackEventHandler& operator=(decltype(nullptr)); - CallbackEventHandler& operator=(CallbackEventHandler&& other); - bool operator==(const CallbackEventHandler& other) const; - bool operator!=(const CallbackEventHandler& other) const; - }; + Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator begin(System::Collections::ObjectModel::Collection& enumerable); + Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator end(System::Collections::ObjectModel::Collection& enumerable); } } } -namespace UnityEngine +namespace System { - namespace Experimental + namespace Collections { - namespace UIElements + namespace ObjectModel { - struct VisualElement : virtual UnityEngine::Experimental::UIElements::CallbackEventHandler, virtual UnityEngine::Experimental::UIElements::IEventHandler, virtual UnityEngine::Experimental::UIElements::IStyle + template<> struct KeyedCollection : virtual System::Collections::ObjectModel::Collection, virtual System::Collections::IList, virtual System::Collections::Generic::IList { - VisualElement(decltype(nullptr)); - VisualElement(Plugin::InternalUse iu, int32_t handle); - VisualElement(const VisualElement& other); - VisualElement(VisualElement&& other); - virtual ~VisualElement(); - VisualElement& operator=(const VisualElement& other); - VisualElement& operator=(decltype(nullptr)); - VisualElement& operator=(VisualElement&& other); - bool operator==(const VisualElement& other) const; - bool operator!=(const VisualElement& other) const; + KeyedCollection(decltype(nullptr)); + KeyedCollection(Plugin::InternalUse, int32_t handle); + KeyedCollection(const KeyedCollection& other); + KeyedCollection(KeyedCollection&& other); + virtual ~KeyedCollection(); + KeyedCollection& operator=(const KeyedCollection& other); + KeyedCollection& operator=(decltype(nullptr)); + KeyedCollection& operator=(KeyedCollection&& other); + bool operator==(const KeyedCollection& other) const; + bool operator!=(const KeyedCollection& other) const; }; } } } -namespace UnityEngine +namespace Plugin { - namespace Experimental + struct SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator { - namespace UIElements - { - namespace UQueryExtensions - { - UnityEngine::Experimental::UIElements::VisualElement Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name, System::Array1& classes); - UnityEngine::Experimental::UIElements::VisualElement Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name = Plugin::NullString, System::String& className = Plugin::NullString); - } - } - } + System::Collections::Generic::IEnumerator enumerator; + bool hasMore; + SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(decltype(nullptr)); + SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(System::Collections::ObjectModel::KeyedCollection& enumerable); + ~SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(); + SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& operator++(); + bool operator!=(const SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& other); + System::Int32 operator*(); + }; } -namespace UnityEngine +namespace System { - namespace XR + namespace Collections { - namespace WSA + namespace ObjectModel { - namespace Input - { - struct InteractionSourcePose : virtual System::ValueType - { - InteractionSourcePose(decltype(nullptr)); - InteractionSourcePose(Plugin::InternalUse iu, int32_t handle); - InteractionSourcePose(const InteractionSourcePose& other); - InteractionSourcePose(InteractionSourcePose&& other); - virtual ~InteractionSourcePose(); - InteractionSourcePose& operator=(const InteractionSourcePose& other); - InteractionSourcePose& operator=(decltype(nullptr)); - InteractionSourcePose& operator=(InteractionSourcePose&& other); - bool operator==(const InteractionSourcePose& other) const; - bool operator!=(const InteractionSourcePose& other) const; - System::Boolean TryGetRotation(UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node = UnityEngine::XR::WSA::Input::InteractionSourceNode::Grip); - }; - } + Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator begin(System::Collections::ObjectModel::KeyedCollection& enumerable); + Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator end(System::Collections::ObjectModel::KeyedCollection& enumerable); } } } @@ -4388,7 +4881,7 @@ namespace MyGame struct TestScript : virtual UnityEngine::MonoBehaviour { TestScript(decltype(nullptr)); - TestScript(Plugin::InternalUse iu, int32_t handle); + TestScript(Plugin::InternalUse, int32_t handle); TestScript(const TestScript& other); TestScript(TestScript&& other); virtual ~TestScript(); @@ -4398,7 +4891,7 @@ namespace MyGame bool operator==(const TestScript& other) const; bool operator!=(const TestScript& other) const; void Awake(); - void OnAnimatorIK(int32_t param0); + void OnAnimatorIK(System::Int32 param0); void OnCollisionEnter(UnityEngine::Collision& param0); void Update(); }; @@ -4412,7 +4905,7 @@ namespace MyGame struct AnotherScript : virtual UnityEngine::MonoBehaviour { AnotherScript(decltype(nullptr)); - AnotherScript(Plugin::InternalUse iu, int32_t handle); + AnotherScript(Plugin::InternalUse, int32_t handle); AnotherScript(const AnotherScript& other); AnotherScript(AnotherScript&& other); virtual ~AnotherScript(); @@ -4429,35 +4922,35 @@ namespace MyGame namespace Plugin { - template<> struct ArrayElementProxy1_1 + template<> struct ArrayElementProxy1_1 { int32_t Handle; int32_t Index0; - ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0); - void operator=(int32_t item); - operator int32_t(); + ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0); + void operator=(System::Int32 item); + operator System::Int32(); }; } namespace System { - template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList + template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { - Array1(decltype(nullptr)); - Array1(Plugin::InternalUse iu, int32_t handle); - Array1(const Array1& other); - Array1(Array1&& other); - virtual ~Array1(); - Array1& operator=(const Array1& other); - Array1& operator=(decltype(nullptr)); - Array1& operator=(Array1&& other); - bool operator==(const Array1& other) const; - bool operator!=(const Array1& other) const; + Array1(decltype(nullptr)); + Array1(Plugin::InternalUse, int32_t handle); + Array1(const Array1& other); + Array1(Array1&& other); + virtual ~Array1(); + Array1& operator=(const Array1& other); + Array1& operator=(decltype(nullptr)); + Array1& operator=(Array1&& other); + bool operator==(const Array1& other) const; + bool operator!=(const Array1& other) const; int32_t InternalLength; - Array1(int32_t length0); - int32_t GetLength(); - int32_t GetRank(); - Plugin::ArrayElementProxy1_1 operator[](int32_t index); + Array1(System::Int32 length0); + System::Int32 GetLength(); + System::Int32 GetRank(); + Plugin::ArrayElementProxy1_1 operator[](int32_t index); }; } @@ -4465,113 +4958,113 @@ namespace Plugin { struct SystemInt32Array1Iterator { - System::Array1& array; + System::Array1& array; int index; - SystemInt32Array1Iterator(System::Array1& array, int32_t index); + SystemInt32Array1Iterator(System::Array1& array, int32_t index); SystemInt32Array1Iterator& operator++(); bool operator!=(const SystemInt32Array1Iterator& other); - int32_t operator*(); + System::Int32 operator*(); }; } namespace System { - Plugin::SystemInt32Array1Iterator begin(System::Array1& array); - Plugin::SystemInt32Array1Iterator end(System::Array1& array); + Plugin::SystemInt32Array1Iterator begin(System::Array1& array); + Plugin::SystemInt32Array1Iterator end(System::Array1& array); } namespace Plugin { - template<> struct ArrayElementProxy1_1 + template<> struct ArrayElementProxy1_1 { int32_t Handle; int32_t Index0; - ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0); - void operator=(float item); - operator float(); + ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0); + void operator=(System::Single item); + operator System::Single(); }; } namespace Plugin { - template<> struct ArrayElementProxy1_2 + template<> struct ArrayElementProxy1_2 { int32_t Handle; int32_t Index0; - ArrayElementProxy1_2(Plugin::InternalUse iu, int32_t handle, int32_t index0); - Plugin::ArrayElementProxy2_2 operator[](int32_t index); + ArrayElementProxy1_2(Plugin::InternalUse, int32_t handle, int32_t index0); + Plugin::ArrayElementProxy2_2 operator[](int32_t index); }; } namespace Plugin { - template<> struct ArrayElementProxy2_2 + template<> struct ArrayElementProxy2_2 { int32_t Handle; int32_t Index0; int32_t Index1; - ArrayElementProxy2_2(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1); - void operator=(float item); - operator float(); + ArrayElementProxy2_2(Plugin::InternalUse, int32_t handle, int32_t index0, int32_t index1); + void operator=(System::Single item); + operator System::Single(); }; } namespace Plugin { - template<> struct ArrayElementProxy1_3 + template<> struct ArrayElementProxy1_3 { int32_t Handle; int32_t Index0; - ArrayElementProxy1_3(Plugin::InternalUse iu, int32_t handle, int32_t index0); - Plugin::ArrayElementProxy2_3 operator[](int32_t index); + ArrayElementProxy1_3(Plugin::InternalUse, int32_t handle, int32_t index0); + Plugin::ArrayElementProxy2_3 operator[](int32_t index); }; } namespace Plugin { - template<> struct ArrayElementProxy2_3 + template<> struct ArrayElementProxy2_3 { int32_t Handle; int32_t Index0; int32_t Index1; - ArrayElementProxy2_3(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1); - Plugin::ArrayElementProxy3_3 operator[](int32_t index); + ArrayElementProxy2_3(Plugin::InternalUse, int32_t handle, int32_t index0, int32_t index1); + Plugin::ArrayElementProxy3_3 operator[](int32_t index); }; } namespace Plugin { - template<> struct ArrayElementProxy3_3 + template<> struct ArrayElementProxy3_3 { int32_t Handle; int32_t Index0; int32_t Index1; int32_t Index2; - ArrayElementProxy3_3(Plugin::InternalUse iu, int32_t handle, int32_t index0, int32_t index1, int32_t index2); - void operator=(float item); - operator float(); + ArrayElementProxy3_3(Plugin::InternalUse, int32_t handle, int32_t index0, int32_t index1, int32_t index2); + void operator=(System::Single item); + operator System::Single(); }; } namespace System { - template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList + template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { - Array1(decltype(nullptr)); - Array1(Plugin::InternalUse iu, int32_t handle); - Array1(const Array1& other); - Array1(Array1&& other); - virtual ~Array1(); - Array1& operator=(const Array1& other); - Array1& operator=(decltype(nullptr)); - Array1& operator=(Array1&& other); - bool operator==(const Array1& other) const; - bool operator!=(const Array1& other) const; + Array1(decltype(nullptr)); + Array1(Plugin::InternalUse, int32_t handle); + Array1(const Array1& other); + Array1(Array1&& other); + virtual ~Array1(); + Array1& operator=(const Array1& other); + Array1& operator=(decltype(nullptr)); + Array1& operator=(Array1&& other); + bool operator==(const Array1& other) const; + bool operator!=(const Array1& other) const; int32_t InternalLength; - Array1(int32_t length0); - int32_t GetLength(); - int32_t GetRank(); - Plugin::ArrayElementProxy1_1 operator[](int32_t index); + Array1(System::Int32 length0); + System::Int32 GetLength(); + System::Int32 GetRank(); + Plugin::ArrayElementProxy1_1 operator[](int32_t index); }; } @@ -4579,66 +5072,66 @@ namespace Plugin { struct SystemSingleArray1Iterator { - System::Array1& array; + System::Array1& array; int index; - SystemSingleArray1Iterator(System::Array1& array, int32_t index); + SystemSingleArray1Iterator(System::Array1& array, int32_t index); SystemSingleArray1Iterator& operator++(); bool operator!=(const SystemSingleArray1Iterator& other); - float operator*(); + System::Single operator*(); }; } namespace System { - Plugin::SystemSingleArray1Iterator begin(System::Array1& array); - Plugin::SystemSingleArray1Iterator end(System::Array1& array); + Plugin::SystemSingleArray1Iterator begin(System::Array1& array); + Plugin::SystemSingleArray1Iterator end(System::Array1& array); } namespace System { - template<> struct Array2 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList + template<> struct Array2 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList { - Array2(decltype(nullptr)); - Array2(Plugin::InternalUse iu, int32_t handle); - Array2(const Array2& other); - Array2(Array2&& other); - virtual ~Array2(); - Array2& operator=(const Array2& other); - Array2& operator=(decltype(nullptr)); - Array2& operator=(Array2&& other); - bool operator==(const Array2& other) const; - bool operator!=(const Array2& other) const; + Array2(decltype(nullptr)); + Array2(Plugin::InternalUse, int32_t handle); + Array2(const Array2& other); + Array2(Array2&& other); + virtual ~Array2(); + Array2& operator=(const Array2& other); + Array2& operator=(decltype(nullptr)); + Array2& operator=(Array2&& other); + bool operator==(const Array2& other) const; + bool operator!=(const Array2& other) const; int32_t InternalLength; int32_t InternalLengths[2]; - Array2(int32_t length0, int32_t length1); - int32_t GetLength(); - int32_t GetLength(int32_t dimension); - int32_t GetRank(); - Plugin::ArrayElementProxy1_2 operator[](int32_t index); + Array2(System::Int32 length0, System::Int32 length1); + System::Int32 GetLength(); + System::Int32 GetLength(System::Int32 dimension); + System::Int32 GetRank(); + Plugin::ArrayElementProxy1_2 operator[](int32_t index); }; } namespace System { - template<> struct Array3 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList + template<> struct Array3 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList { - Array3(decltype(nullptr)); - Array3(Plugin::InternalUse iu, int32_t handle); - Array3(const Array3& other); - Array3(Array3&& other); - virtual ~Array3(); - Array3& operator=(const Array3& other); - Array3& operator=(decltype(nullptr)); - Array3& operator=(Array3&& other); - bool operator==(const Array3& other) const; - bool operator!=(const Array3& other) const; + Array3(decltype(nullptr)); + Array3(Plugin::InternalUse, int32_t handle); + Array3(const Array3& other); + Array3(Array3&& other); + virtual ~Array3(); + Array3& operator=(const Array3& other); + Array3& operator=(decltype(nullptr)); + Array3& operator=(Array3&& other); + bool operator==(const Array3& other) const; + bool operator!=(const Array3& other) const; int32_t InternalLength; int32_t InternalLengths[3]; - Array3(int32_t length0, int32_t length1, int32_t length2); - int32_t GetLength(); - int32_t GetLength(int32_t dimension); - int32_t GetRank(); - Plugin::ArrayElementProxy1_3 operator[](int32_t index); + Array3(System::Int32 length0, System::Int32 length1, System::Int32 length2); + System::Int32 GetLength(); + System::Int32 GetLength(System::Int32 dimension); + System::Int32 GetRank(); + Plugin::ArrayElementProxy1_3 operator[](int32_t index); }; } @@ -4648,7 +5141,7 @@ namespace Plugin { int32_t Handle; int32_t Index0; - ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0); + ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0); void operator=(System::String item); operator System::String(); }; @@ -4659,7 +5152,7 @@ namespace System template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { Array1(decltype(nullptr)); - Array1(Plugin::InternalUse iu, int32_t handle); + Array1(Plugin::InternalUse, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); @@ -4669,9 +5162,9 @@ namespace System bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; int32_t InternalLength; - Array1(int32_t length0); - int32_t GetLength(); - int32_t GetRank(); + Array1(System::Int32 length0); + System::Int32 GetLength(); + System::Int32 GetRank(); Plugin::ArrayElementProxy1_1 operator[](int32_t index); }; } @@ -4701,7 +5194,7 @@ namespace Plugin { int32_t Handle; int32_t Index0; - ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0); + ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0); void operator=(UnityEngine::Resolution item); operator UnityEngine::Resolution(); }; @@ -4712,7 +5205,7 @@ namespace System template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { Array1(decltype(nullptr)); - Array1(Plugin::InternalUse iu, int32_t handle); + Array1(Plugin::InternalUse, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); @@ -4722,9 +5215,9 @@ namespace System bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; int32_t InternalLength; - Array1(int32_t length0); - int32_t GetLength(); - int32_t GetRank(); + Array1(System::Int32 length0); + System::Int32 GetLength(); + System::Int32 GetRank(); Plugin::ArrayElementProxy1_1 operator[](int32_t index); }; } @@ -4754,7 +5247,7 @@ namespace Plugin { int32_t Handle; int32_t Index0; - ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0); + ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0); void operator=(UnityEngine::RaycastHit item); operator UnityEngine::RaycastHit(); }; @@ -4765,7 +5258,7 @@ namespace System template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { Array1(decltype(nullptr)); - Array1(Plugin::InternalUse iu, int32_t handle); + Array1(Plugin::InternalUse, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); @@ -4775,9 +5268,9 @@ namespace System bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; int32_t InternalLength; - Array1(int32_t length0); - int32_t GetLength(); - int32_t GetRank(); + Array1(System::Int32 length0); + System::Int32 GetLength(); + System::Int32 GetRank(); Plugin::ArrayElementProxy1_1 operator[](int32_t index); }; } @@ -4807,7 +5300,7 @@ namespace Plugin { int32_t Handle; int32_t Index0; - ArrayElementProxy1_1(Plugin::InternalUse iu, int32_t handle, int32_t index0); + ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0); void operator=(UnityEngine::GradientColorKey item); operator UnityEngine::GradientColorKey(); }; @@ -4818,7 +5311,7 @@ namespace System template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList { Array1(decltype(nullptr)); - Array1(Plugin::InternalUse iu, int32_t handle); + Array1(Plugin::InternalUse, int32_t handle); Array1(const Array1& other); Array1(Array1&& other); virtual ~Array1(); @@ -4828,9 +5321,9 @@ namespace System bool operator==(const Array1& other) const; bool operator!=(const Array1& other) const; int32_t InternalLength; - Array1(int32_t length0); - int32_t GetLength(); - int32_t GetRank(); + Array1(System::Int32 length0); + System::Int32 GetLength(); + System::Int32 GetRank(); Plugin::ArrayElementProxy1_1 operator[](int32_t index); }; } @@ -4859,7 +5352,7 @@ namespace System struct Action : virtual System::Object { Action(decltype(nullptr)); - Action(Plugin::InternalUse iu, int32_t handle); + Action(Plugin::InternalUse, int32_t handle); Action(const Action& other); Action(Action&& other); virtual ~Action(); @@ -4880,97 +5373,97 @@ namespace System namespace System { - template<> struct Action1 : virtual System::Object + template<> struct Action1 : virtual System::Object { - Action1(decltype(nullptr)); - Action1(Plugin::InternalUse iu, int32_t handle); - Action1(const Action1& other); - Action1(Action1&& other); - virtual ~Action1(); - Action1& operator=(const Action1& other); - Action1& operator=(decltype(nullptr)); - Action1& operator=(Action1&& other); - bool operator==(const Action1& other) const; - bool operator!=(const Action1& other) const; + Action1(decltype(nullptr)); + Action1(Plugin::InternalUse, int32_t handle); + Action1(const Action1& other); + Action1(Action1&& other); + virtual ~Action1(); + Action1& operator=(const Action1& other); + Action1& operator=(decltype(nullptr)); + Action1& operator=(Action1&& other); + bool operator==(const Action1& other) const; + bool operator!=(const Action1& other) const; int32_t CppHandle; int32_t ClassHandle; Action1(); - void operator+=(System::Action1& del); - void operator-=(System::Action1& del); - virtual void operator()(float obj); - void Invoke(float obj); + void operator+=(System::Action1& del); + void operator-=(System::Action1& del); + virtual void operator()(System::Single obj); + void Invoke(System::Single obj); }; } namespace System { - template<> struct Action2 : virtual System::Object + template<> struct Action2 : virtual System::Object { - Action2(decltype(nullptr)); - Action2(Plugin::InternalUse iu, int32_t handle); - Action2(const Action2& other); - Action2(Action2&& other); - virtual ~Action2(); - Action2& operator=(const Action2& other); - Action2& operator=(decltype(nullptr)); - Action2& operator=(Action2&& other); - bool operator==(const Action2& other) const; - bool operator!=(const Action2& other) const; + Action2(decltype(nullptr)); + Action2(Plugin::InternalUse, int32_t handle); + Action2(const Action2& other); + Action2(Action2&& other); + virtual ~Action2(); + Action2& operator=(const Action2& other); + Action2& operator=(decltype(nullptr)); + Action2& operator=(Action2&& other); + bool operator==(const Action2& other) const; + bool operator!=(const Action2& other) const; int32_t CppHandle; int32_t ClassHandle; Action2(); - void operator+=(System::Action2& del); - void operator-=(System::Action2& del); - virtual void operator()(float arg1, float arg2); - void Invoke(float arg1, float arg2); + void operator+=(System::Action2& del); + void operator-=(System::Action2& del); + virtual void operator()(System::Single arg1, System::Single arg2); + void Invoke(System::Single arg1, System::Single arg2); }; } namespace System { - template<> struct Func3 : virtual System::Object + template<> struct Func3 : virtual System::Object { - Func3(decltype(nullptr)); - Func3(Plugin::InternalUse iu, int32_t handle); - Func3(const Func3& other); - Func3(Func3&& other); - virtual ~Func3(); - Func3& operator=(const Func3& other); - Func3& operator=(decltype(nullptr)); - Func3& operator=(Func3&& other); - bool operator==(const Func3& other) const; - bool operator!=(const Func3& other) const; + Func3(decltype(nullptr)); + Func3(Plugin::InternalUse, int32_t handle); + Func3(const Func3& other); + Func3(Func3&& other); + virtual ~Func3(); + Func3& operator=(const Func3& other); + Func3& operator=(decltype(nullptr)); + Func3& operator=(Func3&& other); + bool operator==(const Func3& other) const; + bool operator!=(const Func3& other) const; int32_t CppHandle; int32_t ClassHandle; Func3(); - void operator+=(System::Func3& del); - void operator-=(System::Func3& del); - virtual double operator()(int32_t arg1, float arg2); - double Invoke(int32_t arg1, float arg2); + void operator+=(System::Func3& del); + void operator-=(System::Func3& del); + virtual System::Double operator()(System::Int32 arg1, System::Single arg2); + System::Double Invoke(System::Int32 arg1, System::Single arg2); }; } namespace System { - template<> struct Func3 : virtual System::Object + template<> struct Func3 : virtual System::Object { - Func3(decltype(nullptr)); - Func3(Plugin::InternalUse iu, int32_t handle); - Func3(const Func3& other); - Func3(Func3&& other); - virtual ~Func3(); - Func3& operator=(const Func3& other); - Func3& operator=(decltype(nullptr)); - Func3& operator=(Func3&& other); - bool operator==(const Func3& other) const; - bool operator!=(const Func3& other) const; + Func3(decltype(nullptr)); + Func3(Plugin::InternalUse, int32_t handle); + Func3(const Func3& other); + Func3(Func3&& other); + virtual ~Func3(); + Func3& operator=(const Func3& other); + Func3& operator=(decltype(nullptr)); + Func3& operator=(Func3&& other); + bool operator==(const Func3& other) const; + bool operator!=(const Func3& other) const; int32_t CppHandle; int32_t ClassHandle; Func3(); - void operator+=(System::Func3& del); - void operator-=(System::Func3& del); - virtual System::String operator()(int16_t arg1, int32_t arg2); - System::String Invoke(int16_t arg1, int32_t arg2); + void operator+=(System::Func3& del); + void operator-=(System::Func3& del); + virtual System::String operator()(System::Int16 arg1, System::Int32 arg2); + System::String Invoke(System::Int16 arg1, System::Int32 arg2); }; } @@ -4979,7 +5472,7 @@ namespace System struct AppDomainInitializer : virtual System::Object { AppDomainInitializer(decltype(nullptr)); - AppDomainInitializer(Plugin::InternalUse iu, int32_t handle); + AppDomainInitializer(Plugin::InternalUse, int32_t handle); AppDomainInitializer(const AppDomainInitializer& other); AppDomainInitializer(AppDomainInitializer&& other); virtual ~AppDomainInitializer(); @@ -5005,7 +5498,7 @@ namespace UnityEngine struct UnityAction : virtual System::Object { UnityAction(decltype(nullptr)); - UnityAction(Plugin::InternalUse iu, int32_t handle); + UnityAction(Plugin::InternalUse, int32_t handle); UnityAction(const UnityAction& other); UnityAction(UnityAction&& other); virtual ~UnityAction(); @@ -5032,7 +5525,7 @@ namespace UnityEngine template<> struct UnityAction2 : virtual System::Object { UnityAction2(decltype(nullptr)); - UnityAction2(Plugin::InternalUse iu, int32_t handle); + UnityAction2(Plugin::InternalUse, int32_t handle); UnityAction2(const UnityAction2& other); UnityAction2(UnityAction2&& other); virtual ~UnityAction2(); @@ -5061,7 +5554,7 @@ namespace System struct ComponentEventHandler : virtual System::Object { ComponentEventHandler(decltype(nullptr)); - ComponentEventHandler(Plugin::InternalUse iu, int32_t handle); + ComponentEventHandler(Plugin::InternalUse, int32_t handle); ComponentEventHandler(const ComponentEventHandler& other); ComponentEventHandler(ComponentEventHandler&& other); virtual ~ComponentEventHandler(); @@ -5091,7 +5584,7 @@ namespace System struct ComponentChangingEventHandler : virtual System::Object { ComponentChangingEventHandler(decltype(nullptr)); - ComponentChangingEventHandler(Plugin::InternalUse iu, int32_t handle); + ComponentChangingEventHandler(Plugin::InternalUse, int32_t handle); ComponentChangingEventHandler(const ComponentChangingEventHandler& other); ComponentChangingEventHandler(ComponentChangingEventHandler&& other); virtual ~ComponentChangingEventHandler(); @@ -5121,7 +5614,7 @@ namespace System struct ComponentChangedEventHandler : virtual System::Object { ComponentChangedEventHandler(decltype(nullptr)); - ComponentChangedEventHandler(Plugin::InternalUse iu, int32_t handle); + ComponentChangedEventHandler(Plugin::InternalUse, int32_t handle); ComponentChangedEventHandler(const ComponentChangedEventHandler& other); ComponentChangedEventHandler(ComponentChangedEventHandler&& other); virtual ~ComponentChangedEventHandler(); @@ -5151,7 +5644,7 @@ namespace System struct ComponentRenameEventHandler : virtual System::Object { ComponentRenameEventHandler(decltype(nullptr)); - ComponentRenameEventHandler(Plugin::InternalUse iu, int32_t handle); + ComponentRenameEventHandler(Plugin::InternalUse, int32_t handle); ComponentRenameEventHandler(const ComponentRenameEventHandler& other); ComponentRenameEventHandler(ComponentRenameEventHandler&& other); virtual ~ComponentRenameEventHandler(); diff --git a/Unity/ProjectSettings/ProjectVersion.txt b/Unity/ProjectSettings/ProjectVersion.txt index 7a6fffb..e6cd1f9 100644 --- a/Unity/ProjectSettings/ProjectVersion.txt +++ b/Unity/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2017.2.0f3 +m_EditorVersion: 2017.3.0f3 diff --git a/Unity/ProjectSettings/UnityAdsSettings.asset b/Unity/ProjectSettings/UnityAdsSettings.asset deleted file mode 100644 index e6070fc50c853dda6c6a34b0c47dee87c6d20f9a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4116 zcmeH~Jx;?w5QS%BApC>?5*=+2T?B~`ZBj%K2?QtvDuj&eAfv=a@uq;vSKtC58hR)= z3MDrI^WNG4Avgirm1cM5+wt@IZDo%GYHk+wqjyzhGleOLFQ;lMl-#oO+{Z+qBohTbp=yu9Yivm=-U6EB}v sTv7S;jW_IS9k32q2do3u0qcNuz&c Date: Fri, 16 Feb 2018 15:51:19 -0800 Subject: [PATCH 56/95] Use a temporary file to enable hot reloading on Windows --- Unity/Assets/NativeScript/Bindings.cs | 19 +++++++++++++++++-- Unity/CppSource/Game/Game.cpp | 10 +++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 86a7bf3..0f221a1 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -292,8 +292,9 @@ public ReusableWaitForSecondsRealtime(float time) const string PLUGIN_PATH = "/Plugins/Editor/libNativeScript.so"; #elif UNITY_EDITOR_WIN const string PLUGIN_PATH = "/Plugins/Editor/NativeScript.dll"; + const string PLUGIN_TEMP_PATH = "/Plugins/Editor/NativeScript_temp.dll"; #endif - + enum InitMode : byte { FirstBoot, @@ -1517,6 +1518,9 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke /*END DELEGATE TYPES*/ private static readonly string pluginPath = Application.dataPath + PLUGIN_PATH; +#if UNITY_EDITOR_WIN + private static readonly string pluginTempPath = Application.dataPath + PLUGIN_TEMP_PATH; +#endif public static Exception UnhandledCppException; public static SetCsharpExceptionDelegate SetCsharpException; private static IntPtr memory; @@ -1602,8 +1606,16 @@ ReusableWaitForSecondsRealtime poll private static void OpenPlugin(InitMode initMode) { #if UNITY_EDITOR + string loadPath; +#if UNITY_EDITOR_WIN + // Copy native library to temporary file + File.Copy(pluginPath, pluginTempPath); + loadPath = pluginTempPath; +#else + loadPath = pluginPath; +#endif // Open native library - libraryHandle = OpenLibrary(pluginPath); + libraryHandle = OpenLibrary(loadPath); InitDelegate Init = GetDelegate( libraryHandle, "Init"); @@ -1967,6 +1979,9 @@ private static void ClosePlugin() #if UNITY_EDITOR CloseLibrary(libraryHandle); libraryHandle = IntPtr.Zero; +#endif +#if UNITY_EDITOR_WIN + File.Delete(pluginTempPath); #endif } diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index 796ae83..d38131c 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -97,7 +97,7 @@ void MyGame::MonoBehaviours::AnotherScript::Update() { Transform transform = GetTransform(); Vector3 pos = transform.GetPosition(); - const float speed = 1.2f; + const float speed = 0.0012f; const float min = -1.5f; const float max = 1.5f; Vector3 offset(Time::GetDeltaTime() * speed * gameState->Dir, 0, 0); @@ -106,11 +106,19 @@ void MyGame::MonoBehaviours::AnotherScript::Update() { gameState->Dir *= -1.0f; newPos.x = max - (newPos.x - max); + if (newPos.x < min) + { + newPos.x = min; + } } else if (newPos.x < min) { gameState->Dir *= -1.0f; newPos.x = min + (min - newPos.x); + if (newPos.x > max) + { + newPos.x = max; + } } transform.SetPosition(newPos); } From f3f0139e45be39cc4d8a2aac01c92f8d354a472a Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 11 Mar 2018 22:25:56 -0700 Subject: [PATCH 57/95] Support generic "factory functions" with derived types Remove obsolete MonoBehaviour functionality Simplify example JSON config and C++ game code --- README.md | 7 +- Unity/Assets/Game.meta | 10 + Unity/Assets/Game/AbstractBaseBallScript.cs | 19 + .../Game/AbstractBaseBallScript.cs.meta | 13 + Unity/Assets/NativeScript/Bindings.cs | 7988 +----- Unity/Assets/NativeScript/BootScript.cs | 2 + .../NativeScript/Editor/GenerateBindings.cs | 2072 +- Unity/Assets/NativeScriptTypes.json | 1036 +- Unity/CppSource/Game/Game.cpp | 129 +- Unity/CppSource/Game/Game.h | 22 + Unity/CppSource/NativeScript/Bindings.cpp | 21859 ++-------------- Unity/CppSource/NativeScript/Bindings.h | 5578 +--- .../ProjectSettings/EditorBuildSettings.asset | 4 +- 13 files changed, 3681 insertions(+), 35058 deletions(-) create mode 100644 Unity/Assets/Game.meta create mode 100644 Unity/Assets/Game/AbstractBaseBallScript.cs create mode 100644 Unity/Assets/Game/AbstractBaseBallScript.cs.meta create mode 100644 Unity/CppSource/Game/Game.h diff --git a/README.md b/README.md index 3ed4061..dd0bb7b 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,6 @@ C++ is the standard language for video games as well as many other fields. By pr * Methods * Fields * Properties (getters and setters) - * `MonoBehaviour` classes with "message" functions like `Update` * `out` and `ref` parameters * Exceptions * Overloaded operators @@ -105,6 +104,7 @@ C++ is the standard language for video games as well as many other fields. By pr * Implementing C# interfaces with C++ classes * Deriving from C# classes with C++ classes * Default parameters + * Generic types and methods # Performance @@ -140,7 +140,7 @@ With C++, the workflow looks like this: 2. Copy everything in `Unity/Assets` directory to your Unity project's `Assets` directory 3. Copy the `Unity/CppSource` directory to your Unity project directory 4. Edit `NativeScriptTypes.json` and specify what parts of the Unity, .NET, and custom DLL APIs you want access to from C++. -5. Edit `Unity/CppSource/Game/Game.cpp` to create your game. Some example code is provided, but feel free to delete it. You can add more C++ source (`.cpp`) and header (`.h`) files here as your game grows. +5. Edit `Unity/CppSource/Game/Game.cpp` and `Unity/CppSource/Game/Game.h` to create your game. Some example code is provided, but feel free to delete it. You can add more C++ source (`.cpp`) and header (`.h`) files here as your game grows. # Building the C++ Plugin @@ -170,7 +170,7 @@ With C++, the workflow looks like this: 2. Create a directory for build files. Anywhere is fine. 3. Open a Command Prompt by clicking the Start button, typing "Command Prompt", then clicking the app 4. Execute `cd /path/to/your/build/directory` -5. Execute `cmake -G "Visual Studio VERSION YEAR Win64" -DEDITOR=TRUE /path/to/your/project/CppSource`. Replace `VERSION` and `YEAR` with the version of Visual Studio you want to use. To see the options, execute `cmake --help` and look at the list at the bottom. For example, use `"`Visual Studio 15 2017 Win64` for Visual Studio 2017. Any version, including Community, works just fine. Remove `-DEDITOR=TRUE` for standalone builds. +5. Execute `cmake -G "Visual Studio VERSION YEAR Win64" -DEDITOR=TRUE /path/to/your/project/CppSource`. Replace `VERSION` and `YEAR` with the version of Visual Studio you want to use. To see the options, execute `cmake --help` and look at the list at the bottom. For example, use `"Visual Studio 15 2017 Win64"` for Visual Studio 2017. Any version, including Community, works just fine. Remove `-DEDITOR=TRUE` for standalone builds. 6. The project files are now generated in your build directory 7. Open `NativeScript.sln` and click `Build > Build Solution`. @@ -202,7 +202,6 @@ To configure the code generator, open `NativeScriptTypes.json` and notice the ex Note that the code generator does not support (yet): -* `MonoBehaviour` contents (e.g. fields) except for "message" functions * `Array`, `string`, and `object` methods (e.g. `GetHashCode`) * Non-null string default parameters and null non-string default parameters * Implicit `params` parameter (a.k.a. "var args") passing diff --git a/Unity/Assets/Game.meta b/Unity/Assets/Game.meta new file mode 100644 index 0000000..42f3c6b --- /dev/null +++ b/Unity/Assets/Game.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: bb19f2d6c4c0e41c18cdd5ead2b97cec +folderAsset: yes +timeCreated: 1519492407 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Assets/Game/AbstractBaseBallScript.cs b/Unity/Assets/Game/AbstractBaseBallScript.cs new file mode 100644 index 0000000..8694d19 --- /dev/null +++ b/Unity/Assets/Game/AbstractBaseBallScript.cs @@ -0,0 +1,19 @@ +using UnityEngine; + +namespace MyGame +{ + /// + /// Base class of a script used in the example code to make a "ball" bounce + /// back and forth on the screen + /// + /// + /// Jackson Dunstan, 2018, http://JacksonDunstan.com + /// + /// + /// MIT + /// + public abstract class AbstractBaseBallScript : MonoBehaviour + { + public abstract void Update(); + } +} diff --git a/Unity/Assets/Game/AbstractBaseBallScript.cs.meta b/Unity/Assets/Game/AbstractBaseBallScript.cs.meta new file mode 100644 index 0000000..0757588 --- /dev/null +++ b/Unity/Assets/Game/AbstractBaseBallScript.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 7c6c722578a90428dbeacfd4a5aaa3ae +timeCreated: 1520705999 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 0f221a1..0b877fd 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -6,7 +6,6 @@ using System.Runtime.InteropServices; using UnityEngine; -using UnityEngine.Assertions; namespace NativeScript { @@ -281,6 +280,25 @@ public ReusableWaitForSecondsRealtime(float time) WaitTime = time; } } + + public enum DestroyFunction + { + /*BEGIN DESTROY FUNCTION ENUMERATORS*/ + BaseBallScript + /*END DESTROY FUNCTION ENUMERATORS*/ + } + + struct DestroyEntry + { + public DestroyFunction Function; + public int CppHandle; + + public DestroyEntry(DestroyFunction function, int cppHandle) + { + Function = function; + CppHandle = cppHandle; + } + } // Name of the plugin when using [DllImport] const string PLUGIN_NAME = "NativeScript"; @@ -316,171 +334,27 @@ delegate void InitDelegate( IntPtr enumerableGetEnumerator, /*BEGIN INIT PARAMS*/ int maxManagedObjects, - IntPtr systemIComparableMethodCompareToSystemObject, - IntPtr systemIDisposableMethodDispose, IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, - IntPtr unityEngineVector3PropertyGetMagnitude, - IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, - IntPtr unityEngineVector3Methodop_UnaryNegationUnityEngineVector3, IntPtr boxVector3, IntPtr unboxVector3, IntPtr unityEngineObjectPropertyGetName, IntPtr unityEngineObjectPropertySetName, - IntPtr unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject, - IntPtr unityEngineObjectMethodop_ImplicitUnityEngineObject, IntPtr unityEngineComponentPropertyGetTransform, IntPtr unityEngineTransformPropertyGetPosition, IntPtr unityEngineTransformPropertySetPosition, - IntPtr unityEngineTransformMethodSetParentUnityEngineTransform, - IntPtr boxColor, - IntPtr unboxColor, - IntPtr boxGradientColorKey, - IntPtr unboxGradientColorKey, - IntPtr releaseUnityEngineResolution, - IntPtr unityEngineResolutionConstructor, - IntPtr unityEngineResolutionPropertyGetWidth, - IntPtr unityEngineResolutionPropertySetWidth, - IntPtr unityEngineResolutionPropertyGetHeight, - IntPtr unityEngineResolutionPropertySetHeight, - IntPtr unityEngineResolutionPropertyGetRefreshRate, - IntPtr unityEngineResolutionPropertySetRefreshRate, - IntPtr boxResolution, - IntPtr unboxResolution, - IntPtr releaseUnityEngineRaycastHit, - IntPtr unityEngineRaycastHitPropertyGetPoint, - IntPtr unityEngineRaycastHitPropertySetPoint, - IntPtr unityEngineRaycastHitPropertyGetTransform, - IntPtr boxRaycastHit, - IntPtr unboxRaycastHit, IntPtr systemCollectionsIEnumeratorPropertyGetCurrent, IntPtr systemCollectionsIEnumeratorMethodMoveNext, - IntPtr releaseUnityEnginePlayablesPlayableGraph, - IntPtr boxPlayableGraph, - IntPtr unboxPlayableGraph, - IntPtr releaseUnityEngineAnimationsAnimationMixerPlayable, - IntPtr unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean, - IntPtr boxAnimationMixerPlayable, - IntPtr unboxAnimationMixerPlayable, - IntPtr systemDiagnosticsStopwatchConstructor, - IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds, - IntPtr systemDiagnosticsStopwatchMethodStart, - IntPtr systemDiagnosticsStopwatchMethodReset, - IntPtr unityEngineGameObjectConstructor, - IntPtr unityEngineGameObjectConstructorSystemString, - IntPtr unityEngineGameObjectPropertyGetTransform, - IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript, - IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript, + IntPtr unityEngineGameObjectMethodAddComponentMyGameBaseBallScript, IntPtr unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType, IntPtr unityEngineDebugMethodLogSystemObject, - IntPtr unityEngineAssertionsAssertFieldGetRaiseExceptions, - IntPtr unityEngineAssertionsAssertFieldSetRaiseExceptions, - IntPtr unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString, - IntPtr unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject, IntPtr unityEngineMonoBehaviourPropertyGetTransform, - IntPtr unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32, - IntPtr unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte, - IntPtr unityEngineNetworkingNetworkTransportMethodInit, - IntPtr boxQuaternion, - IntPtr unboxQuaternion, - IntPtr unityEngineMatrix4x4PropertyGetItem, - IntPtr unityEngineMatrix4x4PropertySetItem, - IntPtr boxMatrix4x4, - IntPtr unboxMatrix4x4, - IntPtr boxQueryTriggerInteraction, - IntPtr unboxQueryTriggerInteraction, - IntPtr releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, - IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble, - IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey, - IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue, - IntPtr boxKeyValuePairSystemString_SystemDouble, - IntPtr unboxKeyValuePairSystemString_SystemDouble, - IntPtr systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString, - IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue, - IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue, - IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString, - IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue, - IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue, IntPtr systemExceptionConstructorSystemString, - IntPtr unityEngineScreenPropertyGetResolutions, - IntPtr releaseUnityEngineRay, - IntPtr unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3, - IntPtr boxRay, - IntPtr unboxRay, - IntPtr unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1, - IntPtr unityEnginePhysicsMethodRaycastAllUnityEngineRay, - IntPtr unityEngineGradientConstructor, - IntPtr unityEngineGradientPropertyGetColorKeys, - IntPtr unityEngineGradientPropertySetColorKeys, - IntPtr systemAppDomainSetupConstructor, - IntPtr systemAppDomainSetupPropertyGetAppDomainInitializer, - IntPtr systemAppDomainSetupPropertySetAppDomainInitializer, - IntPtr unityEngineApplicationAddEventOnBeforeRender, - IntPtr unityEngineApplicationRemoveEventOnBeforeRender, - IntPtr unityEngineSceneManagementSceneManagerAddEventSceneLoaded, - IntPtr unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded, - IntPtr releaseUnityEngineSceneManagementScene, - IntPtr boxScene, - IntPtr unboxScene, - IntPtr boxLoadSceneMode, - IntPtr unboxLoadSceneMode, IntPtr boxPrimitiveType, IntPtr unboxPrimitiveType, IntPtr unityEngineTimePropertyGetDeltaTime, - IntPtr boxFileMode, - IntPtr unboxFileMode, - IntPtr releaseSystemCollectionsGenericBaseIComparerSystemInt32, - IntPtr systemCollectionsGenericBaseIComparerSystemInt32Constructor, - IntPtr releaseSystemCollectionsGenericBaseIComparerSystemString, - IntPtr systemCollectionsGenericBaseIComparerSystemStringConstructor, - IntPtr releaseSystemBaseStringComparer, - IntPtr systemBaseStringComparerConstructor, - IntPtr systemCollectionsQueuePropertyGetCount, - IntPtr releaseSystemCollectionsBaseQueue, - IntPtr systemCollectionsBaseQueueConstructor, - IntPtr releaseSystemComponentModelDesignBaseIComponentChangeService, - IntPtr systemComponentModelDesignBaseIComponentChangeServiceConstructor, - IntPtr systemIOFileStreamConstructorSystemString_SystemIOFileMode, - IntPtr systemIOFileStreamMethodWriteByteSystemByte, - IntPtr releaseSystemIOBaseFileStream, - IntPtr systemIOBaseFileStreamConstructorSystemString_SystemIOFileMode, - IntPtr releaseUnityEnginePlayablesPlayableHandle, - IntPtr boxPlayableHandle, - IntPtr unboxPlayableHandle, - IntPtr systemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator, - IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1, - IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString, - IntPtr boxInteractionSourcePositionAccuracy, - IntPtr unboxInteractionSourcePositionAccuracy, - IntPtr boxInteractionSourceNode, - IntPtr unboxInteractionSourceNode, - IntPtr releaseUnityEngineXRWSAInputInteractionSourcePose, - IntPtr unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode, - IntPtr boxInteractionSourcePose, - IntPtr unboxInteractionSourcePose, - IntPtr systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator, - IntPtr systemCollectionsGenericListSystemStringConstructor, - IntPtr systemCollectionsGenericListSystemStringPropertyGetItem, - IntPtr systemCollectionsGenericListSystemStringPropertySetItem, - IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString, - IntPtr systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer, - IntPtr systemCollectionsGenericListSystemInt32Constructor, - IntPtr systemCollectionsGenericListSystemInt32PropertyGetItem, - IntPtr systemCollectionsGenericListSystemInt32PropertySetItem, - IntPtr systemCollectionsGenericListSystemInt32MethodAddSystemInt32, - IntPtr systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer, + IntPtr releaseBaseBallScript, + IntPtr baseBallScriptConstructor, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -504,224 +378,24 @@ delegate void InitDelegate( IntPtr boxSingle, IntPtr unboxSingle, IntPtr boxDouble, - IntPtr unboxDouble, - IntPtr systemSystemInt32Array1Constructor1, - IntPtr systemInt32Array1GetItem1, - IntPtr systemInt32Array1SetItem1, - IntPtr systemSystemSingleArray1Constructor1, - IntPtr systemSingleArray1GetItem1, - IntPtr systemSingleArray1SetItem1, - IntPtr systemSystemSingleArray2Constructor2, - IntPtr systemSystemSingleArray2GetLength2, - IntPtr systemSingleArray2GetItem2, - IntPtr systemSingleArray2SetItem2, - IntPtr systemSystemSingleArray3Constructor3, - IntPtr systemSystemSingleArray3GetLength3, - IntPtr systemSingleArray3GetItem3, - IntPtr systemSingleArray3SetItem3, - IntPtr systemSystemStringArray1Constructor1, - IntPtr systemStringArray1GetItem1, - IntPtr systemStringArray1SetItem1, - IntPtr unityEngineUnityEngineResolutionArray1Constructor1, - IntPtr unityEngineResolutionArray1GetItem1, - IntPtr unityEngineResolutionArray1SetItem1, - IntPtr unityEngineUnityEngineRaycastHitArray1Constructor1, - IntPtr unityEngineRaycastHitArray1GetItem1, - IntPtr unityEngineRaycastHitArray1SetItem1, - IntPtr unityEngineUnityEngineGradientColorKeyArray1Constructor1, - IntPtr unityEngineGradientColorKeyArray1GetItem1, - IntPtr unityEngineGradientColorKeyArray1SetItem1, - IntPtr releaseSystemAction, - IntPtr systemActionConstructor, - IntPtr systemActionAdd, - IntPtr systemActionRemove, - IntPtr systemActionInvoke, - IntPtr releaseSystemActionSystemSingle, - IntPtr systemActionSystemSingleConstructor, - IntPtr systemActionSystemSingleAdd, - IntPtr systemActionSystemSingleRemove, - IntPtr systemActionSystemSingleInvoke, - IntPtr releaseSystemActionSystemSingle_SystemSingle, - IntPtr systemActionSystemSingle_SystemSingleConstructor, - IntPtr systemActionSystemSingle_SystemSingleAdd, - IntPtr systemActionSystemSingle_SystemSingleRemove, - IntPtr systemActionSystemSingle_SystemSingleInvoke, - IntPtr releaseSystemFuncSystemInt32_SystemSingle_SystemDouble, - IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor, - IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleAdd, - IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleRemove, - IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke, - IntPtr releaseSystemFuncSystemInt16_SystemInt32_SystemString, - IntPtr systemFuncSystemInt16_SystemInt32_SystemStringConstructor, - IntPtr systemFuncSystemInt16_SystemInt32_SystemStringAdd, - IntPtr systemFuncSystemInt16_SystemInt32_SystemStringRemove, - IntPtr systemFuncSystemInt16_SystemInt32_SystemStringInvoke, - IntPtr releaseSystemAppDomainInitializer, - IntPtr systemAppDomainInitializerConstructor, - IntPtr systemAppDomainInitializerAdd, - IntPtr systemAppDomainInitializerRemove, - IntPtr systemAppDomainInitializerInvoke, - IntPtr releaseUnityEngineEventsUnityAction, - IntPtr unityEngineEventsUnityActionConstructor, - IntPtr unityEngineEventsUnityActionAdd, - IntPtr unityEngineEventsUnityActionRemove, - IntPtr unityEngineEventsUnityActionInvoke, - IntPtr releaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode, - IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor, - IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd, - IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove, - IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke, - IntPtr releaseSystemComponentModelDesignComponentEventHandler, - IntPtr systemComponentModelDesignComponentEventHandlerConstructor, - IntPtr systemComponentModelDesignComponentEventHandlerAdd, - IntPtr systemComponentModelDesignComponentEventHandlerRemove, - IntPtr systemComponentModelDesignComponentEventHandlerInvoke, - IntPtr releaseSystemComponentModelDesignComponentChangingEventHandler, - IntPtr systemComponentModelDesignComponentChangingEventHandlerConstructor, - IntPtr systemComponentModelDesignComponentChangingEventHandlerAdd, - IntPtr systemComponentModelDesignComponentChangingEventHandlerRemove, - IntPtr systemComponentModelDesignComponentChangingEventHandlerInvoke, - IntPtr releaseSystemComponentModelDesignComponentChangedEventHandler, - IntPtr systemComponentModelDesignComponentChangedEventHandlerConstructor, - IntPtr systemComponentModelDesignComponentChangedEventHandlerAdd, - IntPtr systemComponentModelDesignComponentChangedEventHandlerRemove, - IntPtr systemComponentModelDesignComponentChangedEventHandlerInvoke, - IntPtr releaseSystemComponentModelDesignComponentRenameEventHandler, - IntPtr systemComponentModelDesignComponentRenameEventHandlerConstructor, - IntPtr systemComponentModelDesignComponentRenameEventHandlerAdd, - IntPtr systemComponentModelDesignComponentRenameEventHandlerRemove, - IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke + IntPtr unboxDouble /*END INIT PARAMS*/); public delegate void SetCsharpExceptionDelegate(int handle); - /*BEGIN MONOBEHAVIOUR DELEGATES*/ - public delegate int SystemCollectionsGenericIComparerSystemInt32CompareDelegate(int thisHandle, int param0, int param1); - public static SystemCollectionsGenericIComparerSystemInt32CompareDelegate SystemCollectionsGenericIComparerSystemInt32Compare; - - public delegate int SystemCollectionsGenericIComparerSystemStringCompareDelegate(int thisHandle, int param0, int param1); - public static SystemCollectionsGenericIComparerSystemStringCompareDelegate SystemCollectionsGenericIComparerSystemStringCompare; - - public delegate int SystemStringComparerCompareDelegate(int thisHandle, int param0, int param1); - public static SystemStringComparerCompareDelegate SystemStringComparerCompare; - - public delegate bool SystemStringComparerEqualsDelegate(int thisHandle, int param0, int param1); - public static SystemStringComparerEqualsDelegate SystemStringComparerEquals; - - public delegate int SystemStringComparerGetHashCodeDelegate(int thisHandle, int param0); - public static SystemStringComparerGetHashCodeDelegate SystemStringComparerGetHashCode; - - public delegate int SystemCollectionsQueueGetCountDelegate(int thisHandle); - public static SystemCollectionsQueueGetCountDelegate SystemCollectionsQueueGetCount; - - public delegate void SystemComponentModelDesignIComponentChangeServiceOnComponentChangedDelegate(int thisHandle, int param0, int param1, int param2, int param3); - public static SystemComponentModelDesignIComponentChangeServiceOnComponentChangedDelegate SystemComponentModelDesignIComponentChangeServiceOnComponentChanged; - - public delegate void SystemComponentModelDesignIComponentChangeServiceOnComponentChangingDelegate(int thisHandle, int param0, int param1); - public static SystemComponentModelDesignIComponentChangeServiceOnComponentChangingDelegate SystemComponentModelDesignIComponentChangeServiceOnComponentChanging; - - public delegate void SystemComponentModelDesignIComponentChangeServiceAddComponentAddedDelegate(int thisHandle, int param0); - public static SystemComponentModelDesignIComponentChangeServiceAddComponentAddedDelegate SystemComponentModelDesignIComponentChangeServiceAddComponentAdded; - - public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAddedDelegate(int thisHandle, int param0); - public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentAddedDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded; - - public delegate void SystemComponentModelDesignIComponentChangeServiceAddComponentAddingDelegate(int thisHandle, int param0); - public static SystemComponentModelDesignIComponentChangeServiceAddComponentAddingDelegate SystemComponentModelDesignIComponentChangeServiceAddComponentAdding; - - public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAddingDelegate(int thisHandle, int param0); - public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentAddingDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding; - - public delegate void SystemComponentModelDesignIComponentChangeServiceAddComponentChangedDelegate(int thisHandle, int param0); - public static SystemComponentModelDesignIComponentChangeServiceAddComponentChangedDelegate SystemComponentModelDesignIComponentChangeServiceAddComponentChanged; - - public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChangedDelegate(int thisHandle, int param0); - public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentChangedDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanged; - - public delegate void SystemComponentModelDesignIComponentChangeServiceAddComponentChangingDelegate(int thisHandle, int param0); - public static SystemComponentModelDesignIComponentChangeServiceAddComponentChangingDelegate SystemComponentModelDesignIComponentChangeServiceAddComponentChanging; - - public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChangingDelegate(int thisHandle, int param0); - public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentChangingDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanging; - - public delegate void SystemComponentModelDesignIComponentChangeServiceAddComponentRemovedDelegate(int thisHandle, int param0); - public static SystemComponentModelDesignIComponentChangeServiceAddComponentRemovedDelegate SystemComponentModelDesignIComponentChangeServiceAddComponentRemoved; - - public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemovedDelegate(int thisHandle, int param0); - public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemovedDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoved; - - public delegate void SystemComponentModelDesignIComponentChangeServiceAddComponentRemovingDelegate(int thisHandle, int param0); - public static SystemComponentModelDesignIComponentChangeServiceAddComponentRemovingDelegate SystemComponentModelDesignIComponentChangeServiceAddComponentRemoving; - - public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemovingDelegate(int thisHandle, int param0); - public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemovingDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving; - - public delegate void SystemComponentModelDesignIComponentChangeServiceAddComponentRenameDelegate(int thisHandle, int param0); - public static SystemComponentModelDesignIComponentChangeServiceAddComponentRenameDelegate SystemComponentModelDesignIComponentChangeServiceAddComponentRename; - - public delegate void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRenameDelegate(int thisHandle, int param0); - public static SystemComponentModelDesignIComponentChangeServiceRemoveComponentRenameDelegate SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename; + /*BEGIN DELEGATES*/ + public delegate int NewBaseBallScriptDelegate(int param0); + public static NewBaseBallScriptDelegate NewBaseBallScript; - public delegate void SystemIOFileStreamWriteByteDelegate(int thisHandle, byte param0); - public static SystemIOFileStreamWriteByteDelegate SystemIOFileStreamWriteByte; + public delegate void DestroyBaseBallScriptDelegate(int param0); + public static DestroyBaseBallScriptDelegate DestroyBaseBallScript; - 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 MyGameMonoBehavioursAnotherScriptAwakeDelegate(int thisHandle); - public static MyGameMonoBehavioursAnotherScriptAwakeDelegate MyGameMonoBehavioursAnotherScriptAwake; - - public delegate void MyGameMonoBehavioursAnotherScriptUpdateDelegate(int thisHandle); - public static MyGameMonoBehavioursAnotherScriptUpdateDelegate MyGameMonoBehavioursAnotherScriptUpdate; - - public delegate void SystemActionNativeInvokeDelegate(int thisHandle); - public static SystemActionNativeInvokeDelegate SystemActionNativeInvoke; - - public delegate void SystemActionSystemSingleNativeInvokeDelegate(int thisHandle, float param0); - public static SystemActionSystemSingleNativeInvokeDelegate SystemActionSystemSingleNativeInvoke; - - public delegate void SystemActionSystemSingle_SystemSingleNativeInvokeDelegate(int thisHandle, float param0, float param1); - public static SystemActionSystemSingle_SystemSingleNativeInvokeDelegate SystemActionSystemSingle_SystemSingleNativeInvoke; - - public delegate double SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvokeDelegate(int thisHandle, int param0, float param1); - public static SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvokeDelegate SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke; - - public delegate int SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvokeDelegate(int thisHandle, short param0, int param1); - public static SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvokeDelegate SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke; - - public delegate void SystemAppDomainInitializerNativeInvokeDelegate(int thisHandle, int param0); - public static SystemAppDomainInitializerNativeInvokeDelegate SystemAppDomainInitializerNativeInvoke; - - public delegate void UnityEngineEventsUnityActionNativeInvokeDelegate(int thisHandle); - public static UnityEngineEventsUnityActionNativeInvokeDelegate UnityEngineEventsUnityActionNativeInvoke; - - public delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvokeDelegate(int thisHandle, int param0, UnityEngine.SceneManagement.LoadSceneMode param1); - public static UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvokeDelegate UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke; - - public delegate void SystemComponentModelDesignComponentEventHandlerNativeInvokeDelegate(int thisHandle, int param0, int param1); - public static SystemComponentModelDesignComponentEventHandlerNativeInvokeDelegate SystemComponentModelDesignComponentEventHandlerNativeInvoke; - - public delegate void SystemComponentModelDesignComponentChangingEventHandlerNativeInvokeDelegate(int thisHandle, int param0, int param1); - public static SystemComponentModelDesignComponentChangingEventHandlerNativeInvokeDelegate SystemComponentModelDesignComponentChangingEventHandlerNativeInvoke; - - public delegate void SystemComponentModelDesignComponentChangedEventHandlerNativeInvokeDelegate(int thisHandle, int param0, int param1); - public static SystemComponentModelDesignComponentChangedEventHandlerNativeInvokeDelegate SystemComponentModelDesignComponentChangedEventHandlerNativeInvoke; - - public delegate void SystemComponentModelDesignComponentRenameEventHandlerNativeInvokeDelegate(int thisHandle, int param0, int param1); - public static SystemComponentModelDesignComponentRenameEventHandlerNativeInvokeDelegate SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke; + public delegate void MyGameAbstractBaseBallScriptUpdateDelegate(int thisHandle); + public static MyGameAbstractBaseBallScriptUpdateDelegate MyGameAbstractBaseBallScriptUpdate; public delegate void SetCsharpExceptionSystemNullReferenceExceptionDelegate(int param0); public static SetCsharpExceptionSystemNullReferenceExceptionDelegate SetCsharpExceptionSystemNullReferenceException; - /*END MONOBEHAVIOUR DELEGATES*/ + /*END DELEGATES*/ #endif #if UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX @@ -824,171 +498,27 @@ static extern void Init( IntPtr enumerableGetEnumerator, /*BEGIN INIT PARAMS*/ int maxManagedObjects, - IntPtr systemIComparableMethodCompareToSystemObject, - IntPtr systemIDisposableMethodDispose, IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, - IntPtr unityEngineVector3PropertyGetMagnitude, - IntPtr unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, - IntPtr unityEngineVector3Methodop_UnaryNegationUnityEngineVector3, IntPtr boxVector3, IntPtr unboxVector3, IntPtr unityEngineObjectPropertyGetName, IntPtr unityEngineObjectPropertySetName, - IntPtr unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject, - IntPtr unityEngineObjectMethodop_ImplicitUnityEngineObject, IntPtr unityEngineComponentPropertyGetTransform, IntPtr unityEngineTransformPropertyGetPosition, IntPtr unityEngineTransformPropertySetPosition, - IntPtr unityEngineTransformMethodSetParentUnityEngineTransform, - IntPtr boxColor, - IntPtr unboxColor, - IntPtr boxGradientColorKey, - IntPtr unboxGradientColorKey, - IntPtr releaseUnityEngineResolution, - IntPtr unityEngineResolutionConstructor, - IntPtr unityEngineResolutionPropertyGetWidth, - IntPtr unityEngineResolutionPropertySetWidth, - IntPtr unityEngineResolutionPropertyGetHeight, - IntPtr unityEngineResolutionPropertySetHeight, - IntPtr unityEngineResolutionPropertyGetRefreshRate, - IntPtr unityEngineResolutionPropertySetRefreshRate, - IntPtr boxResolution, - IntPtr unboxResolution, - IntPtr releaseUnityEngineRaycastHit, - IntPtr unityEngineRaycastHitPropertyGetPoint, - IntPtr unityEngineRaycastHitPropertySetPoint, - IntPtr unityEngineRaycastHitPropertyGetTransform, - IntPtr boxRaycastHit, - IntPtr unboxRaycastHit, IntPtr systemCollectionsIEnumeratorPropertyGetCurrent, IntPtr systemCollectionsIEnumeratorMethodMoveNext, - IntPtr releaseUnityEnginePlayablesPlayableGraph, - IntPtr boxPlayableGraph, - IntPtr unboxPlayableGraph, - IntPtr releaseUnityEngineAnimationsAnimationMixerPlayable, - IntPtr unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean, - IntPtr boxAnimationMixerPlayable, - IntPtr unboxAnimationMixerPlayable, - IntPtr systemDiagnosticsStopwatchConstructor, - IntPtr systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds, - IntPtr systemDiagnosticsStopwatchMethodStart, - IntPtr systemDiagnosticsStopwatchMethodReset, - IntPtr unityEngineGameObjectConstructor, - IntPtr unityEngineGameObjectConstructorSystemString, - IntPtr unityEngineGameObjectPropertyGetTransform, - IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript, - IntPtr unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript, + IntPtr unityEngineGameObjectMethodAddComponentMyGameBaseBallScript, IntPtr unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType, IntPtr unityEngineDebugMethodLogSystemObject, - IntPtr unityEngineAssertionsAssertFieldGetRaiseExceptions, - IntPtr unityEngineAssertionsAssertFieldSetRaiseExceptions, - IntPtr unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString, - IntPtr unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject, IntPtr unityEngineMonoBehaviourPropertyGetTransform, - IntPtr unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32, - IntPtr unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte, - IntPtr unityEngineNetworkingNetworkTransportMethodInit, - IntPtr boxQuaternion, - IntPtr unboxQuaternion, - IntPtr unityEngineMatrix4x4PropertyGetItem, - IntPtr unityEngineMatrix4x4PropertySetItem, - IntPtr boxMatrix4x4, - IntPtr unboxMatrix4x4, - IntPtr boxQueryTriggerInteraction, - IntPtr unboxQueryTriggerInteraction, - IntPtr releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble, - IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble, - IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey, - IntPtr systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue, - IntPtr boxKeyValuePairSystemString_SystemDouble, - IntPtr unboxKeyValuePairSystemString_SystemDouble, - IntPtr systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString, - IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue, - IntPtr systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue, - IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString, - IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue, - IntPtr systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue, IntPtr systemExceptionConstructorSystemString, - IntPtr unityEngineScreenPropertyGetResolutions, - IntPtr releaseUnityEngineRay, - IntPtr unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3, - IntPtr boxRay, - IntPtr unboxRay, - IntPtr unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1, - IntPtr unityEnginePhysicsMethodRaycastAllUnityEngineRay, - IntPtr unityEngineGradientConstructor, - IntPtr unityEngineGradientPropertyGetColorKeys, - IntPtr unityEngineGradientPropertySetColorKeys, - IntPtr systemAppDomainSetupConstructor, - IntPtr systemAppDomainSetupPropertyGetAppDomainInitializer, - IntPtr systemAppDomainSetupPropertySetAppDomainInitializer, - IntPtr unityEngineApplicationAddEventOnBeforeRender, - IntPtr unityEngineApplicationRemoveEventOnBeforeRender, - IntPtr unityEngineSceneManagementSceneManagerAddEventSceneLoaded, - IntPtr unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded, - IntPtr releaseUnityEngineSceneManagementScene, - IntPtr boxScene, - IntPtr unboxScene, - IntPtr boxLoadSceneMode, - IntPtr unboxLoadSceneMode, IntPtr boxPrimitiveType, IntPtr unboxPrimitiveType, IntPtr unityEngineTimePropertyGetDeltaTime, - IntPtr boxFileMode, - IntPtr unboxFileMode, - IntPtr releaseSystemCollectionsGenericBaseIComparerSystemInt32, - IntPtr systemCollectionsGenericBaseIComparerSystemInt32Constructor, - IntPtr releaseSystemCollectionsGenericBaseIComparerSystemString, - IntPtr systemCollectionsGenericBaseIComparerSystemStringConstructor, - IntPtr releaseSystemBaseStringComparer, - IntPtr systemBaseStringComparerConstructor, - IntPtr systemCollectionsQueuePropertyGetCount, - IntPtr releaseSystemCollectionsBaseQueue, - IntPtr systemCollectionsBaseQueueConstructor, - IntPtr releaseSystemComponentModelDesignBaseIComponentChangeService, - IntPtr systemComponentModelDesignBaseIComponentChangeServiceConstructor, - IntPtr systemIOFileStreamConstructorSystemString_SystemIOFileMode, - IntPtr systemIOFileStreamMethodWriteByteSystemByte, - IntPtr releaseSystemIOBaseFileStream, - IntPtr systemIOBaseFileStreamConstructorSystemString_SystemIOFileMode, - IntPtr releaseUnityEnginePlayablesPlayableHandle, - IntPtr boxPlayableHandle, - IntPtr unboxPlayableHandle, - IntPtr systemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator, - IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1, - IntPtr unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString, - IntPtr boxInteractionSourcePositionAccuracy, - IntPtr unboxInteractionSourcePositionAccuracy, - IntPtr boxInteractionSourceNode, - IntPtr unboxInteractionSourceNode, - IntPtr releaseUnityEngineXRWSAInputInteractionSourcePose, - IntPtr unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode, - IntPtr boxInteractionSourcePose, - IntPtr unboxInteractionSourcePose, - IntPtr systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent, - IntPtr systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator, - IntPtr systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator, - IntPtr systemCollectionsGenericListSystemStringConstructor, - IntPtr systemCollectionsGenericListSystemStringPropertyGetItem, - IntPtr systemCollectionsGenericListSystemStringPropertySetItem, - IntPtr systemCollectionsGenericListSystemStringMethodAddSystemString, - IntPtr systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer, - IntPtr systemCollectionsGenericListSystemInt32Constructor, - IntPtr systemCollectionsGenericListSystemInt32PropertyGetItem, - IntPtr systemCollectionsGenericListSystemInt32PropertySetItem, - IntPtr systemCollectionsGenericListSystemInt32MethodAddSystemInt32, - IntPtr systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer, + IntPtr releaseBaseBallScript, + IntPtr baseBallScriptConstructor, IntPtr boxBoolean, IntPtr unboxBoolean, IntPtr boxSByte, @@ -1012,225 +542,25 @@ static extern void Init( IntPtr boxSingle, IntPtr unboxSingle, IntPtr boxDouble, - IntPtr unboxDouble, - IntPtr systemSystemInt32Array1Constructor1, - IntPtr systemInt32Array1GetItem1, - IntPtr systemInt32Array1SetItem1, - IntPtr systemSystemSingleArray1Constructor1, - IntPtr systemSingleArray1GetItem1, - IntPtr systemSingleArray1SetItem1, - IntPtr systemSystemSingleArray2Constructor2, - IntPtr systemSystemSingleArray2GetLength2, - IntPtr systemSingleArray2GetItem2, - IntPtr systemSingleArray2SetItem2, - IntPtr systemSystemSingleArray3Constructor3, - IntPtr systemSystemSingleArray3GetLength3, - IntPtr systemSingleArray3GetItem3, - IntPtr systemSingleArray3SetItem3, - IntPtr systemSystemStringArray1Constructor1, - IntPtr systemStringArray1GetItem1, - IntPtr systemStringArray1SetItem1, - IntPtr unityEngineUnityEngineResolutionArray1Constructor1, - IntPtr unityEngineResolutionArray1GetItem1, - IntPtr unityEngineResolutionArray1SetItem1, - IntPtr unityEngineUnityEngineRaycastHitArray1Constructor1, - IntPtr unityEngineRaycastHitArray1GetItem1, - IntPtr unityEngineRaycastHitArray1SetItem1, - IntPtr unityEngineUnityEngineGradientColorKeyArray1Constructor1, - IntPtr unityEngineGradientColorKeyArray1GetItem1, - IntPtr unityEngineGradientColorKeyArray1SetItem1, - IntPtr releaseSystemAction, - IntPtr systemActionConstructor, - IntPtr systemActionAdd, - IntPtr systemActionRemove, - IntPtr systemActionInvoke, - IntPtr releaseSystemActionSystemSingle, - IntPtr systemActionSystemSingleConstructor, - IntPtr systemActionSystemSingleAdd, - IntPtr systemActionSystemSingleRemove, - IntPtr systemActionSystemSingleInvoke, - IntPtr releaseSystemActionSystemSingle_SystemSingle, - IntPtr systemActionSystemSingle_SystemSingleConstructor, - IntPtr systemActionSystemSingle_SystemSingleAdd, - IntPtr systemActionSystemSingle_SystemSingleRemove, - IntPtr systemActionSystemSingle_SystemSingleInvoke, - IntPtr releaseSystemFuncSystemInt32_SystemSingle_SystemDouble, - IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor, - IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleAdd, - IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleRemove, - IntPtr systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke, - IntPtr releaseSystemFuncSystemInt16_SystemInt32_SystemString, - IntPtr systemFuncSystemInt16_SystemInt32_SystemStringConstructor, - IntPtr systemFuncSystemInt16_SystemInt32_SystemStringAdd, - IntPtr systemFuncSystemInt16_SystemInt32_SystemStringRemove, - IntPtr systemFuncSystemInt16_SystemInt32_SystemStringInvoke, - IntPtr releaseSystemAppDomainInitializer, - IntPtr systemAppDomainInitializerConstructor, - IntPtr systemAppDomainInitializerAdd, - IntPtr systemAppDomainInitializerRemove, - IntPtr systemAppDomainInitializerInvoke, - IntPtr releaseUnityEngineEventsUnityAction, - IntPtr unityEngineEventsUnityActionConstructor, - IntPtr unityEngineEventsUnityActionAdd, - IntPtr unityEngineEventsUnityActionRemove, - IntPtr unityEngineEventsUnityActionInvoke, - IntPtr releaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode, - IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor, - IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd, - IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove, - IntPtr unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke, - IntPtr releaseSystemComponentModelDesignComponentEventHandler, - IntPtr systemComponentModelDesignComponentEventHandlerConstructor, - IntPtr systemComponentModelDesignComponentEventHandlerAdd, - IntPtr systemComponentModelDesignComponentEventHandlerRemove, - IntPtr systemComponentModelDesignComponentEventHandlerInvoke, - IntPtr releaseSystemComponentModelDesignComponentChangingEventHandler, - IntPtr systemComponentModelDesignComponentChangingEventHandlerConstructor, - IntPtr systemComponentModelDesignComponentChangingEventHandlerAdd, - IntPtr systemComponentModelDesignComponentChangingEventHandlerRemove, - IntPtr systemComponentModelDesignComponentChangingEventHandlerInvoke, - IntPtr releaseSystemComponentModelDesignComponentChangedEventHandler, - IntPtr systemComponentModelDesignComponentChangedEventHandlerConstructor, - IntPtr systemComponentModelDesignComponentChangedEventHandlerAdd, - IntPtr systemComponentModelDesignComponentChangedEventHandlerRemove, - IntPtr systemComponentModelDesignComponentChangedEventHandlerInvoke, - IntPtr releaseSystemComponentModelDesignComponentRenameEventHandler, - IntPtr systemComponentModelDesignComponentRenameEventHandlerConstructor, - IntPtr systemComponentModelDesignComponentRenameEventHandlerAdd, - IntPtr systemComponentModelDesignComponentRenameEventHandlerRemove, - IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke + IntPtr unboxDouble /*END INIT PARAMS*/); [DllImport(PluginName)] static extern void SetCsharpException(int handle); - /*BEGIN MONOBEHAVIOUR IMPORTS*/ - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsGenericIComparerSystemInt32Compare(int thisHandle, int param0, int param1); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsGenericIComparerSystemStringCompare(int thisHandle, int param0, int param1); - - [DllImport(Constants.PluginName)] - public static extern void SystemStringComparerCompare(int thisHandle, int param0, int param1); - - [DllImport(Constants.PluginName)] - public static extern void SystemStringComparerEquals(int thisHandle, int param0, int param1); - - [DllImport(Constants.PluginName)] - public static extern void SystemStringComparerGetHashCode(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemCollectionsQueueGetCount(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceOnComponentChanged(int thisHandle, int param0, int param1, int param2, int param3); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceOnComponentChanging(int thisHandle, int param0, int param1); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceAddComponentAdded(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceAddComponentAdding(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceAddComponentChanged(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanged(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceAddComponentChanging(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanging(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceAddComponentRemoved(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoved(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceAddComponentRemoving(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceAddComponentRename(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemIOFileStreamWriteByte(int thisHandle, int param0); - - [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 MyGameMonoBehavioursAnotherScriptAwake(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void MyGameMonoBehavioursAnotherScriptUpdate(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void SystemActionNativeInvoke(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void SystemActionSystemSingleNativeInvoke(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void SystemActionSystemSingle_SystemSingleNativeInvoke(int thisHandle, int param0, int param1); - - [DllImport(Constants.PluginName)] - public static extern void SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke(int thisHandle, int param0, int param1); - - [DllImport(Constants.PluginName)] - public static extern void SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke(int thisHandle, int param0, int param1); - - [DllImport(Constants.PluginName)] - public static extern void SystemAppDomainInitializerNativeInvoke(int thisHandle, int param0); - - [DllImport(Constants.PluginName)] - public static extern void UnityEngineEventsUnityActionNativeInvoke(int thisHandle); - - [DllImport(Constants.PluginName)] - public static extern void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(int thisHandle, int param0, int param1); - - [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignComponentEventHandlerNativeInvoke(int thisHandle, int param0, int param1); - + /*BEGIN IMPORTS*/ [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignComponentChangingEventHandlerNativeInvoke(int thisHandle, int param0, int param1); + public static extern void NewBaseBallScript(int thisHandle, int param0); [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignComponentChangedEventHandlerNativeInvoke(int thisHandle, int param0, int param1); + public static extern void DestroyBaseBallScript(int thisHandle, int param0); [DllImport(Constants.PluginName)] - public static extern void SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke(int thisHandle, int param0, int param1); + public static extern void MyGameAbstractBaseBallScriptUpdate(int thisHandle); [DllImport(Constants.PluginName)] public static extern void SetCsharpExceptionSystemNullReferenceException(int thisHandle, int param0); - /*END MONOBEHAVIOUR IMPORTS*/ + /*END IMPORTS*/ #endif delegate void ReleaseObjectDelegate(int handle); @@ -1240,171 +570,27 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate int EnumerableGetEnumeratorDelegate(int handle); /*BEGIN DELEGATE TYPES*/ - delegate int SystemIComparableMethodCompareToSystemObjectDelegate(int thisHandle, int objHandle); - delegate void SystemIDisposableMethodDisposeDelegate(int thisHandle); 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 int BoxVector3Delegate(ref UnityEngine.Vector3 val); delegate UnityEngine.Vector3 UnboxVector3Delegate(int valHandle); 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 UnityEngineComponentPropertyGetTransformDelegate(int thisHandle); delegate UnityEngine.Vector3 UnityEngineTransformPropertyGetPositionDelegate(int thisHandle); delegate void UnityEngineTransformPropertySetPositionDelegate(int thisHandle, ref UnityEngine.Vector3 value); - delegate void UnityEngineTransformMethodSetParentUnityEngineTransformDelegate(int thisHandle, int parentHandle); - delegate int BoxColorDelegate(ref UnityEngine.Color val); - delegate UnityEngine.Color UnboxColorDelegate(int valHandle); - delegate int BoxGradientColorKeyDelegate(ref UnityEngine.GradientColorKey val); - delegate UnityEngine.GradientColorKey UnboxGradientColorKeyDelegate(int valHandle); - delegate void ReleaseUnityEngineResolutionDelegate(int handle); - delegate int UnityEngineResolutionConstructorDelegate(); - delegate int UnityEngineResolutionPropertyGetWidthDelegate(int thisHandle); - delegate void UnityEngineResolutionPropertySetWidthDelegate(int thisHandle, int value); - delegate int UnityEngineResolutionPropertyGetHeightDelegate(int thisHandle); - delegate void UnityEngineResolutionPropertySetHeightDelegate(int thisHandle, int value); - delegate int UnityEngineResolutionPropertyGetRefreshRateDelegate(int thisHandle); - delegate void UnityEngineResolutionPropertySetRefreshRateDelegate(int thisHandle, int value); - delegate int BoxResolutionDelegate(int valHandle); - delegate int UnboxResolutionDelegate(int valHandle); - 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 int BoxRaycastHitDelegate(int valHandle); - delegate int UnboxRaycastHitDelegate(int valHandle); delegate int SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(int thisHandle); delegate bool SystemCollectionsIEnumeratorMethodMoveNextDelegate(int thisHandle); - delegate void ReleaseUnityEnginePlayablesPlayableGraphDelegate(int handle); - delegate int BoxPlayableGraphDelegate(int valHandle); - delegate int UnboxPlayableGraphDelegate(int valHandle); - delegate void ReleaseUnityEngineAnimationsAnimationMixerPlayableDelegate(int handle); - delegate int UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBooleanDelegate(int graphHandle, int inputCount, bool normalizeWeights); - delegate int BoxAnimationMixerPlayableDelegate(int valHandle); - delegate int UnboxAnimationMixerPlayableDelegate(int valHandle); - delegate int SystemDiagnosticsStopwatchConstructorDelegate(); - delegate long SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate(int thisHandle); - delegate void SystemDiagnosticsStopwatchMethodStartDelegate(int thisHandle); - delegate void SystemDiagnosticsStopwatchMethodResetDelegate(int thisHandle); - delegate int UnityEngineGameObjectConstructorDelegate(); - delegate int UnityEngineGameObjectConstructorSystemStringDelegate(int nameHandle); - delegate int UnityEngineGameObjectPropertyGetTransformDelegate(int thisHandle); - delegate int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate(int thisHandle); - delegate int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScriptDelegate(int thisHandle); + delegate int UnityEngineGameObjectMethodAddComponentMyGameBaseBallScriptDelegate(int thisHandle); delegate int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate(UnityEngine.PrimitiveType type); 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 int UnityEngineMonoBehaviourPropertyGetTransformDelegate(int thisHandle); - 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 int BoxQuaternionDelegate(ref UnityEngine.Quaternion val); - delegate UnityEngine.Quaternion UnboxQuaternionDelegate(int valHandle); - 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 int BoxMatrix4x4Delegate(ref UnityEngine.Matrix4x4 val); - delegate UnityEngine.Matrix4x4 UnboxMatrix4x4Delegate(int valHandle); - delegate int BoxQueryTriggerInteractionDelegate(UnityEngine.QueryTriggerInteraction val); - delegate UnityEngine.QueryTriggerInteraction UnboxQueryTriggerInteractionDelegate(int valHandle); - 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 BoxKeyValuePairSystemString_SystemDoubleDelegate(int valHandle); - delegate int UnboxKeyValuePairSystemString_SystemDoubleDelegate(int valHandle); - 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 UnityEngineScreenPropertyGetResolutionsDelegate(); - delegate void ReleaseUnityEngineRayDelegate(int handle); - delegate int UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction); - delegate int BoxRayDelegate(int valHandle); - delegate int UnboxRayDelegate(int valHandle); - delegate int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1Delegate(int rayHandle, int resultsHandle); - delegate int UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate(int rayHandle); - 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 void UnityEngineApplicationAddEventOnBeforeRenderDelegate(int delHandle); - delegate void UnityEngineApplicationRemoveEventOnBeforeRenderDelegate(int delHandle); - delegate void UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate(int delHandle); - delegate void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate(int delHandle); - delegate void ReleaseUnityEngineSceneManagementSceneDelegate(int handle); - delegate int BoxSceneDelegate(int valHandle); - delegate int UnboxSceneDelegate(int valHandle); - delegate int BoxLoadSceneModeDelegate(UnityEngine.SceneManagement.LoadSceneMode val); - delegate UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneModeDelegate(int valHandle); delegate int BoxPrimitiveTypeDelegate(UnityEngine.PrimitiveType val); delegate UnityEngine.PrimitiveType UnboxPrimitiveTypeDelegate(int valHandle); delegate float UnityEngineTimePropertyGetDeltaTimeDelegate(); - delegate int BoxFileModeDelegate(System.IO.FileMode val); - delegate System.IO.FileMode UnboxFileModeDelegate(int valHandle); - delegate void SystemCollectionsGenericBaseIComparerSystemInt32ConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemCollectionsGenericBaseIComparerSystemInt32Delegate(int handle); - delegate void SystemCollectionsGenericBaseIComparerSystemStringConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemCollectionsGenericBaseIComparerSystemStringDelegate(int handle); - delegate void SystemBaseStringComparerConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemBaseStringComparerDelegate(int handle); - delegate int SystemCollectionsQueuePropertyGetCountDelegate(int thisHandle); - delegate void SystemCollectionsBaseQueueConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemCollectionsBaseQueueDelegate(int handle); - delegate void SystemComponentModelDesignBaseIComponentChangeServiceConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseSystemComponentModelDesignBaseIComponentChangeServiceDelegate(int handle); - delegate int SystemIOFileStreamConstructorSystemString_SystemIOFileModeDelegate(int pathHandle, System.IO.FileMode mode); - delegate void SystemIOFileStreamMethodWriteByteSystemByteDelegate(int thisHandle, byte value); - delegate void SystemIOBaseFileStreamConstructorSystemString_SystemIOFileModeDelegate(int cppHandle, ref int handle, int pathHandle, System.IO.FileMode mode); - delegate void ReleaseSystemIOBaseFileStreamDelegate(int handle); - delegate void ReleaseUnityEnginePlayablesPlayableHandleDelegate(int handle); - delegate int BoxPlayableHandleDelegate(int valHandle); - delegate int UnboxPlayableHandleDelegate(int valHandle); - delegate int SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrentDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumeratorDelegate(int thisHandle); - delegate int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1Delegate(int eHandle, int nameHandle, int classesHandle); - delegate int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringDelegate(int eHandle, int nameHandle, int classNameHandle); - delegate int BoxInteractionSourcePositionAccuracyDelegate(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy val); - delegate UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy UnboxInteractionSourcePositionAccuracyDelegate(int valHandle); - delegate int BoxInteractionSourceNodeDelegate(UnityEngine.XR.WSA.Input.InteractionSourceNode val); - delegate UnityEngine.XR.WSA.Input.InteractionSourceNode UnboxInteractionSourceNodeDelegate(int valHandle); - delegate void ReleaseUnityEngineXRWSAInputInteractionSourcePoseDelegate(int handle); - delegate bool UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNodeDelegate(int thisHandle, out UnityEngine.Quaternion rotation, UnityEngine.XR.WSA.Input.InteractionSourceNode node); - delegate int BoxInteractionSourcePoseDelegate(int valHandle); - delegate int UnboxInteractionSourcePoseDelegate(int valHandle); - delegate int SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrentDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrentDelegate(int thisHandle); - delegate float SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrentDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrentDelegate(int thisHandle); - delegate UnityEngine.GradientColorKey SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrentDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrentDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumeratorDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumeratorDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumeratorDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumeratorDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumeratorDelegate(int thisHandle); - delegate int SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumeratorDelegate(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 void SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate(int thisHandle, int comparerHandle); - delegate int SystemCollectionsGenericListSystemInt32ConstructorDelegate(); - delegate int SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate(int thisHandle, int index); - delegate void SystemCollectionsGenericListSystemInt32PropertySetItemDelegate(int thisHandle, int index, int value); - delegate void SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate(int thisHandle, int item); - delegate void SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate(int thisHandle, int comparerHandle); + delegate void BaseBallScriptConstructorDelegate(int cppHandle, ref int handle); + delegate void ReleaseBaseBallScriptDelegate(int handle); delegate int BoxBooleanDelegate(bool val); delegate bool UnboxBooleanDelegate(int valHandle); delegate int BoxSByteDelegate(sbyte val); @@ -1429,92 +615,6 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke delegate float UnboxSingleDelegate(int valHandle); delegate int BoxDoubleDelegate(double val); delegate double UnboxDoubleDelegate(int valHandle); - delegate int SystemSystemInt32Array1Constructor1Delegate(int length0); - delegate int SystemInt32Array1GetItem1Delegate(int thisHandle, int index0); - delegate void SystemInt32Array1SetItem1Delegate(int thisHandle, int index0, int item); - delegate int SystemSystemSingleArray1Constructor1Delegate(int length0); - delegate float SystemSingleArray1GetItem1Delegate(int thisHandle, int index0); - delegate void SystemSingleArray1SetItem1Delegate(int thisHandle, int index0, float item); - delegate int SystemSystemSingleArray2Constructor2Delegate(int length0, int length1); - delegate int SystemSystemSingleArray2GetLength2Delegate(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 SystemSystemSingleArray3Constructor3Delegate(int length0, int length1, int length2); - delegate int SystemSystemSingleArray3GetLength3Delegate(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 SystemSystemStringArray1Constructor1Delegate(int length0); - delegate int SystemStringArray1GetItem1Delegate(int thisHandle, int index0); - delegate void SystemStringArray1SetItem1Delegate(int thisHandle, int index0, int itemHandle); - delegate int UnityEngineUnityEngineResolutionArray1Constructor1Delegate(int length0); - delegate int UnityEngineResolutionArray1GetItem1Delegate(int thisHandle, int index0); - delegate void UnityEngineResolutionArray1SetItem1Delegate(int thisHandle, int index0, int itemHandle); - delegate int UnityEngineUnityEngineRaycastHitArray1Constructor1Delegate(int length0); - delegate int UnityEngineRaycastHitArray1GetItem1Delegate(int thisHandle, int index0); - delegate void UnityEngineRaycastHitArray1SetItem1Delegate(int thisHandle, int index0, int itemHandle); - delegate int UnityEngineUnityEngineGradientColorKeyArray1Constructor1Delegate(int length0); - delegate UnityEngine.GradientColorKey UnityEngineGradientColorKeyArray1GetItem1Delegate(int thisHandle, int index0); - delegate void UnityEngineGradientColorKeyArray1SetItem1Delegate(int thisHandle, int index0, ref UnityEngine.GradientColorKey item); - delegate void SystemActionInvokeDelegate(int thisHandle); - delegate void SystemActionConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); - delegate void ReleaseSystemActionDelegate(int handle, int classHandle); - delegate void SystemActionAddDelegate(int thisHandle, int delHandle); - delegate void SystemActionRemoveDelegate(int thisHandle, int delHandle); - delegate void SystemActionSystemSingleInvokeDelegate(int thisHandle, float obj); - delegate void SystemActionSystemSingleConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); - delegate void ReleaseSystemActionSystemSingleDelegate(int handle, int classHandle); - delegate void SystemActionSystemSingleAddDelegate(int thisHandle, int delHandle); - delegate void SystemActionSystemSingleRemoveDelegate(int thisHandle, int delHandle); - delegate void SystemActionSystemSingle_SystemSingleInvokeDelegate(int thisHandle, float arg1, float arg2); - delegate void SystemActionSystemSingle_SystemSingleConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); - delegate void ReleaseSystemActionSystemSingle_SystemSingleDelegate(int handle, int classHandle); - delegate void SystemActionSystemSingle_SystemSingleAddDelegate(int thisHandle, int delHandle); - delegate void SystemActionSystemSingle_SystemSingleRemoveDelegate(int thisHandle, int delHandle); - delegate double SystemFuncSystemInt32_SystemSingle_SystemDoubleInvokeDelegate(int thisHandle, int arg1, float arg2); - delegate void SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); - delegate void ReleaseSystemFuncSystemInt32_SystemSingle_SystemDoubleDelegate(int handle, int classHandle); - delegate void SystemFuncSystemInt32_SystemSingle_SystemDoubleAddDelegate(int thisHandle, int delHandle); - delegate void SystemFuncSystemInt32_SystemSingle_SystemDoubleRemoveDelegate(int thisHandle, int delHandle); - delegate int SystemFuncSystemInt16_SystemInt32_SystemStringInvokeDelegate(int thisHandle, short arg1, int arg2); - delegate void SystemFuncSystemInt16_SystemInt32_SystemStringConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); - delegate void ReleaseSystemFuncSystemInt16_SystemInt32_SystemStringDelegate(int handle, int classHandle); - delegate void SystemFuncSystemInt16_SystemInt32_SystemStringAddDelegate(int thisHandle, int delHandle); - delegate void SystemFuncSystemInt16_SystemInt32_SystemStringRemoveDelegate(int thisHandle, int delHandle); - delegate void SystemAppDomainInitializerInvokeDelegate(int thisHandle, int argsHandle); - delegate void SystemAppDomainInitializerConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); - delegate void ReleaseSystemAppDomainInitializerDelegate(int handle, int classHandle); - delegate void SystemAppDomainInitializerAddDelegate(int thisHandle, int delHandle); - delegate void SystemAppDomainInitializerRemoveDelegate(int thisHandle, int delHandle); - delegate void UnityEngineEventsUnityActionInvokeDelegate(int thisHandle); - delegate void UnityEngineEventsUnityActionConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); - delegate void ReleaseUnityEngineEventsUnityActionDelegate(int handle, int classHandle); - delegate void UnityEngineEventsUnityActionAddDelegate(int thisHandle, int delHandle); - delegate void UnityEngineEventsUnityActionRemoveDelegate(int thisHandle, int delHandle); - delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate(int thisHandle, int arg0Handle, UnityEngine.SceneManagement.LoadSceneMode arg1); - delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); - delegate void ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeDelegate(int handle, int classHandle); - delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAddDelegate(int thisHandle, int delHandle); - delegate void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemoveDelegate(int thisHandle, int delHandle); - delegate void SystemComponentModelDesignComponentEventHandlerInvokeDelegate(int thisHandle, int senderHandle, int eHandle); - delegate void SystemComponentModelDesignComponentEventHandlerConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); - delegate void ReleaseSystemComponentModelDesignComponentEventHandlerDelegate(int handle, int classHandle); - delegate void SystemComponentModelDesignComponentEventHandlerAddDelegate(int thisHandle, int delHandle); - delegate void SystemComponentModelDesignComponentEventHandlerRemoveDelegate(int thisHandle, int delHandle); - delegate void SystemComponentModelDesignComponentChangingEventHandlerInvokeDelegate(int thisHandle, int senderHandle, int eHandle); - delegate void SystemComponentModelDesignComponentChangingEventHandlerConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); - delegate void ReleaseSystemComponentModelDesignComponentChangingEventHandlerDelegate(int handle, int classHandle); - delegate void SystemComponentModelDesignComponentChangingEventHandlerAddDelegate(int thisHandle, int delHandle); - delegate void SystemComponentModelDesignComponentChangingEventHandlerRemoveDelegate(int thisHandle, int delHandle); - delegate void SystemComponentModelDesignComponentChangedEventHandlerInvokeDelegate(int thisHandle, int senderHandle, int eHandle); - delegate void SystemComponentModelDesignComponentChangedEventHandlerConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); - delegate void ReleaseSystemComponentModelDesignComponentChangedEventHandlerDelegate(int handle, int classHandle); - delegate void SystemComponentModelDesignComponentChangedEventHandlerAddDelegate(int thisHandle, int delHandle); - delegate void SystemComponentModelDesignComponentChangedEventHandlerRemoveDelegate(int thisHandle, int delHandle); - delegate void SystemComponentModelDesignComponentRenameEventHandlerInvokeDelegate(int thisHandle, int senderHandle, int eHandle); - delegate void SystemComponentModelDesignComponentRenameEventHandlerConstructorDelegate(int cppHandle, ref int handle, ref int classHandle); - delegate void ReleaseSystemComponentModelDesignComponentRenameEventHandlerDelegate(int handle, int classHandle); - delegate void SystemComponentModelDesignComponentRenameEventHandlerAddDelegate(int thisHandle, int delHandle); - delegate void SystemComponentModelDesignComponentRenameEventHandlerRemoveDelegate(int thisHandle, int delHandle); /*END DELEGATE TYPES*/ private static readonly string pluginPath = Application.dataPath + PLUGIN_PATH; @@ -1523,8 +623,12 @@ IntPtr systemComponentModelDesignComponentRenameEventHandlerInvoke #endif public static Exception UnhandledCppException; public static SetCsharpExceptionDelegate SetCsharpException; - private static IntPtr memory; - private static int memorySize; + static IntPtr memory; + static int memorySize; + static DestroyEntry[] destroyQueue; + static int destroyQueueCount; + static int destroyQueueCapacity; + static object destroyQueueLockObj; /// /// Open the C++ plugin and call its PluginMain() @@ -1537,19 +641,17 @@ public static void Open(int memorySize) { /*BEGIN STORE INIT CALLS*/ NativeScript.Bindings.ObjectStore.Init(1000); - NativeScript.Bindings.StructStore.Init(1000); - NativeScript.Bindings.StructStore.Init(1000); - NativeScript.Bindings.StructStore.Init(1000); - NativeScript.Bindings.StructStore.Init(1000); - NativeScript.Bindings.StructStore>.Init(20); - NativeScript.Bindings.StructStore.Init(10); - NativeScript.Bindings.StructStore.Init(1000); - NativeScript.Bindings.StructStore.Init(1000); - NativeScript.Bindings.StructStore.Init(1000); /*END STORE INIT CALLS*/ - + + // Allocate unmanaged memory Bindings.memorySize = memorySize; memory = Marshal.AllocHGlobal(memorySize); + + // Allocate destroy queue + destroyQueueCapacity = 128; + destroyQueue = new DestroyEntry[destroyQueueCapacity]; + destroyQueueLockObj = new object(); + OpenPlugin(InitMode.FirstBoot); } @@ -1562,6 +664,7 @@ public static void Open(int memorySize) /// public static void Reload() { + DestroyAll(); ClosePlugin(); OpenPlugin(InitMode.Reload); } @@ -1622,50 +725,12 @@ private static void OpenPlugin(InitMode initMode) SetCsharpException = GetDelegate( libraryHandle, "SetCsharpException"); - /*BEGIN MONOBEHAVIOUR GETDELEGATE CALLS*/ - SystemCollectionsGenericIComparerSystemInt32Compare = GetDelegate(libraryHandle, "SystemCollectionsGenericIComparerSystemInt32Compare"); - SystemCollectionsGenericIComparerSystemStringCompare = GetDelegate(libraryHandle, "SystemCollectionsGenericIComparerSystemStringCompare"); - SystemStringComparerCompare = GetDelegate(libraryHandle, "SystemStringComparerCompare"); - SystemStringComparerEquals = GetDelegate(libraryHandle, "SystemStringComparerEquals"); - SystemStringComparerGetHashCode = GetDelegate(libraryHandle, "SystemStringComparerGetHashCode"); - SystemCollectionsQueueGetCount = GetDelegate(libraryHandle, "SystemCollectionsQueueGetCount"); - SystemComponentModelDesignIComponentChangeServiceOnComponentChanged = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceOnComponentChanged"); - SystemComponentModelDesignIComponentChangeServiceOnComponentChanging = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceOnComponentChanging"); - SystemComponentModelDesignIComponentChangeServiceAddComponentAdded = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentAdded"); - SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded"); - SystemComponentModelDesignIComponentChangeServiceAddComponentAdding = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentAdding"); - SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding"); - SystemComponentModelDesignIComponentChangeServiceAddComponentChanged = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentChanged"); - SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanged = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanged"); - SystemComponentModelDesignIComponentChangeServiceAddComponentChanging = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentChanging"); - SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanging = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanging"); - SystemComponentModelDesignIComponentChangeServiceAddComponentRemoved = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentRemoved"); - SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoved = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoved"); - SystemComponentModelDesignIComponentChangeServiceAddComponentRemoving = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentRemoving"); - SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving"); - SystemComponentModelDesignIComponentChangeServiceAddComponentRename = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceAddComponentRename"); - SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename = GetDelegate(libraryHandle, "SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename"); - SystemIOFileStreamWriteByte = GetDelegate(libraryHandle, "SystemIOFileStreamWriteByte"); - MyGameMonoBehavioursTestScriptAwake = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptAwake"); - MyGameMonoBehavioursTestScriptOnAnimatorIK = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptOnAnimatorIK"); - MyGameMonoBehavioursTestScriptOnCollisionEnter = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptOnCollisionEnter"); - MyGameMonoBehavioursTestScriptUpdate = GetDelegate(libraryHandle, "MyGameMonoBehavioursTestScriptUpdate"); - MyGameMonoBehavioursAnotherScriptAwake = GetDelegate(libraryHandle, "MyGameMonoBehavioursAnotherScriptAwake"); - MyGameMonoBehavioursAnotherScriptUpdate = GetDelegate(libraryHandle, "MyGameMonoBehavioursAnotherScriptUpdate"); - SystemActionNativeInvoke = GetDelegate(libraryHandle, "SystemActionNativeInvoke"); - SystemActionSystemSingleNativeInvoke = GetDelegate(libraryHandle, "SystemActionSystemSingleNativeInvoke"); - SystemActionSystemSingle_SystemSingleNativeInvoke = GetDelegate(libraryHandle, "SystemActionSystemSingle_SystemSingleNativeInvoke"); - SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke = GetDelegate(libraryHandle, "SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke"); - SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke = GetDelegate(libraryHandle, "SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke"); - SystemAppDomainInitializerNativeInvoke = GetDelegate(libraryHandle, "SystemAppDomainInitializerNativeInvoke"); - UnityEngineEventsUnityActionNativeInvoke = GetDelegate(libraryHandle, "UnityEngineEventsUnityActionNativeInvoke"); - UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke = GetDelegate(libraryHandle, "UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke"); - SystemComponentModelDesignComponentEventHandlerNativeInvoke = GetDelegate(libraryHandle, "SystemComponentModelDesignComponentEventHandlerNativeInvoke"); - SystemComponentModelDesignComponentChangingEventHandlerNativeInvoke = GetDelegate(libraryHandle, "SystemComponentModelDesignComponentChangingEventHandlerNativeInvoke"); - SystemComponentModelDesignComponentChangedEventHandlerNativeInvoke = GetDelegate(libraryHandle, "SystemComponentModelDesignComponentChangedEventHandlerNativeInvoke"); - SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke = GetDelegate(libraryHandle, "SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke"); + /*BEGIN GETDELEGATE CALLS*/ + NewBaseBallScript = GetDelegate(libraryHandle, "NewBaseBallScript"); + DestroyBaseBallScript = GetDelegate(libraryHandle, "DestroyBaseBallScript"); + MyGameAbstractBaseBallScriptUpdate = GetDelegate(libraryHandle, "MyGameAbstractBaseBallScriptUpdate"); SetCsharpExceptionSystemNullReferenceException = GetDelegate(libraryHandle, "SetCsharpExceptionSystemNullReferenceException"); - /*END MONOBEHAVIOUR GETDELEGATE CALLS*/ + /*END GETDELEGATE CALLS*/ #endif // Init C++ library Init( @@ -1679,171 +744,27 @@ private static void OpenPlugin(InitMode initMode) Marshal.GetFunctionPointerForDelegate(new EnumerableGetEnumeratorDelegate(EnumerableGetEnumerator)), /*BEGIN INIT CALL*/ 1000, - Marshal.GetFunctionPointerForDelegate(new SystemIComparableMethodCompareToSystemObjectDelegate(SystemIComparableMethodCompareToSystemObject)), - Marshal.GetFunctionPointerForDelegate(new SystemIDisposableMethodDisposeDelegate(SystemIDisposableMethodDispose)), 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 BoxVector3Delegate(BoxVector3)), Marshal.GetFunctionPointerForDelegate(new UnboxVector3Delegate(UnboxVector3)), 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 UnityEngineComponentPropertyGetTransformDelegate(UnityEngineComponentPropertyGetTransform)), Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformPropertyGetPositionDelegate(UnityEngineTransformPropertyGetPosition)), Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformPropertySetPositionDelegate(UnityEngineTransformPropertySetPosition)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformMethodSetParentUnityEngineTransformDelegate(UnityEngineTransformMethodSetParentUnityEngineTransform)), - Marshal.GetFunctionPointerForDelegate(new BoxColorDelegate(BoxColor)), - Marshal.GetFunctionPointerForDelegate(new UnboxColorDelegate(UnboxColor)), - Marshal.GetFunctionPointerForDelegate(new BoxGradientColorKeyDelegate(BoxGradientColorKey)), - Marshal.GetFunctionPointerForDelegate(new UnboxGradientColorKeyDelegate(UnboxGradientColorKey)), - Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineResolutionDelegate(ReleaseUnityEngineResolution)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionConstructorDelegate(UnityEngineResolutionConstructor)), - 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 BoxResolutionDelegate(BoxResolution)), - Marshal.GetFunctionPointerForDelegate(new UnboxResolutionDelegate(UnboxResolution)), - Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineRaycastHitDelegate(ReleaseUnityEngineRaycastHit)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetPointDelegate(UnityEngineRaycastHitPropertyGetPoint)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertySetPointDelegate(UnityEngineRaycastHitPropertySetPoint)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitPropertyGetTransformDelegate(UnityEngineRaycastHitPropertyGetTransform)), - Marshal.GetFunctionPointerForDelegate(new BoxRaycastHitDelegate(BoxRaycastHit)), - Marshal.GetFunctionPointerForDelegate(new UnboxRaycastHitDelegate(UnboxRaycastHit)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(SystemCollectionsIEnumeratorPropertyGetCurrent)), Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIEnumeratorMethodMoveNextDelegate(SystemCollectionsIEnumeratorMethodMoveNext)), - Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEnginePlayablesPlayableGraphDelegate(ReleaseUnityEnginePlayablesPlayableGraph)), - Marshal.GetFunctionPointerForDelegate(new BoxPlayableGraphDelegate(BoxPlayableGraph)), - Marshal.GetFunctionPointerForDelegate(new UnboxPlayableGraphDelegate(UnboxPlayableGraph)), - Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineAnimationsAnimationMixerPlayableDelegate(ReleaseUnityEngineAnimationsAnimationMixerPlayable)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBooleanDelegate(UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)), - Marshal.GetFunctionPointerForDelegate(new BoxAnimationMixerPlayableDelegate(BoxAnimationMixerPlayable)), - Marshal.GetFunctionPointerForDelegate(new UnboxAnimationMixerPlayableDelegate(UnboxAnimationMixerPlayable)), - Marshal.GetFunctionPointerForDelegate(new SystemDiagnosticsStopwatchConstructorDelegate(SystemDiagnosticsStopwatchConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate(SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)), - Marshal.GetFunctionPointerForDelegate(new SystemDiagnosticsStopwatchMethodStartDelegate(SystemDiagnosticsStopwatchMethodStart)), - Marshal.GetFunctionPointerForDelegate(new SystemDiagnosticsStopwatchMethodResetDelegate(SystemDiagnosticsStopwatchMethodReset)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectConstructorDelegate(UnityEngineGameObjectConstructor)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectConstructorSystemStringDelegate(UnityEngineGameObjectConstructorSystemString)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectPropertyGetTransformDelegate(UnityEngineGameObjectPropertyGetTransform)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScriptDelegate(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript)), + Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodAddComponentMyGameBaseBallScriptDelegate(UnityEngineGameObjectMethodAddComponentMyGameBaseBallScript)), Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)), 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 UnityEngineMonoBehaviourPropertyGetTransformDelegate(UnityEngineMonoBehaviourPropertyGetTransform)), - 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 BoxQuaternionDelegate(BoxQuaternion)), - Marshal.GetFunctionPointerForDelegate(new UnboxQuaternionDelegate(UnboxQuaternion)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineMatrix4x4PropertyGetItemDelegate(UnityEngineMatrix4x4PropertyGetItem)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineMatrix4x4PropertySetItemDelegate(UnityEngineMatrix4x4PropertySetItem)), - Marshal.GetFunctionPointerForDelegate(new BoxMatrix4x4Delegate(BoxMatrix4x4)), - Marshal.GetFunctionPointerForDelegate(new UnboxMatrix4x4Delegate(UnboxMatrix4x4)), - Marshal.GetFunctionPointerForDelegate(new BoxQueryTriggerInteractionDelegate(BoxQueryTriggerInteraction)), - Marshal.GetFunctionPointerForDelegate(new UnboxQueryTriggerInteractionDelegate(UnboxQueryTriggerInteraction)), - 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 BoxKeyValuePairSystemString_SystemDoubleDelegate(BoxKeyValuePairSystemString_SystemDouble)), - Marshal.GetFunctionPointerForDelegate(new UnboxKeyValuePairSystemString_SystemDoubleDelegate(UnboxKeyValuePairSystemString_SystemDouble)), - 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 UnityEngineScreenPropertyGetResolutionsDelegate(UnityEngineScreenPropertyGetResolutions)), - Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineRayDelegate(ReleaseUnityEngineRay)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)), - Marshal.GetFunctionPointerForDelegate(new BoxRayDelegate(BoxRay)), - Marshal.GetFunctionPointerForDelegate(new UnboxRayDelegate(UnboxRay)), - Marshal.GetFunctionPointerForDelegate(new UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1Delegate(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1)), - 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 UnityEngineApplicationAddEventOnBeforeRenderDelegate(UnityEngineApplicationAddEventOnBeforeRender)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineApplicationRemoveEventOnBeforeRenderDelegate(UnityEngineApplicationRemoveEventOnBeforeRender)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate(UnityEngineSceneManagementSceneManagerAddEventSceneLoaded)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate(UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)), - Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineSceneManagementSceneDelegate(ReleaseUnityEngineSceneManagementScene)), - Marshal.GetFunctionPointerForDelegate(new BoxSceneDelegate(BoxScene)), - Marshal.GetFunctionPointerForDelegate(new UnboxSceneDelegate(UnboxScene)), - Marshal.GetFunctionPointerForDelegate(new BoxLoadSceneModeDelegate(BoxLoadSceneMode)), - Marshal.GetFunctionPointerForDelegate(new UnboxLoadSceneModeDelegate(UnboxLoadSceneMode)), Marshal.GetFunctionPointerForDelegate(new BoxPrimitiveTypeDelegate(BoxPrimitiveType)), Marshal.GetFunctionPointerForDelegate(new UnboxPrimitiveTypeDelegate(UnboxPrimitiveType)), Marshal.GetFunctionPointerForDelegate(new UnityEngineTimePropertyGetDeltaTimeDelegate(UnityEngineTimePropertyGetDeltaTime)), - Marshal.GetFunctionPointerForDelegate(new BoxFileModeDelegate(BoxFileMode)), - Marshal.GetFunctionPointerForDelegate(new UnboxFileModeDelegate(UnboxFileMode)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericBaseIComparerSystemInt32Delegate(ReleaseSystemCollectionsGenericBaseIComparerSystemInt32)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericBaseIComparerSystemInt32ConstructorDelegate(SystemCollectionsGenericBaseIComparerSystemInt32Constructor)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsGenericBaseIComparerSystemStringDelegate(ReleaseSystemCollectionsGenericBaseIComparerSystemString)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericBaseIComparerSystemStringConstructorDelegate(SystemCollectionsGenericBaseIComparerSystemStringConstructor)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemBaseStringComparerDelegate(ReleaseSystemBaseStringComparer)), - Marshal.GetFunctionPointerForDelegate(new SystemBaseStringComparerConstructorDelegate(SystemBaseStringComparerConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsQueuePropertyGetCountDelegate(SystemCollectionsQueuePropertyGetCount)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemCollectionsBaseQueueDelegate(ReleaseSystemCollectionsBaseQueue)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsBaseQueueConstructorDelegate(SystemCollectionsBaseQueueConstructor)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemComponentModelDesignBaseIComponentChangeServiceDelegate(ReleaseSystemComponentModelDesignBaseIComponentChangeService)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignBaseIComponentChangeServiceConstructorDelegate(SystemComponentModelDesignBaseIComponentChangeServiceConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemIOFileStreamConstructorSystemString_SystemIOFileModeDelegate(SystemIOFileStreamConstructorSystemString_SystemIOFileMode)), - Marshal.GetFunctionPointerForDelegate(new SystemIOFileStreamMethodWriteByteSystemByteDelegate(SystemIOFileStreamMethodWriteByteSystemByte)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemIOBaseFileStreamDelegate(ReleaseSystemIOBaseFileStream)), - Marshal.GetFunctionPointerForDelegate(new SystemIOBaseFileStreamConstructorSystemString_SystemIOFileModeDelegate(SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode)), - Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEnginePlayablesPlayableHandleDelegate(ReleaseUnityEnginePlayablesPlayableHandle)), - Marshal.GetFunctionPointerForDelegate(new BoxPlayableHandleDelegate(BoxPlayableHandle)), - Marshal.GetFunctionPointerForDelegate(new UnboxPlayableHandleDelegate(UnboxPlayableHandle)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1Delegate(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringDelegate(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString)), - Marshal.GetFunctionPointerForDelegate(new BoxInteractionSourcePositionAccuracyDelegate(BoxInteractionSourcePositionAccuracy)), - Marshal.GetFunctionPointerForDelegate(new UnboxInteractionSourcePositionAccuracyDelegate(UnboxInteractionSourcePositionAccuracy)), - Marshal.GetFunctionPointerForDelegate(new BoxInteractionSourceNodeDelegate(BoxInteractionSourceNode)), - Marshal.GetFunctionPointerForDelegate(new UnboxInteractionSourceNodeDelegate(UnboxInteractionSourceNode)), - Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineXRWSAInputInteractionSourcePoseDelegate(ReleaseUnityEngineXRWSAInputInteractionSourcePose)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNodeDelegate(UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode)), - Marshal.GetFunctionPointerForDelegate(new BoxInteractionSourcePoseDelegate(BoxInteractionSourcePose)), - Marshal.GetFunctionPointerForDelegate(new UnboxInteractionSourcePoseDelegate(UnboxInteractionSourcePose)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrentDelegate(SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumeratorDelegate(SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringConstructorDelegate(SystemCollectionsGenericListSystemStringConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringPropertyGetItemDelegate(SystemCollectionsGenericListSystemStringPropertyGetItem)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringPropertySetItemDelegate(SystemCollectionsGenericListSystemStringPropertySetItem)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate(SystemCollectionsGenericListSystemStringMethodAddSystemString)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate(SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32ConstructorDelegate(SystemCollectionsGenericListSystemInt32Constructor)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate(SystemCollectionsGenericListSystemInt32PropertyGetItem)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32PropertySetItemDelegate(SystemCollectionsGenericListSystemInt32PropertySetItem)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate(SystemCollectionsGenericListSystemInt32MethodAddSystemInt32)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate(SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer)), + Marshal.GetFunctionPointerForDelegate(new ReleaseBaseBallScriptDelegate(ReleaseBaseBallScript)), + Marshal.GetFunctionPointerForDelegate(new BaseBallScriptConstructorDelegate(BaseBallScriptConstructor)), Marshal.GetFunctionPointerForDelegate(new BoxBooleanDelegate(BoxBoolean)), Marshal.GetFunctionPointerForDelegate(new UnboxBooleanDelegate(UnboxBoolean)), Marshal.GetFunctionPointerForDelegate(new BoxSByteDelegate(BoxSByte)), @@ -1867,93 +788,7 @@ private static void OpenPlugin(InitMode initMode) Marshal.GetFunctionPointerForDelegate(new BoxSingleDelegate(BoxSingle)), Marshal.GetFunctionPointerForDelegate(new UnboxSingleDelegate(UnboxSingle)), Marshal.GetFunctionPointerForDelegate(new BoxDoubleDelegate(BoxDouble)), - Marshal.GetFunctionPointerForDelegate(new UnboxDoubleDelegate(UnboxDouble)), - Marshal.GetFunctionPointerForDelegate(new SystemSystemInt32Array1Constructor1Delegate(SystemSystemInt32Array1Constructor1)), - Marshal.GetFunctionPointerForDelegate(new SystemInt32Array1GetItem1Delegate(SystemInt32Array1GetItem1)), - Marshal.GetFunctionPointerForDelegate(new SystemInt32Array1SetItem1Delegate(SystemInt32Array1SetItem1)), - Marshal.GetFunctionPointerForDelegate(new SystemSystemSingleArray1Constructor1Delegate(SystemSystemSingleArray1Constructor1)), - Marshal.GetFunctionPointerForDelegate(new SystemSingleArray1GetItem1Delegate(SystemSingleArray1GetItem1)), - Marshal.GetFunctionPointerForDelegate(new SystemSingleArray1SetItem1Delegate(SystemSingleArray1SetItem1)), - Marshal.GetFunctionPointerForDelegate(new SystemSystemSingleArray2Constructor2Delegate(SystemSystemSingleArray2Constructor2)), - Marshal.GetFunctionPointerForDelegate(new SystemSystemSingleArray2GetLength2Delegate(SystemSystemSingleArray2GetLength2)), - Marshal.GetFunctionPointerForDelegate(new SystemSingleArray2GetItem2Delegate(SystemSingleArray2GetItem2)), - Marshal.GetFunctionPointerForDelegate(new SystemSingleArray2SetItem2Delegate(SystemSingleArray2SetItem2)), - Marshal.GetFunctionPointerForDelegate(new SystemSystemSingleArray3Constructor3Delegate(SystemSystemSingleArray3Constructor3)), - Marshal.GetFunctionPointerForDelegate(new SystemSystemSingleArray3GetLength3Delegate(SystemSystemSingleArray3GetLength3)), - Marshal.GetFunctionPointerForDelegate(new SystemSingleArray3GetItem3Delegate(SystemSingleArray3GetItem3)), - Marshal.GetFunctionPointerForDelegate(new SystemSingleArray3SetItem3Delegate(SystemSingleArray3SetItem3)), - Marshal.GetFunctionPointerForDelegate(new SystemSystemStringArray1Constructor1Delegate(SystemSystemStringArray1Constructor1)), - Marshal.GetFunctionPointerForDelegate(new SystemStringArray1GetItem1Delegate(SystemStringArray1GetItem1)), - Marshal.GetFunctionPointerForDelegate(new SystemStringArray1SetItem1Delegate(SystemStringArray1SetItem1)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineUnityEngineResolutionArray1Constructor1Delegate(UnityEngineUnityEngineResolutionArray1Constructor1)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionArray1GetItem1Delegate(UnityEngineResolutionArray1GetItem1)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineResolutionArray1SetItem1Delegate(UnityEngineResolutionArray1SetItem1)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineUnityEngineRaycastHitArray1Constructor1Delegate(UnityEngineUnityEngineRaycastHitArray1Constructor1)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitArray1GetItem1Delegate(UnityEngineRaycastHitArray1GetItem1)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineRaycastHitArray1SetItem1Delegate(UnityEngineRaycastHitArray1SetItem1)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineUnityEngineGradientColorKeyArray1Constructor1Delegate(UnityEngineUnityEngineGradientColorKeyArray1Constructor1)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientColorKeyArray1GetItem1Delegate(UnityEngineGradientColorKeyArray1GetItem1)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineGradientColorKeyArray1SetItem1Delegate(UnityEngineGradientColorKeyArray1SetItem1)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemActionDelegate(ReleaseSystemAction)), - Marshal.GetFunctionPointerForDelegate(new SystemActionConstructorDelegate(SystemActionConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemActionAddDelegate(SystemActionAdd)), - Marshal.GetFunctionPointerForDelegate(new SystemActionRemoveDelegate(SystemActionRemove)), - Marshal.GetFunctionPointerForDelegate(new SystemActionInvokeDelegate(SystemActionInvoke)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemActionSystemSingleDelegate(ReleaseSystemActionSystemSingle)), - Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingleConstructorDelegate(SystemActionSystemSingleConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingleAddDelegate(SystemActionSystemSingleAdd)), - Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingleRemoveDelegate(SystemActionSystemSingleRemove)), - Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingleInvokeDelegate(SystemActionSystemSingleInvoke)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemActionSystemSingle_SystemSingleDelegate(ReleaseSystemActionSystemSingle_SystemSingle)), - Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingle_SystemSingleConstructorDelegate(SystemActionSystemSingle_SystemSingleConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingle_SystemSingleAddDelegate(SystemActionSystemSingle_SystemSingleAdd)), - Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingle_SystemSingleRemoveDelegate(SystemActionSystemSingle_SystemSingleRemove)), - Marshal.GetFunctionPointerForDelegate(new SystemActionSystemSingle_SystemSingleInvokeDelegate(SystemActionSystemSingle_SystemSingleInvoke)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemFuncSystemInt32_SystemSingle_SystemDoubleDelegate(ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble)), - Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructorDelegate(SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt32_SystemSingle_SystemDoubleAddDelegate(SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd)), - Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt32_SystemSingle_SystemDoubleRemoveDelegate(SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove)), - Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt32_SystemSingle_SystemDoubleInvokeDelegate(SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemFuncSystemInt16_SystemInt32_SystemStringDelegate(ReleaseSystemFuncSystemInt16_SystemInt32_SystemString)), - Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt16_SystemInt32_SystemStringConstructorDelegate(SystemFuncSystemInt16_SystemInt32_SystemStringConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt16_SystemInt32_SystemStringAddDelegate(SystemFuncSystemInt16_SystemInt32_SystemStringAdd)), - Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt16_SystemInt32_SystemStringRemoveDelegate(SystemFuncSystemInt16_SystemInt32_SystemStringRemove)), - Marshal.GetFunctionPointerForDelegate(new SystemFuncSystemInt16_SystemInt32_SystemStringInvokeDelegate(SystemFuncSystemInt16_SystemInt32_SystemStringInvoke)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemAppDomainInitializerDelegate(ReleaseSystemAppDomainInitializer)), - Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerConstructorDelegate(SystemAppDomainInitializerConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerAddDelegate(SystemAppDomainInitializerAdd)), - Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerRemoveDelegate(SystemAppDomainInitializerRemove)), - Marshal.GetFunctionPointerForDelegate(new SystemAppDomainInitializerInvokeDelegate(SystemAppDomainInitializerInvoke)), - Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineEventsUnityActionDelegate(ReleaseUnityEngineEventsUnityAction)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionConstructorDelegate(UnityEngineEventsUnityActionConstructor)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionAddDelegate(UnityEngineEventsUnityActionAdd)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionRemoveDelegate(UnityEngineEventsUnityActionRemove)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionInvokeDelegate(UnityEngineEventsUnityActionInvoke)), - Marshal.GetFunctionPointerForDelegate(new ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeDelegate(ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructorDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAddDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemoveDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemComponentModelDesignComponentEventHandlerDelegate(ReleaseSystemComponentModelDesignComponentEventHandler)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentEventHandlerConstructorDelegate(SystemComponentModelDesignComponentEventHandlerConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentEventHandlerAddDelegate(SystemComponentModelDesignComponentEventHandlerAdd)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentEventHandlerRemoveDelegate(SystemComponentModelDesignComponentEventHandlerRemove)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentEventHandlerInvokeDelegate(SystemComponentModelDesignComponentEventHandlerInvoke)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemComponentModelDesignComponentChangingEventHandlerDelegate(ReleaseSystemComponentModelDesignComponentChangingEventHandler)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangingEventHandlerConstructorDelegate(SystemComponentModelDesignComponentChangingEventHandlerConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangingEventHandlerAddDelegate(SystemComponentModelDesignComponentChangingEventHandlerAdd)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangingEventHandlerRemoveDelegate(SystemComponentModelDesignComponentChangingEventHandlerRemove)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangingEventHandlerInvokeDelegate(SystemComponentModelDesignComponentChangingEventHandlerInvoke)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemComponentModelDesignComponentChangedEventHandlerDelegate(ReleaseSystemComponentModelDesignComponentChangedEventHandler)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangedEventHandlerConstructorDelegate(SystemComponentModelDesignComponentChangedEventHandlerConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangedEventHandlerAddDelegate(SystemComponentModelDesignComponentChangedEventHandlerAdd)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangedEventHandlerRemoveDelegate(SystemComponentModelDesignComponentChangedEventHandlerRemove)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentChangedEventHandlerInvokeDelegate(SystemComponentModelDesignComponentChangedEventHandlerInvoke)), - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemComponentModelDesignComponentRenameEventHandlerDelegate(ReleaseSystemComponentModelDesignComponentRenameEventHandler)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentRenameEventHandlerConstructorDelegate(SystemComponentModelDesignComponentRenameEventHandlerConstructor)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentRenameEventHandlerAddDelegate(SystemComponentModelDesignComponentRenameEventHandlerAdd)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentRenameEventHandlerRemoveDelegate(SystemComponentModelDesignComponentRenameEventHandlerRemove)), - Marshal.GetFunctionPointerForDelegate(new SystemComponentModelDesignComponentRenameEventHandlerInvokeDelegate(SystemComponentModelDesignComponentRenameEventHandlerInvoke)) + Marshal.GetFunctionPointerForDelegate(new UnboxDoubleDelegate(UnboxDouble)) /*END INIT CALL*/ ); if (UnhandledCppException != null) @@ -1973,6 +808,14 @@ public static void Close() Marshal.FreeHGlobal(memory); memory = IntPtr.Zero; } + + /// + /// Perform updates over time + /// + public static void Update() + { + DestroyAll(); + } private static void ClosePlugin() { @@ -1984,6 +827,55 @@ private static void ClosePlugin() File.Delete(pluginTempPath); #endif } + + public static void QueueDestroy(DestroyFunction function, int cppHandle) + { + lock (destroyQueueLockObj) + { + // Grow capacity if necessary + int count = destroyQueueCount; + int capacity = destroyQueueCapacity; + DestroyEntry[] queue = destroyQueue; + if (count == capacity) + { + int newCapacity = capacity * 2; + DestroyEntry[] newQueue = new DestroyEntry[newCapacity]; + for (int i = 0; i < capacity; ++i) + { + newQueue[i] = queue[i]; + } + destroyQueueCapacity = newCapacity; + destroyQueue = newQueue; + queue = newQueue; + } + + // Add to the end + queue[count] = new DestroyEntry(function, cppHandle); + destroyQueueCount = count + 1; + } + } + + static void DestroyAll() + { + lock (destroyQueueLockObj) + { + int count = destroyQueueCount; + DestroyEntry[] queue = destroyQueue; + for (int i = 0; i < count; ++i) + { + DestroyEntry entry = queue[i]; + switch (entry.Function) + { + /*BEGIN DESTROY QUEUE CASES*/ + case DestroyFunction.BaseBallScript: + DestroyBaseBallScript(entry.CppHandle); + break; + /*END DESTROY QUEUE CASES*/ + } + } + destroyQueueCount = 0; + } + } //////////////////////////////////////////////////////////////// // C# functions for C++ to call @@ -2024,5895 +916,128 @@ static int EnumerableGetEnumerator(int handle) { return ObjectStore.Store(((IEnumerable)ObjectStore.Get(handle)).GetEnumerator()); } - - /*BEGIN BASE TYPES*/ - class SystemCollectionsGenericBaseIComparerSystemInt32 : System.Collections.Generic.IComparer + + /*BEGIN FUNCTIONS*/ + [MonoPInvokeCallback(typeof(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate))] + static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(float x, float y, float z) { - public int CppHandle; - - public SystemCollectionsGenericBaseIComparerSystemInt32(int cppHandle) - : base() + try { - CppHandle = cppHandle; + var returnValue = new UnityEngine.Vector3(x, y, z); + return returnValue; } - - public int Compare(int x, int y) + catch (System.NullReferenceException ex) { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemCollectionsGenericIComparerSystemInt32Compare(thisHandle, x, y); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } - return default(int); + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); } - } - class SystemCollectionsGenericBaseIComparerSystemString : System.Collections.Generic.IComparer + [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate))] + static UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 a, ref UnityEngine.Vector3 b) { - public int CppHandle; - - public SystemCollectionsGenericBaseIComparerSystemString(int cppHandle) - : base() + try { - CppHandle = cppHandle; + var returnValue = a + b; + return returnValue; } - - public int Compare(string x, string y) + catch (System.NullReferenceException ex) { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int xHandle = NativeScript.Bindings.ObjectStore.GetHandle(x); - int yHandle = NativeScript.Bindings.ObjectStore.GetHandle(y); - var returnVal = NativeScript.Bindings.SystemCollectionsGenericIComparerSystemStringCompare(thisHandle, xHandle, yHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } - return default(int); + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); } - } - class SystemBaseStringComparer : System.StringComparer + [MonoPInvokeCallback(typeof(BoxVector3Delegate))] + static int BoxVector3(ref UnityEngine.Vector3 val) { - public int CppHandle; - - public SystemBaseStringComparer(int cppHandle) - : base() + try { - CppHandle = cppHandle; + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } - - public override int Compare(string x, string y) + catch (System.NullReferenceException ex) { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int xHandle = NativeScript.Bindings.ObjectStore.GetHandle(x); - int yHandle = NativeScript.Bindings.ObjectStore.GetHandle(y); - var returnVal = NativeScript.Bindings.SystemStringComparerCompare(thisHandle, xHandle, yHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } - - public override bool Equals(string x, string y) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int xHandle = NativeScript.Bindings.ObjectStore.GetHandle(x); - int yHandle = NativeScript.Bindings.ObjectStore.GetHandle(y); - var returnVal = NativeScript.Bindings.SystemStringComparerEquals(thisHandle, xHandle, yHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } - return default(bool); - } - - public override int GetHashCode(string obj) + catch (System.Exception ex) { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int objHandle = NativeScript.Bindings.ObjectStore.GetHandle(obj); - var returnVal = NativeScript.Bindings.SystemStringComparerGetHashCode(thisHandle, objHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); return default(int); } - } - class SystemCollectionsBaseQueue : System.Collections.Queue + [MonoPInvokeCallback(typeof(UnboxVector3Delegate))] + static UnityEngine.Vector3 UnboxVector3(int valHandle) { - public int CppHandle; - - public SystemCollectionsBaseQueue(int cppHandle) - : base() + try { - CppHandle = cppHandle; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.Vector3)val; + return returnValue; } - - public override int Count - { - get - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemCollectionsQueueGetCount(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } - return default(int); - } - } - - } - - class SystemComponentModelDesignBaseIComponentChangeService : System.ComponentModel.Design.IComponentChangeService - { - public int CppHandle; - - public SystemComponentModelDesignBaseIComponentChangeService(int cppHandle) - : base() - { - CppHandle = cppHandle; - } - - public void OnComponentChanged(object component, System.ComponentModel.MemberDescriptor member, object oldValue, object newValue) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int componentHandle = NativeScript.Bindings.ObjectStore.GetHandle(component); - int memberHandle = NativeScript.Bindings.ObjectStore.GetHandle(member); - int oldValueHandle = NativeScript.Bindings.ObjectStore.GetHandle(oldValue); - int newValueHandle = NativeScript.Bindings.ObjectStore.GetHandle(newValue); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceOnComponentChanged(thisHandle, componentHandle, memberHandle, oldValueHandle, newValueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - public void OnComponentChanging(object component, System.ComponentModel.MemberDescriptor member) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int componentHandle = NativeScript.Bindings.ObjectStore.GetHandle(component); - int memberHandle = NativeScript.Bindings.ObjectStore.GetHandle(member); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceOnComponentChanging(thisHandle, componentHandle, memberHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - public event System.ComponentModel.Design.ComponentEventHandler ComponentAdded - { - add - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentAdded(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - remove - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - - public event System.ComponentModel.Design.ComponentEventHandler ComponentAdding - { - add - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentAdding(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - remove - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - - public event System.ComponentModel.Design.ComponentChangedEventHandler ComponentChanged - { - add - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentChanged(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - remove - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanged(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - - public event System.ComponentModel.Design.ComponentChangingEventHandler ComponentChanging - { - add - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentChanging(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - remove - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanging(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - - public event System.ComponentModel.Design.ComponentEventHandler ComponentRemoved - { - add - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentRemoved(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - remove - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoved(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - - public event System.ComponentModel.Design.ComponentEventHandler ComponentRemoving - { - add - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentRemoving(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - remove - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - - public event System.ComponentModel.Design.ComponentRenameEventHandler ComponentRename - { - add - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceAddComponentRename(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - remove - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int valueHandle = NativeScript.Bindings.ObjectStore.GetHandle(value); - NativeScript.Bindings.SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename(thisHandle, valueHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - } - - } - - class SystemIOBaseFileStream : System.IO.FileStream - { - public int CppHandle; - - public SystemIOBaseFileStream(int cppHandle, string path, System.IO.FileMode mode) - : base(path, mode) - { - CppHandle = cppHandle; - } - - public override void WriteByte(byte value) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - NativeScript.Bindings.SystemIOFileStreamWriteByte(thisHandle, value); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - } - - class SystemAction - { - public int CppHandle; - public System.Action Delegate; - - public SystemAction(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public void NativeInvoke() - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - NativeScript.Bindings.SystemActionNativeInvoke(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - } - - class SystemActionSystemSingle - { - public int CppHandle; - public System.Action Delegate; - - public SystemActionSystemSingle(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public void NativeInvoke(float obj) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - NativeScript.Bindings.SystemActionSystemSingleNativeInvoke(thisHandle, obj); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - } - - class SystemActionSystemSingle_SystemSingle - { - public int CppHandle; - public System.Action Delegate; - - public SystemActionSystemSingle_SystemSingle(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public void NativeInvoke(float arg1, float arg2) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - NativeScript.Bindings.SystemActionSystemSingle_SystemSingleNativeInvoke(thisHandle, arg1, arg2); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - } - - class SystemFuncSystemInt32_SystemSingle_SystemDouble - { - public int CppHandle; - public System.Func Delegate; - - public SystemFuncSystemInt32_SystemSingle_SystemDouble(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public double NativeInvoke(int arg1, float arg2) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke(thisHandle, arg1, arg2); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return returnVal; - } - return default(double); - } - - } - - class SystemFuncSystemInt16_SystemInt32_SystemString - { - public int CppHandle; - public System.Func Delegate; - - public SystemFuncSystemInt16_SystemInt32_SystemString(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public string NativeInvoke(short arg1, int arg2) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - var returnVal = NativeScript.Bindings.SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke(thisHandle, arg1, arg2); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - return (string)NativeScript.Bindings.ObjectStore.Get(returnVal); - } - return default(string); - } - - } - - class SystemAppDomainInitializer - { - public int CppHandle; - public System.AppDomainInitializer Delegate; - - public SystemAppDomainInitializer(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public void NativeInvoke(string[] args) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int argsHandle = NativeScript.Bindings.ObjectStore.GetHandle(args); - NativeScript.Bindings.SystemAppDomainInitializerNativeInvoke(thisHandle, argsHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - } - - class UnityEngineEventsUnityAction - { - public int CppHandle; - public UnityEngine.Events.UnityAction Delegate; - - public UnityEngineEventsUnityAction(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public void NativeInvoke() - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - NativeScript.Bindings.UnityEngineEventsUnityActionNativeInvoke(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - } - - class UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode - { - public int CppHandle; - public UnityEngine.Events.UnityAction Delegate; - - public UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public void NativeInvoke(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.LoadSceneMode arg1) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int arg0Handle = NativeScript.Bindings.StructStore.Store(arg0); - NativeScript.Bindings.UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(thisHandle, arg0Handle, arg1); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - } - - class SystemComponentModelDesignComponentEventHandler - { - public int CppHandle; - public System.ComponentModel.Design.ComponentEventHandler Delegate; - - public SystemComponentModelDesignComponentEventHandler(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public void NativeInvoke(object sender, System.ComponentModel.Design.ComponentEventArgs e) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int senderHandle = NativeScript.Bindings.ObjectStore.GetHandle(sender); - int eHandle = NativeScript.Bindings.ObjectStore.GetHandle(e); - NativeScript.Bindings.SystemComponentModelDesignComponentEventHandlerNativeInvoke(thisHandle, senderHandle, eHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - } - - class SystemComponentModelDesignComponentChangingEventHandler - { - public int CppHandle; - public System.ComponentModel.Design.ComponentChangingEventHandler Delegate; - - public SystemComponentModelDesignComponentChangingEventHandler(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public void NativeInvoke(object sender, System.ComponentModel.Design.ComponentChangingEventArgs e) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int senderHandle = NativeScript.Bindings.ObjectStore.GetHandle(sender); - int eHandle = NativeScript.Bindings.ObjectStore.GetHandle(e); - NativeScript.Bindings.SystemComponentModelDesignComponentChangingEventHandlerNativeInvoke(thisHandle, senderHandle, eHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - } - - class SystemComponentModelDesignComponentChangedEventHandler - { - public int CppHandle; - public System.ComponentModel.Design.ComponentChangedEventHandler Delegate; - - public SystemComponentModelDesignComponentChangedEventHandler(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public void NativeInvoke(object sender, System.ComponentModel.Design.ComponentChangedEventArgs e) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int senderHandle = NativeScript.Bindings.ObjectStore.GetHandle(sender); - int eHandle = NativeScript.Bindings.ObjectStore.GetHandle(e); - NativeScript.Bindings.SystemComponentModelDesignComponentChangedEventHandlerNativeInvoke(thisHandle, senderHandle, eHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - } - - class SystemComponentModelDesignComponentRenameEventHandler - { - public int CppHandle; - public System.ComponentModel.Design.ComponentRenameEventHandler Delegate; - - public SystemComponentModelDesignComponentRenameEventHandler(int cppHandle) - { - CppHandle = cppHandle; - Delegate = NativeInvoke; - } - - public void NativeInvoke(object sender, System.ComponentModel.Design.ComponentRenameEventArgs e) - { - if (CppHandle != 0) - { - int thisHandle = CppHandle; - int senderHandle = NativeScript.Bindings.ObjectStore.GetHandle(sender); - int eHandle = NativeScript.Bindings.ObjectStore.GetHandle(e); - NativeScript.Bindings.SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke(thisHandle, senderHandle, eHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - } - - } - /*END BASE TYPES*/ - - /*BEGIN FUNCTIONS*/ - [MonoPInvokeCallback(typeof(SystemIComparableMethodCompareToSystemObjectDelegate))] - static int SystemIComparableMethodCompareToSystemObject(int thisHandle, int objHandle) - { - try - { - var thiz = (System.IComparable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var obj = NativeScript.Bindings.ObjectStore.Get(objHandle); - var returnValue = thiz.CompareTo(obj); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemIDisposableMethodDisposeDelegate))] - static void SystemIDisposableMethodDispose(int thisHandle) - { - try - { - var thiz = (System.IDisposable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Dispose(); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate))] - static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(float x, float y, float z) - { - try - { - var returnValue = new UnityEngine.Vector3(x, y, z); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineVector3PropertyGetMagnitudeDelegate))] - static float UnityEngineVector3PropertyGetMagnitude(ref UnityEngine.Vector3 thiz) - { - try - { - var returnValue = thiz.magnitude; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingleDelegate))] - static void UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(ref UnityEngine.Vector3 thiz, float newX, float newY, float newZ) - { - try - { - thiz.Set(newX, newY, newZ); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate))] - static UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 a, ref UnityEngine.Vector3 b) - { - try - { - var returnValue = a + b; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3Delegate))] - static UnityEngine.Vector3 UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3(ref UnityEngine.Vector3 a) - { - try - { - var returnValue = -a; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); - } - } - - [MonoPInvokeCallback(typeof(BoxVector3Delegate))] - static int BoxVector3(ref UnityEngine.Vector3 val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxVector3Delegate))] - static UnityEngine.Vector3 UnboxVector3(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Vector3)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineObjectPropertyGetNameDelegate))] - static int UnityEngineObjectPropertyGetName(int thisHandle) - { - try - { - var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.name; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineObjectPropertySetNameDelegate))] - static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) - { - try - { - var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.name = value; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObjectDelegate))] - static bool UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject(int xHandle, int yHandle) - { - try - { - var x = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(xHandle); - var y = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(yHandle); - var returnValue = x == y; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineObjectMethodop_ImplicitUnityEngineObjectDelegate))] - static bool UnityEngineObjectMethodop_ImplicitUnityEngineObject(int existsHandle) - { - try - { - var exists = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(existsHandle); - var returnValue = exists; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineComponentPropertyGetTransformDelegate))] - static int UnityEngineComponentPropertyGetTransform(int thisHandle) - { - try - { - var thiz = (UnityEngine.Component)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineTransformPropertyGetPositionDelegate))] - static UnityEngine.Vector3 UnityEngineTransformPropertyGetPosition(int thisHandle) - { - try - { - var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.position; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineTransformPropertySetPositionDelegate))] - static void UnityEngineTransformPropertySetPosition(int thisHandle, ref UnityEngine.Vector3 value) - { - try - { - var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.position = value; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineTransformMethodSetParentUnityEngineTransformDelegate))] - static void UnityEngineTransformMethodSetParentUnityEngineTransform(int thisHandle, int parentHandle) - { - try - { - var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var parent = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(parentHandle); - thiz.SetParent(parent); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(BoxColorDelegate))] - static int BoxColor(ref UnityEngine.Color val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxColorDelegate))] - static UnityEngine.Color UnboxColor(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Color)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Color); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Color); - } - } - - [MonoPInvokeCallback(typeof(BoxGradientColorKeyDelegate))] - static int BoxGradientColorKey(ref UnityEngine.GradientColorKey val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxGradientColorKeyDelegate))] - static UnityEngine.GradientColorKey UnboxGradientColorKey(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.GradientColorKey)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); - } - } - - [MonoPInvokeCallback(typeof(ReleaseUnityEngineResolutionDelegate))] - static void ReleaseUnityEngineResolution(int handle) - { - try - { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineResolutionConstructorDelegate))] - static int UnityEngineResolutionConstructor() - { - try - { - var returnValue = NativeScript.Bindings.StructStore.Store(new UnityEngine.Resolution()); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetWidthDelegate))] - static int UnityEngineResolutionPropertyGetWidth(int thisHandle) - { - try - { - var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.width; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetWidthDelegate))] - static void UnityEngineResolutionPropertySetWidth(int thisHandle, int value) - { - try - { - var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); - thiz.width = value; - NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetHeightDelegate))] - static int UnityEngineResolutionPropertyGetHeight(int thisHandle) - { - try - { - var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.height; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetHeightDelegate))] - static void UnityEngineResolutionPropertySetHeight(int thisHandle, int value) - { - try - { - var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); - thiz.height = value; - NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertyGetRefreshRateDelegate))] - static int UnityEngineResolutionPropertyGetRefreshRate(int thisHandle) - { - try - { - var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.refreshRate; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineResolutionPropertySetRefreshRateDelegate))] - static void UnityEngineResolutionPropertySetRefreshRate(int thisHandle, int value) - { - try - { - var thiz = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(thisHandle); - thiz.refreshRate = value; - NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(BoxResolutionDelegate))] - static int BoxResolution(int valHandle) - { - try - { - var val = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxResolutionDelegate))] - static int UnboxResolution(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Resolution)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseUnityEngineRaycastHitDelegate))] - static void ReleaseUnityEngineRaycastHit(int handle) - { - try - { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertyGetPointDelegate))] - static UnityEngine.Vector3 UnityEngineRaycastHitPropertyGetPoint(int thisHandle) - { - try - { - var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.point; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Vector3); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertySetPointDelegate))] - static void UnityEngineRaycastHitPropertySetPoint(int thisHandle, ref UnityEngine.Vector3 value) - { - try - { - var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); - thiz.point = value; - NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineRaycastHitPropertyGetTransformDelegate))] - static int UnityEngineRaycastHitPropertyGetTransform(int thisHandle) - { - try - { - var thiz = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(BoxRaycastHitDelegate))] - static int BoxRaycastHit(int valHandle) - { - try - { - var val = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxRaycastHitDelegate))] - static int UnboxRaycastHit(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.RaycastHit)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorPropertyGetCurrentDelegate))] - static int SystemCollectionsIEnumeratorPropertyGetCurrent(int thisHandle) - { - try - { - var thiz = (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorMethodMoveNextDelegate))] - static bool SystemCollectionsIEnumeratorMethodMoveNext(int thisHandle) - { - try - { - var thiz = (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.MoveNext(); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); - } - } - - [MonoPInvokeCallback(typeof(ReleaseUnityEnginePlayablesPlayableGraphDelegate))] - static void ReleaseUnityEnginePlayablesPlayableGraph(int handle) - { - try - { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(BoxPlayableGraphDelegate))] - static int BoxPlayableGraph(int valHandle) - { - try - { - var val = (UnityEngine.Playables.PlayableGraph)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxPlayableGraphDelegate))] - static int UnboxPlayableGraph(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Playables.PlayableGraph)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseUnityEngineAnimationsAnimationMixerPlayableDelegate))] - static void ReleaseUnityEngineAnimationsAnimationMixerPlayable(int handle) - { - try - { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBooleanDelegate))] - static int UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean(int graphHandle, int inputCount, bool normalizeWeights) - { - try - { - var graph = (UnityEngine.Playables.PlayableGraph)NativeScript.Bindings.StructStore.Get(graphHandle); - var returnValue = UnityEngine.Animations.AnimationMixerPlayable.Create(graph, inputCount, normalizeWeights); - return NativeScript.Bindings.StructStore.Store(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(BoxAnimationMixerPlayableDelegate))] - static int BoxAnimationMixerPlayable(int valHandle) - { - try - { - var val = (UnityEngine.Animations.AnimationMixerPlayable)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxAnimationMixerPlayableDelegate))] - static int UnboxAnimationMixerPlayable(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Animations.AnimationMixerPlayable)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchConstructorDelegate))] - static int SystemDiagnosticsStopwatchConstructor() - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Diagnostics.Stopwatch()); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchPropertyGetElapsedMillisecondsDelegate))] - static long SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(int thisHandle) - { - try - { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.ElapsedMilliseconds; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(long); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(long); - } - } - - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodStartDelegate))] - static void SystemDiagnosticsStopwatchMethodStart(int thisHandle) - { - try - { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Start(); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemDiagnosticsStopwatchMethodResetDelegate))] - static void SystemDiagnosticsStopwatchMethodReset(int thisHandle) - { - try - { - var thiz = (System.Diagnostics.Stopwatch)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Reset(); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorDelegate))] - static int UnityEngineGameObjectConstructor() - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject()); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineGameObjectConstructorSystemStringDelegate))] - static int UnityEngineGameObjectConstructorSystemString(int nameHandle) - { - try - { - var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GameObject(name)); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineGameObjectPropertyGetTransformDelegate))] - static int UnityEngineGameObjectPropertyGetTransform(int thisHandle) - { - try - { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScriptDelegate))] - static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(int thisHandle) - { - try - { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.AddComponent(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScriptDelegate))] - static int UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript(int thisHandle) - { - try - { - var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.AddComponent(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate))] - static int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(UnityEngine.PrimitiveType type) - { - try - { - var returnValue = UnityEngine.GameObject.CreatePrimitive(type); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineDebugMethodLogSystemObjectDelegate))] - static void UnityEngineDebugMethodLogSystemObject(int messageHandle) - { - try - { - var message = NativeScript.Bindings.ObjectStore.Get(messageHandle); - UnityEngine.Debug.Log(message); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldGetRaiseExceptionsDelegate))] - static bool UnityEngineAssertionsAssertFieldGetRaiseExceptions() - { - try - { - var returnValue = UnityEngine.Assertions.Assert.raiseExceptions; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertFieldSetRaiseExceptionsDelegate))] - static void UnityEngineAssertionsAssertFieldSetRaiseExceptions(bool value) - { - try - { - UnityEngine.Assertions.Assert.raiseExceptions = value; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemStringDelegate))] - static void UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(int expectedHandle, int actualHandle) - { - try - { - var expected = (string)NativeScript.Bindings.ObjectStore.Get(expectedHandle); - var actual = (string)NativeScript.Bindings.ObjectStore.Get(actualHandle); - UnityEngine.Assertions.Assert.AreEqual(expected, actual); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObjectDelegate))] - static void UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(int expectedHandle, int actualHandle) - { - try - { - var expected = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(expectedHandle); - var actual = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(actualHandle); - UnityEngine.Assertions.Assert.AreEqual(expected, actual); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineMonoBehaviourPropertyGetTransformDelegate))] - static int UnityEngineMonoBehaviourPropertyGetTransform(int thisHandle) - { - try - { - var thiz = (UnityEngine.MonoBehaviour)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.transform; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32Delegate))] - static void UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(ref int bufferLength, ref int numBuffers) - { - try - { - UnityEngine.AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - bufferLength = default(int); - numBuffers = default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - bufferLength = default(int); - numBuffers = default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByteDelegate))] - static void UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(int hostId, ref int addressHandle, ref int port, ref byte error) - { - try - { - var address = (string)NativeScript.Bindings.ObjectStore.Get(addressHandle); - UnityEngine.Networking.NetworkTransport.GetBroadcastConnectionInfo(hostId, out address, out port, out error); - int addressHandleNew = NativeScript.Bindings.ObjectStore.GetHandle(address); - addressHandle = addressHandleNew; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - addressHandle = default(int); - port = default(int); - error = default(byte); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - addressHandle = default(int); - port = default(int); - error = default(byte); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineNetworkingNetworkTransportMethodInitDelegate))] - static void UnityEngineNetworkingNetworkTransportMethodInit() - { - try - { - UnityEngine.Networking.NetworkTransport.Init(); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(BoxQuaternionDelegate))] - static int BoxQuaternion(ref UnityEngine.Quaternion val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxQuaternionDelegate))] - static UnityEngine.Quaternion UnboxQuaternion(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Quaternion)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Quaternion); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Quaternion); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertyGetItemDelegate))] - static float UnityEngineMatrix4x4PropertyGetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column) - { - try - { - var returnValue = thiz[row, row]; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineMatrix4x4PropertySetItemDelegate))] - static void UnityEngineMatrix4x4PropertySetItem(ref UnityEngine.Matrix4x4 thiz, int row, int column, float value) - { - try - { - thiz[row, column] = column; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(BoxMatrix4x4Delegate))] - static int BoxMatrix4x4(ref UnityEngine.Matrix4x4 val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxMatrix4x4Delegate))] - static UnityEngine.Matrix4x4 UnboxMatrix4x4(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.Matrix4x4)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Matrix4x4); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.Matrix4x4); - } - } - - [MonoPInvokeCallback(typeof(BoxQueryTriggerInteractionDelegate))] - static int BoxQueryTriggerInteraction(UnityEngine.QueryTriggerInteraction val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxQueryTriggerInteractionDelegate))] - static UnityEngine.QueryTriggerInteraction UnboxQueryTriggerInteraction(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.QueryTriggerInteraction)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.QueryTriggerInteraction); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.QueryTriggerInteraction); - } - } - - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDoubleDelegate))] - static void ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int handle) - { - try - { - if (handle != 0) - { - NativeScript.Bindings.StructStore>.Remove(handle); - } - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDoubleDelegate))] - static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(int keyHandle, double value) - { - try - { - var key = (string)NativeScript.Bindings.ObjectStore.Get(keyHandle); - var returnValue = NativeScript.Bindings.StructStore>.Store(new System.Collections.Generic.KeyValuePair(key, value)); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKeyDelegate))] - static int SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); - var returnValue = thiz.Key; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValueDelegate))] - static double SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(thisHandle); - var returnValue = thiz.Value; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); - } - } - - [MonoPInvokeCallback(typeof(BoxKeyValuePairSystemString_SystemDoubleDelegate))] - static int BoxKeyValuePairSystemString_SystemDouble(int valHandle) - { - try - { - var val = (System.Collections.Generic.KeyValuePair)NativeScript.Bindings.StructStore>.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxKeyValuePairSystemString_SystemDoubleDelegate))] - static int UnboxKeyValuePairSystemString_SystemDouble(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore>.Store((System.Collections.Generic.KeyValuePair)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemStringDelegate))] - static int SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(int valueHandle) - { - try - { - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.LinkedListNode(value)); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValueDelegate))] - static int SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Value; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValueDelegate))] - static void SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(int thisHandle, int valueHandle) - { - try - { - var thiz = (System.Collections.Generic.LinkedListNode)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.Value = value; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemStringDelegate))] - static int SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(int valueHandle) - { - try - { - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Runtime.CompilerServices.StrongBox(value)); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValueDelegate))] - static int SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(int thisHandle) - { - try - { - var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Value; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValueDelegate))] - static void SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(int thisHandle, int valueHandle) - { - try - { - var thiz = (System.Runtime.CompilerServices.StrongBox)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.Value = value; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemExceptionConstructorSystemStringDelegate))] - static int SystemExceptionConstructorSystemString(int messageHandle) - { - try - { - var message = (string)NativeScript.Bindings.ObjectStore.Get(messageHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Exception(message)); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineScreenPropertyGetResolutionsDelegate))] - static int UnityEngineScreenPropertyGetResolutions() - { - try - { - var returnValue = UnityEngine.Screen.resolutions; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseUnityEngineRayDelegate))] - static void ReleaseUnityEngineRay(int handle) - { - try - { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3Delegate))] - static int UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 origin, ref UnityEngine.Vector3 direction) - { - try - { - var returnValue = NativeScript.Bindings.StructStore.Store(new UnityEngine.Ray(origin, direction)); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(BoxRayDelegate))] - static int BoxRay(int valHandle) - { - try - { - var val = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxRayDelegate))] - static int UnboxRay(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Ray)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1Delegate))] - static int UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1(int rayHandle, int resultsHandle) - { - try - { - var ray = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(rayHandle); - var results = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(resultsHandle); - var returnValue = UnityEngine.Physics.RaycastNonAlloc(ray, results); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEnginePhysicsMethodRaycastAllUnityEngineRayDelegate))] - static int UnityEnginePhysicsMethodRaycastAllUnityEngineRay(int rayHandle) - { - try - { - var ray = (UnityEngine.Ray)NativeScript.Bindings.StructStore.Get(rayHandle); - var returnValue = UnityEngine.Physics.RaycastAll(ray); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineGradientConstructorDelegate))] - static int UnityEngineGradientConstructor() - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.Gradient()); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineGradientPropertyGetColorKeysDelegate))] - static int UnityEngineGradientPropertyGetColorKeys(int thisHandle) - { - try - { - var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.colorKeys; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineGradientPropertySetColorKeysDelegate))] - static void UnityEngineGradientPropertySetColorKeys(int thisHandle, int valueHandle) - { - try - { - var thiz = (UnityEngine.Gradient)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.colorKeys = value; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemAppDomainSetupConstructorDelegate))] - static int SystemAppDomainSetupConstructor() - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.AppDomainSetup()); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertyGetAppDomainInitializerDelegate))] - static int SystemAppDomainSetupPropertyGetAppDomainInitializer(int thisHandle) - { - try - { - var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.AppDomainInitializer; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemAppDomainSetupPropertySetAppDomainInitializerDelegate))] - static void SystemAppDomainSetupPropertySetAppDomainInitializer(int thisHandle, int valueHandle) - { - try - { - var thiz = (System.AppDomainSetup)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz.AppDomainInitializer = value; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineApplicationAddEventOnBeforeRenderDelegate))] - static void UnityEngineApplicationAddEventOnBeforeRender(int delHandle) - { - try - { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.Application.onBeforeRender += del; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineApplicationRemoveEventOnBeforeRenderDelegate))] - static void UnityEngineApplicationRemoveEventOnBeforeRender(int delHandle) - { - try - { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.Application.onBeforeRender += del; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerAddEventSceneLoadedDelegate))] - static void UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(int delHandle) - { - try - { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineSceneManagementSceneManagerRemoveEventSceneLoadedDelegate))] - static void UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(int delHandle) - { - try - { - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - UnityEngine.SceneManagement.SceneManager.sceneLoaded += del; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(ReleaseUnityEngineSceneManagementSceneDelegate))] - static void ReleaseUnityEngineSceneManagementScene(int handle) - { - try - { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(BoxSceneDelegate))] - static int BoxScene(int valHandle) - { - try - { - var val = (UnityEngine.SceneManagement.Scene)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxSceneDelegate))] - static int UnboxScene(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.SceneManagement.Scene)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(BoxLoadSceneModeDelegate))] - static int BoxLoadSceneMode(UnityEngine.SceneManagement.LoadSceneMode val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxLoadSceneModeDelegate))] - static UnityEngine.SceneManagement.LoadSceneMode UnboxLoadSceneMode(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.SceneManagement.LoadSceneMode)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.SceneManagement.LoadSceneMode); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.SceneManagement.LoadSceneMode); - } - } - - [MonoPInvokeCallback(typeof(BoxPrimitiveTypeDelegate))] - static int BoxPrimitiveType(UnityEngine.PrimitiveType val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxPrimitiveTypeDelegate))] - static UnityEngine.PrimitiveType UnboxPrimitiveType(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.PrimitiveType)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.PrimitiveType); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.PrimitiveType); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineTimePropertyGetDeltaTimeDelegate))] - static float UnityEngineTimePropertyGetDeltaTime() - { - try - { - var returnValue = UnityEngine.Time.deltaTime; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - } - - [MonoPInvokeCallback(typeof(BoxFileModeDelegate))] - static int BoxFileMode(System.IO.FileMode val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxFileModeDelegate))] - static System.IO.FileMode UnboxFileMode(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (System.IO.FileMode)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(System.IO.FileMode); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(System.IO.FileMode); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericBaseIComparerSystemInt32ConstructorDelegate))] - static void SystemCollectionsGenericBaseIComparerSystemInt32Constructor(int cppHandle, ref int handle) - { - try - { - var thiz = new SystemCollectionsGenericBaseIComparerSystemInt32(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericBaseIComparerSystemInt32Delegate))] - static void ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(int handle) - { - try - { - NativeScript.Bindings.ObjectStore.Remove(handle); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericBaseIComparerSystemStringConstructorDelegate))] - static void SystemCollectionsGenericBaseIComparerSystemStringConstructor(int cppHandle, ref int handle) - { - try - { - var thiz = new SystemCollectionsGenericBaseIComparerSystemString(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsGenericBaseIComparerSystemStringDelegate))] - static void ReleaseSystemCollectionsGenericBaseIComparerSystemString(int handle) - { - try - { - NativeScript.Bindings.ObjectStore.Remove(handle); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemBaseStringComparerConstructorDelegate))] - static void SystemBaseStringComparerConstructor(int cppHandle, ref int handle) - { - try - { - var thiz = new SystemBaseStringComparer(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseSystemBaseStringComparerDelegate))] - static void ReleaseSystemBaseStringComparer(int handle) - { - try - { - NativeScript.Bindings.ObjectStore.Remove(handle); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsQueuePropertyGetCountDelegate))] - static int SystemCollectionsQueuePropertyGetCount(int thisHandle) - { - try - { - var thiz = (System.Collections.Queue)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Count; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsBaseQueueConstructorDelegate))] - static void SystemCollectionsBaseQueueConstructor(int cppHandle, ref int handle) - { - try - { - var thiz = new SystemCollectionsBaseQueue(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseSystemCollectionsBaseQueueDelegate))] - static void ReleaseSystemCollectionsBaseQueue(int handle) - { - try - { - NativeScript.Bindings.ObjectStore.Remove(handle); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemComponentModelDesignBaseIComponentChangeServiceConstructorDelegate))] - static void SystemComponentModelDesignBaseIComponentChangeServiceConstructor(int cppHandle, ref int handle) - { - try - { - var thiz = new SystemComponentModelDesignBaseIComponentChangeService(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseSystemComponentModelDesignBaseIComponentChangeServiceDelegate))] - static void ReleaseSystemComponentModelDesignBaseIComponentChangeService(int handle) - { - try - { - NativeScript.Bindings.ObjectStore.Remove(handle); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemIOFileStreamConstructorSystemString_SystemIOFileModeDelegate))] - static int SystemIOFileStreamConstructorSystemString_SystemIOFileMode(int pathHandle, System.IO.FileMode mode) - { - try - { - var path = (string)NativeScript.Bindings.ObjectStore.Get(pathHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.IO.FileStream(path, mode)); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemIOFileStreamMethodWriteByteSystemByteDelegate))] - static void SystemIOFileStreamMethodWriteByteSystemByte(int thisHandle, byte value) - { - try - { - var thiz = (System.IO.FileStream)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.WriteByte(value); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemIOBaseFileStreamConstructorSystemString_SystemIOFileModeDelegate))] - static void SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode(int cppHandle, ref int handle, int pathHandle, System.IO.FileMode mode) - { - try - { - var path = (string)NativeScript.Bindings.ObjectStore.Get(pathHandle); - var thiz = new SystemIOBaseFileStream(cppHandle, path, mode); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseSystemIOBaseFileStreamDelegate))] - static void ReleaseSystemIOBaseFileStream(int handle) - { - try - { - NativeScript.Bindings.ObjectStore.Remove(handle); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(ReleaseUnityEnginePlayablesPlayableHandleDelegate))] - static void ReleaseUnityEnginePlayablesPlayableHandle(int handle) - { - try - { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(BoxPlayableHandleDelegate))] - static int BoxPlayableHandle(int valHandle) - { - try - { - var val = (UnityEngine.Playables.PlayableHandle)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxPlayableHandleDelegate))] - static int UnboxPlayableHandle(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.Playables.PlayableHandle)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrentDelegate))] - static int SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumeratorDelegate))] - static int SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetEnumerator(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1Delegate))] - static int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1(int eHandle, int nameHandle, int classesHandle) - { - try - { - var e = (UnityEngine.Experimental.UIElements.VisualElement)NativeScript.Bindings.ObjectStore.Get(eHandle); - var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); - var classes = (string[])NativeScript.Bindings.ObjectStore.Get(classesHandle); - var returnValue = UnityEngine.Experimental.UIElements.UQueryExtensions.Q(e, name, classes); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringDelegate))] - static int UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString(int eHandle, int nameHandle, int classNameHandle) - { - try - { - var e = (UnityEngine.Experimental.UIElements.VisualElement)NativeScript.Bindings.ObjectStore.Get(eHandle); - var name = (string)NativeScript.Bindings.ObjectStore.Get(nameHandle); - var className = (string)NativeScript.Bindings.ObjectStore.Get(classNameHandle); - var returnValue = UnityEngine.Experimental.UIElements.UQueryExtensions.Q(e, name, className); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(BoxInteractionSourcePositionAccuracyDelegate))] - static int BoxInteractionSourcePositionAccuracy(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxInteractionSourcePositionAccuracyDelegate))] - static UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy UnboxInteractionSourcePositionAccuracy(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy); - } - } - - [MonoPInvokeCallback(typeof(BoxInteractionSourceNodeDelegate))] - static int BoxInteractionSourceNode(UnityEngine.XR.WSA.Input.InteractionSourceNode val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxInteractionSourceNodeDelegate))] - static UnityEngine.XR.WSA.Input.InteractionSourceNode UnboxInteractionSourceNode(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (UnityEngine.XR.WSA.Input.InteractionSourceNode)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.XR.WSA.Input.InteractionSourceNode); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.XR.WSA.Input.InteractionSourceNode); - } - } - - [MonoPInvokeCallback(typeof(ReleaseUnityEngineXRWSAInputInteractionSourcePoseDelegate))] - static void ReleaseUnityEngineXRWSAInputInteractionSourcePose(int handle) - { - try - { - if (handle != 0) - { - NativeScript.Bindings.StructStore.Remove(handle); - } - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNodeDelegate))] - static bool UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode(int thisHandle, out UnityEngine.Quaternion rotation, UnityEngine.XR.WSA.Input.InteractionSourceNode node) - { - try - { - var thiz = (UnityEngine.XR.WSA.Input.InteractionSourcePose)NativeScript.Bindings.StructStore.Get(thisHandle); - var returnValue = thiz.TryGetRotation(out rotation, node); - NativeScript.Bindings.StructStore.Replace(thisHandle, ref thiz); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - rotation = default(UnityEngine.Quaternion); - return default(bool); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - rotation = default(UnityEngine.Quaternion); - return default(bool); - } - } - - [MonoPInvokeCallback(typeof(BoxInteractionSourcePoseDelegate))] - static int BoxInteractionSourcePose(int valHandle) - { - try - { - var val = (UnityEngine.XR.WSA.Input.InteractionSourcePose)NativeScript.Bindings.StructStore.Get(valHandle); - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxInteractionSourcePoseDelegate))] - static int UnboxInteractionSourcePose(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = NativeScript.Bindings.StructStore.Store((UnityEngine.XR.WSA.Input.InteractionSourcePose)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrentDelegate))] - static int SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrentDelegate))] - static int SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrentDelegate))] - static float SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrentDelegate))] - static int SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; - return NativeScript.Bindings.StructStore.Store(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrentDelegate))] - static UnityEngine.GradientColorKey SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrentDelegate))] - static int SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.Current; - return NativeScript.Bindings.StructStore.Store(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumeratorDelegate))] - static int SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetEnumerator(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumeratorDelegate))] - static int SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetEnumerator(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumeratorDelegate))] - static int SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetEnumerator(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumeratorDelegate))] - static int SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetEnumerator(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumeratorDelegate))] - static int SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetEnumerator(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumeratorDelegate))] - static int SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator(int thisHandle) - { - try - { - var thiz = (System.Collections.Generic.IEnumerable)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetEnumerator(); - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringConstructorDelegate))] - static int SystemCollectionsGenericListSystemStringConstructor() - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertyGetItemDelegate))] - static int SystemCollectionsGenericListSystemStringPropertyGetItem(int thisHandle, int index) - { - try - { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index]; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringPropertySetItemDelegate))] - static void SystemCollectionsGenericListSystemStringPropertySetItem(int thisHandle, int index, int valueHandle) - { - try - { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); - thiz[index] = value; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodAddSystemStringDelegate))] - static void SystemCollectionsGenericListSystemStringMethodAddSystemString(int thisHandle, int itemHandle) - { - try - { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); - thiz.Add(item); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparerDelegate))] - static void SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) - { - try - { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); - thiz.Sort(comparer); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32ConstructorDelegate))] - static int SystemCollectionsGenericListSystemInt32Constructor() - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Collections.Generic.List()); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertyGetItemDelegate))] - static int SystemCollectionsGenericListSystemInt32PropertyGetItem(int thisHandle, int index) - { - try - { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index]; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32PropertySetItemDelegate))] - static void SystemCollectionsGenericListSystemInt32PropertySetItem(int thisHandle, int index, int value) - { - try - { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz[index] = value; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodAddSystemInt32Delegate))] - static void SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(int thisHandle, int item) - { - try - { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz.Add(item); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparerDelegate))] - static void SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(int thisHandle, int comparerHandle) - { - try - { - var thiz = (System.Collections.Generic.List)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var comparer = (System.Collections.Generic.IComparer)NativeScript.Bindings.ObjectStore.Get(comparerHandle); - thiz.Sort(comparer); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(BoxBooleanDelegate))] - static int BoxBoolean(bool val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxBooleanDelegate))] - static bool UnboxBoolean(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (bool)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(bool); - } - } - - [MonoPInvokeCallback(typeof(BoxSByteDelegate))] - static int BoxSByte(sbyte val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxSByteDelegate))] - static sbyte UnboxSByte(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (sbyte)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(sbyte); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(sbyte); - } - } - - [MonoPInvokeCallback(typeof(BoxByteDelegate))] - static int BoxByte(byte val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxByteDelegate))] - static byte UnboxByte(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (byte)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(byte); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(byte); - } - } - - [MonoPInvokeCallback(typeof(BoxInt16Delegate))] - static int BoxInt16(short val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxInt16Delegate))] - static short UnboxInt16(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (short)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(short); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(short); - } - } - - [MonoPInvokeCallback(typeof(BoxUInt16Delegate))] - static int BoxUInt16(ushort val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxUInt16Delegate))] - static ushort UnboxUInt16(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (ushort)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(ushort); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(ushort); - } - } - - [MonoPInvokeCallback(typeof(BoxInt32Delegate))] - static int BoxInt32(int val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxInt32Delegate))] - static int UnboxInt32(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (int)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(BoxUInt32Delegate))] - static int BoxUInt32(uint val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxUInt32Delegate))] - static uint UnboxUInt32(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (uint)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(uint); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(uint); - } - } - - [MonoPInvokeCallback(typeof(BoxInt64Delegate))] - static int BoxInt64(long val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxInt64Delegate))] - static long UnboxInt64(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (long)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(long); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(long); - } - } - - [MonoPInvokeCallback(typeof(BoxUInt64Delegate))] - static int BoxUInt64(ulong val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxUInt64Delegate))] - static ulong UnboxUInt64(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (ulong)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(ulong); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(ulong); - } - } - - [MonoPInvokeCallback(typeof(BoxCharDelegate))] - static int BoxChar(char val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxCharDelegate))] - static char UnboxChar(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (char)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(char); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(char); - } - } - - [MonoPInvokeCallback(typeof(BoxSingleDelegate))] - static int BoxSingle(float val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxSingleDelegate))] - static float UnboxSingle(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (float)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - } - - [MonoPInvokeCallback(typeof(BoxDoubleDelegate))] - static int BoxDouble(double val) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnboxDoubleDelegate))] - static double UnboxDouble(int valHandle) - { - try - { - var val = NativeScript.Bindings.ObjectStore.Get(valHandle); - var returnValue = (double)val; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); - } - } - - [MonoPInvokeCallback(typeof(SystemSystemInt32Array1Constructor1Delegate))] - static int SystemSystemInt32Array1Constructor1(int length0) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new int[length0]); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemInt32Array1GetItem1Delegate))] - static int SystemInt32Array1GetItem1(int thisHandle, int index0) - { - try - { - var thiz = (int[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index0]; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemInt32Array1SetItem1Delegate))] - static void SystemInt32Array1SetItem1(int thisHandle, int index0, int item) - { - try - { - var thiz = (int[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz[index0] = item; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemSystemSingleArray1Constructor1Delegate))] - static int SystemSystemSingleArray1Constructor1(int length0) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new float[length0]); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemSingleArray1GetItem1Delegate))] - static float SystemSingleArray1GetItem1(int thisHandle, int index0) - { - try - { - var thiz = (float[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index0]; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - } - - [MonoPInvokeCallback(typeof(SystemSingleArray1SetItem1Delegate))] - static void SystemSingleArray1SetItem1(int thisHandle, int index0, float item) - { - try - { - var thiz = (float[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz[index0] = item; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemSystemSingleArray2Constructor2Delegate))] - static int SystemSystemSingleArray2Constructor2(int length0, int length1) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new float[length0, length1]); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemSystemSingleArray2GetLength2Delegate))] - static int SystemSystemSingleArray2GetLength2(int thisHandle, int dimension) - { - try - { - var thiz = (float[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetLength(dimension); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemSingleArray2GetItem2Delegate))] - static float SystemSingleArray2GetItem2(int thisHandle, int index0, int index1) - { - try - { - var thiz = (float[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index0, index1]; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - } - - [MonoPInvokeCallback(typeof(SystemSingleArray2SetItem2Delegate))] - static void SystemSingleArray2SetItem2(int thisHandle, int index0, int index1, float item) - { - try - { - var thiz = (float[,])NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz[index0, index1] = item; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemSystemSingleArray3Constructor3Delegate))] - static int SystemSystemSingleArray3Constructor3(int length0, int length1, int length2) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new float[length0, length1, length2]); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemSystemSingleArray3GetLength3Delegate))] - static int SystemSystemSingleArray3GetLength3(int thisHandle, int dimension) - { - try - { - var thiz = (float[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz.GetLength(dimension); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemSingleArray3GetItem3Delegate))] - static float SystemSingleArray3GetItem3(int thisHandle, int index0, int index1, int index2) - { - try - { - var thiz = (float[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index0, index1, index2]; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(float); - } - } - - [MonoPInvokeCallback(typeof(SystemSingleArray3SetItem3Delegate))] - static void SystemSingleArray3SetItem3(int thisHandle, int index0, int index1, int index2, float item) - { - try - { - var thiz = (float[,,])NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz[index0, index1, index2] = item; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemSystemStringArray1Constructor1Delegate))] - static int SystemSystemStringArray1Constructor1(int length0) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new string[length0]); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemStringArray1GetItem1Delegate))] - static int SystemStringArray1GetItem1(int thisHandle, int index0) - { - try - { - var thiz = (string[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index0]; - return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(SystemStringArray1SetItem1Delegate))] - static void SystemStringArray1SetItem1(int thisHandle, int index0, int itemHandle) - { - try - { - var thiz = (string[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var item = (string)NativeScript.Bindings.ObjectStore.Get(itemHandle); - thiz[index0] = item; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineUnityEngineResolutionArray1Constructor1Delegate))] - static int UnityEngineUnityEngineResolutionArray1Constructor1(int length0) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.Resolution[length0]); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineResolutionArray1GetItem1Delegate))] - static int UnityEngineResolutionArray1GetItem1(int thisHandle, int index0) - { - try - { - var thiz = (UnityEngine.Resolution[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index0]; - return NativeScript.Bindings.StructStore.Store(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineResolutionArray1SetItem1Delegate))] - static void UnityEngineResolutionArray1SetItem1(int thisHandle, int index0, int itemHandle) - { - try - { - var thiz = (UnityEngine.Resolution[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var item = (UnityEngine.Resolution)NativeScript.Bindings.StructStore.Get(itemHandle); - thiz[index0] = item; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineUnityEngineRaycastHitArray1Constructor1Delegate))] - static int UnityEngineUnityEngineRaycastHitArray1Constructor1(int length0) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.RaycastHit[length0]); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineRaycastHitArray1GetItem1Delegate))] - static int UnityEngineRaycastHitArray1GetItem1(int thisHandle, int index0) - { - try - { - var thiz = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index0]; - return NativeScript.Bindings.StructStore.Store(returnValue); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineRaycastHitArray1SetItem1Delegate))] - static void UnityEngineRaycastHitArray1SetItem1(int thisHandle, int index0, int itemHandle) - { - try - { - var thiz = (UnityEngine.RaycastHit[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var item = (UnityEngine.RaycastHit)NativeScript.Bindings.StructStore.Get(itemHandle); - thiz[index0] = item; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineUnityEngineGradientColorKeyArray1Constructor1Delegate))] - static int UnityEngineUnityEngineGradientColorKeyArray1Constructor1(int length0) - { - try - { - var returnValue = NativeScript.Bindings.ObjectStore.Store(new UnityEngine.GradientColorKey[length0]); - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(int); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineGradientColorKeyArray1GetItem1Delegate))] - static UnityEngine.GradientColorKey UnityEngineGradientColorKeyArray1GetItem1(int thisHandle, int index0) - { - try - { - var thiz = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - var returnValue = thiz[index0]; - return returnValue; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(UnityEngine.GradientColorKey); - } - } - - [MonoPInvokeCallback(typeof(UnityEngineGradientColorKeyArray1SetItem1Delegate))] - static void UnityEngineGradientColorKeyArray1SetItem1(int thisHandle, int index0, ref UnityEngine.GradientColorKey item) - { - try - { - var thiz = (UnityEngine.GradientColorKey[])NativeScript.Bindings.ObjectStore.Get(thisHandle); - thiz[index0] = item; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemActionInvokeDelegate))] - static void SystemActionInvoke(int thisHandle) - { - try - { - ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemActionConstructorDelegate))] - static void SystemActionConstructor(int cppHandle, ref int handle, ref int classHandle) - { - try - { - var thiz = new SystemAction(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseSystemActionDelegate))] - static void ReleaseSystemAction(int handle, int classHandle) - { - try - { - if (classHandle != 0) - { - var thiz = (SystemAction)NativeScript.Bindings.ObjectStore.Remove(classHandle); - thiz.CppHandle = 0; - } - NativeScript.Bindings.ObjectStore.Remove(handle); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemActionAddDelegate))] - static void SystemActionAdd(int thisHandle, int delHandle) - { - try - { - var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemActionRemoveDelegate))] - static void SystemActionRemove(int thisHandle, int delHandle) - { - try - { - var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemActionSystemSingleInvokeDelegate))] - static void SystemActionSystemSingleInvoke(int thisHandle, float obj) - { - try - { - ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(obj); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemActionSystemSingleConstructorDelegate))] - static void SystemActionSystemSingleConstructor(int cppHandle, ref int handle, ref int classHandle) - { - try - { - var thiz = new SystemActionSystemSingle(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseSystemActionSystemSingleDelegate))] - static void ReleaseSystemActionSystemSingle(int handle, int classHandle) - { - try - { - if (classHandle != 0) - { - var thiz = (SystemActionSystemSingle)NativeScript.Bindings.ObjectStore.Remove(classHandle); - thiz.CppHandle = 0; - } - NativeScript.Bindings.ObjectStore.Remove(handle); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemActionSystemSingleAddDelegate))] - static void SystemActionSystemSingleAdd(int thisHandle, int delHandle) - { - try - { - var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemActionSystemSingleRemoveDelegate))] - static void SystemActionSystemSingleRemove(int thisHandle, int delHandle) - { - try - { - var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleInvokeDelegate))] - static void SystemActionSystemSingle_SystemSingleInvoke(int thisHandle, float arg1, float arg2) - { - try - { - ((System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleConstructorDelegate))] - static void SystemActionSystemSingle_SystemSingleConstructor(int cppHandle, ref int handle, ref int classHandle) - { - try - { - var thiz = new SystemActionSystemSingle_SystemSingle(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - } - catch (System.NullReferenceException ex) + catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(ReleaseSystemActionSystemSingle_SystemSingleDelegate))] - static void ReleaseSystemActionSystemSingle_SystemSingle(int handle, int classHandle) + [MonoPInvokeCallback(typeof(UnityEngineObjectPropertyGetNameDelegate))] + static int UnityEngineObjectPropertyGetName(int thisHandle) { try { - if (classHandle != 0) - { - var thiz = (SystemActionSystemSingle_SystemSingle)NativeScript.Bindings.ObjectStore.Remove(classHandle); - thiz.CppHandle = 0; - } - NativeScript.Bindings.ObjectStore.Remove(handle); + var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.name; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleAddDelegate))] - static void SystemActionSystemSingle_SystemSingleAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnityEngineObjectPropertySetNameDelegate))] + static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) { try { - var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; + var thiz = (UnityEngine.Object)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var value = (string)NativeScript.Bindings.ObjectStore.Get(valueHandle); + thiz.name = value; } catch (System.NullReferenceException ex) { @@ -7926,126 +1051,59 @@ static void SystemActionSystemSingle_SystemSingleAdd(int thisHandle, int delHand } } - [MonoPInvokeCallback(typeof(SystemActionSystemSingle_SystemSingleRemoveDelegate))] - static void SystemActionSystemSingle_SystemSingleRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnityEngineComponentPropertyGetTransformDelegate))] + static int UnityEngineComponentPropertyGetTransform(int thisHandle) { try { - var thiz = (System.Action)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Action)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; + var thiz = (UnityEngine.Component)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleInvokeDelegate))] - static double SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(int thisHandle, int arg1, float arg2) + [MonoPInvokeCallback(typeof(UnityEngineTransformPropertyGetPositionDelegate))] + static UnityEngine.Vector3 UnityEngineTransformPropertyGetPosition(int thisHandle) { try { - var returnValue = ((System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); + var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.position; return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - return default(double); - } - } - - [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructorDelegate))] - static void SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(int cppHandle, ref int handle, ref int classHandle) - { - try - { - var thiz = new SystemFuncSystemInt32_SystemSingle_SystemDouble(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseSystemFuncSystemInt32_SystemSingle_SystemDoubleDelegate))] - static void ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(int handle, int classHandle) - { - try - { - if (classHandle != 0) - { - var thiz = (SystemFuncSystemInt32_SystemSingle_SystemDouble)NativeScript.Bindings.ObjectStore.Remove(classHandle); - thiz.CppHandle = 0; - } - NativeScript.Bindings.ObjectStore.Remove(handle); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleAddDelegate))] - static void SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(int thisHandle, int delHandle) - { - try - { - var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.Vector3); } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt32_SystemSingle_SystemDoubleRemoveDelegate))] - static void SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnityEngineTransformPropertySetPositionDelegate))] + static void UnityEngineTransformPropertySetPosition(int thisHandle, ref UnityEngine.Vector3 value) { try { - var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; + var thiz = (UnityEngine.Transform)NativeScript.Bindings.ObjectStore.Get(thisHandle); + thiz.position = value; } catch (System.NullReferenceException ex) { @@ -8059,12 +1117,13 @@ static void SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(int thisHandle } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringInvokeDelegate))] - static int SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(int thisHandle, short arg1, int arg2) + [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorPropertyGetCurrentDelegate))] + static int SystemCollectionsIEnumeratorPropertyGetCurrent(int thisHandle) { try { - var returnValue = ((System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg1, arg2); + var thiz = (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.Current; return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) @@ -8081,172 +1140,81 @@ static int SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(int thisHandle, } } - [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringConstructorDelegate))] - static void SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(int cppHandle, ref int handle, ref int classHandle) - { - try - { - var thiz = new SystemFuncSystemInt16_SystemInt32_SystemString(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); - } - } - - [MonoPInvokeCallback(typeof(ReleaseSystemFuncSystemInt16_SystemInt32_SystemStringDelegate))] - static void ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(int handle, int classHandle) - { - try - { - if (classHandle != 0) - { - var thiz = (SystemFuncSystemInt16_SystemInt32_SystemString)NativeScript.Bindings.ObjectStore.Remove(classHandle); - thiz.CppHandle = 0; - } - NativeScript.Bindings.ObjectStore.Remove(handle); - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringAddDelegate))] - static void SystemFuncSystemInt16_SystemInt32_SystemStringAdd(int thisHandle, int delHandle) - { - try - { - var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemFuncSystemInt16_SystemInt32_SystemStringRemoveDelegate))] - static void SystemFuncSystemInt16_SystemInt32_SystemStringRemove(int thisHandle, int delHandle) - { - try - { - var thiz = (System.Func)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.Func)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; - } - catch (System.NullReferenceException ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - catch (System.Exception ex) - { - UnityEngine.Debug.LogException(ex); - NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - } - } - - [MonoPInvokeCallback(typeof(SystemAppDomainInitializerInvokeDelegate))] - static void SystemAppDomainInitializerInvoke(int thisHandle, int argsHandle) + [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorMethodMoveNextDelegate))] + static bool SystemCollectionsIEnumeratorMethodMoveNext(int thisHandle) { try { - var args = (string[])NativeScript.Bindings.ObjectStore.Get(argsHandle); - ((System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle))(args); + var thiz = (System.Collections.IEnumerator)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.MoveNext(); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); } } - [MonoPInvokeCallback(typeof(SystemAppDomainInitializerConstructorDelegate))] - static void SystemAppDomainInitializerConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameBaseBallScriptDelegate))] + static int UnityEngineGameObjectMethodAddComponentMyGameBaseBallScript(int thisHandle) { try { - var thiz = new SystemAppDomainInitializer(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var thiz = (UnityEngine.GameObject)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.AddComponent(); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemAppDomainInitializerDelegate))] - static void ReleaseSystemAppDomainInitializer(int handle, int classHandle) + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate))] + static int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(UnityEngine.PrimitiveType type) { try { - if (classHandle != 0) - { - var thiz = (SystemAppDomainInitializer)NativeScript.Bindings.ObjectStore.Remove(classHandle); - thiz.CppHandle = 0; - } - NativeScript.Bindings.ObjectStore.Remove(handle); + var returnValue = UnityEngine.GameObject.CreatePrimitive(type); + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemAppDomainInitializerAddDelegate))] - static void SystemAppDomainInitializerAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnityEngineDebugMethodLogSystemObjectDelegate))] + static void UnityEngineDebugMethodLogSystemObject(int messageHandle) { try { - var thiz = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; + var message = NativeScript.Bindings.ObjectStore.Get(messageHandle); + UnityEngine.Debug.Log(message); } catch (System.NullReferenceException ex) { @@ -8260,143 +1228,152 @@ static void SystemAppDomainInitializerAdd(int thisHandle, int delHandle) } } - [MonoPInvokeCallback(typeof(SystemAppDomainInitializerRemoveDelegate))] - static void SystemAppDomainInitializerRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnityEngineMonoBehaviourPropertyGetTransformDelegate))] + static int UnityEngineMonoBehaviourPropertyGetTransform(int thisHandle) { try { - var thiz = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.AppDomainInitializer)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; + var thiz = (UnityEngine.MonoBehaviour)NativeScript.Bindings.ObjectStore.Get(thisHandle); + var returnValue = thiz.transform; + return NativeScript.Bindings.ObjectStore.GetHandle(returnValue); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionInvokeDelegate))] - static void UnityEngineEventsUnityActionInvoke(int thisHandle) + [MonoPInvokeCallback(typeof(SystemExceptionConstructorSystemStringDelegate))] + static int SystemExceptionConstructorSystemString(int messageHandle) { try { - ((UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle))(); + var message = (string)NativeScript.Bindings.ObjectStore.Get(messageHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store(new System.Exception(message)); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionConstructorDelegate))] - static void UnityEngineEventsUnityActionConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(BoxPrimitiveTypeDelegate))] + static int BoxPrimitiveType(UnityEngine.PrimitiveType val) { try { - var thiz = new UnityEngineEventsUnityAction(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseUnityEngineEventsUnityActionDelegate))] - static void ReleaseUnityEngineEventsUnityAction(int handle, int classHandle) + [MonoPInvokeCallback(typeof(UnboxPrimitiveTypeDelegate))] + static UnityEngine.PrimitiveType UnboxPrimitiveType(int valHandle) { try { - if (classHandle != 0) - { - var thiz = (UnityEngineEventsUnityAction)NativeScript.Bindings.ObjectStore.Remove(classHandle); - thiz.CppHandle = 0; - } - NativeScript.Bindings.ObjectStore.Remove(handle); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (UnityEngine.PrimitiveType)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.PrimitiveType); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(UnityEngine.PrimitiveType); } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionAddDelegate))] - static void UnityEngineEventsUnityActionAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnityEngineTimePropertyGetDeltaTimeDelegate))] + static float UnityEngineTimePropertyGetDeltaTime() { try { - var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; + var returnValue = UnityEngine.Time.deltaTime; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionRemoveDelegate))] - static void UnityEngineEventsUnityActionRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(BaseBallScriptConstructorDelegate))] + static void BaseBallScriptConstructor(int cppHandle, ref int handle) { try { - var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; + var thiz = new MyGame.BaseBallScript(cppHandle); + handle = NativeScript.Bindings.ObjectStore.Store(thiz); } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + handle = default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvokeDelegate))] - static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(int thisHandle, int arg0Handle, UnityEngine.SceneManagement.LoadSceneMode arg1) + [MonoPInvokeCallback(typeof(ReleaseBaseBallScriptDelegate))] + static void ReleaseBaseBallScript(int handle) { try { - var arg0 = (UnityEngine.SceneManagement.Scene)NativeScript.Bindings.StructStore.Get(arg0Handle); - ((UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle))(arg0, arg1); + MyGame.BaseBallScript thiz; + thiz = (MyGame.BaseBallScript)ObjectStore.Get(handle); + int cppHandle = thiz.CppHandle; + thiz.CppHandle = 0; + QueueDestroy(DestroyFunction.BaseBallScript, cppHandle); + ObjectStore.Remove(handle); } catch (System.NullReferenceException ex) { @@ -8410,623 +1387,583 @@ static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEng } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructorDelegate))] - static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(BoxBooleanDelegate))] + static int BoxBoolean(bool val) { try { - var thiz = new UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeDelegate))] - static void ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int handle, int classHandle) + [MonoPInvokeCallback(typeof(UnboxBooleanDelegate))] + static bool UnboxBoolean(int valHandle) { try { - if (classHandle != 0) - { - var thiz = (UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode)NativeScript.Bindings.ObjectStore.Remove(classHandle); - thiz.CppHandle = 0; - } - NativeScript.Bindings.ObjectStore.Remove(handle); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (bool)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(bool); } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAddDelegate))] - static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(BoxSByteDelegate))] + static int BoxSByte(sbyte val) { try { - var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemoveDelegate))] - static void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnboxSByteDelegate))] + static sbyte UnboxSByte(int valHandle) { try { - var thiz = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (UnityEngine.Events.UnityAction)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (sbyte)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(sbyte); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(sbyte); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentEventHandlerInvokeDelegate))] - static void SystemComponentModelDesignComponentEventHandlerInvoke(int thisHandle, int senderHandle, int eHandle) + [MonoPInvokeCallback(typeof(BoxByteDelegate))] + static int BoxByte(byte val) { try { - var sender = NativeScript.Bindings.ObjectStore.Get(senderHandle); - var e = (System.ComponentModel.Design.ComponentEventArgs)NativeScript.Bindings.ObjectStore.Get(eHandle); - ((System.ComponentModel.Design.ComponentEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle))(sender, e); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentEventHandlerConstructorDelegate))] - static void SystemComponentModelDesignComponentEventHandlerConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(UnboxByteDelegate))] + static byte UnboxByte(int valHandle) { try { - var thiz = new SystemComponentModelDesignComponentEventHandler(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (byte)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(byte); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(byte); } } - [MonoPInvokeCallback(typeof(ReleaseSystemComponentModelDesignComponentEventHandlerDelegate))] - static void ReleaseSystemComponentModelDesignComponentEventHandler(int handle, int classHandle) + [MonoPInvokeCallback(typeof(BoxInt16Delegate))] + static int BoxInt16(short val) { try { - if (classHandle != 0) - { - var thiz = (SystemComponentModelDesignComponentEventHandler)NativeScript.Bindings.ObjectStore.Remove(classHandle); - thiz.CppHandle = 0; - } - NativeScript.Bindings.ObjectStore.Remove(handle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentEventHandlerAddDelegate))] - static void SystemComponentModelDesignComponentEventHandlerAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnboxInt16Delegate))] + static short UnboxInt16(int valHandle) { try { - var thiz = (System.ComponentModel.Design.ComponentEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.ComponentModel.Design.ComponentEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (short)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(short); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(short); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentEventHandlerRemoveDelegate))] - static void SystemComponentModelDesignComponentEventHandlerRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(BoxUInt16Delegate))] + static int BoxUInt16(ushort val) { try { - var thiz = (System.ComponentModel.Design.ComponentEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.ComponentModel.Design.ComponentEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangingEventHandlerInvokeDelegate))] - static void SystemComponentModelDesignComponentChangingEventHandlerInvoke(int thisHandle, int senderHandle, int eHandle) + [MonoPInvokeCallback(typeof(UnboxUInt16Delegate))] + static ushort UnboxUInt16(int valHandle) { try { - var sender = NativeScript.Bindings.ObjectStore.Get(senderHandle); - var e = (System.ComponentModel.Design.ComponentChangingEventArgs)NativeScript.Bindings.ObjectStore.Get(eHandle); - ((System.ComponentModel.Design.ComponentChangingEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle))(sender, e); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (ushort)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(ushort); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(ushort); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangingEventHandlerConstructorDelegate))] - static void SystemComponentModelDesignComponentChangingEventHandlerConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(BoxInt32Delegate))] + static int BoxInt32(int val) { try { - var thiz = new SystemComponentModelDesignComponentChangingEventHandler(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemComponentModelDesignComponentChangingEventHandlerDelegate))] - static void ReleaseSystemComponentModelDesignComponentChangingEventHandler(int handle, int classHandle) + [MonoPInvokeCallback(typeof(UnboxInt32Delegate))] + static int UnboxInt32(int valHandle) { try { - if (classHandle != 0) - { - var thiz = (SystemComponentModelDesignComponentChangingEventHandler)NativeScript.Bindings.ObjectStore.Remove(classHandle); - thiz.CppHandle = 0; - } - NativeScript.Bindings.ObjectStore.Remove(handle); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (int)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangingEventHandlerAddDelegate))] - static void SystemComponentModelDesignComponentChangingEventHandlerAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(BoxUInt32Delegate))] + static int BoxUInt32(uint val) { try { - var thiz = (System.ComponentModel.Design.ComponentChangingEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.ComponentModel.Design.ComponentChangingEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangingEventHandlerRemoveDelegate))] - static void SystemComponentModelDesignComponentChangingEventHandlerRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnboxUInt32Delegate))] + static uint UnboxUInt32(int valHandle) { try { - var thiz = (System.ComponentModel.Design.ComponentChangingEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.ComponentModel.Design.ComponentChangingEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (uint)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(uint); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(uint); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangedEventHandlerInvokeDelegate))] - static void SystemComponentModelDesignComponentChangedEventHandlerInvoke(int thisHandle, int senderHandle, int eHandle) + [MonoPInvokeCallback(typeof(BoxInt64Delegate))] + static int BoxInt64(long val) { try { - var sender = NativeScript.Bindings.ObjectStore.Get(senderHandle); - var e = (System.ComponentModel.Design.ComponentChangedEventArgs)NativeScript.Bindings.ObjectStore.Get(eHandle); - ((System.ComponentModel.Design.ComponentChangedEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle))(sender, e); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangedEventHandlerConstructorDelegate))] - static void SystemComponentModelDesignComponentChangedEventHandlerConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(UnboxInt64Delegate))] + static long UnboxInt64(int valHandle) { try { - var thiz = new SystemComponentModelDesignComponentChangedEventHandler(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (long)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(long); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(long); } } - [MonoPInvokeCallback(typeof(ReleaseSystemComponentModelDesignComponentChangedEventHandlerDelegate))] - static void ReleaseSystemComponentModelDesignComponentChangedEventHandler(int handle, int classHandle) + [MonoPInvokeCallback(typeof(BoxUInt64Delegate))] + static int BoxUInt64(ulong val) { try { - if (classHandle != 0) - { - var thiz = (SystemComponentModelDesignComponentChangedEventHandler)NativeScript.Bindings.ObjectStore.Remove(classHandle); - thiz.CppHandle = 0; - } - NativeScript.Bindings.ObjectStore.Remove(handle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangedEventHandlerAddDelegate))] - static void SystemComponentModelDesignComponentChangedEventHandlerAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnboxUInt64Delegate))] + static ulong UnboxUInt64(int valHandle) { try { - var thiz = (System.ComponentModel.Design.ComponentChangedEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.ComponentModel.Design.ComponentChangedEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (ulong)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(ulong); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(ulong); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentChangedEventHandlerRemoveDelegate))] - static void SystemComponentModelDesignComponentChangedEventHandlerRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(BoxCharDelegate))] + static int BoxChar(char val) { try { - var thiz = (System.ComponentModel.Design.ComponentChangedEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.ComponentModel.Design.ComponentChangedEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentRenameEventHandlerInvokeDelegate))] - static void SystemComponentModelDesignComponentRenameEventHandlerInvoke(int thisHandle, int senderHandle, int eHandle) + [MonoPInvokeCallback(typeof(UnboxCharDelegate))] + static char UnboxChar(int valHandle) { try { - var sender = NativeScript.Bindings.ObjectStore.Get(senderHandle); - var e = (System.ComponentModel.Design.ComponentRenameEventArgs)NativeScript.Bindings.ObjectStore.Get(eHandle); - ((System.ComponentModel.Design.ComponentRenameEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle))(sender, e); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (char)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(char); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(char); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentRenameEventHandlerConstructorDelegate))] - static void SystemComponentModelDesignComponentRenameEventHandlerConstructor(int cppHandle, ref int handle, ref int classHandle) + [MonoPInvokeCallback(typeof(BoxSingleDelegate))] + static int BoxSingle(float val) { try { - var thiz = new SystemComponentModelDesignComponentRenameEventHandler(cppHandle); - handle = NativeScript.Bindings.ObjectStore.Store(thiz); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); - handle = default(int); - classHandle = default(int); + return default(int); } } - [MonoPInvokeCallback(typeof(ReleaseSystemComponentModelDesignComponentRenameEventHandlerDelegate))] - static void ReleaseSystemComponentModelDesignComponentRenameEventHandler(int handle, int classHandle) + [MonoPInvokeCallback(typeof(UnboxSingleDelegate))] + static float UnboxSingle(int valHandle) { try { - if (classHandle != 0) - { - var thiz = (SystemComponentModelDesignComponentRenameEventHandler)NativeScript.Bindings.ObjectStore.Remove(classHandle); - thiz.CppHandle = 0; - } - NativeScript.Bindings.ObjectStore.Remove(handle); + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (float)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(float); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentRenameEventHandlerAddDelegate))] - static void SystemComponentModelDesignComponentRenameEventHandlerAdd(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(BoxDoubleDelegate))] + static int BoxDouble(double val) { try { - var thiz = (System.ComponentModel.Design.ComponentRenameEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.ComponentModel.Design.ComponentRenameEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz += del; + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); } } - [MonoPInvokeCallback(typeof(SystemComponentModelDesignComponentRenameEventHandlerRemoveDelegate))] - static void SystemComponentModelDesignComponentRenameEventHandlerRemove(int thisHandle, int delHandle) + [MonoPInvokeCallback(typeof(UnboxDoubleDelegate))] + static double UnboxDouble(int valHandle) { try { - var thiz = (System.ComponentModel.Design.ComponentRenameEventHandler)NativeScript.Bindings.ObjectStore.Get(thisHandle); - var del = (System.ComponentModel.Design.ComponentRenameEventHandler)NativeScript.Bindings.ObjectStore.Get(delHandle); - thiz -= del; + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = (double)val; + return returnValue; } catch (System.NullReferenceException ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(double); } catch (System.Exception ex) { UnityEngine.Debug.LogException(ex); NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(double); } } /*END FUNCTIONS*/ } } -/*BEGIN MONOBEHAVIOURS*/ +/*BEGIN BASE TYPES*/ namespace MyGame { - namespace MonoBehaviours + class BaseBallScript : MyGame.AbstractBaseBallScript { - public class TestScript : UnityEngine.MonoBehaviour + public int CppHandle; + + public BaseBallScript() { - public void Awake() - { - int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); - NativeScript.Bindings.MyGameMonoBehavioursTestScriptAwake(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - - public void OnAnimatorIK(int param0) - { - int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); - NativeScript.Bindings.MyGameMonoBehavioursTestScriptOnAnimatorIK(thisHandle, param0); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - - public void OnCollisionEnter(UnityEngine.Collision param0) - { - int param0Handle = NativeScript.Bindings.ObjectStore.GetHandle(param0); - int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); - NativeScript.Bindings.MyGameMonoBehavioursTestScriptOnCollisionEnter(thisHandle, param0Handle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } - - public void Update() - { - int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); - NativeScript.Bindings.MyGameMonoBehavioursTestScriptUpdate(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } - } + int handle = NativeScript.Bindings.ObjectStore.Store(this); + CppHandle = NativeScript.Bindings.NewBaseBallScript(handle); } - } -} -namespace MyGame -{ - namespace MonoBehaviours - { - public class AnotherScript : UnityEngine.MonoBehaviour + + ~BaseBallScript() { - public void Awake() + if (CppHandle != 0) { - int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); - NativeScript.Bindings.MyGameMonoBehavioursAnotherScriptAwake(thisHandle); - if (NativeScript.Bindings.UnhandledCppException != null) - { - Exception ex = NativeScript.Bindings.UnhandledCppException; - NativeScript.Bindings.UnhandledCppException = null; - throw ex; - } + NativeScript.Bindings.QueueDestroy(NativeScript.Bindings.DestroyFunction.BaseBallScript, CppHandle); + CppHandle = 0; } - - public void Update() + } + + public BaseBallScript(int cppHandle) + : base() + { + CppHandle = cppHandle; + } + + public override void Update() + { + if (CppHandle != 0) { - int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this); - NativeScript.Bindings.MyGameMonoBehavioursAnotherScriptUpdate(thisHandle); + int thisHandle = CppHandle; + NativeScript.Bindings.MyGameAbstractBaseBallScriptUpdate(thisHandle); if (NativeScript.Bindings.UnhandledCppException != null) { Exception ex = NativeScript.Bindings.UnhandledCppException; @@ -9035,6 +1972,7 @@ public void Update() } } } + } } -/*END MONOBEHAVIOURS*/ \ No newline at end of file +/*END BASE TYPES*/ \ No newline at end of file diff --git a/Unity/Assets/NativeScript/BootScript.cs b/Unity/Assets/NativeScript/BootScript.cs index 7ca6ee0..1fe063f 100644 --- a/Unity/Assets/NativeScript/BootScript.cs +++ b/Unity/Assets/NativeScript/BootScript.cs @@ -39,6 +39,8 @@ void Awake() #if UNITY_EDITOR void Update() { + Bindings.Update(); + if (AutoReload) { if (AutoReloadPollTime > 0) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 49283b8..42d933e 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -12,8 +12,7 @@ namespace NativeScript { /// /// Code generator that reads a JSON file and outputs C# and C++ code - /// bindings so C++ can call managed functions and MonoBehaviour "messages" - /// like Update() can call their C++ counterparts. + /// bindings so the languages can call each other. /// /// /// Jackson Dunstan, 2017, http://JacksonDunstan.com @@ -98,6 +97,8 @@ class JsonType [Serializable] class JsonBaseType { + public string BaseName; + public string DerivedName; public string[] GenericTypes; public int MaxSimultaneous; public JsonConstructor[] Constructors; @@ -106,13 +107,6 @@ class JsonBaseType public JsonEvent[] OverrideEvents; } - [Serializable] - class JsonMonoBehaviour - { - public string Name; - public string[] Messages; - } - [Serializable] class JsonArray { @@ -135,7 +129,6 @@ class JsonDocument public int DefaultMaxSimultaneous; public string[] Assemblies; public JsonType[] Types; - public JsonMonoBehaviour[] MonoBehaviours; public JsonArray[] Arrays; public JsonDelegate[] Delegates; } @@ -156,14 +149,16 @@ class StringBuilders new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CsharpFunctions = new StringBuilder(InitialStringBuilderCapacity); - public readonly StringBuilder CsharpMonoBehaviours = - new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CsharpDelegates = new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CsharpImports = new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CsharpGetDelegateCalls = new StringBuilder(InitialStringBuilderCapacity); + public readonly StringBuilder CsharpDestroyFunctionEnumerators = + new StringBuilder(InitialStringBuilderCapacity); + public readonly StringBuilder CsharpDestroyQueueCases = + new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppFunctionPointers = new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppTypeDeclarations = @@ -182,14 +177,14 @@ class StringBuilders new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppInitBodyFirstBoot = new StringBuilder(InitialStringBuilderCapacity); - public readonly StringBuilder CppMonoBehaviourMessages = - new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppGlobalStateAndFunctions = new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppUnboxingMethodDeclarations = new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppStringDefaultParams = new StringBuilder(InitialStringBuilderCapacity); + public readonly StringBuilder CppMacros = + new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder TempStrBuilder = new StringBuilder(InitialStringBuilderCapacity); } @@ -252,92 +247,11 @@ int IComparer.Compare(object x, object y) : 0; } } - - class MessageInfo - { - public readonly string Name; - public readonly Type[] ParameterTypes; - public bool Selected; - - public MessageInfo( - string name, - params Type[] parameterTypes) - { - Name = name; - ParameterTypes = parameterTypes; - } - } - + const int DEFAULT_MAX_SIMULTANEOUS = 1000; const int DEFAULT_MAX_SIMULTANEOUS_OBJECTS = 1000; - - static readonly MessageInfo[] messageInfos = new[] { - new MessageInfo("Awake"), - new MessageInfo("FixedUpdate"), - new MessageInfo("LateUpdate"), - new MessageInfo("OnAnimatorIK", typeof(int)), - new MessageInfo("OnAnimatorMove"), - new MessageInfo("OnApplicationFocus", typeof(bool)), - new MessageInfo("OnApplicationPause", typeof(bool)), - new MessageInfo("OnApplicationQuit"), - new MessageInfo("OnAudioFilterRead", typeof(float[]), typeof(int)), - new MessageInfo("OnBecameInvisible"), - new MessageInfo("OnBecameVisible"), - new MessageInfo("OnCollisionEnter", typeof(Collision)), - new MessageInfo("OnCollisionEnter2D", typeof(Collision2D)), - new MessageInfo("OnCollisionExit", typeof(Collision)), - new MessageInfo("OnCollisionExit2D", typeof(Collision2D)), - new MessageInfo("OnCollisionStay", typeof(Collision)), - new MessageInfo("OnCollisionStay2D", typeof(Collision2D)), - new MessageInfo("OnConnectedToServer"), - new MessageInfo("OnControllerColliderHit", typeof(ControllerColliderHit)), - new MessageInfo("OnDestroy"), - new MessageInfo("OnDisable"), - new MessageInfo("OnDisconnectedFromServer", typeof(NetworkDisconnection)), - new MessageInfo("OnDrawGizmos"), - new MessageInfo("OnDrawGizmosSelected"), - new MessageInfo("OnEnable"), - new MessageInfo("OnFailedToConnect", typeof(NetworkConnectionError)), - new MessageInfo("OnFailedToConnectToMasterServer", typeof(NetworkConnectionError)), - new MessageInfo("OnGUI"), - new MessageInfo("OnJointBreak", typeof(float)), - new MessageInfo("OnJointBreak2D", typeof(Joint2D)), - new MessageInfo("OnMasterServerEvent", typeof(MasterServerEvent)), - new MessageInfo("OnMouseDown"), - new MessageInfo("OnMouseDrag"), - new MessageInfo("OnMouseEnter"), - new MessageInfo("OnMouseExit"), - new MessageInfo("OnMouseOver"), - new MessageInfo("OnMouseUp"), - new MessageInfo("OnMouseUpAsButton"), - new MessageInfo("OnNetworkInstantiate", typeof(NetworkMessageInfo)), - new MessageInfo("OnParticleCollision", typeof(GameObject)), - new MessageInfo("OnParticleTrigger"), - new MessageInfo("OnPlayerConnected", typeof(NetworkPlayer)), - new MessageInfo("OnPlayerDisconnected", typeof(NetworkPlayer)), - new MessageInfo("OnPostRender"), - new MessageInfo("OnPreCull"), - new MessageInfo("OnPreRender"), - new MessageInfo("OnRenderImage", typeof(RenderTexture), typeof(RenderTexture)), - new MessageInfo("OnRenderObject"), - new MessageInfo("OnSerializeNetworkView", typeof(BitStream), typeof(NetworkMessageInfo)), - new MessageInfo("OnServerInitialized"), - new MessageInfo("OnTransformChildrenChanged"), - new MessageInfo("OnTransformParentChanged"), - new MessageInfo("OnTriggerEnter", typeof(Collider)), - new MessageInfo("OnTriggerEnter2D", typeof(Collider2D)), - new MessageInfo("OnTriggerExit", typeof(Collider)), - new MessageInfo("OnTriggerExit2D", typeof(Collider2D)), - new MessageInfo("OnTriggerStay", typeof(Collider)), - new MessageInfo("OnTriggerStay2D", typeof(Collider2D)), - new MessageInfo("OnValidate"), - new MessageInfo("OnWillRenderObject"), - new MessageInfo("Reset"), - new MessageInfo("Start"), - new MessageInfo("Update"), - }; - - private static readonly Type[] PRIMITIVE_TYPES = { + + static readonly Type[] PRIMITIVE_TYPES = { typeof(bool), typeof(sbyte), typeof(byte), @@ -397,28 +311,26 @@ public static void Generate() // Determine whether we need to generate stubs // We can skip this step if we've already generated all the - // required MonoBehaviour classes and their messages + // required base types bool needStubs = false; - foreach (JsonMonoBehaviour monoBehaviour in doc.MonoBehaviours) + if (doc.Types != null) { - // Check if the MonoBehaviour type is already generated - Type type = TryGetType( - monoBehaviour.Name, - assemblies); - if (type == null) - { - needStubs = true; - break; - } - - // Check if all the messages are already generated - foreach (string message in monoBehaviour.Messages) + foreach (JsonType jsonType in doc.Types) { - MethodInfo methodInfo = type.GetMethod(message); - if (methodInfo == null) + if (jsonType.BaseTypes != null) { - needStubs = true; - goto determinedNeedStubs; + foreach (JsonBaseType jsonBaseType in jsonType.BaseTypes) + { + // Check if the type is already generated + Type type = TryGetType( + jsonBaseType.BaseName, + assemblies); + if (type == null) + { + needStubs = true; + goto determinedNeedStubs; + } + } } } } @@ -427,27 +339,19 @@ public static void Generate() if (needStubs) { // We'll need to be able to get these via reflection later - StringBuilder csharpMonoBehaviours = new StringBuilder( - InitialStringBuilderCapacity); + StringBuilders builders = new StringBuilders(); string timestamp = DateTime.Now.ToLongTimeString(); - AppendStubMonoBehaviours( - doc.MonoBehaviours, + AppendStubs( + doc.Types, + assemblies, timestamp, - csharpMonoBehaviours); - - // Inject - string csharpContents = File.ReadAllText(CsharpPath); - csharpContents = InjectIntoString( - csharpContents, - "/*BEGIN MONOBEHAVIOURS*/\n", - "\n/*END MONOBEHAVIOURS*/", - csharpMonoBehaviours.ToString()); - File.WriteAllText(CsharpPath, csharpContents); + builders); + InjectBuilders(builders); // Compile and continue after scripts are refreshed Debug.Log("Waiting for compile..."); - AssetDatabase.Refresh(); EditorPrefs.SetBool(PostCompileWorkPref, true); + AssetDatabase.Refresh(); } else { @@ -455,52 +359,137 @@ public static void Generate() } } - static void AppendStubMonoBehaviours( - JsonMonoBehaviour[] monoBehaviours, + static void AppendStubs( + JsonType[] jsonTypes, + Assembly[] assemblies, string timestamp, - StringBuilder output) + StringBuilders builders) { - if (monoBehaviours != null) + // Base types + foreach (JsonType jsonType in jsonTypes) { - foreach (JsonMonoBehaviour jsonMonoBehaviour in monoBehaviours) + if (jsonType.BaseTypes != null) { - // Split namespace from name - string fullName = jsonMonoBehaviour.Name; - string monoBehaviourName; - string monoBehaviourNamespace; - int index = fullName.LastIndexOf('.'); - if (index >= 0) + foreach (JsonBaseType jsonBaseType in jsonType.BaseTypes) { - monoBehaviourNamespace = fullName.Substring( - 0, - index); - monoBehaviourName = fullName.Substring( - index + 1); + string typeFullName = jsonType.Name; + string typeName; + string typeNamespace; + SplitJsonTypeName( + typeFullName, + out typeName, + out typeNamespace); + + string baseTypeFullName = jsonBaseType.BaseName; + string baseTypeName; + string baseTypeNamespace; + SplitJsonTypeName( + baseTypeFullName, + out baseTypeName, + out baseTypeNamespace); + + Type type = GetType(typeFullName, assemblies); + + Type[] typeParams = GetTypes( + jsonBaseType.GenericTypes, + assemblies); + + AppendStubBaseType( + typeFullName, + typeName, + typeNamespace, + baseTypeFullName, + baseTypeName, + baseTypeNamespace, + typeParams, + type, + timestamp, + builders.CsharpBaseTypes); } - else + } + } + + // Need at least one init param + builders.CsharpInitParams.Append("object stub"); + builders.CsharpInitCall.Append("null // stub"); + } + + static void AppendStubBaseType( + string typeFullName, + string typeName, + string typeNamespace, + string baseTypeFullName, + string baseTypeName, + string baseTypeNamespace, + Type[] typeParams, + Type type, + string timestamp, + StringBuilder output) + { + int indent = AppendNamespaceBeginning( + baseTypeNamespace, + output); + AppendIndent(indent, output); + if (type.IsClass) + { + output.Append("abstract public class "); + } + else + { + output.Append("public interface "); + } + output.Append(baseTypeName); + output.Append(" : "); + AppendCsharpTypeName( + typeNamespace, + typeName, + output); + AppendCSharpTypeParameters( + typeParams, + output); + output.Append('\n'); + AppendIndent(indent, output); + output.Append("{\n"); + AppendIndent(indent + 1, output); + output.Append("// Stub version. GenerateBindings is still in progress. "); + output.Append(timestamp); + output.Append('\n'); + if (type.IsClass) + { + output.Append('\n'); + ConstructorInfo[] constructors = type.GetConstructors(); + if (constructors != null && constructors.Length > 0) + { + foreach (ConstructorInfo ctor in constructors) { - monoBehaviourName = fullName; - monoBehaviourNamespace = string.Empty; + if (ctor.IsPublic + && ctor.GetCustomAttributes(typeof(ObsoleteAttribute), true).Length == 0) + { + ParameterInfo[] ctorParams = ConvertParameters( + ctor.GetParameters()); + output.Append("\t\t"); + output.Append(baseTypeName); + output.Append('('); + AppendCsharpParams( + ctorParams, + output); + output.Append(")\n"); + output.Append("\t\t\t: base("); + AppendCsharpFunctionCallParameters( + ctorParams, + output); + output.Append(")\n"); + output.Append("\t\t{\n"); + output.Append("\t\t}\n"); + output.Append("\t\t\n"); + break; + } } - - int indent = AppendNamespaceBeginning( - monoBehaviourNamespace, - output); - AppendIndent(indent, output); - output.Append("public class "); - output.Append(monoBehaviourName); - output.Append(" : UnityEngine.MonoBehaviour\n"); - AppendIndent(indent, output); - output.Append("{\n"); - AppendIndent(indent + 1, output); - output.Append("// Stub version. GenerateBindings is still in progress. "); - output.Append(timestamp); - output.Append('\n'); - AppendIndent(indent, output); - output.Append("}\n"); - AppendNamespaceEnding(indent, output); } } + AppendIndent(indent, output); + output.Append("}\n"); + AppendNamespaceEnding(indent, output); } [UnityEditor.Callbacks.DidReloadScripts] @@ -524,21 +513,17 @@ static void DoPostCompileWork(bool canRefreshAssetDb) Assembly[] assemblies = GetAssemblies(doc.Assemblies); StringBuilders builders = new StringBuilders(); - // Count the number of ref-counts in C++ - // Start with 1 for Object + // Get the default number of maximum simultaneous objects in case + // it's not specified for a specific type int defaultMaxSimultaneous = doc.DefaultMaxSimultaneous != 0 ? doc.DefaultMaxSimultaneous : DEFAULT_MAX_SIMULTANEOUS; - int totalMaxSimultaneous = defaultMaxSimultaneous; // Init param for max managed Objects - int maxSimultaneousObjects = doc.MaxSimultaneousObjects != 0 - ? doc.MaxSimultaneousObjects - : DEFAULT_MAX_SIMULTANEOUS_OBJECTS; builders.CppInitParams.Append("\tint32_t maxManagedObjects,\n"); builders.CsharpInitParams.Append("\t\t\tint maxManagedObjects,\n"); builders.CsharpInitCall.Append("\t\t\t\t"); - builders.CsharpInitCall.Append(maxSimultaneousObjects); + builders.CsharpInitCall.Append(defaultMaxSimultaneous); builders.CsharpInitCall.Append(",\n"); // C# ObjectStore Init call @@ -554,7 +539,7 @@ static void DoPostCompileWork(bool canRefreshAssetDb) { Type type = GetType(jsonType.Name, assemblies); TypeKind typeKind = GetTypeKind(type); - totalMaxSimultaneous += AppendType( + AppendType( jsonType, type, typeKind, @@ -564,31 +549,22 @@ static void DoPostCompileWork(bool canRefreshAssetDb) if (jsonType.BaseTypes != null) { - // C++ template declaration if necessary Type[] genericArgTypes = type.GetGenericArguments(); - string cppBaseTypeName = "Base" + type.Name; - if (!IsStatic(type)) - { - foreach (JsonBaseType jsonBaseType in jsonType.BaseTypes) - { - if (jsonBaseType.GenericTypes != null) - { - AppendCppTemplateDeclaration( - cppBaseTypeName, - type.Namespace, - genericArgTypes.Length, - builders.CppTemplateDeclarations); - } - } - } - foreach (JsonBaseType jsonBaseType in jsonType.BaseTypes) { - AppendBaseType( + string baseTypeName; + string baseTypeNamespace; + GetBaseTypeBaseNameAndNamespace( + jsonBaseType, type, genericArgTypes, - jsonType.Name, - cppBaseTypeName, + builders.TempStrBuilder, + out baseTypeName, + out baseTypeNamespace); + AppendBaseType( + type, + baseTypeName, + baseTypeNamespace, jsonBaseType, assemblies, defaultMaxSimultaneous, @@ -617,18 +593,6 @@ static void DoPostCompileWork(bool canRefreshAssetDb) builders); } - // Generate MonoBehaviours - if (doc.MonoBehaviours != null) - { - foreach (JsonMonoBehaviour monoBehaviour in doc.MonoBehaviours) - { - AppendMonoBehaviour( - monoBehaviour, - assemblies, - builders); - } - } - // Generate arrays if (doc.Arrays != null) { @@ -641,6 +605,7 @@ static void DoPostCompileWork(bool canRefreshAssetDb) } } + // Generate delegates if (doc.Delegates != null) { foreach (JsonDelegate del in doc.Delegates) @@ -659,9 +624,11 @@ static void DoPostCompileWork(bool canRefreshAssetDb) assemblies, builders); + // Output source files RemoveTrailingChars(builders); - InjectBuilders(builders); + + // Inform the user of the result if (canRefreshAssetDb) { AssetDatabase.Refresh(); @@ -1000,6 +967,51 @@ static Type[] GetCppCtorInitTypes(Type type, bool includeSelf) } return types.ToArray(); } + + static void AppendCppConstructorInitializerList( + Type[] interfaceTypes, + int indent, + StringBuilder output, + string newline = "\n") + { + string separator = ": "; + for (int i = 0; i < interfaceTypes.Length; ++i) + { + Type interfaceType = interfaceTypes[i]; + AppendIndent( + indent, + output); + output.Append(separator); + AppendCppTypeName( + interfaceType, + output); + output.Append("(nullptr)"); + output.Append(newline); + separator = ", "; + } + } + + static void AppendUppercaseWithUnderscores( + string str, + StringBuilder output) + { + if (string.IsNullOrEmpty(str)) + { + return; + } + char prev = str[0]; + output.Append(char.ToUpper(prev)); + for (int i = 1; i < str.Length; ++i) + { + char cur = str[i]; + if (char.IsUpper(cur) && char.IsLower(prev)) + { + output.Append('_'); + } + output.Append(char.ToUpper(cur)); + prev = cur; + } + } static bool CheckParametersMatch( string[] paramTypeNames, @@ -1119,6 +1131,39 @@ static void AppendTypeNames( } } } + + static void GetBaseTypeBaseNameAndNamespace( + JsonBaseType jsonBaseType, + Type type, + Type[] typeParams, + StringBuilder tempStringBuilder, + out string baseTypeName, + out string baseTypeNamespace) + { + // Get specified (optional) base type name + SplitJsonTypeName( + jsonBaseType.BaseName, + out baseTypeName, + out baseTypeNamespace); + + // If base type name isn't provided, make one + if (string.IsNullOrEmpty(baseTypeName)) + { + tempStringBuilder.Length = 0; + AppendNamespace( + type.Namespace, + string.Empty, + tempStringBuilder); + tempStringBuilder.Append("Base"); + AppendTypeNameWithoutSuffixes( + type.Name, + tempStringBuilder); + AppendTypeNames( + typeParams, + tempStringBuilder); + baseTypeName = tempStringBuilder.ToString(); + } + } static void AppendNamespace( string namespaceName, @@ -1157,11 +1202,39 @@ static void AppendNamespace( namespaceName.Length - startIndex); } } + + static void SplitJsonTypeName( + string fullName, + out string typeName, + out string typeNamespace) + { + // No full name + if (string.IsNullOrEmpty(fullName)) + { + typeName = string.Empty; + typeNamespace = string.Empty; + } + else + { + // Has a namespace + int index = fullName.LastIndexOf('.'); + if (index >= 0) + { + typeNamespace = fullName.Substring(0, index); + typeName = fullName.Substring(index + 1); + } + // No namespace. Just name. + else + { + typeName = fullName; + typeNamespace = string.Empty; + } + } + } static ParameterInfo[] ConvertParameters( System.Reflection.ParameterInfo[] reflectionParameters, - int start = 0, - int count = -1) + int start = 0) { int num = reflectionParameters.Length - start; ParameterInfo[] parameters = new ParameterInfo[num]; @@ -1684,9 +1757,6 @@ static void AppendType( type.Namespace, typeKind, typeParams, - baseTypeName, - baseTypeNamespace, - baseTypeTypeParams, cppCtorInterfaceTypes, isStatic, (extraIndent, subject) => {}, @@ -1861,9 +1931,8 @@ static void AppendType( static void AppendBaseType( Type type, - Type[] genericArgTypes, - string typeName, string cppBaseTypeName, + string cppBaseTypeNamespace, JsonBaseType jsonBaseType, Assembly[] assemblies, int defaultMaxSimultaneous, @@ -1882,6 +1951,7 @@ static void AppendBaseType( genericType, jsonBaseType, cppBaseTypeName, + cppBaseTypeNamespace, typeParams, maxSimultaneous, assemblies, @@ -1893,6 +1963,7 @@ static void AppendBaseType( type, jsonBaseType, cppBaseTypeName, + cppBaseTypeNamespace, null, maxSimultaneous, assemblies, @@ -2214,8 +2285,6 @@ static void AppendBoxing( out boxMethodDefinitionName, out boxMethodDeclarationName); AppendCppBoxingMethodDeclaration( - baseType, - baseType.GetGenericArguments(), boxMethodDeclarationName, boxCppParams, indent + 1, @@ -2241,8 +2310,6 @@ static void AppendBoxing( out boxMethodDefinitionName, out boxMethodDeclarationName); AppendCppBoxingMethodDeclaration( - interfaceType, - interfaceType.GetGenericArguments(), boxMethodDeclarationName, boxCppParams, indent + 1, @@ -2489,7 +2556,6 @@ static void AppendUnboxing( false, false, null, - typeParams, null, unboxCppParams, builders.CppUnboxingMethodDeclarations); @@ -2578,8 +2644,6 @@ static void AppendCppBoxingMethodNames( } static void AppendCppBoxingMethodDeclaration( - Type type, - Type[] typeParams, string boxMethodDeclarationName, ParameterInfo[] boxCppParams, int indent, @@ -2594,7 +2658,6 @@ static void AppendCppBoxingMethodDeclaration( false, false, null, - typeParams, null, boxCppParams, output); @@ -2885,7 +2948,6 @@ static void AppendConstructor( false, false, null, - enclosingTypeParams, null, parameters, builders.CppTypeDefinitions); @@ -2902,19 +2964,10 @@ static void AppendConstructor( builders.CppMethodDefinitions); if (enclosingTypeKind != TypeKind.FullStruct) { - string separator = ": "; - foreach (Type interfaceType in interfaceTypes) - { - AppendIndent( - indent + 1, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(separator); - AppendCppTypeName( - interfaceType, - builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("(nullptr)\n"); - separator = ", "; - } + AppendCppConstructorInitializerList( + interfaceTypes, + indent + 1, + builders.CppMethodDefinitions); } AppendIndent( indent, @@ -3445,7 +3498,6 @@ static void AppendEventAddRemoveMethod( false, cppMethodIsStatic, cppReturnType, - typeTypeParams, null, cppParameters, builders.CppTypeDefinitions); @@ -4160,7 +4212,6 @@ static void AppendMethod( false, cppMethodIsStatic, cppReturnType, - enclosingTypeParams, methodTypeParams, cppParameters, builders.CppTypeDefinitions); @@ -4259,317 +4310,14 @@ static void AppendCppTypeParameters( output.Append('>'); } } - - static void AppendMonoBehaviour( - JsonMonoBehaviour jsonMonoBehaviour, - Assembly[] assemblies, - StringBuilders builders) - { - Type type = GetType( - jsonMonoBehaviour.Name, - assemblies); - - // C++ Type Declaration - int cppIndent = AppendCppTypeDeclaration( - type.Namespace, - type.Name, - false, - null, - builders.CppTypeDeclarations); - - // C++ Type Definition (begin) - AppendCppTypeDefinitionBegin( - type.Name, - type.Namespace, - TypeKind.Class, - null, - "MonoBehaviour", - "UnityEngine", - null, - null, - false, - cppIndent, - builders.CppTypeDefinitions); - - // C++ method definition - Type[] interfaceTypes = GetCppCtorInitTypes( - type, - false); - int cppMethodDefinitionsIndent = AppendCppMethodDefinitionsBegin( - type.Name, - type.Namespace, - TypeKind.Class, - null, - "MonoBehaviour", - "UnityEngine", - null, - interfaceTypes, - false, - (extraIndent, subject) => {}, - (extraIndent, subject) => {}, - cppIndent, - builders.CppMethodDefinitions); - AppendCppMethodDefinitionsEnd( - cppMethodDefinitionsIndent, - builders.CppMethodDefinitions); - - // C# Class extending MonoBehaviour - int csharpIndent = AppendNamespaceBeginning( - type.Namespace, - builders.CsharpMonoBehaviours); - AppendIndent(csharpIndent, builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("public class "); - builders.CsharpMonoBehaviours.Append(type.Name); - builders.CsharpMonoBehaviours.Append(" : UnityEngine.MonoBehaviour\n"); - AppendIndent(csharpIndent, builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("{\n"); - for ( - int messageIndex = 0; - messageIndex < jsonMonoBehaviour.Messages.Length; - ++messageIndex) - { - // Find the MessageInfo - string message = jsonMonoBehaviour.Messages[messageIndex]; - MessageInfo messageInfo = null; - foreach (MessageInfo mi in messageInfos) - { - if (mi.Name == message) - { - messageInfo = mi; - break; - } - } - if (messageInfo == null) - { - builders.TempStrBuilder.Length = 0; - builders.TempStrBuilder.Append("Unknown message '"); - builders.TempStrBuilder.Append(message); - builders.TempStrBuilder.Append("'. Aborting."); - throw new Exception(builders.TempStrBuilder.ToString()); - } - - // Build the C++ function name - builders.TempStrBuilder.Length = 0; - AppendNamespace( - type.Namespace, - string.Empty, - builders.TempStrBuilder); - builders.TempStrBuilder.Append(type.Name); - builders.TempStrBuilder.Append(messageInfo.Name); - string cppFunctionName = builders.TempStrBuilder.ToString(); - - // Build ParameterInfos - ParameterInfo[] parameters = ConvertParameters( - messageInfo.ParameterTypes); - int numParams = parameters.Length; - - // C++ Method Declaration - AppendIndent( - cppIndent + 1, - builders.CppTypeDefinitions); - AppendCppMethodDeclaration( - messageInfo.Name, - false, - false, - false, - typeof(void), - null, - null, - parameters, - builders.CppTypeDefinitions); - - // C# message function - AppendIndent( - csharpIndent + 1, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("public "); - AppendCsharpTypeName( - typeof(void), - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append(' '); - builders.CsharpMonoBehaviours.Append(messageInfo.Name); - builders.CsharpMonoBehaviours.Append('('); - for (int i = 0; i < numParams; ++i) - { - Type paramType = parameters[i].ParameterType; - AppendCsharpTypeName( - paramType, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append(' '); - builders.CsharpMonoBehaviours.Append("param"); - builders.CsharpMonoBehaviours.Append(i); - if (i != numParams - 1) - { - builders.CsharpMonoBehaviours.Append(", "); - } - } - builders.CsharpMonoBehaviours.Append(")\n"); - AppendIndent( - csharpIndent + 1, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("{\n"); - AppendCppFunctionCall( - cppFunctionName, - parameters, - typeof(void), - false, - csharpIndent + 2, - builders.CsharpMonoBehaviours); - AppendIndent( - csharpIndent + 1, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("}\n"); - if (messageIndex != jsonMonoBehaviour.Messages.Length - 1) - { - AppendIndent( - csharpIndent + 1, - builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append('\n'); - } - - // C# Delegate - AppendCsharpDelegate( - false, - type.Name, - type.Namespace, - null, - messageInfo.Name, - parameters, - typeof(void), - TypeKind.None, - builders.CsharpDelegates); - - // C# Import - AppendCsharpImport( - type.Name, - type.Namespace, - null, - messageInfo.Name, - parameters, - builders.CsharpImports); - - // C# GetDelegate Call - AppendCsharpGetDelegateCall( - type.Name, - type.Namespace, - null, - messageInfo.Name, - builders.CsharpGetDelegateCalls); - - // C++ Message - builders.CppMonoBehaviourMessages.Append("DLLEXPORT void "); - AppendCsharpDelegateName( - type.Name, - type.Namespace, - null, - messageInfo.Name, - builders.CppMonoBehaviourMessages); - builders.CppMonoBehaviourMessages.Append("(int32_t thisHandle"); - if (numParams > 0) - { - builders.CppMonoBehaviourMessages.Append(", "); - } - for (int i = 0; i < numParams; ++i) - { - ParameterInfo param = parameters[i]; - switch (param.Kind) - { - case TypeKind.FullStruct: - case TypeKind.Primitive: - case TypeKind.Enum: - AppendCppTypeName( - param.ParameterType, - builders.CppMonoBehaviourMessages); - builders.CppMonoBehaviourMessages.Append(" param"); - builders.CppMonoBehaviourMessages.Append(i); - break; - default: - builders.CppMonoBehaviourMessages.Append("int32_t param"); - builders.CppMonoBehaviourMessages.Append(i); - builders.CppMonoBehaviourMessages.Append("Handle"); - break; - } - if (i != numParams-1) - { - builders.CppMonoBehaviourMessages.Append(", "); - } - } - builders.CppMonoBehaviourMessages.Append(")\n{\n\t"); - AppendCppTypeName( - type, - builders.CppMonoBehaviourMessages); - builders.CppMonoBehaviourMessages.Append(" thiz(Plugin::InternalUse::Only, thisHandle);\n"); - for (int i = 0; i < numParams; ++i) - { - ParameterInfo param = parameters[i]; - if (param.Kind == TypeKind.Class - || param.Kind == TypeKind.ManagedStruct) - { - builders.CppMonoBehaviourMessages.Append('\t'); - AppendCppTypeName( - param.ParameterType, - builders.CppMonoBehaviourMessages); - builders.CppMonoBehaviourMessages.Append(" param"); - builders.CppMonoBehaviourMessages.Append(i); - builders.CppMonoBehaviourMessages.Append("(Plugin::InternalUse::Only, param"); - builders.CppMonoBehaviourMessages.Append(i); - builders.CppMonoBehaviourMessages.Append("Handle);\n"); - } - } - builders.CppMonoBehaviourMessages.Append("\ttry\n"); - builders.CppMonoBehaviourMessages.Append("\t{\n"); - builders.CppMonoBehaviourMessages.Append("\t\tthiz."); - builders.CppMonoBehaviourMessages.Append(messageInfo.Name); - builders.CppMonoBehaviourMessages.Append("("); - for (int i = 0; i < numParams; ++i) - { - builders.CppMonoBehaviourMessages.Append("param"); - builders.CppMonoBehaviourMessages.Append(i); - if (i != numParams-1) - { - builders.CppMonoBehaviourMessages.Append(", "); - } - } - builders.CppMonoBehaviourMessages.Append(");\n"); - builders.CppMonoBehaviourMessages.Append("\t}\n"); - builders.CppMonoBehaviourMessages.Append("\tcatch (System::Exception ex)\n"); - builders.CppMonoBehaviourMessages.Append("\t{\n"); - builders.CppMonoBehaviourMessages.Append("\t\tPlugin::SetException(ex.Handle);\n"); - builders.CppMonoBehaviourMessages.Append("\t}\n"); - builders.CppMonoBehaviourMessages.Append("\tcatch (...)\n"); - builders.CppMonoBehaviourMessages.Append("\t{\n"); - builders.CppMonoBehaviourMessages.Append("\t\tSystem::String msg = \"Unhandled exception in "); - AppendCppTypeName( - type, - builders.CppMonoBehaviourMessages); - builders.CppMonoBehaviourMessages.Append("::"); - builders.CppMonoBehaviourMessages.Append(messageInfo.Name); - builders.CppMonoBehaviourMessages.Append("\";\n"); - builders.CppMonoBehaviourMessages.Append("\t\tSystem::Exception ex(msg);\n"); - builders.CppMonoBehaviourMessages.Append("\t\tPlugin::SetException(ex.Handle);\n"); - builders.CppMonoBehaviourMessages.Append("\t}\n"); - builders.CppMonoBehaviourMessages.Append("}\n\n\n"); - } - - // C# Class extending MonoBehaviour (end) - AppendIndent(csharpIndent, builders.CsharpMonoBehaviours); - builders.CsharpMonoBehaviours.Append("}\n"); - AppendNamespaceEnding(csharpIndent, builders.CsharpMonoBehaviours); - - // C++ Type Definition (end) - AppendCppTypeDefinitionEnd( - false, - cppIndent, - builders.CppTypeDefinitions); - } - - static void AppendCppFunctionCall( - string funcName, - ParameterInfo[] parameters, - Type returnType, - bool enclosingTypeIsStatic, - int indent, - StringBuilder output) + + static void AppendCppFunctionCall( + string funcName, + ParameterInfo[] parameters, + Type returnType, + bool enclosingTypeIsStatic, + int indent, + StringBuilder output) { foreach (ParameterInfo param in parameters) { @@ -4798,9 +4546,6 @@ static void AppendArray( "System", TypeKind.Class, cppTypeParams, - "Array", - "System", - null, cppCtorInitTypes, false, (extraIndent, subject) => { @@ -5937,7 +5682,6 @@ static void AppendArrayConstructor( false, null, null, - null, parameters, builders.CppTypeDefinitions); @@ -6076,7 +5820,6 @@ static void AppendArrayCppGetLengthFunction( false, typeof(int), null, - null, parameters, builders.CppTypeDefinitions); @@ -6155,7 +5898,6 @@ static void AppendArrayCppGetRankFunction( false, typeof(int), null, - null, parameters, builders.CppTypeDefinitions); @@ -6303,7 +6045,6 @@ static void AppendArrayMultidimensionalGetLength( false, typeof(int), null, - null, parameters, builders.CppTypeDefinitions); @@ -6791,15 +6532,15 @@ static void AppendDelegate( Kind = TypeKind.Primitive }}; - AppendCppFreeListStateAndFunctions( - type, + AppendCppPointerFreeListStateAndFunctions( + type.Namespace, typeParams, cppTypeName, bindingTypeName, builders.CppGlobalStateAndFunctions); - AppendCppFreeListInit( - type, + AppendCppPointerFreeListInit( + type.Namespace, typeParams, cppTypeName, maxSimultaneous, @@ -6841,7 +6582,6 @@ static void AppendDelegate( false, false, null, - typeParams, null, new ParameterInfo[0], builders.CppTypeDefinitions); @@ -6854,7 +6594,6 @@ static void AppendDelegate( false, false, typeof(void), - typeParams, null, addRemoveParams, builders.CppTypeDefinitions); @@ -6867,7 +6606,6 @@ static void AppendDelegate( false, false, typeof(void), - typeParams, null, addRemoveParams, builders.CppTypeDefinitions); @@ -6997,13 +6735,10 @@ static void AppendDelegate( AppendCppBaseTypeConstructor( bindingTypeName, - type.Name, type.Namespace, TypeKind.Class, cppTypeName, - typeof(object), typeParams, - null, new Type[0], new ParameterInfo[0], constructorParams, @@ -7016,9 +6751,6 @@ static void AppendDelegate( bindingTypeName, cppTypeName, typeParams, - "Object", - "System", - null, new Type[0], true, cppMethodDefinitionsIndent, @@ -7028,9 +6760,6 @@ static void AppendDelegate( bindingTypeName, cppTypeName, typeParams, - "Object", - "System", - null, new Type[0], true, cppMethodDefinitionsIndent, @@ -7039,9 +6768,6 @@ static void AppendDelegate( AppendCppBaseTypeMoveConstructor( cppTypeName, typeParams, - "Object", - "System", - null, new Type[0], true, cppMethodDefinitionsIndent, @@ -7051,9 +6777,6 @@ static void AppendDelegate( bindingTypeName, cppTypeName, typeParams, - "Object", - "System", - null, new Type[0], true, cppMethodDefinitionsIndent, @@ -7064,7 +6787,10 @@ static void AppendDelegate( cppTypeName, typeParams, true, + string.Empty, + string.Empty, releaseFuncName, + bindingTypeName, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); @@ -7097,12 +6823,14 @@ static void AppendDelegate( cppTypeName, typeParams, cppMethodDefinitionsIndent, + true, builders.CppMethodDefinitions); AppendCppBaseTypeInequalityOperator( cppTypeName, typeParams, cppMethodDefinitionsIndent, + true, builders.CppMethodDefinitions); // C++ add @@ -7178,29 +6906,29 @@ static void AppendDelegate( builders.CsharpGetDelegateCalls); // C# class (beginning) - builders.CsharpBaseTypes.Append("\t\tclass "); + builders.CsharpBaseTypes.Append("class "); builders.CsharpBaseTypes.Append(bindingTypeName); builders.CsharpBaseTypes.Append('\n'); - builders.CsharpBaseTypes.Append("\t\t{\n"); + builders.CsharpBaseTypes.Append("{\n"); // C# class fields - builders.CsharpBaseTypes.Append("\t\t\tpublic int CppHandle;\n"); - builders.CsharpBaseTypes.Append("\t\t\tpublic "); + builders.CsharpBaseTypes.Append("\tpublic int CppHandle;\n"); + builders.CsharpBaseTypes.Append("\tpublic "); AppendCsharpTypeName( type, builders.CsharpBaseTypes); builders.CsharpBaseTypes.Append(" Delegate;\n"); - builders.CsharpBaseTypes.Append("\t\t\t\n"); + builders.CsharpBaseTypes.Append("\t\n"); // C# class constructor - builders.CsharpBaseTypes.Append("\t\t\tpublic "); + builders.CsharpBaseTypes.Append("\tpublic "); builders.CsharpBaseTypes.Append(bindingTypeName); builders.CsharpBaseTypes.Append("(int cppHandle)\n"); - builders.CsharpBaseTypes.Append("\t\t\t{\n"); - builders.CsharpBaseTypes.Append("\t\t\t\tCppHandle = cppHandle;\n"); - builders.CsharpBaseTypes.Append("\t\t\t\tDelegate = NativeInvoke;\n"); - builders.CsharpBaseTypes.Append("\t\t\t}\n"); - builders.CsharpBaseTypes.Append("\t\t\t\n"); + builders.CsharpBaseTypes.Append("\t{\n"); + builders.CsharpBaseTypes.Append("\t\tCppHandle = cppHandle;\n"); + builders.CsharpBaseTypes.Append("\t\tDelegate = NativeInvoke;\n"); + builders.CsharpBaseTypes.Append("\t}\n"); + builders.CsharpBaseTypes.Append("\t\n"); // Build the name of the C++ binding function that C# calls builders.TempStrBuilder.Length = 0; @@ -7223,12 +6951,13 @@ static void AppendDelegate( nativeInvokeFuncName, "operator()", false, + true, indent, builders); // C# class (ending) - builders.CsharpBaseTypes.Append("\t\t}\n"); - builders.CsharpBaseTypes.Append("\t\t\n"); + builders.CsharpBaseTypes.Append("}\n"); + builders.CsharpBaseTypes.Append('\n'); // Invoke() is how C++ invokes the delegate AppendBaseTypeMethodCallsCsharpMethod( @@ -7255,6 +6984,7 @@ static void AppendDelegate( AppendCsharpBaseTypeConstructorFunction( type, bindingTypeName, + string.Empty, false, constructorFuncName, constructorParams, @@ -7274,8 +7004,10 @@ static void AppendDelegate( AppendCsharpBaseTypeReleaseFunction( type, bindingTypeName, + string.Empty, true, releaseFuncName, + null, releaseParams, builders.CsharpFunctions); @@ -7350,35 +7082,34 @@ static void AppendDelegate( static void AppendBaseType( Type type, JsonBaseType jsonBaseType, - string cppBaseTypeName, + string baseTypeName, + string baseTypeNamespace, Type[] typeParams, int maxSimultaneous, Assembly[] assemblies, StringBuilders builders) { - builders.TempStrBuilder.Length = 0; - AppendNamespace( - type.Namespace, - string.Empty, - builders.TempStrBuilder); - builders.TempStrBuilder.Append("Base"); - AppendTypeNameWithoutSuffixes( - type.Name, - builders.TempStrBuilder); - AppendTypeNames( - typeParams, - builders.TempStrBuilder); - string bindingTypeName = builders.TempStrBuilder.ToString(); - + // Get specified derived type name + string derivedTypeName; + string derivedTypeNamespace; + SplitJsonTypeName( + jsonBaseType.DerivedName, + out derivedTypeName, + out derivedTypeNamespace); + builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("Release"); - builders.TempStrBuilder.Append(bindingTypeName); + builders.TempStrBuilder.Append(baseTypeName); string releaseFuncName = builders.TempStrBuilder.ToString(); builders.TempStrBuilder[0] = char.ToLower( builders.TempStrBuilder[0]); string releaseFuncNameLower = builders.TempStrBuilder.ToString(); - + + bool hasDefaultConstructor = !type.IsClass || + (type.GetConstructor(new Type[0]) != null || + type.GetConstructors().Length == 0); + // Either use specified constructors, the default constructor, or // nothing in the case of MonoBehaviour (where you can't call 'new') JsonConstructor[] jsonConstructors = jsonBaseType.Constructors; @@ -7386,9 +7117,7 @@ static void AppendBaseType( { // Base classes must have a default constructor or no // constructors at all - if (type.IsClass && - (type.GetConstructor(new Type[0]) == null && - type.GetConstructors().Length != 0)) + if (!hasDefaultConstructor) { // Throw an exception so the user knows what to fix in the JSON StringBuilder errorBuilder = new StringBuilder(1024); @@ -7424,7 +7153,7 @@ static void AppendBaseType( assemblies); builders.TempStrBuilder.Length = 0; - builders.TempStrBuilder.Append(bindingTypeName); + builders.TempStrBuilder.Append(baseTypeName); builders.TempStrBuilder.Append("Constructor"); AppendTypeNames( paramTypes, @@ -7491,16 +7220,30 @@ static void AppendBaseType( cppBaseClassTypeParams = typeParams; cppInterfaceTypes = new Type[0]; } + + AppendCppPointerFreeListStateAndFunctions( + baseTypeNamespace, + null, + baseTypeName, + baseTypeName, + builders.CppGlobalStateAndFunctions); + + AppendCppPointerFreeListInit( + baseTypeNamespace, + null, + baseTypeName, + maxSimultaneous, + baseTypeName, + builders.CppInitBody, + builders.CppInitBodyFirstBoot); // C++ type declaration int indent = AppendCppTypeDeclaration( - type.Namespace, - cppBaseTypeName, + baseTypeNamespace, + baseTypeName, false, - typeParams, - typeParams != null ? - builders.CppTemplateSpecializationDeclarations : - builders.CppTypeDeclarations); + null, + builders.CppTypeDeclarations); ParameterInfo[] releaseParams = { new ParameterInfo @@ -7513,28 +7256,12 @@ static void AppendBaseType( Kind = TypeKind.Primitive }}; - AppendCppFreeListStateAndFunctions( - type, - typeParams, - cppBaseTypeName, - bindingTypeName, - builders.CppGlobalStateAndFunctions); - - AppendCppFreeListInit( - type, - typeParams, - cppBaseTypeName, - maxSimultaneous, - bindingTypeName, - builders.CppInitBody, - builders.CppInitBodyFirstBoot); - // C++ type definition (begin) AppendCppTypeDefinitionBegin( - cppBaseTypeName, - type.Namespace, + baseTypeName, + baseTypeNamespace, TypeKind.Class, - typeParams, + null, cppBaseClass.Name, cppBaseClass.Namespace, cppBaseClassTypeParams, @@ -7556,17 +7283,90 @@ static void AppendBaseType( indent + 1, builders.CppTypeDefinitions); AppendCppMethodDeclaration( - cppBaseTypeName, + baseTypeName, false, false, false, null, - typeParams, null, cppConstructorParams[i], builders.CppTypeDefinitions); } - + + // C++ constructor declaration macro + builders.CppMacros.Append("#define "); + AppendUppercaseWithUnderscores( + derivedTypeNamespace, + builders.CppMacros); + builders.CppMacros.Append('_'); + AppendUppercaseWithUnderscores( + derivedTypeName, + builders.CppMacros); + builders.CppMacros.Append("_DEFAULT_CONSTRUCTOR_DECLARATION \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append(derivedTypeName); + builders.CppMacros.Append("(Plugin::InternalUse iu, int32_t handle);\n"); + builders.CppMacros.Append('\n'); + + // C++ constructor definition macro + builders.CppMacros.Append("#define "); + AppendUppercaseWithUnderscores( + derivedTypeNamespace, + builders.CppMacros); + builders.CppMacros.Append('_'); + AppendUppercaseWithUnderscores( + derivedTypeName, + builders.CppMacros); + builders.CppMacros.Append("_DEFAULT_CONSTRUCTOR_DEFINITION \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append(derivedTypeName); + builders.CppMacros.Append("::"); + builders.CppMacros.Append(derivedTypeName); + builders.CppMacros.Append("(Plugin::InternalUse iu, int32_t handle) \\\n"); + AppendCppConstructorInitializerList( + cppCtorInitTypes, + indent + 1, + builders.CppMacros, + " \\\n"); + AppendIndent(indent + 1, builders.CppMacros); + builders.CppMacros.Append(", "); + AppendCppTypeName( + baseTypeNamespace, + baseTypeName, + builders.CppMacros); + builders.CppMacros.Append("(iu, handle)\n"); + + // C++ constructor inline definition macro + builders.CppMacros.Append("#define "); + AppendUppercaseWithUnderscores( + derivedTypeNamespace, + builders.CppMacros); + builders.CppMacros.Append('_'); + AppendUppercaseWithUnderscores( + derivedTypeName, + builders.CppMacros); + builders.CppMacros.Append("_DEFAULT_CONSTRUCTOR \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append(derivedTypeName); + builders.CppMacros.Append("(Plugin::InternalUse iu, int32_t handle) \\\n"); + AppendCppConstructorInitializerList( + cppCtorInitTypes, + indent + 1, + builders.CppMacros, + " \\\n"); + AppendIndent(indent + 1, builders.CppMacros); + builders.CppMacros.Append(", "); + AppendCppTypeName( + baseTypeNamespace, + baseTypeName, + builders.CppMacros); + builders.CppMacros.Append("(iu, handle) \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("{ \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("} \\\n"); + builders.CppMacros.Append('\n'); + // C++ function pointers AppendCppFunctionPointerDefinition( releaseFuncName, @@ -7642,19 +7442,16 @@ static void AppendBaseType( // C++ method definitions (end) int cppMethodDefinitionsIndent = AppendNamespaceBeginning( - type.Namespace, + baseTypeNamespace, builders.CppMethodDefinitions); for (int i = 0; i < numConstructors; ++i) { AppendCppBaseTypeConstructor( - bindingTypeName, - type.Name, - type.Namespace, + baseTypeName, + baseTypeNamespace, TypeKind.Class, - cppBaseTypeName, - cppBaseClass, - typeParams, + baseTypeName, typeParams, cppCtorInitTypes, cppConstructorParams[i], @@ -7666,71 +7463,62 @@ static void AppendBaseType( } AppendCppBaseTypeNullptrConstructor( - bindingTypeName, - cppBaseTypeName, + baseTypeName, + baseTypeName, typeParams, - cppBaseClass.Name, - cppBaseClass.Namespace, - cppBaseClassTypeParams, cppCtorInitTypes, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeCopyConstructor( - bindingTypeName, - cppBaseTypeName, + baseTypeName, + baseTypeName, typeParams, - cppBaseClass.Name, - cppBaseClass.Namespace, - cppBaseClassTypeParams, cppCtorInitTypes, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeMoveConstructor( - cppBaseTypeName, + baseTypeName, typeParams, - cppBaseClass.Name, - cppBaseClass.Namespace, - cppBaseClassTypeParams, cppCtorInitTypes, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeHandleConstructor( - bindingTypeName, - cppBaseTypeName, + baseTypeName, + baseTypeName, typeParams, - cppBaseClass.Name, - cppBaseClass.Namespace, - cppBaseClassTypeParams, cppCtorInitTypes, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeDestructor( - bindingTypeName, - cppBaseTypeName, + baseTypeName, + baseTypeName, typeParams, false, + derivedTypeName, + derivedTypeNamespace, releaseFuncName, + baseTypeName, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeAssignmentOperatorSameType( type, - cppBaseTypeName, + baseTypeName, typeParams, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeAssignmentOperatorNullptr( - cppBaseTypeName, + baseTypeName, typeParams, false, releaseFuncName, @@ -7738,8 +7526,8 @@ static void AppendBaseType( builders.CppMethodDefinitions); AppendCppBaseTypeMoveAssignmentOperator( - bindingTypeName, - cppBaseTypeName, + baseTypeName, + baseTypeName, typeParams, false, releaseFuncName, @@ -7747,20 +7535,196 @@ static void AppendBaseType( builders.CppMethodDefinitions); AppendCppBaseTypeEqualityOperator( - cppBaseTypeName, + baseTypeName, typeParams, cppMethodDefinitionsIndent, + false, builders.CppMethodDefinitions); AppendCppBaseTypeInequalityOperator( - cppBaseTypeName, + baseTypeName, typeParams, cppMethodDefinitionsIndent, + false, builders.CppMethodDefinitions); - + + if (!string.IsNullOrEmpty(derivedTypeName)) + { + // C++ whole object free list + AppendCppWholeObjectFreeListStateAndFunctions( + null, + baseTypeName, + baseTypeNamespace, + baseTypeName, + builders.CppGlobalStateAndFunctions); + AppendCppWholeObjectFreeListInit( + maxSimultaneous, + baseTypeName, + builders.CppInitBody, + builders.CppInitBodyFirstBoot); + + // C++ binding function to create the base class + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("New"); + builders.TempStrBuilder.Append(baseTypeName); + string cppDefaultConstructorBindingFunctionName = builders.TempStrBuilder.ToString(); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("DLLEXPORT int32_t "); + builders.CppMethodDefinitions.Append(cppDefaultConstructorBindingFunctionName); + builders.CppMethodDefinitions.Append("(int32_t handle)\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + AppendCppTypeName( + baseTypeNamespace, + baseTypeName, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("* memory = Plugin::StoreWhole"); + builders.CppMethodDefinitions.Append(baseTypeName); + builders.CppMethodDefinitions.Append("();\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + AppendCppTypeName( + derivedTypeNamespace, + derivedTypeName, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("* thiz = new (memory) "); + AppendCppTypeName( + derivedTypeNamespace, + derivedTypeName, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("(Plugin::InternalUse::Only, handle);\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("return thiz->CppHandle;\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n\n"); + + // C# usage of the C++ binding function to create from C# default constructor + ParameterInfo[] cppDefaultConstructorBindingFunctionParams = ConvertParameters( + new Type[] { typeof(int) }); + AppendCsharpDelegate( + true, + string.Empty, + string.Empty, + null, + cppDefaultConstructorBindingFunctionName, + cppDefaultConstructorBindingFunctionParams, + typeof(int), + TypeKind.None, + builders.CsharpDelegates); + AppendCsharpImport( + string.Empty, + string.Empty, + null, + cppDefaultConstructorBindingFunctionName, + cppDefaultConstructorBindingFunctionParams, + builders.CsharpImports); + AppendCsharpGetDelegateCall( + string.Empty, + string.Empty, + null, + cppDefaultConstructorBindingFunctionName, + builders.CsharpGetDelegateCalls); + + // C++ binding function to destroy the base class + builders.TempStrBuilder.Length = 0; + builders.TempStrBuilder.Append("Destroy"); + builders.TempStrBuilder.Append(baseTypeName); + string cppDestroyBindingFunctionName = builders.TempStrBuilder.ToString(); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("DLLEXPORT void "); + builders.CppMethodDefinitions.Append(cppDestroyBindingFunctionName); + builders.CppMethodDefinitions.Append("(int32_t cppHandle)\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("{\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + AppendCppTypeName( + string.Empty, + baseTypeName, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("* instance = Plugin::Get"); + builders.CppMethodDefinitions.Append(baseTypeName); + builders.CppMethodDefinitions.Append("(cppHandle);\n"); + AppendIndent( + indent + 1, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("instance->~"); + AppendCppTypeName( + string.Empty, + baseTypeName, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("();\n"); + AppendIndent( + indent, + builders.CppMethodDefinitions); + builders.CppMethodDefinitions.Append("}\n\n"); + + // C# usage of the C++ binding function to destroy from C# default constructor + ParameterInfo[] cppDestroyBindingFunctionParams = ConvertParameters( + new Type[] { typeof(int) }); + AppendCsharpDelegate( + true, + string.Empty, + string.Empty, + null, + cppDestroyBindingFunctionName, + cppDestroyBindingFunctionParams, + typeof(void), + TypeKind.None, + builders.CsharpDelegates); + AppendCsharpImport( + string.Empty, + string.Empty, + null, + cppDestroyBindingFunctionName, + cppDestroyBindingFunctionParams, + builders.CsharpImports); + AppendCsharpGetDelegateCall( + string.Empty, + string.Empty, + null, + cppDestroyBindingFunctionName, + builders.CsharpGetDelegateCalls); + + // C# DestroyFunction enumerator + builders.CsharpDestroyFunctionEnumerators.Append("\t\t\t"); + builders.CsharpDestroyFunctionEnumerators.Append(baseTypeName); + builders.CsharpDestroyFunctionEnumerators.Append(",\n"); + + // C# Destroy queue cases + builders.CsharpDestroyQueueCases.Append("\t\t\t\t\t\tcase DestroyFunction."); + builders.CsharpDestroyQueueCases.Append(baseTypeName); + builders.CsharpDestroyQueueCases.Append(":\n"); + builders.CsharpDestroyQueueCases.Append("\t\t\t\t\t\t\t"); + builders.CsharpDestroyQueueCases.Append(cppDestroyBindingFunctionName); + builders.CsharpDestroyQueueCases.Append("(entry.CppHandle);\n"); + builders.CsharpDestroyQueueCases.Append("\t\t\t\t\t\t\tbreak;\n"); + } + // C# class (beginning) - builders.CsharpBaseTypes.Append("\t\tclass "); - builders.CsharpBaseTypes.Append(bindingTypeName); + builders.CsharpBaseTypes.Append("namespace "); + builders.CsharpBaseTypes.Append(baseTypeNamespace); + builders.CsharpBaseTypes.Append('\n'); + builders.CsharpBaseTypes.Append("{\n"); + builders.CsharpBaseTypes.Append("\tclass "); + builders.CsharpBaseTypes.Append(baseTypeName); if (jsonBaseType != null) { builders.CsharpBaseTypes.Append(" : "); @@ -7769,17 +7733,53 @@ static void AppendBaseType( builders.CsharpBaseTypes); } builders.CsharpBaseTypes.Append('\n'); - builders.CsharpBaseTypes.Append("\t\t{\n"); + builders.CsharpBaseTypes.Append("\t{\n"); // C# class fields - builders.CsharpBaseTypes.Append("\t\t\tpublic int CppHandle;\n"); - builders.CsharpBaseTypes.Append("\t\t\t\n"); - - // C# class constructor + builders.CsharpBaseTypes.Append("\t\tpublic int CppHandle;\n"); + builders.CsharpBaseTypes.Append("\t\t\n"); + + if (derivedTypeName != null) + { + // C# class default constructor if the base class has one + if (hasDefaultConstructor) + { + builders.CsharpBaseTypes.Append("\t\tpublic "); + builders.CsharpBaseTypes.Append(baseTypeName); + builders.CsharpBaseTypes.Append("()\n"); + builders.CsharpBaseTypes.Append("\t\t{\n"); + builders.CsharpBaseTypes.Append( + "\t\t\tint handle = NativeScript.Bindings.ObjectStore.Store(this);\n"); + builders.CsharpBaseTypes.Append( + "\t\t\tCppHandle = NativeScript.Bindings.New"); + builders.CsharpBaseTypes.Append(baseTypeName); + builders.CsharpBaseTypes.Append("(handle);\n"); + builders.CsharpBaseTypes.Append("\t\t}\n"); + builders.CsharpBaseTypes.Append("\t\t\n"); + } + + // C# finalizer/destructor + builders.CsharpBaseTypes.Append("\t\t~"); + builders.CsharpBaseTypes.Append(baseTypeName); + builders.CsharpBaseTypes.Append("()\n"); + builders.CsharpBaseTypes.Append("\t\t{\n"); + builders.CsharpBaseTypes.Append("\t\t\tif (CppHandle != 0)\n"); + builders.CsharpBaseTypes.Append("\t\t\t{\n"); + builders.CsharpBaseTypes.Append( + "\t\t\t\tNativeScript.Bindings.QueueDestroy(NativeScript.Bindings.DestroyFunction."); + builders.CsharpBaseTypes.Append(baseTypeName); + builders.CsharpBaseTypes.Append(", CppHandle);\n"); + builders.CsharpBaseTypes.Append("\t\t\t\tCppHandle = 0;\n"); + builders.CsharpBaseTypes.Append("\t\t\t}\n"); + builders.CsharpBaseTypes.Append("\t\t}\n"); + builders.CsharpBaseTypes.Append("\t\t\n"); + } + + // C# class constructors for (int i = 0; i < numConstructors; ++i) { - builders.CsharpBaseTypes.Append("\t\t\tpublic "); - builders.CsharpBaseTypes.Append(bindingTypeName); + builders.CsharpBaseTypes.Append("\t\tpublic "); + builders.CsharpBaseTypes.Append(baseTypeName); builders.CsharpBaseTypes.Append("(int cppHandle"); ParameterInfo[] parameters = cppConstructorParams[i]; if (parameters.Length > 0) @@ -7790,15 +7790,15 @@ static void AppendBaseType( builders.CsharpBaseTypes); } builders.CsharpBaseTypes.Append(")\n"); - builders.CsharpBaseTypes.Append("\t\t\t\t: base("); + builders.CsharpBaseTypes.Append("\t\t\t: base("); AppendCsharpFunctionCallParameters( parameters, builders.CsharpBaseTypes); builders.CsharpBaseTypes.Append(")\n"); - builders.CsharpBaseTypes.Append("\t\t\t{\n"); - builders.CsharpBaseTypes.Append("\t\t\t\tCppHandle = cppHandle;\n"); - builders.CsharpBaseTypes.Append("\t\t\t}\n"); - builders.CsharpBaseTypes.Append("\t\t\t\n"); + builders.CsharpBaseTypes.Append("\t\t{\n"); + builders.CsharpBaseTypes.Append("\t\t\tCppHandle = cppHandle;\n"); + builders.CsharpBaseTypes.Append("\t\t}\n"); + builders.CsharpBaseTypes.Append("\t\t\n"); } // C# constructor delegate type @@ -7818,7 +7818,8 @@ static void AppendBaseType( { AppendCsharpBaseTypeConstructorFunction( type, - bindingTypeName, + baseTypeName, + baseTypeNamespace, false, constructorFuncNames[i], constructorParams[i], @@ -7838,9 +7839,11 @@ static void AppendBaseType( AppendCsharpBaseTypeReleaseFunction( type, - bindingTypeName, + baseTypeName, + baseTypeNamespace, false, releaseFuncName, + jsonBaseType.DerivedName, releaseParams, builders.CsharpFunctions); @@ -7852,10 +7855,11 @@ static void AppendBaseType( { AppendBaseTypeNativeMethod( type, - bindingTypeName, + baseTypeName, typeParams, - cppBaseTypeName, + baseTypeName, methodInfo, + false, indent, builders); } @@ -7873,10 +7877,11 @@ static void AppendBaseType( { AppendBaseTypeNativeMethod( type, - bindingTypeName, + baseTypeName, typeParams, - cppBaseTypeName, + baseTypeName, methodInfo, + false, indent, builders); } @@ -7905,10 +7910,11 @@ static void AppendBaseType( jsonGenericParams.Types); AppendBaseTypeNativeMethod( type, - bindingTypeName, + baseTypeName, typeParams, - cppBaseTypeName, + baseTypeName, methodInfo, + false, indent, builders); } @@ -7924,10 +7930,11 @@ static void AppendBaseType( null); AppendBaseTypeNativeMethod( type, - bindingTypeName, + baseTypeName, typeParams, - cppBaseTypeName, + baseTypeName, methodInfo, + false, indent, builders); } @@ -7946,8 +7953,8 @@ static void AppendBaseType( } AppendBaseTypeProperty( type, - bindingTypeName, - cppBaseTypeName, + baseTypeName, + baseTypeName, typeParams, propertyInfo, getMethodInfo, @@ -7973,8 +7980,8 @@ static void AppendBaseType( } AppendBaseTypeProperty( type, - bindingTypeName, - cppBaseTypeName, + baseTypeName, + baseTypeName, typeParams, propertyInfo, getMethodInfo, @@ -8033,8 +8040,8 @@ static void AppendBaseType( } AppendBaseTypeProperty( type, - bindingTypeName, - cppBaseTypeName, + baseTypeName, + baseTypeName, typeParams, propertyInfo, getMethodInfo, @@ -8056,8 +8063,8 @@ static void AppendBaseType( } AppendBaseTypeEvent( type, - bindingTypeName, - cppBaseTypeName, + baseTypeName, + baseTypeName, typeParams, eventInfo, addMethodInfo, @@ -8082,8 +8089,8 @@ static void AppendBaseType( } AppendBaseTypeEvent( type, - bindingTypeName, - cppBaseTypeName, + baseTypeName, + baseTypeName, typeParams, eventInfo, addMethodInfo, @@ -8142,8 +8149,8 @@ static void AppendBaseType( } AppendBaseTypeEvent( type, - bindingTypeName, - cppBaseTypeName, + baseTypeName, + baseTypeName, typeParams, eventInfo, addMethodInfo, @@ -8154,14 +8161,15 @@ static void AppendBaseType( } // C# class (ending) - builders.CsharpBaseTypes.Append("\t\t}\n"); - builders.CsharpBaseTypes.Append("\t\t\n"); + builders.CsharpBaseTypes.Append("\t}\n"); + builders.CsharpBaseTypes.Append("}\n"); + builders.CsharpBaseTypes.Append("\n"); // C++ method definitions (end) AppendCppMethodDefinitionsEnd( indent, builders.CppMethodDefinitions); - + // C++ type definition (end) AppendCppTypeDefinitionEnd( false, @@ -8175,6 +8183,7 @@ static void AppendBaseTypeNativeMethod( Type[] typeParams, string cppTypeName, MethodInfo methodInfo, + bool typeIsDelegate, int indent, StringBuilders builders) { @@ -8204,6 +8213,7 @@ static void AppendBaseTypeNativeMethod( nativeInvokeFuncName, methodInfo.Name, IsNonDelegateClass(type), + typeIsDelegate, indent, builders); } @@ -8231,13 +8241,10 @@ static void AppendBaseTypeProperty( { System.Reflection.ParameterInfo[] setParams = setMethodInfo.GetParameters(); - parameters = ConvertParameters( - setParams, - 1, - setParams.Length - 1); + parameters = ConvertParameters(setParams, 1); } - builders.CsharpBaseTypes.Append("\t\t\tpublic "); + builders.CsharpBaseTypes.Append("\t\tpublic "); if (isOverride) { builders.CsharpBaseTypes.Append("override "); @@ -8259,7 +8266,7 @@ static void AppendBaseTypeProperty( builders.CsharpBaseTypes.Append(']'); } builders.CsharpBaseTypes.Append('\n'); - builders.CsharpBaseTypes.Append("\t\t\t{\n"); + builders.CsharpBaseTypes.Append("\t\t{\n"); TypeKind propertyTypeKind = GetTypeKind( propertyInfo.PropertyType); @@ -8275,7 +8282,7 @@ static void AppendBaseTypeProperty( propertyTypeKind, getMethodInfo, "Get", - isOverride, + false, indent, builders); } @@ -8291,13 +8298,13 @@ static void AppendBaseTypeProperty( propertyTypeKind, setMethodInfo, "Set", - isOverride, + false, indent, builders); } - builders.CsharpBaseTypes.Append("\t\t\t}\n"); - builders.CsharpBaseTypes.Append("\t\t\t\n"); + builders.CsharpBaseTypes.Append("\t\t}\n"); + builders.CsharpBaseTypes.Append("\t\t\n"); } static void AppendBaseTypeEvent( @@ -8313,7 +8320,7 @@ static void AppendBaseTypeEvent( { bool isOverride = IsNonDelegateClass(type); - builders.CsharpBaseTypes.Append("\t\t\tpublic "); + builders.CsharpBaseTypes.Append("\t\tpublic "); if (isOverride) { builders.CsharpBaseTypes.Append("override "); @@ -8325,7 +8332,7 @@ static void AppendBaseTypeEvent( builders.CsharpBaseTypes.Append(' '); builders.CsharpBaseTypes.Append(eventInfo.Name); builders.CsharpBaseTypes.Append('\n'); - builders.CsharpBaseTypes.Append("\t\t\t{\n"); + builders.CsharpBaseTypes.Append("\t\t{\n"); TypeKind eventHandlerTypeKind = GetTypeKind( eventInfo.EventHandlerType); @@ -8341,7 +8348,7 @@ static void AppendBaseTypeEvent( eventHandlerTypeKind, addMethodInfo, "Add", - isOverride, + false, indent, builders); } @@ -8357,7 +8364,7 @@ static void AppendBaseTypeEvent( eventHandlerTypeKind, removeMethodInfo, "Remove", - isOverride, + false, indent, builders); } @@ -8375,7 +8382,7 @@ static void AppendBaseTypeNativePropertyOrEvent( TypeKind propertyOrEventTypeKind, MethodInfo methodInfo, string operationType, - bool isOverride, + bool typeIsDelegate, int indent, StringBuilders builders) { @@ -8407,31 +8414,30 @@ static void AppendBaseTypeNativePropertyOrEvent( typeParams, methodInfo, funcName, - nativeInvokeFuncName, funcName, - isOverride, + typeIsDelegate, indent, builders); // C# method that calls the C++ binding function ParameterInfo[] invokeParamsWithThis = PrependThisParameter( invokeParams); - builders.CsharpBaseTypes.Append("\t\t\t\t"); + builders.CsharpBaseTypes.Append("\t\t\t"); builders.CsharpBaseTypes.Append(char.ToLower(operationType[0])); builders.CsharpBaseTypes.Append( operationType, 1, operationType.Length - 1); builders.CsharpBaseTypes.Append('\n'); - builders.CsharpBaseTypes.Append("\t\t\t\t{\n"); + builders.CsharpBaseTypes.Append("\t\t\t{\n"); AppendCsharpBaseTypeCppMethodCallMethodBody( methodInfo, nativeInvokeFuncName, invokeParamsWithThis, propertyOrEventTypeKind, - 5, + 4, builders.CsharpBaseTypes); - builders.CsharpBaseTypes.Append("\t\t\t\t}\n"); + builders.CsharpBaseTypes.Append("\t\t\t}\n"); } static void AppendCsharpParams( @@ -8485,7 +8491,6 @@ static void AppendBaseTypeMethodCallsCsharpMethod( false, false, methodInfo.ReturnType, - typeParams, null, invokeParams, builders.CppTypeDefinitions); @@ -8650,6 +8655,7 @@ static void AppendBaseTypeCppMethodCall( string nativeInvokeFuncName, string methodName, bool isOverride, + bool typeIsDelegate, int indent, StringBuilders builders) { @@ -8660,9 +8666,8 @@ static void AppendBaseTypeCppMethodCall( typeParams, invokeMethod, funcName, - nativeInvokeFuncName, methodName, - isOverride, + typeIsDelegate, indent, builders); @@ -8689,9 +8694,8 @@ static ParameterInfo[] AppendBaseTypeCppNativeInvokeCall( Type[] typeParams, MethodInfo invokeMethod, string funcName, - string nativeInvokeFuncName, string methodName, - bool isOverride, + bool typeIsDelegate, int indent, StringBuilders builders) { @@ -8707,7 +8711,6 @@ static ParameterInfo[] AppendBaseTypeCppNativeInvokeCall( true, false, invokeMethod.ReturnType, - typeParams, null, invokeParams, builders.CppTypeDefinitions); @@ -8717,7 +8720,7 @@ static ParameterInfo[] AppendBaseTypeCppNativeInvokeCall( cppTypeName, invokeMethod.ReturnType, methodName, - typeParams, + typeIsDelegate ? typeParams : null, null, invokeParams, indent, @@ -8812,9 +8815,11 @@ static ParameterInfo[] PrependThisParameter( static void AppendCsharpBaseTypeReleaseFunction( Type type, - string typeName, + string bindingTypeName, + string bindingTypeNamespace, bool typeIsDelegate, string releaseFuncName, + string derivedName, ParameterInfo[] releaseParams, StringBuilder output) { @@ -8826,20 +8831,43 @@ static void AppendCsharpBaseTypeReleaseFunction( typeof(void), releaseParams, output); + if (typeIsDelegate || derivedName != null) + { + AppendCsharpTypeName( + bindingTypeNamespace, + bindingTypeName, + output); + output.Append(" thiz;\n"); + } if (typeIsDelegate) { - output.Append("if (classHandle != 0)\n"); + output.Append("\t\t\t\tif (classHandle != 0)\n"); output.Append("\t\t\t\t{\n"); - output.Append("\t\t\t\t\tvar thiz = ("); - output.Append(typeName); - output.Append( - ")NativeScript.Bindings.ObjectStore.Remove(classHandle);\n"); + output.Append("\t\t\t\t\tthiz = ("); + AppendCsharpTypeName( + bindingTypeNamespace, + bindingTypeName, + output); + output.Append(")ObjectStore.Remove(classHandle);\n"); output.Append("\t\t\t\t\tthiz.CppHandle = 0;\n"); output.Append("\t\t\t\t}\n"); - output.Append("\t\t\t\t"); + output.Append("\t\t\t\t\n"); } - output.Append( - "NativeScript.Bindings.ObjectStore.Remove(handle);"); + if (derivedName != null) + { + output.Append("\t\t\t\tthiz = ("); + AppendCsharpTypeName( + bindingTypeNamespace, + bindingTypeName, + output); + output.Append(")ObjectStore.Get(handle);\n"); + output.Append("\t\t\t\tint cppHandle = thiz.CppHandle;\n"); + output.Append("\t\t\t\tthiz.CppHandle = 0;\n"); + output.Append("\t\t\t\tQueueDestroy(DestroyFunction."); + output.Append(bindingTypeName); + output.Append(", cppHandle);\n"); + } + output.Append("\t\t\t\tObjectStore.Remove(handle);"); AppendCsharpFunctionReturn( releaseParams, typeof(void), @@ -8859,7 +8887,7 @@ static void AppendCsharpBaseTypeCppMethodCallMethod( TypeKind invokeReturnTypeKind, StringBuilder output) { - output.Append("\t\t\tpublic "); + output.Append("\t\tpublic "); if (isOverride) { output.Append("override "); @@ -8874,19 +8902,19 @@ static void AppendCsharpBaseTypeCppMethodCallMethod( invokeParams, output); output.Append(")\n"); - output.Append("\t\t\t{\n"); + output.Append("\t\t{\n"); AppendCsharpBaseTypeCppMethodCallMethodBody( invokeMethod, nativeInvokeFuncName, invokeParamsWithThis, invokeReturnTypeKind, - 4, + 3, output); - output.Append("\t\t\t}\n"); - output.Append("\t\t\t\n"); + output.Append("\t\t}\n"); + output.Append("\t\n"); } - private static void AppendCsharpBaseTypeCppMethodCallMethodBody( + static void AppendCsharpBaseTypeCppMethodCallMethodBody( MethodInfo invokeMethod, string nativeInvokeFuncName, ParameterInfo[] invokeParamsWithThis, @@ -8958,9 +8986,10 @@ private static void AppendCsharpBaseTypeCppMethodCallMethodBody( } } - private static void AppendCsharpBaseTypeConstructorFunction( + static void AppendCsharpBaseTypeConstructorFunction( Type type, string typeName, + string typeNamespace, bool typeIsDelegate, string constructorFuncName, ParameterInfo[] constructorParams, @@ -8976,7 +9005,7 @@ private static void AppendCsharpBaseTypeConstructorFunction( constructorParams, output); output.Append("var thiz = new "); - output.Append(typeName); + AppendCsharpTypeName(typeNamespace, typeName, output); output.Append("(cppHandle"); if (cppConstructorParams.Length > 0) { @@ -9254,6 +9283,7 @@ static void AppendCppBaseTypeInequalityOperator( string cppTypeName, Type[] typeParams, int cppMethodDefinitionsIndent, + bool typeIsDelegate, StringBuilder output) { AppendIndent( @@ -9264,14 +9294,14 @@ static void AppendCppBaseTypeInequalityOperator( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("::operator!=(const "); AppendTypeNameWithoutGenericSuffix( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("& other) const\n"); AppendIndent( @@ -9297,6 +9327,7 @@ static void AppendCppBaseTypeEqualityOperator( string cppTypeName, Type[] typeParams, int cppMethodDefinitionsIndent, + bool typeIsDelegate, StringBuilder output) { AppendIndent( @@ -9307,14 +9338,14 @@ static void AppendCppBaseTypeEqualityOperator( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("::operator==(const "); AppendTypeNameWithoutGenericSuffix( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("& other) const\n"); AppendIndent( @@ -9352,21 +9383,21 @@ static void AppendCppBaseTypeMoveAssignmentOperator( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("& "); AppendTypeNameWithoutGenericSuffix( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("::operator=("); AppendTypeNameWithoutGenericSuffix( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("&& other)\n"); AppendIndent( @@ -9493,14 +9524,14 @@ static void AppendCppBaseTypeAssignmentOperatorNullptr( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("& "); AppendTypeNameWithoutGenericSuffix( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append( "::operator=(decltype(nullptr))\n"); @@ -9609,21 +9640,21 @@ static void AppendCppBaseTypeAssignmentOperatorSameType( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("& "); AppendTypeNameWithoutGenericSuffix( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("::operator=(const "); AppendTypeNameWithoutGenericSuffix( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("& other)\n"); AppendIndent( @@ -9666,7 +9697,10 @@ static void AppendCppBaseTypeDestructor( string cppTypeName, Type[] typeParams, bool typeIsDelegate, + string derivedTypeName, + string derivedTypeNamespace, string releaseFuncName, + string bindingTypeName, int cppMethodDefinitionsIndent, StringBuilder output) { @@ -9677,7 +9711,7 @@ static void AppendCppBaseTypeDestructor( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("::~"); AppendTypeNameWithoutGenericSuffix( @@ -9688,6 +9722,15 @@ static void AppendCppBaseTypeDestructor( cppMethodDefinitionsIndent, output); output.Append("{\n"); + if (!string.IsNullOrEmpty(derivedTypeName)) + { + AppendIndent( + cppMethodDefinitionsIndent + 1, + output); + output.Append("Plugin::RemoveWhole"); + output.Append(bindingTypeName); + output.Append("(this);\n"); + } AppendIndent( cppMethodDefinitionsIndent + 1, output); @@ -9773,9 +9816,6 @@ static void AppendCppBaseTypeHandleConstructor( string typeName, string cppTypeName, Type[] typeParams, - string baseTypeName, - string baseTypeNamespace, - Type[] baseTypeParams, Type[] interfaceTypes, bool typeIsDelegate, int cppMethodDefinitionsIndent, @@ -9788,7 +9828,7 @@ static void AppendCppBaseTypeHandleConstructor( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("::"); AppendTypeNameWithoutGenericSuffix( @@ -9796,19 +9836,10 @@ static void AppendCppBaseTypeHandleConstructor( output); output.Append( "(Plugin::InternalUse, int32_t handle)\n"); - string separator = ": "; - foreach (Type interfaceType in interfaceTypes) - { - AppendIndent( - cppMethodDefinitionsIndent + 1, - output); - output.Append(separator); - AppendCppTypeName( - interfaceType, - output); - output.Append("(nullptr)\n"); - separator = ", "; - } + AppendCppConstructorInitializerList( + interfaceTypes, + cppMethodDefinitionsIndent + 1, + output); AppendIndent( cppMethodDefinitionsIndent, output); @@ -9861,9 +9892,6 @@ static void AppendCppBaseTypeHandleConstructor( static void AppendCppBaseTypeMoveConstructor( string cppTypeName, Type[] typeParams, - string baseTypeName, - string baseTypeNamespace, - Type[] baseTypeParams, Type[] interfaceTypes, bool typeIsDelegate, int cppMethodDefinitionsIndent, @@ -9876,7 +9904,7 @@ static void AppendCppBaseTypeMoveConstructor( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("::"); AppendTypeNameWithoutGenericSuffix( @@ -9887,22 +9915,13 @@ static void AppendCppBaseTypeMoveConstructor( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("&& other)\n"); - string separator = ": "; - foreach (Type interfaceType in interfaceTypes) - { - AppendIndent( - cppMethodDefinitionsIndent + 1, - output); - output.Append(separator); - AppendCppTypeName( - interfaceType, - output); - output.Append("(nullptr)\n"); - separator = ", "; - } + AppendCppConstructorInitializerList( + interfaceTypes, + cppMethodDefinitionsIndent + 1, + output); AppendIndent( cppMethodDefinitionsIndent, output); @@ -9954,9 +9973,6 @@ static void AppendCppBaseTypeCopyConstructor( string typeName, string cppTypeName, Type[] typeParams, - string baseTypeName, - string baseTypeNamespace, - Type[] baseTypeParams, Type[] interfaceTypes, bool typeIsDelegate, int cppMethodDefinitionsIndent, @@ -9969,33 +9985,24 @@ static void AppendCppBaseTypeCopyConstructor( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("::"); AppendTypeNameWithoutGenericSuffix( cppTypeName, - output); - output.Append("(const "); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, - output); - AppendCppTypeParameters( - typeParams, - output); - output.Append("& other)\n"); - string separator = ": "; - foreach (Type interfaceType in interfaceTypes) - { - AppendIndent( - cppMethodDefinitionsIndent + 1, - output); - output.Append(separator); - AppendCppTypeName( - interfaceType, - output); - output.Append("(nullptr)\n"); - separator = ", "; - } + output); + output.Append("(const "); + AppendTypeNameWithoutGenericSuffix( + cppTypeName, + output); + AppendCppTypeParameters( + typeIsDelegate ? typeParams : null, + output); + output.Append("& other)\n"); + AppendCppConstructorInitializerList( + interfaceTypes, + cppMethodDefinitionsIndent + 1, + output); AppendIndent( cppMethodDefinitionsIndent, output); @@ -10050,9 +10057,6 @@ static void AppendCppBaseTypeNullptrConstructor( string typeName, string cppTypeName, Type[] typeParams, - string baseTypeName, - string baseTypeNamespace, - Type[] baseTypeParams, Type[] interfaceTypes, bool typeIsDelegate, int cppMethodDefinitionsIndent, @@ -10065,26 +10069,17 @@ static void AppendCppBaseTypeNullptrConstructor( cppTypeName, output); AppendCppTypeParameters( - typeParams, + typeIsDelegate ? typeParams : null, output); output.Append("::"); AppendTypeNameWithoutGenericSuffix( cppTypeName, output); output.Append("(decltype(nullptr))\n"); - string separator = ": "; - foreach (Type interfaceType in interfaceTypes) - { - AppendIndent( - cppMethodDefinitionsIndent + 1, - output); - output.Append(separator); - AppendCppTypeName( - interfaceType, - output); - output.Append("(nullptr)\n"); - separator = ", "; - } + AppendCppConstructorInitializerList( + interfaceTypes, + cppMethodDefinitionsIndent + 1, + output); AppendIndent( cppMethodDefinitionsIndent, output); @@ -10114,13 +10109,10 @@ static void AppendCppBaseTypeNullptrConstructor( static void AppendCppBaseTypeConstructor( string bindingTypeName, - string typeName, string typeNamespace, TypeKind typeKind, string cppTypeName, - Type baseType, Type[] typeParams, - Type[] baseTypeParams, Type[] interfaceTypes, ParameterInfo[] cppParameters, ParameterInfo[] parameters, @@ -10133,24 +10125,15 @@ static void AppendCppBaseTypeConstructor( cppTypeName, null, cppTypeName, - typeParams, + typeIsDelegate ? typeParams : null, null, cppParameters, cppMethodDefinitionsIndent, output); - string separator = ": "; - foreach (Type interfaceType in interfaceTypes) - { - AppendIndent( - cppMethodDefinitionsIndent + 1, - output); - output.Append(separator); - AppendCppTypeName( - interfaceType, - output); - output.Append("(nullptr)\n"); - separator = ", "; - } + AppendCppConstructorInitializerList( + interfaceTypes, + cppMethodDefinitionsIndent + 1, + output); AppendIndent( cppMethodDefinitionsIndent, output); @@ -10246,8 +10229,8 @@ static void AppendCppBaseTypeConstructor( output.Append('\n'); } - static void AppendCppFreeListInit( - Type type, + static void AppendCppPointerFreeListInit( + string typeNamespace, Type[] typeParams, string cppTypeName, int maxSimultaneous, @@ -10265,7 +10248,7 @@ static void AppendCppFreeListInit( output.Append(typeName); output.Append("FreeList = ("); AppendCppTypeName( - type.Namespace, + typeNamespace, cppTypeName, output); AppendCppTypeParameters( @@ -10277,7 +10260,7 @@ static void AppendCppFreeListInit( output.Append(maxSimultaneous); output.Append(" * sizeof("); AppendCppTypeName( - type.Namespace, + typeNamespace, cppTypeName, output); AppendCppTypeParameters( @@ -10295,7 +10278,7 @@ static void AppendCppFreeListInit( outputFirstBoot.Append(typeName); outputFirstBoot.Append("FreeList[i] = ("); AppendCppTypeName( - type.Namespace, + typeNamespace, cppTypeName, outputFirstBoot); AppendCppTypeParameters( @@ -10321,19 +10304,34 @@ static void AppendCppFreeListInit( outputFirstBoot.Append("\t\t\n"); } - static void AppendCppFreeListStateAndFunctions( - Type type, + static void AppendCppPointerFreeListStateAndFunctions( + string typeNamespace, Type[] typeParams, string cppTypeName, string bindingTypeName, StringBuilder output) { + // Section comment + output.Append("\t// Free list for "); + AppendCppTypeName( + typeNamespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append(" pointers\n"); + output.Append("\t\n"); + + // Size variable output.Append("\tint32_t "); output.Append(bindingTypeName); output.Append("FreeListSize;\n"); + + // Free list variable output.Append('\t'); AppendCppTypeName( - type.Namespace, + typeNamespace, cppTypeName, output); AppendCppTypeParameters( @@ -10342,9 +10340,11 @@ static void AppendCppFreeListStateAndFunctions( output.Append("** "); output.Append(bindingTypeName); output.Append("FreeList;\n"); + + // Next free variable output.Append('\t'); AppendCppTypeName( - type.Namespace, + typeNamespace, cppTypeName, output); AppendCppTypeParameters( @@ -10354,11 +10354,13 @@ static void AppendCppFreeListStateAndFunctions( output.Append(bindingTypeName); output.Append(";\n"); output.Append("\t\n"); + + // Store function output.Append("\tint32_t Store"); output.Append(bindingTypeName); output.Append('('); AppendCppTypeName( - type.Namespace, + typeNamespace, cppTypeName, output); AppendCppTypeParameters( @@ -10371,7 +10373,7 @@ static void AppendCppFreeListStateAndFunctions( output.Append(" != nullptr);\n"); output.Append("\t\t"); AppendCppTypeName( - type.Namespace, + typeNamespace, cppTypeName, output); AppendCppTypeParameters( @@ -10384,7 +10386,7 @@ static void AppendCppFreeListStateAndFunctions( output.Append(bindingTypeName); output.Append(" = ("); AppendCppTypeName( - type.Namespace, + typeNamespace, cppTypeName, output); AppendCppTypeParameters( @@ -10397,9 +10399,11 @@ static void AppendCppFreeListStateAndFunctions( output.Append("FreeList);\n"); output.Append("\t}\n"); output.Append("\t\n"); + + // Get function output.Append('\t'); AppendCppTypeName( - type.Namespace, + typeNamespace, cppTypeName, output); AppendCppTypeParameters( @@ -10418,13 +10422,15 @@ static void AppendCppFreeListStateAndFunctions( output.Append("FreeList[handle];\n"); output.Append("\t}\n"); output.Append("\t\n"); + + // Remove function output.Append("\tvoid Remove"); output.Append(bindingTypeName); output.Append("(int32_t handle)\n"); output.Append("\t{\n"); output.Append("\t\t"); AppendCppTypeName( - type.Namespace, + typeNamespace, cppTypeName, output); AppendCppTypeParameters( @@ -10435,7 +10441,7 @@ static void AppendCppFreeListStateAndFunctions( output.Append("FreeList + handle;\n"); output.Append("\t\t*pRelease = ("); AppendCppTypeName( - type.Namespace, + typeNamespace, cppTypeName, output); AppendCppTypeParameters( @@ -10448,6 +10454,182 @@ static void AppendCppFreeListStateAndFunctions( output.Append(bindingTypeName); output.Append(" = pRelease;\n"); output.Append("\t}\n"); + output.Append("\t\n"); + } + + static void AppendCppWholeObjectFreeListInit( + int maxSimultaneous, + string bindingTypeName, + StringBuilder output, + StringBuilder outputFirstBoot) + { + output.Append("\tPlugin::"); + output.Append(bindingTypeName); + output.Append("FreeWholeListSize = "); + output.Append(maxSimultaneous); + output.Append(";\n"); + + output.Append("\tPlugin::"); + output.Append(bindingTypeName); + output.Append("FreeWholeList = (Plugin::"); + output.Append(bindingTypeName); + output.Append("FreeWholeListEntry*)curMemory;\n"); + + output.Append("\tcurMemory += "); + output.Append(maxSimultaneous); + output.Append(" * sizeof(Plugin::"); + output.Append(bindingTypeName); + output.Append("FreeWholeListEntry);\n"); + + output.Append("\t\n"); + + outputFirstBoot.Append("\t\tfor (int32_t i = 0, end = Plugin::"); + outputFirstBoot.Append(bindingTypeName); + outputFirstBoot.Append("FreeWholeListSize - 1; i < end; ++i)\n"); + outputFirstBoot.Append("\t\t{\n"); + outputFirstBoot.Append("\t\t\tPlugin::"); + outputFirstBoot.Append(bindingTypeName); + outputFirstBoot.Append("FreeWholeList[i].Next = Plugin::"); + outputFirstBoot.Append(bindingTypeName); + outputFirstBoot.Append("FreeWholeList[i + 1].Next;\n"); + outputFirstBoot.Append("\t\t}\n"); + + outputFirstBoot.Append("\t\tPlugin::"); + outputFirstBoot.Append(bindingTypeName); + outputFirstBoot.Append("FreeWholeList[Plugin::"); + outputFirstBoot.Append(bindingTypeName); + outputFirstBoot.Append("FreeWholeListSize - 1].Next = nullptr;\n"); + + outputFirstBoot.Append("\t\tPlugin::NextFreeWhole"); + outputFirstBoot.Append(bindingTypeName); + outputFirstBoot.Append(" = Plugin::"); + outputFirstBoot.Append(bindingTypeName); + outputFirstBoot.Append("FreeWholeList + 1;\n"); + + outputFirstBoot.Append("\t\t\n"); + } + + static void AppendCppWholeObjectFreeListStateAndFunctions( + Type[] typeParams, + string cppTypeName, + string cppTypeNamespace, + string bindingTypeName, + StringBuilder output) + { + // Section comment + output.Append("\t// Free list for whole "); + AppendCppTypeName( + cppTypeNamespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append(" objects\n"); + output.Append("\t\n"); + + // Union with a pointer and a whole object + output.Append("\tunion "); + output.Append(bindingTypeName); + output.Append("FreeWholeListEntry\n"); + output.Append("\t{\n"); + output.Append("\t\t"); + output.Append(bindingTypeName); + output.Append("FreeWholeListEntry* Next;\n"); + output.Append("\t\t"); + AppendCppTypeName( + cppTypeNamespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append(" Value;\n"); + output.Append("\t};\n"); + + // Size + output.Append("\tint32_t "); + output.Append(bindingTypeName); + output.Append("FreeWholeListSize;\n"); + + // Free list entries + output.Append('\t'); + output.Append(bindingTypeName); + output.Append("FreeWholeListEntry* "); + output.Append(bindingTypeName); + output.Append("FreeWholeList;\n"); + + // Pointer to next free entry + output.Append('\t'); + output.Append(bindingTypeName); + output.Append("FreeWholeListEntry* NextFreeWhole"); + output.Append(bindingTypeName); + output.Append(";\n"); + output.Append("\t\n"); + + // Store function + output.Append('\t'); + AppendCppTypeName( + cppTypeNamespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("* StoreWhole"); + output.Append(bindingTypeName); + output.Append("()\n"); + output.Append("\t{\n"); + output.Append("\t\tassert(NextFreeWhole"); + output.Append(bindingTypeName); + output.Append(" != nullptr);\n"); + output.Append("\t\t"); + output.Append(bindingTypeName); + output.Append("FreeWholeListEntry* pNext = NextFreeWhole"); + output.Append(bindingTypeName); + output.Append(";\n"); + output.Append("\t\tNextFreeWhole"); + output.Append(bindingTypeName); + output.Append(" = pNext->Next;\n"); + output.Append("\t\treturn &pNext->Value;\n"); + output.Append("\t}\n"); + output.Append("\t\n"); + + // Remove function + output.Append("\tvoid RemoveWhole"); + output.Append(bindingTypeName); + output.Append('('); + AppendCppTypeName( + cppTypeNamespace, + cppTypeName, + output); + AppendCppTypeParameters( + typeParams, + output); + output.Append("* instance)\n"); + output.Append("\t{\n"); + output.Append("\t\t"); + output.Append(bindingTypeName); + output.Append("FreeWholeListEntry* pRelease = ("); + output.Append(bindingTypeName); + output.Append("FreeWholeListEntry*)instance;\n"); + output.Append("\t\tif (pRelease >= "); + output.Append(bindingTypeName); + output.Append("FreeWholeList && pRelease < "); + output.Append(bindingTypeName); + output.Append("FreeWholeList + ("); + output.Append(bindingTypeName); + output.Append("FreeWholeListSize - 1))\n"); + output.Append("\t\t{\n"); + output.Append("\t\t\tpRelease->Next = NextFreeWhole"); + output.Append(bindingTypeName); + output.Append(";\n"); + output.Append("\t\t\tNextFreeWhole"); + output.Append(bindingTypeName); + output.Append(" = pRelease->Next;\n"); + output.Append("\t\t}\n"); + output.Append("\t}\n"); + output.Append("\t\n"); } static void AppendCsharpDelegate( @@ -10998,7 +11180,6 @@ static void AppendGetter( false, methodIsStatic, fieldType, - enclosingTypeParams, null, parameters, builders.CppTypeDefinitions); @@ -11192,7 +11373,6 @@ static void AppendSetter( false, methodIsStatic, typeof(void), - enclosingTypeParams, null, parameters, builders.CppTypeDefinitions); @@ -11595,9 +11775,6 @@ static int AppendCppMethodDefinitionsBegin( string enclosingTypeNamespace, TypeKind enclosingTypeKind, Type[] enclosingTypeParams, - string baseTypeName, - string baseTypeNamespace, - Type[] baseTypeTypeParams, Type[] interfaceTypes, bool isStatic, Action extraDefault, @@ -11612,12 +11789,6 @@ static int AppendCppMethodDefinitionsBegin( enclosingTypeKind == TypeKind.Class || enclosingTypeKind == TypeKind.ManagedStruct)) { - if (baseTypeName == null) - { - baseTypeName = "Object"; - baseTypeNamespace = "System"; - } - // Construct with nullptr AppendIndent(indent, output); AppendTypeNameWithoutGenericSuffix( @@ -11633,19 +11804,10 @@ static int AppendCppMethodDefinitionsBegin( output.Append("(decltype(nullptr))\n"); if (enclosingTypeKind == TypeKind.Class) { - string separator = ": "; - foreach (Type interfaceType in interfaceTypes) - { - AppendIndent( - indent + 1, - output); - output.Append(separator); - AppendCppTypeName( - interfaceType, - output); - output.Append("(nullptr)\n"); - separator = ", "; - } + AppendCppConstructorInitializerList( + interfaceTypes, + indent + 1, + output); } AppendIndent(indent, output); output.Append("{\n"); @@ -11670,19 +11832,10 @@ static int AppendCppMethodDefinitionsBegin( output.Append("(Plugin::InternalUse, int32_t handle)\n"); if (enclosingTypeKind == TypeKind.Class) { - string separator = ": "; - foreach (Type interfaceType in interfaceTypes) - { - AppendIndent( - indent + 1, - output); - output.Append(separator); - AppendCppTypeName( - interfaceType, - output); - output.Append("(nullptr)\n"); - separator = ", "; - } + AppendCppConstructorInitializerList( + interfaceTypes, + indent + 1, + output); } AppendIndent(indent, output); output.Append("{\n"); @@ -12674,7 +12827,6 @@ static void AppendCsharpBindingParameterDeclaration( static void AppendCppParameterDeclaration( ParameterInfo[] parameters, - Type[] typeTypeParameters, Type[] methodTypeParameters, bool includeDefaults, StringBuilder output) @@ -12864,7 +13016,6 @@ static void AppendCppMethodDefinitionBegin( output.Append('('); AppendCppParameterDeclaration( parameters, - null, // don't substitute type type params null, // don't substitute method type params false, output); @@ -13234,7 +13385,6 @@ static void AppendCppMethodDeclaration( bool methodIsVirtual, bool methodIsStatic, Type returnType, - Type[] typeTypeParameters, Type[] methodTypeParameters, ParameterInfo[] parameters, StringBuilder output) @@ -13284,7 +13434,6 @@ static void AppendCppMethodDeclaration( output.Append('('); AppendCppParameterDeclaration( parameters, - typeTypeParameters, methodTypeParameters, true, output); @@ -13368,17 +13517,26 @@ static void AppendCsharpTypeName( } else { - output.Append(type.Namespace); - output.Append('.'); - AppendTypeNameWithoutGenericSuffix( - type.Name, - output); + AppendCsharpTypeName(type.Namespace, type.Name, output); Type[] genTypes = type.GetGenericArguments(); AppendCSharpTypeParameters( genTypes, output); } } + + static void AppendCsharpTypeName( + string namespaceName, + string name, + StringBuilder output) + { + if (!string.IsNullOrEmpty(namespaceName)) + { + output.Append(namespaceName); + output.Append('.'); + } + AppendTypeNameWithoutGenericSuffix(name, output); + } static void AppendCppTypeName( Type type, @@ -13496,8 +13654,14 @@ static void AppendCppTypeName( string name, StringBuilder output) { - AppendNamespace(namespaceName, "::", output); - output.Append("::"); + AppendNamespace( + namespaceName, + "::", + output); + if (!string.IsNullOrEmpty(namespaceName)) + { + output.Append("::"); + } AppendTypeNameWithoutGenericSuffix( name, output); @@ -13578,11 +13742,11 @@ static void RemoveTrailingChars( RemoveTrailingChars(builders.CsharpInitCall); RemoveTrailingChars(builders.CsharpBaseTypes); RemoveTrailingChars(builders.CsharpFunctions); - RemoveTrailingChars(builders.CsharpMonoBehaviours); RemoveTrailingChars(builders.CsharpDelegates); RemoveTrailingChars(builders.CsharpImports); RemoveTrailingChars(builders.CsharpGetDelegateCalls); - RemoveTrailingChars(builders.CsharpGetDelegateCalls); + RemoveTrailingChars(builders.CsharpDestroyFunctionEnumerators); + RemoveTrailingChars(builders.CsharpDestroyQueueCases); RemoveTrailingChars(builders.CppFunctionPointers); RemoveTrailingChars(builders.CppTypeDeclarations); RemoveTrailingChars(builders.CppTemplateDeclarations); @@ -13592,9 +13756,10 @@ static void RemoveTrailingChars( RemoveTrailingChars(builders.CppInitParams); RemoveTrailingChars(builders.CppInitBody); RemoveTrailingChars(builders.CppInitBodyFirstBoot); - RemoveTrailingChars(builders.CppMonoBehaviourMessages); RemoveTrailingChars(builders.CppGlobalStateAndFunctions); RemoveTrailingChars(builders.CppUnboxingMethodDeclarations); + RemoveTrailingChars(builders.CppStringDefaultParams); + RemoveTrailingChars(builders.CppMacros); } // Remove trailing chars (e.g. commas) for last elements @@ -13653,7 +13818,7 @@ static void InjectBuilders( csharpContents = InjectIntoString( csharpContents, "/*BEGIN BASE TYPES*/\n", - "\n\t\t/*END BASE TYPES*/", + "\n/*END BASE TYPES*/", builders.CsharpBaseTypes.ToString()); csharpContents = InjectIntoString( csharpContents, @@ -13662,24 +13827,29 @@ static void InjectBuilders( builders.CsharpFunctions.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN MONOBEHAVIOURS*/\n", - "\n/*END MONOBEHAVIOURS*/", - builders.CsharpMonoBehaviours.ToString()); - csharpContents = InjectIntoString( - csharpContents, - "/*BEGIN MONOBEHAVIOUR DELEGATES*/\n", - "\n\t\t/*END MONOBEHAVIOUR DELEGATES*/", + "/*BEGIN DELEGATES*/\n", + "\n\t\t/*END DELEGATES*/", builders.CsharpDelegates.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN MONOBEHAVIOUR IMPORTS*/\n", - "\n\t\t/*END MONOBEHAVIOUR IMPORTS*/", + "/*BEGIN IMPORTS*/\n", + "\n\t\t/*END IMPORTS*/", builders.CsharpImports.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN MONOBEHAVIOUR GETDELEGATE CALLS*/\n", - "\n\t\t\t/*END MONOBEHAVIOUR GETDELEGATE CALLS*/", + "/*BEGIN GETDELEGATE CALLS*/\n", + "\n\t\t\t/*END GETDELEGATE CALLS*/", builders.CsharpGetDelegateCalls.ToString()); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN DESTROY FUNCTION ENUMERATORS*/\n", + "\n\t\t\t/*END DESTROY FUNCTION ENUMERATORS*/", + builders.CsharpDestroyFunctionEnumerators.ToString()); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN DESTROY QUEUE CASES*/\n", + "\n\t\t\t\t\t\t/*END DESTROY QUEUE CASES*/", + builders.CsharpDestroyQueueCases.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, "/*BEGIN FUNCTION POINTERS*/\n", @@ -13725,11 +13895,6 @@ static void InjectBuilders( "/*BEGIN INIT BODY FIRST BOOT*/\n", "\n\t\t/*END INIT BODY FIRST BOOT*/", builders.CppInitBodyFirstBoot.ToString()); - cppSourceContents = InjectIntoString( - cppSourceContents, - "/*BEGIN MONOBEHAVIOUR MESSAGES*/\n", - "\n/*END MONOBEHAVIOUR MESSAGES*/", - builders.CppMonoBehaviourMessages.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, "/*BEGIN GLOBAL STATE AND FUNCTIONS*/\n", @@ -13745,6 +13910,11 @@ static void InjectBuilders( "/*BEGIN STRING DEFAULT PARAMETERS*/\n", "\n\t/*END STRING DEFAULT PARAMETERS*/", builders.CppStringDefaultParams.ToString()); + cppHeaderContents = InjectIntoString( + cppHeaderContents, + "/*BEGIN MACROS*/\n", + "\n/*END MACROS*/", + builders.CppMacros.ToString()); File.WriteAllText(CsharpPath, csharpContents); File.WriteAllText(CppHeaderPath, cppHeaderContents); diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index aaf5ac5..f04e9f5 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -1,6 +1,5 @@ { "Assemblies": [ - "DOTNET_DLLS/System.Xml.dll" ], "Types": [ { @@ -10,24 +9,7 @@ "Name": " System.IConvertible" }, { - "Name": " System.IComparable", - "Methods": [ - { - "Name": "CompareTo", - "ParamTypes": [ - "System.Object" - ] - } - ] - }, - { - "Name": " System.IDisposable", - "Methods": [ - { - "Name": "Dispose", - "ParamTypes": [] - } - ] + "Name": " System.IComparable" }, { "Name": "UnityEngine.Vector3", @@ -41,32 +23,12 @@ } ], "Methods": [ - { - "Name": "Set", - "ParamTypes": [ - "System.Single", - "System.Single", - "System.Single" - ] - }, { "Name": "x+y", "ParamTypes": [ "UnityEngine.Vector3", "UnityEngine.Vector3" ] - }, - { - "Name": "-x", - "ParamTypes": [ - "UnityEngine.Vector3" - ] - } - ], - "Properties": [ - { - "Name": "magnitude", - "Get": {} } ] }, @@ -78,21 +40,6 @@ "Get": {}, "Set": {} } - ], - "Methods": [ - { - "Name": "x==y", - "ParamTypes": [ - "UnityEngine.Object", - "UnityEngine.Object" - ] - }, - { - "Name": "implicit", - "ParamTypes": [ - "UnityEngine.Object" - ] - } ] }, { @@ -106,14 +53,6 @@ }, { "Name": "UnityEngine.Transform", - "Methods": [ - { - "Name": "SetParent", - "ParamTypes": [ - "UnityEngine.Transform" - ] - } - ], "Properties": [ { "Name": "position", @@ -126,51 +65,6 @@ } ] }, - { - "Name": "UnityEngine.Color" - }, - { - "Name": "UnityEngine.GradientColorKey" - }, - { - "Name": "UnityEngine.Resolution", - "Constructors": [ - { - "ParamTypes": [] - } - ], - "Properties": [ - { - "Name": "width", - "Get": {}, - "Set": {} - }, - { - "Name": "height", - "Get": {}, - "Set": {} - }, - { - "Name": "refreshRate", - "Get": {}, - "Set": {} - } - ] - }, - { - "Name": "UnityEngine.RaycastHit", - "MaxSimultaneous": 1000, - "Properties": [ - { - "Name": "point", - "Get": {} - }, - { - "Name": "transform", - "Get": {} - } - ] - }, { "Name": "System.Collections.IEnumerator", "Methods": [ @@ -193,109 +87,9 @@ { "Name": "System.Runtime.InteropServices._Exception" }, - { - "Name": "System.IAppDomainSetup" - }, - { - "Name": "System.Collections.IComparer" - }, - { - "Name": "System.Collections.IEqualityComparer" - }, - { - "Name": "System.Collections.Generic.IEqualityComparer`1", - "GenericParams": [ - { - "Types": [ - "System.String" - ] - }, - { - "Types": [ - "System.Int32" - ] - } - ] - }, - { - "Name": "UnityEngine.Playables.PlayableGraph" - }, - { - "Name": "UnityEngine.Playables.IPlayable" - }, - { - "Name": "System.IEquatable`1", - "GenericParams": [ - { - "Types": [ - "UnityEngine.Animations.AnimationMixerPlayable" - ] - } - ] - }, - { - "Name": "UnityEngine.Animations.AnimationMixerPlayable", - "Methods": [ - { - "Name": "Create", - "ParamTypes": [ - "UnityEngine.Playables.PlayableGraph", - "System.Int32", - "System.Boolean" - ] - } - ] - }, - { - "Name": " System.Runtime.CompilerServices.IStrongBox" - }, - { - "Name": "UnityEngine.Experimental.UIElements.IEventHandler" - }, - { - "Name": "UnityEngine.Experimental.UIElements.CallbackEventHandler" - }, - { - "Name": "UnityEngine.Experimental.UIElements.Focusable" - }, - { - "Name": "UnityEngine.Experimental.UIElements.IStyle" - }, - { - "Name": "System.Diagnostics.Stopwatch", - "Constructors": [ - { - "ParamTypes": [] - } - ], - "Methods": [ - { - "Name": "Start", - "ParamTypes": [] - }, - { - "Name": "Reset", - "ParamTypes": [] - } - ], - "Properties": [ - { - "Name": "ElapsedMilliseconds", - "Get": {} - } - ] - }, { "Name": "UnityEngine.GameObject", "Constructors": [ - { - "ParamTypes": [] - }, - { - "ParamTypes": [ - "System.String" - ] - } ], "Methods": [ { @@ -304,17 +98,9 @@ "GenericParams": [ { "Types": [ - "MyGame.MonoBehaviours.TestScript" - ] - }, - { - "Types": [ - "MyGame.MonoBehaviours.AnotherScript" + "MyGame.BaseBallScript" ] } - ], - "Exceptions": [ - "System.NullReferenceException" ] }, { @@ -323,16 +109,6 @@ "UnityEngine.PrimitiveType" ] } - ], - "Properties": [ - { - "Name": "transform", - "Get": { - "Exceptions": [ - "System.NullReferenceException" - ] - } - } ] }, { @@ -346,36 +122,6 @@ } ] }, - { - "Name": "UnityEngine.Assertions.Assert", - "Fields": [ - "raiseExceptions" - ], - "Methods": [ - { - "Name": "AreEqual", - "ParamTypes": [ - "T", - "T" - ], - "GenericParams": [ - { - "Types": [ - "System.String" - ] - }, - { - "Types": [ - "UnityEngine.GameObject" - ] - } - ] - } - ] - }, - { - "Name": "UnityEngine.Collision" - }, { "Name": "UnityEngine.Behaviour" }, @@ -390,800 +136,46 @@ ] }, { - "Name": "UnityEngine.AudioSettings", - "Methods": [ - { - "Name": "GetDSPBufferSize", - "ParamTypes": [ - "System.Int32", - "System.Int32" - ] - } - ] - }, - { - "Name": "UnityEngine.Networking.NetworkTransport", - "Methods": [ + "Name": "System.Exception", + "Constructors": [ { - "Name": "GetBroadcastConnectionInfo", "ParamTypes": [ - "System.Int32", - "System.String", - "System.Int32", - "System.Byte" + "System.String" ] - }, - { - "Name": "Init", - "ParamTypes": [] } ] }, { - "Name": "UnityEngine.Quaternion" - }, - { - "Name": "UnityEngine.Matrix4x4", - "Properties": [ - { - "Name": "Item", - "Get": { - "ParamTypes": [ - "System.Int32", - "System.Int32" - ] - }, - "Set": { - "ParamTypes": [ - "System.Int32", - "System.Int32", - "System.Single" - ] - } - } - ] + "Name": "System.SystemException" }, { - "Name": "UnityEngine.QueryTriggerInteraction" + "Name": "System.NullReferenceException" }, { - "Name": "System.Collections.Generic.KeyValuePair`2", - "GenericParams": [ - { - "Types": [ - "System.String", - "System.Double" - ], - "MaxSimultaneous": 20 - } - ], - "Constructors": [ - { - "ParamTypes": [ - "TKey", - "TValue" - ] - } - ], - "Properties": [ - { - "Name": "Key", - "Get": {}, - "Set": {} - }, - { - "Name": "Value", - "Get": {}, - "Set": {} - } - ] + "Name": "UnityEngine.PrimitiveType" }, { - "Name": "System.Collections.Generic.LinkedListNode`1", - "GenericParams": [ - { - "Types": [ - "System.String" - ] - } - ], - "Constructors": [ - { - "ParamTypes": [ - "T" - ] - } - ], + "Name": "UnityEngine.Time", "Properties": [ { - "Name": "Value", + "Name": "deltaTime", "Get": {}, "Set": {} } ] }, { - "Name": " System.Runtime.CompilerServices.StrongBox`1", - "GenericParams": [ - { - "Types": [ - "System.String" - ] - } - ], - "Fields": [ - "Value" - ], - "Constructors": [ + "Name": "MyGame.AbstractBaseBallScript", + "BaseTypes": [ { - "ParamTypes": [ - "T" - ] + "BaseName": "MyGame.BaseBallScript", + "DerivedName": "MyGame.BallScript" } ] - }, - { - "Name": "System.Exception", - "Constructors": [ - { - "ParamTypes": [ - "System.String" - ] - } - ] - }, - { - "Name": "System.SystemException" - }, - { - "Name": "System.NullReferenceException" - }, - { - "Name": "UnityEngine.Screen", - "Properties": [ - { - "Name": "resolutions", - "Get": {} - } - ] - }, - { - "Name": "UnityEngine.Ray", - "MaxSimultaneous": 10, - "Constructors": [ - { - "ParamTypes": [ - "UnityEngine.Vector3", - "UnityEngine.Vector3" - ] - } - ] - }, - { - "Name": "UnityEngine.Physics", - "Methods": [ - { - "Name": "RaycastNonAlloc", - "ParamTypes": [ - "UnityEngine.Ray", - "UnityEngine.RaycastHit[]" - ] - }, - { - "Name": "RaycastAll", - "ParamTypes": [ - "UnityEngine.Ray" - ] - } - ] - }, - { - "Name": "UnityEngine.Gradient", - "Constructors": [ - { - "ParamTypes": [] - } - ], - "Properties": [ - { - "Name": "colorKeys", - "Get": {}, - "Set": {} - } - ] - }, - { - "Name": "System.AppDomainSetup", - "Constructors": [ - { - "ParamTypes": [] - } - ], - "Properties": [ - { - "Name": "AppDomainInitializer", - "Get": {}, - "Set": {} - } - ] - }, - { - "Name": "UnityEngine.Application", - "Events": [ - { - "Name": "onBeforeRender" - } - ] - }, - { - "Name": "UnityEngine.SceneManagement.SceneManager", - "Events": [ - { - "Name": "sceneLoaded" - } - ] - }, - { - "Name": "UnityEngine.SceneManagement.Scene" - }, - { - "Name": "UnityEngine.SceneManagement.LoadSceneMode" - }, - { - "Name": "System.EventArgs" - }, - { - "Name": "System.ComponentModel.Design.ComponentEventArgs" - }, - { - "Name": "System.ComponentModel.Design.ComponentChangingEventArgs" - }, - { - "Name": "System.ComponentModel.Design.ComponentChangedEventArgs" - }, - { - "Name": "System.ComponentModel.Design.ComponentRenameEventArgs" - }, - { - "Name": "System.ComponentModel.MemberDescriptor" - }, - { - "Name": "UnityEngine.PrimitiveType" - }, - { - "Name": "UnityEngine.Time", - "Properties": [ - { - "Name": "deltaTime", - "Get": {}, - "Set": {} - } - ] - }, - { - "Name": "System.IO.FileMode" - }, - { - "Name": "System.MarshalByRefObject" - }, - { - "Name": "System.IO.Stream" - }, - { - "Name": "System.Collections.Generic.IComparer`1", - "GenericParams": [ - { - "Types": [ - "System.Int32" - ] - }, - { - "Types": [ - "System.String" - ] - } - ], - "BaseTypes": [ - { - "GenericTypes": [ - "System.Int32" - ] - }, - { - "GenericTypes": [ - "System.String" - ] - } - ] - }, - { - "Name": "System.StringComparer", - "BaseTypes": [ - {} - ] - }, - { - "Name": "System.Collections.Queue", - "Properties": [ - { - "Name": "Count", - "Get": {}, - "Set": {} - } - ], - "BaseTypes": [ - { - "OverrideProperties": [ - { - "Name": "Count", - "Get": {}, - "Set": {} - } - ] - } - ] - }, - { - "Name": "System.ComponentModel.Design.IComponentChangeService", - "BaseTypes": [ - {} - ] - }, - { - "Name": "System.IO.FileStream", - "Methods": [ - { - "Name": "WriteByte", - "ParamTypes": [ - "System.Byte" - ] - } - ], - "Constructors": [ - { - "ParamTypes": [ - "System.String", - "System.IO.FileMode" - ] - } - ], - "BaseTypes": [ - { - "OverrideMethods": [ - { - "Name": "WriteByte", - "ParamTypes": [ - "System.Byte" - ] - } - ], - "Constructors": [ - { - "ParamTypes": [ - "System.String", - "System.IO.FileMode" - ] - } - ] - } - ] - }, - { - "Name": "UnityEngine.Playables.PlayableHandle" - }, - { - "Name": "UnityEngine.Experimental.UIElements.ITransform" - }, - { - "Name": "UnityEngine.Experimental.UIElements.IUIElementDataWatch" - }, - { - "Name": "UnityEngine.Experimental.UIElements.IVisualElementScheduler" - }, - { - "Name": "System.Collections.Generic.IEnumerator`1", - "GenericParams": [ - { - "Types": [ - "UnityEngine.Experimental.UIElements.VisualElement" - ] - } - ], - "Properties": [ - { - "Name": "Current", - "Get": {} - } - ] - }, - { - "Name": "System.Collections.Generic.IEnumerable`1", - "GenericParams": [ - { - "Types": [ - "UnityEngine.Experimental.UIElements.VisualElement" - ] - } - ], - "Methods": [ - { - "Name": "GetEnumerator", - "ParamTypes": [] - } - ] - }, - { - "Name": "UnityEngine.Experimental.UIElements.VisualElement" - }, - { - "Name": "UnityEngine.Experimental.UIElements.UQueryExtensions", - "Methods": [ - { - "Name": "Q", - "ParamTypes": [ - "UnityEngine.Experimental.UIElements.VisualElement", - "System.String", - "System.String[]" - ] - }, - { - "Name": "Q", - "ParamTypes": [ - "UnityEngine.Experimental.UIElements.VisualElement", - "System.String", - "System.String" - ] - } - ] - }, - { - "Name": "UnityEngine.XR.WSA.Input.InteractionSourcePositionAccuracy" - }, - { - "Name": "UnityEngine.XR.WSA.Input.InteractionSourceNode" - }, - { - "Name": "UnityEngine.XR.WSA.Input.InteractionSourcePose", - "Methods": [ - { - "Name": "TryGetRotation", - "ParamTypes": [ - "UnityEngine.Quaternion", - "UnityEngine.XR.WSA.Input.InteractionSourceNode" - ] - } - ] - }, - { - "Name": "System.Collections.Generic.IEnumerator`1", - "GenericParams": [ - { - "Types": [ - "System.String" - ] - }, - { - "Types": [ - "System.Int32" - ] - }, - { - "Types": [ - "System.Single" - ] - }, - { - "Types": [ - "UnityEngine.RaycastHit" - ] - }, - { - "Types": [ - "UnityEngine.GradientColorKey" - ] - }, - { - "Types": [ - "UnityEngine.Resolution" - ] - } - ], - "Properties": [ - { - "Name": "Current", - "Get": {} - } - ] - }, - { - "Name": "System.Collections.Generic.IEnumerable`1", - "GenericParams": [ - { - "Types": [ - "System.String" - ] - }, - { - "Types": [ - "System.Int32" - ] - }, - { - "Types": [ - "System.Single" - ] - }, - { - "Types": [ - "UnityEngine.RaycastHit" - ] - }, - { - "Types": [ - "UnityEngine.GradientColorKey" - ] - }, - { - "Types": [ - "UnityEngine.Resolution" - ] - } - ], - "Methods": [ - { - "Name": "GetEnumerator", - "ParamTypes": [] - } - ] - }, - { - "Name": "System.Collections.Generic.ICollection`1", - "GenericParams": [ - { - "Types": [ - "System.String" - ] - }, - { - "Types": [ - "System.Int32" - ] - }, - { - "Types": [ - "System.Single" - ] - }, - { - "Types": [ - "UnityEngine.RaycastHit" - ] - }, - { - "Types": [ - "UnityEngine.GradientColorKey" - ] - }, - { - "Types": [ - "UnityEngine.Resolution" - ] - } - ] - }, - { - "Name": "System.Collections.Generic.IList`1", - "GenericParams": [ - { - "Types": [ - "System.String" - ] - }, - { - "Types": [ - "System.Int32" - ] - }, - { - "Types": [ - "System.Single" - ] - }, - { - "Types": [ - "UnityEngine.RaycastHit" - ] - }, - { - "Types": [ - "UnityEngine.GradientColorKey" - ] - }, - { - "Types": [ - "UnityEngine.Resolution" - ] - } - ] - }, - { - "Name": "System.Collections.Generic.List`1", - "GenericParams": [ - { - "Types": [ - "System.String" - ] - }, - { - "Types": [ - "System.Int32" - ] - } - ], - "Constructors": [ - { - "ParamTypes": [] - } - ], - "Properties": [ - { - "Name": "Item", - "Get": {}, - "Set": {} - } - ], - "Methods": [ - { - "Name": "Add", - "ParamTypes": [ - "T" - ] - }, - { - "Name": "Sort", - "ParamTypes": [ - "System.Collections.Generic.IComparer`1" - ] - } - ] - }, - { - "Name": "System.Collections.ObjectModel.Collection`1", - "GenericParams": [ - { - "Types": [ - "System.Int32" - ] - } - ] - }, - { - "Name": "System.Collections.ObjectModel.KeyedCollection`2", - "GenericParams": [ - { - "Types": [ - "System.String", - "System.Int32" - ] - } - ] - } - ], - "MonoBehaviours": [ - { - "Name": "MyGame.MonoBehaviours.TestScript", - "Messages": [ - "Awake", - "OnAnimatorIK", - "OnCollisionEnter", - "Update" - ] - }, - { - "Name": "MyGame.MonoBehaviours.AnotherScript", - "Messages": [ - "Awake", - "Update" - ] } ], "Arrays": [ - { - "Type": "System.Int32" - }, - { - "Type": "System.Single", - "Ranks": [ 1, 2, 3 ] - }, - { - "Type": "System.String" - }, - { - "Type": "UnityEngine.Resolution" - }, - { - "Type": "UnityEngine.RaycastHit" - }, - { - "Type": "UnityEngine.GradientColorKey" - } ], "Delegates": [ - { - "Type": "System.Action" - }, - { - "Type": "System.Action`1", - "GenericParams": [ - { - "Types": [ - "System.Single" - ] - } - ] - }, - { - "Type": "System.Action`2", - "GenericParams": [ - { - "Types": [ - "System.Single", - "System.Single" - ], - "MaxSimultaneous": 100 - } - ] - }, - { - "Type": "System.Func`3", - "GenericParams": [ - { - "Types": [ - "System.Int32", - "System.Single", - "System.Double" - ], - "MaxSimultaneous": 50 - }, - { - "Types": [ - "System.Int16", - "System.Int32", - "System.String" - ], - "MaxSimultaneous": 25 - } - ] - }, - { - "Type": "System.AppDomainInitializer" - }, - { - "Type": "UnityEngine.Events.UnityAction" - }, - { - "Type": "UnityEngine.Events.UnityAction`2", - "GenericParams": [ - { - "Types": [ - "UnityEngine.SceneManagement.Scene", - "UnityEngine.SceneManagement.LoadSceneMode" - ], - "MaxSimultaneous": 10 - } - ] - }, - { - "Type": "System.ComponentModel.Design.ComponentEventHandler" - }, - { - "Type": "System.ComponentModel.Design.ComponentChangingEventHandler" - }, - { - "Type": "System.ComponentModel.Design.ComponentChangedEventHandler" - }, - { - "Type": "System.ComponentModel.Design.ComponentRenameEventHandler" - } ] } \ No newline at end of file diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/CppSource/Game/Game.cpp index d38131c..a8baeff 100644 --- a/Unity/CppSource/Game/Game.cpp +++ b/Unity/CppSource/Game/Game.cpp @@ -9,6 +9,7 @@ /// #include "Bindings.h" +#include "Game.h" using namespace System; using namespace UnityEngine; @@ -17,13 +18,46 @@ namespace { struct GameState { - int32_t NumCreated; - float Dir; + float BallDir; }; GameState* gameState; } +namespace MyGame +{ + void BallScript::Update() + { + Transform transform = GetTransform(); + Vector3 pos = transform.GetPosition(); + const float speed = 1.2f; + const float min = -1.5f; + const float max = 1.5f; + float distance = Time::GetDeltaTime() * speed * gameState->BallDir; + Vector3 offset(distance, 0, 0); + Vector3 newPos = pos + offset; + if (newPos.x > max) + { + gameState->BallDir *= -1.0f; + newPos.x = max - (newPos.x - max); + if (newPos.x < min) + { + newPos.x = min; + } + } + else if (newPos.x < min) + { + gameState->BallDir *= -1.0f; + newPos.x = min + (min - newPos.x); + if (newPos.x > max) + { + newPos.x = max; + } + } + transform.SetPosition(newPos); + } +} + // Called when the plugin is initialized // This is mostly full of test code. Feel free to remove it all. void PluginMain( @@ -37,88 +71,15 @@ void PluginMain( String message("Game booted up"); Debug::Log(message); - gameState->NumCreated = 0; - gameState->Dir = 1.0f; + // The ball initially goes right + gameState->BallDir = 1.0f; - String name("GameObject with a TestScript"); - GameObject go(name); - go.AddComponent(); - } -} - -void MyGame::MonoBehaviours::TestScript::Awake() -{ - String message("C++ TestScript Awake"); - Debug::Log(message); -} - -void MyGame::MonoBehaviours::TestScript::OnAnimatorIK(Int32 param0) -{ - String message("C++ TestScript OnAnimatorIK"); - Debug::Log(message); -} - -void MyGame::MonoBehaviours::TestScript::OnCollisionEnter(UnityEngine::Collision& param0) -{ - String message("C++ TestScript OnCollisionEnter"); - Debug::Log(message); -} - -void MyGame::MonoBehaviours::TestScript::Update() -{ - if (gameState->NumCreated < 10) - { - GameObject go; - Transform transform = go.GetTransform(); - float comp = (float)gameState->NumCreated; - Vector3 position(comp, comp*10.0f, comp*100.0f); - transform.SetPosition(position); - gameState->NumCreated++; - if (gameState->NumCreated == 10) - { - String message("Done spawning game objects"); - Debug::Log(message); - - GameObject go = GameObject::CreatePrimitive(PrimitiveType::Sphere); - String name("GameObject with an AnotherScript"); - go.SetName(name); - go.AddComponent(); - } - } -} - -void MyGame::MonoBehaviours::AnotherScript::Awake() -{ - String message("C++ AnotherScript Awake"); - Debug::Log(message); -} - -void MyGame::MonoBehaviours::AnotherScript::Update() -{ - Transform transform = GetTransform(); - Vector3 pos = transform.GetPosition(); - const float speed = 0.0012f; - const float min = -1.5f; - const float max = 1.5f; - Vector3 offset(Time::GetDeltaTime() * speed * gameState->Dir, 0, 0); - Vector3 newPos = pos + offset; - if (newPos.x > max) - { - gameState->Dir *= -1.0f; - newPos.x = max - (newPos.x - max); - if (newPos.x < min) - { - newPos.x = min; - } - } - else if (newPos.x < min) - { - gameState->Dir *= -1.0f; - newPos.x = min + (min - newPos.x); - if (newPos.x > max) - { - newPos.x = max; - } + // Create the ball game object out of a sphere primitive + GameObject go = GameObject::CreatePrimitive(PrimitiveType::Sphere); + String name("GameObject with a BallScript"); + go.SetName(name); + + // Attach the ball script to make it bounce back and forth + go.AddComponent(); } - transform.SetPosition(newPos); } diff --git a/Unity/CppSource/Game/Game.h b/Unity/CppSource/Game/Game.h new file mode 100644 index 0000000..a8e6e5b --- /dev/null +++ b/Unity/CppSource/Game/Game.h @@ -0,0 +1,22 @@ +/// +/// Declaration of the game types the bindings layer needs to know about +/// +/// +/// Jackson Dunstan, 2018, http://JacksonDunstan.com +/// +/// +/// MIT +/// + +#pragma once + +#include "Bindings.h" + +namespace MyGame +{ + struct BallScript : MyGame::BaseBallScript + { + MY_GAME_BALL_SCRIPT_DEFAULT_CONSTRUCTOR + void Update() override; + }; +} diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 795eec0..e9f1568 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -12,6 +12,9 @@ // Type definitions #include "Bindings.h" +// Game type definitions +#include "Game.h" + // For assert() #include @@ -24,6 +27,12 @@ // For memset(), etc. #include +// Support placement new +void* operator new(size_t, void* p) +{ + return p; +} + // Macro to put before functions that need to be exposed to C# #ifdef _WIN32 #define DLLEXPORT extern "C" __declspec(dllexport) @@ -44,171 +53,27 @@ namespace Plugin int32_t (*EnumerableGetEnumerator)(int32_t handle); /*BEGIN FUNCTION POINTERS*/ - System::Int32 (*SystemIComparableMethodCompareToSystemObject)(int32_t thisHandle, int32_t objHandle); - void (*SystemIDisposableMethodDispose)(int32_t thisHandle); UnityEngine::Vector3 (*UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z); - System::Single (*UnityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz); - void (*UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ); UnityEngine::Vector3 (*UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b); - UnityEngine::Vector3 (*UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a); int32_t (*BoxVector3)(UnityEngine::Vector3& val); UnityEngine::Vector3 (*UnboxVector3)(int32_t valHandle); int32_t (*UnityEngineObjectPropertyGetName)(int32_t thisHandle); void (*UnityEngineObjectPropertySetName)(int32_t thisHandle, int32_t valueHandle); - int32_t (*UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject)(int32_t xHandle, int32_t yHandle); - int32_t (*UnityEngineObjectMethodop_ImplicitUnityEngineObject)(int32_t existsHandle); int32_t (*UnityEngineComponentPropertyGetTransform)(int32_t thisHandle); UnityEngine::Vector3 (*UnityEngineTransformPropertyGetPosition)(int32_t thisHandle); void (*UnityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value); - void (*UnityEngineTransformMethodSetParentUnityEngineTransform)(int32_t thisHandle, int32_t parentHandle); - int32_t (*BoxColor)(UnityEngine::Color& val); - UnityEngine::Color (*UnboxColor)(int32_t valHandle); - int32_t (*BoxGradientColorKey)(UnityEngine::GradientColorKey& val); - UnityEngine::GradientColorKey (*UnboxGradientColorKey)(int32_t valHandle); - void (*ReleaseUnityEngineResolution)(int32_t handle); - int32_t (*UnityEngineResolutionConstructor)(); - System::Int32 (*UnityEngineResolutionPropertyGetWidth)(int32_t thisHandle); - void (*UnityEngineResolutionPropertySetWidth)(int32_t thisHandle, int32_t value); - System::Int32 (*UnityEngineResolutionPropertyGetHeight)(int32_t thisHandle); - void (*UnityEngineResolutionPropertySetHeight)(int32_t thisHandle, int32_t value); - System::Int32 (*UnityEngineResolutionPropertyGetRefreshRate)(int32_t thisHandle); - void (*UnityEngineResolutionPropertySetRefreshRate)(int32_t thisHandle, int32_t value); - int32_t (*BoxResolution)(int32_t valHandle); - int32_t (*UnboxResolution)(int32_t valHandle); - void (*ReleaseUnityEngineRaycastHit)(int32_t handle); - UnityEngine::Vector3 (*UnityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle); - void (*UnityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value); - int32_t (*UnityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle); - int32_t (*BoxRaycastHit)(int32_t valHandle); - int32_t (*UnboxRaycastHit)(int32_t valHandle); int32_t (*SystemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle); int32_t (*SystemCollectionsIEnumeratorMethodMoveNext)(int32_t thisHandle); - void (*ReleaseUnityEnginePlayablesPlayableGraph)(int32_t handle); - int32_t (*BoxPlayableGraph)(int32_t valHandle); - int32_t (*UnboxPlayableGraph)(int32_t valHandle); - void (*ReleaseUnityEngineAnimationsAnimationMixerPlayable)(int32_t handle); - int32_t (*UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)(int32_t graphHandle, int32_t inputCount, uint32_t normalizeWeights); - int32_t (*BoxAnimationMixerPlayable)(int32_t valHandle); - int32_t (*UnboxAnimationMixerPlayable)(int32_t valHandle); - int32_t (*SystemDiagnosticsStopwatchConstructor)(); - System::Int64 (*SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle); - void (*SystemDiagnosticsStopwatchMethodStart)(int32_t thisHandle); - void (*SystemDiagnosticsStopwatchMethodReset)(int32_t thisHandle); - int32_t (*UnityEngineGameObjectConstructor)(); - int32_t (*UnityEngineGameObjectConstructorSystemString)(int32_t nameHandle); - int32_t (*UnityEngineGameObjectPropertyGetTransform)(int32_t thisHandle); - int32_t (*UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle); - int32_t (*UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript)(int32_t thisHandle); + int32_t (*UnityEngineGameObjectMethodAddComponentMyGameBaseBallScript)(int32_t thisHandle); int32_t (*UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)(UnityEngine::PrimitiveType type); void (*UnityEngineDebugMethodLogSystemObject)(int32_t messageHandle); - int32_t (*UnityEngineAssertionsAssertFieldGetRaiseExceptions)(); - void (*UnityEngineAssertionsAssertFieldSetRaiseExceptions)(uint32_t value); - void (*UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString)(int32_t expectedHandle, int32_t actualHandle); - void (*UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject)(int32_t expectedHandle, int32_t actualHandle); int32_t (*UnityEngineMonoBehaviourPropertyGetTransform)(int32_t thisHandle); - void (*UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)(int32_t* bufferLength, int32_t* numBuffers); - void (*UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)(int32_t hostId, int32_t* addressHandle, int32_t* port, uint8_t* error); - void (*UnityEngineNetworkingNetworkTransportMethodInit)(); - int32_t (*BoxQuaternion)(UnityEngine::Quaternion& val); - UnityEngine::Quaternion (*UnboxQuaternion)(int32_t valHandle); - System::Single (*UnityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column); - void (*UnityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value); - int32_t (*BoxMatrix4x4)(UnityEngine::Matrix4x4& val); - UnityEngine::Matrix4x4 (*UnboxMatrix4x4)(int32_t valHandle); - int32_t (*BoxQueryTriggerInteraction)(UnityEngine::QueryTriggerInteraction val); - UnityEngine::QueryTriggerInteraction (*UnboxQueryTriggerInteraction)(int32_t valHandle); - void (*ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)(int32_t handle); - int32_t (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble)(int32_t keyHandle, double value); - int32_t (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)(int32_t thisHandle); - System::Double (*SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle); - int32_t (*BoxKeyValuePairSystemString_SystemDouble)(int32_t valHandle); - int32_t (*UnboxKeyValuePairSystemString_SystemDouble)(int32_t valHandle); - int32_t (*SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)(int32_t valueHandle); - int32_t (*SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue)(int32_t thisHandle); - void (*SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue)(int32_t thisHandle, int32_t valueHandle); - int32_t (*SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString)(int32_t valueHandle); - int32_t (*SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)(int32_t thisHandle); - void (*SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)(int32_t thisHandle, int32_t valueHandle); int32_t (*SystemExceptionConstructorSystemString)(int32_t messageHandle); - int32_t (*UnityEngineScreenPropertyGetResolutions)(); - void (*ReleaseUnityEngineRay)(int32_t handle); - int32_t (*UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); - int32_t (*BoxRay)(int32_t valHandle); - int32_t (*UnboxRay)(int32_t valHandle); - System::Int32 (*UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1)(int32_t rayHandle, int32_t resultsHandle); - int32_t (*UnityEnginePhysicsMethodRaycastAllUnityEngineRay)(int32_t rayHandle); - int32_t (*UnityEngineGradientConstructor)(); - int32_t (*UnityEngineGradientPropertyGetColorKeys)(int32_t thisHandle); - void (*UnityEngineGradientPropertySetColorKeys)(int32_t thisHandle, int32_t valueHandle); - int32_t (*SystemAppDomainSetupConstructor)(); - int32_t (*SystemAppDomainSetupPropertyGetAppDomainInitializer)(int32_t thisHandle); - void (*SystemAppDomainSetupPropertySetAppDomainInitializer)(int32_t thisHandle, int32_t valueHandle); - void (*UnityEngineApplicationAddEventOnBeforeRender)(int32_t delHandle); - void (*UnityEngineApplicationRemoveEventOnBeforeRender)(int32_t delHandle); - void (*UnityEngineSceneManagementSceneManagerAddEventSceneLoaded)(int32_t delHandle); - void (*UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)(int32_t delHandle); - void (*ReleaseUnityEngineSceneManagementScene)(int32_t handle); - int32_t (*BoxScene)(int32_t valHandle); - int32_t (*UnboxScene)(int32_t valHandle); - int32_t (*BoxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val); - UnityEngine::SceneManagement::LoadSceneMode (*UnboxLoadSceneMode)(int32_t valHandle); int32_t (*BoxPrimitiveType)(UnityEngine::PrimitiveType val); UnityEngine::PrimitiveType (*UnboxPrimitiveType)(int32_t valHandle); System::Single (*UnityEngineTimePropertyGetDeltaTime)(); - int32_t (*BoxFileMode)(System::IO::FileMode val); - System::IO::FileMode (*UnboxFileMode)(int32_t valHandle); - void (*ReleaseSystemCollectionsGenericBaseIComparerSystemInt32)(int32_t handle); - void (*SystemCollectionsGenericBaseIComparerSystemInt32Constructor)(int32_t cppHandle, int32_t* handle); - void (*ReleaseSystemCollectionsGenericBaseIComparerSystemString)(int32_t handle); - void (*SystemCollectionsGenericBaseIComparerSystemStringConstructor)(int32_t cppHandle, int32_t* handle); - void (*ReleaseSystemBaseStringComparer)(int32_t handle); - void (*SystemBaseStringComparerConstructor)(int32_t cppHandle, int32_t* handle); - System::Int32 (*SystemCollectionsQueuePropertyGetCount)(int32_t thisHandle); - void (*ReleaseSystemCollectionsBaseQueue)(int32_t handle); - void (*SystemCollectionsBaseQueueConstructor)(int32_t cppHandle, int32_t* handle); - void (*ReleaseSystemComponentModelDesignBaseIComponentChangeService)(int32_t handle); - void (*SystemComponentModelDesignBaseIComponentChangeServiceConstructor)(int32_t cppHandle, int32_t* handle); - int32_t (*SystemIOFileStreamConstructorSystemString_SystemIOFileMode)(int32_t pathHandle, System::IO::FileMode mode); - void (*SystemIOFileStreamMethodWriteByteSystemByte)(int32_t thisHandle, uint8_t value); - void (*ReleaseSystemIOBaseFileStream)(int32_t handle); - void (*SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode)(int32_t cppHandle, int32_t* handle, int32_t pathHandle, System::IO::FileMode mode); - void (*ReleaseUnityEnginePlayablesPlayableHandle)(int32_t handle); - int32_t (*BoxPlayableHandle)(int32_t valHandle); - int32_t (*UnboxPlayableHandle)(int32_t valHandle); - int32_t (*SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator)(int32_t thisHandle); - int32_t (*UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1)(int32_t eHandle, int32_t nameHandle, int32_t classesHandle); - int32_t (*UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString)(int32_t eHandle, int32_t nameHandle, int32_t classNameHandle); - int32_t (*BoxInteractionSourcePositionAccuracy)(UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy val); - UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy (*UnboxInteractionSourcePositionAccuracy)(int32_t valHandle); - int32_t (*BoxInteractionSourceNode)(UnityEngine::XR::WSA::Input::InteractionSourceNode val); - UnityEngine::XR::WSA::Input::InteractionSourceNode (*UnboxInteractionSourceNode)(int32_t valHandle); - void (*ReleaseUnityEngineXRWSAInputInteractionSourcePose)(int32_t handle); - int32_t (*UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode)(int32_t thisHandle, UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node); - int32_t (*BoxInteractionSourcePose)(int32_t valHandle); - int32_t (*UnboxInteractionSourcePose)(int32_t valHandle); - int32_t (*SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent)(int32_t thisHandle); - System::Int32 (*SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent)(int32_t thisHandle); - System::Single (*SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent)(int32_t thisHandle); - UnityEngine::GradientColorKey (*SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator)(int32_t thisHandle); - int32_t (*SystemCollectionsGenericListSystemStringConstructor)(); - int32_t (*SystemCollectionsGenericListSystemStringPropertyGetItem)(int32_t thisHandle, int32_t index); - void (*SystemCollectionsGenericListSystemStringPropertySetItem)(int32_t thisHandle, int32_t index, int32_t valueHandle); - void (*SystemCollectionsGenericListSystemStringMethodAddSystemString)(int32_t thisHandle, int32_t itemHandle); - void (*SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle); - int32_t (*SystemCollectionsGenericListSystemInt32Constructor)(); - System::Int32 (*SystemCollectionsGenericListSystemInt32PropertyGetItem)(int32_t thisHandle, int32_t index); - void (*SystemCollectionsGenericListSystemInt32PropertySetItem)(int32_t thisHandle, int32_t index, int32_t value); - void (*SystemCollectionsGenericListSystemInt32MethodAddSystemInt32)(int32_t thisHandle, int32_t item); - void (*SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle); + void (*ReleaseBaseBallScript)(int32_t handle); + void (*BaseBallScriptConstructor)(int32_t cppHandle, int32_t* handle); int32_t (*BoxBoolean)(uint32_t val); int32_t (*UnboxBoolean)(int32_t valHandle); int32_t (*BoxSByte)(int8_t val); @@ -233,92 +98,6 @@ namespace Plugin System::Single (*UnboxSingle)(int32_t valHandle); int32_t (*BoxDouble)(double val); System::Double (*UnboxDouble)(int32_t valHandle); - int32_t (*SystemSystemInt32Array1Constructor1)(int32_t length0); - System::Int32 (*SystemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0); - int32_t (*SystemInt32Array1SetItem1)(int32_t thisHandle, int32_t index0, int32_t item); - int32_t (*SystemSystemSingleArray1Constructor1)(int32_t length0); - System::Single (*SystemSingleArray1GetItem1)(int32_t thisHandle, int32_t index0); - int32_t (*SystemSingleArray1SetItem1)(int32_t thisHandle, int32_t index0, float item); - int32_t (*SystemSystemSingleArray2Constructor2)(int32_t length0, int32_t length1); - int32_t (*SystemSystemSingleArray2GetLength2)(int32_t thisHandle, int32_t dimension); - System::Single (*SystemSingleArray2GetItem2)(int32_t thisHandle, int32_t index0, int32_t index1); - int32_t (*SystemSingleArray2SetItem2)(int32_t thisHandle, int32_t index0, int32_t index1, float item); - int32_t (*SystemSystemSingleArray3Constructor3)(int32_t length0, int32_t length1, int32_t length2); - int32_t (*SystemSystemSingleArray3GetLength3)(int32_t thisHandle, int32_t dimension); - System::Single (*SystemSingleArray3GetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2); - int32_t (*SystemSingleArray3SetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2, float item); - int32_t (*SystemSystemStringArray1Constructor1)(int32_t length0); - int32_t (*SystemStringArray1GetItem1)(int32_t thisHandle, int32_t index0); - int32_t (*SystemStringArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle); - int32_t (*UnityEngineUnityEngineResolutionArray1Constructor1)(int32_t length0); - int32_t (*UnityEngineResolutionArray1GetItem1)(int32_t thisHandle, int32_t index0); - int32_t (*UnityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle); - int32_t (*UnityEngineUnityEngineRaycastHitArray1Constructor1)(int32_t length0); - int32_t (*UnityEngineRaycastHitArray1GetItem1)(int32_t thisHandle, int32_t index0); - int32_t (*UnityEngineRaycastHitArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle); - int32_t (*UnityEngineUnityEngineGradientColorKeyArray1Constructor1)(int32_t length0); - UnityEngine::GradientColorKey (*UnityEngineGradientColorKeyArray1GetItem1)(int32_t thisHandle, int32_t index0); - int32_t (*UnityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item); - void (*ReleaseSystemAction)(int32_t handle, int32_t classHandle); - void (*SystemActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*SystemActionAdd)(int32_t thisHandle, int32_t delHandle); - void (*SystemActionRemove)(int32_t thisHandle, int32_t delHandle); - void (*SystemActionInvoke)(int32_t thisHandle); - void (*ReleaseSystemActionSystemSingle)(int32_t handle, int32_t classHandle); - void (*SystemActionSystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*SystemActionSystemSingleAdd)(int32_t thisHandle, int32_t delHandle); - void (*SystemActionSystemSingleRemove)(int32_t thisHandle, int32_t delHandle); - void (*SystemActionSystemSingleInvoke)(int32_t thisHandle, float obj); - void (*ReleaseSystemActionSystemSingle_SystemSingle)(int32_t handle, int32_t classHandle); - void (*SystemActionSystemSingle_SystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*SystemActionSystemSingle_SystemSingleAdd)(int32_t thisHandle, int32_t delHandle); - void (*SystemActionSystemSingle_SystemSingleRemove)(int32_t thisHandle, int32_t delHandle); - void (*SystemActionSystemSingle_SystemSingleInvoke)(int32_t thisHandle, float arg1, float arg2); - void (*ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble)(int32_t handle, int32_t classHandle); - void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd)(int32_t thisHandle, int32_t delHandle); - void (*SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove)(int32_t thisHandle, int32_t delHandle); - System::Double (*SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)(int32_t thisHandle, int32_t arg1, float arg2); - void (*ReleaseSystemFuncSystemInt16_SystemInt32_SystemString)(int32_t handle, int32_t classHandle); - void (*SystemFuncSystemInt16_SystemInt32_SystemStringConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*SystemFuncSystemInt16_SystemInt32_SystemStringAdd)(int32_t thisHandle, int32_t delHandle); - void (*SystemFuncSystemInt16_SystemInt32_SystemStringRemove)(int32_t thisHandle, int32_t delHandle); - int32_t (*SystemFuncSystemInt16_SystemInt32_SystemStringInvoke)(int32_t thisHandle, int16_t arg1, int32_t arg2); - void (*ReleaseSystemAppDomainInitializer)(int32_t handle, int32_t classHandle); - void (*SystemAppDomainInitializerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*SystemAppDomainInitializerAdd)(int32_t thisHandle, int32_t delHandle); - void (*SystemAppDomainInitializerRemove)(int32_t thisHandle, int32_t delHandle); - void (*SystemAppDomainInitializerInvoke)(int32_t thisHandle, int32_t argsHandle); - void (*ReleaseUnityEngineEventsUnityAction)(int32_t handle, int32_t classHandle); - void (*UnityEngineEventsUnityActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*UnityEngineEventsUnityActionAdd)(int32_t thisHandle, int32_t delHandle); - void (*UnityEngineEventsUnityActionRemove)(int32_t thisHandle, int32_t delHandle); - void (*UnityEngineEventsUnityActionInvoke)(int32_t thisHandle); - void (*ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode)(int32_t handle, int32_t classHandle); - void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)(int32_t thisHandle, int32_t delHandle); - void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle); - void (*UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, int32_t arg0Handle, UnityEngine::SceneManagement::LoadSceneMode arg1); - void (*ReleaseSystemComponentModelDesignComponentEventHandler)(int32_t handle, int32_t classHandle); - void (*SystemComponentModelDesignComponentEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*SystemComponentModelDesignComponentEventHandlerAdd)(int32_t thisHandle, int32_t delHandle); - void (*SystemComponentModelDesignComponentEventHandlerRemove)(int32_t thisHandle, int32_t delHandle); - void (*SystemComponentModelDesignComponentEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle); - void (*ReleaseSystemComponentModelDesignComponentChangingEventHandler)(int32_t handle, int32_t classHandle); - void (*SystemComponentModelDesignComponentChangingEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*SystemComponentModelDesignComponentChangingEventHandlerAdd)(int32_t thisHandle, int32_t delHandle); - void (*SystemComponentModelDesignComponentChangingEventHandlerRemove)(int32_t thisHandle, int32_t delHandle); - void (*SystemComponentModelDesignComponentChangingEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle); - void (*ReleaseSystemComponentModelDesignComponentChangedEventHandler)(int32_t handle, int32_t classHandle); - void (*SystemComponentModelDesignComponentChangedEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*SystemComponentModelDesignComponentChangedEventHandlerAdd)(int32_t thisHandle, int32_t delHandle); - void (*SystemComponentModelDesignComponentChangedEventHandlerRemove)(int32_t thisHandle, int32_t delHandle); - void (*SystemComponentModelDesignComponentChangedEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle); - void (*ReleaseSystemComponentModelDesignComponentRenameEventHandler)(int32_t handle, int32_t classHandle); - void (*SystemComponentModelDesignComponentRenameEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle); - void (*SystemComponentModelDesignComponentRenameEventHandlerAdd)(int32_t thisHandle, int32_t delHandle); - void (*SystemComponentModelDesignComponentRenameEventHandlerRemove)(int32_t thisHandle, int32_t delHandle); - void (*SystemComponentModelDesignComponentRenameEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle); /*END FUNCTION POINTERS*/ } @@ -949,777 +728,870 @@ namespace Plugin } /*BEGIN GLOBAL STATE AND FUNCTIONS*/ - int32_t RefCountsLenUnityEngineResolution; - int32_t* RefCountsUnityEngineResolution; + // Free list for MyGame::BaseBallScript pointers - void ReferenceManagedUnityEngineResolution(int32_t handle) + int32_t BaseBallScriptFreeListSize; + MyGame::BaseBallScript** BaseBallScriptFreeList; + MyGame::BaseBallScript** NextFreeBaseBallScript; + + int32_t StoreBaseBallScript(MyGame::BaseBallScript* del) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineResolution); - if (handle != 0) - { - RefCountsUnityEngineResolution[handle]++; - } + assert(NextFreeBaseBallScript != nullptr); + MyGame::BaseBallScript** pNext = NextFreeBaseBallScript; + NextFreeBaseBallScript = (MyGame::BaseBallScript**)*pNext; + *pNext = del; + return (int32_t)(pNext - BaseBallScriptFreeList); } - void DereferenceManagedUnityEngineResolution(int32_t handle) + MyGame::BaseBallScript* GetBaseBallScript(int32_t handle) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineResolution); - if (handle != 0) - { - int32_t numRemain = --RefCountsUnityEngineResolution[handle]; - if (numRemain == 0) - { - ReleaseUnityEngineResolution(handle); - } - } + assert(handle >= 0 && handle < BaseBallScriptFreeListSize); + return BaseBallScriptFreeList[handle]; + } + + void RemoveBaseBallScript(int32_t handle) + { + MyGame::BaseBallScript** pRelease = BaseBallScriptFreeList + handle; + *pRelease = (MyGame::BaseBallScript*)NextFreeBaseBallScript; + NextFreeBaseBallScript = pRelease; } - int32_t RefCountsLenUnityEngineRaycastHit; - int32_t* RefCountsUnityEngineRaycastHit; + // Free list for whole MyGame::BaseBallScript objects - void ReferenceManagedUnityEngineRaycastHit(int32_t handle) + union BaseBallScriptFreeWholeListEntry { - assert(handle >= 0 && handle < RefCountsLenUnityEngineRaycastHit); - if (handle != 0) - { - RefCountsUnityEngineRaycastHit[handle]++; - } + BaseBallScriptFreeWholeListEntry* Next; + MyGame::BaseBallScript Value; + }; + int32_t BaseBallScriptFreeWholeListSize; + BaseBallScriptFreeWholeListEntry* BaseBallScriptFreeWholeList; + BaseBallScriptFreeWholeListEntry* NextFreeWholeBaseBallScript; + + MyGame::BaseBallScript* StoreWholeBaseBallScript() + { + assert(NextFreeWholeBaseBallScript != nullptr); + BaseBallScriptFreeWholeListEntry* pNext = NextFreeWholeBaseBallScript; + NextFreeWholeBaseBallScript = pNext->Next; + return &pNext->Value; } - void DereferenceManagedUnityEngineRaycastHit(int32_t handle) + void RemoveWholeBaseBallScript(MyGame::BaseBallScript* instance) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineRaycastHit); - if (handle != 0) + BaseBallScriptFreeWholeListEntry* pRelease = (BaseBallScriptFreeWholeListEntry*)instance; + if (pRelease >= BaseBallScriptFreeWholeList && pRelease < BaseBallScriptFreeWholeList + (BaseBallScriptFreeWholeListSize - 1)) { - int32_t numRemain = --RefCountsUnityEngineRaycastHit[handle]; - if (numRemain == 0) - { - ReleaseUnityEngineRaycastHit(handle); - } + pRelease->Next = NextFreeWholeBaseBallScript; + NextFreeWholeBaseBallScript = pRelease->Next; } } + /*END GLOBAL STATE AND FUNCTIONS*/ +} + +namespace Plugin +{ + // An unhandled exception caused by C++ calling into C# + System::Exception* unhandledCsharpException = nullptr; +} + +//////////////////////////////////////////////////////////////// +// Mirrors of C# types. These wrap the C# functions to present +// a similiar API as in C#. +//////////////////////////////////////////////////////////////// + +namespace System +{ + Object::Object() + : Plugin::ManagedType(nullptr) + { + } - int32_t RefCountsLenUnityEnginePlayablesPlayableGraph; - int32_t* RefCountsUnityEnginePlayablesPlayableGraph; + Object::Object(Plugin::InternalUse iu, int32_t handle) + : ManagedType(Plugin::InternalUse::Only, handle) + { + } - void ReferenceManagedUnityEnginePlayablesPlayableGraph(int32_t handle) + Object::Object(decltype(nullptr)) + : ManagedType(nullptr) { - assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableGraph); - if (handle != 0) - { - RefCountsUnityEnginePlayablesPlayableGraph[handle]++; - } } - void DereferenceManagedUnityEnginePlayablesPlayableGraph(int32_t handle) + bool Object::operator==(decltype(nullptr)) const { - assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableGraph); - if (handle != 0) - { - int32_t numRemain = --RefCountsUnityEnginePlayablesPlayableGraph[handle]; - if (numRemain == 0) - { - ReleaseUnityEnginePlayablesPlayableGraph(handle); - } - } + return Handle == 0; } - int32_t RefCountsLenUnityEngineAnimationsAnimationMixerPlayable; - int32_t* RefCountsUnityEngineAnimationsAnimationMixerPlayable; + bool Object::operator!=(decltype(nullptr)) const + { + return Handle != 0; + } - void ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(int32_t handle) + void Object::ThrowReferenceToThis() { - assert(handle >= 0 && handle < RefCountsLenUnityEngineAnimationsAnimationMixerPlayable); - if (handle != 0) - { - RefCountsUnityEngineAnimationsAnimationMixerPlayable[handle]++; - } + throw *this; } - void DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(int32_t handle) + ValueType::ValueType(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineAnimationsAnimationMixerPlayable); - if (handle != 0) - { - int32_t numRemain = --RefCountsUnityEngineAnimationsAnimationMixerPlayable[handle]; - if (numRemain == 0) - { - ReleaseUnityEngineAnimationsAnimationMixerPlayable(handle); - } - } } - int32_t RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; - int32_t* RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; + ValueType::ValueType(decltype(nullptr)) + : Object(nullptr) + { + } - void ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int32_t handle) + Enum::Enum(Plugin::InternalUse iu, int32_t handle) + : ValueType(iu, handle) { - assert(handle >= 0 && handle < RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble); - if (handle != 0) - { - RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble[handle]++; - } } - void DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(int32_t handle) + Enum::Enum(decltype(nullptr)) + : ValueType(nullptr) { - assert(handle >= 0 && handle < RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble); - if (handle != 0) - { - int32_t numRemain = --RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble[handle]; - if (numRemain == 0) - { - ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(handle); - } - } } - int32_t RefCountsLenUnityEngineRay; - int32_t* RefCountsUnityEngineRay; + String::String(decltype(nullptr)) + : Object(Plugin::InternalUse::Only, 0) + { + } - void ReferenceManagedUnityEngineRay(int32_t handle) + String::String(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineRay); - if (handle != 0) + if (handle) { - RefCountsUnityEngineRay[handle]++; + Plugin::ReferenceManagedClass(handle); } } - void DereferenceManagedUnityEngineRay(int32_t handle) + String::String(const String& other) + : Object(Plugin::InternalUse::Only, other.Handle) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineRay); - if (handle != 0) + if (Handle) { - int32_t numRemain = --RefCountsUnityEngineRay[handle]; - if (numRemain == 0) - { - ReleaseUnityEngineRay(handle); - } + Plugin::ReferenceManagedClass(Handle); } } - int32_t RefCountsLenUnityEngineSceneManagementScene; - int32_t* RefCountsUnityEngineSceneManagementScene; + String::String(String&& other) + : Object(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } - void ReferenceManagedUnityEngineSceneManagementScene(int32_t handle) + String::~String() { - assert(handle >= 0 && handle < RefCountsLenUnityEngineSceneManagementScene); - if (handle != 0) + if (Handle) { - RefCountsUnityEngineSceneManagementScene[handle]++; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } - void DereferenceManagedUnityEngineSceneManagementScene(int32_t handle) + String& String::operator=(const String& other) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineSceneManagementScene); - if (handle != 0) + if (Handle != other.Handle) { - int32_t numRemain = --RefCountsUnityEngineSceneManagementScene[handle]; - if (numRemain == 0) + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + if (Handle) { - ReleaseUnityEngineSceneManagementScene(handle); + Plugin::ReferenceManagedClass(Handle); } } + return *this; } - int32_t SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize; - System::Collections::Generic::BaseIComparer** SystemCollectionsGenericBaseIComparerSystemInt32FreeList; - System::Collections::Generic::BaseIComparer** NextFreeSystemCollectionsGenericBaseIComparerSystemInt32; - - int32_t StoreSystemCollectionsGenericBaseIComparerSystemInt32(System::Collections::Generic::BaseIComparer* del) + String& String::operator=(decltype(nullptr)) { - assert(NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 != nullptr); - System::Collections::Generic::BaseIComparer** pNext = NextFreeSystemCollectionsGenericBaseIComparerSystemInt32; - NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 = (System::Collections::Generic::BaseIComparer**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemCollectionsGenericBaseIComparerSystemInt32FreeList); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - System::Collections::Generic::BaseIComparer* GetSystemCollectionsGenericBaseIComparerSystemInt32(int32_t handle) + String& String::operator=(String&& other) { - assert(handle >= 0 && handle < SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize); - return SystemCollectionsGenericBaseIComparerSystemInt32FreeList[handle]; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - void RemoveSystemCollectionsGenericBaseIComparerSystemInt32(int32_t handle) + String::String(const char* chars) + : Object(Plugin::InternalUse::Only, Plugin::StringNew(chars)) { - System::Collections::Generic::BaseIComparer** pRelease = SystemCollectionsGenericBaseIComparerSystemInt32FreeList + handle; - *pRelease = (System::Collections::Generic::BaseIComparer*)NextFreeSystemCollectionsGenericBaseIComparerSystemInt32; - NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 = pRelease; } - int32_t SystemCollectionsGenericBaseIComparerSystemStringFreeListSize; - System::Collections::Generic::BaseIComparer** SystemCollectionsGenericBaseIComparerSystemStringFreeList; - System::Collections::Generic::BaseIComparer** NextFreeSystemCollectionsGenericBaseIComparerSystemString; - int32_t StoreSystemCollectionsGenericBaseIComparerSystemString(System::Collections::Generic::BaseIComparer* del) + ICloneable::ICloneable(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) { - assert(NextFreeSystemCollectionsGenericBaseIComparerSystemString != nullptr); - System::Collections::Generic::BaseIComparer** pNext = NextFreeSystemCollectionsGenericBaseIComparerSystemString; - NextFreeSystemCollectionsGenericBaseIComparerSystemString = (System::Collections::Generic::BaseIComparer**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemCollectionsGenericBaseIComparerSystemStringFreeList); } - System::Collections::Generic::BaseIComparer* GetSystemCollectionsGenericBaseIComparerSystemString(int32_t handle) + ICloneable::ICloneable(decltype(nullptr)) + : Object(nullptr) { - assert(handle >= 0 && handle < SystemCollectionsGenericBaseIComparerSystemStringFreeListSize); - return SystemCollectionsGenericBaseIComparerSystemStringFreeList[handle]; } - void RemoveSystemCollectionsGenericBaseIComparerSystemString(int32_t handle) + namespace Collections { - System::Collections::Generic::BaseIComparer** pRelease = SystemCollectionsGenericBaseIComparerSystemStringFreeList + handle; - *pRelease = (System::Collections::Generic::BaseIComparer*)NextFreeSystemCollectionsGenericBaseIComparerSystemString; - NextFreeSystemCollectionsGenericBaseIComparerSystemString = pRelease; + IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) + { + } + + IEnumerable::IEnumerable(decltype(nullptr)) + : Object(nullptr) + { + } + + IEnumerator IEnumerable::GetEnumerator() + { + return IEnumerator( + Plugin::InternalUse::Only, + Plugin::EnumerableGetEnumerator(Handle)); + } + + Plugin::EnumerableIterator begin( + System::Collections::IEnumerable& enumerable) + { + return Plugin::EnumerableIterator(enumerable); + } + + Plugin::EnumerableIterator end( + System::Collections::IEnumerable& enumerable) + { + return Plugin::EnumerableIterator(nullptr); + } + + ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) + , IEnumerable(nullptr) + { + } + + ICollection::ICollection(decltype(nullptr)) + : Object(nullptr) + , IEnumerable(nullptr) + { + } + + IList::IList(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) + , IEnumerable(nullptr) + , ICollection(nullptr) + { + } + + IList::IList(decltype(nullptr)) + : Object(nullptr) + , IEnumerable(nullptr) + , ICollection(nullptr) + { + } } - int32_t SystemBaseStringComparerFreeListSize; - System::BaseStringComparer** SystemBaseStringComparerFreeList; - System::BaseStringComparer** NextFreeSystemBaseStringComparer; - int32_t StoreSystemBaseStringComparer(System::BaseStringComparer* del) + Array::Array(Plugin::InternalUse iu, int32_t handle) + : Object(iu, handle) + , ICloneable(nullptr) + , Collections::IEnumerable(nullptr) + , Collections::ICollection(nullptr) + , Collections::IList(nullptr) { - assert(NextFreeSystemBaseStringComparer != nullptr); - System::BaseStringComparer** pNext = NextFreeSystemBaseStringComparer; - NextFreeSystemBaseStringComparer = (System::BaseStringComparer**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemBaseStringComparerFreeList); } - System::BaseStringComparer* GetSystemBaseStringComparer(int32_t handle) + Array::Array(decltype(nullptr)) + : Object(nullptr) + , ICloneable(nullptr) + , Collections::IEnumerable(nullptr) + , Collections::ICollection(nullptr) + , Collections::IList(nullptr) { - assert(handle >= 0 && handle < SystemBaseStringComparerFreeListSize); - return SystemBaseStringComparerFreeList[handle]; } - void RemoveSystemBaseStringComparer(int32_t handle) + int32_t Array::GetLength() { - System::BaseStringComparer** pRelease = SystemBaseStringComparerFreeList + handle; - *pRelease = (System::BaseStringComparer*)NextFreeSystemBaseStringComparer; - NextFreeSystemBaseStringComparer = pRelease; + return Plugin::ArrayGetLength(Handle); } - int32_t SystemCollectionsBaseQueueFreeListSize; - System::Collections::BaseQueue** SystemCollectionsBaseQueueFreeList; - System::Collections::BaseQueue** NextFreeSystemCollectionsBaseQueue; - int32_t StoreSystemCollectionsBaseQueue(System::Collections::BaseQueue* del) + int32_t Array::GetRank() { - assert(NextFreeSystemCollectionsBaseQueue != nullptr); - System::Collections::BaseQueue** pNext = NextFreeSystemCollectionsBaseQueue; - NextFreeSystemCollectionsBaseQueue = (System::Collections::BaseQueue**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemCollectionsBaseQueueFreeList); + return 0; } - - System::Collections::BaseQueue* GetSystemCollectionsBaseQueue(int32_t handle) +} + +/*BEGIN METHOD DEFINITIONS*/ +namespace System +{ + IFormattable::IFormattable(decltype(nullptr)) { - assert(handle >= 0 && handle < SystemCollectionsBaseQueueFreeListSize); - return SystemCollectionsBaseQueueFreeList[handle]; } - void RemoveSystemCollectionsBaseQueue(int32_t handle) + IFormattable::IFormattable(Plugin::InternalUse, int32_t handle) { - System::Collections::BaseQueue** pRelease = SystemCollectionsBaseQueueFreeList + handle; - *pRelease = (System::Collections::BaseQueue*)NextFreeSystemCollectionsBaseQueue; - NextFreeSystemCollectionsBaseQueue = pRelease; + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - int32_t SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize; - System::ComponentModel::Design::BaseIComponentChangeService** SystemComponentModelDesignBaseIComponentChangeServiceFreeList; - System::ComponentModel::Design::BaseIComponentChangeService** NextFreeSystemComponentModelDesignBaseIComponentChangeService; - int32_t StoreSystemComponentModelDesignBaseIComponentChangeService(System::ComponentModel::Design::BaseIComponentChangeService* del) + IFormattable::IFormattable(const IFormattable& other) + : IFormattable(Plugin::InternalUse::Only, other.Handle) { - assert(NextFreeSystemComponentModelDesignBaseIComponentChangeService != nullptr); - System::ComponentModel::Design::BaseIComponentChangeService** pNext = NextFreeSystemComponentModelDesignBaseIComponentChangeService; - NextFreeSystemComponentModelDesignBaseIComponentChangeService = (System::ComponentModel::Design::BaseIComponentChangeService**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemComponentModelDesignBaseIComponentChangeServiceFreeList); } - System::ComponentModel::Design::BaseIComponentChangeService* GetSystemComponentModelDesignBaseIComponentChangeService(int32_t handle) + IFormattable::IFormattable(IFormattable&& other) + : IFormattable(Plugin::InternalUse::Only, other.Handle) { - assert(handle >= 0 && handle < SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize); - return SystemComponentModelDesignBaseIComponentChangeServiceFreeList[handle]; + other.Handle = 0; } - void RemoveSystemComponentModelDesignBaseIComponentChangeService(int32_t handle) + IFormattable::~IFormattable() { - System::ComponentModel::Design::BaseIComponentChangeService** pRelease = SystemComponentModelDesignBaseIComponentChangeServiceFreeList + handle; - *pRelease = (System::ComponentModel::Design::BaseIComponentChangeService*)NextFreeSystemComponentModelDesignBaseIComponentChangeService; - NextFreeSystemComponentModelDesignBaseIComponentChangeService = pRelease; - } - int32_t SystemIOBaseFileStreamFreeListSize; - System::IO::BaseFileStream** SystemIOBaseFileStreamFreeList; - System::IO::BaseFileStream** NextFreeSystemIOBaseFileStream; - - int32_t StoreSystemIOBaseFileStream(System::IO::BaseFileStream* del) - { - assert(NextFreeSystemIOBaseFileStream != nullptr); - System::IO::BaseFileStream** pNext = NextFreeSystemIOBaseFileStream; - NextFreeSystemIOBaseFileStream = (System::IO::BaseFileStream**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemIOBaseFileStreamFreeList); - } - - System::IO::BaseFileStream* GetSystemIOBaseFileStream(int32_t handle) - { - assert(handle >= 0 && handle < SystemIOBaseFileStreamFreeListSize); - return SystemIOBaseFileStreamFreeList[handle]; - } - - void RemoveSystemIOBaseFileStream(int32_t handle) - { - System::IO::BaseFileStream** pRelease = SystemIOBaseFileStreamFreeList + handle; - *pRelease = (System::IO::BaseFileStream*)NextFreeSystemIOBaseFileStream; - NextFreeSystemIOBaseFileStream = pRelease; - } - int32_t RefCountsLenUnityEnginePlayablesPlayableHandle; - int32_t* RefCountsUnityEnginePlayablesPlayableHandle; - - void ReferenceManagedUnityEnginePlayablesPlayableHandle(int32_t handle) - { - assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableHandle); - if (handle != 0) + if (Handle) { - RefCountsUnityEnginePlayablesPlayableHandle[handle]++; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } - void DereferenceManagedUnityEnginePlayablesPlayableHandle(int32_t handle) + IFormattable& IFormattable::operator=(const IFormattable& other) { - assert(handle >= 0 && handle < RefCountsLenUnityEnginePlayablesPlayableHandle); - if (handle != 0) + if (this->Handle) { - int32_t numRemain = --RefCountsUnityEnginePlayablesPlayableHandle[handle]; - if (numRemain == 0) - { - ReleaseUnityEnginePlayablesPlayableHandle(handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } - int32_t RefCountsLenUnityEngineXRWSAInputInteractionSourcePose; - int32_t* RefCountsUnityEngineXRWSAInputInteractionSourcePose; - - void ReferenceManagedUnityEngineXRWSAInputInteractionSourcePose(int32_t handle) + IFormattable& IFormattable::operator=(decltype(nullptr)) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineXRWSAInputInteractionSourcePose); - if (handle != 0) + if (Handle) { - RefCountsUnityEngineXRWSAInputInteractionSourcePose[handle]++; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } + return *this; } - void DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(int32_t handle) + IFormattable& IFormattable::operator=(IFormattable&& other) { - assert(handle >= 0 && handle < RefCountsLenUnityEngineXRWSAInputInteractionSourcePose); - if (handle != 0) + if (Handle) { - int32_t numRemain = --RefCountsUnityEngineXRWSAInputInteractionSourcePose[handle]; - if (numRemain == 0) - { - ReleaseUnityEngineXRWSAInputInteractionSourcePose(handle); - } + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; } - int32_t SystemActionFreeListSize; - System::Action** SystemActionFreeList; - System::Action** NextFreeSystemAction; - - int32_t StoreSystemAction(System::Action* del) + bool IFormattable::operator==(const IFormattable& other) const { - assert(NextFreeSystemAction != nullptr); - System::Action** pNext = NextFreeSystemAction; - NextFreeSystemAction = (System::Action**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemActionFreeList); + return Handle == other.Handle; } - System::Action* GetSystemAction(int32_t handle) + bool IFormattable::operator!=(const IFormattable& other) const { - assert(handle >= 0 && handle < SystemActionFreeListSize); - return SystemActionFreeList[handle]; + return Handle != other.Handle; } - - void RemoveSystemAction(int32_t handle) +} + +namespace System +{ + IConvertible::IConvertible(decltype(nullptr)) { - System::Action** pRelease = SystemActionFreeList + handle; - *pRelease = (System::Action*)NextFreeSystemAction; - NextFreeSystemAction = pRelease; } - int32_t SystemActionSystemSingleFreeListSize; - System::Action1** SystemActionSystemSingleFreeList; - System::Action1** NextFreeSystemActionSystemSingle; - int32_t StoreSystemActionSystemSingle(System::Action1* del) + IConvertible::IConvertible(Plugin::InternalUse, int32_t handle) { - assert(NextFreeSystemActionSystemSingle != nullptr); - System::Action1** pNext = NextFreeSystemActionSystemSingle; - NextFreeSystemActionSystemSingle = (System::Action1**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemActionSystemSingleFreeList); + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - System::Action1* GetSystemActionSystemSingle(int32_t handle) + IConvertible::IConvertible(const IConvertible& other) + : IConvertible(Plugin::InternalUse::Only, other.Handle) { - assert(handle >= 0 && handle < SystemActionSystemSingleFreeListSize); - return SystemActionSystemSingleFreeList[handle]; } - void RemoveSystemActionSystemSingle(int32_t handle) + IConvertible::IConvertible(IConvertible&& other) + : IConvertible(Plugin::InternalUse::Only, other.Handle) { - System::Action1** pRelease = SystemActionSystemSingleFreeList + handle; - *pRelease = (System::Action1*)NextFreeSystemActionSystemSingle; - NextFreeSystemActionSystemSingle = pRelease; + other.Handle = 0; } - int32_t SystemActionSystemSingle_SystemSingleFreeListSize; - System::Action2** SystemActionSystemSingle_SystemSingleFreeList; - System::Action2** NextFreeSystemActionSystemSingle_SystemSingle; - int32_t StoreSystemActionSystemSingle_SystemSingle(System::Action2* del) + IConvertible::~IConvertible() { - assert(NextFreeSystemActionSystemSingle_SystemSingle != nullptr); - System::Action2** pNext = NextFreeSystemActionSystemSingle_SystemSingle; - NextFreeSystemActionSystemSingle_SystemSingle = (System::Action2**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemActionSystemSingle_SystemSingleFreeList); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - System::Action2* GetSystemActionSystemSingle_SystemSingle(int32_t handle) + IConvertible& IConvertible::operator=(const IConvertible& other) { - assert(handle >= 0 && handle < SystemActionSystemSingle_SystemSingleFreeListSize); - return SystemActionSystemSingle_SystemSingleFreeList[handle]; + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - void RemoveSystemActionSystemSingle_SystemSingle(int32_t handle) + IConvertible& IConvertible::operator=(decltype(nullptr)) { - System::Action2** pRelease = SystemActionSystemSingle_SystemSingleFreeList + handle; - *pRelease = (System::Action2*)NextFreeSystemActionSystemSingle_SystemSingle; - NextFreeSystemActionSystemSingle_SystemSingle = pRelease; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - int32_t SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize; - System::Func3** SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList; - System::Func3** NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble; - int32_t StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(System::Func3* del) + IConvertible& IConvertible::operator=(IConvertible&& other) { - assert(NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble != nullptr); - System::Func3** pNext = NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble; - NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble = (System::Func3**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - System::Func3* GetSystemFuncSystemInt32_SystemSingle_SystemDouble(int32_t handle) + bool IConvertible::operator==(const IConvertible& other) const { - assert(handle >= 0 && handle < SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize); - return SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[handle]; + return Handle == other.Handle; } - void RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(int32_t handle) + bool IConvertible::operator!=(const IConvertible& other) const { - System::Func3** pRelease = SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + handle; - *pRelease = (System::Func3*)NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble; - NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble = pRelease; + return Handle != other.Handle; } - int32_t SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize; - System::Func3** SystemFuncSystemInt16_SystemInt32_SystemStringFreeList; - System::Func3** NextFreeSystemFuncSystemInt16_SystemInt32_SystemString; - - int32_t StoreSystemFuncSystemInt16_SystemInt32_SystemString(System::Func3* del) +} + +namespace System +{ + IComparable::IComparable(decltype(nullptr)) { - assert(NextFreeSystemFuncSystemInt16_SystemInt32_SystemString != nullptr); - System::Func3** pNext = NextFreeSystemFuncSystemInt16_SystemInt32_SystemString; - NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = (System::Func3**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemFuncSystemInt16_SystemInt32_SystemStringFreeList); } - System::Func3* GetSystemFuncSystemInt16_SystemInt32_SystemString(int32_t handle) + IComparable::IComparable(Plugin::InternalUse, int32_t handle) { - assert(handle >= 0 && handle < SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize); - return SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[handle]; + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - void RemoveSystemFuncSystemInt16_SystemInt32_SystemString(int32_t handle) + IComparable::IComparable(const IComparable& other) + : IComparable(Plugin::InternalUse::Only, other.Handle) { - System::Func3** pRelease = SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + handle; - *pRelease = (System::Func3*)NextFreeSystemFuncSystemInt16_SystemInt32_SystemString; - NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = pRelease; } - int32_t SystemAppDomainInitializerFreeListSize; - System::AppDomainInitializer** SystemAppDomainInitializerFreeList; - System::AppDomainInitializer** NextFreeSystemAppDomainInitializer; - int32_t StoreSystemAppDomainInitializer(System::AppDomainInitializer* del) + IComparable::IComparable(IComparable&& other) + : IComparable(Plugin::InternalUse::Only, other.Handle) { - assert(NextFreeSystemAppDomainInitializer != nullptr); - System::AppDomainInitializer** pNext = NextFreeSystemAppDomainInitializer; - NextFreeSystemAppDomainInitializer = (System::AppDomainInitializer**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemAppDomainInitializerFreeList); + other.Handle = 0; } - System::AppDomainInitializer* GetSystemAppDomainInitializer(int32_t handle) + IComparable::~IComparable() { - assert(handle >= 0 && handle < SystemAppDomainInitializerFreeListSize); - return SystemAppDomainInitializerFreeList[handle]; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - void RemoveSystemAppDomainInitializer(int32_t handle) + IComparable& IComparable::operator=(const IComparable& other) { - System::AppDomainInitializer** pRelease = SystemAppDomainInitializerFreeList + handle; - *pRelease = (System::AppDomainInitializer*)NextFreeSystemAppDomainInitializer; - NextFreeSystemAppDomainInitializer = pRelease; + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - int32_t UnityEngineEventsUnityActionFreeListSize; - UnityEngine::Events::UnityAction** UnityEngineEventsUnityActionFreeList; - UnityEngine::Events::UnityAction** NextFreeUnityEngineEventsUnityAction; - int32_t StoreUnityEngineEventsUnityAction(UnityEngine::Events::UnityAction* del) + IComparable& IComparable::operator=(decltype(nullptr)) { - assert(NextFreeUnityEngineEventsUnityAction != nullptr); - UnityEngine::Events::UnityAction** pNext = NextFreeUnityEngineEventsUnityAction; - NextFreeUnityEngineEventsUnityAction = (UnityEngine::Events::UnityAction**)*pNext; - *pNext = del; - return (int32_t)(pNext - UnityEngineEventsUnityActionFreeList); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - UnityEngine::Events::UnityAction* GetUnityEngineEventsUnityAction(int32_t handle) + IComparable& IComparable::operator=(IComparable&& other) { - assert(handle >= 0 && handle < UnityEngineEventsUnityActionFreeListSize); - return UnityEngineEventsUnityActionFreeList[handle]; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - void RemoveUnityEngineEventsUnityAction(int32_t handle) + bool IComparable::operator==(const IComparable& other) const { - UnityEngine::Events::UnityAction** pRelease = UnityEngineEventsUnityActionFreeList + handle; - *pRelease = (UnityEngine::Events::UnityAction*)NextFreeUnityEngineEventsUnityAction; - NextFreeUnityEngineEventsUnityAction = pRelease; + return Handle == other.Handle; } - int32_t UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize; - UnityEngine::Events::UnityAction2** UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList; - UnityEngine::Events::UnityAction2** NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; - int32_t StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(UnityEngine::Events::UnityAction2* del) + bool IComparable::operator!=(const IComparable& other) const { - assert(NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode != nullptr); - UnityEngine::Events::UnityAction2** pNext = NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; - NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = (UnityEngine::Events::UnityAction2**)*pNext; - *pNext = del; - return (int32_t)(pNext - UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList); + return Handle != other.Handle; } - - UnityEngine::Events::UnityAction2* GetUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int32_t handle) +} + +namespace UnityEngine +{ + Vector3::Vector3() { - assert(handle >= 0 && handle < UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize); - return UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList[handle]; } - void RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(int32_t handle) + Vector3::Vector3(System::Single x, System::Single y, System::Single z) { - UnityEngine::Events::UnityAction2** pRelease = UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList + handle; - *pRelease = (UnityEngine::Events::UnityAction2*)NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; - NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = pRelease; + auto returnValue = Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(x, y, z); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + *this = returnValue; } - int32_t SystemComponentModelDesignComponentEventHandlerFreeListSize; - System::ComponentModel::Design::ComponentEventHandler** SystemComponentModelDesignComponentEventHandlerFreeList; - System::ComponentModel::Design::ComponentEventHandler** NextFreeSystemComponentModelDesignComponentEventHandler; - int32_t StoreSystemComponentModelDesignComponentEventHandler(System::ComponentModel::Design::ComponentEventHandler* del) + UnityEngine::Vector3 Vector3::operator+(UnityEngine::Vector3& a) { - assert(NextFreeSystemComponentModelDesignComponentEventHandler != nullptr); - System::ComponentModel::Design::ComponentEventHandler** pNext = NextFreeSystemComponentModelDesignComponentEventHandler; - NextFreeSystemComponentModelDesignComponentEventHandler = (System::ComponentModel::Design::ComponentEventHandler**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemComponentModelDesignComponentEventHandlerFreeList); + auto returnValue = Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(*this, a); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; } - System::ComponentModel::Design::ComponentEventHandler* GetSystemComponentModelDesignComponentEventHandler(int32_t handle) + Vector3::operator System::ValueType() { - assert(handle >= 0 && handle < SystemComponentModelDesignComponentEventHandlerFreeListSize); - return SystemComponentModelDesignComponentEventHandlerFreeList[handle]; + int32_t handle = Plugin::BoxVector3(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; } - void RemoveSystemComponentModelDesignComponentEventHandler(int32_t handle) + Vector3::operator System::Object() { - System::ComponentModel::Design::ComponentEventHandler** pRelease = SystemComponentModelDesignComponentEventHandlerFreeList + handle; - *pRelease = (System::ComponentModel::Design::ComponentEventHandler*)NextFreeSystemComponentModelDesignComponentEventHandler; - NextFreeSystemComponentModelDesignComponentEventHandler = pRelease; + int32_t handle = Plugin::BoxVector3(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; } - int32_t SystemComponentModelDesignComponentChangingEventHandlerFreeListSize; - System::ComponentModel::Design::ComponentChangingEventHandler** SystemComponentModelDesignComponentChangingEventHandlerFreeList; - System::ComponentModel::Design::ComponentChangingEventHandler** NextFreeSystemComponentModelDesignComponentChangingEventHandler; - - int32_t StoreSystemComponentModelDesignComponentChangingEventHandler(System::ComponentModel::Design::ComponentChangingEventHandler* del) +} + +namespace System +{ + Object::operator UnityEngine::Vector3() { - assert(NextFreeSystemComponentModelDesignComponentChangingEventHandler != nullptr); - System::ComponentModel::Design::ComponentChangingEventHandler** pNext = NextFreeSystemComponentModelDesignComponentChangingEventHandler; - NextFreeSystemComponentModelDesignComponentChangingEventHandler = (System::ComponentModel::Design::ComponentChangingEventHandler**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemComponentModelDesignComponentChangingEventHandlerFreeList); + UnityEngine::Vector3 returnVal(Plugin::UnboxVector3(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; } - - System::ComponentModel::Design::ComponentChangingEventHandler* GetSystemComponentModelDesignComponentChangingEventHandler(int32_t handle) +} + +namespace UnityEngine +{ + Object::Object(decltype(nullptr)) { - assert(handle >= 0 && handle < SystemComponentModelDesignComponentChangingEventHandlerFreeListSize); - return SystemComponentModelDesignComponentChangingEventHandlerFreeList[handle]; } - void RemoveSystemComponentModelDesignComponentChangingEventHandler(int32_t handle) + Object::Object(Plugin::InternalUse, int32_t handle) { - System::ComponentModel::Design::ComponentChangingEventHandler** pRelease = SystemComponentModelDesignComponentChangingEventHandlerFreeList + handle; - *pRelease = (System::ComponentModel::Design::ComponentChangingEventHandler*)NextFreeSystemComponentModelDesignComponentChangingEventHandler; - NextFreeSystemComponentModelDesignComponentChangingEventHandler = pRelease; + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - int32_t SystemComponentModelDesignComponentChangedEventHandlerFreeListSize; - System::ComponentModel::Design::ComponentChangedEventHandler** SystemComponentModelDesignComponentChangedEventHandlerFreeList; - System::ComponentModel::Design::ComponentChangedEventHandler** NextFreeSystemComponentModelDesignComponentChangedEventHandler; - int32_t StoreSystemComponentModelDesignComponentChangedEventHandler(System::ComponentModel::Design::ComponentChangedEventHandler* del) + Object::Object(const Object& other) + : Object(Plugin::InternalUse::Only, other.Handle) { - assert(NextFreeSystemComponentModelDesignComponentChangedEventHandler != nullptr); - System::ComponentModel::Design::ComponentChangedEventHandler** pNext = NextFreeSystemComponentModelDesignComponentChangedEventHandler; - NextFreeSystemComponentModelDesignComponentChangedEventHandler = (System::ComponentModel::Design::ComponentChangedEventHandler**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemComponentModelDesignComponentChangedEventHandlerFreeList); } - System::ComponentModel::Design::ComponentChangedEventHandler* GetSystemComponentModelDesignComponentChangedEventHandler(int32_t handle) + Object::Object(Object&& other) + : Object(Plugin::InternalUse::Only, other.Handle) { - assert(handle >= 0 && handle < SystemComponentModelDesignComponentChangedEventHandlerFreeListSize); - return SystemComponentModelDesignComponentChangedEventHandlerFreeList[handle]; + other.Handle = 0; } - void RemoveSystemComponentModelDesignComponentChangedEventHandler(int32_t handle) + Object::~Object() { - System::ComponentModel::Design::ComponentChangedEventHandler** pRelease = SystemComponentModelDesignComponentChangedEventHandlerFreeList + handle; - *pRelease = (System::ComponentModel::Design::ComponentChangedEventHandler*)NextFreeSystemComponentModelDesignComponentChangedEventHandler; - NextFreeSystemComponentModelDesignComponentChangedEventHandler = pRelease; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - int32_t SystemComponentModelDesignComponentRenameEventHandlerFreeListSize; - System::ComponentModel::Design::ComponentRenameEventHandler** SystemComponentModelDesignComponentRenameEventHandlerFreeList; - System::ComponentModel::Design::ComponentRenameEventHandler** NextFreeSystemComponentModelDesignComponentRenameEventHandler; - int32_t StoreSystemComponentModelDesignComponentRenameEventHandler(System::ComponentModel::Design::ComponentRenameEventHandler* del) + Object& Object::operator=(const Object& other) { - assert(NextFreeSystemComponentModelDesignComponentRenameEventHandler != nullptr); - System::ComponentModel::Design::ComponentRenameEventHandler** pNext = NextFreeSystemComponentModelDesignComponentRenameEventHandler; - NextFreeSystemComponentModelDesignComponentRenameEventHandler = (System::ComponentModel::Design::ComponentRenameEventHandler**)*pNext; - *pNext = del; - return (int32_t)(pNext - SystemComponentModelDesignComponentRenameEventHandlerFreeList); + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + Object& Object::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + Object& Object::operator=(Object&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - System::ComponentModel::Design::ComponentRenameEventHandler* GetSystemComponentModelDesignComponentRenameEventHandler(int32_t handle) + bool Object::operator==(const Object& other) const { - assert(handle >= 0 && handle < SystemComponentModelDesignComponentRenameEventHandlerFreeListSize); - return SystemComponentModelDesignComponentRenameEventHandlerFreeList[handle]; + return Handle == other.Handle; } - void RemoveSystemComponentModelDesignComponentRenameEventHandler(int32_t handle) + bool Object::operator!=(const Object& other) const { - System::ComponentModel::Design::ComponentRenameEventHandler** pRelease = SystemComponentModelDesignComponentRenameEventHandlerFreeList + handle; - *pRelease = (System::ComponentModel::Design::ComponentRenameEventHandler*)NextFreeSystemComponentModelDesignComponentRenameEventHandler; - NextFreeSystemComponentModelDesignComponentRenameEventHandler = pRelease; + return Handle != other.Handle; + } + + System::String Object::GetName() + { + auto returnValue = Plugin::UnityEngineObjectPropertyGetName(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::String(Plugin::InternalUse::Only, returnValue); + } + + void Object::SetName(System::String& value) + { + Plugin::UnityEngineObjectPropertySetName(Handle, value.Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } } - /*END GLOBAL STATE AND FUNCTIONS*/ -} - -namespace Plugin -{ - // An unhandled exception caused by C++ calling into C# - System::Exception* unhandledCsharpException = nullptr; } -//////////////////////////////////////////////////////////////// -// Mirrors of C# types. These wrap the C# functions to present -// a similiar API as in C#. -//////////////////////////////////////////////////////////////// - -namespace System +namespace UnityEngine { - Object::Object() - : Plugin::ManagedType(nullptr) + Component::Component(decltype(nullptr)) + : UnityEngine::Object(nullptr) { } - Object::Object(Plugin::InternalUse iu, int32_t handle) - : ManagedType(Plugin::InternalUse::Only, handle) + Component::Component(Plugin::InternalUse, int32_t handle) + : UnityEngine::Object(nullptr) { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - Object::Object(decltype(nullptr)) - : ManagedType(nullptr) + Component::Component(const Component& other) + : Component(Plugin::InternalUse::Only, other.Handle) { } - bool Object::operator==(decltype(nullptr)) const + Component::Component(Component&& other) + : Component(Plugin::InternalUse::Only, other.Handle) { - return Handle == 0; + other.Handle = 0; } - bool Object::operator!=(decltype(nullptr)) const + Component::~Component() { - return Handle != 0; + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - void Object::ThrowReferenceToThis() + Component& Component::operator=(const Component& other) { - throw *this; + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - ValueType::ValueType(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) + Component& Component::operator=(decltype(nullptr)) { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - ValueType::ValueType(decltype(nullptr)) - : Object(nullptr) + Component& Component::operator=(Component&& other) { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - Enum::Enum(Plugin::InternalUse iu, int32_t handle) - : ValueType(iu, handle) + bool Component::operator==(const Component& other) const { + return Handle == other.Handle; } - Enum::Enum(decltype(nullptr)) - : ValueType(nullptr) + bool Component::operator!=(const Component& other) const { + return Handle != other.Handle; } - String::String(decltype(nullptr)) - : Object(Plugin::InternalUse::Only, 0) + UnityEngine::Transform Component::GetTransform() + { + auto returnValue = Plugin::UnityEngineComponentPropertyGetTransform(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); + } +} + +namespace UnityEngine +{ + Transform::Transform(decltype(nullptr)) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , System::Collections::IEnumerable(nullptr) { } - String::String(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) + Transform::Transform(Plugin::InternalUse, int32_t handle) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , System::Collections::IEnumerable(nullptr) { + Handle = handle; if (handle) { Plugin::ReferenceManagedClass(handle); } } - String::String(const String& other) - : Object(Plugin::InternalUse::Only, other.Handle) + Transform::Transform(const Transform& other) + : Transform(Plugin::InternalUse::Only, other.Handle) { - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } } - String::String(String&& other) - : Object(Plugin::InternalUse::Only, other.Handle) + Transform::Transform(Transform&& other) + : Transform(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - String::~String() + Transform::~Transform() { if (Handle) { @@ -1728,24 +1600,21 @@ namespace System } } - String& String::operator=(const String& other) + Transform& Transform::operator=(const Transform& other) { - if (Handle != other.Handle) + if (this->Handle) { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } return *this; } - String& String::operator=(decltype(nullptr)) + Transform& Transform::operator=(decltype(nullptr)) { if (Handle) { @@ -1755,7 +1624,7 @@ namespace System return *this; } - String& String::operator=(String&& other) + Transform& Transform::operator=(Transform&& other) { if (Handle) { @@ -1766,278 +1635,335 @@ namespace System return *this; } - String::String(const char* chars) - : Object(Plugin::InternalUse::Only, Plugin::StringNew(chars)) + bool Transform::operator==(const Transform& other) const { + return Handle == other.Handle; } - ICloneable::ICloneable(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) + bool Transform::operator!=(const Transform& other) const { + return Handle != other.Handle; } - ICloneable::ICloneable(decltype(nullptr)) - : Object(nullptr) + UnityEngine::Vector3 Transform::GetPosition() { + auto returnValue = Plugin::UnityEngineTransformPropertyGetPosition(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; } + void Transform::SetPosition(UnityEngine::Vector3& value) + { + Plugin::UnityEngineTransformPropertySetPosition(Handle, value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } +} + +namespace System +{ namespace Collections { - IEnumerable::IEnumerable(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) + IEnumerator::IEnumerator(decltype(nullptr)) { } - IEnumerable::IEnumerable(decltype(nullptr)) - : Object(nullptr) + IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } } - IEnumerator IEnumerable::GetEnumerator() + IEnumerator::IEnumerator(const IEnumerator& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { - return IEnumerator( - Plugin::InternalUse::Only, - Plugin::EnumerableGetEnumerator(Handle)); } - Plugin::EnumerableIterator begin( - System::Collections::IEnumerable& enumerable) + IEnumerator::IEnumerator(IEnumerator&& other) + : IEnumerator(Plugin::InternalUse::Only, other.Handle) { - return Plugin::EnumerableIterator(enumerable); + other.Handle = 0; } - Plugin::EnumerableIterator end( - System::Collections::IEnumerable& enumerable) + IEnumerator::~IEnumerator() { - return Plugin::EnumerableIterator(nullptr); + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } } - ICollection::ICollection(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) - , IEnumerable(nullptr) + IEnumerator& IEnumerator::operator=(const IEnumerator& other) { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; } - ICollection::ICollection(decltype(nullptr)) - : Object(nullptr) - , IEnumerable(nullptr) + IEnumerator& IEnumerator::operator=(decltype(nullptr)) { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; } - IList::IList(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) - , IEnumerable(nullptr) - , ICollection(nullptr) + IEnumerator& IEnumerator::operator=(IEnumerator&& other) { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; } - IList::IList(decltype(nullptr)) - : Object(nullptr) - , IEnumerable(nullptr) - , ICollection(nullptr) - { - } - } - - Array::Array(Plugin::InternalUse iu, int32_t handle) - : Object(iu, handle) - , ICloneable(nullptr) - , Collections::IEnumerable(nullptr) - , Collections::ICollection(nullptr) - , Collections::IList(nullptr) - { - } - - Array::Array(decltype(nullptr)) - : Object(nullptr) - , ICloneable(nullptr) - , Collections::IEnumerable(nullptr) - , Collections::ICollection(nullptr) - , Collections::IList(nullptr) - { - } - - int32_t Array::GetLength() - { - return Plugin::ArrayGetLength(Handle); - } - - int32_t Array::GetRank() - { - return 0; - } -} - -/*BEGIN METHOD DEFINITIONS*/ -namespace System -{ - IFormattable::IFormattable(decltype(nullptr)) - { - } - - IFormattable::IFormattable(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IFormattable::IFormattable(const IFormattable& other) - : IFormattable(Plugin::InternalUse::Only, other.Handle) - { - } - - IFormattable::IFormattable(IFormattable&& other) - : IFormattable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IFormattable::~IFormattable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IFormattable& IFormattable::operator=(const IFormattable& other) - { - if (this->Handle) + bool IEnumerator::operator==(const IEnumerator& other) const { - Plugin::DereferenceManagedClass(this->Handle); + return Handle == other.Handle; } - this->Handle = other.Handle; - if (this->Handle) + + bool IEnumerator::operator!=(const IEnumerator& other) const { - Plugin::ReferenceManagedClass(this->Handle); + return Handle != other.Handle; } - return *this; - } - - IFormattable& IFormattable::operator=(decltype(nullptr)) - { - if (Handle) + + System::Object IEnumerator::GetCurrent() { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; + auto returnValue = Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return System::Object(Plugin::InternalUse::Only, returnValue); } - return *this; - } - - IFormattable& IFormattable::operator=(IFormattable&& other) - { - if (Handle) + + System::Boolean IEnumerator::MoveNext() { - Plugin::DereferenceManagedClass(Handle); + auto returnValue = Plugin::SystemCollectionsIEnumeratorMethodMoveNext(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnValue; } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IFormattable::operator==(const IFormattable& other) const - { - return Handle == other.Handle; - } - - bool IFormattable::operator!=(const IFormattable& other) const - { - return Handle != other.Handle; } } namespace System { - IConvertible::IConvertible(decltype(nullptr)) - { - } - - IConvertible::IConvertible(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IConvertible::IConvertible(const IConvertible& other) - : IConvertible(Plugin::InternalUse::Only, other.Handle) - { - } - - IConvertible::IConvertible(IConvertible&& other) - : IConvertible(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IConvertible::~IConvertible() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IConvertible& IConvertible::operator=(const IConvertible& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IConvertible& IConvertible::operator=(decltype(nullptr)) + namespace Runtime { - if (Handle) + namespace Serialization { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IConvertible& IConvertible::operator=(IConvertible&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); + ISerializable::ISerializable(decltype(nullptr)) + { + } + + ISerializable::ISerializable(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + ISerializable::ISerializable(const ISerializable& other) + : ISerializable(Plugin::InternalUse::Only, other.Handle) + { + } + + ISerializable::ISerializable(ISerializable&& other) + : ISerializable(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + ISerializable::~ISerializable() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + ISerializable& ISerializable::operator=(const ISerializable& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + ISerializable& ISerializable::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + ISerializable& ISerializable::operator=(ISerializable&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool ISerializable::operator==(const ISerializable& other) const + { + return Handle == other.Handle; + } + + bool ISerializable::operator!=(const ISerializable& other) const + { + return Handle != other.Handle; + } } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IConvertible::operator==(const IConvertible& other) const - { - return Handle == other.Handle; } - - bool IConvertible::operator!=(const IConvertible& other) const +} + +namespace System +{ + namespace Runtime { - return Handle != other.Handle; + namespace InteropServices + { + _Exception::_Exception(decltype(nullptr)) + { + } + + _Exception::_Exception(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + _Exception::_Exception(const _Exception& other) + : _Exception(Plugin::InternalUse::Only, other.Handle) + { + } + + _Exception::_Exception(_Exception&& other) + : _Exception(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + _Exception::~_Exception() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + _Exception& _Exception::operator=(const _Exception& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + _Exception& _Exception::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + _Exception& _Exception::operator=(_Exception&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool _Exception::operator==(const _Exception& other) const + { + return Handle == other.Handle; + } + + bool _Exception::operator!=(const _Exception& other) const + { + return Handle != other.Handle; + } + } } } -namespace System +namespace UnityEngine { - IComparable::IComparable(decltype(nullptr)) + GameObject::GameObject(decltype(nullptr)) + : UnityEngine::Object(nullptr) { } - IComparable::IComparable(Plugin::InternalUse, int32_t handle) + GameObject::GameObject(Plugin::InternalUse, int32_t handle) + : UnityEngine::Object(nullptr) { Handle = handle; if (handle) @@ -2046,18 +1972,18 @@ namespace System } } - IComparable::IComparable(const IComparable& other) - : IComparable(Plugin::InternalUse::Only, other.Handle) + GameObject::GameObject(const GameObject& other) + : GameObject(Plugin::InternalUse::Only, other.Handle) { } - IComparable::IComparable(IComparable&& other) - : IComparable(Plugin::InternalUse::Only, other.Handle) + GameObject::GameObject(GameObject&& other) + : GameObject(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IComparable::~IComparable() + GameObject::~GameObject() { if (Handle) { @@ -2066,7 +1992,7 @@ namespace System } } - IComparable& IComparable::operator=(const IComparable& other) + GameObject& GameObject::operator=(const GameObject& other) { if (this->Handle) { @@ -2080,7 +2006,7 @@ namespace System return *this; } - IComparable& IComparable::operator=(decltype(nullptr)) + GameObject& GameObject::operator=(decltype(nullptr)) { if (Handle) { @@ -2090,7 +2016,7 @@ namespace System return *this; } - IComparable& IComparable::operator=(IComparable&& other) + GameObject& GameObject::operator=(GameObject&& other) { if (Handle) { @@ -2101,19 +2027,19 @@ namespace System return *this; } - bool IComparable::operator==(const IComparable& other) const + bool GameObject::operator==(const GameObject& other) const { return Handle == other.Handle; } - bool IComparable::operator!=(const IComparable& other) const + bool GameObject::operator!=(const GameObject& other) const { return Handle != other.Handle; } - System::Int32 IComparable::CompareTo(System::Object& obj) + template<> MyGame::BaseBallScript GameObject::AddComponent() { - auto returnValue = Plugin::SystemIComparableMethodCompareToSystemObject(Handle, obj.Handle); + auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameBaseBallScript(Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -2121,17 +2047,30 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return returnValue; + return MyGame::BaseBallScript(Plugin::InternalUse::Only, returnValue); + } + + UnityEngine::GameObject GameObject::CreatePrimitive(UnityEngine::PrimitiveType type) + { + auto returnValue = Plugin::UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(type); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return UnityEngine::GameObject(Plugin::InternalUse::Only, returnValue); } } -namespace System +namespace UnityEngine { - IDisposable::IDisposable(decltype(nullptr)) + Debug::Debug(decltype(nullptr)) { } - IDisposable::IDisposable(Plugin::InternalUse, int32_t handle) + Debug::Debug(Plugin::InternalUse, int32_t handle) { Handle = handle; if (handle) @@ -2140,18 +2079,18 @@ namespace System } } - IDisposable::IDisposable(const IDisposable& other) - : IDisposable(Plugin::InternalUse::Only, other.Handle) + Debug::Debug(const Debug& other) + : Debug(Plugin::InternalUse::Only, other.Handle) { } - IDisposable::IDisposable(IDisposable&& other) - : IDisposable(Plugin::InternalUse::Only, other.Handle) + Debug::Debug(Debug&& other) + : Debug(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - IDisposable::~IDisposable() + Debug::~Debug() { if (Handle) { @@ -2160,7 +2099,7 @@ namespace System } } - IDisposable& IDisposable::operator=(const IDisposable& other) + Debug& Debug::operator=(const Debug& other) { if (this->Handle) { @@ -2174,7 +2113,7 @@ namespace System return *this; } - IDisposable& IDisposable::operator=(decltype(nullptr)) + Debug& Debug::operator=(decltype(nullptr)) { if (Handle) { @@ -2184,7 +2123,7 @@ namespace System return *this; } - IDisposable& IDisposable::operator=(IDisposable&& other) + Debug& Debug::operator=(Debug&& other) { if (Handle) { @@ -2195,19 +2134,19 @@ namespace System return *this; } - bool IDisposable::operator==(const IDisposable& other) const + bool Debug::operator==(const Debug& other) const { return Handle == other.Handle; } - bool IDisposable::operator!=(const IDisposable& other) const + bool Debug::operator!=(const Debug& other) const { return Handle != other.Handle; } - void IDisposable::Dispose() + void Debug::Log(System::Object& message) { - Plugin::SystemIDisposableMethodDispose(Handle); + Plugin::UnityEngineDebugMethodLogSystemObject(message.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -2220,134 +2159,102 @@ namespace System namespace UnityEngine { - Vector3::Vector3() + Behaviour::Behaviour(decltype(nullptr)) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) { } - Vector3::Vector3(System::Single x, System::Single y, System::Single z) + Behaviour::Behaviour(Plugin::InternalUse, int32_t handle) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) { - auto returnValue = Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(x, y, z); - if (Plugin::unhandledCsharpException) + Handle = handle; + if (handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(handle); } - *this = returnValue; } - System::Single Vector3::GetMagnitude() - { - auto returnValue = Plugin::UnityEngineVector3PropertyGetMagnitude(this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void Vector3::Set(System::Single newX, System::Single newY, System::Single newZ) + Behaviour::Behaviour(const Behaviour& other) + : Behaviour(Plugin::InternalUse::Only, other.Handle) { - Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle(this, newX, newY, newZ); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } } - UnityEngine::Vector3 Vector3::operator+(UnityEngine::Vector3& a) + Behaviour::Behaviour(Behaviour&& other) + : Behaviour(Plugin::InternalUse::Only, other.Handle) { - auto returnValue = Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(*this, a); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; + other.Handle = 0; } - UnityEngine::Vector3 Vector3::operator-() + Behaviour::~Behaviour() { - auto returnValue = Plugin::UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3(*this); - if (Plugin::unhandledCsharpException) + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - return returnValue; } - Vector3::operator System::ValueType() + Behaviour& Behaviour::operator=(const Behaviour& other) { - int32_t handle = Plugin::BoxVector3(*this); - if (Plugin::unhandledCsharpException) + if (this->Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(this->Handle); } - if (handle) + this->Handle = other.Handle; + if (this->Handle) { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); + Plugin::ReferenceManagedClass(this->Handle); } - return nullptr; + return *this; } - Vector3::operator System::Object() + Behaviour& Behaviour::operator=(decltype(nullptr)) { - int32_t handle = Plugin::BoxVector3(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) + if (Handle) { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - return nullptr; + return *this; } -} - -namespace System -{ - Object::operator UnityEngine::Vector3() + + Behaviour& Behaviour::operator=(Behaviour&& other) { - UnityEngine::Vector3 returnVal(Plugin::UnboxVector3(Handle)); - if (Plugin::unhandledCsharpException) + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); } - return returnVal; + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Behaviour::operator==(const Behaviour& other) const + { + return Handle == other.Handle; + } + + bool Behaviour::operator!=(const Behaviour& other) const + { + return Handle != other.Handle; } } namespace UnityEngine { - Object::Object(decltype(nullptr)) + MonoBehaviour::MonoBehaviour(decltype(nullptr)) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) { } - Object::Object(Plugin::InternalUse, int32_t handle) + MonoBehaviour::MonoBehaviour(Plugin::InternalUse, int32_t handle) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) { Handle = handle; if (handle) @@ -2356,18 +2263,18 @@ namespace UnityEngine } } - Object::Object(const Object& other) - : Object(Plugin::InternalUse::Only, other.Handle) + MonoBehaviour::MonoBehaviour(const MonoBehaviour& other) + : MonoBehaviour(Plugin::InternalUse::Only, other.Handle) { } - Object::Object(Object&& other) - : Object(Plugin::InternalUse::Only, other.Handle) + MonoBehaviour::MonoBehaviour(MonoBehaviour&& other) + : MonoBehaviour(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - Object::~Object() + MonoBehaviour::~MonoBehaviour() { if (Handle) { @@ -2376,7 +2283,7 @@ namespace UnityEngine } } - Object& Object::operator=(const Object& other) + MonoBehaviour& MonoBehaviour::operator=(const MonoBehaviour& other) { if (this->Handle) { @@ -2390,7 +2297,7 @@ namespace UnityEngine return *this; } - Object& Object::operator=(decltype(nullptr)) + MonoBehaviour& MonoBehaviour::operator=(decltype(nullptr)) { if (Handle) { @@ -2400,7 +2307,7 @@ namespace UnityEngine return *this; } - Object& Object::operator=(Object&& other) + MonoBehaviour& MonoBehaviour::operator=(MonoBehaviour&& other) { if (Handle) { @@ -2411,57 +2318,19 @@ namespace UnityEngine return *this; } - bool Object::operator==(const Object& other) const + bool MonoBehaviour::operator==(const MonoBehaviour& other) const { return Handle == other.Handle; } - bool Object::operator!=(const Object& other) const + bool MonoBehaviour::operator!=(const MonoBehaviour& other) const { return Handle != other.Handle; } - System::String Object::GetName() - { - auto returnValue = Plugin::UnityEngineObjectPropertyGetName(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); - } - - void Object::SetName(System::String& value) - { - Plugin::UnityEngineObjectPropertySetName(Handle, value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - System::Boolean Object::operator==(UnityEngine::Object& x) - { - auto returnValue = Plugin::UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject(Handle, x.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - Object::operator System::Boolean() + UnityEngine::Transform MonoBehaviour::GetTransform() { - auto returnValue = Plugin::UnityEngineObjectMethodop_ImplicitUnityEngineObject(Handle); + auto returnValue = Plugin::UnityEngineMonoBehaviourPropertyGetTransform(Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -2469,19 +2338,21 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return returnValue; + return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); } } -namespace UnityEngine +namespace System { - Component::Component(decltype(nullptr)) - : UnityEngine::Object(nullptr) + Exception::Exception(decltype(nullptr)) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) { } - Component::Component(Plugin::InternalUse, int32_t handle) - : UnityEngine::Object(nullptr) + Exception::Exception(Plugin::InternalUse, int32_t handle) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) { Handle = handle; if (handle) @@ -2490,18 +2361,18 @@ namespace UnityEngine } } - Component::Component(const Component& other) - : Component(Plugin::InternalUse::Only, other.Handle) + Exception::Exception(const Exception& other) + : Exception(Plugin::InternalUse::Only, other.Handle) { } - Component::Component(Component&& other) - : Component(Plugin::InternalUse::Only, other.Handle) + Exception::Exception(Exception&& other) + : Exception(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - Component::~Component() + Exception::~Exception() { if (Handle) { @@ -2510,7 +2381,7 @@ namespace UnityEngine } } - Component& Component::operator=(const Component& other) + Exception& Exception::operator=(const Exception& other) { if (this->Handle) { @@ -2524,7 +2395,7 @@ namespace UnityEngine return *this; } - Component& Component::operator=(decltype(nullptr)) + Exception& Exception::operator=(decltype(nullptr)) { if (Handle) { @@ -2534,7 +2405,7 @@ namespace UnityEngine return *this; } - Component& Component::operator=(Component&& other) + Exception& Exception::operator=(Exception&& other) { if (Handle) { @@ -2545,19 +2416,21 @@ namespace UnityEngine return *this; } - bool Component::operator==(const Component& other) const + bool Exception::operator==(const Exception& other) const { return Handle == other.Handle; } - bool Component::operator!=(const Component& other) const + bool Exception::operator!=(const Exception& other) const { return Handle != other.Handle; } - UnityEngine::Transform Component::GetTransform() + Exception::Exception(System::String& message) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) { - auto returnValue = Plugin::UnityEngineComponentPropertyGetTransform(Handle); + auto returnValue = Plugin::SystemExceptionConstructorSystemString(message.Handle); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -2565,23 +2438,27 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedClass(returnValue); + } } } -namespace UnityEngine +namespace System { - Transform::Transform(decltype(nullptr)) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) - , System::Collections::IEnumerable(nullptr) + SystemException::SystemException(decltype(nullptr)) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + , System::Exception(nullptr) { } - Transform::Transform(Plugin::InternalUse, int32_t handle) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) - , System::Collections::IEnumerable(nullptr) + SystemException::SystemException(Plugin::InternalUse, int32_t handle) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + , System::Exception(nullptr) { Handle = handle; if (handle) @@ -2590,18 +2467,18 @@ namespace UnityEngine } } - Transform::Transform(const Transform& other) - : Transform(Plugin::InternalUse::Only, other.Handle) + SystemException::SystemException(const SystemException& other) + : SystemException(Plugin::InternalUse::Only, other.Handle) { } - Transform::Transform(Transform&& other) - : Transform(Plugin::InternalUse::Only, other.Handle) + SystemException::SystemException(SystemException&& other) + : SystemException(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - Transform::~Transform() + SystemException::~SystemException() { if (Handle) { @@ -2610,7 +2487,7 @@ namespace UnityEngine } } - Transform& Transform::operator=(const Transform& other) + SystemException& SystemException::operator=(const SystemException& other) { if (this->Handle) { @@ -2624,7 +2501,7 @@ namespace UnityEngine return *this; } - Transform& Transform::operator=(decltype(nullptr)) + SystemException& SystemException::operator=(decltype(nullptr)) { if (Handle) { @@ -2634,7 +2511,7 @@ namespace UnityEngine return *this; } - Transform& Transform::operator=(Transform&& other) + SystemException& SystemException::operator=(SystemException&& other) { if (Handle) { @@ -2645,63 +2522,131 @@ namespace UnityEngine return *this; } - bool Transform::operator==(const Transform& other) const + bool SystemException::operator==(const SystemException& other) const { return Handle == other.Handle; } - bool Transform::operator!=(const Transform& other) const + bool SystemException::operator!=(const SystemException& other) const { return Handle != other.Handle; } +} + +namespace System +{ + NullReferenceException::NullReferenceException(decltype(nullptr)) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + , System::Exception(nullptr) + , System::SystemException(nullptr) + { + } - UnityEngine::Vector3 Transform::GetPosition() + NullReferenceException::NullReferenceException(Plugin::InternalUse, int32_t handle) + : System::Runtime::InteropServices::_Exception(nullptr) + , System::Runtime::Serialization::ISerializable(nullptr) + , System::Exception(nullptr) + , System::SystemException(nullptr) { - auto returnValue = Plugin::UnityEngineTransformPropertyGetPosition(Handle); - if (Plugin::unhandledCsharpException) + Handle = handle; + if (handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(handle); } - return returnValue; } - void Transform::SetPosition(UnityEngine::Vector3& value) + NullReferenceException::NullReferenceException(const NullReferenceException& other) + : NullReferenceException(Plugin::InternalUse::Only, other.Handle) { - Plugin::UnityEngineTransformPropertySetPosition(Handle, value); - if (Plugin::unhandledCsharpException) + } + + NullReferenceException::NullReferenceException(NullReferenceException&& other) + : NullReferenceException(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + NullReferenceException::~NullReferenceException() + { + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } } - void Transform::SetParent(UnityEngine::Transform& parent) + NullReferenceException& NullReferenceException::operator=(const NullReferenceException& other) { - Plugin::UnityEngineTransformMethodSetParentUnityEngineTransform(Handle, parent.Handle); - if (Plugin::unhandledCsharpException) + if (this->Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + NullReferenceException& NullReferenceException::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + NullReferenceException& NullReferenceException::operator=(NullReferenceException&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool NullReferenceException::operator==(const NullReferenceException& other) const + { + return Handle == other.Handle; + } + + bool NullReferenceException::operator!=(const NullReferenceException& other) const + { + return Handle != other.Handle; } } namespace UnityEngine { - Color::Color() + PrimitiveType::PrimitiveType(int32_t value) + : Value(value) + { + } + + UnityEngine::PrimitiveType::operator int32_t() const + { + return Value; + } + + bool UnityEngine::PrimitiveType::operator==(PrimitiveType other) + { + return Value == other.Value; + } + + bool UnityEngine::PrimitiveType::operator!=(PrimitiveType other) { + return Value != other.Value; } - Color::operator System::ValueType() + PrimitiveType::operator System::Enum() { - int32_t handle = Plugin::BoxColor(*this); + int32_t handle = Plugin::BoxPrimitiveType(*this); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -2712,14 +2657,14 @@ namespace UnityEngine if (handle) { Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); + return System::Enum(Plugin::InternalUse::Only, handle); } return nullptr; } - Color::operator System::Object() + PrimitiveType::operator System::ValueType() { - int32_t handle = Plugin::BoxColor(*this); + int32_t handle = Plugin::BoxPrimitiveType(*this); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -2730,17 +2675,14 @@ namespace UnityEngine if (handle) { Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); + return System::ValueType(Plugin::InternalUse::Only, handle); } return nullptr; } -} - -namespace System -{ - Object::operator UnityEngine::Color() + + PrimitiveType::operator System::Object() { - UnityEngine::Color returnVal(Plugin::UnboxColor(Handle)); + int32_t handle = Plugin::BoxPrimitiveType(*this); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -2748,19 +2690,35 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return returnVal; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; } -} - -namespace UnityEngine -{ - GradientColorKey::GradientColorKey() + + PrimitiveType::operator System::IFormattable() { + int32_t handle = Plugin::BoxPrimitiveType(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IFormattable(Plugin::InternalUse::Only, handle); + } + return nullptr; } - GradientColorKey::operator System::ValueType() + PrimitiveType::operator System::IConvertible() { - int32_t handle = Plugin::BoxGradientColorKey(*this); + int32_t handle = Plugin::BoxPrimitiveType(*this); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -2771,14 +2729,14 @@ namespace UnityEngine if (handle) { Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); + return System::IConvertible(Plugin::InternalUse::Only, handle); } return nullptr; } - GradientColorKey::operator System::Object() + PrimitiveType::operator System::IComparable() { - int32_t handle = Plugin::BoxGradientColorKey(*this); + int32_t handle = Plugin::BoxPrimitiveType(*this); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -2789,17 +2747,24 @@ namespace UnityEngine if (handle) { Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); + return System::IComparable(Plugin::InternalUse::Only, handle); } return nullptr; } + } +const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Sphere(0); +const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Capsule(1); +const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Cylinder(2); +const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Cube(3); +const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Plane(4); +const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Quad(5); namespace System { - Object::operator UnityEngine::GradientColorKey() + Object::operator UnityEngine::PrimitiveType() { - UnityEngine::GradientColorKey returnVal(Plugin::UnboxGradientColorKey(Handle)); + UnityEngine::PrimitiveType returnVal(Plugin::UnboxPrimitiveType(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -2813,87 +2778,87 @@ namespace System namespace UnityEngine { - Resolution::Resolution(decltype(nullptr)) + Time::Time(decltype(nullptr)) { } - Resolution::Resolution(Plugin::InternalUse, int32_t handle) + Time::Time(Plugin::InternalUse, int32_t handle) { Handle = handle; if (handle) { - Plugin::ReferenceManagedUnityEngineResolution(Handle); + Plugin::ReferenceManagedClass(handle); } } - Resolution::Resolution(const Resolution& other) - : Resolution(Plugin::InternalUse::Only, other.Handle) + Time::Time(const Time& other) + : Time(Plugin::InternalUse::Only, other.Handle) { } - Resolution::Resolution(Resolution&& other) - : Resolution(Plugin::InternalUse::Only, other.Handle) + Time::Time(Time&& other) + : Time(Plugin::InternalUse::Only, other.Handle) { other.Handle = 0; } - Resolution::~Resolution() + Time::~Time() { if (Handle) { - Plugin::DereferenceManagedUnityEngineResolution(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } } - Resolution& Resolution::operator=(const Resolution& other) + Time& Time::operator=(const Time& other) { if (this->Handle) { - Plugin::DereferenceManagedUnityEngineResolution(Handle); + Plugin::DereferenceManagedClass(this->Handle); } this->Handle = other.Handle; if (this->Handle) { - Plugin::ReferenceManagedUnityEngineResolution(Handle); + Plugin::ReferenceManagedClass(this->Handle); } return *this; } - Resolution& Resolution::operator=(decltype(nullptr)) + Time& Time::operator=(decltype(nullptr)) { if (Handle) { - Plugin::DereferenceManagedUnityEngineResolution(Handle); + Plugin::DereferenceManagedClass(Handle); Handle = 0; } return *this; } - Resolution& Resolution::operator=(Resolution&& other) + Time& Time::operator=(Time&& other) { if (Handle) { - Plugin::DereferenceManagedUnityEngineResolution(Handle); + Plugin::DereferenceManagedClass(Handle); } Handle = other.Handle; other.Handle = 0; return *this; } - bool Resolution::operator==(const Resolution& other) const + bool Time::operator==(const Time& other) const { return Handle == other.Handle; } - bool Resolution::operator!=(const Resolution& other) const + bool Time::operator!=(const Time& other) const { return Handle != other.Handle; } - Resolution::Resolution() + System::Single Time::GetDeltaTime() { - auto returnValue = Plugin::UnityEngineResolutionConstructor(); + auto returnValue = Plugin::UnityEngineTimePropertyGetDeltaTime(); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -2901,109 +2866,112 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedUnityEngineResolution(Handle); - } + return returnValue; } - - System::Int32 Resolution::GetWidth() +} + +namespace MyGame +{ + AbstractBaseBallScript::AbstractBaseBallScript(decltype(nullptr)) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) + , UnityEngine::MonoBehaviour(nullptr) { - auto returnValue = Plugin::UnityEngineResolutionPropertyGetWidth(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; } - void Resolution::SetWidth(System::Int32 value) + AbstractBaseBallScript::AbstractBaseBallScript(Plugin::InternalUse, int32_t handle) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) + , UnityEngine::MonoBehaviour(nullptr) { - Plugin::UnityEngineResolutionPropertySetWidth(Handle, value); - if (Plugin::unhandledCsharpException) + Handle = handle; + if (handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::ReferenceManagedClass(handle); } } - System::Int32 Resolution::GetHeight() + AbstractBaseBallScript::AbstractBaseBallScript(const AbstractBaseBallScript& other) + : AbstractBaseBallScript(Plugin::InternalUse::Only, other.Handle) { - auto returnValue = Plugin::UnityEngineResolutionPropertyGetHeight(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; } - void Resolution::SetHeight(System::Int32 value) + AbstractBaseBallScript::AbstractBaseBallScript(AbstractBaseBallScript&& other) + : AbstractBaseBallScript(Plugin::InternalUse::Only, other.Handle) { - Plugin::UnityEngineResolutionPropertySetHeight(Handle, value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } + other.Handle = 0; } - System::Int32 Resolution::GetRefreshRate() + AbstractBaseBallScript::~AbstractBaseBallScript() { - auto returnValue = Plugin::UnityEngineResolutionPropertyGetRefreshRate(Handle); - if (Plugin::unhandledCsharpException) + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - return returnValue; } - void Resolution::SetRefreshRate(System::Int32 value) + AbstractBaseBallScript& AbstractBaseBallScript::operator=(const AbstractBaseBallScript& other) { - Plugin::UnityEngineResolutionPropertySetRefreshRate(Handle, value); - if (Plugin::unhandledCsharpException) + if (this->Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); } + return *this; } - Resolution::operator System::ValueType() + AbstractBaseBallScript& AbstractBaseBallScript::operator=(decltype(nullptr)) { - int32_t handle = Plugin::BoxResolution(Handle); - if (Plugin::unhandledCsharpException) + if (Handle) { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::DereferenceManagedClass(Handle); + Handle = 0; } - if (handle) + return *this; + } + + AbstractBaseBallScript& AbstractBaseBallScript::operator=(AbstractBaseBallScript&& other) + { + if (Handle) { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); + Plugin::DereferenceManagedClass(Handle); } - return nullptr; + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool AbstractBaseBallScript::operator==(const AbstractBaseBallScript& other) const + { + return Handle == other.Handle; } - Resolution::operator System::Object() + bool AbstractBaseBallScript::operator!=(const AbstractBaseBallScript& other) const + { + return Handle != other.Handle; + } +} + +namespace MyGame +{ + BaseBallScript::BaseBallScript() + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) + , UnityEngine::MonoBehaviour(nullptr) + , MyGame::AbstractBaseBallScript(nullptr) { - int32_t handle = Plugin::BoxResolution(Handle); + CppHandle = Plugin::StoreBaseBallScript(this); + System::Int32* handle = (System::Int32*)&Handle; + int32_t cppHandle = CppHandle; + Plugin::BaseBallScriptConstructor(cppHandle, &handle->Value); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3011,20 +2979,15 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - if (handle) + if (Handle) { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); + Plugin::ReferenceManagedClass(Handle); + } + else + { + Plugin::RemoveBaseBallScript(CppHandle); + CppHandle = 0; } - return nullptr; - } -} - -namespace System -{ - Object::operator UnityEngine::Resolution() - { - UnityEngine::Resolution returnVal(Plugin::InternalUse::Only, Plugin::UnboxResolution(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3032,118 +2995,196 @@ namespace System ex->ThrowReferenceToThis(); delete ex; } - return returnVal; } -} - -namespace UnityEngine -{ - RaycastHit::RaycastHit(decltype(nullptr)) + + BaseBallScript::BaseBallScript(decltype(nullptr)) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) + , UnityEngine::MonoBehaviour(nullptr) + , MyGame::AbstractBaseBallScript(nullptr) { + CppHandle = Plugin::StoreBaseBallScript(this); } - RaycastHit::RaycastHit(Plugin::InternalUse, int32_t handle) + BaseBallScript::BaseBallScript(const BaseBallScript& other) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) + , UnityEngine::MonoBehaviour(nullptr) + , MyGame::AbstractBaseBallScript(nullptr) { - Handle = handle; - if (handle) + Handle = other.Handle; + CppHandle = Plugin::StoreBaseBallScript(this); + if (Handle) { - Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); + Plugin::ReferenceManagedClass(Handle); } } - RaycastHit::RaycastHit(const RaycastHit& other) - : RaycastHit(Plugin::InternalUse::Only, other.Handle) + BaseBallScript::BaseBallScript(BaseBallScript&& other) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) + , UnityEngine::MonoBehaviour(nullptr) + , MyGame::AbstractBaseBallScript(nullptr) { + Handle = other.Handle; + CppHandle = other.CppHandle; + other.Handle = 0; + other.CppHandle = 0; } - RaycastHit::RaycastHit(RaycastHit&& other) - : RaycastHit(Plugin::InternalUse::Only, other.Handle) + BaseBallScript::BaseBallScript(Plugin::InternalUse, int32_t handle) + : UnityEngine::Object(nullptr) + , UnityEngine::Component(nullptr) + , UnityEngine::Behaviour(nullptr) + , UnityEngine::MonoBehaviour(nullptr) + , MyGame::AbstractBaseBallScript(nullptr) { - other.Handle = 0; + Handle = handle; + CppHandle = Plugin::StoreBaseBallScript(this); + if (Handle) + { + Plugin::ReferenceManagedClass(Handle); + } } - RaycastHit::~RaycastHit() + BaseBallScript::~BaseBallScript() { + Plugin::RemoveWholeBaseBallScript(this); + Plugin::RemoveBaseBallScript(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); + int32_t handle = Handle; Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseBaseBallScript(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } } - RaycastHit& RaycastHit::operator=(const RaycastHit& other) + BaseBallScript& BaseBallScript::operator=(const BaseBallScript& other) { if (this->Handle) { - Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); + Plugin::DereferenceManagedClass(this->Handle); } this->Handle = other.Handle; if (this->Handle) { - Plugin::ReferenceManagedUnityEngineRaycastHit(Handle); + Plugin::ReferenceManagedClass(this->Handle); } return *this; } - RaycastHit& RaycastHit::operator=(decltype(nullptr)) + BaseBallScript& BaseBallScript::operator=(decltype(nullptr)) { if (Handle) { - Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); + int32_t handle = Handle; Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseBaseBallScript(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } + Handle = 0; return *this; } - RaycastHit& RaycastHit::operator=(RaycastHit&& other) + BaseBallScript& BaseBallScript::operator=(BaseBallScript&& other) { + Plugin::RemoveBaseBallScript(CppHandle); + CppHandle = 0; if (Handle) { - Plugin::DereferenceManagedUnityEngineRaycastHit(Handle); + int32_t handle = Handle; + Handle = 0; + if (Plugin::DereferenceManagedClassNoRelease(handle)) + { + Plugin::ReleaseBaseBallScript(handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + } } Handle = other.Handle; other.Handle = 0; return *this; } - bool RaycastHit::operator==(const RaycastHit& other) const + bool BaseBallScript::operator==(const BaseBallScript& other) const { return Handle == other.Handle; } - bool RaycastHit::operator!=(const RaycastHit& other) const + bool BaseBallScript::operator!=(const BaseBallScript& other) const { return Handle != other.Handle; } - UnityEngine::Vector3 RaycastHit::GetPoint() + DLLEXPORT int32_t NewBaseBallScript(int32_t handle) + { + MyGame::BaseBallScript* memory = Plugin::StoreWholeBaseBallScript(); + MyGame::BallScript* thiz = new (memory) MyGame::BallScript(Plugin::InternalUse::Only, handle); + return thiz->CppHandle; + } + + DLLEXPORT void DestroyBaseBallScript(int32_t cppHandle) + { + BaseBallScript* instance = Plugin::GetBaseBallScript(cppHandle); + instance->~BaseBallScript(); + } + + void BaseBallScript::Update() { - auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetPoint(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; } - void RaycastHit::SetPoint(UnityEngine::Vector3& value) + DLLEXPORT void MyGameAbstractBaseBallScriptUpdate(int32_t cppHandle) { - Plugin::UnityEngineRaycastHitPropertySetPoint(Handle, value); - if (Plugin::unhandledCsharpException) + try { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; + Plugin::GetBaseBallScript(cppHandle)->Update(); + } + catch (System::Exception ex) + { + Plugin::SetException(ex.Handle); + } + catch (...) + { + System::String msg = "Unhandled exception invoking MyGame::AbstractBaseBallScript"; + System::Exception ex(msg); + Plugin::SetException(ex.Handle); } } - - UnityEngine::Transform RaycastHit::GetTransform() +} + +namespace System +{ + Object::operator System::Boolean() { - auto returnValue = Plugin::UnityEngineRaycastHitPropertyGetTransform(Handle); + System::Boolean returnVal(Plugin::UnboxBoolean(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3151,12 +3192,15 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); + return returnVal; } - - RaycastHit::operator System::ValueType() +} + +namespace System +{ + Object::operator System::SByte() { - int32_t handle = Plugin::BoxRaycastHit(Handle); + System::SByte returnVal(Plugin::UnboxSByte(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3164,17 +3208,15 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; + return returnVal; } - - RaycastHit::operator System::Object() +} + +namespace System +{ + Object::operator System::Byte() { - int32_t handle = Plugin::BoxRaycastHit(Handle); + System::Byte returnVal(Plugin::UnboxByte(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3182,20 +3224,15 @@ namespace UnityEngine ex->ThrowReferenceToThis(); delete ex; } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; + return returnVal; } } namespace System { - Object::operator UnityEngine::RaycastHit() + Object::operator System::Int16() { - UnityEngine::RaycastHit returnVal(Plugin::InternalUse::Only, Plugin::UnboxRaycastHit(Handle)); + System::Int16 returnVal(Plugin::UnboxInt16(Handle)); if (Plugin::unhandledCsharpException) { System::Exception* ex = Plugin::unhandledCsharpException; @@ -3209,18131 +3246,129 @@ namespace System namespace System { - namespace Collections + Object::operator System::UInt16() { - IEnumerator::IEnumerator(decltype(nullptr)) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) + System::UInt16 returnVal(Plugin::UnboxUInt16(Handle)); + if (Plugin::unhandledCsharpException) { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerator::operator==(const IEnumerator& other) const - { - return Handle == other.Handle; - } - - bool IEnumerator::operator!=(const IEnumerator& other) const - { - return Handle != other.Handle; - } - - System::Object IEnumerator::GetCurrent() - { - auto returnValue = Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Object(Plugin::InternalUse::Only, returnValue); - } - - System::Boolean IEnumerator::MoveNext() - { - auto returnValue = Plugin::SystemCollectionsIEnumeratorMethodMoveNext(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - } -} - -namespace System -{ - namespace Runtime - { - namespace Serialization - { - ISerializable::ISerializable(decltype(nullptr)) - { - } - - ISerializable::ISerializable(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ISerializable::ISerializable(const ISerializable& other) - : ISerializable(Plugin::InternalUse::Only, other.Handle) - { - } - - ISerializable::ISerializable(ISerializable&& other) - : ISerializable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ISerializable::~ISerializable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ISerializable& ISerializable::operator=(const ISerializable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ISerializable& ISerializable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ISerializable& ISerializable::operator=(ISerializable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ISerializable::operator==(const ISerializable& other) const - { - return Handle == other.Handle; - } - - bool ISerializable::operator!=(const ISerializable& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace System -{ - namespace Runtime - { - namespace InteropServices - { - _Exception::_Exception(decltype(nullptr)) - { - } - - _Exception::_Exception(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - _Exception::_Exception(const _Exception& other) - : _Exception(Plugin::InternalUse::Only, other.Handle) - { - } - - _Exception::_Exception(_Exception&& other) - : _Exception(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - _Exception::~_Exception() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - _Exception& _Exception::operator=(const _Exception& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - _Exception& _Exception::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - _Exception& _Exception::operator=(_Exception&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool _Exception::operator==(const _Exception& other) const - { - return Handle == other.Handle; - } - - bool _Exception::operator!=(const _Exception& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace System -{ - IAppDomainSetup::IAppDomainSetup(decltype(nullptr)) - { - } - - IAppDomainSetup::IAppDomainSetup(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IAppDomainSetup::IAppDomainSetup(const IAppDomainSetup& other) - : IAppDomainSetup(Plugin::InternalUse::Only, other.Handle) - { - } - - IAppDomainSetup::IAppDomainSetup(IAppDomainSetup&& other) - : IAppDomainSetup(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IAppDomainSetup::~IAppDomainSetup() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IAppDomainSetup& IAppDomainSetup::operator=(const IAppDomainSetup& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IAppDomainSetup& IAppDomainSetup::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IAppDomainSetup& IAppDomainSetup::operator=(IAppDomainSetup&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IAppDomainSetup::operator==(const IAppDomainSetup& other) const - { - return Handle == other.Handle; - } - - bool IAppDomainSetup::operator!=(const IAppDomainSetup& other) const - { - return Handle != other.Handle; - } -} - -namespace System -{ - namespace Collections - { - IComparer::IComparer(decltype(nullptr)) - { - } - - IComparer::IComparer(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IComparer::IComparer(const IComparer& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) - { - } - - IComparer::IComparer(IComparer&& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IComparer::~IComparer() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IComparer& IComparer::operator=(const IComparer& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IComparer& IComparer::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IComparer& IComparer::operator=(IComparer&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IComparer::operator==(const IComparer& other) const - { - return Handle == other.Handle; - } - - bool IComparer::operator!=(const IComparer& other) const - { - return Handle != other.Handle; - } - } -} - -namespace System -{ - namespace Collections - { - IEqualityComparer::IEqualityComparer(decltype(nullptr)) - { - } - - IEqualityComparer::IEqualityComparer(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEqualityComparer::IEqualityComparer(const IEqualityComparer& other) - : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) - { - } - - IEqualityComparer::IEqualityComparer(IEqualityComparer&& other) - : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEqualityComparer::~IEqualityComparer() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEqualityComparer& IEqualityComparer::operator=(const IEqualityComparer& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEqualityComparer& IEqualityComparer::operator=(IEqualityComparer&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEqualityComparer::operator==(const IEqualityComparer& other) const - { - return Handle == other.Handle; - } - - bool IEqualityComparer::operator!=(const IEqualityComparer& other) const - { - return Handle != other.Handle; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEqualityComparer::IEqualityComparer(decltype(nullptr)) - { - } - - IEqualityComparer::IEqualityComparer(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEqualityComparer::IEqualityComparer(const IEqualityComparer& other) - : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) - { - } - - IEqualityComparer::IEqualityComparer(IEqualityComparer&& other) - : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEqualityComparer::~IEqualityComparer() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEqualityComparer& IEqualityComparer::operator=(const IEqualityComparer& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEqualityComparer& IEqualityComparer::operator=(IEqualityComparer&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEqualityComparer::operator==(const IEqualityComparer& other) const - { - return Handle == other.Handle; - } - - bool IEqualityComparer::operator!=(const IEqualityComparer& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEqualityComparer::IEqualityComparer(decltype(nullptr)) - { - } - - IEqualityComparer::IEqualityComparer(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEqualityComparer::IEqualityComparer(const IEqualityComparer& other) - : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) - { - } - - IEqualityComparer::IEqualityComparer(IEqualityComparer&& other) - : IEqualityComparer(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEqualityComparer::~IEqualityComparer() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEqualityComparer& IEqualityComparer::operator=(const IEqualityComparer& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEqualityComparer& IEqualityComparer::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEqualityComparer& IEqualityComparer::operator=(IEqualityComparer&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEqualityComparer::operator==(const IEqualityComparer& other) const - { - return Handle == other.Handle; - } - - bool IEqualityComparer::operator!=(const IEqualityComparer& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace UnityEngine -{ - namespace Playables - { - PlayableGraph::PlayableGraph(decltype(nullptr)) - { - } - - PlayableGraph::PlayableGraph(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedUnityEnginePlayablesPlayableGraph(Handle); - } - } - - PlayableGraph::PlayableGraph(const PlayableGraph& other) - : PlayableGraph(Plugin::InternalUse::Only, other.Handle) - { - } - - PlayableGraph::PlayableGraph(PlayableGraph&& other) - : PlayableGraph(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - PlayableGraph::~PlayableGraph() - { - if (Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); - Handle = 0; - } - } - - PlayableGraph& PlayableGraph::operator=(const PlayableGraph& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEnginePlayablesPlayableGraph(Handle); - } - return *this; - } - - PlayableGraph& PlayableGraph::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); - Handle = 0; - } - return *this; - } - - PlayableGraph& PlayableGraph::operator=(PlayableGraph&& other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableGraph(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool PlayableGraph::operator==(const PlayableGraph& other) const - { - return Handle == other.Handle; - } - - bool PlayableGraph::operator!=(const PlayableGraph& other) const - { - return Handle != other.Handle; - } - - PlayableGraph::operator System::ValueType() - { - int32_t handle = Plugin::BoxPlayableGraph(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - PlayableGraph::operator System::Object() - { - int32_t handle = Plugin::BoxPlayableGraph(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - } -} - -namespace System -{ - Object::operator UnityEngine::Playables::PlayableGraph() - { - UnityEngine::Playables::PlayableGraph returnVal(Plugin::InternalUse::Only, Plugin::UnboxPlayableGraph(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - namespace Playables - { - IPlayable::IPlayable(decltype(nullptr)) - { - } - - IPlayable::IPlayable(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IPlayable::IPlayable(const IPlayable& other) - : IPlayable(Plugin::InternalUse::Only, other.Handle) - { - } - - IPlayable::IPlayable(IPlayable&& other) - : IPlayable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IPlayable::~IPlayable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IPlayable& IPlayable::operator=(const IPlayable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IPlayable& IPlayable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IPlayable& IPlayable::operator=(IPlayable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IPlayable::operator==(const IPlayable& other) const - { - return Handle == other.Handle; - } - - bool IPlayable::operator!=(const IPlayable& other) const - { - return Handle != other.Handle; - } - } -} - -namespace System -{ - IEquatable::IEquatable(decltype(nullptr)) - { - } - - IEquatable::IEquatable(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEquatable::IEquatable(const IEquatable& other) - : IEquatable(Plugin::InternalUse::Only, other.Handle) - { - } - - IEquatable::IEquatable(IEquatable&& other) - : IEquatable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEquatable::~IEquatable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEquatable& IEquatable::operator=(const IEquatable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEquatable& IEquatable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEquatable& IEquatable::operator=(IEquatable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEquatable::operator==(const IEquatable& other) const - { - return Handle == other.Handle; - } - - bool IEquatable::operator!=(const IEquatable& other) const - { - return Handle != other.Handle; - } -} - -namespace UnityEngine -{ - namespace Animations - { - AnimationMixerPlayable::AnimationMixerPlayable(decltype(nullptr)) - { - } - - AnimationMixerPlayable::AnimationMixerPlayable(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); - } - } - - AnimationMixerPlayable::AnimationMixerPlayable(const AnimationMixerPlayable& other) - : AnimationMixerPlayable(Plugin::InternalUse::Only, other.Handle) - { - } - - AnimationMixerPlayable::AnimationMixerPlayable(AnimationMixerPlayable&& other) - : AnimationMixerPlayable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - AnimationMixerPlayable::~AnimationMixerPlayable() - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); - Handle = 0; - } - } - - AnimationMixerPlayable& AnimationMixerPlayable::operator=(const AnimationMixerPlayable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); - } - return *this; - } - - AnimationMixerPlayable& AnimationMixerPlayable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); - Handle = 0; - } - return *this; - } - - AnimationMixerPlayable& AnimationMixerPlayable::operator=(AnimationMixerPlayable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineAnimationsAnimationMixerPlayable(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool AnimationMixerPlayable::operator==(const AnimationMixerPlayable& other) const - { - return Handle == other.Handle; - } - - bool AnimationMixerPlayable::operator!=(const AnimationMixerPlayable& other) const - { - return Handle != other.Handle; - } - - UnityEngine::Animations::AnimationMixerPlayable AnimationMixerPlayable::Create(UnityEngine::Playables::PlayableGraph& graph, System::Int32 inputCount, System::Boolean normalizeWeights) - { - auto returnValue = Plugin::UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean(graph.Handle, inputCount, normalizeWeights); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Animations::AnimationMixerPlayable(Plugin::InternalUse::Only, returnValue); - } - - AnimationMixerPlayable::operator System::ValueType() - { - int32_t handle = Plugin::BoxAnimationMixerPlayable(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - AnimationMixerPlayable::operator System::Object() - { - int32_t handle = Plugin::BoxAnimationMixerPlayable(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - AnimationMixerPlayable::operator UnityEngine::Playables::IPlayable() - { - int32_t handle = Plugin::BoxAnimationMixerPlayable(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return UnityEngine::Playables::IPlayable(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - AnimationMixerPlayable::operator System::IEquatable() - { - int32_t handle = Plugin::BoxAnimationMixerPlayable(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IEquatable(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - } -} - -namespace System -{ - Object::operator UnityEngine::Animations::AnimationMixerPlayable() - { - UnityEngine::Animations::AnimationMixerPlayable returnVal(Plugin::InternalUse::Only, Plugin::UnboxAnimationMixerPlayable(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - namespace Runtime - { - namespace CompilerServices - { - IStrongBox::IStrongBox(decltype(nullptr)) - { - } - - IStrongBox::IStrongBox(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IStrongBox::IStrongBox(const IStrongBox& other) - : IStrongBox(Plugin::InternalUse::Only, other.Handle) - { - } - - IStrongBox::IStrongBox(IStrongBox&& other) - : IStrongBox(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IStrongBox::~IStrongBox() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IStrongBox& IStrongBox::operator=(const IStrongBox& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IStrongBox& IStrongBox::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IStrongBox& IStrongBox::operator=(IStrongBox&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IStrongBox::operator==(const IStrongBox& other) const - { - return Handle == other.Handle; - } - - bool IStrongBox::operator!=(const IStrongBox& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - IEventHandler::IEventHandler(decltype(nullptr)) - { - } - - IEventHandler::IEventHandler(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEventHandler::IEventHandler(const IEventHandler& other) - : IEventHandler(Plugin::InternalUse::Only, other.Handle) - { - } - - IEventHandler::IEventHandler(IEventHandler&& other) - : IEventHandler(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEventHandler::~IEventHandler() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEventHandler& IEventHandler::operator=(const IEventHandler& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEventHandler& IEventHandler::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEventHandler& IEventHandler::operator=(IEventHandler&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEventHandler::operator==(const IEventHandler& other) const - { - return Handle == other.Handle; - } - - bool IEventHandler::operator!=(const IEventHandler& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - CallbackEventHandler::CallbackEventHandler(decltype(nullptr)) - : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) - { - } - - CallbackEventHandler::CallbackEventHandler(Plugin::InternalUse, int32_t handle) - : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - CallbackEventHandler::CallbackEventHandler(const CallbackEventHandler& other) - : CallbackEventHandler(Plugin::InternalUse::Only, other.Handle) - { - } - - CallbackEventHandler::CallbackEventHandler(CallbackEventHandler&& other) - : CallbackEventHandler(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - CallbackEventHandler::~CallbackEventHandler() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - CallbackEventHandler& CallbackEventHandler::operator=(const CallbackEventHandler& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - CallbackEventHandler& CallbackEventHandler::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - CallbackEventHandler& CallbackEventHandler::operator=(CallbackEventHandler&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool CallbackEventHandler::operator==(const CallbackEventHandler& other) const - { - return Handle == other.Handle; - } - - bool CallbackEventHandler::operator!=(const CallbackEventHandler& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - Focusable::Focusable(decltype(nullptr)) - : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) - , UnityEngine::Experimental::UIElements::CallbackEventHandler(nullptr) - { - } - - Focusable::Focusable(Plugin::InternalUse, int32_t handle) - : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) - , UnityEngine::Experimental::UIElements::CallbackEventHandler(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Focusable::Focusable(const Focusable& other) - : Focusable(Plugin::InternalUse::Only, other.Handle) - { - } - - Focusable::Focusable(Focusable&& other) - : Focusable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Focusable::~Focusable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Focusable& Focusable::operator=(const Focusable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Focusable& Focusable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Focusable& Focusable::operator=(Focusable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Focusable::operator==(const Focusable& other) const - { - return Handle == other.Handle; - } - - bool Focusable::operator!=(const Focusable& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - IStyle::IStyle(decltype(nullptr)) - { - } - - IStyle::IStyle(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IStyle::IStyle(const IStyle& other) - : IStyle(Plugin::InternalUse::Only, other.Handle) - { - } - - IStyle::IStyle(IStyle&& other) - : IStyle(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IStyle::~IStyle() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IStyle& IStyle::operator=(const IStyle& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IStyle& IStyle::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IStyle& IStyle::operator=(IStyle&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IStyle::operator==(const IStyle& other) const - { - return Handle == other.Handle; - } - - bool IStyle::operator!=(const IStyle& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace System -{ - namespace Diagnostics - { - Stopwatch::Stopwatch(decltype(nullptr)) - { - } - - Stopwatch::Stopwatch(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Stopwatch::Stopwatch(const Stopwatch& other) - : Stopwatch(Plugin::InternalUse::Only, other.Handle) - { - } - - Stopwatch::Stopwatch(Stopwatch&& other) - : Stopwatch(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Stopwatch::~Stopwatch() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Stopwatch& Stopwatch::operator=(const Stopwatch& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Stopwatch& Stopwatch::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Stopwatch& Stopwatch::operator=(Stopwatch&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Stopwatch::operator==(const Stopwatch& other) const - { - return Handle == other.Handle; - } - - bool Stopwatch::operator!=(const Stopwatch& other) const - { - return Handle != other.Handle; - } - - Stopwatch::Stopwatch() - { - auto returnValue = Plugin::SystemDiagnosticsStopwatchConstructor(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - System::Int64 Stopwatch::GetElapsedMilliseconds() - { - auto returnValue = Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void Stopwatch::Start() - { - Plugin::SystemDiagnosticsStopwatchMethodStart(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void Stopwatch::Reset() - { - Plugin::SystemDiagnosticsStopwatchMethodReset(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } -} - -namespace UnityEngine -{ - GameObject::GameObject(decltype(nullptr)) - : UnityEngine::Object(nullptr) - { - } - - GameObject::GameObject(Plugin::InternalUse, int32_t handle) - : UnityEngine::Object(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - GameObject::GameObject(const GameObject& other) - : GameObject(Plugin::InternalUse::Only, other.Handle) - { - } - - GameObject::GameObject(GameObject&& other) - : GameObject(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - GameObject::~GameObject() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - GameObject& GameObject::operator=(const GameObject& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - GameObject& GameObject::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - GameObject& GameObject::operator=(GameObject&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool GameObject::operator==(const GameObject& other) const - { - return Handle == other.Handle; - } - - bool GameObject::operator!=(const GameObject& other) const - { - return Handle != other.Handle; - } - - GameObject::GameObject() - : UnityEngine::Object(nullptr) - { - auto returnValue = Plugin::UnityEngineGameObjectConstructor(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - GameObject::GameObject(System::String& name) - : UnityEngine::Object(nullptr) - { - auto returnValue = Plugin::UnityEngineGameObjectConstructorSystemString(name.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - UnityEngine::Transform GameObject::GetTransform() - { - auto returnValue = Plugin::UnityEngineGameObjectPropertyGetTransform(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); - } - - template<> MyGame::MonoBehaviours::TestScript GameObject::AddComponent() - { - auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return MyGame::MonoBehaviours::TestScript(Plugin::InternalUse::Only, returnValue); - } - - template<> MyGame::MonoBehaviours::AnotherScript GameObject::AddComponent() - { - auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return MyGame::MonoBehaviours::AnotherScript(Plugin::InternalUse::Only, returnValue); - } - - UnityEngine::GameObject GameObject::CreatePrimitive(UnityEngine::PrimitiveType type) - { - auto returnValue = Plugin::UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(type); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::GameObject(Plugin::InternalUse::Only, returnValue); - } -} - -namespace UnityEngine -{ - Debug::Debug(decltype(nullptr)) - { - } - - Debug::Debug(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Debug::Debug(const Debug& other) - : Debug(Plugin::InternalUse::Only, other.Handle) - { - } - - Debug::Debug(Debug&& other) - : Debug(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Debug::~Debug() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Debug& Debug::operator=(const Debug& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Debug& Debug::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Debug& Debug::operator=(Debug&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Debug::operator==(const Debug& other) const - { - return Handle == other.Handle; - } - - bool Debug::operator!=(const Debug& other) const - { - return Handle != other.Handle; - } - - void Debug::Log(System::Object& message) - { - Plugin::UnityEngineDebugMethodLogSystemObject(message.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } -} - -namespace UnityEngine -{ - namespace Assertions - { - System::Boolean Assert::GetRaiseExceptions() - { - auto returnValue = Plugin::UnityEngineAssertionsAssertFieldGetRaiseExceptions(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void Assert::SetRaiseExceptions(System::Boolean value) - { - Plugin::UnityEngineAssertionsAssertFieldSetRaiseExceptions(value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - template<> void Assert::AreEqual(System::String& expected, System::String& actual) - { - Plugin::UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString(expected.Handle, actual.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - template<> void Assert::AreEqual(UnityEngine::GameObject& expected, UnityEngine::GameObject& actual) - { - Plugin::UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject(expected.Handle, actual.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } -} - -namespace UnityEngine -{ - Collision::Collision(decltype(nullptr)) - { - } - - Collision::Collision(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Collision::Collision(const Collision& other) - : Collision(Plugin::InternalUse::Only, other.Handle) - { - } - - Collision::Collision(Collision&& other) - : Collision(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Collision::~Collision() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Collision& Collision::operator=(const Collision& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Collision& Collision::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Collision& Collision::operator=(Collision&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Collision::operator==(const Collision& other) const - { - return Handle == other.Handle; - } - - bool Collision::operator!=(const Collision& other) const - { - return Handle != other.Handle; - } -} - -namespace UnityEngine -{ - Behaviour::Behaviour(decltype(nullptr)) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) - { - } - - Behaviour::Behaviour(Plugin::InternalUse, int32_t handle) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Behaviour::Behaviour(const Behaviour& other) - : Behaviour(Plugin::InternalUse::Only, other.Handle) - { - } - - Behaviour::Behaviour(Behaviour&& other) - : Behaviour(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Behaviour::~Behaviour() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Behaviour& Behaviour::operator=(const Behaviour& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Behaviour& Behaviour::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Behaviour& Behaviour::operator=(Behaviour&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Behaviour::operator==(const Behaviour& other) const - { - return Handle == other.Handle; - } - - bool Behaviour::operator!=(const Behaviour& other) const - { - return Handle != other.Handle; - } -} - -namespace UnityEngine -{ - MonoBehaviour::MonoBehaviour(decltype(nullptr)) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) - , UnityEngine::Behaviour(nullptr) - { - } - - MonoBehaviour::MonoBehaviour(Plugin::InternalUse, int32_t handle) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) - , UnityEngine::Behaviour(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - MonoBehaviour::MonoBehaviour(const MonoBehaviour& other) - : MonoBehaviour(Plugin::InternalUse::Only, other.Handle) - { - } - - MonoBehaviour::MonoBehaviour(MonoBehaviour&& other) - : MonoBehaviour(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - MonoBehaviour::~MonoBehaviour() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - MonoBehaviour& MonoBehaviour::operator=(const MonoBehaviour& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - MonoBehaviour& MonoBehaviour::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - MonoBehaviour& MonoBehaviour::operator=(MonoBehaviour&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool MonoBehaviour::operator==(const MonoBehaviour& other) const - { - return Handle == other.Handle; - } - - bool MonoBehaviour::operator!=(const MonoBehaviour& other) const - { - return Handle != other.Handle; - } - - UnityEngine::Transform MonoBehaviour::GetTransform() - { - auto returnValue = Plugin::UnityEngineMonoBehaviourPropertyGetTransform(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Transform(Plugin::InternalUse::Only, returnValue); - } -} - -namespace UnityEngine -{ - AudioSettings::AudioSettings(decltype(nullptr)) - { - } - - AudioSettings::AudioSettings(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - AudioSettings::AudioSettings(const AudioSettings& other) - : AudioSettings(Plugin::InternalUse::Only, other.Handle) - { - } - - AudioSettings::AudioSettings(AudioSettings&& other) - : AudioSettings(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - AudioSettings::~AudioSettings() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - AudioSettings& AudioSettings::operator=(const AudioSettings& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - AudioSettings& AudioSettings::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - AudioSettings& AudioSettings::operator=(AudioSettings&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool AudioSettings::operator==(const AudioSettings& other) const - { - return Handle == other.Handle; - } - - bool AudioSettings::operator!=(const AudioSettings& other) const - { - return Handle != other.Handle; - } - - void AudioSettings::GetDSPBufferSize(System::Int32* bufferLength, System::Int32* numBuffers) - { - Plugin::UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32(&bufferLength->Value, &numBuffers->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } -} - -namespace UnityEngine -{ - namespace Networking - { - NetworkTransport::NetworkTransport(decltype(nullptr)) - { - } - - NetworkTransport::NetworkTransport(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - NetworkTransport::NetworkTransport(const NetworkTransport& other) - : NetworkTransport(Plugin::InternalUse::Only, other.Handle) - { - } - - NetworkTransport::NetworkTransport(NetworkTransport&& other) - : NetworkTransport(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - NetworkTransport::~NetworkTransport() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - NetworkTransport& NetworkTransport::operator=(const NetworkTransport& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - NetworkTransport& NetworkTransport::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - NetworkTransport& NetworkTransport::operator=(NetworkTransport&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool NetworkTransport::operator==(const NetworkTransport& other) const - { - return Handle == other.Handle; - } - - bool NetworkTransport::operator!=(const NetworkTransport& other) const - { - return Handle != other.Handle; - } - - void NetworkTransport::GetBroadcastConnectionInfo(System::Int32 hostId, System::String* address, System::Int32* port, System::Byte* error) - { - int32_t addressHandle = address->Handle; - Plugin::UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte(hostId, &addressHandle, &port->Value, &error->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (address->Handle) - { - Plugin::DereferenceManagedClass(address->Handle); - } - address->Handle = addressHandle; - if (address->Handle) - { - Plugin::ReferenceManagedClass(address->Handle); - } - } - - void NetworkTransport::Init() - { - Plugin::UnityEngineNetworkingNetworkTransportMethodInit(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } -} - -namespace UnityEngine -{ - Quaternion::Quaternion() - { - } - - Quaternion::operator System::ValueType() - { - int32_t handle = Plugin::BoxQuaternion(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - Quaternion::operator System::Object() - { - int32_t handle = Plugin::BoxQuaternion(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } -} - -namespace System -{ - Object::operator UnityEngine::Quaternion() - { - UnityEngine::Quaternion returnVal(Plugin::UnboxQuaternion(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - Matrix4x4::Matrix4x4() - { - } - - System::Single Matrix4x4::GetItem(System::Int32 row, System::Int32 column) - { - auto returnValue = Plugin::UnityEngineMatrix4x4PropertyGetItem(this, row, column); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void Matrix4x4::SetItem(System::Int32 row, System::Int32 column, System::Single value) - { - Plugin::UnityEngineMatrix4x4PropertySetItem(this, row, column, value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - Matrix4x4::operator System::ValueType() - { - int32_t handle = Plugin::BoxMatrix4x4(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - Matrix4x4::operator System::Object() - { - int32_t handle = Plugin::BoxMatrix4x4(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } -} - -namespace System -{ - Object::operator UnityEngine::Matrix4x4() - { - UnityEngine::Matrix4x4 returnVal(Plugin::UnboxMatrix4x4(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - QueryTriggerInteraction::QueryTriggerInteraction(int32_t value) - : Value(value) - { - } - - UnityEngine::QueryTriggerInteraction::operator int32_t() const - { - return Value; - } - - bool UnityEngine::QueryTriggerInteraction::operator==(QueryTriggerInteraction other) - { - return Value == other.Value; - } - - bool UnityEngine::QueryTriggerInteraction::operator!=(QueryTriggerInteraction other) - { - return Value != other.Value; - } - - QueryTriggerInteraction::operator System::Enum() - { - int32_t handle = Plugin::BoxQueryTriggerInteraction(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Enum(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - QueryTriggerInteraction::operator System::ValueType() - { - int32_t handle = Plugin::BoxQueryTriggerInteraction(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - QueryTriggerInteraction::operator System::Object() - { - int32_t handle = Plugin::BoxQueryTriggerInteraction(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - QueryTriggerInteraction::operator System::IFormattable() - { - int32_t handle = Plugin::BoxQueryTriggerInteraction(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IFormattable(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - QueryTriggerInteraction::operator System::IConvertible() - { - int32_t handle = Plugin::BoxQueryTriggerInteraction(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IConvertible(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - QueryTriggerInteraction::operator System::IComparable() - { - int32_t handle = Plugin::BoxQueryTriggerInteraction(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IComparable(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - -} -const UnityEngine::QueryTriggerInteraction UnityEngine::QueryTriggerInteraction::UseGlobal(0); -const UnityEngine::QueryTriggerInteraction UnityEngine::QueryTriggerInteraction::Ignore(1); -const UnityEngine::QueryTriggerInteraction UnityEngine::QueryTriggerInteraction::Collide(2); - -namespace System -{ - Object::operator UnityEngine::QueryTriggerInteraction() - { - UnityEngine::QueryTriggerInteraction returnVal(Plugin::UnboxQueryTriggerInteraction(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - KeyValuePair::KeyValuePair(decltype(nullptr)) - { - } - - KeyValuePair::KeyValuePair(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); - } - } - - KeyValuePair::KeyValuePair(const KeyValuePair& other) - : KeyValuePair(Plugin::InternalUse::Only, other.Handle) - { - } - - KeyValuePair::KeyValuePair(KeyValuePair&& other) - : KeyValuePair(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - KeyValuePair::~KeyValuePair() - { - if (Handle) - { - Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); - Handle = 0; - } - } - - KeyValuePair& KeyValuePair::operator=(const KeyValuePair& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); - } - return *this; - } - - KeyValuePair& KeyValuePair::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); - Handle = 0; - } - return *this; - } - - KeyValuePair& KeyValuePair::operator=(KeyValuePair&& other) - { - if (Handle) - { - Plugin::DereferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool KeyValuePair::operator==(const KeyValuePair& other) const - { - return Handle == other.Handle; - } - - bool KeyValuePair::operator!=(const KeyValuePair& other) const - { - return Handle != other.Handle; - } - - KeyValuePair::KeyValuePair(System::String& key, System::Double value) - { - auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble(key.Handle, value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedSystemCollectionsGenericKeyValuePairSystemString_SystemDouble(Handle); - } - } - - System::String KeyValuePair::GetKey() - { - auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); - } - - System::Double KeyValuePair::GetValue() - { - auto returnValue = Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - KeyValuePair::operator System::ValueType() - { - int32_t handle = Plugin::BoxKeyValuePairSystemString_SystemDouble(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - KeyValuePair::operator System::Object() - { - int32_t handle = Plugin::BoxKeyValuePairSystemString_SystemDouble(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - } - } -} - -namespace System -{ - Object::operator System::Collections::Generic::KeyValuePair() - { - System::Collections::Generic::KeyValuePair returnVal(Plugin::InternalUse::Only, Plugin::UnboxKeyValuePairSystemString_SystemDouble(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - LinkedListNode::LinkedListNode(decltype(nullptr)) - { - } - - LinkedListNode::LinkedListNode(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - LinkedListNode::LinkedListNode(const LinkedListNode& other) - : LinkedListNode(Plugin::InternalUse::Only, other.Handle) - { - } - - LinkedListNode::LinkedListNode(LinkedListNode&& other) - : LinkedListNode(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - LinkedListNode::~LinkedListNode() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - LinkedListNode& LinkedListNode::operator=(const LinkedListNode& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - LinkedListNode& LinkedListNode::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - LinkedListNode& LinkedListNode::operator=(LinkedListNode&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool LinkedListNode::operator==(const LinkedListNode& other) const - { - return Handle == other.Handle; - } - - bool LinkedListNode::operator!=(const LinkedListNode& other) const - { - return Handle != other.Handle; - } - - LinkedListNode::LinkedListNode(System::String& value) - { - auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString(value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - System::String LinkedListNode::GetValue() - { - auto returnValue = Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); - } - - void LinkedListNode::SetValue(System::String& value) - { - Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue(Handle, value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } -} - -namespace System -{ - namespace Runtime - { - namespace CompilerServices - { - StrongBox::StrongBox(decltype(nullptr)) - : System::Runtime::CompilerServices::IStrongBox(nullptr) - { - } - - StrongBox::StrongBox(Plugin::InternalUse, int32_t handle) - : System::Runtime::CompilerServices::IStrongBox(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - StrongBox::StrongBox(const StrongBox& other) - : StrongBox(Plugin::InternalUse::Only, other.Handle) - { - } - - StrongBox::StrongBox(StrongBox&& other) - : StrongBox(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - StrongBox::~StrongBox() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - StrongBox& StrongBox::operator=(const StrongBox& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - StrongBox& StrongBox::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - StrongBox& StrongBox::operator=(StrongBox&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool StrongBox::operator==(const StrongBox& other) const - { - return Handle == other.Handle; - } - - bool StrongBox::operator!=(const StrongBox& other) const - { - return Handle != other.Handle; - } - - StrongBox::StrongBox(System::String& value) - : System::Runtime::CompilerServices::IStrongBox(nullptr) - { - auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString(value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - System::String StrongBox::GetValue() - { - auto returnValue = Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); - } - - void StrongBox::SetValue(System::String& value) - { - Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue(Handle, value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } -} - -namespace System -{ - Exception::Exception(decltype(nullptr)) - : System::Runtime::InteropServices::_Exception(nullptr) - , System::Runtime::Serialization::ISerializable(nullptr) - { - } - - Exception::Exception(Plugin::InternalUse, int32_t handle) - : System::Runtime::InteropServices::_Exception(nullptr) - , System::Runtime::Serialization::ISerializable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Exception::Exception(const Exception& other) - : Exception(Plugin::InternalUse::Only, other.Handle) - { - } - - Exception::Exception(Exception&& other) - : Exception(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Exception::~Exception() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Exception& Exception::operator=(const Exception& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Exception& Exception::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Exception& Exception::operator=(Exception&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Exception::operator==(const Exception& other) const - { - return Handle == other.Handle; - } - - bool Exception::operator!=(const Exception& other) const - { - return Handle != other.Handle; - } - - Exception::Exception(System::String& message) - : System::Runtime::InteropServices::_Exception(nullptr) - , System::Runtime::Serialization::ISerializable(nullptr) - { - auto returnValue = Plugin::SystemExceptionConstructorSystemString(message.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } -} - -namespace System -{ - SystemException::SystemException(decltype(nullptr)) - : System::Runtime::InteropServices::_Exception(nullptr) - , System::Runtime::Serialization::ISerializable(nullptr) - , System::Exception(nullptr) - { - } - - SystemException::SystemException(Plugin::InternalUse, int32_t handle) - : System::Runtime::InteropServices::_Exception(nullptr) - , System::Runtime::Serialization::ISerializable(nullptr) - , System::Exception(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - SystemException::SystemException(const SystemException& other) - : SystemException(Plugin::InternalUse::Only, other.Handle) - { - } - - SystemException::SystemException(SystemException&& other) - : SystemException(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - SystemException::~SystemException() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - SystemException& SystemException::operator=(const SystemException& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - SystemException& SystemException::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - SystemException& SystemException::operator=(SystemException&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool SystemException::operator==(const SystemException& other) const - { - return Handle == other.Handle; - } - - bool SystemException::operator!=(const SystemException& other) const - { - return Handle != other.Handle; - } -} - -namespace System -{ - NullReferenceException::NullReferenceException(decltype(nullptr)) - : System::Runtime::InteropServices::_Exception(nullptr) - , System::Runtime::Serialization::ISerializable(nullptr) - , System::Exception(nullptr) - , System::SystemException(nullptr) - { - } - - NullReferenceException::NullReferenceException(Plugin::InternalUse, int32_t handle) - : System::Runtime::InteropServices::_Exception(nullptr) - , System::Runtime::Serialization::ISerializable(nullptr) - , System::Exception(nullptr) - , System::SystemException(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - NullReferenceException::NullReferenceException(const NullReferenceException& other) - : NullReferenceException(Plugin::InternalUse::Only, other.Handle) - { - } - - NullReferenceException::NullReferenceException(NullReferenceException&& other) - : NullReferenceException(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - NullReferenceException::~NullReferenceException() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - NullReferenceException& NullReferenceException::operator=(const NullReferenceException& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - NullReferenceException& NullReferenceException::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - NullReferenceException& NullReferenceException::operator=(NullReferenceException&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool NullReferenceException::operator==(const NullReferenceException& other) const - { - return Handle == other.Handle; - } - - bool NullReferenceException::operator!=(const NullReferenceException& other) const - { - return Handle != other.Handle; - } -} - -namespace UnityEngine -{ - Screen::Screen(decltype(nullptr)) - { - } - - Screen::Screen(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Screen::Screen(const Screen& other) - : Screen(Plugin::InternalUse::Only, other.Handle) - { - } - - Screen::Screen(Screen&& other) - : Screen(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Screen::~Screen() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Screen& Screen::operator=(const Screen& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Screen& Screen::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Screen& Screen::operator=(Screen&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Screen::operator==(const Screen& other) const - { - return Handle == other.Handle; - } - - bool Screen::operator!=(const Screen& other) const - { - return Handle != other.Handle; - } - - System::Array1 Screen::GetResolutions() - { - auto returnValue = Plugin::UnityEngineScreenPropertyGetResolutions(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Array1(Plugin::InternalUse::Only, returnValue); - } -} - -namespace UnityEngine -{ - Ray::Ray(decltype(nullptr)) - { - } - - Ray::Ray(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedUnityEngineRay(Handle); - } - } - - Ray::Ray(const Ray& other) - : Ray(Plugin::InternalUse::Only, other.Handle) - { - } - - Ray::Ray(Ray&& other) - : Ray(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Ray::~Ray() - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineRay(Handle); - Handle = 0; - } - } - - Ray& Ray::operator=(const Ray& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEngineRay(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEngineRay(Handle); - } - return *this; - } - - Ray& Ray::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineRay(Handle); - Handle = 0; - } - return *this; - } - - Ray& Ray::operator=(Ray&& other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineRay(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Ray::operator==(const Ray& other) const - { - return Handle == other.Handle; - } - - bool Ray::operator!=(const Ray& other) const - { - return Handle != other.Handle; - } - - Ray::Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction) - { - auto returnValue = Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3(origin, direction); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedUnityEngineRay(Handle); - } - } - - Ray::operator System::ValueType() - { - int32_t handle = Plugin::BoxRay(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - Ray::operator System::Object() - { - int32_t handle = Plugin::BoxRay(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } -} - -namespace System -{ - Object::operator UnityEngine::Ray() - { - UnityEngine::Ray returnVal(Plugin::InternalUse::Only, Plugin::UnboxRay(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - Physics::Physics(decltype(nullptr)) - { - } - - Physics::Physics(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Physics::Physics(const Physics& other) - : Physics(Plugin::InternalUse::Only, other.Handle) - { - } - - Physics::Physics(Physics&& other) - : Physics(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Physics::~Physics() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Physics& Physics::operator=(const Physics& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Physics& Physics::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Physics& Physics::operator=(Physics&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Physics::operator==(const Physics& other) const - { - return Handle == other.Handle; - } - - bool Physics::operator!=(const Physics& other) const - { - return Handle != other.Handle; - } - - System::Int32 Physics::RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1& results) - { - auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1(ray.Handle, results.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - System::Array1 Physics::RaycastAll(UnityEngine::Ray& ray) - { - auto returnValue = Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay(ray.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Array1(Plugin::InternalUse::Only, returnValue); - } -} - -namespace UnityEngine -{ - Gradient::Gradient(decltype(nullptr)) - { - } - - Gradient::Gradient(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Gradient::Gradient(const Gradient& other) - : Gradient(Plugin::InternalUse::Only, other.Handle) - { - } - - Gradient::Gradient(Gradient&& other) - : Gradient(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Gradient::~Gradient() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Gradient& Gradient::operator=(const Gradient& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Gradient& Gradient::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Gradient& Gradient::operator=(Gradient&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Gradient::operator==(const Gradient& other) const - { - return Handle == other.Handle; - } - - bool Gradient::operator!=(const Gradient& other) const - { - return Handle != other.Handle; - } - - Gradient::Gradient() - { - auto returnValue = Plugin::UnityEngineGradientConstructor(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - System::Array1 Gradient::GetColorKeys() - { - auto returnValue = Plugin::UnityEngineGradientPropertyGetColorKeys(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Array1(Plugin::InternalUse::Only, returnValue); - } - - void Gradient::SetColorKeys(System::Array1& value) - { - Plugin::UnityEngineGradientPropertySetColorKeys(Handle, value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } -} - -namespace System -{ - AppDomainSetup::AppDomainSetup(decltype(nullptr)) - : System::IAppDomainSetup(nullptr) - { - } - - AppDomainSetup::AppDomainSetup(Plugin::InternalUse, int32_t handle) - : System::IAppDomainSetup(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - AppDomainSetup::AppDomainSetup(const AppDomainSetup& other) - : AppDomainSetup(Plugin::InternalUse::Only, other.Handle) - { - } - - AppDomainSetup::AppDomainSetup(AppDomainSetup&& other) - : AppDomainSetup(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - AppDomainSetup::~AppDomainSetup() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - AppDomainSetup& AppDomainSetup::operator=(const AppDomainSetup& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - AppDomainSetup& AppDomainSetup::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - AppDomainSetup& AppDomainSetup::operator=(AppDomainSetup&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool AppDomainSetup::operator==(const AppDomainSetup& other) const - { - return Handle == other.Handle; - } - - bool AppDomainSetup::operator!=(const AppDomainSetup& other) const - { - return Handle != other.Handle; - } - - AppDomainSetup::AppDomainSetup() - : System::IAppDomainSetup(nullptr) - { - auto returnValue = Plugin::SystemAppDomainSetupConstructor(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - System::AppDomainInitializer AppDomainSetup::GetAppDomainInitializer() - { - auto returnValue = Plugin::SystemAppDomainSetupPropertyGetAppDomainInitializer(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::AppDomainInitializer(Plugin::InternalUse::Only, returnValue); - } - - void AppDomainSetup::SetAppDomainInitializer(System::AppDomainInitializer& value) - { - Plugin::SystemAppDomainSetupPropertySetAppDomainInitializer(Handle, value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } -} - -namespace UnityEngine -{ - Application::Application(decltype(nullptr)) - { - } - - Application::Application(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Application::Application(const Application& other) - : Application(Plugin::InternalUse::Only, other.Handle) - { - } - - Application::Application(Application&& other) - : Application(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Application::~Application() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Application& Application::operator=(const Application& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Application& Application::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Application& Application::operator=(Application&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Application::operator==(const Application& other) const - { - return Handle == other.Handle; - } - - bool Application::operator!=(const Application& other) const - { - return Handle != other.Handle; - } - - void Application::AddOnBeforeRender(UnityEngine::Events::UnityAction& del) - { - Plugin::UnityEngineApplicationAddEventOnBeforeRender(del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void Application::RemoveOnBeforeRender(UnityEngine::Events::UnityAction& del) - { - Plugin::UnityEngineApplicationRemoveEventOnBeforeRender(del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } -} - -namespace UnityEngine -{ - namespace SceneManagement - { - SceneManager::SceneManager(decltype(nullptr)) - { - } - - SceneManager::SceneManager(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - SceneManager::SceneManager(const SceneManager& other) - : SceneManager(Plugin::InternalUse::Only, other.Handle) - { - } - - SceneManager::SceneManager(SceneManager&& other) - : SceneManager(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - SceneManager::~SceneManager() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - SceneManager& SceneManager::operator=(const SceneManager& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - SceneManager& SceneManager::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - SceneManager& SceneManager::operator=(SceneManager&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool SceneManager::operator==(const SceneManager& other) const - { - return Handle == other.Handle; - } - - bool SceneManager::operator!=(const SceneManager& other) const - { - return Handle != other.Handle; - } - - void SceneManager::AddSceneLoaded(UnityEngine::Events::UnityAction2& del) - { - Plugin::UnityEngineSceneManagementSceneManagerAddEventSceneLoaded(del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void SceneManager::RemoveSceneLoaded(UnityEngine::Events::UnityAction2& del) - { - Plugin::UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded(del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } -} - -namespace UnityEngine -{ - namespace SceneManagement - { - Scene::Scene(decltype(nullptr)) - { - } - - Scene::Scene(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedUnityEngineSceneManagementScene(Handle); - } - } - - Scene::Scene(const Scene& other) - : Scene(Plugin::InternalUse::Only, other.Handle) - { - } - - Scene::Scene(Scene&& other) - : Scene(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Scene::~Scene() - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); - Handle = 0; - } - } - - Scene& Scene::operator=(const Scene& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEngineSceneManagementScene(Handle); - } - return *this; - } - - Scene& Scene::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); - Handle = 0; - } - return *this; - } - - Scene& Scene::operator=(Scene&& other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineSceneManagementScene(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Scene::operator==(const Scene& other) const - { - return Handle == other.Handle; - } - - bool Scene::operator!=(const Scene& other) const - { - return Handle != other.Handle; - } - - Scene::operator System::ValueType() - { - int32_t handle = Plugin::BoxScene(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - Scene::operator System::Object() - { - int32_t handle = Plugin::BoxScene(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - } -} - -namespace System -{ - Object::operator UnityEngine::SceneManagement::Scene() - { - UnityEngine::SceneManagement::Scene returnVal(Plugin::InternalUse::Only, Plugin::UnboxScene(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - namespace SceneManagement - { - LoadSceneMode::LoadSceneMode(int32_t value) - : Value(value) - { - } - - UnityEngine::SceneManagement::LoadSceneMode::operator int32_t() const - { - return Value; - } - - bool UnityEngine::SceneManagement::LoadSceneMode::operator==(LoadSceneMode other) - { - return Value == other.Value; - } - - bool UnityEngine::SceneManagement::LoadSceneMode::operator!=(LoadSceneMode other) - { - return Value != other.Value; - } - - LoadSceneMode::operator System::Enum() - { - int32_t handle = Plugin::BoxLoadSceneMode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Enum(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - LoadSceneMode::operator System::ValueType() - { - int32_t handle = Plugin::BoxLoadSceneMode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - LoadSceneMode::operator System::Object() - { - int32_t handle = Plugin::BoxLoadSceneMode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - LoadSceneMode::operator System::IFormattable() - { - int32_t handle = Plugin::BoxLoadSceneMode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IFormattable(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - LoadSceneMode::operator System::IConvertible() - { - int32_t handle = Plugin::BoxLoadSceneMode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IConvertible(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - LoadSceneMode::operator System::IComparable() - { - int32_t handle = Plugin::BoxLoadSceneMode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IComparable(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - } -} -const UnityEngine::SceneManagement::LoadSceneMode UnityEngine::SceneManagement::LoadSceneMode::Single(0); -const UnityEngine::SceneManagement::LoadSceneMode UnityEngine::SceneManagement::LoadSceneMode::Additive(1); - -namespace System -{ - Object::operator UnityEngine::SceneManagement::LoadSceneMode() - { - UnityEngine::SceneManagement::LoadSceneMode returnVal(Plugin::UnboxLoadSceneMode(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - EventArgs::EventArgs(decltype(nullptr)) - { - } - - EventArgs::EventArgs(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - EventArgs::EventArgs(const EventArgs& other) - : EventArgs(Plugin::InternalUse::Only, other.Handle) - { - } - - EventArgs::EventArgs(EventArgs&& other) - : EventArgs(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - EventArgs::~EventArgs() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - EventArgs& EventArgs::operator=(const EventArgs& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - EventArgs& EventArgs::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - EventArgs& EventArgs::operator=(EventArgs&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool EventArgs::operator==(const EventArgs& other) const - { - return Handle == other.Handle; - } - - bool EventArgs::operator!=(const EventArgs& other) const - { - return Handle != other.Handle; - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - ComponentEventArgs::ComponentEventArgs(decltype(nullptr)) - : System::EventArgs(nullptr) - { - } - - ComponentEventArgs::ComponentEventArgs(Plugin::InternalUse, int32_t handle) - : System::EventArgs(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ComponentEventArgs::ComponentEventArgs(const ComponentEventArgs& other) - : ComponentEventArgs(Plugin::InternalUse::Only, other.Handle) - { - } - - ComponentEventArgs::ComponentEventArgs(ComponentEventArgs&& other) - : ComponentEventArgs(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ComponentEventArgs::~ComponentEventArgs() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ComponentEventArgs& ComponentEventArgs::operator=(const ComponentEventArgs& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ComponentEventArgs& ComponentEventArgs::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ComponentEventArgs& ComponentEventArgs::operator=(ComponentEventArgs&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ComponentEventArgs::operator==(const ComponentEventArgs& other) const - { - return Handle == other.Handle; - } - - bool ComponentEventArgs::operator!=(const ComponentEventArgs& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - ComponentChangingEventArgs::ComponentChangingEventArgs(decltype(nullptr)) - : System::EventArgs(nullptr) - { - } - - ComponentChangingEventArgs::ComponentChangingEventArgs(Plugin::InternalUse, int32_t handle) - : System::EventArgs(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ComponentChangingEventArgs::ComponentChangingEventArgs(const ComponentChangingEventArgs& other) - : ComponentChangingEventArgs(Plugin::InternalUse::Only, other.Handle) - { - } - - ComponentChangingEventArgs::ComponentChangingEventArgs(ComponentChangingEventArgs&& other) - : ComponentChangingEventArgs(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ComponentChangingEventArgs::~ComponentChangingEventArgs() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(const ComponentChangingEventArgs& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ComponentChangingEventArgs& ComponentChangingEventArgs::operator=(ComponentChangingEventArgs&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ComponentChangingEventArgs::operator==(const ComponentChangingEventArgs& other) const - { - return Handle == other.Handle; - } - - bool ComponentChangingEventArgs::operator!=(const ComponentChangingEventArgs& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - ComponentChangedEventArgs::ComponentChangedEventArgs(decltype(nullptr)) - : System::EventArgs(nullptr) - { - } - - ComponentChangedEventArgs::ComponentChangedEventArgs(Plugin::InternalUse, int32_t handle) - : System::EventArgs(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ComponentChangedEventArgs::ComponentChangedEventArgs(const ComponentChangedEventArgs& other) - : ComponentChangedEventArgs(Plugin::InternalUse::Only, other.Handle) - { - } - - ComponentChangedEventArgs::ComponentChangedEventArgs(ComponentChangedEventArgs&& other) - : ComponentChangedEventArgs(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ComponentChangedEventArgs::~ComponentChangedEventArgs() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(const ComponentChangedEventArgs& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ComponentChangedEventArgs& ComponentChangedEventArgs::operator=(ComponentChangedEventArgs&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ComponentChangedEventArgs::operator==(const ComponentChangedEventArgs& other) const - { - return Handle == other.Handle; - } - - bool ComponentChangedEventArgs::operator!=(const ComponentChangedEventArgs& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - ComponentRenameEventArgs::ComponentRenameEventArgs(decltype(nullptr)) - : System::EventArgs(nullptr) - { - } - - ComponentRenameEventArgs::ComponentRenameEventArgs(Plugin::InternalUse, int32_t handle) - : System::EventArgs(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ComponentRenameEventArgs::ComponentRenameEventArgs(const ComponentRenameEventArgs& other) - : ComponentRenameEventArgs(Plugin::InternalUse::Only, other.Handle) - { - } - - ComponentRenameEventArgs::ComponentRenameEventArgs(ComponentRenameEventArgs&& other) - : ComponentRenameEventArgs(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ComponentRenameEventArgs::~ComponentRenameEventArgs() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(const ComponentRenameEventArgs& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ComponentRenameEventArgs& ComponentRenameEventArgs::operator=(ComponentRenameEventArgs&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ComponentRenameEventArgs::operator==(const ComponentRenameEventArgs& other) const - { - return Handle == other.Handle; - } - - bool ComponentRenameEventArgs::operator!=(const ComponentRenameEventArgs& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace System -{ - namespace ComponentModel - { - MemberDescriptor::MemberDescriptor(decltype(nullptr)) - { - } - - MemberDescriptor::MemberDescriptor(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - MemberDescriptor::MemberDescriptor(const MemberDescriptor& other) - : MemberDescriptor(Plugin::InternalUse::Only, other.Handle) - { - } - - MemberDescriptor::MemberDescriptor(MemberDescriptor&& other) - : MemberDescriptor(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - MemberDescriptor::~MemberDescriptor() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - MemberDescriptor& MemberDescriptor::operator=(const MemberDescriptor& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - MemberDescriptor& MemberDescriptor::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - MemberDescriptor& MemberDescriptor::operator=(MemberDescriptor&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool MemberDescriptor::operator==(const MemberDescriptor& other) const - { - return Handle == other.Handle; - } - - bool MemberDescriptor::operator!=(const MemberDescriptor& other) const - { - return Handle != other.Handle; - } - } -} - -namespace UnityEngine -{ - PrimitiveType::PrimitiveType(int32_t value) - : Value(value) - { - } - - UnityEngine::PrimitiveType::operator int32_t() const - { - return Value; - } - - bool UnityEngine::PrimitiveType::operator==(PrimitiveType other) - { - return Value == other.Value; - } - - bool UnityEngine::PrimitiveType::operator!=(PrimitiveType other) - { - return Value != other.Value; - } - - PrimitiveType::operator System::Enum() - { - int32_t handle = Plugin::BoxPrimitiveType(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Enum(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - PrimitiveType::operator System::ValueType() - { - int32_t handle = Plugin::BoxPrimitiveType(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - PrimitiveType::operator System::Object() - { - int32_t handle = Plugin::BoxPrimitiveType(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - PrimitiveType::operator System::IFormattable() - { - int32_t handle = Plugin::BoxPrimitiveType(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IFormattable(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - PrimitiveType::operator System::IConvertible() - { - int32_t handle = Plugin::BoxPrimitiveType(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IConvertible(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - PrimitiveType::operator System::IComparable() - { - int32_t handle = Plugin::BoxPrimitiveType(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IComparable(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - -} -const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Sphere(0); -const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Capsule(1); -const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Cylinder(2); -const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Cube(3); -const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Plane(4); -const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Quad(5); - -namespace System -{ - Object::operator UnityEngine::PrimitiveType() - { - UnityEngine::PrimitiveType returnVal(Plugin::UnboxPrimitiveType(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - Time::Time(decltype(nullptr)) - { - } - - Time::Time(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Time::Time(const Time& other) - : Time(Plugin::InternalUse::Only, other.Handle) - { - } - - Time::Time(Time&& other) - : Time(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Time::~Time() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Time& Time::operator=(const Time& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Time& Time::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Time& Time::operator=(Time&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Time::operator==(const Time& other) const - { - return Handle == other.Handle; - } - - bool Time::operator!=(const Time& other) const - { - return Handle != other.Handle; - } - - System::Single Time::GetDeltaTime() - { - auto returnValue = Plugin::UnityEngineTimePropertyGetDeltaTime(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } -} - -namespace System -{ - namespace IO - { - FileMode::FileMode(int32_t value) - : Value(value) - { - } - - System::IO::FileMode::operator int32_t() const - { - return Value; - } - - bool System::IO::FileMode::operator==(FileMode other) - { - return Value == other.Value; - } - - bool System::IO::FileMode::operator!=(FileMode other) - { - return Value != other.Value; - } - - FileMode::operator System::Enum() - { - int32_t handle = Plugin::BoxFileMode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Enum(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - FileMode::operator System::ValueType() - { - int32_t handle = Plugin::BoxFileMode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - FileMode::operator System::Object() - { - int32_t handle = Plugin::BoxFileMode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - FileMode::operator System::IFormattable() - { - int32_t handle = Plugin::BoxFileMode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IFormattable(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - FileMode::operator System::IConvertible() - { - int32_t handle = Plugin::BoxFileMode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IConvertible(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - FileMode::operator System::IComparable() - { - int32_t handle = Plugin::BoxFileMode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IComparable(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - } -} -const System::IO::FileMode System::IO::FileMode::CreateNew(1); -const System::IO::FileMode System::IO::FileMode::Create(2); -const System::IO::FileMode System::IO::FileMode::Open(3); -const System::IO::FileMode System::IO::FileMode::OpenOrCreate(4); -const System::IO::FileMode System::IO::FileMode::Truncate(5); -const System::IO::FileMode System::IO::FileMode::Append(6); - -namespace System -{ - Object::operator System::IO::FileMode() - { - System::IO::FileMode returnVal(Plugin::UnboxFileMode(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - MarshalByRefObject::MarshalByRefObject(decltype(nullptr)) - { - } - - MarshalByRefObject::MarshalByRefObject(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - MarshalByRefObject::MarshalByRefObject(const MarshalByRefObject& other) - : MarshalByRefObject(Plugin::InternalUse::Only, other.Handle) - { - } - - MarshalByRefObject::MarshalByRefObject(MarshalByRefObject&& other) - : MarshalByRefObject(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - MarshalByRefObject::~MarshalByRefObject() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - MarshalByRefObject& MarshalByRefObject::operator=(const MarshalByRefObject& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - MarshalByRefObject& MarshalByRefObject::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - MarshalByRefObject& MarshalByRefObject::operator=(MarshalByRefObject&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool MarshalByRefObject::operator==(const MarshalByRefObject& other) const - { - return Handle == other.Handle; - } - - bool MarshalByRefObject::operator!=(const MarshalByRefObject& other) const - { - return Handle != other.Handle; - } -} - -namespace System -{ - namespace IO - { - Stream::Stream(decltype(nullptr)) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - { - } - - Stream::Stream(Plugin::InternalUse, int32_t handle) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Stream::Stream(const Stream& other) - : Stream(Plugin::InternalUse::Only, other.Handle) - { - } - - Stream::Stream(Stream&& other) - : Stream(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Stream::~Stream() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Stream& Stream::operator=(const Stream& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Stream& Stream::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Stream& Stream::operator=(Stream&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Stream::operator==(const Stream& other) const - { - return Handle == other.Handle; - } - - bool Stream::operator!=(const Stream& other) const - { - return Handle != other.Handle; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IComparer::IComparer(decltype(nullptr)) - { - } - - IComparer::IComparer(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IComparer::IComparer(const IComparer& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) - { - } - - IComparer::IComparer(IComparer&& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IComparer::~IComparer() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IComparer& IComparer::operator=(const IComparer& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IComparer& IComparer::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IComparer& IComparer::operator=(IComparer&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IComparer::operator==(const IComparer& other) const - { - return Handle == other.Handle; - } - - bool IComparer::operator!=(const IComparer& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IComparer::IComparer(decltype(nullptr)) - { - } - - IComparer::IComparer(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IComparer::IComparer(const IComparer& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) - { - } - - IComparer::IComparer(IComparer&& other) - : IComparer(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IComparer::~IComparer() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IComparer& IComparer::operator=(const IComparer& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IComparer& IComparer::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IComparer& IComparer::operator=(IComparer&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IComparer::operator==(const IComparer& other) const - { - return Handle == other.Handle; - } - - bool IComparer::operator!=(const IComparer& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - BaseIComparer::BaseIComparer() - : System::Collections::Generic::IComparer(nullptr) - { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsGenericBaseIComparerSystemInt32Constructor(cppHandle, &handle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - BaseIComparer::BaseIComparer(decltype(nullptr)) - : System::Collections::Generic::IComparer(nullptr) - { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); - } - - BaseIComparer::BaseIComparer(const BaseIComparer& other) - : System::Collections::Generic::IComparer(nullptr) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - BaseIComparer::BaseIComparer(BaseIComparer&& other) - : System::Collections::Generic::IComparer(nullptr) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - BaseIComparer::BaseIComparer(Plugin::InternalUse, int32_t handle) - : System::Collections::Generic::IComparer(nullptr) - { - Handle = handle; - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemInt32(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - BaseIComparer::~BaseIComparer() - { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - BaseIComparer& BaseIComparer::operator=(const BaseIComparer& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - BaseIComparer& BaseIComparer::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - Handle = 0; - return *this; - } - - BaseIComparer& BaseIComparer::operator=(BaseIComparer&& other) - { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemInt32(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool BaseIComparer::operator==(const BaseIComparer& other) const - { - return Handle == other.Handle; - } - - bool BaseIComparer::operator!=(const BaseIComparer& other) const - { - return Handle != other.Handle; - } - - System::Int32 BaseIComparer::Compare(System::Int32 x, System::Int32 y) - { - return {}; - } - - DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemInt32Compare(int32_t cppHandle, int32_t x, int32_t y) - { - try - { - return Plugin::GetSystemCollectionsGenericBaseIComparerSystemInt32(cppHandle)->Compare(x, y); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - BaseIComparer::BaseIComparer() - : System::Collections::Generic::IComparer(nullptr) - { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsGenericBaseIComparerSystemStringConstructor(cppHandle, &handle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - BaseIComparer::BaseIComparer(decltype(nullptr)) - : System::Collections::Generic::IComparer(nullptr) - { - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); - } - - BaseIComparer::BaseIComparer(const BaseIComparer& other) - : System::Collections::Generic::IComparer(nullptr) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - BaseIComparer::BaseIComparer(BaseIComparer&& other) - : System::Collections::Generic::IComparer(nullptr) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - BaseIComparer::BaseIComparer(Plugin::InternalUse, int32_t handle) - : System::Collections::Generic::IComparer(nullptr) - { - Handle = handle; - CppHandle = Plugin::StoreSystemCollectionsGenericBaseIComparerSystemString(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - BaseIComparer::~BaseIComparer() - { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - BaseIComparer& BaseIComparer::operator=(const BaseIComparer& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - BaseIComparer& BaseIComparer::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - Handle = 0; - return *this; - } - - BaseIComparer& BaseIComparer::operator=(BaseIComparer&& other) - { - Plugin::RemoveSystemCollectionsGenericBaseIComparerSystemString(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool BaseIComparer::operator==(const BaseIComparer& other) const - { - return Handle == other.Handle; - } - - bool BaseIComparer::operator!=(const BaseIComparer& other) const - { - return Handle != other.Handle; - } - - System::Int32 BaseIComparer::Compare(System::String& x, System::String& y) - { - return {}; - } - - DLLEXPORT int32_t SystemCollectionsGenericIComparerSystemStringCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) - { - try - { - auto x = System::String(Plugin::InternalUse::Only, xHandle); - auto y = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemCollectionsGenericBaseIComparerSystemString(cppHandle)->Compare(x, y); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::Generic::IComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } - } - } -} - -namespace System -{ - StringComparer::StringComparer(decltype(nullptr)) - : System::Collections::IComparer(nullptr) - , System::Collections::Generic::IComparer(nullptr) - , System::Collections::IEqualityComparer(nullptr) - , System::Collections::Generic::IEqualityComparer(nullptr) - { - } - - StringComparer::StringComparer(Plugin::InternalUse, int32_t handle) - : System::Collections::IComparer(nullptr) - , System::Collections::Generic::IComparer(nullptr) - , System::Collections::IEqualityComparer(nullptr) - , System::Collections::Generic::IEqualityComparer(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - StringComparer::StringComparer(const StringComparer& other) - : StringComparer(Plugin::InternalUse::Only, other.Handle) - { - } - - StringComparer::StringComparer(StringComparer&& other) - : StringComparer(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - StringComparer::~StringComparer() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - StringComparer& StringComparer::operator=(const StringComparer& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - StringComparer& StringComparer::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - StringComparer& StringComparer::operator=(StringComparer&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool StringComparer::operator==(const StringComparer& other) const - { - return Handle == other.Handle; - } - - bool StringComparer::operator!=(const StringComparer& other) const - { - return Handle != other.Handle; - } -} - -namespace System -{ - BaseStringComparer::BaseStringComparer() - : System::Collections::IComparer(nullptr) - , System::Collections::Generic::IComparer(nullptr) - , System::Collections::IEqualityComparer(nullptr) - , System::Collections::Generic::IEqualityComparer(nullptr) - , System::StringComparer(nullptr) - { - CppHandle = Plugin::StoreSystemBaseStringComparer(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemBaseStringComparerConstructor(cppHandle, &handle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemBaseStringComparer(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - BaseStringComparer::BaseStringComparer(decltype(nullptr)) - : System::Collections::IComparer(nullptr) - , System::Collections::Generic::IComparer(nullptr) - , System::Collections::IEqualityComparer(nullptr) - , System::Collections::Generic::IEqualityComparer(nullptr) - , System::StringComparer(nullptr) - { - CppHandle = Plugin::StoreSystemBaseStringComparer(this); - } - - BaseStringComparer::BaseStringComparer(const BaseStringComparer& other) - : System::Collections::IComparer(nullptr) - , System::Collections::Generic::IComparer(nullptr) - , System::Collections::IEqualityComparer(nullptr) - , System::Collections::Generic::IEqualityComparer(nullptr) - , System::StringComparer(nullptr) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemBaseStringComparer(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - BaseStringComparer::BaseStringComparer(BaseStringComparer&& other) - : System::Collections::IComparer(nullptr) - , System::Collections::Generic::IComparer(nullptr) - , System::Collections::IEqualityComparer(nullptr) - , System::Collections::Generic::IEqualityComparer(nullptr) - , System::StringComparer(nullptr) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - BaseStringComparer::BaseStringComparer(Plugin::InternalUse, int32_t handle) - : System::Collections::IComparer(nullptr) - , System::Collections::Generic::IComparer(nullptr) - , System::Collections::IEqualityComparer(nullptr) - , System::Collections::Generic::IEqualityComparer(nullptr) - , System::StringComparer(nullptr) - { - Handle = handle; - CppHandle = Plugin::StoreSystemBaseStringComparer(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - BaseStringComparer::~BaseStringComparer() - { - Plugin::RemoveSystemBaseStringComparer(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemBaseStringComparer(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - BaseStringComparer& BaseStringComparer::operator=(const BaseStringComparer& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - BaseStringComparer& BaseStringComparer::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemBaseStringComparer(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - Handle = 0; - return *this; - } - - BaseStringComparer& BaseStringComparer::operator=(BaseStringComparer&& other) - { - Plugin::RemoveSystemBaseStringComparer(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemBaseStringComparer(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool BaseStringComparer::operator==(const BaseStringComparer& other) const - { - return Handle == other.Handle; - } - - bool BaseStringComparer::operator!=(const BaseStringComparer& other) const - { - return Handle != other.Handle; - } - - System::Int32 BaseStringComparer::Compare(System::String& x, System::String& y) - { - return {}; - } - - DLLEXPORT int32_t SystemStringComparerCompare(int32_t cppHandle, int32_t xHandle, int32_t yHandle) - { - try - { - auto x = System::String(Plugin::InternalUse::Only, xHandle); - auto y = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemBaseStringComparer(cppHandle)->Compare(x, y); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::StringComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } - - System::Boolean BaseStringComparer::Equals(System::String& x, System::String& y) - { - return {}; - } - - DLLEXPORT int32_t SystemStringComparerEquals(int32_t cppHandle, int32_t xHandle, int32_t yHandle) - { - try - { - auto x = System::String(Plugin::InternalUse::Only, xHandle); - auto y = System::String(Plugin::InternalUse::Only, yHandle); - return Plugin::GetSystemBaseStringComparer(cppHandle)->Equals(x, y); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::StringComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } - - System::Int32 BaseStringComparer::GetHashCode(System::String& obj) - { - return {}; - } - - DLLEXPORT int32_t SystemStringComparerGetHashCode(int32_t cppHandle, int32_t objHandle) - { - try - { - auto obj = System::String(Plugin::InternalUse::Only, objHandle); - return Plugin::GetSystemBaseStringComparer(cppHandle)->GetHashCode(obj); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::StringComparer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } -} - -namespace System -{ - namespace Collections - { - Queue::Queue(decltype(nullptr)) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - { - } - - Queue::Queue(Plugin::InternalUse, int32_t handle) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Queue::Queue(const Queue& other) - : Queue(Plugin::InternalUse::Only, other.Handle) - { - } - - Queue::Queue(Queue&& other) - : Queue(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Queue::~Queue() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Queue& Queue::operator=(const Queue& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Queue& Queue::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Queue& Queue::operator=(Queue&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Queue::operator==(const Queue& other) const - { - return Handle == other.Handle; - } - - bool Queue::operator!=(const Queue& other) const - { - return Handle != other.Handle; - } - - System::Int32 Queue::GetCount() - { - auto returnValue = Plugin::SystemCollectionsQueuePropertyGetCount(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - } -} - -namespace System -{ - namespace Collections - { - BaseQueue::BaseQueue() - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::Queue(nullptr) - { - CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemCollectionsBaseQueueConstructor(cppHandle, &handle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemCollectionsBaseQueue(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - BaseQueue::BaseQueue(decltype(nullptr)) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::Queue(nullptr) - { - CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); - } - - BaseQueue::BaseQueue(const BaseQueue& other) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::Queue(nullptr) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - BaseQueue::BaseQueue(BaseQueue&& other) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::Queue(nullptr) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - BaseQueue::BaseQueue(Plugin::InternalUse, int32_t handle) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::Queue(nullptr) - { - Handle = handle; - CppHandle = Plugin::StoreSystemCollectionsBaseQueue(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - BaseQueue::~BaseQueue() - { - Plugin::RemoveSystemCollectionsBaseQueue(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsBaseQueue(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - BaseQueue& BaseQueue::operator=(const BaseQueue& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - BaseQueue& BaseQueue::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsBaseQueue(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - Handle = 0; - return *this; - } - - BaseQueue& BaseQueue::operator=(BaseQueue&& other) - { - Plugin::RemoveSystemCollectionsBaseQueue(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemCollectionsBaseQueue(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool BaseQueue::operator==(const BaseQueue& other) const - { - return Handle == other.Handle; - } - - bool BaseQueue::operator!=(const BaseQueue& other) const - { - return Handle != other.Handle; - } - - System::Int32 BaseQueue::GetCount() - { - return {}; - } - - DLLEXPORT int32_t SystemCollectionsQueueGetCount(int32_t cppHandle) - { - try - { - return Plugin::GetSystemCollectionsBaseQueue(cppHandle)->GetCount(); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Collections::Queue"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - IComponentChangeService::IComponentChangeService(decltype(nullptr)) - { - } - - IComponentChangeService::IComponentChangeService(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IComponentChangeService::IComponentChangeService(const IComponentChangeService& other) - : IComponentChangeService(Plugin::InternalUse::Only, other.Handle) - { - } - - IComponentChangeService::IComponentChangeService(IComponentChangeService&& other) - : IComponentChangeService(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IComponentChangeService::~IComponentChangeService() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IComponentChangeService& IComponentChangeService::operator=(const IComponentChangeService& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IComponentChangeService& IComponentChangeService::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IComponentChangeService& IComponentChangeService::operator=(IComponentChangeService&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IComponentChangeService::operator==(const IComponentChangeService& other) const - { - return Handle == other.Handle; - } - - bool IComponentChangeService::operator!=(const IComponentChangeService& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - BaseIComponentChangeService::BaseIComponentChangeService() - : System::ComponentModel::Design::IComponentChangeService(nullptr) - { - CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemComponentModelDesignBaseIComponentChangeServiceConstructor(cppHandle, &handle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemComponentModelDesignBaseIComponentChangeService(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - BaseIComponentChangeService::BaseIComponentChangeService(decltype(nullptr)) - : System::ComponentModel::Design::IComponentChangeService(nullptr) - { - CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); - } - - BaseIComponentChangeService::BaseIComponentChangeService(const BaseIComponentChangeService& other) - : System::ComponentModel::Design::IComponentChangeService(nullptr) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - BaseIComponentChangeService::BaseIComponentChangeService(BaseIComponentChangeService&& other) - : System::ComponentModel::Design::IComponentChangeService(nullptr) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - BaseIComponentChangeService::BaseIComponentChangeService(Plugin::InternalUse, int32_t handle) - : System::ComponentModel::Design::IComponentChangeService(nullptr) - { - Handle = handle; - CppHandle = Plugin::StoreSystemComponentModelDesignBaseIComponentChangeService(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - BaseIComponentChangeService::~BaseIComponentChangeService() - { - Plugin::RemoveSystemComponentModelDesignBaseIComponentChangeService(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - BaseIComponentChangeService& BaseIComponentChangeService::operator=(const BaseIComponentChangeService& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - BaseIComponentChangeService& BaseIComponentChangeService::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - Handle = 0; - return *this; - } - - BaseIComponentChangeService& BaseIComponentChangeService::operator=(BaseIComponentChangeService&& other) - { - Plugin::RemoveSystemComponentModelDesignBaseIComponentChangeService(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool BaseIComponentChangeService::operator==(const BaseIComponentChangeService& other) const - { - return Handle == other.Handle; - } - - bool BaseIComponentChangeService::operator!=(const BaseIComponentChangeService& other) const - { - return Handle != other.Handle; - } - - void BaseIComponentChangeService::OnComponentChanged(System::Object& component, System::ComponentModel::MemberDescriptor& member, System::Object& oldValue, System::Object& newValue) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceOnComponentChanged(int32_t cppHandle, int32_t componentHandle, int32_t memberHandle, int32_t oldValueHandle, int32_t newValueHandle) - { - try - { - auto component = System::Object(Plugin::InternalUse::Only, componentHandle); - auto member = System::ComponentModel::MemberDescriptor(Plugin::InternalUse::Only, memberHandle); - auto oldValue = System::Object(Plugin::InternalUse::Only, oldValueHandle); - auto newValue = System::Object(Plugin::InternalUse::Only, newValueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->OnComponentChanged(component, member, oldValue, newValue); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::OnComponentChanging(System::Object& component, System::ComponentModel::MemberDescriptor& member) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceOnComponentChanging(int32_t cppHandle, int32_t componentHandle, int32_t memberHandle) - { - try - { - auto component = System::Object(Plugin::InternalUse::Only, componentHandle); - auto member = System::ComponentModel::MemberDescriptor(Plugin::InternalUse::Only, memberHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->OnComponentChanging(component, member); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::AddComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentAdded(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentAdded(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::RemoveComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdded(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentAdded(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::AddComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentAdding(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentAdding(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::RemoveComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentAdding(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentAdding(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::AddComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentChanged(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentChangedEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentChanged(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::RemoveComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanged(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentChangedEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentChanged(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::AddComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentChanging(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentChangingEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentChanging(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::RemoveComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentChanging(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentChangingEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentChanging(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::AddComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentRemoved(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentRemoved(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::RemoveComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoved(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentRemoved(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::AddComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentRemoving(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentRemoving(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::RemoveComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRemoving(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentRemoving(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::AddComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceAddComponentRename(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentRenameEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->AddComponentRename(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void BaseIComponentChangeService::RemoveComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value) - { - } - - DLLEXPORT void SystemComponentModelDesignIComponentChangeServiceRemoveComponentRename(int32_t cppHandle, int32_t valueHandle) - { - try - { - auto value = System::ComponentModel::Design::ComponentRenameEventHandler(Plugin::InternalUse::Only, valueHandle); - Plugin::GetSystemComponentModelDesignBaseIComponentChangeService(cppHandle)->RemoveComponentRename(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::IComponentChangeService"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - } - } -} - -namespace System -{ - namespace IO - { - FileStream::FileStream(decltype(nullptr)) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) - { - } - - FileStream::FileStream(Plugin::InternalUse, int32_t handle) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - FileStream::FileStream(const FileStream& other) - : FileStream(Plugin::InternalUse::Only, other.Handle) - { - } - - FileStream::FileStream(FileStream&& other) - : FileStream(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - FileStream::~FileStream() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - FileStream& FileStream::operator=(const FileStream& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - FileStream& FileStream::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - FileStream& FileStream::operator=(FileStream&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool FileStream::operator==(const FileStream& other) const - { - return Handle == other.Handle; - } - - bool FileStream::operator!=(const FileStream& other) const - { - return Handle != other.Handle; - } - - FileStream::FileStream(System::String& path, System::IO::FileMode mode) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) - { - auto returnValue = Plugin::SystemIOFileStreamConstructorSystemString_SystemIOFileMode(path.Handle, mode); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - void FileStream::WriteByte(System::Byte value) - { - Plugin::SystemIOFileStreamMethodWriteByteSystemByte(Handle, value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } -} - -namespace System -{ - namespace IO - { - BaseFileStream::BaseFileStream(System::String& path, System::IO::FileMode mode) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) - , System::IO::FileStream(nullptr) - { - CppHandle = Plugin::StoreSystemIOBaseFileStream(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - Plugin::SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode(cppHandle, &handle->Value, path.Handle, mode); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemIOBaseFileStream(CppHandle); - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - BaseFileStream::BaseFileStream(decltype(nullptr)) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) - , System::IO::FileStream(nullptr) - { - CppHandle = Plugin::StoreSystemIOBaseFileStream(this); - } - - BaseFileStream::BaseFileStream(const BaseFileStream& other) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) - , System::IO::FileStream(nullptr) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemIOBaseFileStream(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - BaseFileStream::BaseFileStream(BaseFileStream&& other) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) - , System::IO::FileStream(nullptr) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - other.Handle = 0; - other.CppHandle = 0; - } - - BaseFileStream::BaseFileStream(Plugin::InternalUse, int32_t handle) - : System::MarshalByRefObject(nullptr) - , System::IDisposable(nullptr) - , System::IO::Stream(nullptr) - , System::IO::FileStream(nullptr) - { - Handle = handle; - CppHandle = Plugin::StoreSystemIOBaseFileStream(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - } - - BaseFileStream::~BaseFileStream() - { - Plugin::RemoveSystemIOBaseFileStream(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemIOBaseFileStream(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - BaseFileStream& BaseFileStream::operator=(const BaseFileStream& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - BaseFileStream& BaseFileStream::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemIOBaseFileStream(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - Handle = 0; - return *this; - } - - BaseFileStream& BaseFileStream::operator=(BaseFileStream&& other) - { - Plugin::RemoveSystemIOBaseFileStream(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - Handle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemIOBaseFileStream(handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool BaseFileStream::operator==(const BaseFileStream& other) const - { - return Handle == other.Handle; - } - - bool BaseFileStream::operator!=(const BaseFileStream& other) const - { - return Handle != other.Handle; - } - - void BaseFileStream::WriteByte(System::Byte value) - { - } - - DLLEXPORT void SystemIOFileStreamWriteByte(int32_t cppHandle, uint8_t value) - { - try - { - Plugin::GetSystemIOBaseFileStream(cppHandle)->WriteByte(value); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::IO::FileStream"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - } -} - -namespace UnityEngine -{ - namespace Playables - { - PlayableHandle::PlayableHandle(decltype(nullptr)) - { - } - - PlayableHandle::PlayableHandle(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedUnityEnginePlayablesPlayableHandle(Handle); - } - } - - PlayableHandle::PlayableHandle(const PlayableHandle& other) - : PlayableHandle(Plugin::InternalUse::Only, other.Handle) - { - } - - PlayableHandle::PlayableHandle(PlayableHandle&& other) - : PlayableHandle(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - PlayableHandle::~PlayableHandle() - { - if (Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); - Handle = 0; - } - } - - PlayableHandle& PlayableHandle::operator=(const PlayableHandle& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEnginePlayablesPlayableHandle(Handle); - } - return *this; - } - - PlayableHandle& PlayableHandle::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); - Handle = 0; - } - return *this; - } - - PlayableHandle& PlayableHandle::operator=(PlayableHandle&& other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEnginePlayablesPlayableHandle(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool PlayableHandle::operator==(const PlayableHandle& other) const - { - return Handle == other.Handle; - } - - bool PlayableHandle::operator!=(const PlayableHandle& other) const - { - return Handle != other.Handle; - } - - PlayableHandle::operator System::ValueType() - { - int32_t handle = Plugin::BoxPlayableHandle(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - PlayableHandle::operator System::Object() - { - int32_t handle = Plugin::BoxPlayableHandle(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - } -} - -namespace System -{ - Object::operator UnityEngine::Playables::PlayableHandle() - { - UnityEngine::Playables::PlayableHandle returnVal(Plugin::InternalUse::Only, Plugin::UnboxPlayableHandle(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - ITransform::ITransform(decltype(nullptr)) - { - } - - ITransform::ITransform(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ITransform::ITransform(const ITransform& other) - : ITransform(Plugin::InternalUse::Only, other.Handle) - { - } - - ITransform::ITransform(ITransform&& other) - : ITransform(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ITransform::~ITransform() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ITransform& ITransform::operator=(const ITransform& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ITransform& ITransform::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ITransform& ITransform::operator=(ITransform&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ITransform::operator==(const ITransform& other) const - { - return Handle == other.Handle; - } - - bool ITransform::operator!=(const ITransform& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - IUIElementDataWatch::IUIElementDataWatch(decltype(nullptr)) - { - } - - IUIElementDataWatch::IUIElementDataWatch(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IUIElementDataWatch::IUIElementDataWatch(const IUIElementDataWatch& other) - : IUIElementDataWatch(Plugin::InternalUse::Only, other.Handle) - { - } - - IUIElementDataWatch::IUIElementDataWatch(IUIElementDataWatch&& other) - : IUIElementDataWatch(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IUIElementDataWatch::~IUIElementDataWatch() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IUIElementDataWatch& IUIElementDataWatch::operator=(const IUIElementDataWatch& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IUIElementDataWatch& IUIElementDataWatch::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IUIElementDataWatch& IUIElementDataWatch::operator=(IUIElementDataWatch&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IUIElementDataWatch::operator==(const IUIElementDataWatch& other) const - { - return Handle == other.Handle; - } - - bool IUIElementDataWatch::operator!=(const IUIElementDataWatch& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - IVisualElementScheduler::IVisualElementScheduler(decltype(nullptr)) - { - } - - IVisualElementScheduler::IVisualElementScheduler(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IVisualElementScheduler::IVisualElementScheduler(const IVisualElementScheduler& other) - : IVisualElementScheduler(Plugin::InternalUse::Only, other.Handle) - { - } - - IVisualElementScheduler::IVisualElementScheduler(IVisualElementScheduler&& other) - : IVisualElementScheduler(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IVisualElementScheduler::~IVisualElementScheduler() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IVisualElementScheduler& IVisualElementScheduler::operator=(const IVisualElementScheduler& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IVisualElementScheduler& IVisualElementScheduler::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IVisualElementScheduler& IVisualElementScheduler::operator=(IVisualElementScheduler&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IVisualElementScheduler::operator==(const IVisualElementScheduler& other) const - { - return Handle == other.Handle; - } - - bool IVisualElementScheduler::operator!=(const IVisualElementScheduler& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEnumerator::IEnumerator(decltype(nullptr)) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerator::operator==(const IEnumerator& other) const - { - return Handle == other.Handle; - } - - bool IEnumerator::operator!=(const IEnumerator& other) const - { - return Handle != other.Handle; - } - - UnityEngine::Experimental::UIElements::VisualElement IEnumerator::GetCurrent() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Experimental::UIElements::VisualElement(Plugin::InternalUse::Only, returnValue); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEnumerable::IEnumerable(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - { - } - - IEnumerable::IEnumerable(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerable::~IEnumerable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerable& IEnumerable::operator=(const IEnumerable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerable& IEnumerable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerable& IEnumerable::operator=(IEnumerable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerable::operator==(const IEnumerable& other) const - { - return Handle == other.Handle; - } - - bool IEnumerable::operator!=(const IEnumerable& other) const - { - return Handle != other.Handle; - } - - System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); - } - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - VisualElement::VisualElement(decltype(nullptr)) - : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) - , UnityEngine::Experimental::UIElements::CallbackEventHandler(nullptr) - , UnityEngine::Experimental::UIElements::Focusable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , UnityEngine::Experimental::UIElements::IStyle(nullptr) - , UnityEngine::Experimental::UIElements::ITransform(nullptr) - , UnityEngine::Experimental::UIElements::IUIElementDataWatch(nullptr) - , UnityEngine::Experimental::UIElements::IVisualElementScheduler(nullptr) - { - } - - VisualElement::VisualElement(Plugin::InternalUse, int32_t handle) - : UnityEngine::Experimental::UIElements::IEventHandler(nullptr) - , UnityEngine::Experimental::UIElements::CallbackEventHandler(nullptr) - , UnityEngine::Experimental::UIElements::Focusable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , UnityEngine::Experimental::UIElements::IStyle(nullptr) - , UnityEngine::Experimental::UIElements::ITransform(nullptr) - , UnityEngine::Experimental::UIElements::IUIElementDataWatch(nullptr) - , UnityEngine::Experimental::UIElements::IVisualElementScheduler(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - VisualElement::VisualElement(const VisualElement& other) - : VisualElement(Plugin::InternalUse::Only, other.Handle) - { - } - - VisualElement::VisualElement(VisualElement&& other) - : VisualElement(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - VisualElement::~VisualElement() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - VisualElement& VisualElement::operator=(const VisualElement& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - VisualElement& VisualElement::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - VisualElement& VisualElement::operator=(VisualElement&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool VisualElement::operator==(const VisualElement& other) const - { - return Handle == other.Handle; - } - - bool VisualElement::operator!=(const VisualElement& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - UnityEngineExperimentalUIElementsVisualElementIterator::UnityEngineExperimentalUIElementsVisualElementIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - UnityEngineExperimentalUIElementsVisualElementIterator::UnityEngineExperimentalUIElementsVisualElementIterator(UnityEngine::Experimental::UIElements::VisualElement& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - UnityEngineExperimentalUIElementsVisualElementIterator::~UnityEngineExperimentalUIElementsVisualElementIterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - UnityEngineExperimentalUIElementsVisualElementIterator& UnityEngineExperimentalUIElementsVisualElementIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool UnityEngineExperimentalUIElementsVisualElementIterator::operator!=(const UnityEngineExperimentalUIElementsVisualElementIterator& other) - { - return hasMore; - } - - UnityEngine::Experimental::UIElements::VisualElement UnityEngineExperimentalUIElementsVisualElementIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - Plugin::UnityEngineExperimentalUIElementsVisualElementIterator begin(UnityEngine::Experimental::UIElements::VisualElement& enumerable) - { - return Plugin::UnityEngineExperimentalUIElementsVisualElementIterator(enumerable); - } - - Plugin::UnityEngineExperimentalUIElementsVisualElementIterator end(UnityEngine::Experimental::UIElements::VisualElement& enumerable) - { - return Plugin::UnityEngineExperimentalUIElementsVisualElementIterator(nullptr); - } - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - UnityEngine::Experimental::UIElements::VisualElement UQueryExtensions::Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name, System::Array1& classes) - { - auto returnValue = Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1(e.Handle, name.Handle, classes.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Experimental::UIElements::VisualElement(Plugin::InternalUse::Only, returnValue); - } - - UnityEngine::Experimental::UIElements::VisualElement UQueryExtensions::Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name, System::String& className) - { - auto returnValue = Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString(e.Handle, name.Handle, className.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Experimental::UIElements::VisualElement(Plugin::InternalUse::Only, returnValue); - } - } - } -} - -namespace UnityEngine -{ - namespace XR - { - namespace WSA - { - namespace Input - { - InteractionSourcePositionAccuracy::InteractionSourcePositionAccuracy(int32_t value) - : Value(value) - { - } - - UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy::operator int32_t() const - { - return Value; - } - - bool UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy::operator==(InteractionSourcePositionAccuracy other) - { - return Value == other.Value; - } - - bool UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy::operator!=(InteractionSourcePositionAccuracy other) - { - return Value != other.Value; - } - - InteractionSourcePositionAccuracy::operator System::Enum() - { - int32_t handle = Plugin::BoxInteractionSourcePositionAccuracy(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Enum(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - InteractionSourcePositionAccuracy::operator System::ValueType() - { - int32_t handle = Plugin::BoxInteractionSourcePositionAccuracy(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - InteractionSourcePositionAccuracy::operator System::Object() - { - int32_t handle = Plugin::BoxInteractionSourcePositionAccuracy(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - InteractionSourcePositionAccuracy::operator System::IFormattable() - { - int32_t handle = Plugin::BoxInteractionSourcePositionAccuracy(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IFormattable(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - InteractionSourcePositionAccuracy::operator System::IConvertible() - { - int32_t handle = Plugin::BoxInteractionSourcePositionAccuracy(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IConvertible(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - InteractionSourcePositionAccuracy::operator System::IComparable() - { - int32_t handle = Plugin::BoxInteractionSourcePositionAccuracy(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IComparable(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - } - } - } -} -const UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy::None(0); -const UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy::Approximate(1); -const UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy::High(2); - -namespace System -{ - Object::operator UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy() - { - UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy returnVal(Plugin::UnboxInteractionSourcePositionAccuracy(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - namespace XR - { - namespace WSA - { - namespace Input - { - InteractionSourceNode::InteractionSourceNode(int32_t value) - : Value(value) - { - } - - UnityEngine::XR::WSA::Input::InteractionSourceNode::operator int32_t() const - { - return Value; - } - - bool UnityEngine::XR::WSA::Input::InteractionSourceNode::operator==(InteractionSourceNode other) - { - return Value == other.Value; - } - - bool UnityEngine::XR::WSA::Input::InteractionSourceNode::operator!=(InteractionSourceNode other) - { - return Value != other.Value; - } - - InteractionSourceNode::operator System::Enum() - { - int32_t handle = Plugin::BoxInteractionSourceNode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Enum(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - InteractionSourceNode::operator System::ValueType() - { - int32_t handle = Plugin::BoxInteractionSourceNode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - InteractionSourceNode::operator System::Object() - { - int32_t handle = Plugin::BoxInteractionSourceNode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - InteractionSourceNode::operator System::IFormattable() - { - int32_t handle = Plugin::BoxInteractionSourceNode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IFormattable(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - InteractionSourceNode::operator System::IConvertible() - { - int32_t handle = Plugin::BoxInteractionSourceNode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IConvertible(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - InteractionSourceNode::operator System::IComparable() - { - int32_t handle = Plugin::BoxInteractionSourceNode(*this); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::IComparable(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - } - } - } -} -const UnityEngine::XR::WSA::Input::InteractionSourceNode UnityEngine::XR::WSA::Input::InteractionSourceNode::Grip(0); -const UnityEngine::XR::WSA::Input::InteractionSourceNode UnityEngine::XR::WSA::Input::InteractionSourceNode::Pointer(1); - -namespace System -{ - Object::operator UnityEngine::XR::WSA::Input::InteractionSourceNode() - { - UnityEngine::XR::WSA::Input::InteractionSourceNode returnVal(Plugin::UnboxInteractionSourceNode(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace UnityEngine -{ - namespace XR - { - namespace WSA - { - namespace Input - { - InteractionSourcePose::InteractionSourcePose(decltype(nullptr)) - { - } - - InteractionSourcePose::InteractionSourcePose(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); - } - } - - InteractionSourcePose::InteractionSourcePose(const InteractionSourcePose& other) - : InteractionSourcePose(Plugin::InternalUse::Only, other.Handle) - { - } - - InteractionSourcePose::InteractionSourcePose(InteractionSourcePose&& other) - : InteractionSourcePose(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - InteractionSourcePose::~InteractionSourcePose() - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); - Handle = 0; - } - } - - InteractionSourcePose& InteractionSourcePose::operator=(const InteractionSourcePose& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); - } - return *this; - } - - InteractionSourcePose& InteractionSourcePose::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); - Handle = 0; - } - return *this; - } - - InteractionSourcePose& InteractionSourcePose::operator=(InteractionSourcePose&& other) - { - if (Handle) - { - Plugin::DereferenceManagedUnityEngineXRWSAInputInteractionSourcePose(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool InteractionSourcePose::operator==(const InteractionSourcePose& other) const - { - return Handle == other.Handle; - } - - bool InteractionSourcePose::operator!=(const InteractionSourcePose& other) const - { - return Handle != other.Handle; - } - - System::Boolean InteractionSourcePose::TryGetRotation(UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node) - { - auto returnValue = Plugin::UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode(Handle, rotation, node); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - InteractionSourcePose::operator System::ValueType() - { - int32_t handle = Plugin::BoxInteractionSourcePose(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::ValueType(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - - InteractionSourcePose::operator System::Object() - { - int32_t handle = Plugin::BoxInteractionSourcePose(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (handle) - { - Plugin::ReferenceManagedClass(handle); - return System::Object(Plugin::InternalUse::Only, handle); - } - return nullptr; - } - } - } - } -} - -namespace System -{ - Object::operator UnityEngine::XR::WSA::Input::InteractionSourcePose() - { - UnityEngine::XR::WSA::Input::InteractionSourcePose returnVal(Plugin::InternalUse::Only, Plugin::UnboxInteractionSourcePose(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEnumerator::IEnumerator(decltype(nullptr)) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerator::operator==(const IEnumerator& other) const - { - return Handle == other.Handle; - } - - bool IEnumerator::operator!=(const IEnumerator& other) const - { - return Handle != other.Handle; - } - - System::String IEnumerator::GetCurrent() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEnumerator::IEnumerator(decltype(nullptr)) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerator::operator==(const IEnumerator& other) const - { - return Handle == other.Handle; - } - - bool IEnumerator::operator!=(const IEnumerator& other) const - { - return Handle != other.Handle; - } - - System::Int32 IEnumerator::GetCurrent() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEnumerator::IEnumerator(decltype(nullptr)) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerator::operator==(const IEnumerator& other) const - { - return Handle == other.Handle; - } - - bool IEnumerator::operator!=(const IEnumerator& other) const - { - return Handle != other.Handle; - } - - System::Single IEnumerator::GetCurrent() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEnumerator::IEnumerator(decltype(nullptr)) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerator::operator==(const IEnumerator& other) const - { - return Handle == other.Handle; - } - - bool IEnumerator::operator!=(const IEnumerator& other) const - { - return Handle != other.Handle; - } - - UnityEngine::RaycastHit IEnumerator::GetCurrent() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::RaycastHit(Plugin::InternalUse::Only, returnValue); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEnumerator::IEnumerator(decltype(nullptr)) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerator::operator==(const IEnumerator& other) const - { - return Handle == other.Handle; - } - - bool IEnumerator::operator!=(const IEnumerator& other) const - { - return Handle != other.Handle; - } - - UnityEngine::GradientColorKey IEnumerator::GetCurrent() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEnumerator::IEnumerator(decltype(nullptr)) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - } - - IEnumerator::IEnumerator(Plugin::InternalUse, int32_t handle) - : System::IDisposable(nullptr) - , System::Collections::IEnumerator(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerator::IEnumerator(const IEnumerator& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerator::IEnumerator(IEnumerator&& other) - : IEnumerator(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerator::~IEnumerator() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerator& IEnumerator::operator=(const IEnumerator& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerator& IEnumerator::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerator& IEnumerator::operator=(IEnumerator&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerator::operator==(const IEnumerator& other) const - { - return Handle == other.Handle; - } - - bool IEnumerator::operator!=(const IEnumerator& other) const - { - return Handle != other.Handle; - } - - UnityEngine::Resolution IEnumerator::GetCurrent() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Resolution(Plugin::InternalUse::Only, returnValue); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEnumerable::IEnumerable(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - { - } - - IEnumerable::IEnumerable(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerable::~IEnumerable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerable& IEnumerable::operator=(const IEnumerable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerable& IEnumerable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerable& IEnumerable::operator=(IEnumerable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerable::operator==(const IEnumerable& other) const - { - return Handle == other.Handle; - } - - bool IEnumerable::operator!=(const IEnumerable& other) const - { - return Handle != other.Handle; - } - - System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEnumerable::IEnumerable(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - { - } - - IEnumerable::IEnumerable(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerable::~IEnumerable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerable& IEnumerable::operator=(const IEnumerable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerable& IEnumerable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerable& IEnumerable::operator=(IEnumerable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerable::operator==(const IEnumerable& other) const - { - return Handle == other.Handle; - } - - bool IEnumerable::operator!=(const IEnumerable& other) const - { - return Handle != other.Handle; - } - - System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEnumerable::IEnumerable(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - { - } - - IEnumerable::IEnumerable(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerable::~IEnumerable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerable& IEnumerable::operator=(const IEnumerable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerable& IEnumerable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerable& IEnumerable::operator=(IEnumerable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerable::operator==(const IEnumerable& other) const - { - return Handle == other.Handle; - } - - bool IEnumerable::operator!=(const IEnumerable& other) const - { - return Handle != other.Handle; - } - - System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEnumerable::IEnumerable(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - { - } - - IEnumerable::IEnumerable(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerable::~IEnumerable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerable& IEnumerable::operator=(const IEnumerable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerable& IEnumerable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerable& IEnumerable::operator=(IEnumerable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerable::operator==(const IEnumerable& other) const - { - return Handle == other.Handle; - } - - bool IEnumerable::operator!=(const IEnumerable& other) const - { - return Handle != other.Handle; - } - - System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEnumerable::IEnumerable(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - { - } - - IEnumerable::IEnumerable(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerable::~IEnumerable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerable& IEnumerable::operator=(const IEnumerable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerable& IEnumerable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerable& IEnumerable::operator=(IEnumerable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerable::operator==(const IEnumerable& other) const - { - return Handle == other.Handle; - } - - bool IEnumerable::operator!=(const IEnumerable& other) const - { - return Handle != other.Handle; - } - - System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IEnumerable::IEnumerable(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - { - } - - IEnumerable::IEnumerable(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IEnumerable::IEnumerable(const IEnumerable& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - } - - IEnumerable::IEnumerable(IEnumerable&& other) - : IEnumerable(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IEnumerable::~IEnumerable() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IEnumerable& IEnumerable::operator=(const IEnumerable& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IEnumerable& IEnumerable::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IEnumerable& IEnumerable::operator=(IEnumerable&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IEnumerable::operator==(const IEnumerable& other) const - { - return Handle == other.Handle; - } - - bool IEnumerable::operator!=(const IEnumerable& other) const - { - return Handle != other.Handle; - } - - System::Collections::Generic::IEnumerator IEnumerable::GetEnumerator() - { - auto returnValue = Plugin::SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::Collections::Generic::IEnumerator(Plugin::InternalUse::Only, returnValue); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - ICollection::ICollection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - } - - ICollection::ICollection(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - } - - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ICollection::~ICollection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ICollection& ICollection::operator=(const ICollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ICollection& ICollection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ICollection& ICollection::operator=(ICollection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ICollection::operator==(const ICollection& other) const - { - return Handle == other.Handle; - } - - bool ICollection::operator!=(const ICollection& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - SystemCollectionsGenericICollectionSystemStringIterator::SystemCollectionsGenericICollectionSystemStringIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericICollectionSystemStringIterator::SystemCollectionsGenericICollectionSystemStringIterator(System::Collections::Generic::ICollection& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericICollectionSystemStringIterator::~SystemCollectionsGenericICollectionSystemStringIterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericICollectionSystemStringIterator& SystemCollectionsGenericICollectionSystemStringIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericICollectionSystemStringIterator::operator!=(const SystemCollectionsGenericICollectionSystemStringIterator& other) - { - return hasMore; - } - - System::String SystemCollectionsGenericICollectionSystemStringIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionSystemStringIterator begin(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionSystemStringIterator(enumerable); - } - - Plugin::SystemCollectionsGenericICollectionSystemStringIterator end(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionSystemStringIterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - ICollection::ICollection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - } - - ICollection::ICollection(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - } - - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ICollection::~ICollection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ICollection& ICollection::operator=(const ICollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ICollection& ICollection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ICollection& ICollection::operator=(ICollection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ICollection::operator==(const ICollection& other) const - { - return Handle == other.Handle; - } - - bool ICollection::operator!=(const ICollection& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - SystemCollectionsGenericICollectionSystemInt32Iterator::SystemCollectionsGenericICollectionSystemInt32Iterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericICollectionSystemInt32Iterator::SystemCollectionsGenericICollectionSystemInt32Iterator(System::Collections::Generic::ICollection& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericICollectionSystemInt32Iterator::~SystemCollectionsGenericICollectionSystemInt32Iterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericICollectionSystemInt32Iterator& SystemCollectionsGenericICollectionSystemInt32Iterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericICollectionSystemInt32Iterator::operator!=(const SystemCollectionsGenericICollectionSystemInt32Iterator& other) - { - return hasMore; - } - - System::Int32 SystemCollectionsGenericICollectionSystemInt32Iterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator begin(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator(enumerable); - } - - Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator end(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - ICollection::ICollection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - } - - ICollection::ICollection(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - } - - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ICollection::~ICollection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ICollection& ICollection::operator=(const ICollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ICollection& ICollection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ICollection& ICollection::operator=(ICollection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ICollection::operator==(const ICollection& other) const - { - return Handle == other.Handle; - } - - bool ICollection::operator!=(const ICollection& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - SystemCollectionsGenericICollectionSystemSingleIterator::SystemCollectionsGenericICollectionSystemSingleIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericICollectionSystemSingleIterator::SystemCollectionsGenericICollectionSystemSingleIterator(System::Collections::Generic::ICollection& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericICollectionSystemSingleIterator::~SystemCollectionsGenericICollectionSystemSingleIterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericICollectionSystemSingleIterator& SystemCollectionsGenericICollectionSystemSingleIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericICollectionSystemSingleIterator::operator!=(const SystemCollectionsGenericICollectionSystemSingleIterator& other) - { - return hasMore; - } - - System::Single SystemCollectionsGenericICollectionSystemSingleIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionSystemSingleIterator begin(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionSystemSingleIterator(enumerable); - } - - Plugin::SystemCollectionsGenericICollectionSystemSingleIterator end(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionSystemSingleIterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - ICollection::ICollection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - } - - ICollection::ICollection(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - } - - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ICollection::~ICollection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ICollection& ICollection::operator=(const ICollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ICollection& ICollection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ICollection& ICollection::operator=(ICollection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ICollection::operator==(const ICollection& other) const - { - return Handle == other.Handle; - } - - bool ICollection::operator!=(const ICollection& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(System::Collections::Generic::ICollection& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::~SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::operator!=(const SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& other) - { - return hasMore; - } - - UnityEngine::RaycastHit SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator begin(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(enumerable); - } - - Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator end(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - ICollection::ICollection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - } - - ICollection::ICollection(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - } - - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ICollection::~ICollection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ICollection& ICollection::operator=(const ICollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ICollection& ICollection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ICollection& ICollection::operator=(ICollection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ICollection::operator==(const ICollection& other) const - { - return Handle == other.Handle; - } - - bool ICollection::operator!=(const ICollection& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(System::Collections::Generic::ICollection& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::~SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::operator!=(const SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& other) - { - return hasMore; - } - - UnityEngine::GradientColorKey SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(enumerable); - } - - Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator end(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - ICollection::ICollection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - } - - ICollection::ICollection(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - ICollection::ICollection(const ICollection& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - } - - ICollection::ICollection(ICollection&& other) - : ICollection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - ICollection::~ICollection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - ICollection& ICollection::operator=(const ICollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - ICollection& ICollection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - ICollection& ICollection::operator=(ICollection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ICollection::operator==(const ICollection& other) const - { - return Handle == other.Handle; - } - - bool ICollection::operator!=(const ICollection& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - SystemCollectionsGenericICollectionUnityEngineResolutionIterator::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericICollectionUnityEngineResolutionIterator::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(System::Collections::Generic::ICollection& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericICollectionUnityEngineResolutionIterator::~SystemCollectionsGenericICollectionUnityEngineResolutionIterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericICollectionUnityEngineResolutionIterator& SystemCollectionsGenericICollectionUnityEngineResolutionIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericICollectionUnityEngineResolutionIterator::operator!=(const SystemCollectionsGenericICollectionUnityEngineResolutionIterator& other) - { - return hasMore; - } - - UnityEngine::Resolution SystemCollectionsGenericICollectionUnityEngineResolutionIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator begin(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(enumerable); - } - - Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator end(System::Collections::Generic::ICollection& enumerable) - { - return Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IList::IList(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - { - } - - IList::IList(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IList::IList(const IList& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - } - - IList::IList(IList&& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IList::~IList() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IList& IList::operator=(const IList& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IList& IList::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IList& IList::operator=(IList&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IList::operator==(const IList& other) const - { - return Handle == other.Handle; - } - - bool IList::operator!=(const IList& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - SystemCollectionsGenericIListSystemStringIterator::SystemCollectionsGenericIListSystemStringIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericIListSystemStringIterator::SystemCollectionsGenericIListSystemStringIterator(System::Collections::Generic::IList& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericIListSystemStringIterator::~SystemCollectionsGenericIListSystemStringIterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericIListSystemStringIterator& SystemCollectionsGenericIListSystemStringIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericIListSystemStringIterator::operator!=(const SystemCollectionsGenericIListSystemStringIterator& other) - { - return hasMore; - } - - System::String SystemCollectionsGenericIListSystemStringIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericIListSystemStringIterator begin(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListSystemStringIterator(enumerable); - } - - Plugin::SystemCollectionsGenericIListSystemStringIterator end(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListSystemStringIterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IList::IList(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - { - } - - IList::IList(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IList::IList(const IList& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - } - - IList::IList(IList&& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IList::~IList() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IList& IList::operator=(const IList& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IList& IList::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IList& IList::operator=(IList&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IList::operator==(const IList& other) const - { - return Handle == other.Handle; - } - - bool IList::operator!=(const IList& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - SystemCollectionsGenericIListSystemInt32Iterator::SystemCollectionsGenericIListSystemInt32Iterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericIListSystemInt32Iterator::SystemCollectionsGenericIListSystemInt32Iterator(System::Collections::Generic::IList& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericIListSystemInt32Iterator::~SystemCollectionsGenericIListSystemInt32Iterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericIListSystemInt32Iterator& SystemCollectionsGenericIListSystemInt32Iterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericIListSystemInt32Iterator::operator!=(const SystemCollectionsGenericIListSystemInt32Iterator& other) - { - return hasMore; - } - - System::Int32 SystemCollectionsGenericIListSystemInt32Iterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericIListSystemInt32Iterator begin(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListSystemInt32Iterator(enumerable); - } - - Plugin::SystemCollectionsGenericIListSystemInt32Iterator end(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListSystemInt32Iterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IList::IList(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - { - } - - IList::IList(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IList::IList(const IList& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - } - - IList::IList(IList&& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IList::~IList() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IList& IList::operator=(const IList& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IList& IList::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IList& IList::operator=(IList&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IList::operator==(const IList& other) const - { - return Handle == other.Handle; - } - - bool IList::operator!=(const IList& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - SystemCollectionsGenericIListSystemSingleIterator::SystemCollectionsGenericIListSystemSingleIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericIListSystemSingleIterator::SystemCollectionsGenericIListSystemSingleIterator(System::Collections::Generic::IList& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericIListSystemSingleIterator::~SystemCollectionsGenericIListSystemSingleIterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericIListSystemSingleIterator& SystemCollectionsGenericIListSystemSingleIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericIListSystemSingleIterator::operator!=(const SystemCollectionsGenericIListSystemSingleIterator& other) - { - return hasMore; - } - - System::Single SystemCollectionsGenericIListSystemSingleIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericIListSystemSingleIterator begin(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListSystemSingleIterator(enumerable); - } - - Plugin::SystemCollectionsGenericIListSystemSingleIterator end(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListSystemSingleIterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IList::IList(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - { - } - - IList::IList(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IList::IList(const IList& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - } - - IList::IList(IList&& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IList::~IList() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IList& IList::operator=(const IList& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IList& IList::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IList& IList::operator=(IList&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IList::operator==(const IList& other) const - { - return Handle == other.Handle; - } - - bool IList::operator!=(const IList& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - SystemCollectionsGenericIListUnityEngineRaycastHitIterator::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericIListUnityEngineRaycastHitIterator::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(System::Collections::Generic::IList& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericIListUnityEngineRaycastHitIterator::~SystemCollectionsGenericIListUnityEngineRaycastHitIterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericIListUnityEngineRaycastHitIterator& SystemCollectionsGenericIListUnityEngineRaycastHitIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericIListUnityEngineRaycastHitIterator::operator!=(const SystemCollectionsGenericIListUnityEngineRaycastHitIterator& other) - { - return hasMore; - } - - UnityEngine::RaycastHit SystemCollectionsGenericIListUnityEngineRaycastHitIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator begin(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(enumerable); - } - - Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator end(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IList::IList(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - { - } - - IList::IList(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IList::IList(const IList& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - } - - IList::IList(IList&& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IList::~IList() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IList& IList::operator=(const IList& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IList& IList::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IList& IList::operator=(IList&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IList::operator==(const IList& other) const - { - return Handle == other.Handle; - } - - bool IList::operator!=(const IList& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(System::Collections::Generic::IList& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::~SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::operator!=(const SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& other) - { - return hasMore; - } - - UnityEngine::GradientColorKey SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(enumerable); - } - - Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator end(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - IList::IList(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - { - } - - IList::IList(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - IList::IList(const IList& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - } - - IList::IList(IList&& other) - : IList(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - IList::~IList() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - IList& IList::operator=(const IList& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - IList& IList::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - IList& IList::operator=(IList&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool IList::operator==(const IList& other) const - { - return Handle == other.Handle; - } - - bool IList::operator!=(const IList& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - SystemCollectionsGenericIListUnityEngineResolutionIterator::SystemCollectionsGenericIListUnityEngineResolutionIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericIListUnityEngineResolutionIterator::SystemCollectionsGenericIListUnityEngineResolutionIterator(System::Collections::Generic::IList& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericIListUnityEngineResolutionIterator::~SystemCollectionsGenericIListUnityEngineResolutionIterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericIListUnityEngineResolutionIterator& SystemCollectionsGenericIListUnityEngineResolutionIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericIListUnityEngineResolutionIterator::operator!=(const SystemCollectionsGenericIListUnityEngineResolutionIterator& other) - { - return hasMore; - } - - UnityEngine::Resolution SystemCollectionsGenericIListUnityEngineResolutionIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator begin(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator(enumerable); - } - - Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator end(System::Collections::Generic::IList& enumerable) - { - return Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - List::List(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - } - - List::List(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - List::List(const List& other) - : List(Plugin::InternalUse::Only, other.Handle) - { - } - - List::List(List&& other) - : List(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - List::~List() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - List& List::operator=(const List& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - List& List::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - List& List::operator=(List&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool List::operator==(const List& other) const - { - return Handle == other.Handle; - } - - bool List::operator!=(const List& other) const - { - return Handle != other.Handle; - } - - List::List() - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - auto returnValue = Plugin::SystemCollectionsGenericListSystemStringConstructor(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - System::String List::GetItem(System::Int32 index) - { - auto returnValue = Plugin::SystemCollectionsGenericListSystemStringPropertyGetItem(Handle, index); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); - } - - void List::SetItem(System::Int32 index, System::String& value) - { - Plugin::SystemCollectionsGenericListSystemStringPropertySetItem(Handle, index, value.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void List::Add(System::String& item) - { - Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString(Handle, item.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void List::Sort(System::Collections::Generic::IComparer& comparer) - { - Plugin::SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } -} - -namespace Plugin -{ - SystemCollectionsGenericListSystemStringIterator::SystemCollectionsGenericListSystemStringIterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericListSystemStringIterator::SystemCollectionsGenericListSystemStringIterator(System::Collections::Generic::List& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericListSystemStringIterator::~SystemCollectionsGenericListSystemStringIterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericListSystemStringIterator& SystemCollectionsGenericListSystemStringIterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericListSystemStringIterator::operator!=(const SystemCollectionsGenericListSystemStringIterator& other) - { - return hasMore; - } - - System::String SystemCollectionsGenericListSystemStringIterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericListSystemStringIterator begin(System::Collections::Generic::List& enumerable) - { - return Plugin::SystemCollectionsGenericListSystemStringIterator(enumerable); - } - - Plugin::SystemCollectionsGenericListSystemStringIterator end(System::Collections::Generic::List& enumerable) - { - return Plugin::SystemCollectionsGenericListSystemStringIterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - List::List(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - } - - List::List(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - List::List(const List& other) - : List(Plugin::InternalUse::Only, other.Handle) - { - } - - List::List(List&& other) - : List(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - List::~List() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - List& List::operator=(const List& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - List& List::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - List& List::operator=(List&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool List::operator==(const List& other) const - { - return Handle == other.Handle; - } - - bool List::operator!=(const List& other) const - { - return Handle != other.Handle; - } - - List::List() - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - auto returnValue = Plugin::SystemCollectionsGenericListSystemInt32Constructor(); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - } - } - - System::Int32 List::GetItem(System::Int32 index) - { - auto returnValue = Plugin::SystemCollectionsGenericListSystemInt32PropertyGetItem(Handle, index); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } - - void List::SetItem(System::Int32 index, System::Int32 value) - { - Plugin::SystemCollectionsGenericListSystemInt32PropertySetItem(Handle, index, value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void List::Add(System::Int32 item) - { - Plugin::SystemCollectionsGenericListSystemInt32MethodAddSystemInt32(Handle, item); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void List::Sort(System::Collections::Generic::IComparer& comparer) - { - Plugin::SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer(Handle, comparer.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } -} - -namespace Plugin -{ - SystemCollectionsGenericListSystemInt32Iterator::SystemCollectionsGenericListSystemInt32Iterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsGenericListSystemInt32Iterator::SystemCollectionsGenericListSystemInt32Iterator(System::Collections::Generic::List& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsGenericListSystemInt32Iterator::~SystemCollectionsGenericListSystemInt32Iterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsGenericListSystemInt32Iterator& SystemCollectionsGenericListSystemInt32Iterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsGenericListSystemInt32Iterator::operator!=(const SystemCollectionsGenericListSystemInt32Iterator& other) - { - return hasMore; - } - - System::Int32 SystemCollectionsGenericListSystemInt32Iterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericListSystemInt32Iterator begin(System::Collections::Generic::List& enumerable) - { - return Plugin::SystemCollectionsGenericListSystemInt32Iterator(enumerable); - } - - Plugin::SystemCollectionsGenericListSystemInt32Iterator end(System::Collections::Generic::List& enumerable) - { - return Plugin::SystemCollectionsGenericListSystemInt32Iterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace ObjectModel - { - Collection::Collection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - } - - Collection::Collection(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - Collection::Collection(const Collection& other) - : Collection(Plugin::InternalUse::Only, other.Handle) - { - } - - Collection::Collection(Collection&& other) - : Collection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - Collection::~Collection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Collection& Collection::operator=(const Collection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - Collection& Collection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Collection& Collection::operator=(Collection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Collection::operator==(const Collection& other) const - { - return Handle == other.Handle; - } - - bool Collection::operator!=(const Collection& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - SystemCollectionsObjectModelCollectionSystemInt32Iterator::SystemCollectionsObjectModelCollectionSystemInt32Iterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsObjectModelCollectionSystemInt32Iterator::SystemCollectionsObjectModelCollectionSystemInt32Iterator(System::Collections::ObjectModel::Collection& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsObjectModelCollectionSystemInt32Iterator::~SystemCollectionsObjectModelCollectionSystemInt32Iterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsObjectModelCollectionSystemInt32Iterator& SystemCollectionsObjectModelCollectionSystemInt32Iterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsObjectModelCollectionSystemInt32Iterator::operator!=(const SystemCollectionsObjectModelCollectionSystemInt32Iterator& other) - { - return hasMore; - } - - System::Int32 SystemCollectionsObjectModelCollectionSystemInt32Iterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace ObjectModel - { - Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator begin(System::Collections::ObjectModel::Collection& enumerable) - { - return Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator(enumerable); - } - - Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator end(System::Collections::ObjectModel::Collection& enumerable) - { - return Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator(nullptr); - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace ObjectModel - { - KeyedCollection::KeyedCollection(decltype(nullptr)) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - , System::Collections::ObjectModel::Collection(nullptr) - { - } - - KeyedCollection::KeyedCollection(Plugin::InternalUse, int32_t handle) - : System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - , System::Collections::ObjectModel::Collection(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - KeyedCollection::KeyedCollection(const KeyedCollection& other) - : KeyedCollection(Plugin::InternalUse::Only, other.Handle) - { - } - - KeyedCollection::KeyedCollection(KeyedCollection&& other) - : KeyedCollection(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - KeyedCollection::~KeyedCollection() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - KeyedCollection& KeyedCollection::operator=(const KeyedCollection& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - KeyedCollection& KeyedCollection::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - KeyedCollection& KeyedCollection::operator=(KeyedCollection&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool KeyedCollection::operator==(const KeyedCollection& other) const - { - return Handle == other.Handle; - } - - bool KeyedCollection::operator!=(const KeyedCollection& other) const - { - return Handle != other.Handle; - } - } - } -} - -namespace Plugin -{ - SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(decltype(nullptr)) - : enumerator(nullptr) - , hasMore(false) - { - } - - SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(System::Collections::ObjectModel::KeyedCollection& enumerable) - : enumerator(enumerable.GetEnumerator()) - { - hasMore = enumerator.MoveNext(); - } - - SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::~SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator() - { - if (enumerator != nullptr) - { - enumerator.Dispose(); - } - } - - SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::operator++() - { - hasMore = enumerator.MoveNext(); - return *this; - } - - bool SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::operator!=(const SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& other) - { - return hasMore; - } - - System::Int32 SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator::operator*() - { - return enumerator.GetCurrent(); - } -} - -namespace System -{ - namespace Collections - { - namespace ObjectModel - { - Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator begin(System::Collections::ObjectModel::KeyedCollection& enumerable) - { - return Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(enumerable); - } - - Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator end(System::Collections::ObjectModel::KeyedCollection& enumerable) - { - return Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(nullptr); - } - } - } -} - -namespace System -{ - Object::operator System::Boolean() - { - System::Boolean returnVal(Plugin::UnboxBoolean(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::operator System::SByte() - { - System::SByte returnVal(Plugin::UnboxSByte(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::operator System::Byte() - { - System::Byte returnVal(Plugin::UnboxByte(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::operator System::Int16() - { - System::Int16 returnVal(Plugin::UnboxInt16(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::operator System::UInt16() - { - System::UInt16 returnVal(Plugin::UnboxUInt16(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::operator System::Int32() - { - System::Int32 returnVal(Plugin::UnboxInt32(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::operator System::UInt32() - { - System::UInt32 returnVal(Plugin::UnboxUInt32(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::operator System::Int64() - { - System::Int64 returnVal(Plugin::UnboxInt64(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::operator System::UInt64() - { - System::UInt64 returnVal(Plugin::UnboxUInt64(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::operator System::Char() - { - System::Char returnVal(Plugin::UnboxChar(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::operator System::Single() - { - System::Single returnVal(Plugin::UnboxSingle(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace System -{ - Object::operator System::Double() - { - System::Double returnVal(Plugin::UnboxDouble(Handle)); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnVal; - } -} - -namespace MyGame -{ - namespace MonoBehaviours - { - TestScript::TestScript(decltype(nullptr)) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) - , UnityEngine::Behaviour(nullptr) - , UnityEngine::MonoBehaviour(nullptr) - { - } - - TestScript::TestScript(Plugin::InternalUse, int32_t handle) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) - , UnityEngine::Behaviour(nullptr) - , UnityEngine::MonoBehaviour(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - TestScript::TestScript(const TestScript& other) - : TestScript(Plugin::InternalUse::Only, other.Handle) - { - } - - TestScript::TestScript(TestScript&& other) - : TestScript(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - TestScript::~TestScript() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - TestScript& TestScript::operator=(const TestScript& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - TestScript& TestScript::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - TestScript& TestScript::operator=(TestScript&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool TestScript::operator==(const TestScript& other) const - { - return Handle == other.Handle; - } - - bool TestScript::operator!=(const TestScript& other) const - { - return Handle != other.Handle; - } - } -} - -namespace MyGame -{ - namespace MonoBehaviours - { - AnotherScript::AnotherScript(decltype(nullptr)) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) - , UnityEngine::Behaviour(nullptr) - , UnityEngine::MonoBehaviour(nullptr) - { - } - - AnotherScript::AnotherScript(Plugin::InternalUse, int32_t handle) - : UnityEngine::Object(nullptr) - , UnityEngine::Component(nullptr) - , UnityEngine::Behaviour(nullptr) - , UnityEngine::MonoBehaviour(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - } - - AnotherScript::AnotherScript(const AnotherScript& other) - : AnotherScript(Plugin::InternalUse::Only, other.Handle) - { - } - - AnotherScript::AnotherScript(AnotherScript&& other) - : AnotherScript(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - } - - AnotherScript::~AnotherScript() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - AnotherScript& AnotherScript::operator=(const AnotherScript& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - return *this; - } - - AnotherScript& AnotherScript::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - AnotherScript& AnotherScript::operator=(AnotherScript&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool AnotherScript::operator==(const AnotherScript& other) const - { - return Handle == other.Handle; - } - - bool AnotherScript::operator!=(const AnotherScript& other) const - { - return Handle != other.Handle; - } - } -} - -namespace Plugin -{ - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0) - { - Handle = handle; - Index0 = index0; - } - - void ArrayElementProxy1_1::operator=(System::Int32 item) - { - Plugin::SystemInt32Array1SetItem1(Handle, Index0, item); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - ArrayElementProxy1_1::operator System::Int32() - { - auto returnValue = Plugin::SystemInt32Array1GetItem1(Handle, Index0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } -} - -namespace System -{ - Array1::Array1(decltype(nullptr)) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - this->InternalLength = 0; - } - - Array1::Array1(Plugin::InternalUse, int32_t handle) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - this->InternalLength = 0; - } - - Array1::Array1(const Array1& other) - : Array1(Plugin::InternalUse::Only, other.Handle) - { - InternalLength = other.InternalLength; - } - - Array1::Array1(Array1&& other) - : Array1(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - InternalLength = other.InternalLength; - other.InternalLength = 0; - } - - Array1::~Array1() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Array1& Array1::operator=(const Array1& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - InternalLength = other.InternalLength; - return *this; - } - - Array1& Array1::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Array1& Array1::operator=(Array1&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - InternalLength = other.InternalLength; - other.Handle = 0; - other.InternalLength = 0; - return *this; - } - - bool Array1::operator==(const Array1& other) const - { - return Handle == other.Handle; - } - - bool Array1::operator!=(const Array1& other) const - { - return Handle != other.Handle; - } - - Array1::Array1(System::Int32 length0) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - auto returnValue = Plugin::SystemSystemInt32Array1Constructor1(length0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - InternalLength = length0; - } - } - - System::Int32 Array1::GetLength() - { - int32_t returnVal = InternalLength; - if (returnVal == 0) - { - returnVal = Array::GetLength(); - InternalLength = returnVal; - }; - return returnVal; - } - - System::Int32 Array1::GetRank() - { - return 1; - } - - Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) - { - return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); - } -} - -namespace Plugin -{ - SystemInt32Array1Iterator::SystemInt32Array1Iterator(System::Array1& array, int32_t index) - : array(array) - , index(index) - { - } - - SystemInt32Array1Iterator& SystemInt32Array1Iterator::operator++() - { - index++; - return *this; - } - - bool SystemInt32Array1Iterator::operator!=(const SystemInt32Array1Iterator& other) - { - return index != other.index; - } - - System::Int32 SystemInt32Array1Iterator::operator*() - { - return array[index]; - } -} - -namespace System -{ - Plugin::SystemInt32Array1Iterator begin(System::Array1& array) - { - return Plugin::SystemInt32Array1Iterator(array, 0); - } - - Plugin::SystemInt32Array1Iterator end(System::Array1& array) - { - return Plugin::SystemInt32Array1Iterator(array, array.GetLength() - 1); - } -} - -namespace Plugin -{ - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0) - { - Handle = handle; - Index0 = index0; - } - - void ArrayElementProxy1_1::operator=(System::Single item) - { - Plugin::SystemSingleArray1SetItem1(Handle, Index0, item); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - ArrayElementProxy1_1::operator System::Single() - { - auto returnValue = Plugin::SystemSingleArray1GetItem1(Handle, Index0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } -} - -namespace Plugin -{ - ArrayElementProxy1_2::ArrayElementProxy1_2(Plugin::InternalUse, int32_t handle, int32_t index0) - { - Handle = handle; - Index0 = index0; - } - - Plugin::ArrayElementProxy2_2 Plugin::ArrayElementProxy1_2::operator[](int32_t index) - { - return Plugin::ArrayElementProxy2_2(Plugin::InternalUse::Only, Handle, Index0, index); - } -} - -namespace Plugin -{ - ArrayElementProxy2_2::ArrayElementProxy2_2(Plugin::InternalUse, int32_t handle, int32_t index0, int32_t index1) - { - Handle = handle; - Index0 = index0; - Index1 = index1; - } - - void ArrayElementProxy2_2::operator=(System::Single item) - { - Plugin::SystemSingleArray2SetItem2(Handle, Index0, Index1, item); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - ArrayElementProxy2_2::operator System::Single() - { - auto returnValue = Plugin::SystemSingleArray2GetItem2(Handle, Index0, Index1); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } -} - -namespace Plugin -{ - ArrayElementProxy1_3::ArrayElementProxy1_3(Plugin::InternalUse, int32_t handle, int32_t index0) - { - Handle = handle; - Index0 = index0; - } - - Plugin::ArrayElementProxy2_3 Plugin::ArrayElementProxy1_3::operator[](int32_t index) - { - return Plugin::ArrayElementProxy2_3(Plugin::InternalUse::Only, Handle, Index0, index); - } -} - -namespace Plugin -{ - ArrayElementProxy2_3::ArrayElementProxy2_3(Plugin::InternalUse, int32_t handle, int32_t index0, int32_t index1) - { - Handle = handle; - Index0 = index0; - Index1 = index1; - } - - Plugin::ArrayElementProxy3_3 Plugin::ArrayElementProxy2_3::operator[](int32_t index) - { - return Plugin::ArrayElementProxy3_3(Plugin::InternalUse::Only, Handle, Index0, Index1, index); - } -} - -namespace Plugin -{ - ArrayElementProxy3_3::ArrayElementProxy3_3(Plugin::InternalUse, int32_t handle, int32_t index0, int32_t index1, int32_t index2) - { - Handle = handle; - Index0 = index0; - Index1 = index1; - Index2 = index2; - } - - void ArrayElementProxy3_3::operator=(System::Single item) - { - Plugin::SystemSingleArray3SetItem3(Handle, Index0, Index1, Index2, item); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - ArrayElementProxy3_3::operator System::Single() - { - auto returnValue = Plugin::SystemSingleArray3GetItem3(Handle, Index0, Index1, Index2); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } -} - -namespace System -{ - Array1::Array1(decltype(nullptr)) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - this->InternalLength = 0; - } - - Array1::Array1(Plugin::InternalUse, int32_t handle) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - this->InternalLength = 0; - } - - Array1::Array1(const Array1& other) - : Array1(Plugin::InternalUse::Only, other.Handle) - { - InternalLength = other.InternalLength; - } - - Array1::Array1(Array1&& other) - : Array1(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - InternalLength = other.InternalLength; - other.InternalLength = 0; - } - - Array1::~Array1() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Array1& Array1::operator=(const Array1& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - InternalLength = other.InternalLength; - return *this; - } - - Array1& Array1::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Array1& Array1::operator=(Array1&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - InternalLength = other.InternalLength; - other.Handle = 0; - other.InternalLength = 0; - return *this; - } - - bool Array1::operator==(const Array1& other) const - { - return Handle == other.Handle; - } - - bool Array1::operator!=(const Array1& other) const - { - return Handle != other.Handle; - } - - Array1::Array1(System::Int32 length0) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - auto returnValue = Plugin::SystemSystemSingleArray1Constructor1(length0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - InternalLength = length0; - } - } - - System::Int32 Array1::GetLength() - { - int32_t returnVal = InternalLength; - if (returnVal == 0) - { - returnVal = Array::GetLength(); - InternalLength = returnVal; - }; - return returnVal; - } - - System::Int32 Array1::GetRank() - { - return 1; - } - - Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) - { - return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); - } -} - -namespace Plugin -{ - SystemSingleArray1Iterator::SystemSingleArray1Iterator(System::Array1& array, int32_t index) - : array(array) - , index(index) - { - } - - SystemSingleArray1Iterator& SystemSingleArray1Iterator::operator++() - { - index++; - return *this; - } - - bool SystemSingleArray1Iterator::operator!=(const SystemSingleArray1Iterator& other) - { - return index != other.index; - } - - System::Single SystemSingleArray1Iterator::operator*() - { - return array[index]; - } -} - -namespace System -{ - Plugin::SystemSingleArray1Iterator begin(System::Array1& array) - { - return Plugin::SystemSingleArray1Iterator(array, 0); - } - - Plugin::SystemSingleArray1Iterator end(System::Array1& array) - { - return Plugin::SystemSingleArray1Iterator(array, array.GetLength() - 1); - } -} - -namespace System -{ - Array2::Array2(decltype(nullptr)) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - { - this->InternalLength = 0; - this->InternalLengths[0] = 0; - this->InternalLengths[1] = 0; - } - - Array2::Array2(Plugin::InternalUse, int32_t handle) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - this->InternalLength = 0; - this->InternalLengths[0] = 0; - this->InternalLengths[1] = 0; - } - - Array2::Array2(const Array2& other) - : Array2(Plugin::InternalUse::Only, other.Handle) - { - InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; - } - - Array2::Array2(Array2&& other) - : Array2(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; - other.InternalLength = 0; - other.InternalLengths[0] = 0; - other.InternalLengths[1] = 0; - } - - Array2::~Array2() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Array2& Array2::operator=(const Array2& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; - return *this; - } - - Array2& Array2::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Array2& Array2::operator=(Array2&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; - other.Handle = 0; - other.InternalLength = 0; - other.InternalLengths[0] = 0; - other.InternalLengths[1] = 0; - return *this; - } - - bool Array2::operator==(const Array2& other) const - { - return Handle == other.Handle; - } - - bool Array2::operator!=(const Array2& other) const - { - return Handle != other.Handle; - } - - Array2::Array2(System::Int32 length0, System::Int32 length1) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - { - auto returnValue = Plugin::SystemSystemSingleArray2Constructor2(length0, length1); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - InternalLength = length0 * length1; - InternalLengths[0] = length0; - InternalLengths[1] = length1; - } - } - - System::Int32 Array2::GetLength() - { - int32_t returnVal = InternalLength; - if (returnVal == 0) - { - returnVal = Array::GetLength(); - InternalLength = returnVal; - }; - return returnVal; - } - - System::Int32 Array2::GetLength(System::Int32 dimension) - { - assert(dimension >= 0 && dimension < 2); - int32_t length = InternalLengths[dimension]; - if (length) - { - return length; - } - auto returnValue = Plugin::SystemSystemSingleArray2GetLength2(Handle, dimension); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - InternalLengths[dimension] = returnValue; - return returnValue; - } - - System::Int32 Array2::GetRank() - { - return 2; - } - - Plugin::ArrayElementProxy1_2 System::Array2::operator[](int32_t index) - { - return Plugin::ArrayElementProxy1_2(Plugin::InternalUse::Only, Handle, index); - } -} - -namespace System -{ - Array3::Array3(decltype(nullptr)) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - { - this->InternalLength = 0; - this->InternalLengths[0] = 0; - this->InternalLengths[1] = 0; - this->InternalLengths[2] = 0; - } - - Array3::Array3(Plugin::InternalUse, int32_t handle) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - this->InternalLength = 0; - this->InternalLengths[0] = 0; - this->InternalLengths[1] = 0; - this->InternalLengths[2] = 0; - } - - Array3::Array3(const Array3& other) - : Array3(Plugin::InternalUse::Only, other.Handle) - { - InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; - InternalLengths[2] = other.InternalLengths[2]; - } - - Array3::Array3(Array3&& other) - : Array3(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; - InternalLengths[2] = other.InternalLengths[2]; - other.InternalLength = 0; - other.InternalLengths[0] = 0; - other.InternalLengths[1] = 0; - other.InternalLengths[2] = 0; - } - - Array3::~Array3() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Array3& Array3::operator=(const Array3& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; - InternalLengths[2] = other.InternalLengths[2]; - return *this; - } - - Array3& Array3::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Array3& Array3::operator=(Array3&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - InternalLength = other.InternalLength; - InternalLengths[0] = other.InternalLengths[0]; - InternalLengths[1] = other.InternalLengths[1]; - InternalLengths[2] = other.InternalLengths[2]; - other.Handle = 0; - other.InternalLength = 0; - other.InternalLengths[0] = 0; - other.InternalLengths[1] = 0; - other.InternalLengths[2] = 0; - return *this; - } - - bool Array3::operator==(const Array3& other) const - { - return Handle == other.Handle; - } - - bool Array3::operator!=(const Array3& other) const - { - return Handle != other.Handle; - } - - Array3::Array3(System::Int32 length0, System::Int32 length1, System::Int32 length2) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - { - auto returnValue = Plugin::SystemSystemSingleArray3Constructor3(length0, length1, length2); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - InternalLength = length0 * length1 * length2; - InternalLengths[0] = length0; - InternalLengths[1] = length1; - InternalLengths[2] = length2; - } - } - - System::Int32 Array3::GetLength() - { - int32_t returnVal = InternalLength; - if (returnVal == 0) - { - returnVal = Array::GetLength(); - InternalLength = returnVal; - }; - return returnVal; - } - - System::Int32 Array3::GetLength(System::Int32 dimension) - { - assert(dimension >= 0 && dimension < 3); - int32_t length = InternalLengths[dimension]; - if (length) - { - return length; - } - auto returnValue = Plugin::SystemSystemSingleArray3GetLength3(Handle, dimension); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - InternalLengths[dimension] = returnValue; - return returnValue; - } - - System::Int32 Array3::GetRank() - { - return 3; - } - - Plugin::ArrayElementProxy1_3 System::Array3::operator[](int32_t index) - { - return Plugin::ArrayElementProxy1_3(Plugin::InternalUse::Only, Handle, index); - } -} - -namespace Plugin -{ - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0) - { - Handle = handle; - Index0 = index0; - } - - void ArrayElementProxy1_1::operator=(System::String item) - { - Plugin::SystemStringArray1SetItem1(Handle, Index0, item.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - ArrayElementProxy1_1::operator System::String() - { - auto returnValue = Plugin::SystemStringArray1GetItem1(Handle, Index0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); - } -} - -namespace System -{ - Array1::Array1(decltype(nullptr)) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - this->InternalLength = 0; - } - - Array1::Array1(Plugin::InternalUse, int32_t handle) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - this->InternalLength = 0; - } - - Array1::Array1(const Array1& other) - : Array1(Plugin::InternalUse::Only, other.Handle) - { - InternalLength = other.InternalLength; - } - - Array1::Array1(Array1&& other) - : Array1(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - InternalLength = other.InternalLength; - other.InternalLength = 0; - } - - Array1::~Array1() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Array1& Array1::operator=(const Array1& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - InternalLength = other.InternalLength; - return *this; - } - - Array1& Array1::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Array1& Array1::operator=(Array1&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - InternalLength = other.InternalLength; - other.Handle = 0; - other.InternalLength = 0; - return *this; - } - - bool Array1::operator==(const Array1& other) const - { - return Handle == other.Handle; - } - - bool Array1::operator!=(const Array1& other) const - { - return Handle != other.Handle; - } - - Array1::Array1(System::Int32 length0) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - auto returnValue = Plugin::SystemSystemStringArray1Constructor1(length0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - InternalLength = length0; - } - } - - System::Int32 Array1::GetLength() - { - int32_t returnVal = InternalLength; - if (returnVal == 0) - { - returnVal = Array::GetLength(); - InternalLength = returnVal; - }; - return returnVal; - } - - System::Int32 Array1::GetRank() - { - return 1; - } - - Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) - { - return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); - } -} - -namespace Plugin -{ - SystemStringArray1Iterator::SystemStringArray1Iterator(System::Array1& array, int32_t index) - : array(array) - , index(index) - { - } - - SystemStringArray1Iterator& SystemStringArray1Iterator::operator++() - { - index++; - return *this; - } - - bool SystemStringArray1Iterator::operator!=(const SystemStringArray1Iterator& other) - { - return index != other.index; - } - - System::String SystemStringArray1Iterator::operator*() - { - return array[index]; - } -} - -namespace System -{ - Plugin::SystemStringArray1Iterator begin(System::Array1& array) - { - return Plugin::SystemStringArray1Iterator(array, 0); - } - - Plugin::SystemStringArray1Iterator end(System::Array1& array) - { - return Plugin::SystemStringArray1Iterator(array, array.GetLength() - 1); - } -} - -namespace Plugin -{ - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0) - { - Handle = handle; - Index0 = index0; - } - - void ArrayElementProxy1_1::operator=(UnityEngine::Resolution item) - { - Plugin::UnityEngineResolutionArray1SetItem1(Handle, Index0, item.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - ArrayElementProxy1_1::operator UnityEngine::Resolution() - { - auto returnValue = Plugin::UnityEngineResolutionArray1GetItem1(Handle, Index0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::Resolution(Plugin::InternalUse::Only, returnValue); - } -} - -namespace System -{ - Array1::Array1(decltype(nullptr)) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - this->InternalLength = 0; - } - - Array1::Array1(Plugin::InternalUse, int32_t handle) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - this->InternalLength = 0; - } - - Array1::Array1(const Array1& other) - : Array1(Plugin::InternalUse::Only, other.Handle) - { - InternalLength = other.InternalLength; - } - - Array1::Array1(Array1&& other) - : Array1(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - InternalLength = other.InternalLength; - other.InternalLength = 0; - } - - Array1::~Array1() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Array1& Array1::operator=(const Array1& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - InternalLength = other.InternalLength; - return *this; - } - - Array1& Array1::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Array1& Array1::operator=(Array1&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - InternalLength = other.InternalLength; - other.Handle = 0; - other.InternalLength = 0; - return *this; - } - - bool Array1::operator==(const Array1& other) const - { - return Handle == other.Handle; - } - - bool Array1::operator!=(const Array1& other) const - { - return Handle != other.Handle; - } - - Array1::Array1(System::Int32 length0) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - auto returnValue = Plugin::UnityEngineUnityEngineResolutionArray1Constructor1(length0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - InternalLength = length0; - } - } - - System::Int32 Array1::GetLength() - { - int32_t returnVal = InternalLength; - if (returnVal == 0) - { - returnVal = Array::GetLength(); - InternalLength = returnVal; - }; - return returnVal; - } - - System::Int32 Array1::GetRank() - { - return 1; - } - - Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) - { - return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); - } -} - -namespace Plugin -{ - UnityEngineResolutionArray1Iterator::UnityEngineResolutionArray1Iterator(System::Array1& array, int32_t index) - : array(array) - , index(index) - { - } - - UnityEngineResolutionArray1Iterator& UnityEngineResolutionArray1Iterator::operator++() - { - index++; - return *this; - } - - bool UnityEngineResolutionArray1Iterator::operator!=(const UnityEngineResolutionArray1Iterator& other) - { - return index != other.index; - } - - UnityEngine::Resolution UnityEngineResolutionArray1Iterator::operator*() - { - return array[index]; - } -} - -namespace System -{ - Plugin::UnityEngineResolutionArray1Iterator begin(System::Array1& array) - { - return Plugin::UnityEngineResolutionArray1Iterator(array, 0); - } - - Plugin::UnityEngineResolutionArray1Iterator end(System::Array1& array) - { - return Plugin::UnityEngineResolutionArray1Iterator(array, array.GetLength() - 1); - } -} - -namespace Plugin -{ - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0) - { - Handle = handle; - Index0 = index0; - } - - void ArrayElementProxy1_1::operator=(UnityEngine::RaycastHit item) - { - Plugin::UnityEngineRaycastHitArray1SetItem1(Handle, Index0, item.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - ArrayElementProxy1_1::operator UnityEngine::RaycastHit() - { - auto returnValue = Plugin::UnityEngineRaycastHitArray1GetItem1(Handle, Index0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return UnityEngine::RaycastHit(Plugin::InternalUse::Only, returnValue); - } -} - -namespace System -{ - Array1::Array1(decltype(nullptr)) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - this->InternalLength = 0; - } - - Array1::Array1(Plugin::InternalUse, int32_t handle) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - this->InternalLength = 0; - } - - Array1::Array1(const Array1& other) - : Array1(Plugin::InternalUse::Only, other.Handle) - { - InternalLength = other.InternalLength; - } - - Array1::Array1(Array1&& other) - : Array1(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - InternalLength = other.InternalLength; - other.InternalLength = 0; - } - - Array1::~Array1() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Array1& Array1::operator=(const Array1& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - InternalLength = other.InternalLength; - return *this; - } - - Array1& Array1::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Array1& Array1::operator=(Array1&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - InternalLength = other.InternalLength; - other.Handle = 0; - other.InternalLength = 0; - return *this; - } - - bool Array1::operator==(const Array1& other) const - { - return Handle == other.Handle; - } - - bool Array1::operator!=(const Array1& other) const - { - return Handle != other.Handle; - } - - Array1::Array1(System::Int32 length0) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - auto returnValue = Plugin::UnityEngineUnityEngineRaycastHitArray1Constructor1(length0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - InternalLength = length0; - } - } - - System::Int32 Array1::GetLength() - { - int32_t returnVal = InternalLength; - if (returnVal == 0) - { - returnVal = Array::GetLength(); - InternalLength = returnVal; - }; - return returnVal; - } - - System::Int32 Array1::GetRank() - { - return 1; - } - - Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) - { - return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); - } -} - -namespace Plugin -{ - UnityEngineRaycastHitArray1Iterator::UnityEngineRaycastHitArray1Iterator(System::Array1& array, int32_t index) - : array(array) - , index(index) - { - } - - UnityEngineRaycastHitArray1Iterator& UnityEngineRaycastHitArray1Iterator::operator++() - { - index++; - return *this; - } - - bool UnityEngineRaycastHitArray1Iterator::operator!=(const UnityEngineRaycastHitArray1Iterator& other) - { - return index != other.index; - } - - UnityEngine::RaycastHit UnityEngineRaycastHitArray1Iterator::operator*() - { - return array[index]; - } -} - -namespace System -{ - Plugin::UnityEngineRaycastHitArray1Iterator begin(System::Array1& array) - { - return Plugin::UnityEngineRaycastHitArray1Iterator(array, 0); - } - - Plugin::UnityEngineRaycastHitArray1Iterator end(System::Array1& array) - { - return Plugin::UnityEngineRaycastHitArray1Iterator(array, array.GetLength() - 1); - } -} - -namespace Plugin -{ - ArrayElementProxy1_1::ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0) - { - Handle = handle; - Index0 = index0; - } - - void ArrayElementProxy1_1::operator=(UnityEngine::GradientColorKey item) - { - Plugin::UnityEngineGradientColorKeyArray1SetItem1(Handle, Index0, item); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - ArrayElementProxy1_1::operator UnityEngine::GradientColorKey() - { - auto returnValue = Plugin::UnityEngineGradientColorKeyArray1GetItem1(Handle, Index0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } -} - -namespace System -{ - Array1::Array1(decltype(nullptr)) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - this->InternalLength = 0; - } - - Array1::Array1(Plugin::InternalUse, int32_t handle) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - Handle = handle; - if (handle) - { - Plugin::ReferenceManagedClass(handle); - } - this->InternalLength = 0; - } - - Array1::Array1(const Array1& other) - : Array1(Plugin::InternalUse::Only, other.Handle) - { - InternalLength = other.InternalLength; - } - - Array1::Array1(Array1&& other) - : Array1(Plugin::InternalUse::Only, other.Handle) - { - other.Handle = 0; - InternalLength = other.InternalLength; - other.InternalLength = 0; - } - - Array1::~Array1() - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - } - - Array1& Array1::operator=(const Array1& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - InternalLength = other.InternalLength; - return *this; - } - - Array1& Array1::operator=(decltype(nullptr)) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - Handle = 0; - } - return *this; - } - - Array1& Array1::operator=(Array1&& other) - { - if (Handle) - { - Plugin::DereferenceManagedClass(Handle); - } - Handle = other.Handle; - InternalLength = other.InternalLength; - other.Handle = 0; - other.InternalLength = 0; - return *this; - } - - bool Array1::operator==(const Array1& other) const - { - return Handle == other.Handle; - } - - bool Array1::operator!=(const Array1& other) const - { - return Handle != other.Handle; - } - - Array1::Array1(System::Int32 length0) - : System::ICloneable(nullptr) - , System::Collections::IEnumerable(nullptr) - , System::Collections::ICollection(nullptr) - , System::Collections::IList(nullptr) - , System::Array(nullptr) - , System::Collections::Generic::IEnumerable(nullptr) - , System::Collections::Generic::ICollection(nullptr) - , System::Collections::Generic::IList(nullptr) - { - auto returnValue = Plugin::UnityEngineUnityEngineGradientColorKeyArray1Constructor1(length0); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - Handle = returnValue; - if (returnValue) - { - Plugin::ReferenceManagedClass(returnValue); - InternalLength = length0; - } - } - - System::Int32 Array1::GetLength() - { - int32_t returnVal = InternalLength; - if (returnVal == 0) - { - returnVal = Array::GetLength(); - InternalLength = returnVal; - }; - return returnVal; - } - - System::Int32 Array1::GetRank() - { - return 1; - } - - Plugin::ArrayElementProxy1_1 System::Array1::operator[](int32_t index) - { - return Plugin::ArrayElementProxy1_1(Plugin::InternalUse::Only, Handle, index); - } -} - -namespace Plugin -{ - UnityEngineGradientColorKeyArray1Iterator::UnityEngineGradientColorKeyArray1Iterator(System::Array1& array, int32_t index) - : array(array) - , index(index) - { - } - - UnityEngineGradientColorKeyArray1Iterator& UnityEngineGradientColorKeyArray1Iterator::operator++() - { - index++; - return *this; - } - - bool UnityEngineGradientColorKeyArray1Iterator::operator!=(const UnityEngineGradientColorKeyArray1Iterator& other) - { - return index != other.index; - } - - UnityEngine::GradientColorKey UnityEngineGradientColorKeyArray1Iterator::operator*() - { - return array[index]; - } -} - -namespace System -{ - Plugin::UnityEngineGradientColorKeyArray1Iterator begin(System::Array1& array) - { - return Plugin::UnityEngineGradientColorKeyArray1Iterator(array, 0); - } - - Plugin::UnityEngineGradientColorKeyArray1Iterator end(System::Array1& array) - { - return Plugin::UnityEngineGradientColorKeyArray1Iterator(array, array.GetLength() - 1); - } -} - -namespace System -{ - Action::Action() - { - CppHandle = Plugin::StoreSystemAction(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - System::Int32* classHandle = (System::Int32*)&ClassHandle; - Plugin::SystemActionConstructor(cppHandle, &handle->Value, &classHandle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemAction(CppHandle); - ClassHandle = 0; - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - Action::Action(decltype(nullptr)) - { - CppHandle = Plugin::StoreSystemAction(this); - ClassHandle = 0; - } - - Action::Action(const Action& other) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemAction(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = other.ClassHandle; - } - - Action::Action(Action&& other) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - Action::Action(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - CppHandle = Plugin::StoreSystemAction(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = 0; - } - - Action::~Action() - { - Plugin::RemoveSystemAction(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemAction(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - Action& Action::operator=(const Action& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - ClassHandle = other.ClassHandle; - return *this; - } - - Action& Action::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemAction(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = 0; - Handle = 0; - return *this; - } - - Action& Action::operator=(Action&& other) - { - Plugin::RemoveSystemAction(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemAction(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Action::operator==(const Action& other) const - { - return Handle == other.Handle; - } - - bool Action::operator!=(const Action& other) const - { - return Handle != other.Handle; - } - - void Action::operator+=(System::Action& del) - { - Plugin::SystemActionAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void Action::operator-=(System::Action& del) - { - Plugin::SystemActionRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void Action::operator()() - { - } - - DLLEXPORT void SystemActionNativeInvoke(int32_t cppHandle) - { - try - { - Plugin::GetSystemAction(cppHandle)->operator()(); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Action"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void Action::Invoke() - { - Plugin::SystemActionInvoke(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } -} - -namespace System -{ - Action1::Action1() - { - CppHandle = Plugin::StoreSystemActionSystemSingle(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - System::Int32* classHandle = (System::Int32*)&ClassHandle; - Plugin::SystemActionSystemSingleConstructor(cppHandle, &handle->Value, &classHandle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemActionSystemSingle(CppHandle); - ClassHandle = 0; - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - Action1::Action1(decltype(nullptr)) - { - CppHandle = Plugin::StoreSystemActionSystemSingle(this); - ClassHandle = 0; - } - - Action1::Action1(const Action1& other) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemActionSystemSingle(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = other.ClassHandle; - } - - Action1::Action1(Action1&& other) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - Action1::Action1(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - CppHandle = Plugin::StoreSystemActionSystemSingle(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = 0; - } - - Action1::~Action1() - { - Plugin::RemoveSystemActionSystemSingle(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemActionSystemSingle(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - Action1& Action1::operator=(const Action1& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - ClassHandle = other.ClassHandle; - return *this; - } - - Action1& Action1::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemActionSystemSingle(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = 0; - Handle = 0; - return *this; - } - - Action1& Action1::operator=(Action1&& other) - { - Plugin::RemoveSystemActionSystemSingle(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemActionSystemSingle(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Action1::operator==(const Action1& other) const - { - return Handle == other.Handle; - } - - bool Action1::operator!=(const Action1& other) const - { - return Handle != other.Handle; - } - - void Action1::operator+=(System::Action1& del) - { - Plugin::SystemActionSystemSingleAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void Action1::operator-=(System::Action1& del) - { - Plugin::SystemActionSystemSingleRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void Action1::operator()(System::Single obj) - { - } - - DLLEXPORT void SystemActionSystemSingleNativeInvoke(int32_t cppHandle, float obj) - { - try - { - Plugin::GetSystemActionSystemSingle(cppHandle)->operator()(obj); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Action1"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void Action1::Invoke(System::Single obj) - { - Plugin::SystemActionSystemSingleInvoke(Handle, obj); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } -} - -namespace System -{ - Action2::Action2() - { - CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - System::Int32* classHandle = (System::Int32*)&ClassHandle; - Plugin::SystemActionSystemSingle_SystemSingleConstructor(cppHandle, &handle->Value, &classHandle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); - ClassHandle = 0; - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - Action2::Action2(decltype(nullptr)) - { - CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); - ClassHandle = 0; - } - - Action2::Action2(const Action2& other) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = other.ClassHandle; - } - - Action2::Action2(Action2&& other) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - Action2::Action2(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - CppHandle = Plugin::StoreSystemActionSystemSingle_SystemSingle(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = 0; - } - - Action2::~Action2() - { - Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemActionSystemSingle_SystemSingle(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - Action2& Action2::operator=(const Action2& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - ClassHandle = other.ClassHandle; - return *this; - } - - Action2& Action2::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemActionSystemSingle_SystemSingle(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = 0; - Handle = 0; - return *this; - } - - Action2& Action2::operator=(Action2&& other) - { - Plugin::RemoveSystemActionSystemSingle_SystemSingle(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemActionSystemSingle_SystemSingle(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Action2::operator==(const Action2& other) const - { - return Handle == other.Handle; - } - - bool Action2::operator!=(const Action2& other) const - { - return Handle != other.Handle; - } - - void Action2::operator+=(System::Action2& del) - { - Plugin::SystemActionSystemSingle_SystemSingleAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void Action2::operator-=(System::Action2& del) - { - Plugin::SystemActionSystemSingle_SystemSingleRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void Action2::operator()(System::Single arg1, System::Single arg2) - { - } - - DLLEXPORT void SystemActionSystemSingle_SystemSingleNativeInvoke(int32_t cppHandle, float arg1, float arg2) - { - try - { - Plugin::GetSystemActionSystemSingle_SystemSingle(cppHandle)->operator()(arg1, arg2); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Action2"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void Action2::Invoke(System::Single arg1, System::Single arg2) - { - Plugin::SystemActionSystemSingle_SystemSingleInvoke(Handle, arg1, arg2); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } -} - -namespace System -{ - Func3::Func3() - { - CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - System::Int32* classHandle = (System::Int32*)&ClassHandle; - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor(cppHandle, &handle->Value, &classHandle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); - ClassHandle = 0; - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - Func3::Func3(decltype(nullptr)) - { - CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); - ClassHandle = 0; - } - - Func3::Func3(const Func3& other) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = other.ClassHandle; - } - - Func3::Func3(Func3&& other) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - Func3::Func3(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - CppHandle = Plugin::StoreSystemFuncSystemInt32_SystemSingle_SystemDouble(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = 0; - } - - Func3::~Func3() - { - Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - Func3& Func3::operator=(const Func3& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - ClassHandle = other.ClassHandle; - return *this; - } - - Func3& Func3::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = 0; - Handle = 0; - return *this; - } - - Func3& Func3::operator=(Func3&& other) - { - Plugin::RemoveSystemFuncSystemInt32_SystemSingle_SystemDouble(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Func3::operator==(const Func3& other) const - { - return Handle == other.Handle; - } - - bool Func3::operator!=(const Func3& other) const - { - return Handle != other.Handle; - } - - void Func3::operator+=(System::Func3& del) - { - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void Func3::operator-=(System::Func3& del) - { - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - System::Double Func3::operator()(System::Int32 arg1, System::Single arg2) - { - return {}; - } - - DLLEXPORT double SystemFuncSystemInt32_SystemSingle_SystemDoubleNativeInvoke(int32_t cppHandle, int32_t arg1, float arg2) - { - try - { - return Plugin::GetSystemFuncSystemInt32_SystemSingle_SystemDouble(cppHandle)->operator()(arg1, arg2); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Func3"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } - - System::Double Func3::Invoke(System::Int32 arg1, System::Single arg2) - { - auto returnValue = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke(Handle, arg1, arg2); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return returnValue; - } -} - -namespace System -{ - Func3::Func3() - { - CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - System::Int32* classHandle = (System::Int32*)&ClassHandle; - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor(cppHandle, &handle->Value, &classHandle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); - ClassHandle = 0; - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - Func3::Func3(decltype(nullptr)) - { - CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); - ClassHandle = 0; - } - - Func3::Func3(const Func3& other) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = other.ClassHandle; - } - - Func3::Func3(Func3&& other) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - Func3::Func3(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - CppHandle = Plugin::StoreSystemFuncSystemInt16_SystemInt32_SystemString(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = 0; - } - - Func3::~Func3() - { - Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - Func3& Func3::operator=(const Func3& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - ClassHandle = other.ClassHandle; - return *this; - } - - Func3& Func3::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = 0; - Handle = 0; - return *this; - } - - Func3& Func3::operator=(Func3&& other) - { - Plugin::RemoveSystemFuncSystemInt16_SystemInt32_SystemString(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool Func3::operator==(const Func3& other) const - { - return Handle == other.Handle; - } - - bool Func3::operator!=(const Func3& other) const - { - return Handle != other.Handle; - } - - void Func3::operator+=(System::Func3& del) - { - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void Func3::operator-=(System::Func3& del) - { - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - System::String Func3::operator()(System::Int16 arg1, System::Int32 arg2) - { - return nullptr; - } - - DLLEXPORT int32_t SystemFuncSystemInt16_SystemInt32_SystemStringNativeInvoke(int32_t cppHandle, int16_t arg1, int32_t arg2) - { - try - { - return Plugin::GetSystemFuncSystemInt16_SystemInt32_SystemString(cppHandle)->operator()(arg1, arg2).Handle; - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - return {}; - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::Func3"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - return {}; - } - } - - System::String Func3::Invoke(System::Int16 arg1, System::Int32 arg2) - { - auto returnValue = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke(Handle, arg1, arg2); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - return System::String(Plugin::InternalUse::Only, returnValue); - } -} - -namespace System -{ - AppDomainInitializer::AppDomainInitializer() - { - CppHandle = Plugin::StoreSystemAppDomainInitializer(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - System::Int32* classHandle = (System::Int32*)&ClassHandle; - Plugin::SystemAppDomainInitializerConstructor(cppHandle, &handle->Value, &classHandle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemAppDomainInitializer(CppHandle); - ClassHandle = 0; - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - AppDomainInitializer::AppDomainInitializer(decltype(nullptr)) - { - CppHandle = Plugin::StoreSystemAppDomainInitializer(this); - ClassHandle = 0; - } - - AppDomainInitializer::AppDomainInitializer(const AppDomainInitializer& other) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemAppDomainInitializer(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = other.ClassHandle; - } - - AppDomainInitializer::AppDomainInitializer(AppDomainInitializer&& other) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - AppDomainInitializer::AppDomainInitializer(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - CppHandle = Plugin::StoreSystemAppDomainInitializer(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = 0; - } - - AppDomainInitializer::~AppDomainInitializer() - { - Plugin::RemoveSystemAppDomainInitializer(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemAppDomainInitializer(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - AppDomainInitializer& AppDomainInitializer::operator=(const AppDomainInitializer& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - ClassHandle = other.ClassHandle; - return *this; - } - - AppDomainInitializer& AppDomainInitializer::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemAppDomainInitializer(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = 0; - Handle = 0; - return *this; - } - - AppDomainInitializer& AppDomainInitializer::operator=(AppDomainInitializer&& other) - { - Plugin::RemoveSystemAppDomainInitializer(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemAppDomainInitializer(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool AppDomainInitializer::operator==(const AppDomainInitializer& other) const - { - return Handle == other.Handle; - } - - bool AppDomainInitializer::operator!=(const AppDomainInitializer& other) const - { - return Handle != other.Handle; - } - - void AppDomainInitializer::operator+=(System::AppDomainInitializer& del) - { - Plugin::SystemAppDomainInitializerAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void AppDomainInitializer::operator-=(System::AppDomainInitializer& del) - { - Plugin::SystemAppDomainInitializerRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void AppDomainInitializer::operator()(System::Array1& args) - { - } - - DLLEXPORT void SystemAppDomainInitializerNativeInvoke(int32_t cppHandle, int32_t argsHandle) - { - try - { - auto args = System::Array1(Plugin::InternalUse::Only, argsHandle); - Plugin::GetSystemAppDomainInitializer(cppHandle)->operator()(args); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::AppDomainInitializer"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void AppDomainInitializer::Invoke(System::Array1& args) - { - Plugin::SystemAppDomainInitializerInvoke(Handle, args.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } -} - -namespace UnityEngine -{ - namespace Events - { - UnityAction::UnityAction() - { - CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - System::Int32* classHandle = (System::Int32*)&ClassHandle; - Plugin::UnityEngineEventsUnityActionConstructor(cppHandle, &handle->Value, &classHandle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveUnityEngineEventsUnityAction(CppHandle); - ClassHandle = 0; - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - UnityAction::UnityAction(decltype(nullptr)) - { - CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); - ClassHandle = 0; - } - - UnityAction::UnityAction(const UnityAction& other) - { - Handle = other.Handle; - CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = other.ClassHandle; - } - - UnityAction::UnityAction(UnityAction&& other) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - UnityAction::UnityAction(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - CppHandle = Plugin::StoreUnityEngineEventsUnityAction(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = 0; - } - - UnityAction::~UnityAction() - { - Plugin::RemoveUnityEngineEventsUnityAction(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseUnityEngineEventsUnityAction(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - UnityAction& UnityAction::operator=(const UnityAction& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - ClassHandle = other.ClassHandle; - return *this; - } - - UnityAction& UnityAction::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseUnityEngineEventsUnityAction(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = 0; - Handle = 0; - return *this; - } - - UnityAction& UnityAction::operator=(UnityAction&& other) - { - Plugin::RemoveUnityEngineEventsUnityAction(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseUnityEngineEventsUnityAction(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool UnityAction::operator==(const UnityAction& other) const - { - return Handle == other.Handle; - } - - bool UnityAction::operator!=(const UnityAction& other) const - { - return Handle != other.Handle; - } - - void UnityAction::operator+=(UnityEngine::Events::UnityAction& del) - { - Plugin::UnityEngineEventsUnityActionAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void UnityAction::operator-=(UnityEngine::Events::UnityAction& del) - { - Plugin::UnityEngineEventsUnityActionRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void UnityAction::operator()() - { - } - - DLLEXPORT void UnityEngineEventsUnityActionNativeInvoke(int32_t cppHandle) - { - try - { - Plugin::GetUnityEngineEventsUnityAction(cppHandle)->operator()(); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking UnityEngine::Events::UnityAction"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void UnityAction::Invoke() - { - Plugin::UnityEngineEventsUnityActionInvoke(Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } -} - -namespace UnityEngine -{ - namespace Events - { - UnityAction2::UnityAction2() - { - CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - System::Int32* classHandle = (System::Int32*)&ClassHandle; - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor(cppHandle, &handle->Value, &classHandle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(CppHandle); - ClassHandle = 0; - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - UnityAction2::UnityAction2(decltype(nullptr)) - { - CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); - ClassHandle = 0; - } - - UnityAction2::UnityAction2(const UnityAction2& other) - { - Handle = other.Handle; - CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = other.ClassHandle; - } - - UnityAction2::UnityAction2(UnityAction2&& other) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - UnityAction2::UnityAction2(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - CppHandle = Plugin::StoreUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = 0; - } - - UnityAction2::~UnityAction2() - { - Plugin::RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - UnityAction2& UnityAction2::operator=(const UnityAction2& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - ClassHandle = other.ClassHandle; - return *this; - } - - UnityAction2& UnityAction2::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = 0; - Handle = 0; - return *this; - } - - UnityAction2& UnityAction2::operator=(UnityAction2&& other) - { - Plugin::RemoveUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool UnityAction2::operator==(const UnityAction2& other) const - { - return Handle == other.Handle; - } - - bool UnityAction2::operator!=(const UnityAction2& other) const - { - return Handle != other.Handle; - } - - void UnityAction2::operator+=(UnityEngine::Events::UnityAction2& del) - { - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void UnityAction2::operator-=(UnityEngine::Events::UnityAction2& del) - { - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void UnityAction2::operator()(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) - { - } - - DLLEXPORT void UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeNativeInvoke(int32_t cppHandle, int32_t arg0Handle, UnityEngine::SceneManagement::LoadSceneMode arg1) - { - try - { - auto arg0 = UnityEngine::SceneManagement::Scene(Plugin::InternalUse::Only, arg0Handle); - Plugin::GetUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode(cppHandle)->operator()(arg0, arg1); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking UnityEngine::Events::UnityAction2"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void UnityAction2::Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1) - { - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke(Handle, arg0.Handle, arg1); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - ComponentEventHandler::ComponentEventHandler() - { - CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - System::Int32* classHandle = (System::Int32*)&ClassHandle; - Plugin::SystemComponentModelDesignComponentEventHandlerConstructor(cppHandle, &handle->Value, &classHandle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemComponentModelDesignComponentEventHandler(CppHandle); - ClassHandle = 0; - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - ComponentEventHandler::ComponentEventHandler(decltype(nullptr)) - { - CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); - ClassHandle = 0; - } - - ComponentEventHandler::ComponentEventHandler(const ComponentEventHandler& other) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = other.ClassHandle; - } - - ComponentEventHandler::ComponentEventHandler(ComponentEventHandler&& other) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - ComponentEventHandler::ComponentEventHandler(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - CppHandle = Plugin::StoreSystemComponentModelDesignComponentEventHandler(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = 0; - } - - ComponentEventHandler::~ComponentEventHandler() - { - Plugin::RemoveSystemComponentModelDesignComponentEventHandler(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignComponentEventHandler(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - ComponentEventHandler& ComponentEventHandler::operator=(const ComponentEventHandler& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - ClassHandle = other.ClassHandle; - return *this; - } - - ComponentEventHandler& ComponentEventHandler::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignComponentEventHandler(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = 0; - Handle = 0; - return *this; - } - - ComponentEventHandler& ComponentEventHandler::operator=(ComponentEventHandler&& other) - { - Plugin::RemoveSystemComponentModelDesignComponentEventHandler(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignComponentEventHandler(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ComponentEventHandler::operator==(const ComponentEventHandler& other) const - { - return Handle == other.Handle; - } - - bool ComponentEventHandler::operator!=(const ComponentEventHandler& other) const - { - return Handle != other.Handle; - } - - void ComponentEventHandler::operator+=(System::ComponentModel::Design::ComponentEventHandler& del) - { - Plugin::SystemComponentModelDesignComponentEventHandlerAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void ComponentEventHandler::operator-=(System::ComponentModel::Design::ComponentEventHandler& del) - { - Plugin::SystemComponentModelDesignComponentEventHandlerRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void ComponentEventHandler::operator()(System::Object& sender, System::ComponentModel::Design::ComponentEventArgs& e) - { - } - - DLLEXPORT void SystemComponentModelDesignComponentEventHandlerNativeInvoke(int32_t cppHandle, int32_t senderHandle, int32_t eHandle) - { - try - { - auto sender = System::Object(Plugin::InternalUse::Only, senderHandle); - auto e = System::ComponentModel::Design::ComponentEventArgs(Plugin::InternalUse::Only, eHandle); - Plugin::GetSystemComponentModelDesignComponentEventHandler(cppHandle)->operator()(sender, e); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::ComponentEventHandler"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void ComponentEventHandler::Invoke(System::Object& sender, System::ComponentModel::Design::ComponentEventArgs& e) - { - Plugin::SystemComponentModelDesignComponentEventHandlerInvoke(Handle, sender.Handle, e.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - ComponentChangingEventHandler::ComponentChangingEventHandler() - { - CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - System::Int32* classHandle = (System::Int32*)&ClassHandle; - Plugin::SystemComponentModelDesignComponentChangingEventHandlerConstructor(cppHandle, &handle->Value, &classHandle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemComponentModelDesignComponentChangingEventHandler(CppHandle); - ClassHandle = 0; - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - ComponentChangingEventHandler::ComponentChangingEventHandler(decltype(nullptr)) - { - CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); - ClassHandle = 0; - } - - ComponentChangingEventHandler::ComponentChangingEventHandler(const ComponentChangingEventHandler& other) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = other.ClassHandle; - } - - ComponentChangingEventHandler::ComponentChangingEventHandler(ComponentChangingEventHandler&& other) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - ComponentChangingEventHandler::ComponentChangingEventHandler(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangingEventHandler(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = 0; - } - - ComponentChangingEventHandler::~ComponentChangingEventHandler() - { - Plugin::RemoveSystemComponentModelDesignComponentChangingEventHandler(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignComponentChangingEventHandler(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - ComponentChangingEventHandler& ComponentChangingEventHandler::operator=(const ComponentChangingEventHandler& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - ClassHandle = other.ClassHandle; - return *this; - } - - ComponentChangingEventHandler& ComponentChangingEventHandler::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignComponentChangingEventHandler(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = 0; - Handle = 0; - return *this; - } - - ComponentChangingEventHandler& ComponentChangingEventHandler::operator=(ComponentChangingEventHandler&& other) - { - Plugin::RemoveSystemComponentModelDesignComponentChangingEventHandler(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignComponentChangingEventHandler(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ComponentChangingEventHandler::operator==(const ComponentChangingEventHandler& other) const - { - return Handle == other.Handle; - } - - bool ComponentChangingEventHandler::operator!=(const ComponentChangingEventHandler& other) const - { - return Handle != other.Handle; - } - - void ComponentChangingEventHandler::operator+=(System::ComponentModel::Design::ComponentChangingEventHandler& del) - { - Plugin::SystemComponentModelDesignComponentChangingEventHandlerAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void ComponentChangingEventHandler::operator-=(System::ComponentModel::Design::ComponentChangingEventHandler& del) - { - Plugin::SystemComponentModelDesignComponentChangingEventHandlerRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void ComponentChangingEventHandler::operator()(System::Object& sender, System::ComponentModel::Design::ComponentChangingEventArgs& e) - { - } - - DLLEXPORT void SystemComponentModelDesignComponentChangingEventHandlerNativeInvoke(int32_t cppHandle, int32_t senderHandle, int32_t eHandle) - { - try - { - auto sender = System::Object(Plugin::InternalUse::Only, senderHandle); - auto e = System::ComponentModel::Design::ComponentChangingEventArgs(Plugin::InternalUse::Only, eHandle); - Plugin::GetSystemComponentModelDesignComponentChangingEventHandler(cppHandle)->operator()(sender, e); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::ComponentChangingEventHandler"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void ComponentChangingEventHandler::Invoke(System::Object& sender, System::ComponentModel::Design::ComponentChangingEventArgs& e) - { - Plugin::SystemComponentModelDesignComponentChangingEventHandlerInvoke(Handle, sender.Handle, e.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - ComponentChangedEventHandler::ComponentChangedEventHandler() - { - CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - System::Int32* classHandle = (System::Int32*)&ClassHandle; - Plugin::SystemComponentModelDesignComponentChangedEventHandlerConstructor(cppHandle, &handle->Value, &classHandle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemComponentModelDesignComponentChangedEventHandler(CppHandle); - ClassHandle = 0; - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - ComponentChangedEventHandler::ComponentChangedEventHandler(decltype(nullptr)) - { - CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); - ClassHandle = 0; - } - - ComponentChangedEventHandler::ComponentChangedEventHandler(const ComponentChangedEventHandler& other) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = other.ClassHandle; - } - - ComponentChangedEventHandler::ComponentChangedEventHandler(ComponentChangedEventHandler&& other) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - ComponentChangedEventHandler::ComponentChangedEventHandler(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - CppHandle = Plugin::StoreSystemComponentModelDesignComponentChangedEventHandler(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = 0; - } - - ComponentChangedEventHandler::~ComponentChangedEventHandler() - { - Plugin::RemoveSystemComponentModelDesignComponentChangedEventHandler(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignComponentChangedEventHandler(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - ComponentChangedEventHandler& ComponentChangedEventHandler::operator=(const ComponentChangedEventHandler& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - ClassHandle = other.ClassHandle; - return *this; - } - - ComponentChangedEventHandler& ComponentChangedEventHandler::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignComponentChangedEventHandler(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = 0; - Handle = 0; - return *this; - } - - ComponentChangedEventHandler& ComponentChangedEventHandler::operator=(ComponentChangedEventHandler&& other) - { - Plugin::RemoveSystemComponentModelDesignComponentChangedEventHandler(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignComponentChangedEventHandler(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ComponentChangedEventHandler::operator==(const ComponentChangedEventHandler& other) const - { - return Handle == other.Handle; - } - - bool ComponentChangedEventHandler::operator!=(const ComponentChangedEventHandler& other) const - { - return Handle != other.Handle; - } - - void ComponentChangedEventHandler::operator+=(System::ComponentModel::Design::ComponentChangedEventHandler& del) - { - Plugin::SystemComponentModelDesignComponentChangedEventHandlerAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void ComponentChangedEventHandler::operator-=(System::ComponentModel::Design::ComponentChangedEventHandler& del) - { - Plugin::SystemComponentModelDesignComponentChangedEventHandlerRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void ComponentChangedEventHandler::operator()(System::Object& sender, System::ComponentModel::Design::ComponentChangedEventArgs& e) - { - } - - DLLEXPORT void SystemComponentModelDesignComponentChangedEventHandlerNativeInvoke(int32_t cppHandle, int32_t senderHandle, int32_t eHandle) - { - try - { - auto sender = System::Object(Plugin::InternalUse::Only, senderHandle); - auto e = System::ComponentModel::Design::ComponentChangedEventArgs(Plugin::InternalUse::Only, eHandle); - Plugin::GetSystemComponentModelDesignComponentChangedEventHandler(cppHandle)->operator()(sender, e); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::ComponentChangedEventHandler"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void ComponentChangedEventHandler::Invoke(System::Object& sender, System::ComponentModel::Design::ComponentChangedEventArgs& e) - { - Plugin::SystemComponentModelDesignComponentChangedEventHandlerInvoke(Handle, sender.Handle, e.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - ComponentRenameEventHandler::ComponentRenameEventHandler() - { - CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); - System::Int32* handle = (System::Int32*)&Handle; - int32_t cppHandle = CppHandle; - System::Int32* classHandle = (System::Int32*)&ClassHandle; - Plugin::SystemComponentModelDesignComponentRenameEventHandlerConstructor(cppHandle, &handle->Value, &classHandle->Value); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - else - { - Plugin::RemoveSystemComponentModelDesignComponentRenameEventHandler(CppHandle); - ClassHandle = 0; - CppHandle = 0; - } - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - ComponentRenameEventHandler::ComponentRenameEventHandler(decltype(nullptr)) - { - CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); - ClassHandle = 0; - } - - ComponentRenameEventHandler::ComponentRenameEventHandler(const ComponentRenameEventHandler& other) - { - Handle = other.Handle; - CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = other.ClassHandle; - } - - ComponentRenameEventHandler::ComponentRenameEventHandler(ComponentRenameEventHandler&& other) - { - Handle = other.Handle; - CppHandle = other.CppHandle; - ClassHandle = other.ClassHandle; - other.Handle = 0; - other.CppHandle = 0; - other.ClassHandle = 0; - } - - ComponentRenameEventHandler::ComponentRenameEventHandler(Plugin::InternalUse, int32_t handle) - { - Handle = handle; - CppHandle = Plugin::StoreSystemComponentModelDesignComponentRenameEventHandler(this); - if (Handle) - { - Plugin::ReferenceManagedClass(Handle); - } - ClassHandle = 0; - } - - ComponentRenameEventHandler::~ComponentRenameEventHandler() - { - Plugin::RemoveSystemComponentModelDesignComponentRenameEventHandler(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignComponentRenameEventHandler(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - } - - ComponentRenameEventHandler& ComponentRenameEventHandler::operator=(const ComponentRenameEventHandler& other) - { - if (this->Handle) - { - Plugin::DereferenceManagedClass(this->Handle); - } - this->Handle = other.Handle; - if (this->Handle) - { - Plugin::ReferenceManagedClass(this->Handle); - } - ClassHandle = other.ClassHandle; - return *this; - } - - ComponentRenameEventHandler& ComponentRenameEventHandler::operator=(decltype(nullptr)) - { - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignComponentRenameEventHandler(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = 0; - Handle = 0; - return *this; - } - - ComponentRenameEventHandler& ComponentRenameEventHandler::operator=(ComponentRenameEventHandler&& other) - { - Plugin::RemoveSystemComponentModelDesignComponentRenameEventHandler(CppHandle); - CppHandle = 0; - if (Handle) - { - int32_t handle = Handle; - int32_t classHandle = ClassHandle; - Handle = 0; - ClassHandle = 0; - if (Plugin::DereferenceManagedClassNoRelease(handle)) - { - Plugin::ReleaseSystemComponentModelDesignComponentRenameEventHandler(handle, classHandle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - } - ClassHandle = other.ClassHandle; - other.ClassHandle = 0; - Handle = other.Handle; - other.Handle = 0; - return *this; - } - - bool ComponentRenameEventHandler::operator==(const ComponentRenameEventHandler& other) const - { - return Handle == other.Handle; - } - - bool ComponentRenameEventHandler::operator!=(const ComponentRenameEventHandler& other) const - { - return Handle != other.Handle; - } - - void ComponentRenameEventHandler::operator+=(System::ComponentModel::Design::ComponentRenameEventHandler& del) - { - Plugin::SystemComponentModelDesignComponentRenameEventHandlerAdd(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void ComponentRenameEventHandler::operator-=(System::ComponentModel::Design::ComponentRenameEventHandler& del) - { - Plugin::SystemComponentModelDesignComponentRenameEventHandlerRemove(Handle, del.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } - - void ComponentRenameEventHandler::operator()(System::Object& sender, System::ComponentModel::Design::ComponentRenameEventArgs& e) - { - } - - DLLEXPORT void SystemComponentModelDesignComponentRenameEventHandlerNativeInvoke(int32_t cppHandle, int32_t senderHandle, int32_t eHandle) - { - try - { - auto sender = System::Object(Plugin::InternalUse::Only, senderHandle); - auto e = System::ComponentModel::Design::ComponentRenameEventArgs(Plugin::InternalUse::Only, eHandle); - Plugin::GetSystemComponentModelDesignComponentRenameEventHandler(cppHandle)->operator()(sender, e); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception invoking System::ComponentModel::Design::ComponentRenameEventHandler"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } - } - - void ComponentRenameEventHandler::Invoke(System::Object& sender, System::ComponentModel::Design::ComponentRenameEventArgs& e) - { - Plugin::SystemComponentModelDesignComponentRenameEventHandlerInvoke(Handle, sender.Handle, e.Handle); - if (Plugin::unhandledCsharpException) - { - System::Exception* ex = Plugin::unhandledCsharpException; - Plugin::unhandledCsharpException = nullptr; - ex->ThrowReferenceToThis(); - delete ex; - } - } + return returnVal; + } +} + +namespace System +{ + Object::operator System::Int32() + { + System::Int32 returnVal(Plugin::UnboxInt32(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::operator System::UInt32() + { + System::UInt32 returnVal(Plugin::UnboxUInt32(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::operator System::Int64() + { + System::Int64 returnVal(Plugin::UnboxInt64(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::operator System::UInt64() + { + System::UInt64 returnVal(Plugin::UnboxUInt64(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::operator System::Char() + { + System::Char returnVal(Plugin::UnboxChar(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::operator System::Single() + { + System::Single returnVal(Plugin::UnboxSingle(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + +namespace System +{ + Object::operator System::Double() + { + System::Double returnVal(Plugin::UnboxDouble(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; } + return returnVal; } } @@ -21396,171 +3431,27 @@ DLLEXPORT void Init( int32_t (*enumerableGetEnumerator)(int32_t handle), /*BEGIN INIT PARAMS*/ int32_t maxManagedObjects, - System::Int32 (*systemIComparableMethodCompareToSystemObject)(int32_t thisHandle, int32_t objHandle), - void (*systemIDisposableMethodDispose)(int32_t thisHandle), UnityEngine::Vector3 (*unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z), - System::Single (*unityEngineVector3PropertyGetMagnitude)(UnityEngine::Vector3* thiz), - void (*unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle)(UnityEngine::Vector3* thiz, float newX, float newY, float newZ), UnityEngine::Vector3 (*unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b), - UnityEngine::Vector3 (*unityEngineVector3Methodop_UnaryNegationUnityEngineVector3)(UnityEngine::Vector3& a), int32_t (*boxVector3)(UnityEngine::Vector3& val), UnityEngine::Vector3 (*unboxVector3)(int32_t valHandle), int32_t (*unityEngineObjectPropertyGetName)(int32_t thisHandle), void (*unityEngineObjectPropertySetName)(int32_t thisHandle, int32_t valueHandle), - int32_t (*unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject)(int32_t xHandle, int32_t yHandle), - int32_t (*unityEngineObjectMethodop_ImplicitUnityEngineObject)(int32_t existsHandle), int32_t (*unityEngineComponentPropertyGetTransform)(int32_t thisHandle), UnityEngine::Vector3 (*unityEngineTransformPropertyGetPosition)(int32_t thisHandle), void (*unityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value), - void (*unityEngineTransformMethodSetParentUnityEngineTransform)(int32_t thisHandle, int32_t parentHandle), - int32_t (*boxColor)(UnityEngine::Color& val), - UnityEngine::Color (*unboxColor)(int32_t valHandle), - int32_t (*boxGradientColorKey)(UnityEngine::GradientColorKey& val), - UnityEngine::GradientColorKey (*unboxGradientColorKey)(int32_t valHandle), - void (*releaseUnityEngineResolution)(int32_t handle), - int32_t (*unityEngineResolutionConstructor)(), - System::Int32 (*unityEngineResolutionPropertyGetWidth)(int32_t thisHandle), - void (*unityEngineResolutionPropertySetWidth)(int32_t thisHandle, int32_t value), - System::Int32 (*unityEngineResolutionPropertyGetHeight)(int32_t thisHandle), - void (*unityEngineResolutionPropertySetHeight)(int32_t thisHandle, int32_t value), - System::Int32 (*unityEngineResolutionPropertyGetRefreshRate)(int32_t thisHandle), - void (*unityEngineResolutionPropertySetRefreshRate)(int32_t thisHandle, int32_t value), - int32_t (*boxResolution)(int32_t valHandle), - int32_t (*unboxResolution)(int32_t valHandle), - void (*releaseUnityEngineRaycastHit)(int32_t handle), - UnityEngine::Vector3 (*unityEngineRaycastHitPropertyGetPoint)(int32_t thisHandle), - void (*unityEngineRaycastHitPropertySetPoint)(int32_t thisHandle, UnityEngine::Vector3& value), - int32_t (*unityEngineRaycastHitPropertyGetTransform)(int32_t thisHandle), - int32_t (*boxRaycastHit)(int32_t valHandle), - int32_t (*unboxRaycastHit)(int32_t valHandle), int32_t (*systemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle), int32_t (*systemCollectionsIEnumeratorMethodMoveNext)(int32_t thisHandle), - void (*releaseUnityEnginePlayablesPlayableGraph)(int32_t handle), - int32_t (*boxPlayableGraph)(int32_t valHandle), - int32_t (*unboxPlayableGraph)(int32_t valHandle), - void (*releaseUnityEngineAnimationsAnimationMixerPlayable)(int32_t handle), - int32_t (*unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean)(int32_t graphHandle, int32_t inputCount, uint32_t normalizeWeights), - int32_t (*boxAnimationMixerPlayable)(int32_t valHandle), - int32_t (*unboxAnimationMixerPlayable)(int32_t valHandle), - int32_t (*systemDiagnosticsStopwatchConstructor)(), - System::Int64 (*systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds)(int32_t thisHandle), - void (*systemDiagnosticsStopwatchMethodStart)(int32_t thisHandle), - void (*systemDiagnosticsStopwatchMethodReset)(int32_t thisHandle), - int32_t (*unityEngineGameObjectConstructor)(), - int32_t (*unityEngineGameObjectConstructorSystemString)(int32_t nameHandle), - int32_t (*unityEngineGameObjectPropertyGetTransform)(int32_t thisHandle), - int32_t (*unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript)(int32_t thisHandle), - int32_t (*unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript)(int32_t thisHandle), + int32_t (*unityEngineGameObjectMethodAddComponentMyGameBaseBallScript)(int32_t thisHandle), int32_t (*unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)(UnityEngine::PrimitiveType type), void (*unityEngineDebugMethodLogSystemObject)(int32_t messageHandle), - int32_t (*unityEngineAssertionsAssertFieldGetRaiseExceptions)(), - void (*unityEngineAssertionsAssertFieldSetRaiseExceptions)(uint32_t value), - void (*unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString)(int32_t expectedHandle, int32_t actualHandle), - void (*unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject)(int32_t expectedHandle, int32_t actualHandle), int32_t (*unityEngineMonoBehaviourPropertyGetTransform)(int32_t thisHandle), - void (*unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32)(int32_t* bufferLength, int32_t* numBuffers), - void (*unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte)(int32_t hostId, int32_t* addressHandle, int32_t* port, uint8_t* error), - void (*unityEngineNetworkingNetworkTransportMethodInit)(), - int32_t (*boxQuaternion)(UnityEngine::Quaternion& val), - UnityEngine::Quaternion (*unboxQuaternion)(int32_t valHandle), - System::Single (*unityEngineMatrix4x4PropertyGetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column), - void (*unityEngineMatrix4x4PropertySetItem)(UnityEngine::Matrix4x4* thiz, int32_t row, int32_t column, float value), - int32_t (*boxMatrix4x4)(UnityEngine::Matrix4x4& val), - UnityEngine::Matrix4x4 (*unboxMatrix4x4)(int32_t valHandle), - int32_t (*boxQueryTriggerInteraction)(UnityEngine::QueryTriggerInteraction val), - UnityEngine::QueryTriggerInteraction (*unboxQueryTriggerInteraction)(int32_t valHandle), - void (*releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble)(int32_t handle), - int32_t (*systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble)(int32_t keyHandle, double value), - int32_t (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey)(int32_t thisHandle), - System::Double (*systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue)(int32_t thisHandle), - int32_t (*boxKeyValuePairSystemString_SystemDouble)(int32_t valHandle), - int32_t (*unboxKeyValuePairSystemString_SystemDouble)(int32_t valHandle), - int32_t (*systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString)(int32_t valueHandle), - int32_t (*systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue)(int32_t thisHandle), - void (*systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue)(int32_t thisHandle, int32_t valueHandle), - int32_t (*systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString)(int32_t valueHandle), - int32_t (*systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue)(int32_t thisHandle), - void (*systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue)(int32_t thisHandle, int32_t valueHandle), int32_t (*systemExceptionConstructorSystemString)(int32_t messageHandle), - int32_t (*unityEngineScreenPropertyGetResolutions)(), - void (*releaseUnityEngineRay)(int32_t handle), - int32_t (*unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction), - int32_t (*boxRay)(int32_t valHandle), - int32_t (*unboxRay)(int32_t valHandle), - System::Int32 (*unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1)(int32_t rayHandle, int32_t resultsHandle), - int32_t (*unityEnginePhysicsMethodRaycastAllUnityEngineRay)(int32_t rayHandle), - int32_t (*unityEngineGradientConstructor)(), - int32_t (*unityEngineGradientPropertyGetColorKeys)(int32_t thisHandle), - void (*unityEngineGradientPropertySetColorKeys)(int32_t thisHandle, int32_t valueHandle), - int32_t (*systemAppDomainSetupConstructor)(), - int32_t (*systemAppDomainSetupPropertyGetAppDomainInitializer)(int32_t thisHandle), - void (*systemAppDomainSetupPropertySetAppDomainInitializer)(int32_t thisHandle, int32_t valueHandle), - void (*unityEngineApplicationAddEventOnBeforeRender)(int32_t delHandle), - void (*unityEngineApplicationRemoveEventOnBeforeRender)(int32_t delHandle), - void (*unityEngineSceneManagementSceneManagerAddEventSceneLoaded)(int32_t delHandle), - void (*unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded)(int32_t delHandle), - void (*releaseUnityEngineSceneManagementScene)(int32_t handle), - int32_t (*boxScene)(int32_t valHandle), - int32_t (*unboxScene)(int32_t valHandle), - int32_t (*boxLoadSceneMode)(UnityEngine::SceneManagement::LoadSceneMode val), - UnityEngine::SceneManagement::LoadSceneMode (*unboxLoadSceneMode)(int32_t valHandle), int32_t (*boxPrimitiveType)(UnityEngine::PrimitiveType val), UnityEngine::PrimitiveType (*unboxPrimitiveType)(int32_t valHandle), System::Single (*unityEngineTimePropertyGetDeltaTime)(), - int32_t (*boxFileMode)(System::IO::FileMode val), - System::IO::FileMode (*unboxFileMode)(int32_t valHandle), - void (*releaseSystemCollectionsGenericBaseIComparerSystemInt32)(int32_t handle), - void (*systemCollectionsGenericBaseIComparerSystemInt32Constructor)(int32_t cppHandle, int32_t* handle), - void (*releaseSystemCollectionsGenericBaseIComparerSystemString)(int32_t handle), - void (*systemCollectionsGenericBaseIComparerSystemStringConstructor)(int32_t cppHandle, int32_t* handle), - void (*releaseSystemBaseStringComparer)(int32_t handle), - void (*systemBaseStringComparerConstructor)(int32_t cppHandle, int32_t* handle), - System::Int32 (*systemCollectionsQueuePropertyGetCount)(int32_t thisHandle), - void (*releaseSystemCollectionsBaseQueue)(int32_t handle), - void (*systemCollectionsBaseQueueConstructor)(int32_t cppHandle, int32_t* handle), - void (*releaseSystemComponentModelDesignBaseIComponentChangeService)(int32_t handle), - void (*systemComponentModelDesignBaseIComponentChangeServiceConstructor)(int32_t cppHandle, int32_t* handle), - int32_t (*systemIOFileStreamConstructorSystemString_SystemIOFileMode)(int32_t pathHandle, System::IO::FileMode mode), - void (*systemIOFileStreamMethodWriteByteSystemByte)(int32_t thisHandle, uint8_t value), - void (*releaseSystemIOBaseFileStream)(int32_t handle), - void (*systemIOBaseFileStreamConstructorSystemString_SystemIOFileMode)(int32_t cppHandle, int32_t* handle, int32_t pathHandle, System::IO::FileMode mode), - void (*releaseUnityEnginePlayablesPlayableHandle)(int32_t handle), - int32_t (*boxPlayableHandle)(int32_t valHandle), - int32_t (*unboxPlayableHandle)(int32_t valHandle), - int32_t (*systemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator)(int32_t thisHandle), - int32_t (*unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1)(int32_t eHandle, int32_t nameHandle, int32_t classesHandle), - int32_t (*unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString)(int32_t eHandle, int32_t nameHandle, int32_t classNameHandle), - int32_t (*boxInteractionSourcePositionAccuracy)(UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy val), - UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy (*unboxInteractionSourcePositionAccuracy)(int32_t valHandle), - int32_t (*boxInteractionSourceNode)(UnityEngine::XR::WSA::Input::InteractionSourceNode val), - UnityEngine::XR::WSA::Input::InteractionSourceNode (*unboxInteractionSourceNode)(int32_t valHandle), - void (*releaseUnityEngineXRWSAInputInteractionSourcePose)(int32_t handle), - int32_t (*unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode)(int32_t thisHandle, UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node), - int32_t (*boxInteractionSourcePose)(int32_t valHandle), - int32_t (*unboxInteractionSourcePose)(int32_t valHandle), - int32_t (*systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent)(int32_t thisHandle), - System::Int32 (*systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent)(int32_t thisHandle), - System::Single (*systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent)(int32_t thisHandle), - UnityEngine::GradientColorKey (*systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator)(int32_t thisHandle), - int32_t (*systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator)(int32_t thisHandle), - int32_t (*systemCollectionsGenericListSystemStringConstructor)(), - int32_t (*systemCollectionsGenericListSystemStringPropertyGetItem)(int32_t thisHandle, int32_t index), - void (*systemCollectionsGenericListSystemStringPropertySetItem)(int32_t thisHandle, int32_t index, int32_t valueHandle), - void (*systemCollectionsGenericListSystemStringMethodAddSystemString)(int32_t thisHandle, int32_t itemHandle), - void (*systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle), - int32_t (*systemCollectionsGenericListSystemInt32Constructor)(), - System::Int32 (*systemCollectionsGenericListSystemInt32PropertyGetItem)(int32_t thisHandle, int32_t index), - void (*systemCollectionsGenericListSystemInt32PropertySetItem)(int32_t thisHandle, int32_t index, int32_t value), - void (*systemCollectionsGenericListSystemInt32MethodAddSystemInt32)(int32_t thisHandle, int32_t item), - void (*systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer)(int32_t thisHandle, int32_t comparerHandle), + void (*releaseBaseBallScript)(int32_t handle), + void (*baseBallScriptConstructor)(int32_t cppHandle, int32_t* handle), int32_t (*boxBoolean)(uint32_t val), int32_t (*unboxBoolean)(int32_t valHandle), int32_t (*boxSByte)(int8_t val), @@ -21584,93 +3475,7 @@ DLLEXPORT void Init( int32_t (*boxSingle)(float val), System::Single (*unboxSingle)(int32_t valHandle), int32_t (*boxDouble)(double val), - System::Double (*unboxDouble)(int32_t valHandle), - int32_t (*systemSystemInt32Array1Constructor1)(int32_t length0), - System::Int32 (*systemInt32Array1GetItem1)(int32_t thisHandle, int32_t index0), - int32_t (*systemInt32Array1SetItem1)(int32_t thisHandle, int32_t index0, int32_t item), - int32_t (*systemSystemSingleArray1Constructor1)(int32_t length0), - System::Single (*systemSingleArray1GetItem1)(int32_t thisHandle, int32_t index0), - int32_t (*systemSingleArray1SetItem1)(int32_t thisHandle, int32_t index0, float item), - int32_t (*systemSystemSingleArray2Constructor2)(int32_t length0, int32_t length1), - int32_t (*systemSystemSingleArray2GetLength2)(int32_t thisHandle, int32_t dimension), - System::Single (*systemSingleArray2GetItem2)(int32_t thisHandle, int32_t index0, int32_t index1), - int32_t (*systemSingleArray2SetItem2)(int32_t thisHandle, int32_t index0, int32_t index1, float item), - int32_t (*systemSystemSingleArray3Constructor3)(int32_t length0, int32_t length1, int32_t length2), - int32_t (*systemSystemSingleArray3GetLength3)(int32_t thisHandle, int32_t dimension), - System::Single (*systemSingleArray3GetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2), - int32_t (*systemSingleArray3SetItem3)(int32_t thisHandle, int32_t index0, int32_t index1, int32_t index2, float item), - int32_t (*systemSystemStringArray1Constructor1)(int32_t length0), - int32_t (*systemStringArray1GetItem1)(int32_t thisHandle, int32_t index0), - int32_t (*systemStringArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), - int32_t (*unityEngineUnityEngineResolutionArray1Constructor1)(int32_t length0), - int32_t (*unityEngineResolutionArray1GetItem1)(int32_t thisHandle, int32_t index0), - int32_t (*unityEngineResolutionArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), - int32_t (*unityEngineUnityEngineRaycastHitArray1Constructor1)(int32_t length0), - int32_t (*unityEngineRaycastHitArray1GetItem1)(int32_t thisHandle, int32_t index0), - int32_t (*unityEngineRaycastHitArray1SetItem1)(int32_t thisHandle, int32_t index0, int32_t itemHandle), - int32_t (*unityEngineUnityEngineGradientColorKeyArray1Constructor1)(int32_t length0), - UnityEngine::GradientColorKey (*unityEngineGradientColorKeyArray1GetItem1)(int32_t thisHandle, int32_t index0), - int32_t (*unityEngineGradientColorKeyArray1SetItem1)(int32_t thisHandle, int32_t index0, UnityEngine::GradientColorKey& item), - void (*releaseSystemAction)(int32_t handle, int32_t classHandle), - void (*systemActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*systemActionAdd)(int32_t thisHandle, int32_t delHandle), - void (*systemActionRemove)(int32_t thisHandle, int32_t delHandle), - void (*systemActionInvoke)(int32_t thisHandle), - void (*releaseSystemActionSystemSingle)(int32_t handle, int32_t classHandle), - void (*systemActionSystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*systemActionSystemSingleAdd)(int32_t thisHandle, int32_t delHandle), - void (*systemActionSystemSingleRemove)(int32_t thisHandle, int32_t delHandle), - void (*systemActionSystemSingleInvoke)(int32_t thisHandle, float obj), - void (*releaseSystemActionSystemSingle_SystemSingle)(int32_t handle, int32_t classHandle), - void (*systemActionSystemSingle_SystemSingleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*systemActionSystemSingle_SystemSingleAdd)(int32_t thisHandle, int32_t delHandle), - void (*systemActionSystemSingle_SystemSingleRemove)(int32_t thisHandle, int32_t delHandle), - void (*systemActionSystemSingle_SystemSingleInvoke)(int32_t thisHandle, float arg1, float arg2), - void (*releaseSystemFuncSystemInt32_SystemSingle_SystemDouble)(int32_t handle, int32_t classHandle), - void (*systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*systemFuncSystemInt32_SystemSingle_SystemDoubleAdd)(int32_t thisHandle, int32_t delHandle), - void (*systemFuncSystemInt32_SystemSingle_SystemDoubleRemove)(int32_t thisHandle, int32_t delHandle), - System::Double (*systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke)(int32_t thisHandle, int32_t arg1, float arg2), - void (*releaseSystemFuncSystemInt16_SystemInt32_SystemString)(int32_t handle, int32_t classHandle), - void (*systemFuncSystemInt16_SystemInt32_SystemStringConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*systemFuncSystemInt16_SystemInt32_SystemStringAdd)(int32_t thisHandle, int32_t delHandle), - void (*systemFuncSystemInt16_SystemInt32_SystemStringRemove)(int32_t thisHandle, int32_t delHandle), - int32_t (*systemFuncSystemInt16_SystemInt32_SystemStringInvoke)(int32_t thisHandle, int16_t arg1, int32_t arg2), - void (*releaseSystemAppDomainInitializer)(int32_t handle, int32_t classHandle), - void (*systemAppDomainInitializerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*systemAppDomainInitializerAdd)(int32_t thisHandle, int32_t delHandle), - void (*systemAppDomainInitializerRemove)(int32_t thisHandle, int32_t delHandle), - void (*systemAppDomainInitializerInvoke)(int32_t thisHandle, int32_t argsHandle), - void (*releaseUnityEngineEventsUnityAction)(int32_t handle, int32_t classHandle), - void (*unityEngineEventsUnityActionConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*unityEngineEventsUnityActionAdd)(int32_t thisHandle, int32_t delHandle), - void (*unityEngineEventsUnityActionRemove)(int32_t thisHandle, int32_t delHandle), - void (*unityEngineEventsUnityActionInvoke)(int32_t thisHandle), - void (*releaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode)(int32_t handle, int32_t classHandle), - void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd)(int32_t thisHandle, int32_t delHandle), - void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove)(int32_t thisHandle, int32_t delHandle), - void (*unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke)(int32_t thisHandle, int32_t arg0Handle, UnityEngine::SceneManagement::LoadSceneMode arg1), - void (*releaseSystemComponentModelDesignComponentEventHandler)(int32_t handle, int32_t classHandle), - void (*systemComponentModelDesignComponentEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*systemComponentModelDesignComponentEventHandlerAdd)(int32_t thisHandle, int32_t delHandle), - void (*systemComponentModelDesignComponentEventHandlerRemove)(int32_t thisHandle, int32_t delHandle), - void (*systemComponentModelDesignComponentEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle), - void (*releaseSystemComponentModelDesignComponentChangingEventHandler)(int32_t handle, int32_t classHandle), - void (*systemComponentModelDesignComponentChangingEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*systemComponentModelDesignComponentChangingEventHandlerAdd)(int32_t thisHandle, int32_t delHandle), - void (*systemComponentModelDesignComponentChangingEventHandlerRemove)(int32_t thisHandle, int32_t delHandle), - void (*systemComponentModelDesignComponentChangingEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle), - void (*releaseSystemComponentModelDesignComponentChangedEventHandler)(int32_t handle, int32_t classHandle), - void (*systemComponentModelDesignComponentChangedEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*systemComponentModelDesignComponentChangedEventHandlerAdd)(int32_t thisHandle, int32_t delHandle), - void (*systemComponentModelDesignComponentChangedEventHandlerRemove)(int32_t thisHandle, int32_t delHandle), - void (*systemComponentModelDesignComponentChangedEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle), - void (*releaseSystemComponentModelDesignComponentRenameEventHandler)(int32_t handle, int32_t classHandle), - void (*systemComponentModelDesignComponentRenameEventHandlerConstructor)(int32_t cppHandle, int32_t* handle, int32_t* classHandle), - void (*systemComponentModelDesignComponentRenameEventHandlerAdd)(int32_t thisHandle, int32_t delHandle), - void (*systemComponentModelDesignComponentRenameEventHandlerRemove)(int32_t thisHandle, int32_t delHandle), - void (*systemComponentModelDesignComponentRenameEventHandlerInvoke)(int32_t thisHandle, int32_t senderHandle, int32_t eHandle) + System::Double (*unboxDouble)(int32_t valHandle) /*END INIT PARAMS*/) { uint8_t* curMemory = memory; @@ -21687,222 +3492,35 @@ DLLEXPORT void Init( Plugin::ArrayGetLength = arrayGetLength; Plugin::EnumerableGetEnumerator = enumerableGetEnumerator; /*BEGIN INIT BODY*/ - Plugin::SystemIComparableMethodCompareToSystemObject = systemIComparableMethodCompareToSystemObject; - Plugin::SystemIDisposableMethodDispose = systemIDisposableMethodDispose; Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle = unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle; - Plugin::UnityEngineVector3PropertyGetMagnitude = unityEngineVector3PropertyGetMagnitude; - Plugin::UnityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle = unityEngineVector3MethodSetSystemSingle_SystemSingle_SystemSingle; Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3 = unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3; - Plugin::UnityEngineVector3Methodop_UnaryNegationUnityEngineVector3 = unityEngineVector3Methodop_UnaryNegationUnityEngineVector3; Plugin::BoxVector3 = boxVector3; Plugin::UnboxVector3 = unboxVector3; Plugin::UnityEngineObjectPropertyGetName = unityEngineObjectPropertyGetName; Plugin::UnityEngineObjectPropertySetName = unityEngineObjectPropertySetName; - Plugin::UnityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject = unityEngineObjectMethodop_EqualityUnityEngineObject_UnityEngineObject; - Plugin::UnityEngineObjectMethodop_ImplicitUnityEngineObject = unityEngineObjectMethodop_ImplicitUnityEngineObject; Plugin::UnityEngineComponentPropertyGetTransform = unityEngineComponentPropertyGetTransform; Plugin::UnityEngineTransformPropertyGetPosition = unityEngineTransformPropertyGetPosition; Plugin::UnityEngineTransformPropertySetPosition = unityEngineTransformPropertySetPosition; - Plugin::UnityEngineTransformMethodSetParentUnityEngineTransform = unityEngineTransformMethodSetParentUnityEngineTransform; - Plugin::BoxColor = boxColor; - Plugin::UnboxColor = unboxColor; - Plugin::BoxGradientColorKey = boxGradientColorKey; - Plugin::UnboxGradientColorKey = unboxGradientColorKey; - Plugin::ReleaseUnityEngineResolution = releaseUnityEngineResolution; - Plugin::RefCountsUnityEngineResolution = (int32_t*)curMemory; - curMemory += 1000 * sizeof(int32_t); - Plugin::RefCountsLenUnityEngineResolution = 1000; - Plugin::UnityEngineResolutionConstructor = unityEngineResolutionConstructor; - Plugin::UnityEngineResolutionPropertyGetWidth = unityEngineResolutionPropertyGetWidth; - Plugin::UnityEngineResolutionPropertySetWidth = unityEngineResolutionPropertySetWidth; - Plugin::UnityEngineResolutionPropertyGetHeight = unityEngineResolutionPropertyGetHeight; - Plugin::UnityEngineResolutionPropertySetHeight = unityEngineResolutionPropertySetHeight; - Plugin::UnityEngineResolutionPropertyGetRefreshRate = unityEngineResolutionPropertyGetRefreshRate; - Plugin::UnityEngineResolutionPropertySetRefreshRate = unityEngineResolutionPropertySetRefreshRate; - Plugin::BoxResolution = boxResolution; - Plugin::UnboxResolution = unboxResolution; - Plugin::ReleaseUnityEngineRaycastHit = releaseUnityEngineRaycastHit; - Plugin::RefCountsUnityEngineRaycastHit = (int32_t*)curMemory; - curMemory += 1000 * sizeof(int32_t); - Plugin::RefCountsLenUnityEngineRaycastHit = 1000; - Plugin::UnityEngineRaycastHitPropertyGetPoint = unityEngineRaycastHitPropertyGetPoint; - Plugin::UnityEngineRaycastHitPropertySetPoint = unityEngineRaycastHitPropertySetPoint; - Plugin::UnityEngineRaycastHitPropertyGetTransform = unityEngineRaycastHitPropertyGetTransform; - Plugin::BoxRaycastHit = boxRaycastHit; - Plugin::UnboxRaycastHit = unboxRaycastHit; Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent = systemCollectionsIEnumeratorPropertyGetCurrent; Plugin::SystemCollectionsIEnumeratorMethodMoveNext = systemCollectionsIEnumeratorMethodMoveNext; - Plugin::ReleaseUnityEnginePlayablesPlayableGraph = releaseUnityEnginePlayablesPlayableGraph; - Plugin::RefCountsUnityEnginePlayablesPlayableGraph = (int32_t*)curMemory; - curMemory += 1000 * sizeof(int32_t); - Plugin::RefCountsLenUnityEnginePlayablesPlayableGraph = 1000; - Plugin::BoxPlayableGraph = boxPlayableGraph; - Plugin::UnboxPlayableGraph = unboxPlayableGraph; - Plugin::ReleaseUnityEngineAnimationsAnimationMixerPlayable = releaseUnityEngineAnimationsAnimationMixerPlayable; - Plugin::RefCountsUnityEngineAnimationsAnimationMixerPlayable = (int32_t*)curMemory; - curMemory += 1000 * sizeof(int32_t); - Plugin::RefCountsLenUnityEngineAnimationsAnimationMixerPlayable = 1000; - Plugin::UnityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean = unityEngineAnimationsAnimationMixerPlayableMethodCreateUnityEnginePlayablesPlayableGraph_SystemInt32_SystemBoolean; - Plugin::BoxAnimationMixerPlayable = boxAnimationMixerPlayable; - Plugin::UnboxAnimationMixerPlayable = unboxAnimationMixerPlayable; - Plugin::SystemDiagnosticsStopwatchConstructor = systemDiagnosticsStopwatchConstructor; - Plugin::SystemDiagnosticsStopwatchPropertyGetElapsedMilliseconds = systemDiagnosticsStopwatchPropertyGetElapsedMilliseconds; - Plugin::SystemDiagnosticsStopwatchMethodStart = systemDiagnosticsStopwatchMethodStart; - Plugin::SystemDiagnosticsStopwatchMethodReset = systemDiagnosticsStopwatchMethodReset; - Plugin::UnityEngineGameObjectConstructor = unityEngineGameObjectConstructor; - Plugin::UnityEngineGameObjectConstructorSystemString = unityEngineGameObjectConstructorSystemString; - Plugin::UnityEngineGameObjectPropertyGetTransform = unityEngineGameObjectPropertyGetTransform; - Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript = unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursTestScript; - Plugin::UnityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript = unityEngineGameObjectMethodAddComponentMyGameMonoBehavioursAnotherScript; + Plugin::UnityEngineGameObjectMethodAddComponentMyGameBaseBallScript = unityEngineGameObjectMethodAddComponentMyGameBaseBallScript; Plugin::UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType = unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType; Plugin::UnityEngineDebugMethodLogSystemObject = unityEngineDebugMethodLogSystemObject; - Plugin::UnityEngineAssertionsAssertFieldGetRaiseExceptions = unityEngineAssertionsAssertFieldGetRaiseExceptions; - Plugin::UnityEngineAssertionsAssertFieldSetRaiseExceptions = unityEngineAssertionsAssertFieldSetRaiseExceptions; - Plugin::UnityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString = unityEngineAssertionsAssertMethodAreEqualSystemStringSystemString_SystemString; - Plugin::UnityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject = unityEngineAssertionsAssertMethodAreEqualUnityEngineGameObjectUnityEngineGameObject_UnityEngineGameObject; Plugin::UnityEngineMonoBehaviourPropertyGetTransform = unityEngineMonoBehaviourPropertyGetTransform; - Plugin::UnityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32 = unityEngineAudioSettingsMethodGetDSPBufferSizeSystemInt32_SystemInt32; - Plugin::UnityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte = unityEngineNetworkingNetworkTransportMethodGetBroadcastConnectionInfoSystemInt32_SystemString_SystemInt32_SystemByte; - Plugin::UnityEngineNetworkingNetworkTransportMethodInit = unityEngineNetworkingNetworkTransportMethodInit; - Plugin::BoxQuaternion = boxQuaternion; - Plugin::UnboxQuaternion = unboxQuaternion; - Plugin::UnityEngineMatrix4x4PropertyGetItem = unityEngineMatrix4x4PropertyGetItem; - Plugin::UnityEngineMatrix4x4PropertySetItem = unityEngineMatrix4x4PropertySetItem; - Plugin::BoxMatrix4x4 = boxMatrix4x4; - Plugin::UnboxMatrix4x4 = unboxMatrix4x4; - Plugin::BoxQueryTriggerInteraction = boxQueryTriggerInteraction; - Plugin::UnboxQueryTriggerInteraction = unboxQueryTriggerInteraction; - Plugin::ReleaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = releaseSystemCollectionsGenericKeyValuePairSystemString_SystemDouble; - Plugin::RefCountsSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = (int32_t*)curMemory; - curMemory += 20 * sizeof(int32_t); - Plugin::RefCountsLenSystemCollectionsGenericKeyValuePairSystemString_SystemDouble = 20; - Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble = systemCollectionsGenericKeyValuePairSystemString_SystemDoubleConstructorSystemString_SystemDouble; - Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetKey; - Plugin::SystemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue = systemCollectionsGenericKeyValuePairSystemString_SystemDoublePropertyGetValue; - Plugin::BoxKeyValuePairSystemString_SystemDouble = boxKeyValuePairSystemString_SystemDouble; - Plugin::UnboxKeyValuePairSystemString_SystemDouble = unboxKeyValuePairSystemString_SystemDouble; - Plugin::SystemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString = systemCollectionsGenericLinkedListNodeSystemStringConstructorSystemString; - Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue = systemCollectionsGenericLinkedListNodeSystemStringPropertyGetValue; - Plugin::SystemCollectionsGenericLinkedListNodeSystemStringPropertySetValue = systemCollectionsGenericLinkedListNodeSystemStringPropertySetValue; - Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString = systemRuntimeCompilerServicesStrongBoxSystemStringConstructorSystemString; - Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldGetValue; - Plugin::SystemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue = systemRuntimeCompilerServicesStrongBoxSystemStringFieldSetValue; Plugin::SystemExceptionConstructorSystemString = systemExceptionConstructorSystemString; - Plugin::UnityEngineScreenPropertyGetResolutions = unityEngineScreenPropertyGetResolutions; - Plugin::ReleaseUnityEngineRay = releaseUnityEngineRay; - Plugin::RefCountsUnityEngineRay = (int32_t*)curMemory; - curMemory += 10 * sizeof(int32_t); - Plugin::RefCountsLenUnityEngineRay = 10; - Plugin::UnityEngineRayConstructorUnityEngineVector3_UnityEngineVector3 = unityEngineRayConstructorUnityEngineVector3_UnityEngineVector3; - Plugin::BoxRay = boxRay; - Plugin::UnboxRay = unboxRay; - Plugin::UnityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1 = unityEnginePhysicsMethodRaycastNonAllocUnityEngineRay_UnityEngineRaycastHitArray1; - Plugin::UnityEnginePhysicsMethodRaycastAllUnityEngineRay = unityEnginePhysicsMethodRaycastAllUnityEngineRay; - Plugin::UnityEngineGradientConstructor = unityEngineGradientConstructor; - Plugin::UnityEngineGradientPropertyGetColorKeys = unityEngineGradientPropertyGetColorKeys; - Plugin::UnityEngineGradientPropertySetColorKeys = unityEngineGradientPropertySetColorKeys; - Plugin::SystemAppDomainSetupConstructor = systemAppDomainSetupConstructor; - Plugin::SystemAppDomainSetupPropertyGetAppDomainInitializer = systemAppDomainSetupPropertyGetAppDomainInitializer; - Plugin::SystemAppDomainSetupPropertySetAppDomainInitializer = systemAppDomainSetupPropertySetAppDomainInitializer; - Plugin::UnityEngineApplicationAddEventOnBeforeRender = unityEngineApplicationAddEventOnBeforeRender; - Plugin::UnityEngineApplicationRemoveEventOnBeforeRender = unityEngineApplicationRemoveEventOnBeforeRender; - Plugin::UnityEngineSceneManagementSceneManagerAddEventSceneLoaded = unityEngineSceneManagementSceneManagerAddEventSceneLoaded; - Plugin::UnityEngineSceneManagementSceneManagerRemoveEventSceneLoaded = unityEngineSceneManagementSceneManagerRemoveEventSceneLoaded; - Plugin::ReleaseUnityEngineSceneManagementScene = releaseUnityEngineSceneManagementScene; - Plugin::RefCountsUnityEngineSceneManagementScene = (int32_t*)curMemory; - curMemory += 1000 * sizeof(int32_t); - Plugin::RefCountsLenUnityEngineSceneManagementScene = 1000; - Plugin::BoxScene = boxScene; - Plugin::UnboxScene = unboxScene; - Plugin::BoxLoadSceneMode = boxLoadSceneMode; - Plugin::UnboxLoadSceneMode = unboxLoadSceneMode; Plugin::BoxPrimitiveType = boxPrimitiveType; Plugin::UnboxPrimitiveType = unboxPrimitiveType; Plugin::UnityEngineTimePropertyGetDeltaTime = unityEngineTimePropertyGetDeltaTime; - Plugin::BoxFileMode = boxFileMode; - Plugin::UnboxFileMode = unboxFileMode; - Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize = 1000; - Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList = (System::Collections::Generic::BaseIComparer**)curMemory; - curMemory += 1000 * sizeof(System::Collections::Generic::BaseIComparer*); - - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemInt32 = releaseSystemCollectionsGenericBaseIComparerSystemInt32; - Plugin::SystemCollectionsGenericBaseIComparerSystemInt32Constructor = systemCollectionsGenericBaseIComparerSystemInt32Constructor; - Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeListSize = 1000; - Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeList = (System::Collections::Generic::BaseIComparer**)curMemory; - curMemory += 1000 * sizeof(System::Collections::Generic::BaseIComparer*); - - Plugin::ReleaseSystemCollectionsGenericBaseIComparerSystemString = releaseSystemCollectionsGenericBaseIComparerSystemString; - Plugin::SystemCollectionsGenericBaseIComparerSystemStringConstructor = systemCollectionsGenericBaseIComparerSystemStringConstructor; - Plugin::SystemBaseStringComparerFreeListSize = 1000; - Plugin::SystemBaseStringComparerFreeList = (System::BaseStringComparer**)curMemory; - curMemory += 1000 * sizeof(System::BaseStringComparer*); - - Plugin::ReleaseSystemBaseStringComparer = releaseSystemBaseStringComparer; - Plugin::SystemBaseStringComparerConstructor = systemBaseStringComparerConstructor; - Plugin::SystemCollectionsQueuePropertyGetCount = systemCollectionsQueuePropertyGetCount; - Plugin::SystemCollectionsBaseQueueFreeListSize = 1000; - Plugin::SystemCollectionsBaseQueueFreeList = (System::Collections::BaseQueue**)curMemory; - curMemory += 1000 * sizeof(System::Collections::BaseQueue*); - - Plugin::ReleaseSystemCollectionsBaseQueue = releaseSystemCollectionsBaseQueue; - Plugin::SystemCollectionsBaseQueueConstructor = systemCollectionsBaseQueueConstructor; - Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize = 1000; - Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeList = (System::ComponentModel::Design::BaseIComponentChangeService**)curMemory; - curMemory += 1000 * sizeof(System::ComponentModel::Design::BaseIComponentChangeService*); - - Plugin::ReleaseSystemComponentModelDesignBaseIComponentChangeService = releaseSystemComponentModelDesignBaseIComponentChangeService; - Plugin::SystemComponentModelDesignBaseIComponentChangeServiceConstructor = systemComponentModelDesignBaseIComponentChangeServiceConstructor; - Plugin::SystemIOFileStreamConstructorSystemString_SystemIOFileMode = systemIOFileStreamConstructorSystemString_SystemIOFileMode; - Plugin::SystemIOFileStreamMethodWriteByteSystemByte = systemIOFileStreamMethodWriteByteSystemByte; - Plugin::SystemIOBaseFileStreamFreeListSize = 1000; - Plugin::SystemIOBaseFileStreamFreeList = (System::IO::BaseFileStream**)curMemory; - curMemory += 1000 * sizeof(System::IO::BaseFileStream*); - - Plugin::ReleaseSystemIOBaseFileStream = releaseSystemIOBaseFileStream; - Plugin::SystemIOBaseFileStreamConstructorSystemString_SystemIOFileMode = systemIOBaseFileStreamConstructorSystemString_SystemIOFileMode; - Plugin::ReleaseUnityEnginePlayablesPlayableHandle = releaseUnityEnginePlayablesPlayableHandle; - Plugin::RefCountsUnityEnginePlayablesPlayableHandle = (int32_t*)curMemory; - curMemory += 1000 * sizeof(int32_t); - Plugin::RefCountsLenUnityEnginePlayablesPlayableHandle = 1000; - Plugin::BoxPlayableHandle = boxPlayableHandle; - Plugin::UnboxPlayableHandle = unboxPlayableHandle; - Plugin::SystemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent = systemCollectionsGenericIEnumeratorUnityEngineExperimentalUIElementsVisualElementPropertyGetCurrent; - Plugin::SystemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator = systemCollectionsGenericIEnumerableUnityEngineExperimentalUIElementsVisualElementMethodGetEnumerator; - Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1 = unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemStringArray1; - Plugin::UnityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString = unityEngineExperimentalUIElementsUQueryExtensionsMethodQUnityEngineExperimentalUIElementsVisualElement_SystemString_SystemString; - Plugin::BoxInteractionSourcePositionAccuracy = boxInteractionSourcePositionAccuracy; - Plugin::UnboxInteractionSourcePositionAccuracy = unboxInteractionSourcePositionAccuracy; - Plugin::BoxInteractionSourceNode = boxInteractionSourceNode; - Plugin::UnboxInteractionSourceNode = unboxInteractionSourceNode; - Plugin::ReleaseUnityEngineXRWSAInputInteractionSourcePose = releaseUnityEngineXRWSAInputInteractionSourcePose; - Plugin::RefCountsUnityEngineXRWSAInputInteractionSourcePose = (int32_t*)curMemory; - curMemory += 1000 * sizeof(int32_t); - Plugin::RefCountsLenUnityEngineXRWSAInputInteractionSourcePose = 1000; - Plugin::UnityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode = unityEngineXRWSAInputInteractionSourcePoseMethodTryGetRotationUnityEngineQuaternion_UnityEngineXRWSAInputInteractionSourceNode; - Plugin::BoxInteractionSourcePose = boxInteractionSourcePose; - Plugin::UnboxInteractionSourcePose = unboxInteractionSourcePose; - Plugin::SystemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent = systemCollectionsGenericIEnumeratorSystemStringPropertyGetCurrent; - Plugin::SystemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent = systemCollectionsGenericIEnumeratorSystemInt32PropertyGetCurrent; - Plugin::SystemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent = systemCollectionsGenericIEnumeratorSystemSinglePropertyGetCurrent; - Plugin::SystemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent = systemCollectionsGenericIEnumeratorUnityEngineRaycastHitPropertyGetCurrent; - Plugin::SystemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent = systemCollectionsGenericIEnumeratorUnityEngineGradientColorKeyPropertyGetCurrent; - Plugin::SystemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent = systemCollectionsGenericIEnumeratorUnityEngineResolutionPropertyGetCurrent; - Plugin::SystemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator = systemCollectionsGenericIEnumerableSystemStringMethodGetEnumerator; - Plugin::SystemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator = systemCollectionsGenericIEnumerableSystemInt32MethodGetEnumerator; - Plugin::SystemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator = systemCollectionsGenericIEnumerableSystemSingleMethodGetEnumerator; - Plugin::SystemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator = systemCollectionsGenericIEnumerableUnityEngineRaycastHitMethodGetEnumerator; - Plugin::SystemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator = systemCollectionsGenericIEnumerableUnityEngineGradientColorKeyMethodGetEnumerator; - Plugin::SystemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator = systemCollectionsGenericIEnumerableUnityEngineResolutionMethodGetEnumerator; - Plugin::SystemCollectionsGenericListSystemStringConstructor = systemCollectionsGenericListSystemStringConstructor; - Plugin::SystemCollectionsGenericListSystemStringPropertyGetItem = systemCollectionsGenericListSystemStringPropertyGetItem; - Plugin::SystemCollectionsGenericListSystemStringPropertySetItem = systemCollectionsGenericListSystemStringPropertySetItem; - Plugin::SystemCollectionsGenericListSystemStringMethodAddSystemString = systemCollectionsGenericListSystemStringMethodAddSystemString; - Plugin::SystemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer = systemCollectionsGenericListSystemStringMethodSortSystemCollectionsGenericIComparer; - Plugin::SystemCollectionsGenericListSystemInt32Constructor = systemCollectionsGenericListSystemInt32Constructor; - Plugin::SystemCollectionsGenericListSystemInt32PropertyGetItem = systemCollectionsGenericListSystemInt32PropertyGetItem; - Plugin::SystemCollectionsGenericListSystemInt32PropertySetItem = systemCollectionsGenericListSystemInt32PropertySetItem; - Plugin::SystemCollectionsGenericListSystemInt32MethodAddSystemInt32 = systemCollectionsGenericListSystemInt32MethodAddSystemInt32; - Plugin::SystemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer = systemCollectionsGenericListSystemInt32MethodSortSystemCollectionsGenericIComparer; + Plugin::BaseBallScriptFreeListSize = 1000; + Plugin::BaseBallScriptFreeList = (MyGame::BaseBallScript**)curMemory; + curMemory += 1000 * sizeof(MyGame::BaseBallScript*); + + Plugin::ReleaseBaseBallScript = releaseBaseBallScript; + Plugin::BaseBallScriptConstructor = baseBallScriptConstructor; + Plugin::BaseBallScriptFreeWholeListSize = 1000; + Plugin::BaseBallScriptFreeWholeList = (Plugin::BaseBallScriptFreeWholeListEntry*)curMemory; + curMemory += 1000 * sizeof(Plugin::BaseBallScriptFreeWholeListEntry); + Plugin::BoxBoolean = boxBoolean; Plugin::UnboxBoolean = unboxBoolean; Plugin::BoxSByte = boxSByte; @@ -21927,140 +3545,6 @@ DLLEXPORT void Init( Plugin::UnboxSingle = unboxSingle; Plugin::BoxDouble = boxDouble; Plugin::UnboxDouble = unboxDouble; - Plugin::SystemSystemInt32Array1Constructor1 = systemSystemInt32Array1Constructor1; - Plugin::SystemInt32Array1GetItem1 = systemInt32Array1GetItem1; - Plugin::SystemInt32Array1SetItem1 = systemInt32Array1SetItem1; - Plugin::SystemSystemSingleArray1Constructor1 = systemSystemSingleArray1Constructor1; - Plugin::SystemSingleArray1GetItem1 = systemSingleArray1GetItem1; - Plugin::SystemSingleArray1SetItem1 = systemSingleArray1SetItem1; - Plugin::SystemSystemSingleArray2Constructor2 = systemSystemSingleArray2Constructor2; - Plugin::SystemSystemSingleArray2GetLength2 = systemSystemSingleArray2GetLength2; - Plugin::SystemSingleArray2GetItem2 = systemSingleArray2GetItem2; - Plugin::SystemSingleArray2SetItem2 = systemSingleArray2SetItem2; - Plugin::SystemSystemSingleArray3Constructor3 = systemSystemSingleArray3Constructor3; - Plugin::SystemSystemSingleArray3GetLength3 = systemSystemSingleArray3GetLength3; - Plugin::SystemSingleArray3GetItem3 = systemSingleArray3GetItem3; - Plugin::SystemSingleArray3SetItem3 = systemSingleArray3SetItem3; - Plugin::SystemSystemStringArray1Constructor1 = systemSystemStringArray1Constructor1; - Plugin::SystemStringArray1GetItem1 = systemStringArray1GetItem1; - Plugin::SystemStringArray1SetItem1 = systemStringArray1SetItem1; - Plugin::UnityEngineUnityEngineResolutionArray1Constructor1 = unityEngineUnityEngineResolutionArray1Constructor1; - Plugin::UnityEngineResolutionArray1GetItem1 = unityEngineResolutionArray1GetItem1; - Plugin::UnityEngineResolutionArray1SetItem1 = unityEngineResolutionArray1SetItem1; - Plugin::UnityEngineUnityEngineRaycastHitArray1Constructor1 = unityEngineUnityEngineRaycastHitArray1Constructor1; - Plugin::UnityEngineRaycastHitArray1GetItem1 = unityEngineRaycastHitArray1GetItem1; - Plugin::UnityEngineRaycastHitArray1SetItem1 = unityEngineRaycastHitArray1SetItem1; - Plugin::UnityEngineUnityEngineGradientColorKeyArray1Constructor1 = unityEngineUnityEngineGradientColorKeyArray1Constructor1; - Plugin::UnityEngineGradientColorKeyArray1GetItem1 = unityEngineGradientColorKeyArray1GetItem1; - Plugin::UnityEngineGradientColorKeyArray1SetItem1 = unityEngineGradientColorKeyArray1SetItem1; - Plugin::SystemActionFreeListSize = 1000; - Plugin::SystemActionFreeList = (System::Action**)curMemory; - curMemory += 1000 * sizeof(System::Action*); - - Plugin::ReleaseSystemAction = releaseSystemAction; - Plugin::SystemActionConstructor = systemActionConstructor; - Plugin::SystemActionAdd = systemActionAdd; - Plugin::SystemActionRemove = systemActionRemove; - Plugin::SystemActionInvoke = systemActionInvoke; - Plugin::SystemActionSystemSingleFreeListSize = 1000; - Plugin::SystemActionSystemSingleFreeList = (System::Action1**)curMemory; - curMemory += 1000 * sizeof(System::Action1*); - - Plugin::ReleaseSystemActionSystemSingle = releaseSystemActionSystemSingle; - Plugin::SystemActionSystemSingleConstructor = systemActionSystemSingleConstructor; - Plugin::SystemActionSystemSingleAdd = systemActionSystemSingleAdd; - Plugin::SystemActionSystemSingleRemove = systemActionSystemSingleRemove; - Plugin::SystemActionSystemSingleInvoke = systemActionSystemSingleInvoke; - Plugin::SystemActionSystemSingle_SystemSingleFreeListSize = 100; - Plugin::SystemActionSystemSingle_SystemSingleFreeList = (System::Action2**)curMemory; - curMemory += 100 * sizeof(System::Action2*); - - Plugin::ReleaseSystemActionSystemSingle_SystemSingle = releaseSystemActionSystemSingle_SystemSingle; - Plugin::SystemActionSystemSingle_SystemSingleConstructor = systemActionSystemSingle_SystemSingleConstructor; - Plugin::SystemActionSystemSingle_SystemSingleAdd = systemActionSystemSingle_SystemSingleAdd; - Plugin::SystemActionSystemSingle_SystemSingleRemove = systemActionSystemSingle_SystemSingleRemove; - Plugin::SystemActionSystemSingle_SystemSingleInvoke = systemActionSystemSingle_SystemSingleInvoke; - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize = 50; - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList = (System::Func3**)curMemory; - curMemory += 50 * sizeof(System::Func3*); - - Plugin::ReleaseSystemFuncSystemInt32_SystemSingle_SystemDouble = releaseSystemFuncSystemInt32_SystemSingle_SystemDouble; - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleConstructor = systemFuncSystemInt32_SystemSingle_SystemDoubleConstructor; - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleAdd = systemFuncSystemInt32_SystemSingle_SystemDoubleAdd; - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleRemove = systemFuncSystemInt32_SystemSingle_SystemDoubleRemove; - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleInvoke = systemFuncSystemInt32_SystemSingle_SystemDoubleInvoke; - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize = 25; - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList = (System::Func3**)curMemory; - curMemory += 25 * sizeof(System::Func3*); - - Plugin::ReleaseSystemFuncSystemInt16_SystemInt32_SystemString = releaseSystemFuncSystemInt16_SystemInt32_SystemString; - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringConstructor = systemFuncSystemInt16_SystemInt32_SystemStringConstructor; - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringAdd = systemFuncSystemInt16_SystemInt32_SystemStringAdd; - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringRemove = systemFuncSystemInt16_SystemInt32_SystemStringRemove; - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringInvoke = systemFuncSystemInt16_SystemInt32_SystemStringInvoke; - Plugin::SystemAppDomainInitializerFreeListSize = 1000; - Plugin::SystemAppDomainInitializerFreeList = (System::AppDomainInitializer**)curMemory; - curMemory += 1000 * sizeof(System::AppDomainInitializer*); - - Plugin::ReleaseSystemAppDomainInitializer = releaseSystemAppDomainInitializer; - Plugin::SystemAppDomainInitializerConstructor = systemAppDomainInitializerConstructor; - Plugin::SystemAppDomainInitializerAdd = systemAppDomainInitializerAdd; - Plugin::SystemAppDomainInitializerRemove = systemAppDomainInitializerRemove; - Plugin::SystemAppDomainInitializerInvoke = systemAppDomainInitializerInvoke; - Plugin::UnityEngineEventsUnityActionFreeListSize = 1000; - Plugin::UnityEngineEventsUnityActionFreeList = (UnityEngine::Events::UnityAction**)curMemory; - curMemory += 1000 * sizeof(UnityEngine::Events::UnityAction*); - - Plugin::ReleaseUnityEngineEventsUnityAction = releaseUnityEngineEventsUnityAction; - Plugin::UnityEngineEventsUnityActionConstructor = unityEngineEventsUnityActionConstructor; - Plugin::UnityEngineEventsUnityActionAdd = unityEngineEventsUnityActionAdd; - Plugin::UnityEngineEventsUnityActionRemove = unityEngineEventsUnityActionRemove; - Plugin::UnityEngineEventsUnityActionInvoke = unityEngineEventsUnityActionInvoke; - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize = 10; - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList = (UnityEngine::Events::UnityAction2**)curMemory; - curMemory += 10 * sizeof(UnityEngine::Events::UnityAction2*); - - Plugin::ReleaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = releaseUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode; - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeConstructor; - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeAdd; - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeRemove; - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke = unityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeInvoke; - Plugin::SystemComponentModelDesignComponentEventHandlerFreeListSize = 1000; - Plugin::SystemComponentModelDesignComponentEventHandlerFreeList = (System::ComponentModel::Design::ComponentEventHandler**)curMemory; - curMemory += 1000 * sizeof(System::ComponentModel::Design::ComponentEventHandler*); - - Plugin::ReleaseSystemComponentModelDesignComponentEventHandler = releaseSystemComponentModelDesignComponentEventHandler; - Plugin::SystemComponentModelDesignComponentEventHandlerConstructor = systemComponentModelDesignComponentEventHandlerConstructor; - Plugin::SystemComponentModelDesignComponentEventHandlerAdd = systemComponentModelDesignComponentEventHandlerAdd; - Plugin::SystemComponentModelDesignComponentEventHandlerRemove = systemComponentModelDesignComponentEventHandlerRemove; - Plugin::SystemComponentModelDesignComponentEventHandlerInvoke = systemComponentModelDesignComponentEventHandlerInvoke; - Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeListSize = 1000; - Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeList = (System::ComponentModel::Design::ComponentChangingEventHandler**)curMemory; - curMemory += 1000 * sizeof(System::ComponentModel::Design::ComponentChangingEventHandler*); - - Plugin::ReleaseSystemComponentModelDesignComponentChangingEventHandler = releaseSystemComponentModelDesignComponentChangingEventHandler; - Plugin::SystemComponentModelDesignComponentChangingEventHandlerConstructor = systemComponentModelDesignComponentChangingEventHandlerConstructor; - Plugin::SystemComponentModelDesignComponentChangingEventHandlerAdd = systemComponentModelDesignComponentChangingEventHandlerAdd; - Plugin::SystemComponentModelDesignComponentChangingEventHandlerRemove = systemComponentModelDesignComponentChangingEventHandlerRemove; - Plugin::SystemComponentModelDesignComponentChangingEventHandlerInvoke = systemComponentModelDesignComponentChangingEventHandlerInvoke; - Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeListSize = 1000; - Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeList = (System::ComponentModel::Design::ComponentChangedEventHandler**)curMemory; - curMemory += 1000 * sizeof(System::ComponentModel::Design::ComponentChangedEventHandler*); - - Plugin::ReleaseSystemComponentModelDesignComponentChangedEventHandler = releaseSystemComponentModelDesignComponentChangedEventHandler; - Plugin::SystemComponentModelDesignComponentChangedEventHandlerConstructor = systemComponentModelDesignComponentChangedEventHandlerConstructor; - Plugin::SystemComponentModelDesignComponentChangedEventHandlerAdd = systemComponentModelDesignComponentChangedEventHandlerAdd; - Plugin::SystemComponentModelDesignComponentChangedEventHandlerRemove = systemComponentModelDesignComponentChangedEventHandlerRemove; - Plugin::SystemComponentModelDesignComponentChangedEventHandlerInvoke = systemComponentModelDesignComponentChangedEventHandlerInvoke; - Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeListSize = 1000; - Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeList = (System::ComponentModel::Design::ComponentRenameEventHandler**)curMemory; - curMemory += 1000 * sizeof(System::ComponentModel::Design::ComponentRenameEventHandler*); - - Plugin::ReleaseSystemComponentModelDesignComponentRenameEventHandler = releaseSystemComponentModelDesignComponentRenameEventHandler; - Plugin::SystemComponentModelDesignComponentRenameEventHandlerConstructor = systemComponentModelDesignComponentRenameEventHandlerConstructor; - Plugin::SystemComponentModelDesignComponentRenameEventHandlerAdd = systemComponentModelDesignComponentRenameEventHandlerAdd; - Plugin::SystemComponentModelDesignComponentRenameEventHandlerRemove = systemComponentModelDesignComponentRenameEventHandlerRemove; - Plugin::SystemComponentModelDesignComponentRenameEventHandlerInvoke = systemComponentModelDesignComponentRenameEventHandlerInvoke; /*END INIT BODY*/ // Make sure there was enough memory @@ -22078,131 +3562,19 @@ DLLEXPORT void Init( memset(memory, 0, memorySize); /*BEGIN INIT BODY FIRST BOOT*/ - for (int32_t i = 0, end = Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize - 1; i < end; ++i) - { - Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList[i] = (System::Collections::Generic::BaseIComparer*)(Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList + i + 1); - } - Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList[Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeListSize - 1] = nullptr; - Plugin::NextFreeSystemCollectionsGenericBaseIComparerSystemInt32 = Plugin::SystemCollectionsGenericBaseIComparerSystemInt32FreeList + 1; - - for (int32_t i = 0, end = Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeListSize - 1; i < end; ++i) - { - Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeList[i] = (System::Collections::Generic::BaseIComparer*)(Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeList + i + 1); - } - Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeList[Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemCollectionsGenericBaseIComparerSystemString = Plugin::SystemCollectionsGenericBaseIComparerSystemStringFreeList + 1; - - for (int32_t i = 0, end = Plugin::SystemBaseStringComparerFreeListSize - 1; i < end; ++i) - { - Plugin::SystemBaseStringComparerFreeList[i] = (System::BaseStringComparer*)(Plugin::SystemBaseStringComparerFreeList + i + 1); - } - Plugin::SystemBaseStringComparerFreeList[Plugin::SystemBaseStringComparerFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemBaseStringComparer = Plugin::SystemBaseStringComparerFreeList + 1; - - for (int32_t i = 0, end = Plugin::SystemCollectionsBaseQueueFreeListSize - 1; i < end; ++i) - { - Plugin::SystemCollectionsBaseQueueFreeList[i] = (System::Collections::BaseQueue*)(Plugin::SystemCollectionsBaseQueueFreeList + i + 1); - } - Plugin::SystemCollectionsBaseQueueFreeList[Plugin::SystemCollectionsBaseQueueFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemCollectionsBaseQueue = Plugin::SystemCollectionsBaseQueueFreeList + 1; - - for (int32_t i = 0, end = Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize - 1; i < end; ++i) - { - Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeList[i] = (System::ComponentModel::Design::BaseIComponentChangeService*)(Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeList + i + 1); - } - Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeList[Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemComponentModelDesignBaseIComponentChangeService = Plugin::SystemComponentModelDesignBaseIComponentChangeServiceFreeList + 1; - - for (int32_t i = 0, end = Plugin::SystemIOBaseFileStreamFreeListSize - 1; i < end; ++i) - { - Plugin::SystemIOBaseFileStreamFreeList[i] = (System::IO::BaseFileStream*)(Plugin::SystemIOBaseFileStreamFreeList + i + 1); - } - Plugin::SystemIOBaseFileStreamFreeList[Plugin::SystemIOBaseFileStreamFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemIOBaseFileStream = Plugin::SystemIOBaseFileStreamFreeList + 1; - - for (int32_t i = 0, end = Plugin::SystemActionFreeListSize - 1; i < end; ++i) - { - Plugin::SystemActionFreeList[i] = (System::Action*)(Plugin::SystemActionFreeList + i + 1); - } - Plugin::SystemActionFreeList[Plugin::SystemActionFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemAction = Plugin::SystemActionFreeList + 1; - - for (int32_t i = 0, end = Plugin::SystemActionSystemSingleFreeListSize - 1; i < end; ++i) - { - Plugin::SystemActionSystemSingleFreeList[i] = (System::Action1*)(Plugin::SystemActionSystemSingleFreeList + i + 1); - } - Plugin::SystemActionSystemSingleFreeList[Plugin::SystemActionSystemSingleFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemActionSystemSingle = Plugin::SystemActionSystemSingleFreeList + 1; - - for (int32_t i = 0, end = Plugin::SystemActionSystemSingle_SystemSingleFreeListSize - 1; i < end; ++i) - { - Plugin::SystemActionSystemSingle_SystemSingleFreeList[i] = (System::Action2*)(Plugin::SystemActionSystemSingle_SystemSingleFreeList + i + 1); - } - Plugin::SystemActionSystemSingle_SystemSingleFreeList[Plugin::SystemActionSystemSingle_SystemSingleFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemActionSystemSingle_SystemSingle = Plugin::SystemActionSystemSingle_SystemSingleFreeList + 1; - - for (int32_t i = 0, end = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize - 1; i < end; ++i) - { - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[i] = (System::Func3*)(Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + i + 1); - } - Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList[Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemFuncSystemInt32_SystemSingle_SystemDouble = Plugin::SystemFuncSystemInt32_SystemSingle_SystemDoubleFreeList + 1; - - for (int32_t i = 0, end = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize - 1; i < end; ++i) - { - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[i] = (System::Func3*)(Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + i + 1); - } - Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList[Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemFuncSystemInt16_SystemInt32_SystemString = Plugin::SystemFuncSystemInt16_SystemInt32_SystemStringFreeList + 1; - - for (int32_t i = 0, end = Plugin::SystemAppDomainInitializerFreeListSize - 1; i < end; ++i) - { - Plugin::SystemAppDomainInitializerFreeList[i] = (System::AppDomainInitializer*)(Plugin::SystemAppDomainInitializerFreeList + i + 1); - } - Plugin::SystemAppDomainInitializerFreeList[Plugin::SystemAppDomainInitializerFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemAppDomainInitializer = Plugin::SystemAppDomainInitializerFreeList + 1; - - for (int32_t i = 0, end = Plugin::UnityEngineEventsUnityActionFreeListSize - 1; i < end; ++i) - { - Plugin::UnityEngineEventsUnityActionFreeList[i] = (UnityEngine::Events::UnityAction*)(Plugin::UnityEngineEventsUnityActionFreeList + i + 1); - } - Plugin::UnityEngineEventsUnityActionFreeList[Plugin::UnityEngineEventsUnityActionFreeListSize - 1] = nullptr; - Plugin::NextFreeUnityEngineEventsUnityAction = Plugin::UnityEngineEventsUnityActionFreeList + 1; - - for (int32_t i = 0, end = Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize - 1; i < end; ++i) - { - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList[i] = (UnityEngine::Events::UnityAction2*)(Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList + i + 1); - } - Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList[Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeListSize - 1] = nullptr; - Plugin::NextFreeUnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneMode = Plugin::UnityEngineEventsUnityActionUnityEngineSceneManagementScene_UnityEngineSceneManagementLoadSceneModeFreeList + 1; - - for (int32_t i = 0, end = Plugin::SystemComponentModelDesignComponentEventHandlerFreeListSize - 1; i < end; ++i) - { - Plugin::SystemComponentModelDesignComponentEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentEventHandler*)(Plugin::SystemComponentModelDesignComponentEventHandlerFreeList + i + 1); - } - Plugin::SystemComponentModelDesignComponentEventHandlerFreeList[Plugin::SystemComponentModelDesignComponentEventHandlerFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemComponentModelDesignComponentEventHandler = Plugin::SystemComponentModelDesignComponentEventHandlerFreeList + 1; - - for (int32_t i = 0, end = Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeListSize - 1; i < end; ++i) - { - Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentChangingEventHandler*)(Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeList + i + 1); - } - Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeList[Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemComponentModelDesignComponentChangingEventHandler = Plugin::SystemComponentModelDesignComponentChangingEventHandlerFreeList + 1; - - for (int32_t i = 0, end = Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeListSize - 1; i < end; ++i) + for (int32_t i = 0, end = Plugin::BaseBallScriptFreeListSize - 1; i < end; ++i) { - Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentChangedEventHandler*)(Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeList + i + 1); + Plugin::BaseBallScriptFreeList[i] = (MyGame::BaseBallScript*)(Plugin::BaseBallScriptFreeList + i + 1); } - Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeList[Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemComponentModelDesignComponentChangedEventHandler = Plugin::SystemComponentModelDesignComponentChangedEventHandlerFreeList + 1; + Plugin::BaseBallScriptFreeList[Plugin::BaseBallScriptFreeListSize - 1] = nullptr; + Plugin::NextFreeBaseBallScript = Plugin::BaseBallScriptFreeList + 1; - for (int32_t i = 0, end = Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeListSize - 1; i < end; ++i) + for (int32_t i = 0, end = Plugin::BaseBallScriptFreeWholeListSize - 1; i < end; ++i) { - Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeList[i] = (System::ComponentModel::Design::ComponentRenameEventHandler*)(Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeList + i + 1); + Plugin::BaseBallScriptFreeWholeList[i].Next = Plugin::BaseBallScriptFreeWholeList[i + 1].Next; } - Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeList[Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeListSize - 1] = nullptr; - Plugin::NextFreeSystemComponentModelDesignComponentRenameEventHandler = Plugin::SystemComponentModelDesignComponentRenameEventHandlerFreeList + 1; + Plugin::BaseBallScriptFreeWholeList[Plugin::BaseBallScriptFreeWholeListSize - 1].Next = nullptr; + Plugin::NextFreeWholeBaseBallScript = Plugin::BaseBallScriptFreeWholeList + 1; /*END INIT BODY FIRST BOOT*/ } @@ -22233,124 +3605,3 @@ DLLEXPORT void SetCsharpException(int32_t handle) handle); } -/*BEGIN MONOBEHAVIOUR MESSAGES*/ -DLLEXPORT void MyGameMonoBehavioursTestScriptAwake(int32_t thisHandle) -{ - MyGame::MonoBehaviours::TestScript thiz(Plugin::InternalUse::Only, thisHandle); - try - { - thiz.Awake(); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception in MyGame::MonoBehaviours::TestScript::Awake"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } -} - - -DLLEXPORT void MyGameMonoBehavioursTestScriptOnAnimatorIK(int32_t thisHandle, System::Int32 param0) -{ - MyGame::MonoBehaviours::TestScript thiz(Plugin::InternalUse::Only, thisHandle); - try - { - thiz.OnAnimatorIK(param0); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception in MyGame::MonoBehaviours::TestScript::OnAnimatorIK"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } -} - - -DLLEXPORT void MyGameMonoBehavioursTestScriptOnCollisionEnter(int32_t thisHandle, int32_t param0Handle) -{ - MyGame::MonoBehaviours::TestScript thiz(Plugin::InternalUse::Only, thisHandle); - UnityEngine::Collision param0(Plugin::InternalUse::Only, param0Handle); - try - { - thiz.OnCollisionEnter(param0); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception in MyGame::MonoBehaviours::TestScript::OnCollisionEnter"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } -} - - -DLLEXPORT void MyGameMonoBehavioursTestScriptUpdate(int32_t thisHandle) -{ - MyGame::MonoBehaviours::TestScript thiz(Plugin::InternalUse::Only, thisHandle); - try - { - thiz.Update(); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception in MyGame::MonoBehaviours::TestScript::Update"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } -} - - -DLLEXPORT void MyGameMonoBehavioursAnotherScriptAwake(int32_t thisHandle) -{ - MyGame::MonoBehaviours::AnotherScript thiz(Plugin::InternalUse::Only, thisHandle); - try - { - thiz.Awake(); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception in MyGame::MonoBehaviours::AnotherScript::Awake"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } -} - - -DLLEXPORT void MyGameMonoBehavioursAnotherScriptUpdate(int32_t thisHandle) -{ - MyGame::MonoBehaviours::AnotherScript thiz(Plugin::InternalUse::Only, thisHandle); - try - { - thiz.Update(); - } - catch (System::Exception ex) - { - Plugin::SetException(ex.Handle); - } - catch (...) - { - System::String msg = "Unhandled exception in MyGame::MonoBehaviours::AnotherScript::Update"; - System::Exception ex(msg); - Plugin::SetException(ex.Handle); - } -} -/*END MONOBEHAVIOUR MESSAGES*/ diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 4ce8ff7..04e0e99 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -259,214 +259,7 @@ namespace System } /*BEGIN TEMPLATE DECLARATIONS*/ -namespace System -{ - namespace Collections - { - namespace Generic - { - template struct IEqualityComparer; - } - } -} - -namespace System -{ - template struct IEquatable; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template struct KeyValuePair; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template struct LinkedListNode; - } - } -} - -namespace System -{ - namespace Runtime - { - namespace CompilerServices - { - template struct StrongBox; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template struct IComparer; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template struct BaseIComparer; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template struct BaseIComparer; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template struct IEnumerator; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template struct IEnumerable; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template struct IEnumerator; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template struct IEnumerable; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template struct ICollection; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template struct IList; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template struct List; - } - } -} - -namespace System -{ - namespace Collections - { - namespace ObjectModel - { - template struct Collection; - } - } -} - -namespace System -{ - namespace Collections - { - namespace ObjectModel - { - template struct KeyedCollection; - } - } -} - -namespace System -{ - template struct Action1; -} - -namespace System -{ - template struct Action2; -} - -namespace System -{ - template struct Func3; -} - -namespace System -{ - template struct Func3; -} -namespace UnityEngine -{ - namespace Events - { - template struct UnityAction2; - } -} /*END TEMPLATE DECLARATIONS*/ /*BEGIN TYPE DECLARATIONS*/ @@ -485,11 +278,6 @@ namespace System struct IComparable; } -namespace System -{ - struct IDisposable; -} - namespace UnityEngine { struct Vector3; @@ -510,26 +298,6 @@ namespace UnityEngine struct Transform; } -namespace UnityEngine -{ - struct Color; -} - -namespace UnityEngine -{ - struct GradientColorKey; -} - -namespace UnityEngine -{ - struct Resolution; -} - -namespace UnityEngine -{ - struct RaycastHit; -} - namespace System { namespace Collections @@ -560,5112 +328,590 @@ namespace System } } -namespace System +namespace UnityEngine { - struct IAppDomainSetup; + struct GameObject; } -namespace System +namespace UnityEngine { - namespace Collections - { - struct IComparer; - } + struct Debug; } -namespace System +namespace UnityEngine { - namespace Collections - { - struct IEqualityComparer; - } + struct Behaviour; } namespace UnityEngine { - namespace Playables - { - struct PlayableGraph; - } + struct MonoBehaviour; } -namespace UnityEngine +namespace System { - namespace Playables - { - struct IPlayable; - } + struct Exception; } -namespace UnityEngine +namespace System { - namespace Animations - { - struct AnimationMixerPlayable; - } + struct SystemException; } namespace System { - namespace Runtime - { - namespace CompilerServices - { - struct IStrongBox; - } - } + struct NullReferenceException; } namespace UnityEngine { - namespace Experimental - { - namespace UIElements - { - struct IEventHandler; - } - } + struct PrimitiveType; } namespace UnityEngine { - namespace Experimental - { - namespace UIElements - { - struct CallbackEventHandler; - } - } + struct Time; } -namespace UnityEngine +namespace MyGame { - namespace Experimental - { - namespace UIElements - { - struct Focusable; - } - } + struct AbstractBaseBallScript; } -namespace UnityEngine +namespace MyGame { - namespace Experimental - { - namespace UIElements - { - struct IStyle; - } - } + struct BaseBallScript; } +/*END TYPE DECLARATIONS*/ + +/*BEGIN TEMPLATE SPECIALIZATION DECLARATIONS*/ + +/*END TEMPLATE SPECIALIZATION DECLARATIONS*/ + +//////////////////////////////////////////////////////////////// +// C# type definitions +//////////////////////////////////////////////////////////////// namespace System { - namespace Diagnostics + struct Object : Plugin::ManagedType { - struct Stopwatch; - } -} - -namespace UnityEngine -{ - struct GameObject; -} - -namespace UnityEngine -{ - struct Debug; -} - -namespace UnityEngine -{ - namespace Assertions - { - namespace Assert - { - } - } -} - -namespace UnityEngine -{ - struct Collision; -} - -namespace UnityEngine -{ - struct Behaviour; -} - -namespace UnityEngine -{ - struct MonoBehaviour; -} - -namespace UnityEngine -{ - struct AudioSettings; -} - -namespace UnityEngine -{ - namespace Networking - { - struct NetworkTransport; - } -} - -namespace UnityEngine -{ - struct Quaternion; -} - -namespace UnityEngine -{ - struct Matrix4x4; -} - -namespace UnityEngine -{ - struct QueryTriggerInteraction; -} - -namespace System -{ - struct Exception; -} - -namespace System -{ - struct SystemException; -} - -namespace System -{ - struct NullReferenceException; -} - -namespace UnityEngine -{ - struct Screen; -} - -namespace UnityEngine -{ - struct Ray; -} - -namespace UnityEngine -{ - struct Physics; -} - -namespace UnityEngine -{ - struct Gradient; -} - -namespace System -{ - struct AppDomainSetup; -} - -namespace UnityEngine -{ - struct Application; -} - -namespace UnityEngine -{ - namespace SceneManagement - { - struct SceneManager; - } -} - -namespace UnityEngine -{ - namespace SceneManagement - { - struct Scene; - } -} - -namespace UnityEngine -{ - namespace SceneManagement - { - struct LoadSceneMode; - } -} - -namespace System -{ - struct EventArgs; -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct ComponentEventArgs; - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct ComponentChangingEventArgs; - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct ComponentChangedEventArgs; - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct ComponentRenameEventArgs; - } - } -} - -namespace System -{ - namespace ComponentModel - { - struct MemberDescriptor; - } -} - -namespace UnityEngine -{ - struct PrimitiveType; -} - -namespace UnityEngine -{ - struct Time; -} - -namespace System -{ - namespace IO - { - struct FileMode; - } -} - -namespace System -{ - struct MarshalByRefObject; -} - -namespace System -{ - namespace IO - { - struct Stream; - } -} - -namespace System -{ - struct StringComparer; -} - -namespace System -{ - struct BaseStringComparer; -} - -namespace System -{ - namespace Collections - { - struct Queue; - } -} - -namespace System -{ - namespace Collections - { - struct BaseQueue; - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct IComponentChangeService; - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct BaseIComponentChangeService; - } - } -} - -namespace System -{ - namespace IO - { - struct FileStream; - } -} - -namespace System -{ - namespace IO - { - struct BaseFileStream; - } -} - -namespace UnityEngine -{ - namespace Playables - { - struct PlayableHandle; - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - struct ITransform; - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - struct IUIElementDataWatch; - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - struct IVisualElementScheduler; - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - struct VisualElement; - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - namespace UQueryExtensions - { - } - } - } -} - -namespace UnityEngine -{ - namespace XR - { - namespace WSA - { - namespace Input - { - struct InteractionSourcePositionAccuracy; - } - } - } -} - -namespace UnityEngine -{ - namespace XR - { - namespace WSA - { - namespace Input - { - struct InteractionSourceNode; - } - } - } -} - -namespace UnityEngine -{ - namespace XR - { - namespace WSA - { - namespace Input - { - struct InteractionSourcePose; - } - } - } -} - -namespace MyGame -{ - namespace MonoBehaviours - { - struct TestScript; - } -} - -namespace MyGame -{ - namespace MonoBehaviours - { - struct AnotherScript; - } -} - -namespace System -{ - struct Action; -} - -namespace System -{ - struct AppDomainInitializer; -} - -namespace UnityEngine -{ - namespace Events - { - struct UnityAction; - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct ComponentEventHandler; - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct ComponentChangingEventHandler; - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct ComponentChangedEventHandler; - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct ComponentRenameEventHandler; - } - } -} -/*END TYPE DECLARATIONS*/ - -/*BEGIN TEMPLATE SPECIALIZATION DECLARATIONS*/ -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEqualityComparer; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEqualityComparer; - } - } -} - -namespace System -{ - template<> struct IEquatable; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct KeyValuePair; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct LinkedListNode; - } - } -} - -namespace System -{ - namespace Runtime - { - namespace CompilerServices - { - template<> struct StrongBox; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IComparer; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IComparer; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct BaseIComparer; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct BaseIComparer; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct ICollection; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct ICollection; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct ICollection; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct ICollection; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct ICollection; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct ICollection; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IList; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IList; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IList; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IList; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IList; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IList; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct List; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct List; - } - } -} - -namespace System -{ - namespace Collections - { - namespace ObjectModel - { - template<> struct Collection; - } - } -} - -namespace System -{ - namespace Collections - { - namespace ObjectModel - { - template<> struct KeyedCollection; - } - } -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_1; -} - -namespace System -{ - template<> struct Array1; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_1; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_2; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy2_2; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_3; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy2_3; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy3_3; -} - -namespace System -{ - template<> struct Array1; -} - -namespace System -{ - template<> struct Array2; -} - -namespace System -{ - template<> struct Array3; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_1; -} - -namespace System -{ - template<> struct Array1; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_1; -} - -namespace System -{ - template<> struct Array1; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_1; -} - -namespace System -{ - template<> struct Array1; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_1; -} - -namespace System -{ - template<> struct Array1; -} - -namespace System -{ - template<> struct Action1; -} - -namespace System -{ - template<> struct Action2; -} - -namespace System -{ - template<> struct Func3; -} - -namespace System -{ - template<> struct Func3; -} - -namespace UnityEngine -{ - namespace Events - { - template<> struct UnityAction2; - } -} -/*END TEMPLATE SPECIALIZATION DECLARATIONS*/ - -//////////////////////////////////////////////////////////////// -// C# type definitions -//////////////////////////////////////////////////////////////// - -namespace System -{ - struct Object : Plugin::ManagedType - { - Object(); - Object(Plugin::InternalUse iu, int32_t handle); - Object(decltype(nullptr)); - virtual ~Object() = default; - bool operator==(decltype(nullptr)) const; - bool operator!=(decltype(nullptr)) const; - virtual void ThrowReferenceToThis(); - - /*BEGIN UNBOXING METHOD DECLARATIONS*/ - explicit operator UnityEngine::Vector3(); - explicit operator UnityEngine::Color(); - explicit operator UnityEngine::GradientColorKey(); - explicit operator UnityEngine::Resolution(); - explicit operator UnityEngine::RaycastHit(); - explicit operator UnityEngine::Playables::PlayableGraph(); - explicit operator UnityEngine::Animations::AnimationMixerPlayable(); - explicit operator UnityEngine::Quaternion(); - explicit operator UnityEngine::Matrix4x4(); - explicit operator UnityEngine::QueryTriggerInteraction(); - explicit operator System::Collections::Generic::KeyValuePair(); - explicit operator UnityEngine::Ray(); - explicit operator UnityEngine::SceneManagement::Scene(); - explicit operator UnityEngine::SceneManagement::LoadSceneMode(); - explicit operator UnityEngine::PrimitiveType(); - explicit operator System::IO::FileMode(); - explicit operator UnityEngine::Playables::PlayableHandle(); - explicit operator UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy(); - explicit operator UnityEngine::XR::WSA::Input::InteractionSourceNode(); - explicit operator UnityEngine::XR::WSA::Input::InteractionSourcePose(); - explicit operator System::Boolean(); - explicit operator System::SByte(); - explicit operator System::Byte(); - explicit operator System::Int16(); - explicit operator System::UInt16(); - explicit operator System::Int32(); - explicit operator System::UInt32(); - explicit operator System::Int64(); - explicit operator System::UInt64(); - explicit operator System::Char(); - explicit operator System::Single(); - explicit operator System::Double(); - /*END UNBOXING METHOD DECLARATIONS*/ - }; - - struct ValueType : virtual Object - { - ValueType(Plugin::InternalUse iu, int32_t handle); - ValueType(decltype(nullptr)); - }; - - struct Enum : virtual ValueType - { - Enum(Plugin::InternalUse iu, int32_t handle); - Enum(decltype(nullptr)); - }; - - struct String : virtual Object - { - String(Plugin::InternalUse iu, int32_t handle); - String(decltype(nullptr)); - String(const String& other); - String(String&& other); - virtual ~String(); - String& operator=(const String& other); - String& operator=(decltype(nullptr)); - String& operator=(String&& other); - String(const char* chars); - }; - - struct ICloneable : virtual Object - { - ICloneable(Plugin::InternalUse iu, int32_t handle); - ICloneable(decltype(nullptr)); - }; - - namespace Collections - { - struct IEnumerable : virtual Object - { - IEnumerable(Plugin::InternalUse iu, int32_t handle); - IEnumerable(decltype(nullptr)); - IEnumerator GetEnumerator(); - }; - - struct ICollection : virtual IEnumerable - { - ICollection(Plugin::InternalUse iu, int32_t handle); - ICollection(decltype(nullptr)); - }; - - struct IList : virtual ICollection, virtual IEnumerable - { - IList(Plugin::InternalUse iu, int32_t handle); - IList(decltype(nullptr)); - }; - } - - struct Array : virtual ICloneable, virtual Collections::IList - { - Array(Plugin::InternalUse iu, int32_t handle); - Array(decltype(nullptr)); - int32_t GetLength(); - int32_t GetRank(); - }; -} - -//////////////////////////////////////////////////////////////// -// Global variables -//////////////////////////////////////////////////////////////// - -namespace Plugin -{ - extern System::String NullString; -} - -/*BEGIN TYPE DEFINITIONS*/ -namespace System -{ - struct IFormattable : virtual System::Object - { - IFormattable(decltype(nullptr)); - IFormattable(Plugin::InternalUse, int32_t handle); - IFormattable(const IFormattable& other); - IFormattable(IFormattable&& other); - virtual ~IFormattable(); - IFormattable& operator=(const IFormattable& other); - IFormattable& operator=(decltype(nullptr)); - IFormattable& operator=(IFormattable&& other); - bool operator==(const IFormattable& other) const; - bool operator!=(const IFormattable& other) const; - }; -} - -namespace System -{ - struct IConvertible : virtual System::Object - { - IConvertible(decltype(nullptr)); - IConvertible(Plugin::InternalUse, int32_t handle); - IConvertible(const IConvertible& other); - IConvertible(IConvertible&& other); - virtual ~IConvertible(); - IConvertible& operator=(const IConvertible& other); - IConvertible& operator=(decltype(nullptr)); - IConvertible& operator=(IConvertible&& other); - bool operator==(const IConvertible& other) const; - bool operator!=(const IConvertible& other) const; - }; -} - -namespace System -{ - struct IComparable : virtual System::Object - { - IComparable(decltype(nullptr)); - IComparable(Plugin::InternalUse, int32_t handle); - IComparable(const IComparable& other); - IComparable(IComparable&& other); - virtual ~IComparable(); - IComparable& operator=(const IComparable& other); - IComparable& operator=(decltype(nullptr)); - IComparable& operator=(IComparable&& other); - bool operator==(const IComparable& other) const; - bool operator!=(const IComparable& other) const; - System::Int32 CompareTo(System::Object& obj); - }; -} - -namespace System -{ - struct IDisposable : virtual System::Object - { - IDisposable(decltype(nullptr)); - IDisposable(Plugin::InternalUse, int32_t handle); - IDisposable(const IDisposable& other); - IDisposable(IDisposable&& other); - virtual ~IDisposable(); - IDisposable& operator=(const IDisposable& other); - IDisposable& operator=(decltype(nullptr)); - IDisposable& operator=(IDisposable&& other); - bool operator==(const IDisposable& other) const; - bool operator!=(const IDisposable& other) const; - void Dispose(); - }; -} - -namespace UnityEngine -{ - struct Vector3 - { - Vector3(); - Vector3(System::Single x, System::Single y, System::Single z); - System::Single GetMagnitude(); - System::Single x; - System::Single y; - System::Single z; - void Set(System::Single newX, System::Single newY, System::Single newZ); - UnityEngine::Vector3 operator+(UnityEngine::Vector3& a); - UnityEngine::Vector3 operator-(); - explicit operator System::ValueType(); - explicit operator System::Object(); - }; -} - -namespace UnityEngine -{ - struct Object : virtual System::Object - { - Object(decltype(nullptr)); - Object(Plugin::InternalUse, int32_t handle); - Object(const Object& other); - Object(Object&& other); - virtual ~Object(); - Object& operator=(const Object& other); - Object& operator=(decltype(nullptr)); - Object& operator=(Object&& other); - bool operator==(const Object& other) const; - bool operator!=(const Object& other) const; - System::String GetName(); - void SetName(System::String& value); - System::Boolean operator==(UnityEngine::Object& x); - operator System::Boolean(); - }; -} - -namespace UnityEngine -{ - struct Component : virtual UnityEngine::Object - { - Component(decltype(nullptr)); - Component(Plugin::InternalUse, int32_t handle); - Component(const Component& other); - Component(Component&& other); - virtual ~Component(); - Component& operator=(const Component& other); - Component& operator=(decltype(nullptr)); - Component& operator=(Component&& other); - bool operator==(const Component& other) const; - bool operator!=(const Component& other) const; - UnityEngine::Transform GetTransform(); - }; -} - -namespace UnityEngine -{ - struct Transform : virtual UnityEngine::Component, virtual System::Collections::IEnumerable - { - Transform(decltype(nullptr)); - Transform(Plugin::InternalUse, int32_t handle); - Transform(const Transform& other); - Transform(Transform&& other); - virtual ~Transform(); - Transform& operator=(const Transform& other); - Transform& operator=(decltype(nullptr)); - Transform& operator=(Transform&& other); - bool operator==(const Transform& other) const; - bool operator!=(const Transform& other) const; - UnityEngine::Vector3 GetPosition(); - void SetPosition(UnityEngine::Vector3& value); - void SetParent(UnityEngine::Transform& parent); - }; -} - -namespace UnityEngine -{ - struct Color - { - Color(); - System::Single r; - System::Single g; - System::Single b; - System::Single a; - explicit operator System::ValueType(); - explicit operator System::Object(); - }; -} - -namespace UnityEngine -{ - struct GradientColorKey - { - GradientColorKey(); - UnityEngine::Color color; - System::Single time; - explicit operator System::ValueType(); - explicit operator System::Object(); - }; -} - -namespace UnityEngine -{ - struct Resolution : Plugin::ManagedType - { - Resolution(decltype(nullptr)); - Resolution(Plugin::InternalUse, int32_t handle); - Resolution(const Resolution& other); - Resolution(Resolution&& other); - virtual ~Resolution(); - Resolution& operator=(const Resolution& other); - Resolution& operator=(decltype(nullptr)); - Resolution& operator=(Resolution&& other); - bool operator==(const Resolution& other) const; - bool operator!=(const Resolution& other) const; - Resolution(); - System::Int32 GetWidth(); - void SetWidth(System::Int32 value); - System::Int32 GetHeight(); - void SetHeight(System::Int32 value); - System::Int32 GetRefreshRate(); - void SetRefreshRate(System::Int32 value); - explicit operator System::ValueType(); - explicit operator System::Object(); - }; -} - -namespace UnityEngine -{ - struct RaycastHit : Plugin::ManagedType - { - RaycastHit(decltype(nullptr)); - RaycastHit(Plugin::InternalUse, int32_t handle); - RaycastHit(const RaycastHit& other); - RaycastHit(RaycastHit&& other); - virtual ~RaycastHit(); - RaycastHit& operator=(const RaycastHit& other); - RaycastHit& operator=(decltype(nullptr)); - RaycastHit& operator=(RaycastHit&& other); - bool operator==(const RaycastHit& other) const; - bool operator!=(const RaycastHit& other) const; - UnityEngine::Vector3 GetPoint(); - void SetPoint(UnityEngine::Vector3& value); - UnityEngine::Transform GetTransform(); - explicit operator System::ValueType(); - explicit operator System::Object(); - }; -} - -namespace System -{ - namespace Collections - { - struct IEnumerator : virtual System::Object - { - IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr)); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - System::Object GetCurrent(); - System::Boolean MoveNext(); - }; - } -} - -namespace System -{ - namespace Runtime - { - namespace Serialization - { - struct ISerializable : virtual System::Object - { - ISerializable(decltype(nullptr)); - ISerializable(Plugin::InternalUse, int32_t handle); - ISerializable(const ISerializable& other); - ISerializable(ISerializable&& other); - virtual ~ISerializable(); - ISerializable& operator=(const ISerializable& other); - ISerializable& operator=(decltype(nullptr)); - ISerializable& operator=(ISerializable&& other); - bool operator==(const ISerializable& other) const; - bool operator!=(const ISerializable& other) const; - }; - } - } -} - -namespace System -{ - namespace Runtime - { - namespace InteropServices - { - struct _Exception : virtual System::Object - { - _Exception(decltype(nullptr)); - _Exception(Plugin::InternalUse, int32_t handle); - _Exception(const _Exception& other); - _Exception(_Exception&& other); - virtual ~_Exception(); - _Exception& operator=(const _Exception& other); - _Exception& operator=(decltype(nullptr)); - _Exception& operator=(_Exception&& other); - bool operator==(const _Exception& other) const; - bool operator!=(const _Exception& other) const; - }; - } - } -} - -namespace System -{ - struct IAppDomainSetup : virtual System::Object - { - IAppDomainSetup(decltype(nullptr)); - IAppDomainSetup(Plugin::InternalUse, int32_t handle); - IAppDomainSetup(const IAppDomainSetup& other); - IAppDomainSetup(IAppDomainSetup&& other); - virtual ~IAppDomainSetup(); - IAppDomainSetup& operator=(const IAppDomainSetup& other); - IAppDomainSetup& operator=(decltype(nullptr)); - IAppDomainSetup& operator=(IAppDomainSetup&& other); - bool operator==(const IAppDomainSetup& other) const; - bool operator!=(const IAppDomainSetup& other) const; - }; -} - -namespace System -{ - namespace Collections - { - struct IComparer : virtual System::Object - { - IComparer(decltype(nullptr)); - IComparer(Plugin::InternalUse, int32_t handle); - IComparer(const IComparer& other); - IComparer(IComparer&& other); - virtual ~IComparer(); - IComparer& operator=(const IComparer& other); - IComparer& operator=(decltype(nullptr)); - IComparer& operator=(IComparer&& other); - bool operator==(const IComparer& other) const; - bool operator!=(const IComparer& other) const; - }; - } -} - -namespace System -{ - namespace Collections - { - struct IEqualityComparer : virtual System::Object - { - IEqualityComparer(decltype(nullptr)); - IEqualityComparer(Plugin::InternalUse, int32_t handle); - IEqualityComparer(const IEqualityComparer& other); - IEqualityComparer(IEqualityComparer&& other); - virtual ~IEqualityComparer(); - IEqualityComparer& operator=(const IEqualityComparer& other); - IEqualityComparer& operator=(decltype(nullptr)); - IEqualityComparer& operator=(IEqualityComparer&& other); - bool operator==(const IEqualityComparer& other) const; - bool operator!=(const IEqualityComparer& other) const; - }; - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEqualityComparer : virtual System::Object - { - IEqualityComparer(decltype(nullptr)); - IEqualityComparer(Plugin::InternalUse, int32_t handle); - IEqualityComparer(const IEqualityComparer& other); - IEqualityComparer(IEqualityComparer&& other); - virtual ~IEqualityComparer(); - IEqualityComparer& operator=(const IEqualityComparer& other); - IEqualityComparer& operator=(decltype(nullptr)); - IEqualityComparer& operator=(IEqualityComparer&& other); - bool operator==(const IEqualityComparer& other) const; - bool operator!=(const IEqualityComparer& other) const; - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEqualityComparer : virtual System::Object - { - IEqualityComparer(decltype(nullptr)); - IEqualityComparer(Plugin::InternalUse, int32_t handle); - IEqualityComparer(const IEqualityComparer& other); - IEqualityComparer(IEqualityComparer&& other); - virtual ~IEqualityComparer(); - IEqualityComparer& operator=(const IEqualityComparer& other); - IEqualityComparer& operator=(decltype(nullptr)); - IEqualityComparer& operator=(IEqualityComparer&& other); - bool operator==(const IEqualityComparer& other) const; - bool operator!=(const IEqualityComparer& other) const; - }; - } - } -} - -namespace UnityEngine -{ - namespace Playables - { - struct PlayableGraph : Plugin::ManagedType - { - PlayableGraph(decltype(nullptr)); - PlayableGraph(Plugin::InternalUse, int32_t handle); - PlayableGraph(const PlayableGraph& other); - PlayableGraph(PlayableGraph&& other); - virtual ~PlayableGraph(); - PlayableGraph& operator=(const PlayableGraph& other); - PlayableGraph& operator=(decltype(nullptr)); - PlayableGraph& operator=(PlayableGraph&& other); - bool operator==(const PlayableGraph& other) const; - bool operator!=(const PlayableGraph& other) const; - explicit operator System::ValueType(); - explicit operator System::Object(); - }; - } -} - -namespace UnityEngine -{ - namespace Playables - { - struct IPlayable : virtual System::Object - { - IPlayable(decltype(nullptr)); - IPlayable(Plugin::InternalUse, int32_t handle); - IPlayable(const IPlayable& other); - IPlayable(IPlayable&& other); - virtual ~IPlayable(); - IPlayable& operator=(const IPlayable& other); - IPlayable& operator=(decltype(nullptr)); - IPlayable& operator=(IPlayable&& other); - bool operator==(const IPlayable& other) const; - bool operator!=(const IPlayable& other) const; - }; - } -} - -namespace System -{ - template<> struct IEquatable : virtual System::Object - { - IEquatable(decltype(nullptr)); - IEquatable(Plugin::InternalUse, int32_t handle); - IEquatable(const IEquatable& other); - IEquatable(IEquatable&& other); - virtual ~IEquatable(); - IEquatable& operator=(const IEquatable& other); - IEquatable& operator=(decltype(nullptr)); - IEquatable& operator=(IEquatable&& other); - bool operator==(const IEquatable& other) const; - bool operator!=(const IEquatable& other) const; - }; -} - -namespace UnityEngine -{ - namespace Animations - { - struct AnimationMixerPlayable : Plugin::ManagedType - { - AnimationMixerPlayable(decltype(nullptr)); - AnimationMixerPlayable(Plugin::InternalUse, int32_t handle); - AnimationMixerPlayable(const AnimationMixerPlayable& other); - AnimationMixerPlayable(AnimationMixerPlayable&& other); - virtual ~AnimationMixerPlayable(); - AnimationMixerPlayable& operator=(const AnimationMixerPlayable& other); - AnimationMixerPlayable& operator=(decltype(nullptr)); - AnimationMixerPlayable& operator=(AnimationMixerPlayable&& other); - bool operator==(const AnimationMixerPlayable& other) const; - bool operator!=(const AnimationMixerPlayable& other) const; - static UnityEngine::Animations::AnimationMixerPlayable Create(UnityEngine::Playables::PlayableGraph& graph, System::Int32 inputCount = 0, System::Boolean normalizeWeights = false); - explicit operator System::ValueType(); - explicit operator System::Object(); - explicit operator UnityEngine::Playables::IPlayable(); - explicit operator System::IEquatable(); - }; - } -} - -namespace System -{ - namespace Runtime - { - namespace CompilerServices - { - struct IStrongBox : virtual System::Object - { - IStrongBox(decltype(nullptr)); - IStrongBox(Plugin::InternalUse, int32_t handle); - IStrongBox(const IStrongBox& other); - IStrongBox(IStrongBox&& other); - virtual ~IStrongBox(); - IStrongBox& operator=(const IStrongBox& other); - IStrongBox& operator=(decltype(nullptr)); - IStrongBox& operator=(IStrongBox&& other); - bool operator==(const IStrongBox& other) const; - bool operator!=(const IStrongBox& other) const; - }; - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - struct IEventHandler : virtual System::Object - { - IEventHandler(decltype(nullptr)); - IEventHandler(Plugin::InternalUse, int32_t handle); - IEventHandler(const IEventHandler& other); - IEventHandler(IEventHandler&& other); - virtual ~IEventHandler(); - IEventHandler& operator=(const IEventHandler& other); - IEventHandler& operator=(decltype(nullptr)); - IEventHandler& operator=(IEventHandler&& other); - bool operator==(const IEventHandler& other) const; - bool operator!=(const IEventHandler& other) const; - }; - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - struct CallbackEventHandler : virtual UnityEngine::Experimental::UIElements::IEventHandler - { - CallbackEventHandler(decltype(nullptr)); - CallbackEventHandler(Plugin::InternalUse, int32_t handle); - CallbackEventHandler(const CallbackEventHandler& other); - CallbackEventHandler(CallbackEventHandler&& other); - virtual ~CallbackEventHandler(); - CallbackEventHandler& operator=(const CallbackEventHandler& other); - CallbackEventHandler& operator=(decltype(nullptr)); - CallbackEventHandler& operator=(CallbackEventHandler&& other); - bool operator==(const CallbackEventHandler& other) const; - bool operator!=(const CallbackEventHandler& other) const; - }; - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - struct Focusable : virtual UnityEngine::Experimental::UIElements::CallbackEventHandler, virtual UnityEngine::Experimental::UIElements::IEventHandler - { - Focusable(decltype(nullptr)); - Focusable(Plugin::InternalUse, int32_t handle); - Focusable(const Focusable& other); - Focusable(Focusable&& other); - virtual ~Focusable(); - Focusable& operator=(const Focusable& other); - Focusable& operator=(decltype(nullptr)); - Focusable& operator=(Focusable&& other); - bool operator==(const Focusable& other) const; - bool operator!=(const Focusable& other) const; - }; - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - struct IStyle : virtual System::Object - { - IStyle(decltype(nullptr)); - IStyle(Plugin::InternalUse, int32_t handle); - IStyle(const IStyle& other); - IStyle(IStyle&& other); - virtual ~IStyle(); - IStyle& operator=(const IStyle& other); - IStyle& operator=(decltype(nullptr)); - IStyle& operator=(IStyle&& other); - bool operator==(const IStyle& other) const; - bool operator!=(const IStyle& other) const; - }; - } - } -} - -namespace System -{ - namespace Diagnostics - { - struct Stopwatch : virtual System::Object - { - Stopwatch(decltype(nullptr)); - Stopwatch(Plugin::InternalUse, int32_t handle); - Stopwatch(const Stopwatch& other); - Stopwatch(Stopwatch&& other); - virtual ~Stopwatch(); - Stopwatch& operator=(const Stopwatch& other); - Stopwatch& operator=(decltype(nullptr)); - Stopwatch& operator=(Stopwatch&& other); - bool operator==(const Stopwatch& other) const; - bool operator!=(const Stopwatch& other) const; - Stopwatch(); - System::Int64 GetElapsedMilliseconds(); - void Start(); - void Reset(); - }; - } -} - -namespace UnityEngine -{ - struct GameObject : virtual UnityEngine::Object - { - GameObject(decltype(nullptr)); - GameObject(Plugin::InternalUse, int32_t handle); - GameObject(const GameObject& other); - GameObject(GameObject&& other); - virtual ~GameObject(); - GameObject& operator=(const GameObject& other); - GameObject& operator=(decltype(nullptr)); - GameObject& operator=(GameObject&& other); - bool operator==(const GameObject& other) const; - bool operator!=(const GameObject& other) const; - GameObject(); - GameObject(System::String& name); - UnityEngine::Transform GetTransform(); - template MT0 AddComponent(); - static UnityEngine::GameObject CreatePrimitive(UnityEngine::PrimitiveType type); - }; -} - -namespace UnityEngine -{ - struct Debug : virtual System::Object - { - Debug(decltype(nullptr)); - Debug(Plugin::InternalUse, int32_t handle); - Debug(const Debug& other); - Debug(Debug&& other); - virtual ~Debug(); - Debug& operator=(const Debug& other); - Debug& operator=(decltype(nullptr)); - Debug& operator=(Debug&& other); - bool operator==(const Debug& other) const; - bool operator!=(const Debug& other) const; - static void Log(System::Object& message); - }; -} - -namespace UnityEngine -{ - namespace Assertions - { - namespace Assert - { - System::Boolean GetRaiseExceptions(); - void SetRaiseExceptions(System::Boolean value); - template void AreEqual(MT0& expected, MT0& actual); - } - } -} - -namespace UnityEngine -{ - struct Collision : virtual System::Object - { - Collision(decltype(nullptr)); - Collision(Plugin::InternalUse, int32_t handle); - Collision(const Collision& other); - Collision(Collision&& other); - virtual ~Collision(); - Collision& operator=(const Collision& other); - Collision& operator=(decltype(nullptr)); - Collision& operator=(Collision&& other); - bool operator==(const Collision& other) const; - bool operator!=(const Collision& other) const; - }; -} - -namespace UnityEngine -{ - struct Behaviour : virtual UnityEngine::Component - { - Behaviour(decltype(nullptr)); - Behaviour(Plugin::InternalUse, int32_t handle); - Behaviour(const Behaviour& other); - Behaviour(Behaviour&& other); - virtual ~Behaviour(); - Behaviour& operator=(const Behaviour& other); - Behaviour& operator=(decltype(nullptr)); - Behaviour& operator=(Behaviour&& other); - bool operator==(const Behaviour& other) const; - bool operator!=(const Behaviour& other) const; - }; -} - -namespace UnityEngine -{ - struct MonoBehaviour : virtual UnityEngine::Behaviour - { - MonoBehaviour(decltype(nullptr)); - MonoBehaviour(Plugin::InternalUse, int32_t handle); - MonoBehaviour(const MonoBehaviour& other); - MonoBehaviour(MonoBehaviour&& other); - virtual ~MonoBehaviour(); - MonoBehaviour& operator=(const MonoBehaviour& other); - MonoBehaviour& operator=(decltype(nullptr)); - MonoBehaviour& operator=(MonoBehaviour&& other); - bool operator==(const MonoBehaviour& other) const; - bool operator!=(const MonoBehaviour& other) const; - UnityEngine::Transform GetTransform(); - }; -} - -namespace UnityEngine -{ - struct AudioSettings : virtual System::Object - { - AudioSettings(decltype(nullptr)); - AudioSettings(Plugin::InternalUse, int32_t handle); - AudioSettings(const AudioSettings& other); - AudioSettings(AudioSettings&& other); - virtual ~AudioSettings(); - AudioSettings& operator=(const AudioSettings& other); - AudioSettings& operator=(decltype(nullptr)); - AudioSettings& operator=(AudioSettings&& other); - bool operator==(const AudioSettings& other) const; - bool operator!=(const AudioSettings& other) const; - static void GetDSPBufferSize(System::Int32* bufferLength, System::Int32* numBuffers); - }; -} - -namespace UnityEngine -{ - namespace Networking - { - struct NetworkTransport : virtual System::Object - { - NetworkTransport(decltype(nullptr)); - NetworkTransport(Plugin::InternalUse, int32_t handle); - NetworkTransport(const NetworkTransport& other); - NetworkTransport(NetworkTransport&& other); - virtual ~NetworkTransport(); - NetworkTransport& operator=(const NetworkTransport& other); - NetworkTransport& operator=(decltype(nullptr)); - NetworkTransport& operator=(NetworkTransport&& other); - bool operator==(const NetworkTransport& other) const; - bool operator!=(const NetworkTransport& other) const; - static void GetBroadcastConnectionInfo(System::Int32 hostId, System::String* address, System::Int32* port, System::Byte* error); - static void Init(); - }; - } -} - -namespace UnityEngine -{ - struct Quaternion - { - Quaternion(); - System::Single x; - System::Single y; - System::Single z; - System::Single w; - explicit operator System::ValueType(); - explicit operator System::Object(); - }; -} - -namespace UnityEngine -{ - struct Matrix4x4 - { - Matrix4x4(); - System::Single GetItem(System::Int32 row, System::Int32 column); - void SetItem(System::Int32 row, System::Int32 column, System::Single value); - System::Single m00; - System::Single m10; - System::Single m20; - System::Single m30; - System::Single m01; - System::Single m11; - System::Single m21; - System::Single m31; - System::Single m02; - System::Single m12; - System::Single m22; - System::Single m32; - System::Single m03; - System::Single m13; - System::Single m23; - System::Single m33; - explicit operator System::ValueType(); - explicit operator System::Object(); - }; -} - -namespace UnityEngine -{ - struct QueryTriggerInteraction - { - int32_t Value; - static const UnityEngine::QueryTriggerInteraction UseGlobal; - static const UnityEngine::QueryTriggerInteraction Ignore; - static const UnityEngine::QueryTriggerInteraction Collide; - explicit QueryTriggerInteraction(int32_t value); - explicit operator int32_t() const; - bool operator==(QueryTriggerInteraction other); - bool operator!=(QueryTriggerInteraction other); - explicit operator System::Enum(); - explicit operator System::ValueType(); - explicit operator System::Object(); - explicit operator System::IFormattable(); - explicit operator System::IConvertible(); - explicit operator System::IComparable(); - }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct KeyValuePair : Plugin::ManagedType - { - KeyValuePair(decltype(nullptr)); - KeyValuePair(Plugin::InternalUse, int32_t handle); - KeyValuePair(const KeyValuePair& other); - KeyValuePair(KeyValuePair&& other); - virtual ~KeyValuePair(); - KeyValuePair& operator=(const KeyValuePair& other); - KeyValuePair& operator=(decltype(nullptr)); - KeyValuePair& operator=(KeyValuePair&& other); - bool operator==(const KeyValuePair& other) const; - bool operator!=(const KeyValuePair& other) const; - KeyValuePair(System::String& key, System::Double value); - System::String GetKey(); - System::Double GetValue(); - explicit operator System::ValueType(); - explicit operator System::Object(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct LinkedListNode : virtual System::Object - { - LinkedListNode(decltype(nullptr)); - LinkedListNode(Plugin::InternalUse, int32_t handle); - LinkedListNode(const LinkedListNode& other); - LinkedListNode(LinkedListNode&& other); - virtual ~LinkedListNode(); - LinkedListNode& operator=(const LinkedListNode& other); - LinkedListNode& operator=(decltype(nullptr)); - LinkedListNode& operator=(LinkedListNode&& other); - bool operator==(const LinkedListNode& other) const; - bool operator!=(const LinkedListNode& other) const; - LinkedListNode(System::String& value); - System::String GetValue(); - void SetValue(System::String& value); - }; - } - } -} - -namespace System -{ - namespace Runtime - { - namespace CompilerServices - { - template<> struct StrongBox : virtual System::Runtime::CompilerServices::IStrongBox - { - StrongBox(decltype(nullptr)); - StrongBox(Plugin::InternalUse, int32_t handle); - StrongBox(const StrongBox& other); - StrongBox(StrongBox&& other); - virtual ~StrongBox(); - StrongBox& operator=(const StrongBox& other); - StrongBox& operator=(decltype(nullptr)); - StrongBox& operator=(StrongBox&& other); - bool operator==(const StrongBox& other) const; - bool operator!=(const StrongBox& other) const; - StrongBox(System::String& value); - System::String GetValue(); - void SetValue(System::String& value); - }; - } - } -} - -namespace System -{ - struct Exception : virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable - { - Exception(decltype(nullptr)); - Exception(Plugin::InternalUse, int32_t handle); - Exception(const Exception& other); - Exception(Exception&& other); - virtual ~Exception(); - Exception& operator=(const Exception& other); - Exception& operator=(decltype(nullptr)); - Exception& operator=(Exception&& other); - bool operator==(const Exception& other) const; - bool operator!=(const Exception& other) const; - Exception(System::String& message); - }; -} - -namespace System -{ - struct SystemException : virtual System::Exception, virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable - { - SystemException(decltype(nullptr)); - SystemException(Plugin::InternalUse, int32_t handle); - SystemException(const SystemException& other); - SystemException(SystemException&& other); - virtual ~SystemException(); - SystemException& operator=(const SystemException& other); - SystemException& operator=(decltype(nullptr)); - SystemException& operator=(SystemException&& other); - bool operator==(const SystemException& other) const; - bool operator!=(const SystemException& other) const; - }; -} - -namespace System -{ - struct NullReferenceException : virtual System::SystemException, virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable - { - NullReferenceException(decltype(nullptr)); - NullReferenceException(Plugin::InternalUse, int32_t handle); - NullReferenceException(const NullReferenceException& other); - NullReferenceException(NullReferenceException&& other); - virtual ~NullReferenceException(); - NullReferenceException& operator=(const NullReferenceException& other); - NullReferenceException& operator=(decltype(nullptr)); - NullReferenceException& operator=(NullReferenceException&& other); - bool operator==(const NullReferenceException& other) const; - bool operator!=(const NullReferenceException& other) const; - }; -} - -namespace UnityEngine -{ - struct Screen : virtual System::Object - { - Screen(decltype(nullptr)); - Screen(Plugin::InternalUse, int32_t handle); - Screen(const Screen& other); - Screen(Screen&& other); - virtual ~Screen(); - Screen& operator=(const Screen& other); - Screen& operator=(decltype(nullptr)); - Screen& operator=(Screen&& other); - bool operator==(const Screen& other) const; - bool operator!=(const Screen& other) const; - static System::Array1 GetResolutions(); - }; -} - -namespace UnityEngine -{ - struct Ray : Plugin::ManagedType - { - Ray(decltype(nullptr)); - Ray(Plugin::InternalUse, int32_t handle); - Ray(const Ray& other); - Ray(Ray&& other); - virtual ~Ray(); - Ray& operator=(const Ray& other); - Ray& operator=(decltype(nullptr)); - Ray& operator=(Ray&& other); - bool operator==(const Ray& other) const; - bool operator!=(const Ray& other) const; - Ray(UnityEngine::Vector3& origin, UnityEngine::Vector3& direction); - explicit operator System::ValueType(); - explicit operator System::Object(); - }; -} - -namespace UnityEngine -{ - struct Physics : virtual System::Object - { - Physics(decltype(nullptr)); - Physics(Plugin::InternalUse, int32_t handle); - Physics(const Physics& other); - Physics(Physics&& other); - virtual ~Physics(); - Physics& operator=(const Physics& other); - Physics& operator=(decltype(nullptr)); - Physics& operator=(Physics&& other); - bool operator==(const Physics& other) const; - bool operator!=(const Physics& other) const; - static System::Int32 RaycastNonAlloc(UnityEngine::Ray& ray, System::Array1& results); - static System::Array1 RaycastAll(UnityEngine::Ray& ray); - }; -} - -namespace UnityEngine -{ - struct Gradient : virtual System::Object - { - Gradient(decltype(nullptr)); - Gradient(Plugin::InternalUse, int32_t handle); - Gradient(const Gradient& other); - Gradient(Gradient&& other); - virtual ~Gradient(); - Gradient& operator=(const Gradient& other); - Gradient& operator=(decltype(nullptr)); - Gradient& operator=(Gradient&& other); - bool operator==(const Gradient& other) const; - bool operator!=(const Gradient& other) const; - Gradient(); - System::Array1 GetColorKeys(); - void SetColorKeys(System::Array1& value); - }; -} - -namespace System -{ - struct AppDomainSetup : virtual System::IAppDomainSetup - { - AppDomainSetup(decltype(nullptr)); - AppDomainSetup(Plugin::InternalUse, int32_t handle); - AppDomainSetup(const AppDomainSetup& other); - AppDomainSetup(AppDomainSetup&& other); - virtual ~AppDomainSetup(); - AppDomainSetup& operator=(const AppDomainSetup& other); - AppDomainSetup& operator=(decltype(nullptr)); - AppDomainSetup& operator=(AppDomainSetup&& other); - bool operator==(const AppDomainSetup& other) const; - bool operator!=(const AppDomainSetup& other) const; - AppDomainSetup(); - System::AppDomainInitializer GetAppDomainInitializer(); - void SetAppDomainInitializer(System::AppDomainInitializer& value); - }; -} - -namespace UnityEngine -{ - struct Application : virtual System::Object - { - Application(decltype(nullptr)); - Application(Plugin::InternalUse, int32_t handle); - Application(const Application& other); - Application(Application&& other); - virtual ~Application(); - Application& operator=(const Application& other); - Application& operator=(decltype(nullptr)); - Application& operator=(Application&& other); - bool operator==(const Application& other) const; - bool operator!=(const Application& other) const; - static void AddOnBeforeRender(UnityEngine::Events::UnityAction& del); - static void RemoveOnBeforeRender(UnityEngine::Events::UnityAction& del); - }; -} - -namespace UnityEngine -{ - namespace SceneManagement - { - struct SceneManager : virtual System::Object - { - SceneManager(decltype(nullptr)); - SceneManager(Plugin::InternalUse, int32_t handle); - SceneManager(const SceneManager& other); - SceneManager(SceneManager&& other); - virtual ~SceneManager(); - SceneManager& operator=(const SceneManager& other); - SceneManager& operator=(decltype(nullptr)); - SceneManager& operator=(SceneManager&& other); - bool operator==(const SceneManager& other) const; - bool operator!=(const SceneManager& other) const; - static void AddSceneLoaded(UnityEngine::Events::UnityAction2& del); - static void RemoveSceneLoaded(UnityEngine::Events::UnityAction2& del); - }; - } -} - -namespace UnityEngine -{ - namespace SceneManagement - { - struct Scene : Plugin::ManagedType - { - Scene(decltype(nullptr)); - Scene(Plugin::InternalUse, int32_t handle); - Scene(const Scene& other); - Scene(Scene&& other); - virtual ~Scene(); - Scene& operator=(const Scene& other); - Scene& operator=(decltype(nullptr)); - Scene& operator=(Scene&& other); - bool operator==(const Scene& other) const; - bool operator!=(const Scene& other) const; - explicit operator System::ValueType(); - explicit operator System::Object(); - }; - } -} - -namespace UnityEngine -{ - namespace SceneManagement - { - struct LoadSceneMode - { - int32_t Value; - static const UnityEngine::SceneManagement::LoadSceneMode Single; - static const UnityEngine::SceneManagement::LoadSceneMode Additive; - explicit LoadSceneMode(int32_t value); - explicit operator int32_t() const; - bool operator==(LoadSceneMode other); - bool operator!=(LoadSceneMode other); - explicit operator System::Enum(); - explicit operator System::ValueType(); - explicit operator System::Object(); - explicit operator System::IFormattable(); - explicit operator System::IConvertible(); - explicit operator System::IComparable(); - }; - } -} - -namespace System -{ - struct EventArgs : virtual System::Object - { - EventArgs(decltype(nullptr)); - EventArgs(Plugin::InternalUse, int32_t handle); - EventArgs(const EventArgs& other); - EventArgs(EventArgs&& other); - virtual ~EventArgs(); - EventArgs& operator=(const EventArgs& other); - EventArgs& operator=(decltype(nullptr)); - EventArgs& operator=(EventArgs&& other); - bool operator==(const EventArgs& other) const; - bool operator!=(const EventArgs& other) const; - }; -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct ComponentEventArgs : virtual System::EventArgs - { - ComponentEventArgs(decltype(nullptr)); - ComponentEventArgs(Plugin::InternalUse, int32_t handle); - ComponentEventArgs(const ComponentEventArgs& other); - ComponentEventArgs(ComponentEventArgs&& other); - virtual ~ComponentEventArgs(); - ComponentEventArgs& operator=(const ComponentEventArgs& other); - ComponentEventArgs& operator=(decltype(nullptr)); - ComponentEventArgs& operator=(ComponentEventArgs&& other); - bool operator==(const ComponentEventArgs& other) const; - bool operator!=(const ComponentEventArgs& other) const; - }; - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct ComponentChangingEventArgs : virtual System::EventArgs - { - ComponentChangingEventArgs(decltype(nullptr)); - ComponentChangingEventArgs(Plugin::InternalUse, int32_t handle); - ComponentChangingEventArgs(const ComponentChangingEventArgs& other); - ComponentChangingEventArgs(ComponentChangingEventArgs&& other); - virtual ~ComponentChangingEventArgs(); - ComponentChangingEventArgs& operator=(const ComponentChangingEventArgs& other); - ComponentChangingEventArgs& operator=(decltype(nullptr)); - ComponentChangingEventArgs& operator=(ComponentChangingEventArgs&& other); - bool operator==(const ComponentChangingEventArgs& other) const; - bool operator!=(const ComponentChangingEventArgs& other) const; - }; - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct ComponentChangedEventArgs : virtual System::EventArgs - { - ComponentChangedEventArgs(decltype(nullptr)); - ComponentChangedEventArgs(Plugin::InternalUse, int32_t handle); - ComponentChangedEventArgs(const ComponentChangedEventArgs& other); - ComponentChangedEventArgs(ComponentChangedEventArgs&& other); - virtual ~ComponentChangedEventArgs(); - ComponentChangedEventArgs& operator=(const ComponentChangedEventArgs& other); - ComponentChangedEventArgs& operator=(decltype(nullptr)); - ComponentChangedEventArgs& operator=(ComponentChangedEventArgs&& other); - bool operator==(const ComponentChangedEventArgs& other) const; - bool operator!=(const ComponentChangedEventArgs& other) const; - }; - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct ComponentRenameEventArgs : virtual System::EventArgs - { - ComponentRenameEventArgs(decltype(nullptr)); - ComponentRenameEventArgs(Plugin::InternalUse, int32_t handle); - ComponentRenameEventArgs(const ComponentRenameEventArgs& other); - ComponentRenameEventArgs(ComponentRenameEventArgs&& other); - virtual ~ComponentRenameEventArgs(); - ComponentRenameEventArgs& operator=(const ComponentRenameEventArgs& other); - ComponentRenameEventArgs& operator=(decltype(nullptr)); - ComponentRenameEventArgs& operator=(ComponentRenameEventArgs&& other); - bool operator==(const ComponentRenameEventArgs& other) const; - bool operator!=(const ComponentRenameEventArgs& other) const; - }; - } - } -} - -namespace System -{ - namespace ComponentModel - { - struct MemberDescriptor : virtual System::Object - { - MemberDescriptor(decltype(nullptr)); - MemberDescriptor(Plugin::InternalUse, int32_t handle); - MemberDescriptor(const MemberDescriptor& other); - MemberDescriptor(MemberDescriptor&& other); - virtual ~MemberDescriptor(); - MemberDescriptor& operator=(const MemberDescriptor& other); - MemberDescriptor& operator=(decltype(nullptr)); - MemberDescriptor& operator=(MemberDescriptor&& other); - bool operator==(const MemberDescriptor& other) const; - bool operator!=(const MemberDescriptor& other) const; - }; - } -} - -namespace UnityEngine -{ - struct PrimitiveType - { - int32_t Value; - static const UnityEngine::PrimitiveType Sphere; - static const UnityEngine::PrimitiveType Capsule; - static const UnityEngine::PrimitiveType Cylinder; - static const UnityEngine::PrimitiveType Cube; - static const UnityEngine::PrimitiveType Plane; - static const UnityEngine::PrimitiveType Quad; - explicit PrimitiveType(int32_t value); - explicit operator int32_t() const; - bool operator==(PrimitiveType other); - bool operator!=(PrimitiveType other); - explicit operator System::Enum(); - explicit operator System::ValueType(); - explicit operator System::Object(); - explicit operator System::IFormattable(); - explicit operator System::IConvertible(); - explicit operator System::IComparable(); - }; -} - -namespace UnityEngine -{ - struct Time : virtual System::Object - { - Time(decltype(nullptr)); - Time(Plugin::InternalUse, int32_t handle); - Time(const Time& other); - Time(Time&& other); - virtual ~Time(); - Time& operator=(const Time& other); - Time& operator=(decltype(nullptr)); - Time& operator=(Time&& other); - bool operator==(const Time& other) const; - bool operator!=(const Time& other) const; - static System::Single GetDeltaTime(); - }; -} - -namespace System -{ - namespace IO - { - struct FileMode - { - int32_t Value; - static const System::IO::FileMode CreateNew; - static const System::IO::FileMode Create; - static const System::IO::FileMode Open; - static const System::IO::FileMode OpenOrCreate; - static const System::IO::FileMode Truncate; - static const System::IO::FileMode Append; - explicit FileMode(int32_t value); - explicit operator int32_t() const; - bool operator==(FileMode other); - bool operator!=(FileMode other); - explicit operator System::Enum(); - explicit operator System::ValueType(); - explicit operator System::Object(); - explicit operator System::IFormattable(); - explicit operator System::IConvertible(); - explicit operator System::IComparable(); - }; - } -} - -namespace System -{ - struct MarshalByRefObject : virtual System::Object - { - MarshalByRefObject(decltype(nullptr)); - MarshalByRefObject(Plugin::InternalUse, int32_t handle); - MarshalByRefObject(const MarshalByRefObject& other); - MarshalByRefObject(MarshalByRefObject&& other); - virtual ~MarshalByRefObject(); - MarshalByRefObject& operator=(const MarshalByRefObject& other); - MarshalByRefObject& operator=(decltype(nullptr)); - MarshalByRefObject& operator=(MarshalByRefObject&& other); - bool operator==(const MarshalByRefObject& other) const; - bool operator!=(const MarshalByRefObject& other) const; - }; -} - -namespace System -{ - namespace IO - { - struct Stream : virtual System::MarshalByRefObject, virtual System::IDisposable - { - Stream(decltype(nullptr)); - Stream(Plugin::InternalUse, int32_t handle); - Stream(const Stream& other); - Stream(Stream&& other); - virtual ~Stream(); - Stream& operator=(const Stream& other); - Stream& operator=(decltype(nullptr)); - Stream& operator=(Stream&& other); - bool operator==(const Stream& other) const; - bool operator!=(const Stream& other) const; - }; - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IComparer : virtual System::Object - { - IComparer(decltype(nullptr)); - IComparer(Plugin::InternalUse, int32_t handle); - IComparer(const IComparer& other); - IComparer(IComparer&& other); - virtual ~IComparer(); - IComparer& operator=(const IComparer& other); - IComparer& operator=(decltype(nullptr)); - IComparer& operator=(IComparer&& other); - bool operator==(const IComparer& other) const; - bool operator!=(const IComparer& other) const; - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IComparer : virtual System::Object - { - IComparer(decltype(nullptr)); - IComparer(Plugin::InternalUse, int32_t handle); - IComparer(const IComparer& other); - IComparer(IComparer&& other); - virtual ~IComparer(); - IComparer& operator=(const IComparer& other); - IComparer& operator=(decltype(nullptr)); - IComparer& operator=(IComparer&& other); - bool operator==(const IComparer& other) const; - bool operator!=(const IComparer& other) const; - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct BaseIComparer : virtual System::Collections::Generic::IComparer - { - BaseIComparer(decltype(nullptr)); - BaseIComparer(Plugin::InternalUse, int32_t handle); - BaseIComparer(const BaseIComparer& other); - BaseIComparer(BaseIComparer&& other); - virtual ~BaseIComparer(); - BaseIComparer& operator=(const BaseIComparer& other); - BaseIComparer& operator=(decltype(nullptr)); - BaseIComparer& operator=(BaseIComparer&& other); - bool operator==(const BaseIComparer& other) const; - bool operator!=(const BaseIComparer& other) const; - int32_t CppHandle; - BaseIComparer(); - virtual System::Int32 Compare(System::Int32 x, System::Int32 y); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct BaseIComparer : virtual System::Collections::Generic::IComparer - { - BaseIComparer(decltype(nullptr)); - BaseIComparer(Plugin::InternalUse, int32_t handle); - BaseIComparer(const BaseIComparer& other); - BaseIComparer(BaseIComparer&& other); - virtual ~BaseIComparer(); - BaseIComparer& operator=(const BaseIComparer& other); - BaseIComparer& operator=(decltype(nullptr)); - BaseIComparer& operator=(BaseIComparer&& other); - bool operator==(const BaseIComparer& other) const; - bool operator!=(const BaseIComparer& other) const; - int32_t CppHandle; - BaseIComparer(); - virtual System::Int32 Compare(System::String& x, System::String& y); - }; - } - } -} - -namespace System -{ - struct StringComparer : virtual System::Collections::IComparer, virtual System::Collections::Generic::IComparer, virtual System::Collections::IEqualityComparer, virtual System::Collections::Generic::IEqualityComparer - { - StringComparer(decltype(nullptr)); - StringComparer(Plugin::InternalUse, int32_t handle); - StringComparer(const StringComparer& other); - StringComparer(StringComparer&& other); - virtual ~StringComparer(); - StringComparer& operator=(const StringComparer& other); - StringComparer& operator=(decltype(nullptr)); - StringComparer& operator=(StringComparer&& other); - bool operator==(const StringComparer& other) const; - bool operator!=(const StringComparer& other) const; - }; -} - -namespace System -{ - struct BaseStringComparer : virtual System::StringComparer - { - BaseStringComparer(decltype(nullptr)); - BaseStringComparer(Plugin::InternalUse, int32_t handle); - BaseStringComparer(const BaseStringComparer& other); - BaseStringComparer(BaseStringComparer&& other); - virtual ~BaseStringComparer(); - BaseStringComparer& operator=(const BaseStringComparer& other); - BaseStringComparer& operator=(decltype(nullptr)); - BaseStringComparer& operator=(BaseStringComparer&& other); - bool operator==(const BaseStringComparer& other) const; - bool operator!=(const BaseStringComparer& other) const; - int32_t CppHandle; - BaseStringComparer(); - virtual System::Int32 Compare(System::String& x, System::String& y); - virtual System::Boolean Equals(System::String& x, System::String& y); - virtual System::Int32 GetHashCode(System::String& obj); - }; -} - -namespace System -{ - namespace Collections - { - struct Queue : virtual System::ICloneable, virtual System::Collections::ICollection - { - Queue(decltype(nullptr)); - Queue(Plugin::InternalUse, int32_t handle); - Queue(const Queue& other); - Queue(Queue&& other); - virtual ~Queue(); - Queue& operator=(const Queue& other); - Queue& operator=(decltype(nullptr)); - Queue& operator=(Queue&& other); - bool operator==(const Queue& other) const; - bool operator!=(const Queue& other) const; - System::Int32 GetCount(); - }; - } -} - -namespace System -{ - namespace Collections - { - struct BaseQueue : virtual System::Collections::Queue - { - BaseQueue(decltype(nullptr)); - BaseQueue(Plugin::InternalUse, int32_t handle); - BaseQueue(const BaseQueue& other); - BaseQueue(BaseQueue&& other); - virtual ~BaseQueue(); - BaseQueue& operator=(const BaseQueue& other); - BaseQueue& operator=(decltype(nullptr)); - BaseQueue& operator=(BaseQueue&& other); - bool operator==(const BaseQueue& other) const; - bool operator!=(const BaseQueue& other) const; - int32_t CppHandle; - BaseQueue(); - virtual System::Int32 GetCount(); - }; - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct IComponentChangeService : virtual System::Object - { - IComponentChangeService(decltype(nullptr)); - IComponentChangeService(Plugin::InternalUse, int32_t handle); - IComponentChangeService(const IComponentChangeService& other); - IComponentChangeService(IComponentChangeService&& other); - virtual ~IComponentChangeService(); - IComponentChangeService& operator=(const IComponentChangeService& other); - IComponentChangeService& operator=(decltype(nullptr)); - IComponentChangeService& operator=(IComponentChangeService&& other); - bool operator==(const IComponentChangeService& other) const; - bool operator!=(const IComponentChangeService& other) const; - }; - } - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct BaseIComponentChangeService : virtual System::ComponentModel::Design::IComponentChangeService - { - BaseIComponentChangeService(decltype(nullptr)); - BaseIComponentChangeService(Plugin::InternalUse, int32_t handle); - BaseIComponentChangeService(const BaseIComponentChangeService& other); - BaseIComponentChangeService(BaseIComponentChangeService&& other); - virtual ~BaseIComponentChangeService(); - BaseIComponentChangeService& operator=(const BaseIComponentChangeService& other); - BaseIComponentChangeService& operator=(decltype(nullptr)); - BaseIComponentChangeService& operator=(BaseIComponentChangeService&& other); - bool operator==(const BaseIComponentChangeService& other) const; - bool operator!=(const BaseIComponentChangeService& other) const; - int32_t CppHandle; - BaseIComponentChangeService(); - virtual void OnComponentChanged(System::Object& component, System::ComponentModel::MemberDescriptor& member, System::Object& oldValue, System::Object& newValue); - virtual void OnComponentChanging(System::Object& component, System::ComponentModel::MemberDescriptor& member); - virtual void AddComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void RemoveComponentAdded(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void AddComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void RemoveComponentAdding(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void AddComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value); - virtual void RemoveComponentChanged(System::ComponentModel::Design::ComponentChangedEventHandler& value); - virtual void AddComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value); - virtual void RemoveComponentChanging(System::ComponentModel::Design::ComponentChangingEventHandler& value); - virtual void AddComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void RemoveComponentRemoved(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void AddComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void RemoveComponentRemoving(System::ComponentModel::Design::ComponentEventHandler& value); - virtual void AddComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value); - virtual void RemoveComponentRename(System::ComponentModel::Design::ComponentRenameEventHandler& value); - }; - } - } -} - -namespace System -{ - namespace IO - { - struct FileStream : virtual System::IO::Stream, virtual System::IDisposable - { - FileStream(decltype(nullptr)); - FileStream(Plugin::InternalUse, int32_t handle); - FileStream(const FileStream& other); - FileStream(FileStream&& other); - virtual ~FileStream(); - FileStream& operator=(const FileStream& other); - FileStream& operator=(decltype(nullptr)); - FileStream& operator=(FileStream&& other); - bool operator==(const FileStream& other) const; - bool operator!=(const FileStream& other) const; - FileStream(System::String& path, System::IO::FileMode mode); - void WriteByte(System::Byte value); - }; - } -} - -namespace System -{ - namespace IO - { - struct BaseFileStream : virtual System::IO::FileStream - { - BaseFileStream(decltype(nullptr)); - BaseFileStream(Plugin::InternalUse, int32_t handle); - BaseFileStream(const BaseFileStream& other); - BaseFileStream(BaseFileStream&& other); - virtual ~BaseFileStream(); - BaseFileStream& operator=(const BaseFileStream& other); - BaseFileStream& operator=(decltype(nullptr)); - BaseFileStream& operator=(BaseFileStream&& other); - bool operator==(const BaseFileStream& other) const; - bool operator!=(const BaseFileStream& other) const; - int32_t CppHandle; - BaseFileStream(System::String& path, System::IO::FileMode mode); - virtual void WriteByte(System::Byte value); - }; - } -} - -namespace UnityEngine -{ - namespace Playables - { - struct PlayableHandle : Plugin::ManagedType - { - PlayableHandle(decltype(nullptr)); - PlayableHandle(Plugin::InternalUse, int32_t handle); - PlayableHandle(const PlayableHandle& other); - PlayableHandle(PlayableHandle&& other); - virtual ~PlayableHandle(); - PlayableHandle& operator=(const PlayableHandle& other); - PlayableHandle& operator=(decltype(nullptr)); - PlayableHandle& operator=(PlayableHandle&& other); - bool operator==(const PlayableHandle& other) const; - bool operator!=(const PlayableHandle& other) const; - explicit operator System::ValueType(); - explicit operator System::Object(); - }; - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - struct ITransform : virtual System::Object - { - ITransform(decltype(nullptr)); - ITransform(Plugin::InternalUse, int32_t handle); - ITransform(const ITransform& other); - ITransform(ITransform&& other); - virtual ~ITransform(); - ITransform& operator=(const ITransform& other); - ITransform& operator=(decltype(nullptr)); - ITransform& operator=(ITransform&& other); - bool operator==(const ITransform& other) const; - bool operator!=(const ITransform& other) const; - }; - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - struct IUIElementDataWatch : virtual System::Object - { - IUIElementDataWatch(decltype(nullptr)); - IUIElementDataWatch(Plugin::InternalUse, int32_t handle); - IUIElementDataWatch(const IUIElementDataWatch& other); - IUIElementDataWatch(IUIElementDataWatch&& other); - virtual ~IUIElementDataWatch(); - IUIElementDataWatch& operator=(const IUIElementDataWatch& other); - IUIElementDataWatch& operator=(decltype(nullptr)); - IUIElementDataWatch& operator=(IUIElementDataWatch&& other); - bool operator==(const IUIElementDataWatch& other) const; - bool operator!=(const IUIElementDataWatch& other) const; - }; - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - struct IVisualElementScheduler : virtual System::Object - { - IVisualElementScheduler(decltype(nullptr)); - IVisualElementScheduler(Plugin::InternalUse, int32_t handle); - IVisualElementScheduler(const IVisualElementScheduler& other); - IVisualElementScheduler(IVisualElementScheduler&& other); - virtual ~IVisualElementScheduler(); - IVisualElementScheduler& operator=(const IVisualElementScheduler& other); - IVisualElementScheduler& operator=(decltype(nullptr)); - IVisualElementScheduler& operator=(IVisualElementScheduler&& other); - bool operator==(const IVisualElementScheduler& other) const; - bool operator!=(const IVisualElementScheduler& other) const; - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator - { - IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr)); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - UnityEngine::Experimental::UIElements::VisualElement GetCurrent(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable : virtual System::Collections::IEnumerable - { - IEnumerable(decltype(nullptr)); - IEnumerable(Plugin::InternalUse, int32_t handle); - IEnumerable(const IEnumerable& other); - IEnumerable(IEnumerable&& other); - virtual ~IEnumerable(); - IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr)); - IEnumerable& operator=(IEnumerable&& other); - bool operator==(const IEnumerable& other) const; - bool operator!=(const IEnumerable& other) const; - System::Collections::Generic::IEnumerator GetEnumerator(); - }; - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - struct VisualElement : virtual UnityEngine::Experimental::UIElements::Focusable, virtual System::Collections::Generic::IEnumerable, virtual UnityEngine::Experimental::UIElements::IEventHandler, virtual UnityEngine::Experimental::UIElements::IStyle, virtual UnityEngine::Experimental::UIElements::ITransform, virtual UnityEngine::Experimental::UIElements::IUIElementDataWatch, virtual UnityEngine::Experimental::UIElements::IVisualElementScheduler - { - VisualElement(decltype(nullptr)); - VisualElement(Plugin::InternalUse, int32_t handle); - VisualElement(const VisualElement& other); - VisualElement(VisualElement&& other); - virtual ~VisualElement(); - VisualElement& operator=(const VisualElement& other); - VisualElement& operator=(decltype(nullptr)); - VisualElement& operator=(VisualElement&& other); - bool operator==(const VisualElement& other) const; - bool operator!=(const VisualElement& other) const; - }; - } - } -} - -namespace Plugin -{ - struct UnityEngineExperimentalUIElementsVisualElementIterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - UnityEngineExperimentalUIElementsVisualElementIterator(decltype(nullptr)); - UnityEngineExperimentalUIElementsVisualElementIterator(UnityEngine::Experimental::UIElements::VisualElement& enumerable); - ~UnityEngineExperimentalUIElementsVisualElementIterator(); - UnityEngineExperimentalUIElementsVisualElementIterator& operator++(); - bool operator!=(const UnityEngineExperimentalUIElementsVisualElementIterator& other); - UnityEngine::Experimental::UIElements::VisualElement operator*(); - }; -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - Plugin::UnityEngineExperimentalUIElementsVisualElementIterator begin(UnityEngine::Experimental::UIElements::VisualElement& enumerable); - Plugin::UnityEngineExperimentalUIElementsVisualElementIterator end(UnityEngine::Experimental::UIElements::VisualElement& enumerable); - } - } -} - -namespace UnityEngine -{ - namespace Experimental - { - namespace UIElements - { - namespace UQueryExtensions - { - UnityEngine::Experimental::UIElements::VisualElement Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name, System::Array1& classes); - UnityEngine::Experimental::UIElements::VisualElement Q(UnityEngine::Experimental::UIElements::VisualElement& e, System::String& name = Plugin::NullString, System::String& className = Plugin::NullString); - } - } - } -} - -namespace UnityEngine -{ - namespace XR - { - namespace WSA - { - namespace Input - { - struct InteractionSourcePositionAccuracy - { - int32_t Value; - static const UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy None; - static const UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy Approximate; - static const UnityEngine::XR::WSA::Input::InteractionSourcePositionAccuracy High; - explicit InteractionSourcePositionAccuracy(int32_t value); - explicit operator int32_t() const; - bool operator==(InteractionSourcePositionAccuracy other); - bool operator!=(InteractionSourcePositionAccuracy other); - explicit operator System::Enum(); - explicit operator System::ValueType(); - explicit operator System::Object(); - explicit operator System::IFormattable(); - explicit operator System::IConvertible(); - explicit operator System::IComparable(); - }; - } - } - } -} - -namespace UnityEngine -{ - namespace XR - { - namespace WSA - { - namespace Input - { - struct InteractionSourceNode - { - int32_t Value; - static const UnityEngine::XR::WSA::Input::InteractionSourceNode Grip; - static const UnityEngine::XR::WSA::Input::InteractionSourceNode Pointer; - explicit InteractionSourceNode(int32_t value); - explicit operator int32_t() const; - bool operator==(InteractionSourceNode other); - bool operator!=(InteractionSourceNode other); - explicit operator System::Enum(); - explicit operator System::ValueType(); - explicit operator System::Object(); - explicit operator System::IFormattable(); - explicit operator System::IConvertible(); - explicit operator System::IComparable(); - }; - } - } - } -} - -namespace UnityEngine -{ - namespace XR - { - namespace WSA - { - namespace Input - { - struct InteractionSourcePose : Plugin::ManagedType - { - InteractionSourcePose(decltype(nullptr)); - InteractionSourcePose(Plugin::InternalUse, int32_t handle); - InteractionSourcePose(const InteractionSourcePose& other); - InteractionSourcePose(InteractionSourcePose&& other); - virtual ~InteractionSourcePose(); - InteractionSourcePose& operator=(const InteractionSourcePose& other); - InteractionSourcePose& operator=(decltype(nullptr)); - InteractionSourcePose& operator=(InteractionSourcePose&& other); - bool operator==(const InteractionSourcePose& other) const; - bool operator!=(const InteractionSourcePose& other) const; - System::Boolean TryGetRotation(UnityEngine::Quaternion* rotation, UnityEngine::XR::WSA::Input::InteractionSourceNode node = UnityEngine::XR::WSA::Input::InteractionSourceNode::Grip); - explicit operator System::ValueType(); - explicit operator System::Object(); - }; - } - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator - { - IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr)); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - System::String GetCurrent(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator - { - IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr)); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - System::Int32 GetCurrent(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator - { - IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr)); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - System::Single GetCurrent(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator - { - IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr)); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - UnityEngine::RaycastHit GetCurrent(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator - { - IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr)); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - UnityEngine::GradientColorKey GetCurrent(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerator : virtual System::IDisposable, virtual System::Collections::IEnumerator - { - IEnumerator(decltype(nullptr)); - IEnumerator(Plugin::InternalUse, int32_t handle); - IEnumerator(const IEnumerator& other); - IEnumerator(IEnumerator&& other); - virtual ~IEnumerator(); - IEnumerator& operator=(const IEnumerator& other); - IEnumerator& operator=(decltype(nullptr)); - IEnumerator& operator=(IEnumerator&& other); - bool operator==(const IEnumerator& other) const; - bool operator!=(const IEnumerator& other) const; - UnityEngine::Resolution GetCurrent(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable : virtual System::Collections::IEnumerable - { - IEnumerable(decltype(nullptr)); - IEnumerable(Plugin::InternalUse, int32_t handle); - IEnumerable(const IEnumerable& other); - IEnumerable(IEnumerable&& other); - virtual ~IEnumerable(); - IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr)); - IEnumerable& operator=(IEnumerable&& other); - bool operator==(const IEnumerable& other) const; - bool operator!=(const IEnumerable& other) const; - System::Collections::Generic::IEnumerator GetEnumerator(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable : virtual System::Collections::IEnumerable - { - IEnumerable(decltype(nullptr)); - IEnumerable(Plugin::InternalUse, int32_t handle); - IEnumerable(const IEnumerable& other); - IEnumerable(IEnumerable&& other); - virtual ~IEnumerable(); - IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr)); - IEnumerable& operator=(IEnumerable&& other); - bool operator==(const IEnumerable& other) const; - bool operator!=(const IEnumerable& other) const; - System::Collections::Generic::IEnumerator GetEnumerator(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable : virtual System::Collections::IEnumerable - { - IEnumerable(decltype(nullptr)); - IEnumerable(Plugin::InternalUse, int32_t handle); - IEnumerable(const IEnumerable& other); - IEnumerable(IEnumerable&& other); - virtual ~IEnumerable(); - IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr)); - IEnumerable& operator=(IEnumerable&& other); - bool operator==(const IEnumerable& other) const; - bool operator!=(const IEnumerable& other) const; - System::Collections::Generic::IEnumerator GetEnumerator(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable : virtual System::Collections::IEnumerable - { - IEnumerable(decltype(nullptr)); - IEnumerable(Plugin::InternalUse, int32_t handle); - IEnumerable(const IEnumerable& other); - IEnumerable(IEnumerable&& other); - virtual ~IEnumerable(); - IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr)); - IEnumerable& operator=(IEnumerable&& other); - bool operator==(const IEnumerable& other) const; - bool operator!=(const IEnumerable& other) const; - System::Collections::Generic::IEnumerator GetEnumerator(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable : virtual System::Collections::IEnumerable - { - IEnumerable(decltype(nullptr)); - IEnumerable(Plugin::InternalUse, int32_t handle); - IEnumerable(const IEnumerable& other); - IEnumerable(IEnumerable&& other); - virtual ~IEnumerable(); - IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr)); - IEnumerable& operator=(IEnumerable&& other); - bool operator==(const IEnumerable& other) const; - bool operator!=(const IEnumerable& other) const; - System::Collections::Generic::IEnumerator GetEnumerator(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IEnumerable : virtual System::Collections::IEnumerable - { - IEnumerable(decltype(nullptr)); - IEnumerable(Plugin::InternalUse, int32_t handle); - IEnumerable(const IEnumerable& other); - IEnumerable(IEnumerable&& other); - virtual ~IEnumerable(); - IEnumerable& operator=(const IEnumerable& other); - IEnumerable& operator=(decltype(nullptr)); - IEnumerable& operator=(IEnumerable&& other); - bool operator==(const IEnumerable& other) const; - bool operator!=(const IEnumerable& other) const; - System::Collections::Generic::IEnumerator GetEnumerator(); - }; - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct ICollection : virtual System::Collections::Generic::IEnumerable - { - ICollection(decltype(nullptr)); - ICollection(Plugin::InternalUse, int32_t handle); - ICollection(const ICollection& other); - ICollection(ICollection&& other); - virtual ~ICollection(); - ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr)); - ICollection& operator=(ICollection&& other); - bool operator==(const ICollection& other) const; - bool operator!=(const ICollection& other) const; - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsGenericICollectionSystemStringIterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericICollectionSystemStringIterator(decltype(nullptr)); - SystemCollectionsGenericICollectionSystemStringIterator(System::Collections::Generic::ICollection& enumerable); - ~SystemCollectionsGenericICollectionSystemStringIterator(); - SystemCollectionsGenericICollectionSystemStringIterator& operator++(); - bool operator!=(const SystemCollectionsGenericICollectionSystemStringIterator& other); - System::String operator*(); - }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionSystemStringIterator begin(System::Collections::Generic::ICollection& enumerable); - Plugin::SystemCollectionsGenericICollectionSystemStringIterator end(System::Collections::Generic::ICollection& enumerable); - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct ICollection : virtual System::Collections::Generic::IEnumerable - { - ICollection(decltype(nullptr)); - ICollection(Plugin::InternalUse, int32_t handle); - ICollection(const ICollection& other); - ICollection(ICollection&& other); - virtual ~ICollection(); - ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr)); - ICollection& operator=(ICollection&& other); - bool operator==(const ICollection& other) const; - bool operator!=(const ICollection& other) const; - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsGenericICollectionSystemInt32Iterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericICollectionSystemInt32Iterator(decltype(nullptr)); - SystemCollectionsGenericICollectionSystemInt32Iterator(System::Collections::Generic::ICollection& enumerable); - ~SystemCollectionsGenericICollectionSystemInt32Iterator(); - SystemCollectionsGenericICollectionSystemInt32Iterator& operator++(); - bool operator!=(const SystemCollectionsGenericICollectionSystemInt32Iterator& other); - System::Int32 operator*(); - }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator begin(System::Collections::Generic::ICollection& enumerable); - Plugin::SystemCollectionsGenericICollectionSystemInt32Iterator end(System::Collections::Generic::ICollection& enumerable); - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct ICollection : virtual System::Collections::Generic::IEnumerable - { - ICollection(decltype(nullptr)); - ICollection(Plugin::InternalUse, int32_t handle); - ICollection(const ICollection& other); - ICollection(ICollection&& other); - virtual ~ICollection(); - ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr)); - ICollection& operator=(ICollection&& other); - bool operator==(const ICollection& other) const; - bool operator!=(const ICollection& other) const; - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsGenericICollectionSystemSingleIterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericICollectionSystemSingleIterator(decltype(nullptr)); - SystemCollectionsGenericICollectionSystemSingleIterator(System::Collections::Generic::ICollection& enumerable); - ~SystemCollectionsGenericICollectionSystemSingleIterator(); - SystemCollectionsGenericICollectionSystemSingleIterator& operator++(); - bool operator!=(const SystemCollectionsGenericICollectionSystemSingleIterator& other); - System::Single operator*(); - }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionSystemSingleIterator begin(System::Collections::Generic::ICollection& enumerable); - Plugin::SystemCollectionsGenericICollectionSystemSingleIterator end(System::Collections::Generic::ICollection& enumerable); - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct ICollection : virtual System::Collections::Generic::IEnumerable - { - ICollection(decltype(nullptr)); - ICollection(Plugin::InternalUse, int32_t handle); - ICollection(const ICollection& other); - ICollection(ICollection&& other); - virtual ~ICollection(); - ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr)); - ICollection& operator=(ICollection&& other); - bool operator==(const ICollection& other) const; - bool operator!=(const ICollection& other) const; - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(decltype(nullptr)); - SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(System::Collections::Generic::ICollection& enumerable); - ~SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator(); - SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& operator++(); - bool operator!=(const SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator& other); - UnityEngine::RaycastHit operator*(); - }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator begin(System::Collections::Generic::ICollection& enumerable); - Plugin::SystemCollectionsGenericICollectionUnityEngineRaycastHitIterator end(System::Collections::Generic::ICollection& enumerable); - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct ICollection : virtual System::Collections::Generic::IEnumerable - { - ICollection(decltype(nullptr)); - ICollection(Plugin::InternalUse, int32_t handle); - ICollection(const ICollection& other); - ICollection(ICollection&& other); - virtual ~ICollection(); - ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr)); - ICollection& operator=(ICollection&& other); - bool operator==(const ICollection& other) const; - bool operator!=(const ICollection& other) const; - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(decltype(nullptr)); - SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(System::Collections::Generic::ICollection& enumerable); - ~SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator(); - SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& operator++(); - bool operator!=(const SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator& other); - UnityEngine::GradientColorKey operator*(); - }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::ICollection& enumerable); - Plugin::SystemCollectionsGenericICollectionUnityEngineGradientColorKeyIterator end(System::Collections::Generic::ICollection& enumerable); - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct ICollection : virtual System::Collections::Generic::IEnumerable - { - ICollection(decltype(nullptr)); - ICollection(Plugin::InternalUse, int32_t handle); - ICollection(const ICollection& other); - ICollection(ICollection&& other); - virtual ~ICollection(); - ICollection& operator=(const ICollection& other); - ICollection& operator=(decltype(nullptr)); - ICollection& operator=(ICollection&& other); - bool operator==(const ICollection& other) const; - bool operator!=(const ICollection& other) const; - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsGenericICollectionUnityEngineResolutionIterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericICollectionUnityEngineResolutionIterator(decltype(nullptr)); - SystemCollectionsGenericICollectionUnityEngineResolutionIterator(System::Collections::Generic::ICollection& enumerable); - ~SystemCollectionsGenericICollectionUnityEngineResolutionIterator(); - SystemCollectionsGenericICollectionUnityEngineResolutionIterator& operator++(); - bool operator!=(const SystemCollectionsGenericICollectionUnityEngineResolutionIterator& other); - UnityEngine::Resolution operator*(); - }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator begin(System::Collections::Generic::ICollection& enumerable); - Plugin::SystemCollectionsGenericICollectionUnityEngineResolutionIterator end(System::Collections::Generic::ICollection& enumerable); - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IList : virtual System::Collections::Generic::ICollection - { - IList(decltype(nullptr)); - IList(Plugin::InternalUse, int32_t handle); - IList(const IList& other); - IList(IList&& other); - virtual ~IList(); - IList& operator=(const IList& other); - IList& operator=(decltype(nullptr)); - IList& operator=(IList&& other); - bool operator==(const IList& other) const; - bool operator!=(const IList& other) const; - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsGenericIListSystemStringIterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericIListSystemStringIterator(decltype(nullptr)); - SystemCollectionsGenericIListSystemStringIterator(System::Collections::Generic::IList& enumerable); - ~SystemCollectionsGenericIListSystemStringIterator(); - SystemCollectionsGenericIListSystemStringIterator& operator++(); - bool operator!=(const SystemCollectionsGenericIListSystemStringIterator& other); - System::String operator*(); - }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericIListSystemStringIterator begin(System::Collections::Generic::IList& enumerable); - Plugin::SystemCollectionsGenericIListSystemStringIterator end(System::Collections::Generic::IList& enumerable); - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IList : virtual System::Collections::Generic::ICollection - { - IList(decltype(nullptr)); - IList(Plugin::InternalUse, int32_t handle); - IList(const IList& other); - IList(IList&& other); - virtual ~IList(); - IList& operator=(const IList& other); - IList& operator=(decltype(nullptr)); - IList& operator=(IList&& other); - bool operator==(const IList& other) const; - bool operator!=(const IList& other) const; - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsGenericIListSystemInt32Iterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericIListSystemInt32Iterator(decltype(nullptr)); - SystemCollectionsGenericIListSystemInt32Iterator(System::Collections::Generic::IList& enumerable); - ~SystemCollectionsGenericIListSystemInt32Iterator(); - SystemCollectionsGenericIListSystemInt32Iterator& operator++(); - bool operator!=(const SystemCollectionsGenericIListSystemInt32Iterator& other); - System::Int32 operator*(); - }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericIListSystemInt32Iterator begin(System::Collections::Generic::IList& enumerable); - Plugin::SystemCollectionsGenericIListSystemInt32Iterator end(System::Collections::Generic::IList& enumerable); - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IList : virtual System::Collections::Generic::ICollection - { - IList(decltype(nullptr)); - IList(Plugin::InternalUse, int32_t handle); - IList(const IList& other); - IList(IList&& other); - virtual ~IList(); - IList& operator=(const IList& other); - IList& operator=(decltype(nullptr)); - IList& operator=(IList&& other); - bool operator==(const IList& other) const; - bool operator!=(const IList& other) const; - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsGenericIListSystemSingleIterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericIListSystemSingleIterator(decltype(nullptr)); - SystemCollectionsGenericIListSystemSingleIterator(System::Collections::Generic::IList& enumerable); - ~SystemCollectionsGenericIListSystemSingleIterator(); - SystemCollectionsGenericIListSystemSingleIterator& operator++(); - bool operator!=(const SystemCollectionsGenericIListSystemSingleIterator& other); - System::Single operator*(); - }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericIListSystemSingleIterator begin(System::Collections::Generic::IList& enumerable); - Plugin::SystemCollectionsGenericIListSystemSingleIterator end(System::Collections::Generic::IList& enumerable); - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IList : virtual System::Collections::Generic::ICollection - { - IList(decltype(nullptr)); - IList(Plugin::InternalUse, int32_t handle); - IList(const IList& other); - IList(IList&& other); - virtual ~IList(); - IList& operator=(const IList& other); - IList& operator=(decltype(nullptr)); - IList& operator=(IList&& other); - bool operator==(const IList& other) const; - bool operator!=(const IList& other) const; - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsGenericIListUnityEngineRaycastHitIterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericIListUnityEngineRaycastHitIterator(decltype(nullptr)); - SystemCollectionsGenericIListUnityEngineRaycastHitIterator(System::Collections::Generic::IList& enumerable); - ~SystemCollectionsGenericIListUnityEngineRaycastHitIterator(); - SystemCollectionsGenericIListUnityEngineRaycastHitIterator& operator++(); - bool operator!=(const SystemCollectionsGenericIListUnityEngineRaycastHitIterator& other); - UnityEngine::RaycastHit operator*(); - }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator begin(System::Collections::Generic::IList& enumerable); - Plugin::SystemCollectionsGenericIListUnityEngineRaycastHitIterator end(System::Collections::Generic::IList& enumerable); - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IList : virtual System::Collections::Generic::ICollection - { - IList(decltype(nullptr)); - IList(Plugin::InternalUse, int32_t handle); - IList(const IList& other); - IList(IList&& other); - virtual ~IList(); - IList& operator=(const IList& other); - IList& operator=(decltype(nullptr)); - IList& operator=(IList&& other); - bool operator==(const IList& other) const; - bool operator!=(const IList& other) const; - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(decltype(nullptr)); - SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(System::Collections::Generic::IList& enumerable); - ~SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator(); - SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& operator++(); - bool operator!=(const SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator& other); - UnityEngine::GradientColorKey operator*(); - }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator begin(System::Collections::Generic::IList& enumerable); - Plugin::SystemCollectionsGenericIListUnityEngineGradientColorKeyIterator end(System::Collections::Generic::IList& enumerable); - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct IList : virtual System::Collections::Generic::ICollection - { - IList(decltype(nullptr)); - IList(Plugin::InternalUse, int32_t handle); - IList(const IList& other); - IList(IList&& other); - virtual ~IList(); - IList& operator=(const IList& other); - IList& operator=(decltype(nullptr)); - IList& operator=(IList&& other); - bool operator==(const IList& other) const; - bool operator!=(const IList& other) const; - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsGenericIListUnityEngineResolutionIterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericIListUnityEngineResolutionIterator(decltype(nullptr)); - SystemCollectionsGenericIListUnityEngineResolutionIterator(System::Collections::Generic::IList& enumerable); - ~SystemCollectionsGenericIListUnityEngineResolutionIterator(); - SystemCollectionsGenericIListUnityEngineResolutionIterator& operator++(); - bool operator!=(const SystemCollectionsGenericIListUnityEngineResolutionIterator& other); - UnityEngine::Resolution operator*(); - }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator begin(System::Collections::Generic::IList& enumerable); - Plugin::SystemCollectionsGenericIListUnityEngineResolutionIterator end(System::Collections::Generic::IList& enumerable); - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct List : virtual System::Collections::IList, virtual System::Collections::Generic::IList - { - List(decltype(nullptr)); - List(Plugin::InternalUse, int32_t handle); - List(const List& other); - List(List&& other); - virtual ~List(); - List& operator=(const List& other); - List& operator=(decltype(nullptr)); - List& operator=(List&& other); - bool operator==(const List& other) const; - bool operator!=(const List& other) const; - List(); - System::String GetItem(System::Int32 index); - void SetItem(System::Int32 index, System::String& value); - void Add(System::String& item); - void Sort(System::Collections::Generic::IComparer& comparer); - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsGenericListSystemStringIterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericListSystemStringIterator(decltype(nullptr)); - SystemCollectionsGenericListSystemStringIterator(System::Collections::Generic::List& enumerable); - ~SystemCollectionsGenericListSystemStringIterator(); - SystemCollectionsGenericListSystemStringIterator& operator++(); - bool operator!=(const SystemCollectionsGenericListSystemStringIterator& other); - System::String operator*(); - }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericListSystemStringIterator begin(System::Collections::Generic::List& enumerable); - Plugin::SystemCollectionsGenericListSystemStringIterator end(System::Collections::Generic::List& enumerable); - } - } -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - template<> struct List : virtual System::Collections::IList, virtual System::Collections::Generic::IList - { - List(decltype(nullptr)); - List(Plugin::InternalUse, int32_t handle); - List(const List& other); - List(List&& other); - virtual ~List(); - List& operator=(const List& other); - List& operator=(decltype(nullptr)); - List& operator=(List&& other); - bool operator==(const List& other) const; - bool operator!=(const List& other) const; - List(); - System::Int32 GetItem(System::Int32 index); - void SetItem(System::Int32 index, System::Int32 value); - void Add(System::Int32 item); - void Sort(System::Collections::Generic::IComparer& comparer); - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsGenericListSystemInt32Iterator - { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsGenericListSystemInt32Iterator(decltype(nullptr)); - SystemCollectionsGenericListSystemInt32Iterator(System::Collections::Generic::List& enumerable); - ~SystemCollectionsGenericListSystemInt32Iterator(); - SystemCollectionsGenericListSystemInt32Iterator& operator++(); - bool operator!=(const SystemCollectionsGenericListSystemInt32Iterator& other); - System::Int32 operator*(); + Object(); + Object(Plugin::InternalUse iu, int32_t handle); + Object(decltype(nullptr)); + virtual ~Object() = default; + bool operator==(decltype(nullptr)) const; + bool operator!=(decltype(nullptr)) const; + virtual void ThrowReferenceToThis(); + + /*BEGIN UNBOXING METHOD DECLARATIONS*/ + explicit operator UnityEngine::Vector3(); + explicit operator UnityEngine::PrimitiveType(); + explicit operator System::Boolean(); + explicit operator System::SByte(); + explicit operator System::Byte(); + explicit operator System::Int16(); + explicit operator System::UInt16(); + explicit operator System::Int32(); + explicit operator System::UInt32(); + explicit operator System::Int64(); + explicit operator System::UInt64(); + explicit operator System::Char(); + explicit operator System::Single(); + explicit operator System::Double(); + /*END UNBOXING METHOD DECLARATIONS*/ }; -} - -namespace System -{ - namespace Collections - { - namespace Generic - { - Plugin::SystemCollectionsGenericListSystemInt32Iterator begin(System::Collections::Generic::List& enumerable); - Plugin::SystemCollectionsGenericListSystemInt32Iterator end(System::Collections::Generic::List& enumerable); - } - } -} - -namespace System -{ - namespace Collections - { - namespace ObjectModel - { - template<> struct Collection : virtual System::Collections::IList, virtual System::Collections::Generic::IList - { - Collection(decltype(nullptr)); - Collection(Plugin::InternalUse, int32_t handle); - Collection(const Collection& other); - Collection(Collection&& other); - virtual ~Collection(); - Collection& operator=(const Collection& other); - Collection& operator=(decltype(nullptr)); - Collection& operator=(Collection&& other); - bool operator==(const Collection& other) const; - bool operator!=(const Collection& other) const; - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsObjectModelCollectionSystemInt32Iterator + + struct ValueType : virtual Object { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsObjectModelCollectionSystemInt32Iterator(decltype(nullptr)); - SystemCollectionsObjectModelCollectionSystemInt32Iterator(System::Collections::ObjectModel::Collection& enumerable); - ~SystemCollectionsObjectModelCollectionSystemInt32Iterator(); - SystemCollectionsObjectModelCollectionSystemInt32Iterator& operator++(); - bool operator!=(const SystemCollectionsObjectModelCollectionSystemInt32Iterator& other); - System::Int32 operator*(); + ValueType(Plugin::InternalUse iu, int32_t handle); + ValueType(decltype(nullptr)); }; -} - -namespace System -{ - namespace Collections + + struct Enum : virtual ValueType { - namespace ObjectModel - { - Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator begin(System::Collections::ObjectModel::Collection& enumerable); - Plugin::SystemCollectionsObjectModelCollectionSystemInt32Iterator end(System::Collections::ObjectModel::Collection& enumerable); - } - } -} - -namespace System -{ - namespace Collections + Enum(Plugin::InternalUse iu, int32_t handle); + Enum(decltype(nullptr)); + }; + + struct String : virtual Object { - namespace ObjectModel - { - template<> struct KeyedCollection : virtual System::Collections::ObjectModel::Collection, virtual System::Collections::IList, virtual System::Collections::Generic::IList - { - KeyedCollection(decltype(nullptr)); - KeyedCollection(Plugin::InternalUse, int32_t handle); - KeyedCollection(const KeyedCollection& other); - KeyedCollection(KeyedCollection&& other); - virtual ~KeyedCollection(); - KeyedCollection& operator=(const KeyedCollection& other); - KeyedCollection& operator=(decltype(nullptr)); - KeyedCollection& operator=(KeyedCollection&& other); - bool operator==(const KeyedCollection& other) const; - bool operator!=(const KeyedCollection& other) const; - }; - } - } -} - -namespace Plugin -{ - struct SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator + String(Plugin::InternalUse iu, int32_t handle); + String(decltype(nullptr)); + String(const String& other); + String(String&& other); + virtual ~String(); + String& operator=(const String& other); + String& operator=(decltype(nullptr)); + String& operator=(String&& other); + String(const char* chars); + }; + + struct ICloneable : virtual Object { - System::Collections::Generic::IEnumerator enumerator; - bool hasMore; - SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(decltype(nullptr)); - SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(System::Collections::ObjectModel::KeyedCollection& enumerable); - ~SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator(); - SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& operator++(); - bool operator!=(const SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator& other); - System::Int32 operator*(); + ICloneable(Plugin::InternalUse iu, int32_t handle); + ICloneable(decltype(nullptr)); }; -} - -namespace System -{ + namespace Collections { - namespace ObjectModel + struct IEnumerable : virtual Object { - Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator begin(System::Collections::ObjectModel::KeyedCollection& enumerable); - Plugin::SystemCollectionsObjectModelKeyedCollectionSystemString_SystemInt32Iterator end(System::Collections::ObjectModel::KeyedCollection& enumerable); - } - } -} - -namespace MyGame -{ - namespace MonoBehaviours - { - struct TestScript : virtual UnityEngine::MonoBehaviour + IEnumerable(Plugin::InternalUse iu, int32_t handle); + IEnumerable(decltype(nullptr)); + IEnumerator GetEnumerator(); + }; + + struct ICollection : virtual IEnumerable { - TestScript(decltype(nullptr)); - TestScript(Plugin::InternalUse, int32_t handle); - TestScript(const TestScript& other); - TestScript(TestScript&& other); - virtual ~TestScript(); - TestScript& operator=(const TestScript& other); - TestScript& operator=(decltype(nullptr)); - TestScript& operator=(TestScript&& other); - bool operator==(const TestScript& other) const; - bool operator!=(const TestScript& other) const; - void Awake(); - void OnAnimatorIK(System::Int32 param0); - void OnCollisionEnter(UnityEngine::Collision& param0); - void Update(); + ICollection(Plugin::InternalUse iu, int32_t handle); + ICollection(decltype(nullptr)); }; - } -} - -namespace MyGame -{ - namespace MonoBehaviours - { - struct AnotherScript : virtual UnityEngine::MonoBehaviour + + struct IList : virtual ICollection, virtual IEnumerable { - AnotherScript(decltype(nullptr)); - AnotherScript(Plugin::InternalUse, int32_t handle); - AnotherScript(const AnotherScript& other); - AnotherScript(AnotherScript&& other); - virtual ~AnotherScript(); - AnotherScript& operator=(const AnotherScript& other); - AnotherScript& operator=(decltype(nullptr)); - AnotherScript& operator=(AnotherScript&& other); - bool operator==(const AnotherScript& other) const; - bool operator!=(const AnotherScript& other) const; - void Awake(); - void Update(); + IList(Plugin::InternalUse iu, int32_t handle); + IList(decltype(nullptr)); }; } -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_1 - { - int32_t Handle; - int32_t Index0; - ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0); - void operator=(System::Int32 item); - operator System::Int32(); - }; -} - -namespace System -{ - template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList - { - Array1(decltype(nullptr)); - Array1(Plugin::InternalUse, int32_t handle); - Array1(const Array1& other); - Array1(Array1&& other); - virtual ~Array1(); - Array1& operator=(const Array1& other); - Array1& operator=(decltype(nullptr)); - Array1& operator=(Array1&& other); - bool operator==(const Array1& other) const; - bool operator!=(const Array1& other) const; - int32_t InternalLength; - Array1(System::Int32 length0); - System::Int32 GetLength(); - System::Int32 GetRank(); - Plugin::ArrayElementProxy1_1 operator[](int32_t index); - }; -} - -namespace Plugin -{ - struct SystemInt32Array1Iterator - { - System::Array1& array; - int index; - SystemInt32Array1Iterator(System::Array1& array, int32_t index); - SystemInt32Array1Iterator& operator++(); - bool operator!=(const SystemInt32Array1Iterator& other); - System::Int32 operator*(); - }; -} - -namespace System -{ - Plugin::SystemInt32Array1Iterator begin(System::Array1& array); - Plugin::SystemInt32Array1Iterator end(System::Array1& array); -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_1 - { - int32_t Handle; - int32_t Index0; - ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0); - void operator=(System::Single item); - operator System::Single(); - }; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_2 - { - int32_t Handle; - int32_t Index0; - ArrayElementProxy1_2(Plugin::InternalUse, int32_t handle, int32_t index0); - Plugin::ArrayElementProxy2_2 operator[](int32_t index); - }; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy2_2 - { - int32_t Handle; - int32_t Index0; - int32_t Index1; - ArrayElementProxy2_2(Plugin::InternalUse, int32_t handle, int32_t index0, int32_t index1); - void operator=(System::Single item); - operator System::Single(); - }; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_3 - { - int32_t Handle; - int32_t Index0; - ArrayElementProxy1_3(Plugin::InternalUse, int32_t handle, int32_t index0); - Plugin::ArrayElementProxy2_3 operator[](int32_t index); - }; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy2_3 - { - int32_t Handle; - int32_t Index0; - int32_t Index1; - ArrayElementProxy2_3(Plugin::InternalUse, int32_t handle, int32_t index0, int32_t index1); - Plugin::ArrayElementProxy3_3 operator[](int32_t index); - }; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy3_3 + + struct Array : virtual ICloneable, virtual Collections::IList { - int32_t Handle; - int32_t Index0; - int32_t Index1; - int32_t Index2; - ArrayElementProxy3_3(Plugin::InternalUse, int32_t handle, int32_t index0, int32_t index1, int32_t index2); - void operator=(System::Single item); - operator System::Single(); + Array(Plugin::InternalUse iu, int32_t handle); + Array(decltype(nullptr)); + int32_t GetLength(); + int32_t GetRank(); }; } -namespace System -{ - template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList - { - Array1(decltype(nullptr)); - Array1(Plugin::InternalUse, int32_t handle); - Array1(const Array1& other); - Array1(Array1&& other); - virtual ~Array1(); - Array1& operator=(const Array1& other); - Array1& operator=(decltype(nullptr)); - Array1& operator=(Array1&& other); - bool operator==(const Array1& other) const; - bool operator!=(const Array1& other) const; - int32_t InternalLength; - Array1(System::Int32 length0); - System::Int32 GetLength(); - System::Int32 GetRank(); - Plugin::ArrayElementProxy1_1 operator[](int32_t index); - }; -} +//////////////////////////////////////////////////////////////// +// Global variables +//////////////////////////////////////////////////////////////// namespace Plugin { - struct SystemSingleArray1Iterator - { - System::Array1& array; - int index; - SystemSingleArray1Iterator(System::Array1& array, int32_t index); - SystemSingleArray1Iterator& operator++(); - bool operator!=(const SystemSingleArray1Iterator& other); - System::Single operator*(); - }; -} - -namespace System -{ - Plugin::SystemSingleArray1Iterator begin(System::Array1& array); - Plugin::SystemSingleArray1Iterator end(System::Array1& array); -} - -namespace System -{ - template<> struct Array2 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList - { - Array2(decltype(nullptr)); - Array2(Plugin::InternalUse, int32_t handle); - Array2(const Array2& other); - Array2(Array2&& other); - virtual ~Array2(); - Array2& operator=(const Array2& other); - Array2& operator=(decltype(nullptr)); - Array2& operator=(Array2&& other); - bool operator==(const Array2& other) const; - bool operator!=(const Array2& other) const; - int32_t InternalLength; - int32_t InternalLengths[2]; - Array2(System::Int32 length0, System::Int32 length1); - System::Int32 GetLength(); - System::Int32 GetLength(System::Int32 dimension); - System::Int32 GetRank(); - Plugin::ArrayElementProxy1_2 operator[](int32_t index); - }; + extern System::String NullString; } +/*BEGIN TYPE DEFINITIONS*/ namespace System { - template<> struct Array3 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList - { - Array3(decltype(nullptr)); - Array3(Plugin::InternalUse, int32_t handle); - Array3(const Array3& other); - Array3(Array3&& other); - virtual ~Array3(); - Array3& operator=(const Array3& other); - Array3& operator=(decltype(nullptr)); - Array3& operator=(Array3&& other); - bool operator==(const Array3& other) const; - bool operator!=(const Array3& other) const; - int32_t InternalLength; - int32_t InternalLengths[3]; - Array3(System::Int32 length0, System::Int32 length1, System::Int32 length2); - System::Int32 GetLength(); - System::Int32 GetLength(System::Int32 dimension); - System::Int32 GetRank(); - Plugin::ArrayElementProxy1_3 operator[](int32_t index); - }; -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_1 + struct IFormattable : virtual System::Object { - int32_t Handle; - int32_t Index0; - ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0); - void operator=(System::String item); - operator System::String(); + IFormattable(decltype(nullptr)); + IFormattable(Plugin::InternalUse, int32_t handle); + IFormattable(const IFormattable& other); + IFormattable(IFormattable&& other); + virtual ~IFormattable(); + IFormattable& operator=(const IFormattable& other); + IFormattable& operator=(decltype(nullptr)); + IFormattable& operator=(IFormattable&& other); + bool operator==(const IFormattable& other) const; + bool operator!=(const IFormattable& other) const; }; } namespace System { - template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList - { - Array1(decltype(nullptr)); - Array1(Plugin::InternalUse, int32_t handle); - Array1(const Array1& other); - Array1(Array1&& other); - virtual ~Array1(); - Array1& operator=(const Array1& other); - Array1& operator=(decltype(nullptr)); - Array1& operator=(Array1&& other); - bool operator==(const Array1& other) const; - bool operator!=(const Array1& other) const; - int32_t InternalLength; - Array1(System::Int32 length0); - System::Int32 GetLength(); - System::Int32 GetRank(); - Plugin::ArrayElementProxy1_1 operator[](int32_t index); - }; -} - -namespace Plugin -{ - struct SystemStringArray1Iterator + struct IConvertible : virtual System::Object { - System::Array1& array; - int index; - SystemStringArray1Iterator(System::Array1& array, int32_t index); - SystemStringArray1Iterator& operator++(); - bool operator!=(const SystemStringArray1Iterator& other); - System::String operator*(); + IConvertible(decltype(nullptr)); + IConvertible(Plugin::InternalUse, int32_t handle); + IConvertible(const IConvertible& other); + IConvertible(IConvertible&& other); + virtual ~IConvertible(); + IConvertible& operator=(const IConvertible& other); + IConvertible& operator=(decltype(nullptr)); + IConvertible& operator=(IConvertible&& other); + bool operator==(const IConvertible& other) const; + bool operator!=(const IConvertible& other) const; }; } namespace System { - Plugin::SystemStringArray1Iterator begin(System::Array1& array); - Plugin::SystemStringArray1Iterator end(System::Array1& array); -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_1 + struct IComparable : virtual System::Object { - int32_t Handle; - int32_t Index0; - ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0); - void operator=(UnityEngine::Resolution item); - operator UnityEngine::Resolution(); + IComparable(decltype(nullptr)); + IComparable(Plugin::InternalUse, int32_t handle); + IComparable(const IComparable& other); + IComparable(IComparable&& other); + virtual ~IComparable(); + IComparable& operator=(const IComparable& other); + IComparable& operator=(decltype(nullptr)); + IComparable& operator=(IComparable&& other); + bool operator==(const IComparable& other) const; + bool operator!=(const IComparable& other) const; }; } -namespace System +namespace UnityEngine { - template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList + struct Vector3 { - Array1(decltype(nullptr)); - Array1(Plugin::InternalUse, int32_t handle); - Array1(const Array1& other); - Array1(Array1&& other); - virtual ~Array1(); - Array1& operator=(const Array1& other); - Array1& operator=(decltype(nullptr)); - Array1& operator=(Array1&& other); - bool operator==(const Array1& other) const; - bool operator!=(const Array1& other) const; - int32_t InternalLength; - Array1(System::Int32 length0); - System::Int32 GetLength(); - System::Int32 GetRank(); - Plugin::ArrayElementProxy1_1 operator[](int32_t index); + Vector3(); + Vector3(System::Single x, System::Single y, System::Single z); + System::Single x; + System::Single y; + System::Single z; + UnityEngine::Vector3 operator+(UnityEngine::Vector3& a); + explicit operator System::ValueType(); + explicit operator System::Object(); }; } -namespace Plugin +namespace UnityEngine { - struct UnityEngineResolutionArray1Iterator + struct Object : virtual System::Object { - System::Array1& array; - int index; - UnityEngineResolutionArray1Iterator(System::Array1& array, int32_t index); - UnityEngineResolutionArray1Iterator& operator++(); - bool operator!=(const UnityEngineResolutionArray1Iterator& other); - UnityEngine::Resolution operator*(); + Object(decltype(nullptr)); + Object(Plugin::InternalUse, int32_t handle); + Object(const Object& other); + Object(Object&& other); + virtual ~Object(); + Object& operator=(const Object& other); + Object& operator=(decltype(nullptr)); + Object& operator=(Object&& other); + bool operator==(const Object& other) const; + bool operator!=(const Object& other) const; + System::String GetName(); + void SetName(System::String& value); }; } -namespace System -{ - Plugin::UnityEngineResolutionArray1Iterator begin(System::Array1& array); - Plugin::UnityEngineResolutionArray1Iterator end(System::Array1& array); -} - -namespace Plugin +namespace UnityEngine { - template<> struct ArrayElementProxy1_1 + struct Component : virtual UnityEngine::Object { - int32_t Handle; - int32_t Index0; - ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0); - void operator=(UnityEngine::RaycastHit item); - operator UnityEngine::RaycastHit(); + Component(decltype(nullptr)); + Component(Plugin::InternalUse, int32_t handle); + Component(const Component& other); + Component(Component&& other); + virtual ~Component(); + Component& operator=(const Component& other); + Component& operator=(decltype(nullptr)); + Component& operator=(Component&& other); + bool operator==(const Component& other) const; + bool operator!=(const Component& other) const; + UnityEngine::Transform GetTransform(); }; } -namespace System +namespace UnityEngine { - template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList + struct Transform : virtual UnityEngine::Component, virtual System::Collections::IEnumerable { - Array1(decltype(nullptr)); - Array1(Plugin::InternalUse, int32_t handle); - Array1(const Array1& other); - Array1(Array1&& other); - virtual ~Array1(); - Array1& operator=(const Array1& other); - Array1& operator=(decltype(nullptr)); - Array1& operator=(Array1&& other); - bool operator==(const Array1& other) const; - bool operator!=(const Array1& other) const; - int32_t InternalLength; - Array1(System::Int32 length0); - System::Int32 GetLength(); - System::Int32 GetRank(); - Plugin::ArrayElementProxy1_1 operator[](int32_t index); + Transform(decltype(nullptr)); + Transform(Plugin::InternalUse, int32_t handle); + Transform(const Transform& other); + Transform(Transform&& other); + virtual ~Transform(); + Transform& operator=(const Transform& other); + Transform& operator=(decltype(nullptr)); + Transform& operator=(Transform&& other); + bool operator==(const Transform& other) const; + bool operator!=(const Transform& other) const; + UnityEngine::Vector3 GetPosition(); + void SetPosition(UnityEngine::Vector3& value); }; } -namespace Plugin +namespace System { - struct UnityEngineRaycastHitArray1Iterator + namespace Collections { - System::Array1& array; - int index; - UnityEngineRaycastHitArray1Iterator(System::Array1& array, int32_t index); - UnityEngineRaycastHitArray1Iterator& operator++(); - bool operator!=(const UnityEngineRaycastHitArray1Iterator& other); - UnityEngine::RaycastHit operator*(); - }; + struct IEnumerator : virtual System::Object + { + IEnumerator(decltype(nullptr)); + IEnumerator(Plugin::InternalUse, int32_t handle); + IEnumerator(const IEnumerator& other); + IEnumerator(IEnumerator&& other); + virtual ~IEnumerator(); + IEnumerator& operator=(const IEnumerator& other); + IEnumerator& operator=(decltype(nullptr)); + IEnumerator& operator=(IEnumerator&& other); + bool operator==(const IEnumerator& other) const; + bool operator!=(const IEnumerator& other) const; + System::Object GetCurrent(); + System::Boolean MoveNext(); + }; + } } namespace System { - Plugin::UnityEngineRaycastHitArray1Iterator begin(System::Array1& array); - Plugin::UnityEngineRaycastHitArray1Iterator end(System::Array1& array); -} - -namespace Plugin -{ - template<> struct ArrayElementProxy1_1 + namespace Runtime { - int32_t Handle; - int32_t Index0; - ArrayElementProxy1_1(Plugin::InternalUse, int32_t handle, int32_t index0); - void operator=(UnityEngine::GradientColorKey item); - operator UnityEngine::GradientColorKey(); - }; + namespace Serialization + { + struct ISerializable : virtual System::Object + { + ISerializable(decltype(nullptr)); + ISerializable(Plugin::InternalUse, int32_t handle); + ISerializable(const ISerializable& other); + ISerializable(ISerializable&& other); + virtual ~ISerializable(); + ISerializable& operator=(const ISerializable& other); + ISerializable& operator=(decltype(nullptr)); + ISerializable& operator=(ISerializable&& other); + bool operator==(const ISerializable& other) const; + bool operator!=(const ISerializable& other) const; + }; + } + } } namespace System { - template<> struct Array1 : virtual System::Array, virtual System::ICloneable, virtual System::Collections::IList, virtual System::Collections::Generic::IList + namespace Runtime { - Array1(decltype(nullptr)); - Array1(Plugin::InternalUse, int32_t handle); - Array1(const Array1& other); - Array1(Array1&& other); - virtual ~Array1(); - Array1& operator=(const Array1& other); - Array1& operator=(decltype(nullptr)); - Array1& operator=(Array1&& other); - bool operator==(const Array1& other) const; - bool operator!=(const Array1& other) const; - int32_t InternalLength; - Array1(System::Int32 length0); - System::Int32 GetLength(); - System::Int32 GetRank(); - Plugin::ArrayElementProxy1_1 operator[](int32_t index); - }; + namespace InteropServices + { + struct _Exception : virtual System::Object + { + _Exception(decltype(nullptr)); + _Exception(Plugin::InternalUse, int32_t handle); + _Exception(const _Exception& other); + _Exception(_Exception&& other); + virtual ~_Exception(); + _Exception& operator=(const _Exception& other); + _Exception& operator=(decltype(nullptr)); + _Exception& operator=(_Exception&& other); + bool operator==(const _Exception& other) const; + bool operator!=(const _Exception& other) const; + }; + } + } } -namespace Plugin +namespace UnityEngine { - struct UnityEngineGradientColorKeyArray1Iterator + struct GameObject : virtual UnityEngine::Object { - System::Array1& array; - int index; - UnityEngineGradientColorKeyArray1Iterator(System::Array1& array, int32_t index); - UnityEngineGradientColorKeyArray1Iterator& operator++(); - bool operator!=(const UnityEngineGradientColorKeyArray1Iterator& other); - UnityEngine::GradientColorKey operator*(); + GameObject(decltype(nullptr)); + GameObject(Plugin::InternalUse, int32_t handle); + GameObject(const GameObject& other); + GameObject(GameObject&& other); + virtual ~GameObject(); + GameObject& operator=(const GameObject& other); + GameObject& operator=(decltype(nullptr)); + GameObject& operator=(GameObject&& other); + bool operator==(const GameObject& other) const; + bool operator!=(const GameObject& other) const; + template MT0 AddComponent(); + static UnityEngine::GameObject CreatePrimitive(UnityEngine::PrimitiveType type); }; } -namespace System -{ - Plugin::UnityEngineGradientColorKeyArray1Iterator begin(System::Array1& array); - Plugin::UnityEngineGradientColorKeyArray1Iterator end(System::Array1& array); -} - -namespace System +namespace UnityEngine { - struct Action : virtual System::Object + struct Debug : virtual System::Object { - Action(decltype(nullptr)); - Action(Plugin::InternalUse, int32_t handle); - Action(const Action& other); - Action(Action&& other); - virtual ~Action(); - Action& operator=(const Action& other); - Action& operator=(decltype(nullptr)); - Action& operator=(Action&& other); - bool operator==(const Action& other) const; - bool operator!=(const Action& other) const; - int32_t CppHandle; - int32_t ClassHandle; - Action(); - void operator+=(System::Action& del); - void operator-=(System::Action& del); - virtual void operator()(); - void Invoke(); + Debug(decltype(nullptr)); + Debug(Plugin::InternalUse, int32_t handle); + Debug(const Debug& other); + Debug(Debug&& other); + virtual ~Debug(); + Debug& operator=(const Debug& other); + Debug& operator=(decltype(nullptr)); + Debug& operator=(Debug&& other); + bool operator==(const Debug& other) const; + bool operator!=(const Debug& other) const; + static void Log(System::Object& message); }; } -namespace System +namespace UnityEngine { - template<> struct Action1 : virtual System::Object + struct Behaviour : virtual UnityEngine::Component { - Action1(decltype(nullptr)); - Action1(Plugin::InternalUse, int32_t handle); - Action1(const Action1& other); - Action1(Action1&& other); - virtual ~Action1(); - Action1& operator=(const Action1& other); - Action1& operator=(decltype(nullptr)); - Action1& operator=(Action1&& other); - bool operator==(const Action1& other) const; - bool operator!=(const Action1& other) const; - int32_t CppHandle; - int32_t ClassHandle; - Action1(); - void operator+=(System::Action1& del); - void operator-=(System::Action1& del); - virtual void operator()(System::Single obj); - void Invoke(System::Single obj); + Behaviour(decltype(nullptr)); + Behaviour(Plugin::InternalUse, int32_t handle); + Behaviour(const Behaviour& other); + Behaviour(Behaviour&& other); + virtual ~Behaviour(); + Behaviour& operator=(const Behaviour& other); + Behaviour& operator=(decltype(nullptr)); + Behaviour& operator=(Behaviour&& other); + bool operator==(const Behaviour& other) const; + bool operator!=(const Behaviour& other) const; }; } -namespace System +namespace UnityEngine { - template<> struct Action2 : virtual System::Object + struct MonoBehaviour : virtual UnityEngine::Behaviour { - Action2(decltype(nullptr)); - Action2(Plugin::InternalUse, int32_t handle); - Action2(const Action2& other); - Action2(Action2&& other); - virtual ~Action2(); - Action2& operator=(const Action2& other); - Action2& operator=(decltype(nullptr)); - Action2& operator=(Action2&& other); - bool operator==(const Action2& other) const; - bool operator!=(const Action2& other) const; - int32_t CppHandle; - int32_t ClassHandle; - Action2(); - void operator+=(System::Action2& del); - void operator-=(System::Action2& del); - virtual void operator()(System::Single arg1, System::Single arg2); - void Invoke(System::Single arg1, System::Single arg2); + MonoBehaviour(decltype(nullptr)); + MonoBehaviour(Plugin::InternalUse, int32_t handle); + MonoBehaviour(const MonoBehaviour& other); + MonoBehaviour(MonoBehaviour&& other); + virtual ~MonoBehaviour(); + MonoBehaviour& operator=(const MonoBehaviour& other); + MonoBehaviour& operator=(decltype(nullptr)); + MonoBehaviour& operator=(MonoBehaviour&& other); + bool operator==(const MonoBehaviour& other) const; + bool operator!=(const MonoBehaviour& other) const; + UnityEngine::Transform GetTransform(); }; } namespace System { - template<> struct Func3 : virtual System::Object + struct Exception : virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable { - Func3(decltype(nullptr)); - Func3(Plugin::InternalUse, int32_t handle); - Func3(const Func3& other); - Func3(Func3&& other); - virtual ~Func3(); - Func3& operator=(const Func3& other); - Func3& operator=(decltype(nullptr)); - Func3& operator=(Func3&& other); - bool operator==(const Func3& other) const; - bool operator!=(const Func3& other) const; - int32_t CppHandle; - int32_t ClassHandle; - Func3(); - void operator+=(System::Func3& del); - void operator-=(System::Func3& del); - virtual System::Double operator()(System::Int32 arg1, System::Single arg2); - System::Double Invoke(System::Int32 arg1, System::Single arg2); + Exception(decltype(nullptr)); + Exception(Plugin::InternalUse, int32_t handle); + Exception(const Exception& other); + Exception(Exception&& other); + virtual ~Exception(); + Exception& operator=(const Exception& other); + Exception& operator=(decltype(nullptr)); + Exception& operator=(Exception&& other); + bool operator==(const Exception& other) const; + bool operator!=(const Exception& other) const; + Exception(System::String& message); }; } namespace System { - template<> struct Func3 : virtual System::Object + struct SystemException : virtual System::Exception, virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable { - Func3(decltype(nullptr)); - Func3(Plugin::InternalUse, int32_t handle); - Func3(const Func3& other); - Func3(Func3&& other); - virtual ~Func3(); - Func3& operator=(const Func3& other); - Func3& operator=(decltype(nullptr)); - Func3& operator=(Func3&& other); - bool operator==(const Func3& other) const; - bool operator!=(const Func3& other) const; - int32_t CppHandle; - int32_t ClassHandle; - Func3(); - void operator+=(System::Func3& del); - void operator-=(System::Func3& del); - virtual System::String operator()(System::Int16 arg1, System::Int32 arg2); - System::String Invoke(System::Int16 arg1, System::Int32 arg2); + SystemException(decltype(nullptr)); + SystemException(Plugin::InternalUse, int32_t handle); + SystemException(const SystemException& other); + SystemException(SystemException&& other); + virtual ~SystemException(); + SystemException& operator=(const SystemException& other); + SystemException& operator=(decltype(nullptr)); + SystemException& operator=(SystemException&& other); + bool operator==(const SystemException& other) const; + bool operator!=(const SystemException& other) const; }; } namespace System { - struct AppDomainInitializer : virtual System::Object + struct NullReferenceException : virtual System::SystemException, virtual System::Runtime::InteropServices::_Exception, virtual System::Runtime::Serialization::ISerializable { - AppDomainInitializer(decltype(nullptr)); - AppDomainInitializer(Plugin::InternalUse, int32_t handle); - AppDomainInitializer(const AppDomainInitializer& other); - AppDomainInitializer(AppDomainInitializer&& other); - virtual ~AppDomainInitializer(); - AppDomainInitializer& operator=(const AppDomainInitializer& other); - AppDomainInitializer& operator=(decltype(nullptr)); - AppDomainInitializer& operator=(AppDomainInitializer&& other); - bool operator==(const AppDomainInitializer& other) const; - bool operator!=(const AppDomainInitializer& other) const; - int32_t CppHandle; - int32_t ClassHandle; - AppDomainInitializer(); - void operator+=(System::AppDomainInitializer& del); - void operator-=(System::AppDomainInitializer& del); - virtual void operator()(System::Array1& args); - void Invoke(System::Array1& args); + NullReferenceException(decltype(nullptr)); + NullReferenceException(Plugin::InternalUse, int32_t handle); + NullReferenceException(const NullReferenceException& other); + NullReferenceException(NullReferenceException&& other); + virtual ~NullReferenceException(); + NullReferenceException& operator=(const NullReferenceException& other); + NullReferenceException& operator=(decltype(nullptr)); + NullReferenceException& operator=(NullReferenceException&& other); + bool operator==(const NullReferenceException& other) const; + bool operator!=(const NullReferenceException& other) const; }; } namespace UnityEngine { - namespace Events + struct PrimitiveType { - struct UnityAction : virtual System::Object - { - UnityAction(decltype(nullptr)); - UnityAction(Plugin::InternalUse, int32_t handle); - UnityAction(const UnityAction& other); - UnityAction(UnityAction&& other); - virtual ~UnityAction(); - UnityAction& operator=(const UnityAction& other); - UnityAction& operator=(decltype(nullptr)); - UnityAction& operator=(UnityAction&& other); - bool operator==(const UnityAction& other) const; - bool operator!=(const UnityAction& other) const; - int32_t CppHandle; - int32_t ClassHandle; - UnityAction(); - void operator+=(UnityEngine::Events::UnityAction& del); - void operator-=(UnityEngine::Events::UnityAction& del); - virtual void operator()(); - void Invoke(); - }; - } + int32_t Value; + static const UnityEngine::PrimitiveType Sphere; + static const UnityEngine::PrimitiveType Capsule; + static const UnityEngine::PrimitiveType Cylinder; + static const UnityEngine::PrimitiveType Cube; + static const UnityEngine::PrimitiveType Plane; + static const UnityEngine::PrimitiveType Quad; + explicit PrimitiveType(int32_t value); + explicit operator int32_t() const; + bool operator==(PrimitiveType other); + bool operator!=(PrimitiveType other); + explicit operator System::Enum(); + explicit operator System::ValueType(); + explicit operator System::Object(); + explicit operator System::IFormattable(); + explicit operator System::IConvertible(); + explicit operator System::IComparable(); + }; } namespace UnityEngine { - namespace Events - { - template<> struct UnityAction2 : virtual System::Object - { - UnityAction2(decltype(nullptr)); - UnityAction2(Plugin::InternalUse, int32_t handle); - UnityAction2(const UnityAction2& other); - UnityAction2(UnityAction2&& other); - virtual ~UnityAction2(); - UnityAction2& operator=(const UnityAction2& other); - UnityAction2& operator=(decltype(nullptr)); - UnityAction2& operator=(UnityAction2&& other); - bool operator==(const UnityAction2& other) const; - bool operator!=(const UnityAction2& other) const; - int32_t CppHandle; - int32_t ClassHandle; - UnityAction2(); - void operator+=(UnityEngine::Events::UnityAction2& del); - void operator-=(UnityEngine::Events::UnityAction2& del); - virtual void operator()(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); - void Invoke(UnityEngine::SceneManagement::Scene& arg0, UnityEngine::SceneManagement::LoadSceneMode arg1); - }; - } -} - -namespace System -{ - namespace ComponentModel - { - namespace Design - { - struct ComponentEventHandler : virtual System::Object - { - ComponentEventHandler(decltype(nullptr)); - ComponentEventHandler(Plugin::InternalUse, int32_t handle); - ComponentEventHandler(const ComponentEventHandler& other); - ComponentEventHandler(ComponentEventHandler&& other); - virtual ~ComponentEventHandler(); - ComponentEventHandler& operator=(const ComponentEventHandler& other); - ComponentEventHandler& operator=(decltype(nullptr)); - ComponentEventHandler& operator=(ComponentEventHandler&& other); - bool operator==(const ComponentEventHandler& other) const; - bool operator!=(const ComponentEventHandler& other) const; - int32_t CppHandle; - int32_t ClassHandle; - ComponentEventHandler(); - void operator+=(System::ComponentModel::Design::ComponentEventHandler& del); - void operator-=(System::ComponentModel::Design::ComponentEventHandler& del); - virtual void operator()(System::Object& sender, System::ComponentModel::Design::ComponentEventArgs& e); - void Invoke(System::Object& sender, System::ComponentModel::Design::ComponentEventArgs& e); - }; - } - } -} - -namespace System -{ - namespace ComponentModel + struct Time : virtual System::Object { - namespace Design - { - struct ComponentChangingEventHandler : virtual System::Object - { - ComponentChangingEventHandler(decltype(nullptr)); - ComponentChangingEventHandler(Plugin::InternalUse, int32_t handle); - ComponentChangingEventHandler(const ComponentChangingEventHandler& other); - ComponentChangingEventHandler(ComponentChangingEventHandler&& other); - virtual ~ComponentChangingEventHandler(); - ComponentChangingEventHandler& operator=(const ComponentChangingEventHandler& other); - ComponentChangingEventHandler& operator=(decltype(nullptr)); - ComponentChangingEventHandler& operator=(ComponentChangingEventHandler&& other); - bool operator==(const ComponentChangingEventHandler& other) const; - bool operator!=(const ComponentChangingEventHandler& other) const; - int32_t CppHandle; - int32_t ClassHandle; - ComponentChangingEventHandler(); - void operator+=(System::ComponentModel::Design::ComponentChangingEventHandler& del); - void operator-=(System::ComponentModel::Design::ComponentChangingEventHandler& del); - virtual void operator()(System::Object& sender, System::ComponentModel::Design::ComponentChangingEventArgs& e); - void Invoke(System::Object& sender, System::ComponentModel::Design::ComponentChangingEventArgs& e); - }; - } - } + Time(decltype(nullptr)); + Time(Plugin::InternalUse, int32_t handle); + Time(const Time& other); + Time(Time&& other); + virtual ~Time(); + Time& operator=(const Time& other); + Time& operator=(decltype(nullptr)); + Time& operator=(Time&& other); + bool operator==(const Time& other) const; + bool operator!=(const Time& other) const; + static System::Single GetDeltaTime(); + }; } -namespace System +namespace MyGame { - namespace ComponentModel + struct AbstractBaseBallScript : virtual UnityEngine::MonoBehaviour { - namespace Design - { - struct ComponentChangedEventHandler : virtual System::Object - { - ComponentChangedEventHandler(decltype(nullptr)); - ComponentChangedEventHandler(Plugin::InternalUse, int32_t handle); - ComponentChangedEventHandler(const ComponentChangedEventHandler& other); - ComponentChangedEventHandler(ComponentChangedEventHandler&& other); - virtual ~ComponentChangedEventHandler(); - ComponentChangedEventHandler& operator=(const ComponentChangedEventHandler& other); - ComponentChangedEventHandler& operator=(decltype(nullptr)); - ComponentChangedEventHandler& operator=(ComponentChangedEventHandler&& other); - bool operator==(const ComponentChangedEventHandler& other) const; - bool operator!=(const ComponentChangedEventHandler& other) const; - int32_t CppHandle; - int32_t ClassHandle; - ComponentChangedEventHandler(); - void operator+=(System::ComponentModel::Design::ComponentChangedEventHandler& del); - void operator-=(System::ComponentModel::Design::ComponentChangedEventHandler& del); - virtual void operator()(System::Object& sender, System::ComponentModel::Design::ComponentChangedEventArgs& e); - void Invoke(System::Object& sender, System::ComponentModel::Design::ComponentChangedEventArgs& e); - }; - } - } + AbstractBaseBallScript(decltype(nullptr)); + AbstractBaseBallScript(Plugin::InternalUse, int32_t handle); + AbstractBaseBallScript(const AbstractBaseBallScript& other); + AbstractBaseBallScript(AbstractBaseBallScript&& other); + virtual ~AbstractBaseBallScript(); + AbstractBaseBallScript& operator=(const AbstractBaseBallScript& other); + AbstractBaseBallScript& operator=(decltype(nullptr)); + AbstractBaseBallScript& operator=(AbstractBaseBallScript&& other); + bool operator==(const AbstractBaseBallScript& other) const; + bool operator!=(const AbstractBaseBallScript& other) const; + }; } -namespace System +namespace MyGame { - namespace ComponentModel - { - namespace Design - { - struct ComponentRenameEventHandler : virtual System::Object - { - ComponentRenameEventHandler(decltype(nullptr)); - ComponentRenameEventHandler(Plugin::InternalUse, int32_t handle); - ComponentRenameEventHandler(const ComponentRenameEventHandler& other); - ComponentRenameEventHandler(ComponentRenameEventHandler&& other); - virtual ~ComponentRenameEventHandler(); - ComponentRenameEventHandler& operator=(const ComponentRenameEventHandler& other); - ComponentRenameEventHandler& operator=(decltype(nullptr)); - ComponentRenameEventHandler& operator=(ComponentRenameEventHandler&& other); - bool operator==(const ComponentRenameEventHandler& other) const; - bool operator!=(const ComponentRenameEventHandler& other) const; - int32_t CppHandle; - int32_t ClassHandle; - ComponentRenameEventHandler(); - void operator+=(System::ComponentModel::Design::ComponentRenameEventHandler& del); - void operator-=(System::ComponentModel::Design::ComponentRenameEventHandler& del); - virtual void operator()(System::Object& sender, System::ComponentModel::Design::ComponentRenameEventArgs& e); - void Invoke(System::Object& sender, System::ComponentModel::Design::ComponentRenameEventArgs& e); - }; - } - } + struct BaseBallScript : virtual MyGame::AbstractBaseBallScript + { + BaseBallScript(decltype(nullptr)); + BaseBallScript(Plugin::InternalUse, int32_t handle); + BaseBallScript(const BaseBallScript& other); + BaseBallScript(BaseBallScript&& other); + virtual ~BaseBallScript(); + BaseBallScript& operator=(const BaseBallScript& other); + BaseBallScript& operator=(decltype(nullptr)); + BaseBallScript& operator=(BaseBallScript&& other); + bool operator==(const BaseBallScript& other) const; + bool operator!=(const BaseBallScript& other) const; + int32_t CppHandle; + BaseBallScript(); + virtual void Update(); + }; } /*END TYPE DEFINITIONS*/ +/*BEGIN MACROS*/ +#define MY_GAME_BALL_SCRIPT_DEFAULT_CONSTRUCTOR_DECLARATION \ + BallScript(Plugin::InternalUse iu, int32_t handle); + +#define MY_GAME_BALL_SCRIPT_DEFAULT_CONSTRUCTOR_DEFINITION \ + BallScript::BallScript(Plugin::InternalUse iu, int32_t handle) \ + : UnityEngine::Object(nullptr) \ + , UnityEngine::Component(nullptr) \ + , UnityEngine::Behaviour(nullptr) \ + , UnityEngine::MonoBehaviour(nullptr) \ + , MyGame::AbstractBaseBallScript(nullptr) \ + , MyGame::BaseBallScript(iu, handle) +#define MY_GAME_BALL_SCRIPT_DEFAULT_CONSTRUCTOR \ + BallScript(Plugin::InternalUse iu, int32_t handle) \ + : UnityEngine::Object(nullptr) \ + , UnityEngine::Component(nullptr) \ + , UnityEngine::Behaviour(nullptr) \ + , UnityEngine::MonoBehaviour(nullptr) \ + , MyGame::AbstractBaseBallScript(nullptr) \ + , MyGame::BaseBallScript(iu, handle) \ + { \ + } \ +/*END MACROS*/ + //////////////////////////////////////////////////////////////// // Support for using IEnumerable with range for loops //////////////////////////////////////////////////////////////// diff --git a/Unity/ProjectSettings/EditorBuildSettings.asset b/Unity/ProjectSettings/EditorBuildSettings.asset index 990bcc2..c813dae 100644 --- a/Unity/ProjectSettings/EditorBuildSettings.asset +++ b/Unity/ProjectSettings/EditorBuildSettings.asset @@ -5,6 +5,6 @@ EditorBuildSettings: m_ObjectHideFlags: 0 serializedVersion: 2 m_Scenes: - - enabled: 1 - path: Assets/TestScene.unity + - enabled: 0 + path: guid: 00000000000000000000000000000000 From ac7bb116bafcf57ededd6c0467b9bfcdd8382079 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Mon, 19 Mar 2018 00:29:04 -0700 Subject: [PATCH 58/95] Support type overloading and decimal --- README.md | 79 +- Unity/Assets/NativeScript/Bindings.cs | 133 + .../NativeScript/Editor/GenerateBindings.cs | 1669 +++++------ Unity/Assets/NativeScriptTypes.json | 155 + Unity/CppSource/NativeScript/Bindings.cpp | 2638 ++++++++++++++++- Unity/CppSource/NativeScript/Bindings.h | 643 ++++ 6 files changed, 4309 insertions(+), 1008 deletions(-) diff --git a/README.md b/README.md index dd0bb7b..d07f917 100644 --- a/README.md +++ b/README.md @@ -58,10 +58,11 @@ While IL2CPP transforms C# into C++ already, it generates a lot of overhead. The ## Industry Standard Language -C++ is the standard language for video games as well as many other fields. By programming in C++ you can more easily transfer your skills and code to and from non-Unity projects. For example, you can avoid lock-in by using the same language (C++) that you'd use in the Unreal or Lumberyard engines. +C++ is the standard language for video games as well as many other fields. By programming in C++ you can more easily transfer your skills and code to and from non-Unity projects. For example, you can avoid lock-in by using the same language (C++) that you'd use in the [Unreal](https://www.unrealengine.com) or [Lumberyard](https://aws.amazon.com/lumberyard/) engines. # UnityNativeScripting Features +* Code generator exposes any C# API to C++ * Supports Windows, macOS, Linux, iOS, and Android (editor and standalone) * Works with Unity 2017.x and 5.x * Plays nice with other C# scripts- no need to use 100% C++ @@ -85,26 +86,48 @@ C++ is the standard language for video games as well as many other fields. By pr * Platform-dependent compilation via the [usual flags](https://docs.unity3d.com/Manual/PlatformDependentCompilation.html) (e.g. `#if UNITY_EDITOR`) * [CMake](https://cmake.org/) build system sets up any IDE project or command-line build -* Code generator exposes any C# API (Unity, .NET, custom DLLs) with a simple JSON config file and runs from a menu in the Unity editor. It supports a wide range of features: - * Class types - * Struct types - * Enumeration types - * Base classes - * Constructors - * Methods - * Fields - * Properties (getters and setters) - * `out` and `ref` parameters - * Exceptions - * Overloaded operators - * Arrays (single- and multi-dimensional) - * Delegates - * Events - * Boxing and unboxing (e.g. casting `int` to `object` and visa versa) - * Implementing C# interfaces with C++ classes - * Deriving from C# classes with C++ classes - * Default parameters - * Generic types and methods + +# Code Generator + +The core of this project is a code generator. It generates C# and C++ code called "bindings" that make C# APIs available to C++ game code. It supports a wide range of language features: + +* Types + * `class` + * `struct` + * `enum` + * Arrays (single- and multi-dimensional) + * Delegates (e.g. `Action`) + * `decimal` +* Type Contents + * Constructors + * Methods + * Fields + * Properties (`get` and `set` like `obj.x`) + * Indexers (`get` and `set` like `obj[x]`) + * Events (`add` and `remove` delegates) + * Overloaded operators + * Boxing and unboxing (e.g. casting `int` to `object` and visa versa) +* Function Features + * `out` and `ref` parameters + * Generic types and methods + * Default parameters +* Cross-Language Features + * Exceptions (C# to C++ and C++ to C#) + * Implementing C# interfaces with C++ classes + * Deriving from C# classes with C++ classes + +Note that the code generator does not yet support: + +* `Array`, `string`, and `object` methods (e.g. `GetHashCode`) +* Non-null string default parameters and null non-string default parameters +* Implicit `params` parameter (a.k.a. "var args") passing +* C# pointers +* Nested types +* Down-casting + +To configure the code generator, open `Unity/Assets/NativeScriptTypes.json` and notice the existing examples. Add on to this file to expose more C# APIs from Unity, .NET, or custom DLLs to your C++ code. + +To run the code generator, choose `NativeScript > Generate Bindings` from the Unity editor. # Performance @@ -194,20 +217,6 @@ With C++, the workflow looks like this: 6. The build scripts or IDE project files are now generated in your build directory 7. Build as appropriate for your generator. For example, execute `make` if you chose `Unix Makefiles` as your generator. -# The Code Generator - -To run the code generator, choose `NativeScript > Generate Bindings` from the Unity editor. - -To configure the code generator, open `NativeScriptTypes.json` and notice the existing examples. Add on to this file to expose more C# APIs from Unity, .NET, or custom DLLs to your C++ code. - -Note that the code generator does not support (yet): - -* `Array`, `string`, and `object` methods (e.g. `GetHashCode`) -* Non-null string default parameters and null non-string default parameters -* Implicit `params` parameter (a.k.a. "var args") passing -* `decimal` -* C# pointers - # Updating To A New Version To update to a new version of this project, overwrite your Unity project's `Assets/NativeScript` directory with this project's `Unity/Assets/NativeScript` directory and re-run the code generator. diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 0b877fd..4d182da 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -334,6 +334,11 @@ delegate void InitDelegate( IntPtr enumerableGetEnumerator, /*BEGIN INIT PARAMS*/ int maxManagedObjects, + IntPtr releaseSystemDecimal, + IntPtr systemDecimalConstructorSystemDouble, + IntPtr systemDecimalConstructorSystemUInt64, + IntPtr boxDecimal, + IntPtr unboxDecimal, IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, IntPtr boxVector3, @@ -498,6 +503,11 @@ static extern void Init( IntPtr enumerableGetEnumerator, /*BEGIN INIT PARAMS*/ int maxManagedObjects, + IntPtr releaseSystemDecimal, + IntPtr systemDecimalConstructorSystemDouble, + IntPtr systemDecimalConstructorSystemUInt64, + IntPtr boxDecimal, + IntPtr unboxDecimal, IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, IntPtr boxVector3, @@ -570,6 +580,11 @@ IntPtr unboxDouble delegate int EnumerableGetEnumeratorDelegate(int handle); /*BEGIN DELEGATE TYPES*/ + delegate void ReleaseSystemDecimalDelegate(int handle); + delegate int SystemDecimalConstructorSystemDoubleDelegate(double value); + delegate int SystemDecimalConstructorSystemUInt64Delegate(ulong value); + delegate int BoxDecimalDelegate(int valHandle); + delegate int UnboxDecimalDelegate(int valHandle); delegate UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate(float x, float y, float z); delegate UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate(ref UnityEngine.Vector3 a, ref UnityEngine.Vector3 b); delegate int BoxVector3Delegate(ref UnityEngine.Vector3 val); @@ -641,6 +656,7 @@ public static void Open(int memorySize) { /*BEGIN STORE INIT CALLS*/ NativeScript.Bindings.ObjectStore.Init(1000); + NativeScript.Bindings.StructStore.Init(1000); /*END STORE INIT CALLS*/ // Allocate unmanaged memory @@ -744,6 +760,11 @@ private static void OpenPlugin(InitMode initMode) Marshal.GetFunctionPointerForDelegate(new EnumerableGetEnumeratorDelegate(EnumerableGetEnumerator)), /*BEGIN INIT CALL*/ 1000, + Marshal.GetFunctionPointerForDelegate(new ReleaseSystemDecimalDelegate(ReleaseSystemDecimal)), + Marshal.GetFunctionPointerForDelegate(new SystemDecimalConstructorSystemDoubleDelegate(SystemDecimalConstructorSystemDouble)), + Marshal.GetFunctionPointerForDelegate(new SystemDecimalConstructorSystemUInt64Delegate(SystemDecimalConstructorSystemUInt64)), + Marshal.GetFunctionPointerForDelegate(new BoxDecimalDelegate(BoxDecimal)), + Marshal.GetFunctionPointerForDelegate(new UnboxDecimalDelegate(UnboxDecimal)), Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)), Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate(UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)), Marshal.GetFunctionPointerForDelegate(new BoxVector3Delegate(BoxVector3)), @@ -918,6 +939,118 @@ static int EnumerableGetEnumerator(int handle) } /*BEGIN FUNCTIONS*/ + [MonoPInvokeCallback(typeof(ReleaseSystemDecimalDelegate))] + static void ReleaseSystemDecimal(int handle) + { + try + { + if (handle != 0) + { + NativeScript.Bindings.StructStore.Remove(handle); + } + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + } + } + + [MonoPInvokeCallback(typeof(SystemDecimalConstructorSystemDoubleDelegate))] + static int SystemDecimalConstructorSystemDouble(double value) + { + try + { + var returnValue = NativeScript.Bindings.StructStore.Store(new System.Decimal(value)); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(SystemDecimalConstructorSystemUInt64Delegate))] + static int SystemDecimalConstructorSystemUInt64(ulong value) + { + try + { + var returnValue = NativeScript.Bindings.StructStore.Store(new System.Decimal(value)); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(BoxDecimalDelegate))] + static int BoxDecimal(int valHandle) + { + try + { + var val = (System.Decimal)NativeScript.Bindings.StructStore.Get(valHandle); + var returnValue = NativeScript.Bindings.ObjectStore.Store((object)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + + [MonoPInvokeCallback(typeof(UnboxDecimalDelegate))] + static int UnboxDecimal(int valHandle) + { + try + { + var val = NativeScript.Bindings.ObjectStore.Get(valHandle); + var returnValue = NativeScript.Bindings.StructStore.Store((System.Decimal)val); + return returnValue; + } + catch (System.NullReferenceException ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpExceptionSystemNullReferenceException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + catch (System.Exception ex) + { + UnityEngine.Debug.LogException(ex); + NativeScript.Bindings.SetCsharpException(NativeScript.Bindings.ObjectStore.Store(ex)); + return default(int); + } + } + [MonoPInvokeCallback(typeof(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate))] static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(float x, float y, float z) { diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 42d933e..7bd5513 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -248,6 +248,13 @@ int IComparer.Compare(object x, object y) } } + struct TypeName + { + public string Name; + public string Namespace; + public int NumTypeParams; + } + const int DEFAULT_MAX_SIMULTANEOUS = 1000; const int DEFAULT_MAX_SIMULTANEOUS_OBJECTS = 1000; @@ -373,20 +380,10 @@ static void AppendStubs( foreach (JsonBaseType jsonBaseType in jsonType.BaseTypes) { string typeFullName = jsonType.Name; - string typeName; - string typeNamespace; - SplitJsonTypeName( - typeFullName, - out typeName, - out typeNamespace); + TypeName typeName = SplitJsonTypeName(typeFullName); string baseTypeFullName = jsonBaseType.BaseName; - string baseTypeName; - string baseTypeNamespace; - SplitJsonTypeName( - baseTypeFullName, - out baseTypeName, - out baseTypeNamespace); + TypeName baseTypeName = SplitJsonTypeName(baseTypeFullName); Type type = GetType(typeFullName, assemblies); @@ -395,12 +392,8 @@ static void AppendStubs( assemblies); AppendStubBaseType( - typeFullName, typeName, - typeNamespace, - baseTypeFullName, baseTypeName, - baseTypeNamespace, typeParams, type, timestamp, @@ -415,19 +408,15 @@ static void AppendStubs( } static void AppendStubBaseType( - string typeFullName, - string typeName, - string typeNamespace, - string baseTypeFullName, - string baseTypeName, - string baseTypeNamespace, + TypeName typeName, + TypeName baseTypeName, Type[] typeParams, Type type, string timestamp, StringBuilder output) { int indent = AppendNamespaceBeginning( - baseTypeNamespace, + baseTypeName.Namespace, output); AppendIndent(indent, output); if (type.IsClass) @@ -438,10 +427,9 @@ static void AppendStubBaseType( { output.Append("public interface "); } - output.Append(baseTypeName); + output.Append(baseTypeName.Name); output.Append(" : "); - AppendCsharpTypeName( - typeNamespace, + AppendCsharpTypeFullName( typeName, output); AppendCSharpTypeParameters( @@ -468,7 +456,7 @@ static void AppendStubBaseType( ParameterInfo[] ctorParams = ConvertParameters( ctor.GetParameters()); output.Append("\t\t"); - output.Append(baseTypeName); + output.Append(baseTypeName.Name); output.Append('('); AppendCsharpParams( ctorParams, @@ -552,19 +540,14 @@ static void DoPostCompileWork(bool canRefreshAssetDb) Type[] genericArgTypes = type.GetGenericArguments(); foreach (JsonBaseType jsonBaseType in jsonType.BaseTypes) { - string baseTypeName; - string baseTypeNamespace; - GetBaseTypeBaseNameAndNamespace( + TypeName baseTypeTypeName = GetBaseTypeBaseNameAndNamespace( jsonBaseType, type, genericArgTypes, - builders.TempStrBuilder, - out baseTypeName, - out baseTypeNamespace); + builders.TempStrBuilder); AppendBaseType( type, - baseTypeName, - baseTypeNamespace, + baseTypeTypeName, jsonBaseType, assemblies, defaultMaxSimultaneous, @@ -850,7 +833,7 @@ System.Reflection.ParameterInfo[] reflectionParams // Throw an exception so the user knows what to fix in the JSON StringBuilder errorBuilder = new StringBuilder(1024); errorBuilder.Append("Constructor \""); - AppendCsharpTypeName(type, errorBuilder); + AppendCsharpTypeFullName(type, errorBuilder); errorBuilder.Append('('); for (int i = 0; i < paramTypeNames.Length; ++i) { @@ -899,7 +882,7 @@ static MethodInfo GetMethod( // Throw an exception so the user knows what to fix in the JSON StringBuilder errorBuilder = new StringBuilder(1024); errorBuilder.Append("Method \""); - AppendCsharpTypeName(type, errorBuilder); + AppendCsharpTypeFullName(type, errorBuilder); errorBuilder.Append('.'); errorBuilder.Append(methodName); errorBuilder.Append('('); @@ -982,7 +965,7 @@ static void AppendCppConstructorInitializerList( indent, output); output.Append(separator); - AppendCppTypeName( + AppendCppTypeFullName( interfaceType, output); output.Append("(nullptr)"); @@ -1132,22 +1115,17 @@ static void AppendTypeNames( } } - static void GetBaseTypeBaseNameAndNamespace( + static TypeName GetBaseTypeBaseNameAndNamespace( JsonBaseType jsonBaseType, Type type, Type[] typeParams, - StringBuilder tempStringBuilder, - out string baseTypeName, - out string baseTypeNamespace) + StringBuilder tempStringBuilder) { // Get specified (optional) base type name - SplitJsonTypeName( - jsonBaseType.BaseName, - out baseTypeName, - out baseTypeNamespace); + TypeName baseTypeTypeName = SplitJsonTypeName(jsonBaseType.BaseName); // If base type name isn't provided, make one - if (string.IsNullOrEmpty(baseTypeName)) + if (string.IsNullOrEmpty(baseTypeTypeName.Name)) { tempStringBuilder.Length = 0; AppendNamespace( @@ -1161,8 +1139,11 @@ static void GetBaseTypeBaseNameAndNamespace( AppendTypeNames( typeParams, tempStringBuilder); - baseTypeName = tempStringBuilder.ToString(); + baseTypeTypeName.Name = tempStringBuilder.ToString(); } + + baseTypeTypeName.NumTypeParams = typeParams.Length; + return baseTypeTypeName; } static void AppendNamespace( @@ -1203,11 +1184,11 @@ static void AppendNamespace( } } - static void SplitJsonTypeName( - string fullName, - out string typeName, - out string typeNamespace) + static TypeName SplitJsonTypeName(string fullName) { + string typeName; + string typeNamespace; + // No full name if (string.IsNullOrEmpty(fullName)) { @@ -1230,6 +1211,8 @@ static void SplitJsonTypeName( typeNamespace = string.Empty; } } + + return GetTypeName(typeName, typeNamespace); } static ParameterInfo[] ConvertParameters( @@ -1294,6 +1277,38 @@ static ParameterInfo[] ConvertParameters( } return parameters; } + + static TypeName GetTypeName(Type type) + { + TypeName typeName; + typeName.Name = type.Name; + typeName.Namespace = type.Namespace; + typeName.NumTypeParams = type.GetGenericArguments().Length; + return typeName; + } + + static TypeName GetTypeName( + string name, + string namespaceName) + { + TypeName typeName; + typeName.Name = name; + typeName.Namespace = namespaceName; + typeName.NumTypeParams = 0; + return typeName; + } + + static TypeName GetTypeName( + string name, + string namespaceName, + int numTypeParams) + { + TypeName typeName; + typeName.Name = name; + typeName.Namespace = namespaceName; + typeName.NumTypeParams = numTypeParams; + return typeName; + } static bool IsStatic(Type type) { @@ -1441,9 +1456,7 @@ static int AppendType( if (!IsStatic(type)) { AppendCppTemplateDeclaration( - type.Name, - type.Namespace, - genericArgTypes.Length, + GetTypeName(type), builders.CppTemplateDeclarations); } @@ -1523,7 +1536,7 @@ static void AppendType( // C# StructStore Init call builders.CsharpStoreInitCalls.Append( "\t\t\tNativeScript.Bindings.StructStore<"); - AppendCsharpTypeName( + AppendCsharpTypeFullName( type, builders.CsharpStoreInitCalls); builders.CsharpStoreInitCalls.Append(">.Init("); @@ -1533,8 +1546,7 @@ static void AppendType( // Build function name suffix builders.TempStrBuilder.Length = 0; AppendReleaseFunctionNameSuffix( - type.Name, - type.Namespace, + GetTypeName(type), typeParams, builders.TempStrBuilder); string funcNameSuffix = builders.TempStrBuilder.ToString(); @@ -1543,8 +1555,7 @@ static void AppendType( builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("Release"); AppendReleaseFunctionNameSuffix( - type.Name, - type.Namespace, + GetTypeName(type), typeParams, builders.TempStrBuilder); string funcName = builders.TempStrBuilder.ToString(); @@ -1587,7 +1598,7 @@ static void AppendType( "if (handle != 0)\n\t\t\t{\n"); builders.CsharpFunctions.Append( "\t\t\t\tNativeScript.Bindings.StructStore<"); - AppendCsharpTypeName( + AppendCsharpTypeFullName( type, builders.CsharpFunctions); builders.CsharpFunctions.Append( @@ -1602,8 +1613,7 @@ static void AppendType( AppendCppFunctionPointerDefinition( funcName, true, - null, - null, + default(TypeName), TypeKind.None, parameters, typeof(void), @@ -1613,8 +1623,7 @@ static void AppendType( AppendCppInitParam( funcNameLower, true, - null, - null, + default(TypeName), TypeKind.None, parameters, typeof(void), @@ -1693,8 +1702,7 @@ static void AppendType( // C++ type declaration int indent = AppendCppTypeDeclaration( - type.Namespace, - type.Name, + GetTypeName(type), isStatic, typeParams, typeParams != null ? @@ -1736,12 +1744,10 @@ static void AppendType( } AppendCppTypeDefinitionBegin( - type.Name, - type.Namespace, + GetTypeName(type), typeKind, typeParams, - baseTypeName, - baseTypeNamespace, + GetTypeName(baseTypeName, baseTypeNamespace), baseTypeTypeParams, interfaceTypes, isStatic, @@ -1753,8 +1759,7 @@ static void AppendType( type, false); int cppMethodDefinitionsIndent = AppendCppMethodDefinitionsBegin( - type.Name, - type.Namespace, + GetTypeName(type), typeKind, typeParams, cppCtorInterfaceTypes, @@ -1931,8 +1936,7 @@ static void AppendType( static void AppendBaseType( Type type, - string cppBaseTypeName, - string cppBaseTypeNamespace, + TypeName cppBaseTypeTypeName, JsonBaseType jsonBaseType, Assembly[] assemblies, int defaultMaxSimultaneous, @@ -1950,8 +1954,7 @@ static void AppendBaseType( AppendBaseType( genericType, jsonBaseType, - cppBaseTypeName, - cppBaseTypeNamespace, + cppBaseTypeTypeName, typeParams, maxSimultaneous, assemblies, @@ -1962,8 +1965,7 @@ static void AppendBaseType( AppendBaseType( type, jsonBaseType, - cppBaseTypeName, - cppBaseTypeNamespace, + cppBaseTypeTypeName, null, maxSimultaneous, assemblies, @@ -1972,17 +1974,16 @@ static void AppendBaseType( } static void AppendReleaseFunctionNameSuffix( - string typeName, - string typeNamespace, + TypeName typeTypeName, Type[] typeParams, StringBuilder output) { AppendNamespace( - typeNamespace, + typeTypeName.Namespace, string.Empty, output); AppendTypeNameWithoutSuffixes( - typeName, + typeTypeName.Name, output); if (typeParams != null) { @@ -2010,20 +2011,17 @@ static void AppendEnum( { // C++ type declaration int indent = AppendCppTypeDeclaration( - type.Namespace, - type.Name, + GetTypeName(type), false, null, builders.CppTypeDeclarations); // C++ type definition (begin) AppendCppTypeDefinitionBegin( - type.Name, - type.Namespace, + GetTypeName(type), TypeKind.FullStruct, null, - null, - null, + default(TypeName), null, null, false, @@ -2051,7 +2049,7 @@ static void AppendEnum( indent + 1, builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append("static const "); - AppendCppTypeName( + AppendCppTypeFullName( type, builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append(' '); @@ -2134,7 +2132,7 @@ static void AppendEnum( AppendIndent( indent, builders.CppMethodDefinitions); - AppendCppTypeName( + AppendCppTypeFullName( type, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("::operator "); @@ -2164,7 +2162,7 @@ static void AppendEnum( indent, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("bool "); - AppendCppTypeName( + AppendCppTypeFullName( type, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("::operator==("); @@ -2192,7 +2190,7 @@ static void AppendEnum( indent, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("bool "); - AppendCppTypeName( + AppendCppTypeFullName( type, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("::operator!=("); @@ -2239,11 +2237,11 @@ static void AppendEnum( { FieldInfo field = fields[i]; builders.CppMethodDefinitions.Append("const "); - AppendCppTypeName( + AppendCppTypeFullName( type, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append(' '); - AppendCppTypeName( + AppendCppTypeFullName( type, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("::"); @@ -2406,8 +2404,7 @@ static void AppendBoxingBindings( AppendCppFunctionPointerDefinition( boxFuncName, true, - type.Name, - type.Namespace, + GetTypeName(type), typeKind, boxParams, typeof(object), @@ -2417,8 +2414,7 @@ static void AppendBoxingBindings( AppendCppInitParam( boxFuncNameLower, true, - type.Name, - type.Namespace, + GetTypeName(type), typeKind, boxParams, typeof(object), @@ -2453,7 +2449,7 @@ static void AppendUnboxing( builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("operator "); - AppendCppTypeName( + AppendCppTypeFullName( type, builders.TempStrBuilder); string unboxMethodDefinitionName = builders.TempStrBuilder.ToString(); @@ -2514,14 +2510,14 @@ static void AppendUnboxing( type, builders.CsharpFunctions); builders.CsharpFunctions.Append(".Store(("); - AppendCsharpTypeName( + AppendCsharpTypeFullName( type, builders.CsharpFunctions); builders.CsharpFunctions.Append(")val);"); break; default: builders.CsharpFunctions.Append('('); - AppendCsharpTypeName( + AppendCsharpTypeFullName( type, builders.CsharpFunctions); builders.CsharpFunctions.Append(")val;"); @@ -2539,8 +2535,7 @@ static void AppendUnboxing( AppendCppFunctionPointerDefinition( unboxFuncName, true, - type.Name, - type.Namespace, + GetTypeName(type), typeKind, unboxParams, type, @@ -2563,7 +2558,7 @@ static void AppendUnboxing( "System", builders.CppMethodDefinitions); AppendCppMethodDefinitionBegin( - "Object", + GetTypeName(typeof(object)), null, unboxMethodDefinitionName, null, @@ -2578,7 +2573,7 @@ static void AppendUnboxing( AppendIndent( indent + 1, builders.CppMethodDefinitions); - AppendCppTypeName( + AppendCppTypeFullName( type, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append(" returnVal("); @@ -2610,8 +2605,7 @@ static void AppendUnboxing( AppendCppInitParam( unboxFuncNameLower, true, - type.Name, - type.Namespace, + GetTypeName(type), typeKind, unboxParams, type, @@ -2632,7 +2626,7 @@ static void AppendCppBoxingMethodNames( { tempBuilder.Length = 0; tempBuilder.Append("operator "); - AppendCppTypeName( + AppendCppTypeFullName( baseType, tempBuilder); boxMethodDefinitionName = tempBuilder.ToString(); @@ -2675,7 +2669,7 @@ static void AppendCppBoxingMethodDefinition( StringBuilder output) { AppendCppMethodDefinitionBegin( - enclosingType.Name, + GetTypeName(enclosingType), null, boxMethodDefinitionName, enclosingTypeTypeParams, @@ -2719,8 +2713,7 @@ static void AppendCppBoxingMethodDefinition( indent + 2, output); AppendReferenceManagedHandleFunctionCall( - "Object", - "System", + GetTypeName(typeof(object)), TypeKind.Class, null, "handle", @@ -2730,7 +2723,7 @@ static void AppendCppBoxingMethodDefinition( indent + 2, output); output.Append("return "); - AppendCppTypeName( + AppendCppTypeFullName( boxedType, output); output.Append("(Plugin::InternalUse::Only, handle);\n"); @@ -2761,7 +2754,7 @@ static void AppendHandleStoreTypeName( if (IsManagedValueType(type)) { output.Append("StructStore<"); - AppendCsharpTypeName(type, output); + AppendCsharpTypeFullName(type, output); output.Append('>'); } else @@ -2839,6 +2832,15 @@ static void AppendConstructor( builders.TempStrBuilder[0] = char.ToLower( builders.TempStrBuilder[0]); string funcNameLower = builders.TempStrBuilder.ToString(); + + TypeName enclosingTypeTypeName = GetTypeName(enclosingType); + + // Build C++ constructor method name + builders.TempStrBuilder.Length = 0; + AppendCppTypeName( + enclosingTypeTypeName, + builders.TempStrBuilder); + string cppMethodName = builders.TempStrBuilder.ToString(); // C# init param declaration AppendCsharpInitParam( @@ -2879,7 +2881,7 @@ static void AppendConstructor( parameters, builders.CsharpFunctions); builders.CsharpFunctions.Append("new "); - AppendCsharpTypeName( + AppendCsharpTypeFullName( enclosingType, builders.CsharpFunctions); builders.CsharpFunctions.Append('('); @@ -2910,7 +2912,7 @@ static void AppendConstructor( builders.CsharpFunctions); builders.CsharpFunctions.Append( ".Store(new "); - AppendCsharpTypeName( + AppendCsharpTypeFullName( enclosingType, builders.CsharpFunctions); builders.CsharpFunctions.Append('('); @@ -2931,8 +2933,7 @@ static void AppendConstructor( AppendCppFunctionPointerDefinition( funcName, true, - enclosingType.Name, - enclosingType.Namespace, + enclosingTypeTypeName, enclosingTypeKind, parameters, enclosingType, @@ -2943,7 +2944,7 @@ static void AppendConstructor( indent + 1, builders.CppTypeDefinitions); AppendCppMethodDeclaration( - enclosingType.Name, + cppMethodName, enclosingTypeIsStatic, false, false, @@ -2954,15 +2955,15 @@ static void AppendConstructor( // C++ method definition AppendCppMethodDefinitionBegin( - enclosingType.Name, + GetTypeName(enclosingType), null, - enclosingType.Name, + cppMethodName, enclosingTypeParams, null, parameters, indent, builders.CppMethodDefinitions); - if (enclosingTypeKind != TypeKind.FullStruct) + if (enclosingTypeKind == TypeKind.Class) { AppendCppConstructorInitializerList( interfaceTypes, @@ -2975,8 +2976,7 @@ static void AppendConstructor( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( true, - enclosingType.Name, - enclosingType.Namespace, + GetTypeName(enclosingType), enclosingTypeKind, enclosingTypeParams, enclosingType, @@ -3013,8 +3013,7 @@ static void AppendConstructor( indent + 2, builders.CppMethodDefinitions); AppendReferenceManagedHandleFunctionCall( - enclosingType.Name, - enclosingType.Namespace, + GetTypeName(enclosingType), enclosingTypeKind, enclosingTypeParams, "returnValue", @@ -3039,8 +3038,7 @@ static void AppendConstructor( AppendCppInitParam( funcNameLower, true, - enclosingType.Name, - enclosingType.Namespace, + GetTypeName(enclosingType), enclosingTypeKind, parameters, enclosingType, @@ -3273,7 +3271,7 @@ static void AppendFullValueTypeFields( AppendIndent( indent, builders.CppTypeDefinitions); - AppendCppTypeName( + AppendCppTypeFullName( field.FieldType, builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append(' '); @@ -3476,8 +3474,7 @@ static void AppendEventAddRemoveMethod( AppendCppFunctionPointerDefinition( funcName, methodIsStatic, - enclosingType.Name, - enclosingType.Namespace, + GetTypeName(enclosingType), enclosingTypeKind, methodParams, typeof(void), @@ -3504,7 +3501,7 @@ static void AppendEventAddRemoveMethod( // C++ method definition AppendCppMethodDefinitionBegin( - enclosingType.Name, + GetTypeName(enclosingType), cppReturnType, cppMethodName, typeTypeParams, @@ -3518,8 +3515,7 @@ static void AppendEventAddRemoveMethod( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( methodIsStatic, - enclosingType.Name, - enclosingType.Namespace, + GetTypeName(enclosingType), enclosingTypeKind, typeTypeParams, typeof(void), @@ -3536,8 +3532,7 @@ static void AppendEventAddRemoveMethod( AppendCppInitParam( funcNameLower, methodIsStatic, - enclosingType.Name, - enclosingType.Namespace, + GetTypeName(enclosingType), enclosingTypeKind, methodParams, typeof(void), @@ -4036,8 +4031,7 @@ static void AppendMethod( AppendCppFunctionPointerDefinition( funcName, methodIsStatic, - enclosingType.Name, - enclosingType.Namespace, + GetTypeName(enclosingType), enclosingTypeKind, parameters, returnType, @@ -4074,7 +4068,7 @@ static void AppendMethod( case "op_Implicit": builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("operator "); - AppendCppTypeName( + AppendCppTypeFullName( returnType, builders.TempStrBuilder); cppMethodName = builders.TempStrBuilder.ToString(); @@ -4083,7 +4077,7 @@ static void AppendMethod( case "op_Explicit": builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("explicit operator "); - AppendCppTypeName( + AppendCppTypeFullName( returnType, builders.TempStrBuilder); cppMethodName = builders.TempStrBuilder.ToString(); @@ -4219,7 +4213,7 @@ static void AppendMethod( // C++ method definition AppendCppMethodDefinitionBegin( - enclosingType.Name, + GetTypeName(enclosingType), cppReturnType, cppMethodName, enclosingTypeParams, @@ -4233,8 +4227,7 @@ static void AppendMethod( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( methodIsStatic, - enclosingType.Name, - enclosingType.Namespace, + GetTypeName(enclosingType), enclosingTypeKind, enclosingTypeParams, returnType, @@ -4256,8 +4249,7 @@ static void AppendMethod( AppendCppInitParam( funcNameLower, methodIsStatic, - enclosingType.Name, - enclosingType.Namespace, + GetTypeName(enclosingType), enclosingTypeKind, parameters, returnType, @@ -4281,7 +4273,7 @@ StringBuilder output for (int i = 0; i < typeParams.Length; ++i) { Type typeParam = typeParams[i]; - AppendCsharpTypeName(typeParam, output); + AppendCsharpTypeFullName(typeParam, output); if (i != typeParams.Length - 1) { output.Append(", "); @@ -4301,7 +4293,7 @@ static void AppendCppTypeParameters( for (int i = 0; i < typeParams.Length; ++i) { Type typeParam = typeParams[i]; - AppendCppTypeName(typeParam, output); + AppendCppTypeFullName(typeParam, output); if (i != typeParams.Length - 1) { output.Append(", "); @@ -4472,7 +4464,7 @@ static void AppendArray( // Build array name with element type builders.TempStrBuilder.Append('<'); - AppendCppTypeName( + AppendCppTypeFullName( elementType, builders.TempStrBuilder); builders.TempStrBuilder.Append('>'); @@ -4489,11 +4481,14 @@ static void AppendArray( // Build "TypeArray" name builders.TempStrBuilder.Length = 0; - AppendBindingArrayTypeName( - elementType.Name, + AppendNamespace( elementType.Namespace, - cppArrayTypeName, + string.Empty, + builders.TempStrBuilder); + AppendTypeNameWithoutGenericSuffix( + elementType.Name, builders.TempStrBuilder); + builders.TempStrBuilder.Append(cppArrayTypeName); string bindingArrayTypeName = builders.TempStrBuilder.ToString(); // MakeArrayType() creates a Type for a "vector" @@ -4514,8 +4509,7 @@ static void AppendArray( // C++ type declaration int indent = AppendCppTypeDeclaration( - "System", - cppArrayTypeName, + GetTypeName(cppArrayTypeName, "System"), false, cppTypeParams, cppTypeParams != null ? @@ -4525,12 +4519,10 @@ static void AppendArray( // C++ type definition (beginning) Type[] interfaceTypes = GetDirectInterfaces(arrayType); AppendCppTypeDefinitionBegin( - cppArrayTypeName, - "System", + GetTypeName(cppArrayTypeName, "System"), TypeKind.Class, cppTypeParams, - "Array", - "System", + GetTypeName("Array", "System"), null, interfaceTypes, false, @@ -4542,8 +4534,7 @@ static void AppendArray( arrayType, false); int cppMethodDefinitionsIndent = AppendCppMethodDefinitionsBegin( - cppArrayTypeName, - "System", + GetTypeName(cppArrayTypeName, "System"), TypeKind.Class, cppTypeParams, cppCtorInitTypes, @@ -4693,8 +4684,7 @@ static void AppendArray( AppendCppArrayIndexOperatorMethodDefinition( 0, cppMethodDefinitionsIndent, - cppGenericArrayTypeName, - "System", + GetTypeName(cppGenericArrayTypeName, "System"), cppElementProxyTypeName, builders.CppMethodDefinitions); @@ -4751,7 +4741,7 @@ static void AppendArrayIterator( cppTypeDefinitions.Append(bindingArrayTypeName); cppTypeDefinitions.Append("Iterator& other);\n"); cppTypeDefinitions.Append("\t\t"); - AppendCppTypeName( + AppendCppTypeFullName( elementType, cppTypeDefinitions); cppTypeDefinitions.Append(" operator*();\n"); @@ -4812,7 +4802,7 @@ static void AppendArrayIterator( cppMethodDefinitions.Append("\t}\n"); cppMethodDefinitions.Append("\t\n"); cppMethodDefinitions.Append('\t'); - AppendCppTypeName( + AppendCppTypeFullName( elementType, cppMethodDefinitions); cppMethodDefinitions.Append(' '); @@ -4869,7 +4859,7 @@ static void AppendGenericEnumerableIterator( cppTypeDefinitions.Append("Iterator\n"); cppTypeDefinitions.Append("\t{\n"); cppTypeDefinitions.Append("\t\t"); - AppendCppTypeName( + AppendCppTypeFullName( enumeratorType, cppTypeDefinitions); cppTypeDefinitions.Append(" enumerator;\n"); @@ -4880,7 +4870,7 @@ static void AppendGenericEnumerableIterator( cppTypeDefinitions.Append("\t\t"); cppTypeDefinitions.Append(bindingEnumerableTypeName); cppTypeDefinitions.Append("Iterator("); - AppendCppTypeName( + AppendCppTypeFullName( enumerableType, cppTypeDefinitions); cppTypeDefinitions.Append("& enumerable);\n"); @@ -4894,7 +4884,7 @@ static void AppendGenericEnumerableIterator( cppTypeDefinitions.Append(bindingEnumerableTypeName); cppTypeDefinitions.Append("Iterator& other);\n"); cppTypeDefinitions.Append("\t\t"); - AppendCppTypeName( + AppendCppTypeFullName( elementType, cppTypeDefinitions); cppTypeDefinitions.Append(" operator*();\n"); @@ -4912,7 +4902,7 @@ static void AppendGenericEnumerableIterator( cppTypeDefinitions.Append("Plugin::"); cppTypeDefinitions.Append(bindingEnumerableTypeName); cppTypeDefinitions.Append("Iterator begin("); - AppendCppTypeName( + AppendCppTypeFullName( enumerableType, cppTypeDefinitions); cppTypeDefinitions.Append("& enumerable);\n"); @@ -4922,7 +4912,7 @@ static void AppendGenericEnumerableIterator( cppTypeDefinitions.Append("Plugin::"); cppTypeDefinitions.Append(bindingEnumerableTypeName); cppTypeDefinitions.Append("Iterator end("); - AppendCppTypeName( + AppendCppTypeFullName( enumerableType, cppTypeDefinitions); cppTypeDefinitions.Append("& enumerable);\n"); @@ -4949,7 +4939,7 @@ static void AppendGenericEnumerableIterator( cppMethodDefinitions.Append("Iterator::"); cppMethodDefinitions.Append(bindingEnumerableTypeName); cppMethodDefinitions.Append("Iterator("); - AppendCppTypeName( + AppendCppTypeFullName( enumerableType, cppMethodDefinitions); cppMethodDefinitions.Append("& enumerable)\n"); @@ -4992,7 +4982,7 @@ static void AppendGenericEnumerableIterator( cppMethodDefinitions.Append("\t}\n"); cppMethodDefinitions.Append("\t\n"); cppMethodDefinitions.Append('\t'); - AppendCppTypeName( + AppendCppTypeFullName( elementType, cppMethodDefinitions); cppMethodDefinitions.Append(' '); @@ -5015,7 +5005,7 @@ static void AppendGenericEnumerableIterator( cppMethodDefinitions.Append("Plugin::"); cppMethodDefinitions.Append(bindingEnumerableTypeName); cppMethodDefinitions.Append("Iterator begin("); - AppendCppTypeName( + AppendCppTypeFullName( enumerableType, cppMethodDefinitions); cppMethodDefinitions.Append("& enumerable)\n"); @@ -5043,7 +5033,7 @@ static void AppendGenericEnumerableIterator( cppMethodDefinitions.Append("Plugin::"); cppMethodDefinitions.Append(bindingEnumerableTypeName); cppMethodDefinitions.Append("Iterator end("); - AppendCppTypeName( + AppendCppTypeFullName( enumerableType, cppMethodDefinitions); cppMethodDefinitions.Append("& enumerable)\n"); @@ -5070,23 +5060,21 @@ static void AppendGenericEnumerableIterator( static void AppendCppArrayIndexOperatorMethodDefinition( int rank, int indent, - string enclosingTypeName, - string enclosingTypeNamespace, + TypeName enclosingTypeTypeName, string nextCppElementProxyTypeName, StringBuilder output) { AppendIndent( indent, output); - AppendCppTypeName( - "Plugin", - nextCppElementProxyTypeName, + AppendCppTypeFullName( + GetTypeName(nextCppElementProxyTypeName, "Plugin"), output); output.Append(' '); - output.Append(enclosingTypeNamespace); + output.Append(enclosingTypeTypeName.Namespace); output.Append("::"); AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + enclosingTypeTypeName.Name, output); output.Append("::operator[](int32_t index)\n"); AppendIndent( @@ -5135,28 +5123,12 @@ static void AppendCppArrayElementProxyName( output.Append('_'); output.Append(maxRank); output.Append('<'); - AppendCppTypeName( + AppendCppTypeFullName( elementType, output); output.Append('>'); } - - static void AppendBindingArrayTypeName( - string elementTypeName, - string elementTypeNamespace, - string cppArrayTypeName, - StringBuilder output) - { - AppendNamespace( - elementTypeNamespace, - string.Empty, - output); - AppendTypeNameWithoutGenericSuffix( - elementTypeName, - output); - output.Append(cppArrayTypeName); - } - + static ParameterInfo[] BuildArrayGetItemsParams( int rank, string indexName) @@ -5210,17 +5182,16 @@ static ParameterInfo[] BuildArraySetItemsParams( } static void AppendArrayGetItemFuncName( - string elementTypeName, - string elementTypeNamespace, + TypeName elementTypeTypeName, string bindingArrayTypeName, int rank, StringBuilder output) { AppendNamespace( - elementTypeNamespace, + elementTypeTypeName.Namespace, string.Empty, output); - output.Append(elementTypeName); + output.Append(elementTypeTypeName.Name); AppendTypeNameWithoutGenericSuffix( bindingArrayTypeName, output); @@ -5229,17 +5200,16 @@ static void AppendArrayGetItemFuncName( } static void AppendArraySetItemFuncName( - string elementTypeName, - string elementTypeNamespace, + TypeName elementTypeTypeName, string bindingArrayTypeName, int rank, StringBuilder output) { AppendNamespace( - elementTypeNamespace, + elementTypeTypeName.Namespace, string.Empty, output); - output.Append(elementTypeName); + output.Append(elementTypeTypeName.Name); AppendTypeNameWithoutGenericSuffix( bindingArrayTypeName, output); @@ -5277,8 +5247,7 @@ static void AppendArrayElementProxy( // GetItem name builders.TempStrBuilder.Length = 0; AppendArrayGetItemFuncName( - elementType.Name, - elementType.Namespace, + GetTypeName(elementType), cppArrayTypeName, rank, builders.TempStrBuilder); @@ -5287,8 +5256,7 @@ static void AppendArrayElementProxy( // SetItem name builders.TempStrBuilder.Length = 0; AppendArraySetItemFuncName( - elementType.Name, - elementType.Namespace, + GetTypeName(elementType), cppArrayTypeName, rank, builders.TempStrBuilder); @@ -5369,7 +5337,7 @@ static void AppendArrayElementProxy( indent + 1, builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append("void operator=("); - AppendCppTypeName( + AppendCppTypeFullName( elementType, builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append(" item);\n"); @@ -5377,7 +5345,7 @@ static void AppendArrayElementProxy( indent + 1, builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append("operator "); - AppendCppTypeName( + AppendCppTypeFullName( elementType, builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append("();\n"); @@ -5468,7 +5436,7 @@ static void AppendArrayElementProxy( builders.CppMethodDefinitions.Append(cppElementProxyTypeName); builders.CppMethodDefinitions.Append("::"); builders.CppMethodDefinitions.Append("operator=("); - AppendCppTypeName( + AppendCppTypeFullName( elementType, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append(" item)\n"); @@ -5478,8 +5446,7 @@ static void AppendArrayElementProxy( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( false, - cppArrayTypeName, - "System", + GetTypeName(cppArrayTypeName, "System"), TypeKind.Class, cppTypeParams, typeof(void), @@ -5503,7 +5470,7 @@ static void AppendArrayElementProxy( builders.CppMethodDefinitions.Append(cppElementProxyTypeName); builders.CppMethodDefinitions.Append("::"); builders.CppMethodDefinitions.Append("operator "); - AppendCppTypeName( + AppendCppTypeFullName( elementType, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("()\n"); @@ -5513,8 +5480,7 @@ static void AppendArrayElementProxy( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( false, - cppArrayTypeName, - "System", + GetTypeName(cppArrayTypeName, "System"), TypeKind.Class, cppTypeParams, elementType, @@ -5537,8 +5503,7 @@ static void AppendArrayElementProxy( AppendCppArrayIndexOperatorMethodDefinition( rank, cppMethodDefinitionsIndent, - cppElementProxyTypeName, - "Plugin", + GetTypeName(cppElementProxyTypeName, "Plugin"), nextCppElementProxyTypeName, builders.CppMethodDefinitions); } @@ -5587,6 +5552,10 @@ static void AppendArrayConstructor( info.Kind = TypeKind.Primitive; parameters[i] = info; } + + TypeName cppArrayTypeTypeName = GetTypeName( + cppArrayTypeName, + "System"); // C# Delegate Type AppendCsharpDelegateType( @@ -5621,7 +5590,7 @@ static void AppendArrayConstructor( arrayType, builders.CsharpFunctions); builders.CsharpFunctions.Append(".Store(new "); - AppendCsharpTypeName( + AppendCsharpTypeFullName( elementType, builders.CsharpFunctions); builders.CsharpFunctions.Append('['); @@ -5647,8 +5616,7 @@ static void AppendArrayConstructor( AppendCppFunctionPointerDefinition( funcName, true, - cppArrayTypeName, - "System", + cppArrayTypeTypeName, TypeKind.Class, parameters, arrayType, @@ -5658,8 +5626,7 @@ static void AppendArrayConstructor( AppendCppInitParam( funcNameLower, true, - cppArrayTypeName, - "System", + cppArrayTypeTypeName, TypeKind.Class, parameters, arrayType, @@ -5688,7 +5655,7 @@ static void AppendArrayConstructor( // C++ method definition Type[] cppTypeParams = { elementType }; AppendCppMethodDefinitionBegin( - cppArrayTypeName, + GetTypeName(cppArrayTypeName, "System"), null, cppArrayTypeName, cppTypeParams, @@ -5703,7 +5670,7 @@ static void AppendArrayConstructor( indent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append(separator); - AppendCppTypeName( + AppendCppTypeFullName( interfaceType, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("(nullptr)\n"); @@ -5715,8 +5682,7 @@ static void AppendArrayConstructor( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( true, - cppArrayTypeName, - "System", + cppArrayTypeTypeName, TypeKind.Class, cppTypeParams, arrayType, @@ -5743,8 +5709,7 @@ static void AppendArrayConstructor( indent + 2, builders.CppMethodDefinitions); AppendReferenceManagedHandleFunctionCall( - cppArrayTypeName, - "System", + cppArrayTypeTypeName, TypeKind.Class, cppTypeParams, "returnValue", @@ -5825,7 +5790,7 @@ static void AppendArrayCppGetLengthFunction( // C++ method definition AppendCppMethodDefinitionBegin( - cppArrayTypeName, + GetTypeName(cppArrayTypeName, "System"), typeof(int), "GetLength", cppTypeParams, @@ -5903,7 +5868,7 @@ static void AppendArrayCppGetRankFunction( // C++ method definition AppendCppMethodDefinitionBegin( - cppArrayTypeName, + GetTypeName(cppArrayTypeName, "System"), typeof(int), "GetRank", cppTypeParams, @@ -5966,6 +5931,10 @@ static void AppendArrayMultidimensionalGetLength( Kind = TypeKind.Primitive, } }; + + TypeName cppArrayTypeTypeName = GetTypeName( + cppArrayTypeName, + "System"); // C# Delegate Type AppendCsharpDelegateType( @@ -6010,8 +5979,7 @@ static void AppendArrayMultidimensionalGetLength( AppendCppFunctionPointerDefinition( funcName, false, - cppArrayTypeName, - "System", + cppArrayTypeTypeName, TypeKind.Class, parameters, arrayType, @@ -6021,8 +5989,7 @@ static void AppendArrayMultidimensionalGetLength( AppendCppInitParam( funcNameLower, false, - cppArrayTypeName, - "System", + cppArrayTypeTypeName, TypeKind.Class, parameters, arrayType, @@ -6051,7 +6018,7 @@ static void AppendArrayMultidimensionalGetLength( // C++ method definition Type[] cppTypeParams = { elementType }; AppendCppMethodDefinitionBegin( - cppArrayTypeName, + GetTypeName(cppArrayTypeName, "System"), typeof(int), "GetLength", cppTypeParams, @@ -6093,8 +6060,7 @@ static void AppendArrayMultidimensionalGetLength( builders.CppMethodDefinitions.Append("}\n"); AppendCppPluginFunctionCall( false, - cppArrayTypeName, - "System", + GetTypeName(cppArrayTypeName, "System"), TypeKind.Class, cppTypeParams, typeof(int), @@ -6132,8 +6098,7 @@ static void AppendArrayGetItem( { builders.TempStrBuilder.Length = 0; AppendArrayGetItemFuncName( - elementType.Name, - elementType.Namespace, + GetTypeName(elementType), cppArrayTypeName, rank, builders.TempStrBuilder); @@ -6194,13 +6159,16 @@ static void AppendArrayGetItem( null, false, builders.CsharpFunctions); - + + TypeName cppArrayTypeTypeName = GetTypeName( + "System", + cppArrayTypeName); + // C++ function pointer definition AppendCppFunctionPointerDefinition( funcName, false, - cppArrayTypeName, - "System", + cppArrayTypeTypeName, TypeKind.Class, parameters, elementType, @@ -6210,8 +6178,7 @@ static void AppendArrayGetItem( AppendCppInitParam( funcNameLower, false, - cppArrayTypeName, - "System", + cppArrayTypeTypeName, TypeKind.Class, parameters, elementType, @@ -6233,8 +6200,7 @@ static void AppendArraySetItem( { builders.TempStrBuilder.Length = 0; AppendArraySetItemFuncName( - elementType.Name, - elementType.Namespace, + GetTypeName(elementType), cppArrayTypeName, rank, builders.TempStrBuilder); @@ -6297,13 +6263,16 @@ static void AppendArraySetItem( null, false, builders.CsharpFunctions); - + + TypeName cppArrayTypeTypeName = GetTypeName( + "System", + cppArrayTypeName); + // C++ function pointer definition AppendCppFunctionPointerDefinition( funcName, false, - cppArrayTypeName, - "System", + cppArrayTypeTypeName, TypeKind.Class, parameters, arrayType, @@ -6313,8 +6282,7 @@ static void AppendArraySetItem( AppendCppInitParam( funcNameLower, false, - cppArrayTypeName, - "System", + cppArrayTypeTypeName, TypeKind.Class, parameters, arrayType, @@ -6336,26 +6304,14 @@ static void AppendDelegate( Type type = GetType( jsonDelegate.Type, assemblies); - Type[] genericArgTypes = type.GetGenericArguments(); if (jsonDelegate.GenericParams != null) { foreach (JsonGenericParams jsonGenericParams in jsonDelegate.GenericParams) { - // Build numbered C++ class name (e.g. Action2) - builders.TempStrBuilder.Length = 0; - AppendTypeNameWithoutSuffixes( - type.Name, - builders.TempStrBuilder); - builders.TempStrBuilder.Append( - jsonGenericParams.Types.Length); - string cppTypeName = builders.TempStrBuilder.ToString(); - // C++ template declaration AppendCppTemplateDeclaration( - cppTypeName, - type.Namespace, - genericArgTypes.Length, + GetTypeName(type), builders.CppTemplateDeclarations); } @@ -6367,11 +6323,12 @@ static void AppendDelegate( assemblies); Type genericType = type.MakeGenericType(typeParams); - // Build numbered C++ class name (e.g. Action2) + // Build numbered C++ class name (e.g. Action_2) builders.TempStrBuilder.Length = 0; AppendTypeNameWithoutSuffixes( type.Name, builders.TempStrBuilder); + builders.TempStrBuilder.Append('_'); builders.TempStrBuilder.Append( jsonGenericParams.Types.Length); string cppTypeName = builders.TempStrBuilder.ToString(); @@ -6404,7 +6361,7 @@ static void AppendDelegate( builders); } } - + static void AppendDelegate( Type type, string cppTypeName, @@ -6460,11 +6417,12 @@ static void AppendDelegate( builders.TempStrBuilder[0] = char.ToLower( builders.TempStrBuilder[0]); string removeFuncNameLower = builders.TempStrBuilder.ToString(); - + + TypeName typeTypeName = GetTypeName(type); + // C++ type declaration int indent = AppendCppTypeDeclaration( - type.Namespace, - cppTypeName, + typeTypeName, false, typeParams, typeParams != null ? @@ -6533,16 +6491,14 @@ static void AppendDelegate( }}; AppendCppPointerFreeListStateAndFunctions( - type.Namespace, + GetTypeName(cppTypeName, type.Namespace), typeParams, - cppTypeName, bindingTypeName, builders.CppGlobalStateAndFunctions); AppendCppPointerFreeListInit( - type.Namespace, typeParams, - cppTypeName, + GetTypeName(cppTypeName, type.Namespace), maxSimultaneous, bindingTypeName, builders.CppInitBody, @@ -6550,12 +6506,10 @@ static void AppendDelegate( // C++ type definition (begin) AppendCppTypeDefinitionBegin( - cppTypeName, - type.Namespace, + GetTypeName(cppTypeName, type.Namespace), TypeKind.Class, typeParams, - "Object", - "System", + GetTypeName(typeof(object)), null, null, false, @@ -6614,8 +6568,7 @@ static void AppendDelegate( AppendCppFunctionPointerDefinition( releaseFuncName, true, - null, - null, + default(TypeName), TypeKind.None, releaseParams, typeof(void), @@ -6623,8 +6576,7 @@ static void AppendDelegate( AppendCppFunctionPointerDefinition( constructorFuncName, true, - null, - null, + default(TypeName), TypeKind.None, constructorParams, typeof(void), @@ -6632,8 +6584,7 @@ static void AppendDelegate( AppendCppFunctionPointerDefinition( addFuncName, false, - null, - null, + default(TypeName), TypeKind.None, addRemoveParams, typeof(void), @@ -6641,8 +6592,7 @@ static void AppendDelegate( AppendCppFunctionPointerDefinition( removeFuncName, false, - null, - null, + default(TypeName), TypeKind.None, addRemoveParams, typeof(void), @@ -6652,8 +6602,7 @@ static void AppendDelegate( AppendCppInitParam( releaseFuncNameLower, true, - null, - null, + default(TypeName), TypeKind.None, releaseParams, typeof(void), @@ -6661,8 +6610,7 @@ static void AppendDelegate( AppendCppInitParam( constructorFuncNameLower, true, - null, - null, + default(TypeName), TypeKind.None, constructorParams, typeof(void), @@ -6670,8 +6618,7 @@ static void AppendDelegate( AppendCppInitParam( addFuncNameLower, false, - null, - null, + default(TypeName), TypeKind.None, addRemoveParams, typeof(void), @@ -6679,8 +6626,7 @@ static void AppendDelegate( AppendCppInitParam( removeFuncNameLower, false, - null, - null, + default(TypeName), TypeKind.None, addRemoveParams, typeof(void), @@ -6735,7 +6681,7 @@ static void AppendDelegate( AppendCppBaseTypeConstructor( bindingTypeName, - type.Namespace, + typeTypeName, TypeKind.Class, cppTypeName, typeParams, @@ -6749,7 +6695,7 @@ static void AppendDelegate( AppendCppBaseTypeNullptrConstructor( bindingTypeName, - cppTypeName, + typeTypeName, typeParams, new Type[0], true, @@ -6758,7 +6704,7 @@ static void AppendDelegate( AppendCppBaseTypeCopyConstructor( bindingTypeName, - cppTypeName, + typeTypeName, typeParams, new Type[0], true, @@ -6766,7 +6712,7 @@ static void AppendDelegate( builders.CppMethodDefinitions); AppendCppBaseTypeMoveConstructor( - cppTypeName, + typeTypeName, typeParams, new Type[0], true, @@ -6775,7 +6721,7 @@ static void AppendDelegate( AppendCppBaseTypeHandleConstructor( bindingTypeName, - cppTypeName, + typeTypeName, typeParams, new Type[0], true, @@ -6784,26 +6730,24 @@ static void AppendDelegate( AppendCppBaseTypeDestructor( bindingTypeName, - cppTypeName, + typeTypeName, typeParams, true, string.Empty, - string.Empty, releaseFuncName, bindingTypeName, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeAssignmentOperatorSameType( - type, - cppTypeName, + typeTypeName, typeParams, true, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeAssignmentOperatorNullptr( - cppTypeName, + typeTypeName, typeParams, true, releaseFuncName, @@ -6812,7 +6756,7 @@ static void AppendDelegate( AppendCppBaseTypeMoveAssignmentOperator( bindingTypeName, - cppTypeName, + typeTypeName, typeParams, true, releaseFuncName, @@ -6820,14 +6764,14 @@ static void AppendDelegate( builders.CppMethodDefinitions); AppendCppBaseTypeEqualityOperator( - cppTypeName, + typeTypeName, typeParams, cppMethodDefinitionsIndent, true, builders.CppMethodDefinitions); AppendCppBaseTypeInequalityOperator( - cppTypeName, + typeTypeName, typeParams, cppMethodDefinitionsIndent, true, @@ -6835,7 +6779,7 @@ static void AppendDelegate( // C++ add AppendCppMethodDefinitionBegin( - cppTypeName, + GetTypeName(type), typeof(void), "operator+=", typeParams, @@ -6867,7 +6811,7 @@ static void AppendDelegate( // C++ remove AppendCppMethodDefinitionBegin( - cppTypeName, + GetTypeName(type), typeof(void), "operator-=", typeParams, @@ -6899,8 +6843,7 @@ static void AppendDelegate( // C# GetDelegate call AppendCsharpGetDelegateCall( - type.Name, - type.Namespace, + GetTypeName(type), typeParams, "NativeInvoke", builders.CsharpGetDelegateCalls); @@ -6914,7 +6857,7 @@ static void AppendDelegate( // C# class fields builders.CsharpBaseTypes.Append("\tpublic int CppHandle;\n"); builders.CsharpBaseTypes.Append("\tpublic "); - AppendCsharpTypeName( + AppendCsharpTypeFullName( type, builders.CsharpBaseTypes); builders.CsharpBaseTypes.Append(" Delegate;\n"); @@ -6944,7 +6887,7 @@ static void AppendDelegate( AppendBaseTypeCppMethodCall( type, bindingTypeName, - cppTypeName, + typeTypeName, typeParams, invokeMethod, "NativeInvoke", @@ -6963,7 +6906,6 @@ static void AppendDelegate( AppendBaseTypeMethodCallsCsharpMethod( type, bindingTypeName, - cppTypeName, typeParams, invokeMethod, "Invoke", @@ -6983,8 +6925,7 @@ static void AppendDelegate( AppendCsharpBaseTypeConstructorFunction( type, - bindingTypeName, - string.Empty, + GetTypeName(bindingTypeName, string.Empty), false, constructorFuncName, constructorParams, @@ -7003,8 +6944,7 @@ static void AppendDelegate( AppendCsharpBaseTypeReleaseFunction( type, - bindingTypeName, - string.Empty, + GetTypeName(bindingTypeName, string.Empty), true, releaseFuncName, null, @@ -7082,30 +7022,31 @@ static void AppendDelegate( static void AppendBaseType( Type type, JsonBaseType jsonBaseType, - string baseTypeName, - string baseTypeNamespace, + TypeName baseTypeTypeName, Type[] typeParams, int maxSimultaneous, Assembly[] assemblies, StringBuilders builders) { // Get specified derived type name - string derivedTypeName; - string derivedTypeNamespace; - SplitJsonTypeName( - jsonBaseType.DerivedName, - out derivedTypeName, - out derivedTypeNamespace); + TypeName derivedTypeTypeName = SplitJsonTypeName( + jsonBaseType.DerivedName); builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("Release"); - builders.TempStrBuilder.Append(baseTypeName); + builders.TempStrBuilder.Append(baseTypeTypeName.Name); string releaseFuncName = builders.TempStrBuilder.ToString(); builders.TempStrBuilder[0] = char.ToLower( builders.TempStrBuilder[0]); string releaseFuncNameLower = builders.TempStrBuilder.ToString(); + builders.TempStrBuilder.Length = 0; + AppendCppTypeName( + baseTypeTypeName, + builders.TempStrBuilder); + string cppBaseTypeName = builders.TempStrBuilder.ToString(); + bool hasDefaultConstructor = !type.IsClass || (type.GetConstructor(new Type[0]) != null || type.GetConstructors().Length == 0); @@ -7122,7 +7063,7 @@ static void AppendBaseType( // Throw an exception so the user knows what to fix in the JSON StringBuilder errorBuilder = new StringBuilder(1024); errorBuilder.Append("Base type \""); - AppendCsharpTypeName( + AppendCsharpTypeFullName( type, errorBuilder); errorBuilder.Append( @@ -7153,7 +7094,7 @@ static void AppendBaseType( assemblies); builders.TempStrBuilder.Length = 0; - builders.TempStrBuilder.Append(baseTypeName); + builders.TempStrBuilder.Append(baseTypeTypeName.Name); builders.TempStrBuilder.Append("Constructor"); AppendTypeNames( paramTypes, @@ -7222,25 +7163,22 @@ static void AppendBaseType( } AppendCppPointerFreeListStateAndFunctions( - baseTypeNamespace, + baseTypeTypeName, null, - baseTypeName, - baseTypeName, + baseTypeTypeName.Name, builders.CppGlobalStateAndFunctions); AppendCppPointerFreeListInit( - baseTypeNamespace, null, - baseTypeName, + baseTypeTypeName, maxSimultaneous, - baseTypeName, + baseTypeTypeName.Name, builders.CppInitBody, builders.CppInitBodyFirstBoot); // C++ type declaration int indent = AppendCppTypeDeclaration( - baseTypeNamespace, - baseTypeName, + baseTypeTypeName, false, null, builders.CppTypeDeclarations); @@ -7258,12 +7196,10 @@ static void AppendBaseType( // C++ type definition (begin) AppendCppTypeDefinitionBegin( - baseTypeName, - baseTypeNamespace, + baseTypeTypeName, TypeKind.Class, null, - cppBaseClass.Name, - cppBaseClass.Namespace, + GetTypeName(cppBaseClass), cppBaseClassTypeParams, cppInterfaceTypes, false, @@ -7283,7 +7219,7 @@ static void AppendBaseType( indent + 1, builders.CppTypeDefinitions); AppendCppMethodDeclaration( - baseTypeName, + cppBaseTypeName, false, false, false, @@ -7296,32 +7232,32 @@ static void AppendBaseType( // C++ constructor declaration macro builders.CppMacros.Append("#define "); AppendUppercaseWithUnderscores( - derivedTypeNamespace, + derivedTypeTypeName.Namespace, builders.CppMacros); builders.CppMacros.Append('_'); AppendUppercaseWithUnderscores( - derivedTypeName, + derivedTypeTypeName.Name, builders.CppMacros); builders.CppMacros.Append("_DEFAULT_CONSTRUCTOR_DECLARATION \\\n"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append(derivedTypeName); + builders.CppMacros.Append(derivedTypeTypeName.Name); builders.CppMacros.Append("(Plugin::InternalUse iu, int32_t handle);\n"); builders.CppMacros.Append('\n'); // C++ constructor definition macro builders.CppMacros.Append("#define "); AppendUppercaseWithUnderscores( - derivedTypeNamespace, + derivedTypeTypeName.Namespace, builders.CppMacros); builders.CppMacros.Append('_'); AppendUppercaseWithUnderscores( - derivedTypeName, + derivedTypeTypeName.Name, builders.CppMacros); builders.CppMacros.Append("_DEFAULT_CONSTRUCTOR_DEFINITION \\\n"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append(derivedTypeName); + builders.CppMacros.Append(derivedTypeTypeName.Name); builders.CppMacros.Append("::"); - builders.CppMacros.Append(derivedTypeName); + builders.CppMacros.Append(derivedTypeTypeName.Name); builders.CppMacros.Append("(Plugin::InternalUse iu, int32_t handle) \\\n"); AppendCppConstructorInitializerList( cppCtorInitTypes, @@ -7330,24 +7266,23 @@ static void AppendBaseType( " \\\n"); AppendIndent(indent + 1, builders.CppMacros); builders.CppMacros.Append(", "); - AppendCppTypeName( - baseTypeNamespace, - baseTypeName, + AppendCppTypeFullName( + baseTypeTypeName, builders.CppMacros); builders.CppMacros.Append("(iu, handle)\n"); // C++ constructor inline definition macro builders.CppMacros.Append("#define "); AppendUppercaseWithUnderscores( - derivedTypeNamespace, + derivedTypeTypeName.Namespace, builders.CppMacros); builders.CppMacros.Append('_'); AppendUppercaseWithUnderscores( - derivedTypeName, + derivedTypeTypeName.Name, builders.CppMacros); builders.CppMacros.Append("_DEFAULT_CONSTRUCTOR \\\n"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append(derivedTypeName); + builders.CppMacros.Append(derivedTypeTypeName.Name); builders.CppMacros.Append("(Plugin::InternalUse iu, int32_t handle) \\\n"); AppendCppConstructorInitializerList( cppCtorInitTypes, @@ -7356,9 +7291,8 @@ static void AppendBaseType( " \\\n"); AppendIndent(indent + 1, builders.CppMacros); builders.CppMacros.Append(", "); - AppendCppTypeName( - baseTypeNamespace, - baseTypeName, + AppendCppTypeFullName( + baseTypeTypeName, builders.CppMacros); builders.CppMacros.Append("(iu, handle) \\\n"); AppendIndent(indent, builders.CppMacros); @@ -7371,8 +7305,7 @@ static void AppendBaseType( AppendCppFunctionPointerDefinition( releaseFuncName, true, - null, - null, + default(TypeName), TypeKind.None, releaseParams, typeof(void), @@ -7382,8 +7315,7 @@ static void AppendBaseType( AppendCppFunctionPointerDefinition( constructorFuncNames[i], true, - null, - null, + default(TypeName), TypeKind.None, constructorParams[i], typeof(void), @@ -7394,8 +7326,7 @@ static void AppendBaseType( AppendCppInitParam( releaseFuncNameLower, true, - null, - null, + default(TypeName), TypeKind.None, releaseParams, typeof(void), @@ -7405,8 +7336,7 @@ static void AppendBaseType( AppendCppInitParam( constructorFuncNameLowers[i], true, - null, - null, + default(TypeName), TypeKind.None, constructorParams[i], typeof(void), @@ -7442,16 +7372,16 @@ static void AppendBaseType( // C++ method definitions (end) int cppMethodDefinitionsIndent = AppendNamespaceBeginning( - baseTypeNamespace, + baseTypeTypeName.Namespace, builders.CppMethodDefinitions); for (int i = 0; i < numConstructors; ++i) { AppendCppBaseTypeConstructor( - baseTypeName, - baseTypeNamespace, + baseTypeTypeName.Name, + baseTypeTypeName, TypeKind.Class, - baseTypeName, + cppBaseTypeName, typeParams, cppCtorInitTypes, cppConstructorParams[i], @@ -7463,8 +7393,8 @@ static void AppendBaseType( } AppendCppBaseTypeNullptrConstructor( - baseTypeName, - baseTypeName, + baseTypeTypeName.Name, + baseTypeTypeName, typeParams, cppCtorInitTypes, false, @@ -7472,8 +7402,8 @@ static void AppendBaseType( builders.CppMethodDefinitions); AppendCppBaseTypeCopyConstructor( - baseTypeName, - baseTypeName, + baseTypeTypeName.Name, + baseTypeTypeName, typeParams, cppCtorInitTypes, false, @@ -7481,7 +7411,7 @@ static void AppendBaseType( builders.CppMethodDefinitions); AppendCppBaseTypeMoveConstructor( - baseTypeName, + baseTypeTypeName, typeParams, cppCtorInitTypes, false, @@ -7489,8 +7419,8 @@ static void AppendBaseType( builders.CppMethodDefinitions); AppendCppBaseTypeHandleConstructor( - baseTypeName, - baseTypeName, + baseTypeTypeName.Name, + baseTypeTypeName, typeParams, cppCtorInitTypes, false, @@ -7498,27 +7428,25 @@ static void AppendBaseType( builders.CppMethodDefinitions); AppendCppBaseTypeDestructor( - baseTypeName, - baseTypeName, + baseTypeTypeName.Name, + baseTypeTypeName, typeParams, false, - derivedTypeName, - derivedTypeNamespace, + derivedTypeTypeName.Name, releaseFuncName, - baseTypeName, + baseTypeTypeName.Name, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeAssignmentOperatorSameType( - type, - baseTypeName, + baseTypeTypeName, typeParams, false, cppMethodDefinitionsIndent, builders.CppMethodDefinitions); AppendCppBaseTypeAssignmentOperatorNullptr( - baseTypeName, + baseTypeTypeName, typeParams, false, releaseFuncName, @@ -7526,8 +7454,8 @@ static void AppendBaseType( builders.CppMethodDefinitions); AppendCppBaseTypeMoveAssignmentOperator( - baseTypeName, - baseTypeName, + baseTypeTypeName.Name, + baseTypeTypeName, typeParams, false, releaseFuncName, @@ -7535,38 +7463,37 @@ static void AppendBaseType( builders.CppMethodDefinitions); AppendCppBaseTypeEqualityOperator( - baseTypeName, + baseTypeTypeName, typeParams, cppMethodDefinitionsIndent, false, builders.CppMethodDefinitions); AppendCppBaseTypeInequalityOperator( - baseTypeName, + baseTypeTypeName, typeParams, cppMethodDefinitionsIndent, false, builders.CppMethodDefinitions); - if (!string.IsNullOrEmpty(derivedTypeName)) + if (!string.IsNullOrEmpty(derivedTypeTypeName.Name)) { // C++ whole object free list AppendCppWholeObjectFreeListStateAndFunctions( null, - baseTypeName, - baseTypeNamespace, - baseTypeName, + baseTypeTypeName, + baseTypeTypeName.Name, builders.CppGlobalStateAndFunctions); AppendCppWholeObjectFreeListInit( maxSimultaneous, - baseTypeName, + baseTypeTypeName.Name, builders.CppInitBody, builders.CppInitBodyFirstBoot); // C++ binding function to create the base class builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("New"); - builders.TempStrBuilder.Append(baseTypeName); + builders.TempStrBuilder.Append(baseTypeTypeName.Name); string cppDefaultConstructorBindingFunctionName = builders.TempStrBuilder.ToString(); AppendIndent( indent, @@ -7581,24 +7508,21 @@ static void AppendBaseType( AppendIndent( indent + 1, builders.CppMethodDefinitions); - AppendCppTypeName( - baseTypeNamespace, - baseTypeName, + AppendCppTypeFullName( + baseTypeTypeName, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("* memory = Plugin::StoreWhole"); - builders.CppMethodDefinitions.Append(baseTypeName); + builders.CppMethodDefinitions.Append(baseTypeTypeName.Name); builders.CppMethodDefinitions.Append("();\n"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - AppendCppTypeName( - derivedTypeNamespace, - derivedTypeName, + AppendCppTypeFullName( + derivedTypeTypeName, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("* thiz = new (memory) "); - AppendCppTypeName( - derivedTypeNamespace, - derivedTypeName, + AppendCppTypeFullName( + derivedTypeTypeName, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("(Plugin::InternalUse::Only, handle);\n"); AppendIndent( @@ -7615,8 +7539,7 @@ static void AppendBaseType( new Type[] { typeof(int) }); AppendCsharpDelegate( true, - string.Empty, - string.Empty, + GetTypeName(string.Empty, string.Empty), null, cppDefaultConstructorBindingFunctionName, cppDefaultConstructorBindingFunctionParams, @@ -7624,15 +7547,13 @@ static void AppendBaseType( TypeKind.None, builders.CsharpDelegates); AppendCsharpImport( - string.Empty, - string.Empty, + GetTypeName(string.Empty, string.Empty), null, cppDefaultConstructorBindingFunctionName, cppDefaultConstructorBindingFunctionParams, builders.CsharpImports); AppendCsharpGetDelegateCall( - string.Empty, - string.Empty, + GetTypeName(string.Empty, string.Empty), null, cppDefaultConstructorBindingFunctionName, builders.CsharpGetDelegateCalls); @@ -7640,7 +7561,7 @@ static void AppendBaseType( // C++ binding function to destroy the base class builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("Destroy"); - builders.TempStrBuilder.Append(baseTypeName); + builders.TempStrBuilder.Append(baseTypeTypeName.Name); string cppDestroyBindingFunctionName = builders.TempStrBuilder.ToString(); AppendIndent( indent, @@ -7655,20 +7576,18 @@ static void AppendBaseType( AppendIndent( indent + 1, builders.CppMethodDefinitions); - AppendCppTypeName( - string.Empty, - baseTypeName, + AppendCppTypeFullName( + baseTypeTypeName, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("* instance = Plugin::Get"); - builders.CppMethodDefinitions.Append(baseTypeName); + builders.CppMethodDefinitions.Append(baseTypeTypeName.Name); builders.CppMethodDefinitions.Append("(cppHandle);\n"); AppendIndent( indent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("instance->~"); AppendCppTypeName( - string.Empty, - baseTypeName, + baseTypeTypeName, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("();\n"); AppendIndent( @@ -7681,8 +7600,7 @@ static void AppendBaseType( new Type[] { typeof(int) }); AppendCsharpDelegate( true, - string.Empty, - string.Empty, + GetTypeName(string.Empty, string.Empty), null, cppDestroyBindingFunctionName, cppDestroyBindingFunctionParams, @@ -7690,27 +7608,25 @@ static void AppendBaseType( TypeKind.None, builders.CsharpDelegates); AppendCsharpImport( - string.Empty, - string.Empty, + GetTypeName(string.Empty, string.Empty), null, cppDestroyBindingFunctionName, cppDestroyBindingFunctionParams, builders.CsharpImports); AppendCsharpGetDelegateCall( - string.Empty, - string.Empty, + GetTypeName(string.Empty, string.Empty), null, cppDestroyBindingFunctionName, builders.CsharpGetDelegateCalls); // C# DestroyFunction enumerator builders.CsharpDestroyFunctionEnumerators.Append("\t\t\t"); - builders.CsharpDestroyFunctionEnumerators.Append(baseTypeName); + builders.CsharpDestroyFunctionEnumerators.Append(baseTypeTypeName.Name); builders.CsharpDestroyFunctionEnumerators.Append(",\n"); // C# Destroy queue cases builders.CsharpDestroyQueueCases.Append("\t\t\t\t\t\tcase DestroyFunction."); - builders.CsharpDestroyQueueCases.Append(baseTypeName); + builders.CsharpDestroyQueueCases.Append(baseTypeTypeName.Name); builders.CsharpDestroyQueueCases.Append(":\n"); builders.CsharpDestroyQueueCases.Append("\t\t\t\t\t\t\t"); builders.CsharpDestroyQueueCases.Append(cppDestroyBindingFunctionName); @@ -7720,15 +7636,15 @@ static void AppendBaseType( // C# class (beginning) builders.CsharpBaseTypes.Append("namespace "); - builders.CsharpBaseTypes.Append(baseTypeNamespace); + builders.CsharpBaseTypes.Append(baseTypeTypeName.Namespace); builders.CsharpBaseTypes.Append('\n'); builders.CsharpBaseTypes.Append("{\n"); builders.CsharpBaseTypes.Append("\tclass "); - builders.CsharpBaseTypes.Append(baseTypeName); + builders.CsharpBaseTypes.Append(baseTypeTypeName.Name); if (jsonBaseType != null) { builders.CsharpBaseTypes.Append(" : "); - AppendCsharpTypeName( + AppendCsharpTypeFullName( type, builders.CsharpBaseTypes); } @@ -7739,20 +7655,20 @@ static void AppendBaseType( builders.CsharpBaseTypes.Append("\t\tpublic int CppHandle;\n"); builders.CsharpBaseTypes.Append("\t\t\n"); - if (derivedTypeName != null) + if (derivedTypeTypeName.Name != null) { // C# class default constructor if the base class has one if (hasDefaultConstructor) { builders.CsharpBaseTypes.Append("\t\tpublic "); - builders.CsharpBaseTypes.Append(baseTypeName); + builders.CsharpBaseTypes.Append(baseTypeTypeName.Name); builders.CsharpBaseTypes.Append("()\n"); builders.CsharpBaseTypes.Append("\t\t{\n"); builders.CsharpBaseTypes.Append( "\t\t\tint handle = NativeScript.Bindings.ObjectStore.Store(this);\n"); builders.CsharpBaseTypes.Append( "\t\t\tCppHandle = NativeScript.Bindings.New"); - builders.CsharpBaseTypes.Append(baseTypeName); + builders.CsharpBaseTypes.Append(baseTypeTypeName.Name); builders.CsharpBaseTypes.Append("(handle);\n"); builders.CsharpBaseTypes.Append("\t\t}\n"); builders.CsharpBaseTypes.Append("\t\t\n"); @@ -7760,14 +7676,14 @@ static void AppendBaseType( // C# finalizer/destructor builders.CsharpBaseTypes.Append("\t\t~"); - builders.CsharpBaseTypes.Append(baseTypeName); + builders.CsharpBaseTypes.Append(baseTypeTypeName.Name); builders.CsharpBaseTypes.Append("()\n"); builders.CsharpBaseTypes.Append("\t\t{\n"); builders.CsharpBaseTypes.Append("\t\t\tif (CppHandle != 0)\n"); builders.CsharpBaseTypes.Append("\t\t\t{\n"); builders.CsharpBaseTypes.Append( "\t\t\t\tNativeScript.Bindings.QueueDestroy(NativeScript.Bindings.DestroyFunction."); - builders.CsharpBaseTypes.Append(baseTypeName); + builders.CsharpBaseTypes.Append(baseTypeTypeName.Name); builders.CsharpBaseTypes.Append(", CppHandle);\n"); builders.CsharpBaseTypes.Append("\t\t\t\tCppHandle = 0;\n"); builders.CsharpBaseTypes.Append("\t\t\t}\n"); @@ -7779,7 +7695,7 @@ static void AppendBaseType( for (int i = 0; i < numConstructors; ++i) { builders.CsharpBaseTypes.Append("\t\tpublic "); - builders.CsharpBaseTypes.Append(baseTypeName); + builders.CsharpBaseTypes.Append(baseTypeTypeName.Name); builders.CsharpBaseTypes.Append("(int cppHandle"); ParameterInfo[] parameters = cppConstructorParams[i]; if (parameters.Length > 0) @@ -7818,8 +7734,7 @@ static void AppendBaseType( { AppendCsharpBaseTypeConstructorFunction( type, - baseTypeName, - baseTypeNamespace, + baseTypeTypeName, false, constructorFuncNames[i], constructorParams[i], @@ -7839,8 +7754,7 @@ static void AppendBaseType( AppendCsharpBaseTypeReleaseFunction( type, - baseTypeName, - baseTypeNamespace, + baseTypeTypeName, false, releaseFuncName, jsonBaseType.DerivedName, @@ -7855,9 +7769,8 @@ static void AppendBaseType( { AppendBaseTypeNativeMethod( type, - baseTypeName, + baseTypeTypeName, typeParams, - baseTypeName, methodInfo, false, indent, @@ -7877,9 +7790,8 @@ static void AppendBaseType( { AppendBaseTypeNativeMethod( type, - baseTypeName, + baseTypeTypeName, typeParams, - baseTypeName, methodInfo, false, indent, @@ -7910,9 +7822,8 @@ static void AppendBaseType( jsonGenericParams.Types); AppendBaseTypeNativeMethod( type, - baseTypeName, + baseTypeTypeName, typeParams, - baseTypeName, methodInfo, false, indent, @@ -7930,9 +7841,8 @@ static void AppendBaseType( null); AppendBaseTypeNativeMethod( type, - baseTypeName, + baseTypeTypeName, typeParams, - baseTypeName, methodInfo, false, indent, @@ -7953,8 +7863,8 @@ static void AppendBaseType( } AppendBaseTypeProperty( type, - baseTypeName, - baseTypeName, + baseTypeTypeName.Name, + baseTypeTypeName, typeParams, propertyInfo, getMethodInfo, @@ -7980,8 +7890,8 @@ static void AppendBaseType( } AppendBaseTypeProperty( type, - baseTypeName, - baseTypeName, + baseTypeTypeName.Name, + baseTypeTypeName, typeParams, propertyInfo, getMethodInfo, @@ -8012,7 +7922,7 @@ static void AppendBaseType( // Throw an exception so the user knows what to fix in the JSON StringBuilder errorBuilder = new StringBuilder(1024); errorBuilder.Append("Property \""); - AppendCsharpTypeName( + AppendCsharpTypeFullName( type, errorBuilder); errorBuilder.Append('.'); @@ -8029,7 +7939,7 @@ static void AppendBaseType( // Throw an exception so the user knows what to fix in the JSON StringBuilder errorBuilder = new StringBuilder(1024); errorBuilder.Append("Property \""); - AppendCsharpTypeName( + AppendCsharpTypeFullName( type, errorBuilder); errorBuilder.Append('.'); @@ -8040,8 +7950,8 @@ static void AppendBaseType( } AppendBaseTypeProperty( type, - baseTypeName, - baseTypeName, + baseTypeTypeName.Name, + baseTypeTypeName, typeParams, propertyInfo, getMethodInfo, @@ -8063,8 +7973,7 @@ static void AppendBaseType( } AppendBaseTypeEvent( type, - baseTypeName, - baseTypeName, + baseTypeTypeName, typeParams, eventInfo, addMethodInfo, @@ -8089,8 +7998,7 @@ static void AppendBaseType( } AppendBaseTypeEvent( type, - baseTypeName, - baseTypeName, + baseTypeTypeName, typeParams, eventInfo, addMethodInfo, @@ -8121,7 +8029,7 @@ static void AppendBaseType( // Throw an exception so the user knows what to fix in the JSON StringBuilder errorBuilder = new StringBuilder(1024); errorBuilder.Append("Event \""); - AppendCsharpTypeName( + AppendCsharpTypeFullName( type, errorBuilder); errorBuilder.Append('.'); @@ -8138,7 +8046,7 @@ static void AppendBaseType( // Throw an exception so the user knows what to fix in the JSON StringBuilder errorBuilder = new StringBuilder(1024); errorBuilder.Append("Event \""); - AppendCsharpTypeName( + AppendCsharpTypeFullName( type, errorBuilder); errorBuilder.Append('.'); @@ -8149,8 +8057,7 @@ static void AppendBaseType( } AppendBaseTypeEvent( type, - baseTypeName, - baseTypeName, + baseTypeTypeName, typeParams, eventInfo, addMethodInfo, @@ -8179,17 +8086,15 @@ static void AppendBaseType( static void AppendBaseTypeNativeMethod( Type type, - string typeName, + TypeName typeTypeName, Type[] typeParams, - string cppTypeName, MethodInfo methodInfo, bool typeIsDelegate, int indent, StringBuilders builders) { AppendCsharpGetDelegateCall( - type.Name, - type.Namespace, + GetTypeName(type), typeParams, methodInfo.Name, builders.CsharpGetDelegateCalls); @@ -8205,8 +8110,8 @@ static void AppendBaseTypeNativeMethod( AppendBaseTypeCppMethodCall( type, - typeName, - cppTypeName, + typeTypeName.Name, + typeTypeName, typeParams, methodInfo, methodInfo.Name, @@ -8221,7 +8126,7 @@ static void AppendBaseTypeNativeMethod( static void AppendBaseTypeProperty( Type type, string typeName, - string cppTypeName, + TypeName typeTypeName, Type[] typeParams, PropertyInfo propertyInfo, MethodInfo getMethodInfo, @@ -8249,7 +8154,7 @@ static void AppendBaseTypeProperty( { builders.CsharpBaseTypes.Append("override "); } - AppendCsharpTypeName( + AppendCsharpTypeFullName( propertyInfo.PropertyType, builders.CsharpBaseTypes); builders.CsharpBaseTypes.Append(' '); @@ -8277,7 +8182,7 @@ static void AppendBaseTypeProperty( type, typeName, typeParams, - cppTypeName, + typeTypeName, propertyInfo.Name, propertyTypeKind, getMethodInfo, @@ -8293,7 +8198,7 @@ static void AppendBaseTypeProperty( type, typeName, typeParams, - cppTypeName, + typeTypeName, propertyInfo.Name, propertyTypeKind, setMethodInfo, @@ -8309,8 +8214,7 @@ static void AppendBaseTypeProperty( static void AppendBaseTypeEvent( Type type, - string typeName, - string cppTypeName, + TypeName typeTypeName, Type[] typeParams, EventInfo eventInfo, MethodInfo addMethodInfo, @@ -8326,7 +8230,7 @@ static void AppendBaseTypeEvent( builders.CsharpBaseTypes.Append("override "); } builders.CsharpBaseTypes.Append("event "); - AppendCsharpTypeName( + AppendCsharpTypeFullName( eventInfo.EventHandlerType, builders.CsharpBaseTypes); builders.CsharpBaseTypes.Append(' '); @@ -8341,9 +8245,9 @@ static void AppendBaseTypeEvent( { AppendBaseTypeNativePropertyOrEvent( type, - typeName, + typeTypeName.Name, typeParams, - cppTypeName, + typeTypeName, eventInfo.Name, eventHandlerTypeKind, addMethodInfo, @@ -8357,9 +8261,9 @@ static void AppendBaseTypeEvent( { AppendBaseTypeNativePropertyOrEvent( type, - typeName, + typeTypeName.Name, typeParams, - cppTypeName, + typeTypeName, eventInfo.Name, eventHandlerTypeKind, removeMethodInfo, @@ -8377,7 +8281,7 @@ static void AppendBaseTypeNativePropertyOrEvent( Type type, string typeName, Type[] typeParams, - string cppTypeName, + TypeName typeTypeName, string propertyOrEventName, TypeKind propertyOrEventTypeKind, MethodInfo methodInfo, @@ -8392,8 +8296,7 @@ static void AppendBaseTypeNativePropertyOrEvent( string funcName = builders.TempStrBuilder.ToString(); AppendCsharpGetDelegateCall( - type.Name, - type.Namespace, + GetTypeName(type), typeParams, funcName, builders.CsharpGetDelegateCalls); @@ -8410,7 +8313,7 @@ static void AppendBaseTypeNativePropertyOrEvent( ParameterInfo[] invokeParams = AppendBaseTypeCppNativeInvokeCall( type, typeName, - cppTypeName, + typeTypeName, typeParams, methodInfo, funcName, @@ -8447,7 +8350,7 @@ static void AppendCsharpParams( for (int i = 0; i < parameters.Length; ++i) { ParameterInfo param = parameters[i]; - AppendCsharpTypeName( + AppendCsharpTypeFullName( param.ParameterType, output); output.Append(' '); @@ -8462,7 +8365,6 @@ static void AppendCsharpParams( static void AppendBaseTypeMethodCallsCsharpMethod( Type type, string typeName, - string cppTypeName, Type[] typeParams, MethodInfo methodInfo, string methodName, @@ -8499,8 +8401,7 @@ static void AppendBaseTypeMethodCallsCsharpMethod( AppendCppFunctionPointerDefinition( funcName, false, - null, - null, + default(TypeName), TypeKind.None, invokeParams, methodInfo.ReturnType, @@ -8510,8 +8411,7 @@ static void AppendBaseTypeMethodCallsCsharpMethod( AppendCppInitParam( funcNameLower, false, - null, - null, + default(TypeName), TypeKind.None, invokeParams, methodInfo.ReturnType, @@ -8531,7 +8431,7 @@ static void AppendBaseTypeMethodCallsCsharpMethod( TypeKind returnTypeKind = GetTypeKind( methodInfo.ReturnType); AppendCppMethodDefinitionBegin( - cppTypeName, + GetTypeName(type), methodInfo.ReturnType, methodName, typeParams, @@ -8545,8 +8445,7 @@ static void AppendBaseTypeMethodCallsCsharpMethod( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( false, - type.Name, - type.Namespace, + GetTypeName(type), TypeKind.Class, typeParams, methodInfo.ReturnType, @@ -8602,7 +8501,7 @@ static void AppendBaseTypeMethodCallsCsharpMethod( invokeParamsWithThis, builders.CsharpFunctions); builders.CsharpFunctions.Append("(("); - AppendCsharpTypeName( + AppendCsharpTypeFullName( type, builders.CsharpFunctions); builders.CsharpFunctions.Append( @@ -8648,7 +8547,7 @@ static void AppendNativeInvokeFuncName( static void AppendBaseTypeCppMethodCall( Type type, string typeName, - string cppTypeName, + TypeName typeTypeName, Type[] typeParams, MethodInfo invokeMethod, string funcName, @@ -8662,7 +8561,7 @@ static void AppendBaseTypeCppMethodCall( ParameterInfo[] invokeParams = AppendBaseTypeCppNativeInvokeCall( type, typeName, - cppTypeName, + typeTypeName, typeParams, invokeMethod, funcName, @@ -8690,7 +8589,7 @@ static void AppendBaseTypeCppMethodCall( static ParameterInfo[] AppendBaseTypeCppNativeInvokeCall( Type type, string typeName, - string cppTypeName, + TypeName typeTypeName, Type[] typeParams, MethodInfo invokeMethod, string funcName, @@ -8717,7 +8616,7 @@ static ParameterInfo[] AppendBaseTypeCppNativeInvokeCall( // C++ method definition. This is a no-op that game code overrides. AppendCppMethodDefinitionBegin( - cppTypeName, + typeTypeName, invokeMethod.ReturnType, methodName, typeIsDelegate ? typeParams : null, @@ -8772,8 +8671,7 @@ static ParameterInfo[] AppendBaseTypeCppNativeInvokeCall( // C# delegate for the C++ binding function AppendCsharpDelegate( false, - type.Name, - type.Namespace, + GetTypeName(type), typeParams, funcName, invokeParams, @@ -8783,8 +8681,7 @@ static ParameterInfo[] AppendBaseTypeCppNativeInvokeCall( // C# import for the C++ binding function AppendCsharpImport( - type.Name, - type.Namespace, + GetTypeName(type), typeParams, funcName, invokeParams, @@ -8815,8 +8712,7 @@ static ParameterInfo[] PrependThisParameter( static void AppendCsharpBaseTypeReleaseFunction( Type type, - string bindingTypeName, - string bindingTypeNamespace, + TypeName bindingTypeTypeName, bool typeIsDelegate, string releaseFuncName, string derivedName, @@ -8833,9 +8729,8 @@ static void AppendCsharpBaseTypeReleaseFunction( output); if (typeIsDelegate || derivedName != null) { - AppendCsharpTypeName( - bindingTypeNamespace, - bindingTypeName, + AppendCsharpTypeFullName( + bindingTypeTypeName, output); output.Append(" thiz;\n"); } @@ -8844,9 +8739,8 @@ static void AppendCsharpBaseTypeReleaseFunction( output.Append("\t\t\t\tif (classHandle != 0)\n"); output.Append("\t\t\t\t{\n"); output.Append("\t\t\t\t\tthiz = ("); - AppendCsharpTypeName( - bindingTypeNamespace, - bindingTypeName, + AppendCsharpTypeFullName( + bindingTypeTypeName, output); output.Append(")ObjectStore.Remove(classHandle);\n"); output.Append("\t\t\t\t\tthiz.CppHandle = 0;\n"); @@ -8856,15 +8750,14 @@ static void AppendCsharpBaseTypeReleaseFunction( if (derivedName != null) { output.Append("\t\t\t\tthiz = ("); - AppendCsharpTypeName( - bindingTypeNamespace, - bindingTypeName, + AppendCsharpTypeFullName( + bindingTypeTypeName, output); output.Append(")ObjectStore.Get(handle);\n"); output.Append("\t\t\t\tint cppHandle = thiz.CppHandle;\n"); output.Append("\t\t\t\tthiz.CppHandle = 0;\n"); output.Append("\t\t\t\tQueueDestroy(DestroyFunction."); - output.Append(bindingTypeName); + output.Append(bindingTypeTypeName.Name); output.Append(", cppHandle);\n"); } output.Append("\t\t\t\tObjectStore.Remove(handle);"); @@ -8892,7 +8785,7 @@ static void AppendCsharpBaseTypeCppMethodCallMethod( { output.Append("override "); } - AppendCsharpTypeName( + AppendCsharpTypeFullName( invokeMethod.ReturnType, output); output.Append(' '); @@ -8954,7 +8847,7 @@ static void AppendCsharpBaseTypeCppMethodCallMethodBody( if (invokeMethod.ReturnType != typeof(object)) { output.Append('('); - AppendCsharpTypeName( + AppendCsharpTypeFullName( invokeMethod.ReturnType, output); output.Append(')'); @@ -8979,7 +8872,7 @@ static void AppendCsharpBaseTypeCppMethodCallMethodBody( indent, output); output.Append("return default("); - AppendCsharpTypeName( + AppendCsharpTypeFullName( invokeMethod.ReturnType, output); output.Append(");\n"); @@ -8988,8 +8881,7 @@ static void AppendCsharpBaseTypeCppMethodCallMethodBody( static void AppendCsharpBaseTypeConstructorFunction( Type type, - string typeName, - string typeNamespace, + TypeName typeTypeName, bool typeIsDelegate, string constructorFuncName, ParameterInfo[] constructorParams, @@ -9005,7 +8897,7 @@ static void AppendCsharpBaseTypeConstructorFunction( constructorParams, output); output.Append("var thiz = new "); - AppendCsharpTypeName(typeNamespace, typeName, output); + AppendCsharpTypeFullName(typeTypeName, output); output.Append("(cppHandle"); if (cppConstructorParams.Length > 0) { @@ -9080,7 +8972,7 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( output); break; default: - AppendCppTypeName( + AppendCppTypeFullName( method.ReturnType, output); break; @@ -9088,8 +8980,7 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( } output.Append(' '); AppendCsharpDelegateName( - type.Name, - type.Namespace, + GetTypeName(type), typeParams, funcName, output); @@ -9117,7 +9008,7 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( output.Append(param.Name); break; default: - AppendCppTypeName( + AppendCppTypeFullName( param.ParameterType, output); output.Append(' '); @@ -9154,7 +9045,7 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( output.Append("auto "); output.Append(parameter.Name); output.Append(" = "); - AppendCppTypeName( + AppendCppTypeFullName( parameter.ParameterType, output); output.Append("(Plugin::InternalUse::Only, "); @@ -9243,7 +9134,7 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( output); output.Append( "System::String msg = \"Unhandled exception invoking "); - AppendCppTypeName( + AppendCppTypeFullName( type, output); output.Append("\";\n"); @@ -9280,7 +9171,7 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( } static void AppendCppBaseTypeInequalityOperator( - string cppTypeName, + TypeName typeTypeName, Type[] typeParams, int cppMethodDefinitionsIndent, bool typeIsDelegate, @@ -9290,15 +9181,15 @@ static void AppendCppBaseTypeInequalityOperator( cppMethodDefinitionsIndent, output); output.Append("bool "); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); output.Append("::operator!=(const "); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, @@ -9324,7 +9215,7 @@ static void AppendCppBaseTypeInequalityOperator( } static void AppendCppBaseTypeEqualityOperator( - string cppTypeName, + TypeName typeTypeName, Type[] typeParams, int cppMethodDefinitionsIndent, bool typeIsDelegate, @@ -9334,15 +9225,15 @@ static void AppendCppBaseTypeEqualityOperator( cppMethodDefinitionsIndent, output); output.Append("bool "); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); output.Append("::operator==(const "); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, @@ -9368,8 +9259,8 @@ static void AppendCppBaseTypeEqualityOperator( } static void AppendCppBaseTypeMoveAssignmentOperator( - string typeName, - string cppTypeName, + string bindingTypeName, + TypeName typeTypeName, Type[] typeParams, bool typeIsDelegate, string releaseFuncName, @@ -9379,22 +9270,22 @@ static void AppendCppBaseTypeMoveAssignmentOperator( AppendIndent( cppMethodDefinitionsIndent, output); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); output.Append("& "); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); output.Append("::operator=("); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, @@ -9408,7 +9299,7 @@ static void AppendCppBaseTypeMoveAssignmentOperator( cppMethodDefinitionsIndent + 1, output); output.Append("Plugin::Remove"); - output.Append(typeName); + output.Append(bindingTypeName); output.Append("(CppHandle);\n"); AppendIndent( cppMethodDefinitionsIndent + 1, @@ -9510,7 +9401,7 @@ static void AppendCppBaseTypeMoveAssignmentOperator( } static void AppendCppBaseTypeAssignmentOperatorNullptr( - string cppTypeName, + TypeName typeTypeName, Type[] typeParams, bool typeIsDelegate, string releaseFuncName, @@ -9520,15 +9411,15 @@ static void AppendCppBaseTypeAssignmentOperatorNullptr( AppendIndent( cppMethodDefinitionsIndent, output); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); output.Append("& "); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, @@ -9626,8 +9517,7 @@ static void AppendCppBaseTypeAssignmentOperatorNullptr( } static void AppendCppBaseTypeAssignmentOperatorSameType( - Type type, - string cppTypeName, + TypeName typeTypeName, Type[] typeParams, bool typeIsDelegate, int cppMethodDefinitionsIndent, @@ -9636,22 +9526,22 @@ static void AppendCppBaseTypeAssignmentOperatorSameType( AppendIndent( cppMethodDefinitionsIndent, output); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); output.Append("& "); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); output.Append("::operator=(const "); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, @@ -9662,8 +9552,7 @@ static void AppendCppBaseTypeAssignmentOperatorSameType( output); output.Append("{\n"); AppendSetHandle( - cppTypeName, - type.Namespace, + typeTypeName, TypeKind.Class, typeParams, cppMethodDefinitionsIndent + 1, @@ -9694,11 +9583,10 @@ static void AppendCppBaseTypeAssignmentOperatorSameType( static void AppendCppBaseTypeDestructor( string typeName, - string cppTypeName, + TypeName typeTypeName, Type[] typeParams, bool typeIsDelegate, string derivedTypeName, - string derivedTypeNamespace, string releaseFuncName, string bindingTypeName, int cppMethodDefinitionsIndent, @@ -9707,15 +9595,18 @@ static void AppendCppBaseTypeDestructor( AppendIndent( cppMethodDefinitionsIndent, output); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); output.Append("::~"); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeName( + typeTypeName, + output); + AppendCppTypeParameters( + typeIsDelegate ? typeParams : null, output); output.Append("()\n"); AppendIndent( @@ -9813,8 +9704,8 @@ static void AppendCppBaseTypeDestructor( } static void AppendCppBaseTypeHandleConstructor( - string typeName, - string cppTypeName, + string bindingTypeName, + TypeName typeTypeName, Type[] typeParams, Type[] interfaceTypes, bool typeIsDelegate, @@ -9824,15 +9715,15 @@ static void AppendCppBaseTypeHandleConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); output.Append("::"); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeName( + typeTypeName, output); output.Append( "(Plugin::InternalUse, int32_t handle)\n"); @@ -9852,7 +9743,7 @@ static void AppendCppBaseTypeHandleConstructor( cppMethodDefinitionsIndent + 1, output); output.Append("CppHandle = Plugin::Store"); - output.Append(typeName); + output.Append(bindingTypeName); output.Append("(this);\n"); AppendIndent( cppMethodDefinitionsIndent + 1, @@ -9890,7 +9781,7 @@ static void AppendCppBaseTypeHandleConstructor( } static void AppendCppBaseTypeMoveConstructor( - string cppTypeName, + TypeName typeTypeName, Type[] typeParams, Type[] interfaceTypes, bool typeIsDelegate, @@ -9900,19 +9791,19 @@ static void AppendCppBaseTypeMoveConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); output.Append("::"); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeName( + typeTypeName, output); output.Append("("); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, @@ -9971,7 +9862,7 @@ static void AppendCppBaseTypeMoveConstructor( static void AppendCppBaseTypeCopyConstructor( string typeName, - string cppTypeName, + TypeName typeTypeName, Type[] typeParams, Type[] interfaceTypes, bool typeIsDelegate, @@ -9981,19 +9872,19 @@ static void AppendCppBaseTypeCopyConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); output.Append("::"); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeName( + typeTypeName, output); output.Append("(const "); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeFullName( + typeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, @@ -10055,7 +9946,7 @@ static void AppendCppBaseTypeCopyConstructor( static void AppendCppBaseTypeNullptrConstructor( string typeName, - string cppTypeName, + TypeName cppTypeTypeName, Type[] typeParams, Type[] interfaceTypes, bool typeIsDelegate, @@ -10065,15 +9956,15 @@ static void AppendCppBaseTypeNullptrConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeName( + cppTypeTypeName, output); AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); output.Append("::"); - AppendTypeNameWithoutGenericSuffix( - cppTypeName, + AppendCppTypeName( + cppTypeTypeName, output); output.Append("(decltype(nullptr))\n"); AppendCppConstructorInitializerList( @@ -10109,7 +10000,7 @@ static void AppendCppBaseTypeNullptrConstructor( static void AppendCppBaseTypeConstructor( string bindingTypeName, - string typeNamespace, + TypeName typeTypeName, TypeKind typeKind, string cppTypeName, Type[] typeParams, @@ -10122,7 +10013,7 @@ static void AppendCppBaseTypeConstructor( StringBuilder output) { AppendCppMethodDefinitionBegin( - cppTypeName, + typeTypeName, null, cppTypeName, typeIsDelegate ? typeParams : null, @@ -10161,8 +10052,7 @@ static void AppendCppBaseTypeConstructor( } AppendCppPluginFunctionCall( true, - bindingTypeName, - typeNamespace, + GetTypeName(bindingTypeName, typeTypeName.Namespace), typeKind, typeParams, null, @@ -10230,9 +10120,8 @@ static void AppendCppBaseTypeConstructor( } static void AppendCppPointerFreeListInit( - string typeNamespace, Type[] typeParams, - string cppTypeName, + TypeName cppTypeTypeName, int maxSimultaneous, string typeName, StringBuilder output, @@ -10247,9 +10136,8 @@ static void AppendCppPointerFreeListInit( output.Append("\tPlugin::"); output.Append(typeName); output.Append("FreeList = ("); - AppendCppTypeName( - typeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10259,9 +10147,8 @@ static void AppendCppPointerFreeListInit( output.Append("\tcurMemory += "); output.Append(maxSimultaneous); output.Append(" * sizeof("); - AppendCppTypeName( - typeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10277,9 +10164,8 @@ static void AppendCppPointerFreeListInit( outputFirstBoot.Append("\t\t\tPlugin::"); outputFirstBoot.Append(typeName); outputFirstBoot.Append("FreeList[i] = ("); - AppendCppTypeName( - typeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, outputFirstBoot); AppendCppTypeParameters( typeParams, @@ -10305,17 +10191,15 @@ static void AppendCppPointerFreeListInit( } static void AppendCppPointerFreeListStateAndFunctions( - string typeNamespace, + TypeName cppTypeTypeName, Type[] typeParams, - string cppTypeName, string bindingTypeName, StringBuilder output) { // Section comment output.Append("\t// Free list for "); - AppendCppTypeName( - typeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10330,9 +10214,8 @@ static void AppendCppPointerFreeListStateAndFunctions( // Free list variable output.Append('\t'); - AppendCppTypeName( - typeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10343,9 +10226,8 @@ static void AppendCppPointerFreeListStateAndFunctions( // Next free variable output.Append('\t'); - AppendCppTypeName( - typeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10359,9 +10241,8 @@ static void AppendCppPointerFreeListStateAndFunctions( output.Append("\tint32_t Store"); output.Append(bindingTypeName); output.Append('('); - AppendCppTypeName( - typeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10372,9 +10253,8 @@ static void AppendCppPointerFreeListStateAndFunctions( output.Append(bindingTypeName); output.Append(" != nullptr);\n"); output.Append("\t\t"); - AppendCppTypeName( - typeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10385,9 +10265,8 @@ static void AppendCppPointerFreeListStateAndFunctions( output.Append("\t\tNextFree"); output.Append(bindingTypeName); output.Append(" = ("); - AppendCppTypeName( - typeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10402,9 +10281,8 @@ static void AppendCppPointerFreeListStateAndFunctions( // Get function output.Append('\t'); - AppendCppTypeName( - typeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10429,9 +10307,8 @@ static void AppendCppPointerFreeListStateAndFunctions( output.Append("(int32_t handle)\n"); output.Append("\t{\n"); output.Append("\t\t"); - AppendCppTypeName( - typeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10440,9 +10317,8 @@ static void AppendCppPointerFreeListStateAndFunctions( output.Append(bindingTypeName); output.Append("FreeList + handle;\n"); output.Append("\t\t*pRelease = ("); - AppendCppTypeName( - typeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10511,16 +10387,14 @@ static void AppendCppWholeObjectFreeListInit( static void AppendCppWholeObjectFreeListStateAndFunctions( Type[] typeParams, - string cppTypeName, - string cppTypeNamespace, + TypeName cppTypeTypeName, string bindingTypeName, StringBuilder output) { // Section comment output.Append("\t// Free list for whole "); - AppendCppTypeName( - cppTypeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10537,9 +10411,8 @@ static void AppendCppWholeObjectFreeListStateAndFunctions( output.Append(bindingTypeName); output.Append("FreeWholeListEntry* Next;\n"); output.Append("\t\t"); - AppendCppTypeName( - cppTypeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10569,9 +10442,8 @@ static void AppendCppWholeObjectFreeListStateAndFunctions( // Store function output.Append('\t'); - AppendCppTypeName( - cppTypeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10599,9 +10471,8 @@ static void AppendCppWholeObjectFreeListStateAndFunctions( output.Append("\tvoid RemoveWhole"); output.Append(bindingTypeName); output.Append('('); - AppendCppTypeName( - cppTypeNamespace, - cppTypeName, + AppendCppTypeFullName( + cppTypeTypeName, output); AppendCppTypeParameters( typeParams, @@ -10634,8 +10505,7 @@ static void AppendCppWholeObjectFreeListStateAndFunctions( static void AppendCsharpDelegate( bool isStatic, - string typeName, - string typeNamespace, + TypeName typeTypeName, Type[] typeParams, string funcName, ParameterInfo[] parameters, @@ -10657,7 +10527,7 @@ static void AppendCsharpDelegate( output.Append("int"); break; default: - AppendCsharpTypeName( + AppendCsharpTypeFullName( returnType, output); break; @@ -10665,8 +10535,7 @@ static void AppendCsharpDelegate( } output.Append(' '); AppendCsharpDelegateName( - typeName, - typeNamespace, + typeTypeName, typeParams, funcName, output); @@ -10687,7 +10556,7 @@ static void AppendCsharpDelegate( case TypeKind.FullStruct: case TypeKind.Primitive: case TypeKind.Enum: - AppendCsharpTypeName( + AppendCsharpTypeFullName( param.ParameterType, output); output.Append(" param"); @@ -10706,15 +10575,13 @@ static void AppendCsharpDelegate( output.Append(");\n"); output.Append("\t\tpublic static "); AppendCsharpDelegateName( - typeName, - typeNamespace, + typeTypeName, typeParams, funcName, output); output.Append("Delegate "); AppendCsharpDelegateName( - typeName, - typeNamespace, + typeTypeName, typeParams, funcName, output); @@ -10722,18 +10589,17 @@ static void AppendCsharpDelegate( } static void AppendCsharpDelegateName( - string typeName, - string typeNamespace, + TypeName typeTypeName, Type[] typeParams, string funcName, StringBuilder output) { AppendNamespace( - typeNamespace, + typeTypeName.Namespace, string.Empty, output); AppendTypeNameWithoutSuffixes( - typeName, + typeTypeName.Name, output); AppendTypeNames( typeParams, @@ -10742,30 +10608,26 @@ static void AppendCsharpDelegateName( } static void AppendCsharpGetDelegateCall( - string typeName, - string typeNamespace, + TypeName typeTypeName, Type[] typeParams, string funcName, StringBuilder output) { output.Append("\t\t\t"); AppendCsharpDelegateName( - typeName, - typeNamespace, + typeTypeName, typeParams, funcName, output); output.Append(" = GetDelegate<"); AppendCsharpDelegateName( - typeName, - typeNamespace, + typeTypeName, typeParams, funcName, output); output.Append("Delegate>(libraryHandle, \""); AppendCsharpDelegateName( - typeName, - typeNamespace, + typeTypeName, typeParams, funcName, output); @@ -10773,8 +10635,7 @@ static void AppendCsharpGetDelegateCall( } static void AppendCsharpImport( - string typeName, - string typeNamespace, + TypeName typeTypeName, Type[] typeParams, string funcName, ParameterInfo[] parameters, @@ -10784,8 +10645,7 @@ StringBuilder output output.Append("\t\t[DllImport(Constants.PluginName)]\n"); output.Append("\t\tpublic static extern void "); AppendCsharpDelegateName( - typeName, - typeNamespace, + typeTypeName, typeParams, funcName, output); @@ -10799,7 +10659,7 @@ StringBuilder output ParameterInfo param = parameters[i]; if (param.Kind == TypeKind.FullStruct) { - AppendCsharpTypeName( + AppendCsharpTypeFullName( param.ParameterType, output); output.Append(" param"); @@ -10901,7 +10761,7 @@ static void AppendExceptions( builders.CppMethodDefinitions.Append("struct "); builders.CppMethodDefinitions.Append(exceptionType.Name); builders.CppMethodDefinitions.Append("Thrower : "); - AppendCppTypeName( + AppendCppTypeFullName( exceptionType, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append('\n'); @@ -10934,7 +10794,7 @@ static void AppendExceptions( throwerIndent + 2, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append(", "); - AppendCppTypeName( + AppendCppTypeFullName( exceptionType, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("(Plugin::InternalUse::Only, handle)\n"); @@ -10982,7 +10842,7 @@ static void AppendExceptions( builders.CppMethodDefinitions.Append("{\n"); builders.CppMethodDefinitions.Append("\tdelete Plugin::unhandledCsharpException;\n"); builders.CppMethodDefinitions.Append("\tPlugin::unhandledCsharpException = new "); - AppendCppTypeName( + AppendCppTypeFullName( exceptionType, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("Thrower(handle);\n"); @@ -10994,8 +10854,7 @@ static void AppendExceptions( // C# imports AppendCsharpImport( - string.Empty, - string.Empty, + GetTypeName(string.Empty, string.Empty), null, funcName, parameters, @@ -11004,8 +10863,7 @@ static void AppendExceptions( // C# delegate AppendCsharpDelegate( true, - string.Empty, - string.Empty, + GetTypeName(string.Empty, string.Empty), null, funcName, parameters, @@ -11016,8 +10874,7 @@ static void AppendExceptions( // C# GetDelegate call AppendCsharpGetDelegateCall( - string.Empty, - string.Empty, + GetTypeName(string.Empty, string.Empty), null, funcName, builders.CsharpGetDelegateCalls); @@ -11071,8 +10928,7 @@ static void AppendGetter( // Build uppercase function name builders.TempStrBuilder.Length = 0; AppendFieldPropertyFuncName( - enclosingType.Name, - enclosingType.Namespace, + GetTypeName(enclosingType), enclosingTypeParams, syntaxType, "Get", @@ -11165,8 +11021,7 @@ static void AppendGetter( AppendCppFunctionPointerDefinition( funcName, methodIsStatic, - enclosingType.Name, - enclosingType.Namespace, + GetTypeName(enclosingType), enclosingTypeKind, parameters, fieldType, @@ -11186,7 +11041,7 @@ static void AppendGetter( // C++ method definition AppendCppMethodDefinitionBegin( - enclosingType.Name, + GetTypeName(enclosingType), fieldType, methodName, enclosingTypeParams, @@ -11198,8 +11053,7 @@ static void AppendGetter( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( methodIsStatic, - enclosingType.Name, - enclosingType.Namespace, + GetTypeName(enclosingType), enclosingTypeKind, enclosingTypeParams, fieldType, @@ -11221,8 +11075,7 @@ static void AppendGetter( AppendCppInitParam( funcNameLower, methodIsStatic, - enclosingType.Name, - enclosingType.Namespace, + GetTypeName(enclosingType), enclosingTypeKind, parameters, fieldType, @@ -11249,6 +11102,8 @@ static void AppendSetter( Type[] exceptionTypes, StringBuilders builders) { + TypeName enclosingTypeTypeName = GetTypeName(enclosingType); + // Build uppercased field name builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append(char.ToUpper(fieldName[0])); @@ -11261,8 +11116,7 @@ static void AppendSetter( // Build uppercase function name builders.TempStrBuilder.Length = 0; AppendFieldPropertyFuncName( - enclosingType.Name, - enclosingType.Namespace, + enclosingTypeTypeName, enclosingTypeParams, syntaxType, "Set", @@ -11358,8 +11212,7 @@ static void AppendSetter( AppendCppFunctionPointerDefinition( funcName, methodIsStatic, - enclosingType.Name, - enclosingType.Namespace, + enclosingTypeTypeName, enclosingTypeKind, parameters, typeof(void), @@ -11379,7 +11232,7 @@ static void AppendSetter( // C++ method definition AppendCppMethodDefinitionBegin( - enclosingType.Name, + GetTypeName(enclosingType), typeof(void), methodName, enclosingTypeParams, @@ -11391,8 +11244,7 @@ static void AppendSetter( builders.CppMethodDefinitions.Append("{\n"); AppendCppPluginFunctionCall( methodIsStatic, - enclosingType.Name, - enclosingType.Namespace, + enclosingTypeTypeName, enclosingTypeKind, enclosingTypeParams, null, @@ -11409,8 +11261,7 @@ static void AppendSetter( AppendCppInitParam( funcNameLower, methodIsStatic, - enclosingType.Name, - enclosingType.Namespace, + enclosingTypeTypeName, enclosingTypeKind, parameters, typeof(void), @@ -11424,8 +11275,7 @@ static void AppendSetter( } static void AppendFieldPropertyFuncName( - string enclosingTypeName, - string enclosingTypeNamespace, + TypeName enclosingTypeTypeName, Type[] enclosingTypeParams, string syntaxType, string operationType, @@ -11433,11 +11283,11 @@ static void AppendFieldPropertyFuncName( StringBuilder output) { AppendNamespace( - enclosingTypeNamespace, + enclosingTypeTypeName.Namespace, string.Empty, output); AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + enclosingTypeTypeName.Name, output); AppendTypeNames( enclosingTypeParams, @@ -11449,24 +11299,22 @@ static void AppendFieldPropertyFuncName( } static void AppendCppTemplateDeclaration( - string typeName, - string typeNamespace, - int numTypeParameters, + TypeName typeTypeName, StringBuilder output) { int indent = AppendNamespaceBeginning( - typeNamespace, + typeTypeName.Namespace, output); AppendIndent( indent, output); AppendCppTemplateTypenames( - numTypeParameters, + typeTypeName.NumTypeParams, 'T', output); output.Append("struct "); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); output.Append(";"); output.Append('\n'); @@ -11477,21 +11325,20 @@ static void AppendCppTemplateDeclaration( } static int AppendCppTypeDeclaration( - string typeNamespace, - string typeName, + TypeName typeTypeName, bool isStatic, Type[] typeParams, StringBuilder output) { int indent = AppendNamespaceBeginning( - typeNamespace, + typeTypeName.Namespace, output); AppendIndent(indent, output); if (isStatic) { output.Append("namespace "); AppendTypeNameWithoutGenericSuffix( - typeName, + typeTypeName.Name, output); output.Append('\n'); AppendIndent(indent, output); @@ -11506,8 +11353,8 @@ static int AppendCppTypeDeclaration( output.Append("template<> "); } output.Append("struct "); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, @@ -11523,12 +11370,10 @@ static int AppendCppTypeDeclaration( } static void AppendCppTypeDefinitionBegin( - string typeName, - string typeNamespace, + TypeName typeTypeName, TypeKind typeKind, Type[] typeParams, - string baseTypeName, - string baseTypeNamespace, + TypeName baseTypeTypeName, Type[] baseTypeTypeParams, Type[] interfaceTypes, bool isStatic, @@ -11536,7 +11381,7 @@ static void AppendCppTypeDefinitionBegin( StringBuilder output) { AppendNamespaceBeginning( - typeNamespace, + typeTypeName.Namespace, output); AppendIndent( indent, @@ -11545,7 +11390,7 @@ static void AppendCppTypeDefinitionBegin( { output.Append("namespace "); AppendTypeNameWithoutGenericSuffix( - typeName, + typeTypeName.Name, output); } else @@ -11555,8 +11400,8 @@ static void AppendCppTypeDefinitionBegin( output.Append("template<> "); } output.Append("struct "); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters(typeParams, output); switch (typeKind) @@ -11566,17 +11411,19 @@ static void AppendCppTypeDefinitionBegin( // there are no interfaces (since they always extend it) string separator = " : virtual "; if ( - (baseTypeName != null && - (baseTypeNamespace != "System" || - baseTypeName != "Object")) || + (baseTypeTypeName.Name != null && + (baseTypeTypeName.Namespace != "System" || + baseTypeTypeName.Name != "Object")) || (interfaceTypes == null || interfaceTypes.Length == 0)) { output.Append(separator); separator = ", virtual "; - AppendCppTypeName( - baseTypeNamespace ?? "System", - baseTypeName ?? "Object", + AppendCppTypeFullName( + GetTypeName( + baseTypeTypeName.Name ?? "Object", + baseTypeTypeName.Namespace ?? "System", + baseTypeTypeParams != null ? baseTypeTypeParams.Length : 0), output); AppendCppTypeParameters( baseTypeTypeParams, @@ -11588,9 +11435,8 @@ static void AppendCppTypeDefinitionBegin( { output.Append(separator); separator = ", virtual "; - AppendCppTypeName( - interfaceType.Namespace, - interfaceType.Name, + AppendCppTypeFullName( + GetTypeName(interfaceType), output); AppendCppTypeParameters( interfaceType.GetGenericArguments(), @@ -11616,8 +11462,8 @@ static void AppendCppTypeDefinitionBegin( case TypeKind.ManagedStruct: // Constructor from nullptr AppendIndent(indent + 1, output); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, @@ -11626,8 +11472,8 @@ static void AppendCppTypeDefinitionBegin( // Constructor from handle AppendIndent(indent + 1, output); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, @@ -11637,15 +11483,15 @@ static void AppendCppTypeDefinitionBegin( // Copy constructor AppendIndent(indent + 1, output); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("(const "); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, @@ -11654,15 +11500,15 @@ static void AppendCppTypeDefinitionBegin( // Move constructor AppendIndent(indent + 1, output); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append('('); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, @@ -11672,8 +11518,8 @@ static void AppendCppTypeDefinitionBegin( // Destructor AppendIndent(indent + 1, output); output.Append("virtual ~"); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, @@ -11682,15 +11528,15 @@ static void AppendCppTypeDefinitionBegin( // Assignment operator to same type AppendIndent(indent + 1, output); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("& operator=(const "); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, @@ -11699,8 +11545,8 @@ static void AppendCppTypeDefinitionBegin( // Assignment operator to nullptr AppendIndent(indent + 1, output); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, @@ -11709,15 +11555,15 @@ static void AppendCppTypeDefinitionBegin( // Move assignment operator to same type AppendIndent(indent + 1, output); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, output); output.Append("& operator=("); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, @@ -11727,8 +11573,8 @@ static void AppendCppTypeDefinitionBegin( // Equality operator with same type AppendIndent(indent + 1, output); output.Append("bool operator==(const "); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, @@ -11738,8 +11584,8 @@ static void AppendCppTypeDefinitionBegin( // Inequality operator with same type AppendIndent(indent + 1, output); output.Append("bool operator!=(const "); - AppendTypeNameWithoutGenericSuffix( - typeName, + AppendCppTypeName( + typeTypeName, output); AppendCppTypeParameters( typeParams, @@ -11771,8 +11617,7 @@ static void AppendCppTypeDefinitionEnd( } static int AppendCppMethodDefinitionsBegin( - string enclosingTypeName, - string enclosingTypeNamespace, + TypeName enclosingTypeTypeName, TypeKind enclosingTypeKind, Type[] enclosingTypeParams, Type[] interfaceTypes, @@ -11783,7 +11628,7 @@ static int AppendCppMethodDefinitionsBegin( StringBuilder output) { int cppMethodDefinitionsIndent = AppendNamespaceBeginning( - enclosingTypeNamespace, + enclosingTypeTypeName.Namespace, output); if (!isStatic && ( enclosingTypeKind == TypeKind.Class @@ -11791,15 +11636,15 @@ static int AppendCppMethodDefinitionsBegin( { // Construct with nullptr AppendIndent(indent, output); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::"); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); output.Append("(decltype(nullptr))\n"); if (enclosingTypeKind == TypeKind.Class) @@ -11819,15 +11664,15 @@ static int AppendCppMethodDefinitionsBegin( // Handle constructor AppendIndent(indent, output); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::"); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); output.Append("(Plugin::InternalUse, int32_t handle)\n"); if (enclosingTypeKind == TypeKind.Class) @@ -11847,8 +11692,7 @@ static int AppendCppMethodDefinitionsBegin( output.Append("{\n"); AppendIndent(indent + 2, output); AppendReferenceManagedHandleFunctionCall( - enclosingTypeName, - enclosingTypeNamespace, + enclosingTypeTypeName, enclosingTypeKind, enclosingTypeParams, "handle", @@ -11864,19 +11708,19 @@ static int AppendCppMethodDefinitionsBegin( // Copy constructor AppendIndent(indent, output); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::"); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); output.Append("(const "); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -11884,8 +11728,8 @@ static int AppendCppMethodDefinitionsBegin( output.Append("& other)\n"); AppendIndent(indent + 1, output); output.Append(": "); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent(indent, output); @@ -11898,19 +11742,19 @@ static int AppendCppMethodDefinitionsBegin( // Move constructor AppendIndent(indent, output); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::"); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); output.Append("("); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -11918,8 +11762,8 @@ static int AppendCppMethodDefinitionsBegin( output.Append("&& other)\n"); AppendIndent(indent, output); output.Append("\t: "); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); AppendIndent(indent, output); @@ -11932,18 +11776,18 @@ static int AppendCppMethodDefinitionsBegin( output.Append("}\n"); AppendIndent(indent, output); output.Append('\n'); - + // Destructor AppendIndent(indent, output); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::~"); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -11957,8 +11801,7 @@ static int AppendCppMethodDefinitionsBegin( output.Append("{\n"); AppendIndent(indent + 2, output); AppendDereferenceManagedHandleFunctionCall( - enclosingTypeName, - enclosingTypeNamespace, + enclosingTypeTypeName, enclosingTypeKind, enclosingTypeParams, "Handle", @@ -11975,22 +11818,22 @@ static int AppendCppMethodDefinitionsBegin( // Assignment operator to same type AppendIndent(indent, output); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("& "); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::operator=(const "); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -11999,8 +11842,7 @@ static int AppendCppMethodDefinitionsBegin( AppendIndent(indent, output); output.Append("{\n"); AppendSetHandle( - enclosingTypeName, - enclosingTypeNamespace, + enclosingTypeTypeName, enclosingTypeKind, enclosingTypeParams, indent + 1, @@ -12017,15 +11859,15 @@ static int AppendCppMethodDefinitionsBegin( // Assignment operator to nullptr AppendIndent(indent, output); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("& "); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -12039,8 +11881,7 @@ static int AppendCppMethodDefinitionsBegin( output.Append("{\n"); AppendIndent(indent + 2, output); AppendDereferenceManagedHandleFunctionCall( - enclosingTypeName, - enclosingTypeNamespace, + enclosingTypeTypeName, enclosingTypeKind, enclosingTypeParams, "Handle", @@ -12059,22 +11900,22 @@ static int AppendCppMethodDefinitionsBegin( // Move assignment operator to same type AppendIndent(indent, output); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("& "); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::operator=("); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -12088,8 +11929,7 @@ static int AppendCppMethodDefinitionsBegin( output.Append("{\n"); AppendIndent(indent + 2, output); AppendDereferenceManagedHandleFunctionCall( - enclosingTypeName, - enclosingTypeNamespace, + enclosingTypeTypeName, enclosingTypeKind, enclosingTypeParams, "Handle", @@ -12113,15 +11953,15 @@ static int AppendCppMethodDefinitionsBegin( // Equality operator with same type AppendIndent(indent, output); output.Append("bool "); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::operator==(const "); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -12139,15 +11979,15 @@ static int AppendCppMethodDefinitionsBegin( // Inequality operator with same type AppendIndent(indent, output); output.Append("bool "); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, output); output.Append("::operator!=(const "); - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeParams, @@ -12166,8 +12006,7 @@ static int AppendCppMethodDefinitionsBegin( } static void AppendSetHandle( - string enclosingTypeName, - string enclosingTypeNamespace, + TypeName enclosingTypeTypeName, TypeKind enclosingTypeKind, Type[] enclosingTypeParams, int indent, @@ -12184,8 +12023,7 @@ static void AppendSetHandle( output.Append("{\n"); AppendIndent(indent + 1, output); AppendDereferenceManagedHandleFunctionCall( - enclosingTypeName, - enclosingTypeNamespace, + enclosingTypeTypeName, enclosingTypeKind, enclosingTypeParams, thisHandleExpression, @@ -12206,8 +12044,7 @@ static void AppendSetHandle( output.Append("{\n"); AppendIndent(indent + 1, output); AppendReferenceManagedHandleFunctionCall( - enclosingTypeName, - enclosingTypeNamespace, + enclosingTypeTypeName, enclosingTypeKind, enclosingTypeParams, thisHandleExpression, @@ -12218,8 +12055,7 @@ static void AppendSetHandle( } static void AppendReferenceManagedHandleFunctionCall( - string enclosingTypeName, - string enclosingTypeNamespace, + TypeName enclosingTypeTypeName, TypeKind enclosingTypeKind, Type[] enclosingTypeParams, string handleVariable, @@ -12229,8 +12065,7 @@ static void AppendReferenceManagedHandleFunctionCall( { output.Append("Plugin::ReferenceManaged"); AppendReleaseFunctionNameSuffix( - enclosingTypeName, - enclosingTypeNamespace, + enclosingTypeTypeName, enclosingTypeParams, output); output.Append("(Handle)"); @@ -12244,8 +12079,7 @@ static void AppendReferenceManagedHandleFunctionCall( } static void AppendDereferenceManagedHandleFunctionCall( - string enclosingTypeName, - string enclosingTypeNamespace, + TypeName enclosingTypeTypeName, TypeKind enclosingTypeKind, Type[] enclosingTypeParams, string handleVariable, @@ -12255,8 +12089,7 @@ static void AppendDereferenceManagedHandleFunctionCall( { output.Append("Plugin::DereferenceManaged"); AppendReleaseFunctionNameSuffix( - enclosingTypeName, - enclosingTypeNamespace, + enclosingTypeTypeName, enclosingTypeParams, output); output.Append("(Handle)"); @@ -12367,7 +12200,7 @@ static void AppendCsharpDelegateType( // Return type if (IsFullValueType(returnType)) { - AppendCsharpTypeName( + AppendCsharpTypeFullName( returnType, output); } @@ -12384,7 +12217,7 @@ static void AppendCsharpDelegateType( if (enclosingTypeKind == TypeKind.FullStruct) { output.Append("ref "); - AppendCsharpTypeName( + AppendCsharpTypeFullName( enclosingType, output); output.Append(" thiz"); @@ -12422,7 +12255,7 @@ static void AppendCsharpFunctionBeginning( { if (IsFullValueType(returnType)) { - AppendCsharpTypeName( + AppendCsharpTypeFullName( returnType, output); } @@ -12443,7 +12276,7 @@ static void AppendCsharpFunctionBeginning( if (enclosingTypeKind == TypeKind.FullStruct) { output.Append("ref "); - AppendCsharpTypeName( + AppendCsharpTypeFullName( enclosingType, output); output.Append(" thiz"); @@ -12470,7 +12303,7 @@ static void AppendCsharpFunctionBeginning( && enclosingTypeKind != TypeKind.FullStruct) { output.Append("var thiz = ("); - AppendCsharpTypeName( + AppendCsharpTypeFullName( enclosingType, output); output.Append(')'); @@ -12494,7 +12327,7 @@ static void AppendCsharpFunctionBeginning( if (paramType != typeof(object)) { output.Append('('); - AppendCsharpTypeName(paramType, output); + AppendCsharpTypeFullName(paramType, output); output.Append(')'); } AppendHandleStoreTypeName(paramType, output); @@ -12518,7 +12351,7 @@ static void AppendCsharpFunctionCallSubject( { if (isStatic) { - AppendCsharpTypeName( + AppendCsharpTypeFullName( enclosingType, output); } @@ -12693,7 +12526,7 @@ static void AppendCsharpCatchException( StringBuilder output) { output.Append("\t\t\tcatch ("); - AppendCsharpTypeName( + AppendCsharpTypeFullName( exceptionType, output); output.Append(" ex)\n"); @@ -12718,7 +12551,7 @@ static void AppendCsharpCatchException( else { output.Append(" = default("); - AppendCsharpTypeName( + AppendCsharpTypeFullName( param.DereferencedParameterType, output); output.Append(");\n"); @@ -12730,7 +12563,7 @@ static void AppendCsharpCatchException( output.Append("\t\t\t\treturn default("); if (IsFullValueType(returnType)) { - AppendCsharpTypeName( + AppendCsharpTypeFullName( returnType, output); } @@ -12801,7 +12634,7 @@ static void AppendCsharpBindingParameterDeclaration( output.Append("int"); break; default: - AppendCsharpTypeName( + AppendCsharpTypeFullName( param.DereferencedParameterType, output); break; @@ -12848,7 +12681,7 @@ static void AppendCppParameterDeclaration( } else { - AppendCppTypeName( + AppendCppTypeFullName( paramType, output); } @@ -12912,7 +12745,7 @@ static void AppendCppParameterDeclaration( Type type = param.DefaultValue.GetType(); if (type.IsEnum) { - AppendCppTypeName( + AppendCppTypeFullName( type, output); output.Append("::"); @@ -12922,7 +12755,7 @@ static void AppendCppParameterDeclaration( { StringBuilder error = new StringBuilder(); error.Append("Default parameter type ("); - AppendCsharpTypeName( + AppendCsharpTypeFullName( param.DefaultValue.GetType(), error); error.Append(") not supported"); @@ -12964,7 +12797,7 @@ static void AppendCppInitBody( } static void AppendCppMethodDefinitionBegin( - string enclosingTypeName, + TypeName enclosingTypeTypeName, Type returnType, string methodName, Type[] enclosingTypeTypeParams, @@ -12987,15 +12820,15 @@ static void AppendCppMethodDefinitionBegin( // Return type if (returnType != null) { - AppendCppTypeName( + AppendCppTypeFullName( returnType, output); output.Append(' '); } - + // Type name - AppendTypeNameWithoutGenericSuffix( - enclosingTypeName, + AppendCppTypeFullName( + enclosingTypeTypeName, output); AppendCppTypeParameters( enclosingTypeTypeParams, @@ -13040,7 +12873,7 @@ static void AppendCppMethodReturn( output.Append("returnValue"); break; default: - AppendCppTypeName( + AppendCppTypeFullName( returnType, output); output.Append("(Plugin::InternalUse::Only, returnValue)"); @@ -13052,8 +12885,7 @@ static void AppendCppMethodReturn( static void AppendCppPluginFunctionCall( bool isStatic, - string enclosingTypeName, - string enclosingTypeNamespace, + TypeName enclosingTypeTypeName, TypeKind enclosingTypeKind, Type[] enclosingTypeParams, Type returnType, @@ -13156,8 +12988,7 @@ static void AppendCppPluginFunctionCall( && (param.IsOut || param.IsRef)) { AppendSetHandle( - enclosingTypeName, - enclosingTypeNamespace, + enclosingTypeTypeName, enclosingTypeKind, enclosingTypeParams, indent, @@ -13191,8 +13022,7 @@ static void AppendCppUnhandledExceptionHandling( static void AppendCppInitParam( string funcName, bool isStatic, - string enclosingTypeName, - string enclosingTypeNamespace, + TypeName enclosingTypeTypeName, TypeKind enclosingTypeKind, ParameterInfo[] parameters, Type returnType, @@ -13203,8 +13033,7 @@ StringBuilder output AppendCppFunctionPointer( funcName, isStatic, - enclosingTypeName, - enclosingTypeNamespace, + enclosingTypeTypeName, enclosingTypeKind, parameters, returnType, @@ -13217,8 +13046,7 @@ StringBuilder output static void AppendCppFunctionPointerDefinition( string funcName, bool isStatic, - string enclosingTypeName, - string enclosingTypeNamespace, + TypeName enclosingTypeTypeName, TypeKind enclosingTypeKind, ParameterInfo[] parameters, Type returnType, @@ -13229,8 +13057,7 @@ StringBuilder output AppendCppFunctionPointer( funcName, isStatic, - enclosingTypeName, - enclosingTypeNamespace, + enclosingTypeTypeName, enclosingTypeKind, parameters, returnType, @@ -13243,8 +13070,7 @@ StringBuilder output static void AppendCppFunctionPointer( string funcName, bool isStatic, - string enclosingTypeName, - string enclosingTypeNamespace, + TypeName enclosingTypeTypeName, TypeKind enclosingTypeKind, ParameterInfo[] parameters, Type returnType, @@ -13264,7 +13090,7 @@ static void AppendCppFunctionPointer( } else if (IsFullValueType(returnType)) { - AppendCppTypeName(returnType, output); + AppendCppTypeFullName(returnType, output); } else { @@ -13280,9 +13106,8 @@ static void AppendCppFunctionPointer( { case TypeKind.FullStruct: case TypeKind.Primitive: - AppendCppTypeName( - enclosingTypeNamespace, - enclosingTypeName, + AppendCppTypeFullName( + enclosingTypeTypeName, output); output.Append("* thiz"); break; @@ -13310,7 +13135,7 @@ static void AppendCppFunctionPointer( } break; case TypeKind.Enum: - AppendCppTypeName( + AppendCppTypeFullName( param.DereferencedParameterType, output); if (param.IsOut || param.IsRef) @@ -13319,7 +13144,7 @@ static void AppendCppFunctionPointer( } break; case TypeKind.FullStruct: - AppendCppTypeName( + AppendCppTypeFullName( param.DereferencedParameterType, output); if (param.IsOut || param.IsRef) @@ -13417,7 +13242,7 @@ static void AppendCppMethodDeclaration( } else { - AppendCppTypeName( + AppendCppTypeFullName( returnType, output); } @@ -13442,7 +13267,7 @@ static void AppendCppMethodDeclaration( output.Append(";\n"); } - static void AppendCsharpTypeName( + static void AppendCsharpTypeFullName( Type type, StringBuilder output) { @@ -13508,7 +13333,7 @@ static void AppendCsharpTypeName( } else if (type.IsArray) { - AppendCsharpTypeName( + AppendCsharpTypeFullName( type.GetElementType(), output); output.Append('['); @@ -13517,7 +13342,7 @@ static void AppendCsharpTypeName( } else { - AppendCsharpTypeName(type.Namespace, type.Name, output); + AppendCsharpTypeFullName(GetTypeName(type), output); Type[] genTypes = type.GetGenericArguments(); AppendCSharpTypeParameters( genTypes, @@ -13525,20 +13350,19 @@ static void AppendCsharpTypeName( } } - static void AppendCsharpTypeName( - string namespaceName, - string name, + static void AppendCsharpTypeFullName( + TypeName typeName, StringBuilder output) { - if (!string.IsNullOrEmpty(namespaceName)) + if (!string.IsNullOrEmpty(typeName.Namespace)) { - output.Append(namespaceName); + output.Append(typeName.Namespace); output.Append('.'); } - AppendTypeNameWithoutGenericSuffix(name, output); + AppendTypeNameWithoutGenericSuffix(typeName.Name, output); } - static void AppendCppTypeName( + static void AppendCppTypeFullName( Type type, StringBuilder output) { @@ -13611,7 +13435,7 @@ static void AppendCppTypeName( Type elementType = type.GetElementType(); for (int i = 0; i < rank; ++i) { - AppendCppTypeName( + AppendCppTypeFullName( elementType, output); if (i != rank -1) @@ -13623,48 +13447,45 @@ static void AppendCppTypeName( } else if (IsDelegate(type)) { - AppendCppTypeName( - type.Namespace, - type.Name, + AppendCppTypeFullName( + GetTypeName(type), output); Type[] genTypes = type.GetGenericArguments(); - if (genTypes.Length > 0) - { - output.Append(genTypes.Length); - } AppendCppTypeParameters( genTypes, output); } else { - AppendCppTypeName( - type.Namespace, - type.Name, - output); + TypeName typeName = GetTypeName(type); + AppendCppTypeFullName(typeName, output); Type[] genTypes = type.GetGenericArguments(); - AppendCppTypeParameters( - genTypes, - output); + AppendCppTypeParameters(genTypes, output); } } - static void AppendCppTypeName( - string namespaceName, - string name, + static void AppendCppTypeFullName( + TypeName typeName, StringBuilder output) { - AppendNamespace( - namespaceName, - "::", - output); - if (!string.IsNullOrEmpty(namespaceName)) + AppendNamespace(typeName.Namespace, "::", output); + if (!string.IsNullOrEmpty(typeName.Namespace)) { output.Append("::"); } - AppendTypeNameWithoutGenericSuffix( - name, - output); + AppendCppTypeName(typeName, output); + } + + static void AppendCppTypeName( + TypeName typeName, + StringBuilder output) + { + AppendTypeNameWithoutGenericSuffix(typeName.Name, output); + if (typeName.NumTypeParams > 0) + { + output.Append('_'); + output.Append(typeName.NumTypeParams); + } } static void AppendCppPrimitiveTypeName( diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index f04e9f5..26511b8 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -11,6 +11,161 @@ { "Name": " System.IComparable" }, + { + "Name": "System.IEquatable`1", + "GenericParams": [ + { + "Types": [ + "System.Boolean" + ] + }, + { + "Types": [ + "System.Char" + ] + }, + { + "Types": [ + "System.SByte" + ] + }, + { + "Types": [ + "System.Byte" + ] + }, + { + "Types": [ + "System.Int16" + ] + }, + { + "Types": [ + "System.UInt16" + ] + }, + { + "Types": [ + "System.Int32" + ] + }, + { + "Types": [ + "System.UInt32" + ] + }, + { + "Types": [ + "System.Int64" + ] + }, + { + "Types": [ + "System.UInt64" + ] + }, + { + "Types": [ + "System.Single" + ] + }, + { + "Types": [ + "System.Double" + ] + }, + { + "Types": [ + "System.Decimal" + ] + } + ] + }, + { + "Name": "System.IComparable`1", + "GenericParams": [ + { + "Types": [ + "System.Boolean" + ] + }, + { + "Types": [ + "System.Char" + ] + }, + { + "Types": [ + "System.SByte" + ] + }, + { + "Types": [ + "System.Byte" + ] + }, + { + "Types": [ + "System.Int16" + ] + }, + { + "Types": [ + "System.UInt16" + ] + }, + { + "Types": [ + "System.Int32" + ] + }, + { + "Types": [ + "System.UInt32" + ] + }, + { + "Types": [ + "System.Int64" + ] + }, + { + "Types": [ + "System.UInt64" + ] + }, + { + "Types": [ + "System.Single" + ] + }, + { + "Types": [ + "System.Double" + ] + }, + { + "Types": [ + "System.Decimal" + ] + } + ] + }, + { + "Name": "System.Decimal", + "Constructors": [ + { + "ParamTypes": [ + "System.Double" + ] + }, + { + "ParamTypes": [ + "System.UInt64" + ] + } + ] + }, { "Name": "UnityEngine.Vector3", "Constructors": [ diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index e9f1568..23820f9 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -53,6 +53,11 @@ namespace Plugin int32_t (*EnumerableGetEnumerator)(int32_t handle); /*BEGIN FUNCTION POINTERS*/ + void (*ReleaseSystemDecimal)(int32_t handle); + int32_t (*SystemDecimalConstructorSystemDouble)(double value); + int32_t (*SystemDecimalConstructorSystemUInt64)(uint64_t value); + int32_t (*BoxDecimal)(int32_t valHandle); + int32_t (*UnboxDecimal)(int32_t valHandle); UnityEngine::Vector3 (*UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z); UnityEngine::Vector3 (*UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b); int32_t (*BoxVector3)(UnityEngine::Vector3& val); @@ -198,6 +203,16 @@ namespace System return IConvertible(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value)); } + Boolean::operator IComparable_1() const + { + return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value)); + } + + Boolean::operator IEquatable_1() const + { + return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxBoolean(Value)); + } + Char::Char() : Value(0) { @@ -242,6 +257,16 @@ namespace System { return IConvertible(Plugin::InternalUse::Only, Plugin::BoxChar(Value)); } + + Char::operator IComparable_1() const + { + return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxChar(Value)); + } + + Char::operator IEquatable_1() const + { + return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxChar(Value)); + } SByte::SByte() : Value(0) @@ -282,6 +307,16 @@ namespace System { return IConvertible(Plugin::InternalUse::Only, Plugin::BoxSByte(Value)); } + + SByte::operator IComparable_1() const + { + return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxSByte(Value)); + } + + SByte::operator IEquatable_1() const + { + return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxSByte(Value)); + } Byte::Byte() : Value(0) @@ -322,6 +357,16 @@ namespace System { return IConvertible(Plugin::InternalUse::Only, Plugin::BoxByte(Value)); } + + Byte::operator IComparable_1() const + { + return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxByte(Value)); + } + + Byte::operator IEquatable_1() const + { + return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxByte(Value)); + } Int16::Int16() : Value(0) @@ -362,6 +407,16 @@ namespace System { return IConvertible(Plugin::InternalUse::Only, Plugin::BoxInt16(Value)); } + + Int16::operator IComparable_1() const + { + return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxInt16(Value)); + } + + Int16::operator IEquatable_1() const + { + return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxInt16(Value)); + } UInt16::UInt16() : Value(0) @@ -402,6 +457,16 @@ namespace System { return IConvertible(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value)); } + + UInt16::operator IComparable_1() const + { + return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value)); + } + + UInt16::operator IEquatable_1() const + { + return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxUInt16(Value)); + } Int32::Int32() : Value(0) @@ -442,6 +507,16 @@ namespace System { return IConvertible(Plugin::InternalUse::Only, Plugin::BoxInt32(Value)); } + + Int32::operator IComparable_1() const + { + return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxInt32(Value)); + } + + Int32::operator IEquatable_1() const + { + return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxInt32(Value)); + } UInt32::UInt32() : Value(0) @@ -482,6 +557,16 @@ namespace System { return IConvertible(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value)); } + + UInt32::operator IComparable_1() const + { + return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value)); + } + + UInt32::operator IEquatable_1() const + { + return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxUInt32(Value)); + } Int64::Int64() : Value(0) @@ -522,6 +607,16 @@ namespace System { return IConvertible(Plugin::InternalUse::Only, Plugin::BoxInt64(Value)); } + + Int64::operator IComparable_1() const + { + return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxInt64(Value)); + } + + Int64::operator IEquatable_1() const + { + return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxInt64(Value)); + } UInt64::UInt64() : Value(0) @@ -562,6 +657,16 @@ namespace System { return IConvertible(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value)); } + + UInt64::operator IComparable_1() const + { + return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value)); + } + + UInt64::operator IEquatable_1() const + { + return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxUInt64(Value)); + } Single::Single() : Value(0.0f) @@ -602,6 +707,16 @@ namespace System { return IConvertible(Plugin::InternalUse::Only, Plugin::BoxSingle(Value)); } + + Single::operator IComparable_1() const + { + return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxSingle(Value)); + } + + Single::operator IEquatable_1() const + { + return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxSingle(Value)); + } Double::Double() : Value(0.0) @@ -642,6 +757,16 @@ namespace System { return IConvertible(Plugin::InternalUse::Only, Plugin::BoxDouble(Value)); } + + Double::operator IComparable_1() const + { + return IComparable_1(Plugin::InternalUse::Only, Plugin::BoxDouble(Value)); + } + + Double::operator IEquatable_1() const + { + return IEquatable_1(Plugin::InternalUse::Only, Plugin::BoxDouble(Value)); + } } //////////////////////////////////////////////////////////////// @@ -682,6 +807,20 @@ namespace Plugin } } +//////////////////////////////////////////////////////////////// +// User-defined literals for creating decimals (System.Decimal) +//////////////////////////////////////////////////////////////// + +System::Decimal operator"" _m(long double x) +{ + return System::Decimal((System::Double)x); +} + +System::Decimal operator"" _m(unsigned long long x) +{ + return System::Decimal((System::UInt64)x); +} + //////////////////////////////////////////////////////////////// // Reference counting of managed objects //////////////////////////////////////////////////////////////// @@ -728,6 +867,31 @@ namespace Plugin } /*BEGIN GLOBAL STATE AND FUNCTIONS*/ + int32_t RefCountsLenSystemDecimal; + int32_t* RefCountsSystemDecimal; + + void ReferenceManagedSystemDecimal(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenSystemDecimal); + if (handle != 0) + { + RefCountsSystemDecimal[handle]++; + } + } + + void DereferenceManagedSystemDecimal(int32_t handle) + { + assert(handle >= 0 && handle < RefCountsLenSystemDecimal); + if (handle != 0) + { + int32_t numRemain = --RefCountsSystemDecimal[handle]; + if (numRemain == 0) + { + ReleaseSystemDecimal(handle); + } + } + } + // Free list for MyGame::BaseBallScript pointers int32_t BaseBallScriptFreeListSize; @@ -1272,13 +1436,2376 @@ namespace System } } +namespace System +{ + IEquatable_1::IEquatable_1(decltype(nullptr)) + { + } + + IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEquatable_1::IEquatable_1(const IEquatable_1& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IEquatable_1::IEquatable_1(IEquatable_1&& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable_1::~IEquatable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable_1::operator==(const IEquatable_1& other) const + { + return Handle == other.Handle; + } + + bool IEquatable_1::operator!=(const IEquatable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IEquatable_1::IEquatable_1(decltype(nullptr)) + { + } + + IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEquatable_1::IEquatable_1(const IEquatable_1& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IEquatable_1::IEquatable_1(IEquatable_1&& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable_1::~IEquatable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable_1::operator==(const IEquatable_1& other) const + { + return Handle == other.Handle; + } + + bool IEquatable_1::operator!=(const IEquatable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IEquatable_1::IEquatable_1(decltype(nullptr)) + { + } + + IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEquatable_1::IEquatable_1(const IEquatable_1& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IEquatable_1::IEquatable_1(IEquatable_1&& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable_1::~IEquatable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable_1::operator==(const IEquatable_1& other) const + { + return Handle == other.Handle; + } + + bool IEquatable_1::operator!=(const IEquatable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IEquatable_1::IEquatable_1(decltype(nullptr)) + { + } + + IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEquatable_1::IEquatable_1(const IEquatable_1& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IEquatable_1::IEquatable_1(IEquatable_1&& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable_1::~IEquatable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable_1::operator==(const IEquatable_1& other) const + { + return Handle == other.Handle; + } + + bool IEquatable_1::operator!=(const IEquatable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IEquatable_1::IEquatable_1(decltype(nullptr)) + { + } + + IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEquatable_1::IEquatable_1(const IEquatable_1& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IEquatable_1::IEquatable_1(IEquatable_1&& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable_1::~IEquatable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable_1::operator==(const IEquatable_1& other) const + { + return Handle == other.Handle; + } + + bool IEquatable_1::operator!=(const IEquatable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IEquatable_1::IEquatable_1(decltype(nullptr)) + { + } + + IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEquatable_1::IEquatable_1(const IEquatable_1& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IEquatable_1::IEquatable_1(IEquatable_1&& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable_1::~IEquatable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable_1::operator==(const IEquatable_1& other) const + { + return Handle == other.Handle; + } + + bool IEquatable_1::operator!=(const IEquatable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IEquatable_1::IEquatable_1(decltype(nullptr)) + { + } + + IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEquatable_1::IEquatable_1(const IEquatable_1& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IEquatable_1::IEquatable_1(IEquatable_1&& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable_1::~IEquatable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable_1::operator==(const IEquatable_1& other) const + { + return Handle == other.Handle; + } + + bool IEquatable_1::operator!=(const IEquatable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IEquatable_1::IEquatable_1(decltype(nullptr)) + { + } + + IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEquatable_1::IEquatable_1(const IEquatable_1& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IEquatable_1::IEquatable_1(IEquatable_1&& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable_1::~IEquatable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable_1::operator==(const IEquatable_1& other) const + { + return Handle == other.Handle; + } + + bool IEquatable_1::operator!=(const IEquatable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IEquatable_1::IEquatable_1(decltype(nullptr)) + { + } + + IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEquatable_1::IEquatable_1(const IEquatable_1& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IEquatable_1::IEquatable_1(IEquatable_1&& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable_1::~IEquatable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable_1::operator==(const IEquatable_1& other) const + { + return Handle == other.Handle; + } + + bool IEquatable_1::operator!=(const IEquatable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IEquatable_1::IEquatable_1(decltype(nullptr)) + { + } + + IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEquatable_1::IEquatable_1(const IEquatable_1& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IEquatable_1::IEquatable_1(IEquatable_1&& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable_1::~IEquatable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable_1::operator==(const IEquatable_1& other) const + { + return Handle == other.Handle; + } + + bool IEquatable_1::operator!=(const IEquatable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IEquatable_1::IEquatable_1(decltype(nullptr)) + { + } + + IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEquatable_1::IEquatable_1(const IEquatable_1& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IEquatable_1::IEquatable_1(IEquatable_1&& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable_1::~IEquatable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable_1::operator==(const IEquatable_1& other) const + { + return Handle == other.Handle; + } + + bool IEquatable_1::operator!=(const IEquatable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IEquatable_1::IEquatable_1(decltype(nullptr)) + { + } + + IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEquatable_1::IEquatable_1(const IEquatable_1& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IEquatable_1::IEquatable_1(IEquatable_1&& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable_1::~IEquatable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable_1::operator==(const IEquatable_1& other) const + { + return Handle == other.Handle; + } + + bool IEquatable_1::operator!=(const IEquatable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IEquatable_1::IEquatable_1(decltype(nullptr)) + { + } + + IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEquatable_1::IEquatable_1(const IEquatable_1& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IEquatable_1::IEquatable_1(IEquatable_1&& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable_1::~IEquatable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable_1::operator==(const IEquatable_1& other) const + { + return Handle == other.Handle; + } + + bool IEquatable_1::operator!=(const IEquatable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IComparable_1::IComparable_1(decltype(nullptr)) + { + } + + IComparable_1::IComparable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparable_1::IComparable_1(const IComparable_1& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparable_1::IComparable_1(IComparable_1&& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparable_1::~IComparable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparable_1& IComparable_1::operator=(const IComparable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparable_1& IComparable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparable_1& IComparable_1::operator=(IComparable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparable_1::operator==(const IComparable_1& other) const + { + return Handle == other.Handle; + } + + bool IComparable_1::operator!=(const IComparable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IComparable_1::IComparable_1(decltype(nullptr)) + { + } + + IComparable_1::IComparable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparable_1::IComparable_1(const IComparable_1& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparable_1::IComparable_1(IComparable_1&& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparable_1::~IComparable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparable_1& IComparable_1::operator=(const IComparable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparable_1& IComparable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparable_1& IComparable_1::operator=(IComparable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparable_1::operator==(const IComparable_1& other) const + { + return Handle == other.Handle; + } + + bool IComparable_1::operator!=(const IComparable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IComparable_1::IComparable_1(decltype(nullptr)) + { + } + + IComparable_1::IComparable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparable_1::IComparable_1(const IComparable_1& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparable_1::IComparable_1(IComparable_1&& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparable_1::~IComparable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparable_1& IComparable_1::operator=(const IComparable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparable_1& IComparable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparable_1& IComparable_1::operator=(IComparable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparable_1::operator==(const IComparable_1& other) const + { + return Handle == other.Handle; + } + + bool IComparable_1::operator!=(const IComparable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IComparable_1::IComparable_1(decltype(nullptr)) + { + } + + IComparable_1::IComparable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparable_1::IComparable_1(const IComparable_1& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparable_1::IComparable_1(IComparable_1&& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparable_1::~IComparable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparable_1& IComparable_1::operator=(const IComparable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparable_1& IComparable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparable_1& IComparable_1::operator=(IComparable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparable_1::operator==(const IComparable_1& other) const + { + return Handle == other.Handle; + } + + bool IComparable_1::operator!=(const IComparable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IComparable_1::IComparable_1(decltype(nullptr)) + { + } + + IComparable_1::IComparable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparable_1::IComparable_1(const IComparable_1& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparable_1::IComparable_1(IComparable_1&& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparable_1::~IComparable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparable_1& IComparable_1::operator=(const IComparable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparable_1& IComparable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparable_1& IComparable_1::operator=(IComparable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparable_1::operator==(const IComparable_1& other) const + { + return Handle == other.Handle; + } + + bool IComparable_1::operator!=(const IComparable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IComparable_1::IComparable_1(decltype(nullptr)) + { + } + + IComparable_1::IComparable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparable_1::IComparable_1(const IComparable_1& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparable_1::IComparable_1(IComparable_1&& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparable_1::~IComparable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparable_1& IComparable_1::operator=(const IComparable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparable_1& IComparable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparable_1& IComparable_1::operator=(IComparable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparable_1::operator==(const IComparable_1& other) const + { + return Handle == other.Handle; + } + + bool IComparable_1::operator!=(const IComparable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IComparable_1::IComparable_1(decltype(nullptr)) + { + } + + IComparable_1::IComparable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparable_1::IComparable_1(const IComparable_1& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparable_1::IComparable_1(IComparable_1&& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparable_1::~IComparable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparable_1& IComparable_1::operator=(const IComparable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparable_1& IComparable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparable_1& IComparable_1::operator=(IComparable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparable_1::operator==(const IComparable_1& other) const + { + return Handle == other.Handle; + } + + bool IComparable_1::operator!=(const IComparable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IComparable_1::IComparable_1(decltype(nullptr)) + { + } + + IComparable_1::IComparable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparable_1::IComparable_1(const IComparable_1& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparable_1::IComparable_1(IComparable_1&& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparable_1::~IComparable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparable_1& IComparable_1::operator=(const IComparable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparable_1& IComparable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparable_1& IComparable_1::operator=(IComparable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparable_1::operator==(const IComparable_1& other) const + { + return Handle == other.Handle; + } + + bool IComparable_1::operator!=(const IComparable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IComparable_1::IComparable_1(decltype(nullptr)) + { + } + + IComparable_1::IComparable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparable_1::IComparable_1(const IComparable_1& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparable_1::IComparable_1(IComparable_1&& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparable_1::~IComparable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparable_1& IComparable_1::operator=(const IComparable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparable_1& IComparable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparable_1& IComparable_1::operator=(IComparable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparable_1::operator==(const IComparable_1& other) const + { + return Handle == other.Handle; + } + + bool IComparable_1::operator!=(const IComparable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IComparable_1::IComparable_1(decltype(nullptr)) + { + } + + IComparable_1::IComparable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparable_1::IComparable_1(const IComparable_1& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparable_1::IComparable_1(IComparable_1&& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparable_1::~IComparable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparable_1& IComparable_1::operator=(const IComparable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparable_1& IComparable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparable_1& IComparable_1::operator=(IComparable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparable_1::operator==(const IComparable_1& other) const + { + return Handle == other.Handle; + } + + bool IComparable_1::operator!=(const IComparable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IComparable_1::IComparable_1(decltype(nullptr)) + { + } + + IComparable_1::IComparable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparable_1::IComparable_1(const IComparable_1& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparable_1::IComparable_1(IComparable_1&& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparable_1::~IComparable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparable_1& IComparable_1::operator=(const IComparable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparable_1& IComparable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparable_1& IComparable_1::operator=(IComparable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparable_1::operator==(const IComparable_1& other) const + { + return Handle == other.Handle; + } + + bool IComparable_1::operator!=(const IComparable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IComparable_1::IComparable_1(decltype(nullptr)) + { + } + + IComparable_1::IComparable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparable_1::IComparable_1(const IComparable_1& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparable_1::IComparable_1(IComparable_1&& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparable_1::~IComparable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparable_1& IComparable_1::operator=(const IComparable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparable_1& IComparable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparable_1& IComparable_1::operator=(IComparable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparable_1::operator==(const IComparable_1& other) const + { + return Handle == other.Handle; + } + + bool IComparable_1::operator!=(const IComparable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + IComparable_1::IComparable_1(decltype(nullptr)) + { + } + + IComparable_1::IComparable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IComparable_1::IComparable_1(const IComparable_1& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IComparable_1::IComparable_1(IComparable_1&& other) + : IComparable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IComparable_1::~IComparable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IComparable_1& IComparable_1::operator=(const IComparable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IComparable_1& IComparable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IComparable_1& IComparable_1::operator=(IComparable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IComparable_1::operator==(const IComparable_1& other) const + { + return Handle == other.Handle; + } + + bool IComparable_1::operator!=(const IComparable_1& other) const + { + return Handle != other.Handle; + } +} + +namespace System +{ + Decimal::Decimal(decltype(nullptr)) + { + } + + Decimal::Decimal(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedSystemDecimal(Handle); + } + } + + Decimal::Decimal(const Decimal& other) + : Decimal(Plugin::InternalUse::Only, other.Handle) + { + } + + Decimal::Decimal(Decimal&& other) + : Decimal(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + Decimal::~Decimal() + { + if (Handle) + { + Plugin::DereferenceManagedSystemDecimal(Handle); + Handle = 0; + } + } + + Decimal& Decimal::operator=(const Decimal& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedSystemDecimal(Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedSystemDecimal(Handle); + } + return *this; + } + + Decimal& Decimal::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedSystemDecimal(Handle); + Handle = 0; + } + return *this; + } + + Decimal& Decimal::operator=(Decimal&& other) + { + if (Handle) + { + Plugin::DereferenceManagedSystemDecimal(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool Decimal::operator==(const Decimal& other) const + { + return Handle == other.Handle; + } + + bool Decimal::operator!=(const Decimal& other) const + { + return Handle != other.Handle; + } + + System::Decimal::Decimal(System::Double value) + { + auto returnValue = Plugin::SystemDecimalConstructorSystemDouble(value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedSystemDecimal(Handle); + } + } + + System::Decimal::Decimal(System::UInt64 value) + { + auto returnValue = Plugin::SystemDecimalConstructorSystemUInt64(value); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + Handle = returnValue; + if (returnValue) + { + Plugin::ReferenceManagedSystemDecimal(Handle); + } + } + + System::Decimal::operator System::ValueType() + { + int32_t handle = Plugin::BoxDecimal(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::ValueType(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + System::Decimal::operator System::Object() + { + int32_t handle = Plugin::BoxDecimal(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::Object(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + System::Decimal::operator System::IFormattable() + { + int32_t handle = Plugin::BoxDecimal(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IFormattable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + System::Decimal::operator System::IConvertible() + { + int32_t handle = Plugin::BoxDecimal(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IConvertible(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + System::Decimal::operator System::IComparable() + { + int32_t handle = Plugin::BoxDecimal(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IComparable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + System::Decimal::operator System::IComparable_1() + { + int32_t handle = Plugin::BoxDecimal(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IComparable_1(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + System::Decimal::operator System::IEquatable_1() + { + int32_t handle = Plugin::BoxDecimal(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IEquatable_1(Plugin::InternalUse::Only, handle); + } + return nullptr; + } +} + +namespace System +{ + System::Object::operator System::Decimal() + { + System::Decimal returnVal(Plugin::InternalUse::Only, Plugin::UnboxDecimal(Handle)); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + return returnVal; + } +} + namespace UnityEngine { Vector3::Vector3() { } - Vector3::Vector3(System::Single x, System::Single y, System::Single z) + UnityEngine::Vector3::Vector3(System::Single x, System::Single y, System::Single z) { auto returnValue = Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(x, y, z); if (Plugin::unhandledCsharpException) @@ -1291,7 +3818,7 @@ namespace UnityEngine *this = returnValue; } - UnityEngine::Vector3 Vector3::operator+(UnityEngine::Vector3& a) + UnityEngine::Vector3 UnityEngine::Vector3::operator+(UnityEngine::Vector3& a) { auto returnValue = Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(*this, a); if (Plugin::unhandledCsharpException) @@ -1304,7 +3831,7 @@ namespace UnityEngine return returnValue; } - Vector3::operator System::ValueType() + UnityEngine::Vector3::operator System::ValueType() { int32_t handle = Plugin::BoxVector3(*this); if (Plugin::unhandledCsharpException) @@ -1322,7 +3849,7 @@ namespace UnityEngine return nullptr; } - Vector3::operator System::Object() + UnityEngine::Vector3::operator System::Object() { int32_t handle = Plugin::BoxVector3(*this); if (Plugin::unhandledCsharpException) @@ -1343,7 +3870,7 @@ namespace UnityEngine namespace System { - Object::operator UnityEngine::Vector3() + System::Object::operator UnityEngine::Vector3() { UnityEngine::Vector3 returnVal(Plugin::UnboxVector3(Handle)); if (Plugin::unhandledCsharpException) @@ -1437,7 +3964,7 @@ namespace UnityEngine return Handle != other.Handle; } - System::String Object::GetName() + System::String UnityEngine::Object::GetName() { auto returnValue = Plugin::UnityEngineObjectPropertyGetName(Handle); if (Plugin::unhandledCsharpException) @@ -1450,7 +3977,7 @@ namespace UnityEngine return System::String(Plugin::InternalUse::Only, returnValue); } - void Object::SetName(System::String& value) + void UnityEngine::Object::SetName(System::String& value) { Plugin::UnityEngineObjectPropertySetName(Handle, value.Handle); if (Plugin::unhandledCsharpException) @@ -1545,7 +4072,7 @@ namespace UnityEngine return Handle != other.Handle; } - UnityEngine::Transform Component::GetTransform() + UnityEngine::Transform UnityEngine::Component::GetTransform() { auto returnValue = Plugin::UnityEngineComponentPropertyGetTransform(Handle); if (Plugin::unhandledCsharpException) @@ -1645,7 +4172,7 @@ namespace UnityEngine return Handle != other.Handle; } - UnityEngine::Vector3 Transform::GetPosition() + UnityEngine::Vector3 UnityEngine::Transform::GetPosition() { auto returnValue = Plugin::UnityEngineTransformPropertyGetPosition(Handle); if (Plugin::unhandledCsharpException) @@ -1658,7 +4185,7 @@ namespace UnityEngine return returnValue; } - void Transform::SetPosition(UnityEngine::Vector3& value) + void UnityEngine::Transform::SetPosition(UnityEngine::Vector3& value) { Plugin::UnityEngineTransformPropertySetPosition(Handle, value); if (Plugin::unhandledCsharpException) @@ -1753,7 +4280,7 @@ namespace System return Handle != other.Handle; } - System::Object IEnumerator::GetCurrent() + System::Object System::Collections::IEnumerator::GetCurrent() { auto returnValue = Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent(Handle); if (Plugin::unhandledCsharpException) @@ -1766,7 +4293,7 @@ namespace System return System::Object(Plugin::InternalUse::Only, returnValue); } - System::Boolean IEnumerator::MoveNext() + System::Boolean System::Collections::IEnumerator::MoveNext() { auto returnValue = Plugin::SystemCollectionsIEnumeratorMethodMoveNext(Handle); if (Plugin::unhandledCsharpException) @@ -2037,7 +4564,7 @@ namespace UnityEngine return Handle != other.Handle; } - template<> MyGame::BaseBallScript GameObject::AddComponent() + template<> MyGame::BaseBallScript UnityEngine::GameObject::AddComponent() { auto returnValue = Plugin::UnityEngineGameObjectMethodAddComponentMyGameBaseBallScript(Handle); if (Plugin::unhandledCsharpException) @@ -2050,7 +4577,7 @@ namespace UnityEngine return MyGame::BaseBallScript(Plugin::InternalUse::Only, returnValue); } - UnityEngine::GameObject GameObject::CreatePrimitive(UnityEngine::PrimitiveType type) + UnityEngine::GameObject UnityEngine::GameObject::CreatePrimitive(UnityEngine::PrimitiveType type) { auto returnValue = Plugin::UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(type); if (Plugin::unhandledCsharpException) @@ -2144,7 +4671,7 @@ namespace UnityEngine return Handle != other.Handle; } - void Debug::Log(System::Object& message) + void UnityEngine::Debug::Log(System::Object& message) { Plugin::UnityEngineDebugMethodLogSystemObject(message.Handle); if (Plugin::unhandledCsharpException) @@ -2328,7 +4855,7 @@ namespace UnityEngine return Handle != other.Handle; } - UnityEngine::Transform MonoBehaviour::GetTransform() + UnityEngine::Transform UnityEngine::MonoBehaviour::GetTransform() { auto returnValue = Plugin::UnityEngineMonoBehaviourPropertyGetTransform(Handle); if (Plugin::unhandledCsharpException) @@ -2426,7 +4953,7 @@ namespace System return Handle != other.Handle; } - Exception::Exception(System::String& message) + System::Exception::Exception(System::String& message) : System::Runtime::InteropServices::_Exception(nullptr) , System::Runtime::Serialization::ISerializable(nullptr) { @@ -2644,7 +5171,7 @@ namespace UnityEngine return Value != other.Value; } - PrimitiveType::operator System::Enum() + UnityEngine::PrimitiveType::operator System::Enum() { int32_t handle = Plugin::BoxPrimitiveType(*this); if (Plugin::unhandledCsharpException) @@ -2662,7 +5189,7 @@ namespace UnityEngine return nullptr; } - PrimitiveType::operator System::ValueType() + UnityEngine::PrimitiveType::operator System::ValueType() { int32_t handle = Plugin::BoxPrimitiveType(*this); if (Plugin::unhandledCsharpException) @@ -2680,7 +5207,7 @@ namespace UnityEngine return nullptr; } - PrimitiveType::operator System::Object() + UnityEngine::PrimitiveType::operator System::Object() { int32_t handle = Plugin::BoxPrimitiveType(*this); if (Plugin::unhandledCsharpException) @@ -2698,7 +5225,7 @@ namespace UnityEngine return nullptr; } - PrimitiveType::operator System::IFormattable() + UnityEngine::PrimitiveType::operator System::IFormattable() { int32_t handle = Plugin::BoxPrimitiveType(*this); if (Plugin::unhandledCsharpException) @@ -2716,7 +5243,7 @@ namespace UnityEngine return nullptr; } - PrimitiveType::operator System::IConvertible() + UnityEngine::PrimitiveType::operator System::IConvertible() { int32_t handle = Plugin::BoxPrimitiveType(*this); if (Plugin::unhandledCsharpException) @@ -2734,7 +5261,7 @@ namespace UnityEngine return nullptr; } - PrimitiveType::operator System::IComparable() + UnityEngine::PrimitiveType::operator System::IComparable() { int32_t handle = Plugin::BoxPrimitiveType(*this); if (Plugin::unhandledCsharpException) @@ -2762,7 +5289,7 @@ const UnityEngine::PrimitiveType UnityEngine::PrimitiveType::Quad(5); namespace System { - Object::operator UnityEngine::PrimitiveType() + System::Object::operator UnityEngine::PrimitiveType() { UnityEngine::PrimitiveType returnVal(Plugin::UnboxPrimitiveType(Handle)); if (Plugin::unhandledCsharpException) @@ -2856,7 +5383,7 @@ namespace UnityEngine return Handle != other.Handle; } - System::Single Time::GetDeltaTime() + System::Single UnityEngine::Time::GetDeltaTime() { auto returnValue = Plugin::UnityEngineTimePropertyGetDeltaTime(); if (Plugin::unhandledCsharpException) @@ -2961,7 +5488,7 @@ namespace MyGame namespace MyGame { - BaseBallScript::BaseBallScript() + MyGame::BaseBallScript::BaseBallScript() : UnityEngine::Object(nullptr) , UnityEngine::Component(nullptr) , UnityEngine::Behaviour(nullptr) @@ -3007,7 +5534,7 @@ namespace MyGame CppHandle = Plugin::StoreBaseBallScript(this); } - BaseBallScript::BaseBallScript(const BaseBallScript& other) + MyGame::BaseBallScript::BaseBallScript(const MyGame::BaseBallScript& other) : UnityEngine::Object(nullptr) , UnityEngine::Component(nullptr) , UnityEngine::Behaviour(nullptr) @@ -3022,7 +5549,7 @@ namespace MyGame } } - BaseBallScript::BaseBallScript(BaseBallScript&& other) + MyGame::BaseBallScript::BaseBallScript(MyGame::BaseBallScript&& other) : UnityEngine::Object(nullptr) , UnityEngine::Component(nullptr) , UnityEngine::Behaviour(nullptr) @@ -3035,7 +5562,7 @@ namespace MyGame other.CppHandle = 0; } - BaseBallScript::BaseBallScript(Plugin::InternalUse, int32_t handle) + MyGame::BaseBallScript::BaseBallScript(Plugin::InternalUse, int32_t handle) : UnityEngine::Object(nullptr) , UnityEngine::Component(nullptr) , UnityEngine::Behaviour(nullptr) @@ -3050,7 +5577,7 @@ namespace MyGame } } - BaseBallScript::~BaseBallScript() + MyGame::BaseBallScript::~BaseBallScript() { Plugin::RemoveWholeBaseBallScript(this); Plugin::RemoveBaseBallScript(CppHandle); @@ -3073,7 +5600,7 @@ namespace MyGame } } - BaseBallScript& BaseBallScript::operator=(const BaseBallScript& other) + MyGame::BaseBallScript& MyGame::BaseBallScript::operator=(const MyGame::BaseBallScript& other) { if (this->Handle) { @@ -3087,7 +5614,7 @@ namespace MyGame return *this; } - BaseBallScript& BaseBallScript::operator=(decltype(nullptr)) + MyGame::BaseBallScript& MyGame::BaseBallScript::operator=(decltype(nullptr)) { if (Handle) { @@ -3109,7 +5636,7 @@ namespace MyGame return *this; } - BaseBallScript& BaseBallScript::operator=(BaseBallScript&& other) + MyGame::BaseBallScript& MyGame::BaseBallScript::operator=(MyGame::BaseBallScript&& other) { Plugin::RemoveBaseBallScript(CppHandle); CppHandle = 0; @@ -3134,12 +5661,12 @@ namespace MyGame return *this; } - bool BaseBallScript::operator==(const BaseBallScript& other) const + bool MyGame::BaseBallScript::operator==(const MyGame::BaseBallScript& other) const { return Handle == other.Handle; } - bool BaseBallScript::operator!=(const BaseBallScript& other) const + bool MyGame::BaseBallScript::operator!=(const MyGame::BaseBallScript& other) const { return Handle != other.Handle; } @@ -3153,11 +5680,11 @@ namespace MyGame DLLEXPORT void DestroyBaseBallScript(int32_t cppHandle) { - BaseBallScript* instance = Plugin::GetBaseBallScript(cppHandle); + MyGame::BaseBallScript* instance = Plugin::GetBaseBallScript(cppHandle); instance->~BaseBallScript(); } - void BaseBallScript::Update() + void MyGame::BaseBallScript::Update() { } @@ -3182,7 +5709,7 @@ namespace MyGame namespace System { - Object::operator System::Boolean() + System::Object::operator System::Boolean() { System::Boolean returnVal(Plugin::UnboxBoolean(Handle)); if (Plugin::unhandledCsharpException) @@ -3198,7 +5725,7 @@ namespace System namespace System { - Object::operator System::SByte() + System::Object::operator System::SByte() { System::SByte returnVal(Plugin::UnboxSByte(Handle)); if (Plugin::unhandledCsharpException) @@ -3214,7 +5741,7 @@ namespace System namespace System { - Object::operator System::Byte() + System::Object::operator System::Byte() { System::Byte returnVal(Plugin::UnboxByte(Handle)); if (Plugin::unhandledCsharpException) @@ -3230,7 +5757,7 @@ namespace System namespace System { - Object::operator System::Int16() + System::Object::operator System::Int16() { System::Int16 returnVal(Plugin::UnboxInt16(Handle)); if (Plugin::unhandledCsharpException) @@ -3246,7 +5773,7 @@ namespace System namespace System { - Object::operator System::UInt16() + System::Object::operator System::UInt16() { System::UInt16 returnVal(Plugin::UnboxUInt16(Handle)); if (Plugin::unhandledCsharpException) @@ -3262,7 +5789,7 @@ namespace System namespace System { - Object::operator System::Int32() + System::Object::operator System::Int32() { System::Int32 returnVal(Plugin::UnboxInt32(Handle)); if (Plugin::unhandledCsharpException) @@ -3278,7 +5805,7 @@ namespace System namespace System { - Object::operator System::UInt32() + System::Object::operator System::UInt32() { System::UInt32 returnVal(Plugin::UnboxUInt32(Handle)); if (Plugin::unhandledCsharpException) @@ -3294,7 +5821,7 @@ namespace System namespace System { - Object::operator System::Int64() + System::Object::operator System::Int64() { System::Int64 returnVal(Plugin::UnboxInt64(Handle)); if (Plugin::unhandledCsharpException) @@ -3310,7 +5837,7 @@ namespace System namespace System { - Object::operator System::UInt64() + System::Object::operator System::UInt64() { System::UInt64 returnVal(Plugin::UnboxUInt64(Handle)); if (Plugin::unhandledCsharpException) @@ -3326,7 +5853,7 @@ namespace System namespace System { - Object::operator System::Char() + System::Object::operator System::Char() { System::Char returnVal(Plugin::UnboxChar(Handle)); if (Plugin::unhandledCsharpException) @@ -3342,7 +5869,7 @@ namespace System namespace System { - Object::operator System::Single() + System::Object::operator System::Single() { System::Single returnVal(Plugin::UnboxSingle(Handle)); if (Plugin::unhandledCsharpException) @@ -3358,7 +5885,7 @@ namespace System namespace System { - Object::operator System::Double() + System::Object::operator System::Double() { System::Double returnVal(Plugin::UnboxDouble(Handle)); if (Plugin::unhandledCsharpException) @@ -3431,6 +5958,11 @@ DLLEXPORT void Init( int32_t (*enumerableGetEnumerator)(int32_t handle), /*BEGIN INIT PARAMS*/ int32_t maxManagedObjects, + void (*releaseSystemDecimal)(int32_t handle), + int32_t (*systemDecimalConstructorSystemDouble)(double value), + int32_t (*systemDecimalConstructorSystemUInt64)(uint64_t value), + int32_t (*boxDecimal)(int32_t valHandle), + int32_t (*unboxDecimal)(int32_t valHandle), UnityEngine::Vector3 (*unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z), UnityEngine::Vector3 (*unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b), int32_t (*boxVector3)(UnityEngine::Vector3& val), @@ -3492,6 +6024,14 @@ DLLEXPORT void Init( Plugin::ArrayGetLength = arrayGetLength; Plugin::EnumerableGetEnumerator = enumerableGetEnumerator; /*BEGIN INIT BODY*/ + Plugin::ReleaseSystemDecimal = releaseSystemDecimal; + Plugin::RefCountsSystemDecimal = (int32_t*)curMemory; + curMemory += 1000 * sizeof(int32_t); + Plugin::RefCountsLenSystemDecimal = 1000; + Plugin::SystemDecimalConstructorSystemDouble = systemDecimalConstructorSystemDouble; + Plugin::SystemDecimalConstructorSystemUInt64 = systemDecimalConstructorSystemUInt64; + Plugin::BoxDecimal = boxDecimal; + Plugin::UnboxDecimal = unboxDecimal; Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle = unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle; Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3 = unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3; Plugin::BoxVector3 = boxVector3; diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/CppSource/NativeScript/Bindings.h index 04e0e99..e7a25bb 100644 --- a/Unity/CppSource/NativeScript/Bindings.h +++ b/Unity/CppSource/NativeScript/Bindings.h @@ -77,6 +77,8 @@ namespace System template struct Array4; template struct Array5; struct IComparable; + template struct IComparable_1; + template struct IEquatable_1; struct IFormattable; struct IConvertible; @@ -98,6 +100,8 @@ namespace System explicit operator IComparable() const; explicit operator IFormattable() const; explicit operator IConvertible() const; + explicit operator IComparable_1() const; + explicit operator IEquatable_1() const; }; // .NET chars are two bytes long @@ -115,6 +119,8 @@ namespace System explicit operator IComparable() const; explicit operator IFormattable() const; explicit operator IConvertible() const; + explicit operator IComparable_1() const; + explicit operator IEquatable_1() const; }; struct SByte @@ -129,6 +135,8 @@ namespace System explicit operator IComparable() const; explicit operator IFormattable() const; explicit operator IConvertible() const; + explicit operator IComparable_1() const; + explicit operator IEquatable_1() const; }; struct Byte @@ -143,6 +151,8 @@ namespace System explicit operator IComparable() const; explicit operator IFormattable() const; explicit operator IConvertible() const; + explicit operator IComparable_1() const; + explicit operator IEquatable_1() const; }; struct Int16 @@ -157,6 +167,8 @@ namespace System explicit operator IComparable() const; explicit operator IFormattable() const; explicit operator IConvertible() const; + explicit operator IComparable_1() const; + explicit operator IEquatable_1() const; }; struct UInt16 @@ -171,6 +183,8 @@ namespace System explicit operator IComparable() const; explicit operator IFormattable() const; explicit operator IConvertible() const; + explicit operator IComparable_1() const; + explicit operator IEquatable_1() const; }; struct Int32 @@ -185,6 +199,8 @@ namespace System explicit operator IComparable() const; explicit operator IFormattable() const; explicit operator IConvertible() const; + explicit operator IComparable_1() const; + explicit operator IEquatable_1() const; }; struct UInt32 @@ -199,6 +215,8 @@ namespace System explicit operator IComparable() const; explicit operator IFormattable() const; explicit operator IConvertible() const; + explicit operator IComparable_1() const; + explicit operator IEquatable_1() const; }; struct Int64 @@ -213,6 +231,8 @@ namespace System explicit operator IComparable() const; explicit operator IFormattable() const; explicit operator IConvertible() const; + explicit operator IComparable_1() const; + explicit operator IEquatable_1() const; }; struct UInt64 @@ -227,6 +247,8 @@ namespace System explicit operator IComparable() const; explicit operator IFormattable() const; explicit operator IConvertible() const; + explicit operator IComparable_1() const; + explicit operator IEquatable_1() const; }; struct Single @@ -241,6 +263,8 @@ namespace System explicit operator IComparable() const; explicit operator IFormattable() const; explicit operator IConvertible() const; + explicit operator IComparable_1() const; + explicit operator IEquatable_1() const; }; struct Double @@ -255,11 +279,21 @@ namespace System explicit operator IComparable() const; explicit operator IFormattable() const; explicit operator IConvertible() const; + explicit operator IComparable_1() const; + explicit operator IEquatable_1() const; }; } /*BEGIN TEMPLATE DECLARATIONS*/ +namespace System +{ + template struct IEquatable_1; +} +namespace System +{ + template struct IComparable_1; +} /*END TEMPLATE DECLARATIONS*/ /*BEGIN TYPE DECLARATIONS*/ @@ -278,6 +312,11 @@ namespace System struct IComparable; } +namespace System +{ + struct Decimal; +} + namespace UnityEngine { struct Vector3; @@ -385,7 +424,135 @@ namespace MyGame /*END TYPE DECLARATIONS*/ /*BEGIN TEMPLATE SPECIALIZATION DECLARATIONS*/ +namespace System +{ + template<> struct IEquatable_1; +} + +namespace System +{ + template<> struct IEquatable_1; +} + +namespace System +{ + template<> struct IEquatable_1; +} + +namespace System +{ + template<> struct IEquatable_1; +} + +namespace System +{ + template<> struct IEquatable_1; +} + +namespace System +{ + template<> struct IEquatable_1; +} + +namespace System +{ + template<> struct IEquatable_1; +} + +namespace System +{ + template<> struct IEquatable_1; +} + +namespace System +{ + template<> struct IEquatable_1; +} + +namespace System +{ + template<> struct IEquatable_1; +} + +namespace System +{ + template<> struct IEquatable_1; +} + +namespace System +{ + template<> struct IEquatable_1; +} + +namespace System +{ + template<> struct IEquatable_1; +} + +namespace System +{ + template<> struct IComparable_1; +} + +namespace System +{ + template<> struct IComparable_1; +} + +namespace System +{ + template<> struct IComparable_1; +} + +namespace System +{ + template<> struct IComparable_1; +} + +namespace System +{ + template<> struct IComparable_1; +} + +namespace System +{ + template<> struct IComparable_1; +} + +namespace System +{ + template<> struct IComparable_1; +} +namespace System +{ + template<> struct IComparable_1; +} + +namespace System +{ + template<> struct IComparable_1; +} + +namespace System +{ + template<> struct IComparable_1; +} + +namespace System +{ + template<> struct IComparable_1; +} + +namespace System +{ + template<> struct IComparable_1; +} + +namespace System +{ + template<> struct IComparable_1; +} /*END TEMPLATE SPECIALIZATION DECLARATIONS*/ //////////////////////////////////////////////////////////////// @@ -405,6 +572,7 @@ namespace System virtual void ThrowReferenceToThis(); /*BEGIN UNBOXING METHOD DECLARATIONS*/ + explicit operator System::Decimal(); explicit operator UnityEngine::Vector3(); explicit operator UnityEngine::PrimitiveType(); explicit operator System::Boolean(); @@ -545,6 +713,474 @@ namespace System }; } +namespace System +{ + template<> struct IEquatable_1 : virtual System::Object + { + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); + IEquatable_1& operator=(const IEquatable_1& other); + IEquatable_1& operator=(decltype(nullptr)); + IEquatable_1& operator=(IEquatable_1&& other); + bool operator==(const IEquatable_1& other) const; + bool operator!=(const IEquatable_1& other) const; + }; +} + +namespace System +{ + template<> struct IEquatable_1 : virtual System::Object + { + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); + IEquatable_1& operator=(const IEquatable_1& other); + IEquatable_1& operator=(decltype(nullptr)); + IEquatable_1& operator=(IEquatable_1&& other); + bool operator==(const IEquatable_1& other) const; + bool operator!=(const IEquatable_1& other) const; + }; +} + +namespace System +{ + template<> struct IEquatable_1 : virtual System::Object + { + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); + IEquatable_1& operator=(const IEquatable_1& other); + IEquatable_1& operator=(decltype(nullptr)); + IEquatable_1& operator=(IEquatable_1&& other); + bool operator==(const IEquatable_1& other) const; + bool operator!=(const IEquatable_1& other) const; + }; +} + +namespace System +{ + template<> struct IEquatable_1 : virtual System::Object + { + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); + IEquatable_1& operator=(const IEquatable_1& other); + IEquatable_1& operator=(decltype(nullptr)); + IEquatable_1& operator=(IEquatable_1&& other); + bool operator==(const IEquatable_1& other) const; + bool operator!=(const IEquatable_1& other) const; + }; +} + +namespace System +{ + template<> struct IEquatable_1 : virtual System::Object + { + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); + IEquatable_1& operator=(const IEquatable_1& other); + IEquatable_1& operator=(decltype(nullptr)); + IEquatable_1& operator=(IEquatable_1&& other); + bool operator==(const IEquatable_1& other) const; + bool operator!=(const IEquatable_1& other) const; + }; +} + +namespace System +{ + template<> struct IEquatable_1 : virtual System::Object + { + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); + IEquatable_1& operator=(const IEquatable_1& other); + IEquatable_1& operator=(decltype(nullptr)); + IEquatable_1& operator=(IEquatable_1&& other); + bool operator==(const IEquatable_1& other) const; + bool operator!=(const IEquatable_1& other) const; + }; +} + +namespace System +{ + template<> struct IEquatable_1 : virtual System::Object + { + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); + IEquatable_1& operator=(const IEquatable_1& other); + IEquatable_1& operator=(decltype(nullptr)); + IEquatable_1& operator=(IEquatable_1&& other); + bool operator==(const IEquatable_1& other) const; + bool operator!=(const IEquatable_1& other) const; + }; +} + +namespace System +{ + template<> struct IEquatable_1 : virtual System::Object + { + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); + IEquatable_1& operator=(const IEquatable_1& other); + IEquatable_1& operator=(decltype(nullptr)); + IEquatable_1& operator=(IEquatable_1&& other); + bool operator==(const IEquatable_1& other) const; + bool operator!=(const IEquatable_1& other) const; + }; +} + +namespace System +{ + template<> struct IEquatable_1 : virtual System::Object + { + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); + IEquatable_1& operator=(const IEquatable_1& other); + IEquatable_1& operator=(decltype(nullptr)); + IEquatable_1& operator=(IEquatable_1&& other); + bool operator==(const IEquatable_1& other) const; + bool operator!=(const IEquatable_1& other) const; + }; +} + +namespace System +{ + template<> struct IEquatable_1 : virtual System::Object + { + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); + IEquatable_1& operator=(const IEquatable_1& other); + IEquatable_1& operator=(decltype(nullptr)); + IEquatable_1& operator=(IEquatable_1&& other); + bool operator==(const IEquatable_1& other) const; + bool operator!=(const IEquatable_1& other) const; + }; +} + +namespace System +{ + template<> struct IEquatable_1 : virtual System::Object + { + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); + IEquatable_1& operator=(const IEquatable_1& other); + IEquatable_1& operator=(decltype(nullptr)); + IEquatable_1& operator=(IEquatable_1&& other); + bool operator==(const IEquatable_1& other) const; + bool operator!=(const IEquatable_1& other) const; + }; +} + +namespace System +{ + template<> struct IEquatable_1 : virtual System::Object + { + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); + IEquatable_1& operator=(const IEquatable_1& other); + IEquatable_1& operator=(decltype(nullptr)); + IEquatable_1& operator=(IEquatable_1&& other); + bool operator==(const IEquatable_1& other) const; + bool operator!=(const IEquatable_1& other) const; + }; +} + +namespace System +{ + template<> struct IEquatable_1 : virtual System::Object + { + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); + IEquatable_1& operator=(const IEquatable_1& other); + IEquatable_1& operator=(decltype(nullptr)); + IEquatable_1& operator=(IEquatable_1&& other); + bool operator==(const IEquatable_1& other) const; + bool operator!=(const IEquatable_1& other) const; + }; +} + +namespace System +{ + template<> struct IComparable_1 : virtual System::Object + { + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); + IComparable_1& operator=(const IComparable_1& other); + IComparable_1& operator=(decltype(nullptr)); + IComparable_1& operator=(IComparable_1&& other); + bool operator==(const IComparable_1& other) const; + bool operator!=(const IComparable_1& other) const; + }; +} + +namespace System +{ + template<> struct IComparable_1 : virtual System::Object + { + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); + IComparable_1& operator=(const IComparable_1& other); + IComparable_1& operator=(decltype(nullptr)); + IComparable_1& operator=(IComparable_1&& other); + bool operator==(const IComparable_1& other) const; + bool operator!=(const IComparable_1& other) const; + }; +} + +namespace System +{ + template<> struct IComparable_1 : virtual System::Object + { + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); + IComparable_1& operator=(const IComparable_1& other); + IComparable_1& operator=(decltype(nullptr)); + IComparable_1& operator=(IComparable_1&& other); + bool operator==(const IComparable_1& other) const; + bool operator!=(const IComparable_1& other) const; + }; +} + +namespace System +{ + template<> struct IComparable_1 : virtual System::Object + { + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); + IComparable_1& operator=(const IComparable_1& other); + IComparable_1& operator=(decltype(nullptr)); + IComparable_1& operator=(IComparable_1&& other); + bool operator==(const IComparable_1& other) const; + bool operator!=(const IComparable_1& other) const; + }; +} + +namespace System +{ + template<> struct IComparable_1 : virtual System::Object + { + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); + IComparable_1& operator=(const IComparable_1& other); + IComparable_1& operator=(decltype(nullptr)); + IComparable_1& operator=(IComparable_1&& other); + bool operator==(const IComparable_1& other) const; + bool operator!=(const IComparable_1& other) const; + }; +} + +namespace System +{ + template<> struct IComparable_1 : virtual System::Object + { + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); + IComparable_1& operator=(const IComparable_1& other); + IComparable_1& operator=(decltype(nullptr)); + IComparable_1& operator=(IComparable_1&& other); + bool operator==(const IComparable_1& other) const; + bool operator!=(const IComparable_1& other) const; + }; +} + +namespace System +{ + template<> struct IComparable_1 : virtual System::Object + { + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); + IComparable_1& operator=(const IComparable_1& other); + IComparable_1& operator=(decltype(nullptr)); + IComparable_1& operator=(IComparable_1&& other); + bool operator==(const IComparable_1& other) const; + bool operator!=(const IComparable_1& other) const; + }; +} + +namespace System +{ + template<> struct IComparable_1 : virtual System::Object + { + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); + IComparable_1& operator=(const IComparable_1& other); + IComparable_1& operator=(decltype(nullptr)); + IComparable_1& operator=(IComparable_1&& other); + bool operator==(const IComparable_1& other) const; + bool operator!=(const IComparable_1& other) const; + }; +} + +namespace System +{ + template<> struct IComparable_1 : virtual System::Object + { + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); + IComparable_1& operator=(const IComparable_1& other); + IComparable_1& operator=(decltype(nullptr)); + IComparable_1& operator=(IComparable_1&& other); + bool operator==(const IComparable_1& other) const; + bool operator!=(const IComparable_1& other) const; + }; +} + +namespace System +{ + template<> struct IComparable_1 : virtual System::Object + { + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); + IComparable_1& operator=(const IComparable_1& other); + IComparable_1& operator=(decltype(nullptr)); + IComparable_1& operator=(IComparable_1&& other); + bool operator==(const IComparable_1& other) const; + bool operator!=(const IComparable_1& other) const; + }; +} + +namespace System +{ + template<> struct IComparable_1 : virtual System::Object + { + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); + IComparable_1& operator=(const IComparable_1& other); + IComparable_1& operator=(decltype(nullptr)); + IComparable_1& operator=(IComparable_1&& other); + bool operator==(const IComparable_1& other) const; + bool operator!=(const IComparable_1& other) const; + }; +} + +namespace System +{ + template<> struct IComparable_1 : virtual System::Object + { + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); + IComparable_1& operator=(const IComparable_1& other); + IComparable_1& operator=(decltype(nullptr)); + IComparable_1& operator=(IComparable_1&& other); + bool operator==(const IComparable_1& other) const; + bool operator!=(const IComparable_1& other) const; + }; +} + +namespace System +{ + template<> struct IComparable_1 : virtual System::Object + { + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); + IComparable_1& operator=(const IComparable_1& other); + IComparable_1& operator=(decltype(nullptr)); + IComparable_1& operator=(IComparable_1&& other); + bool operator==(const IComparable_1& other) const; + bool operator!=(const IComparable_1& other) const; + }; +} + +namespace System +{ + struct Decimal : Plugin::ManagedType + { + Decimal(decltype(nullptr)); + Decimal(Plugin::InternalUse, int32_t handle); + Decimal(const Decimal& other); + Decimal(Decimal&& other); + virtual ~Decimal(); + Decimal& operator=(const Decimal& other); + Decimal& operator=(decltype(nullptr)); + Decimal& operator=(Decimal&& other); + bool operator==(const Decimal& other) const; + bool operator!=(const Decimal& other) const; + Decimal(System::Double value); + Decimal(System::UInt64 value); + explicit operator System::ValueType(); + explicit operator System::Object(); + explicit operator System::IFormattable(); + explicit operator System::IConvertible(); + explicit operator System::IComparable(); + explicit operator System::IComparable_1(); + explicit operator System::IEquatable_1(); + }; +} + namespace UnityEngine { struct Vector3 @@ -938,3 +1574,10 @@ namespace System Plugin::EnumerableIterator end(IEnumerable& enumerable); } } + +//////////////////////////////////////////////////////////////// +// User-defined literals for creating decimals (System.Decimal) +//////////////////////////////////////////////////////////////// + +System::Decimal operator"" _m(long double x); +System::Decimal operator"" _m(unsigned long long x); From 4af035161a3ba682124eda3a47ab9697e6068557 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Mon, 26 Mar 2018 19:09:25 -0700 Subject: [PATCH 59/95] Fix issue #6 by ref counting System::String objects created from string literals --- Unity/CppSource/NativeScript/Bindings.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/CppSource/NativeScript/Bindings.cpp index 23820f9..a828a47 100644 --- a/Unity/CppSource/NativeScript/Bindings.cpp +++ b/Unity/CppSource/NativeScript/Bindings.cpp @@ -1093,6 +1093,7 @@ namespace System String::String(const char* chars) : Object(Plugin::InternalUse::Only, Plugin::StringNew(chars)) { + Plugin::ReferenceManagedClass(Handle); } ICloneable::ICloneable(Plugin::InternalUse iu, int32_t handle) From 97421db1ada4818fd8a496958125bbade14bc143 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Tue, 1 May 2018 09:11:18 -0700 Subject: [PATCH 60/95] Fix compiler errors for non-editor builds (thanks, @hanbim520!) Upgrade to 2017.4.1f1 --- Unity/Assets/NativeScript/Bindings.cs | 26 +++--- .../NativeScript/Editor/GenerateBindings.cs | 19 +++-- Unity/Assets/NativeScriptConstants.cs | 5 ++ Unity/ProjectSettings/GraphicsSettings.asset | 3 +- Unity/ProjectSettings/ProjectSettings.asset | 84 +++++++++++++++---- Unity/ProjectSettings/ProjectVersion.txt | 2 +- 6 files changed, 105 insertions(+), 34 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 4d182da..286d480 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -491,11 +491,11 @@ static T GetDelegate( typeof(T)) as T; } #else - [DllImport(PluginName)] + [DllImport(NativeScriptConstants.PluginName)] static extern void Init( IntPtr memory, int memorySize, - initMode initMode, + InitMode initMode, IntPtr releaseObject, IntPtr stringNew, IntPtr setException, @@ -555,21 +555,21 @@ static extern void Init( IntPtr unboxDouble /*END INIT PARAMS*/); - [DllImport(PluginName)] + [DllImport(NativeScriptConstants.PluginName)] static extern void SetCsharpException(int handle); /*BEGIN IMPORTS*/ - [DllImport(Constants.PluginName)] - public static extern void NewBaseBallScript(int thisHandle, int param0); + [DllImport(NativeScriptConstants.PluginName)] + public static extern int NewBaseBallScript(int thisHandle); - [DllImport(Constants.PluginName)] - public static extern void DestroyBaseBallScript(int thisHandle, int param0); + [DllImport(NativeScriptConstants.PluginName)] + public static extern void DestroyBaseBallScript(int thisHandle); - [DllImport(Constants.PluginName)] + [DllImport(NativeScriptConstants.PluginName)] public static extern void MyGameAbstractBaseBallScriptUpdate(int thisHandle); - [DllImport(Constants.PluginName)] - public static extern void SetCsharpExceptionSystemNullReferenceException(int thisHandle, int param0); + [DllImport(NativeScriptConstants.PluginName)] + public static extern void SetCsharpExceptionSystemNullReferenceException(int thisHandle); /*END IMPORTS*/ #endif @@ -631,13 +631,15 @@ IntPtr unboxDouble delegate int BoxDoubleDelegate(double val); delegate double UnboxDoubleDelegate(int valHandle); /*END DELEGATE TYPES*/ - - private static readonly string pluginPath = Application.dataPath + PLUGIN_PATH; + #if UNITY_EDITOR_WIN private static readonly string pluginTempPath = Application.dataPath + PLUGIN_TEMP_PATH; #endif public static Exception UnhandledCppException; +#if UNITY_EDITOR + private static readonly string pluginPath = Application.dataPath + PLUGIN_PATH; public static SetCsharpExceptionDelegate SetCsharpException; +#endif static IntPtr memory; static int memorySize; static DestroyEntry[] destroyQueue; diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 7bd5513..0b810fd 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -7550,7 +7550,8 @@ static void AppendBaseType( GetTypeName(string.Empty, string.Empty), null, cppDefaultConstructorBindingFunctionName, - cppDefaultConstructorBindingFunctionParams, + ConvertParameters(Type.EmptyTypes), + typeof(int), builders.CsharpImports); AppendCsharpGetDelegateCall( GetTypeName(string.Empty, string.Empty), @@ -7607,11 +7608,14 @@ static void AppendBaseType( typeof(void), TypeKind.None, builders.CsharpDelegates); + ParameterInfo[] cppDestroyImportFunctionParams = ConvertParameters( + new Type[0]); AppendCsharpImport( GetTypeName(string.Empty, string.Empty), null, cppDestroyBindingFunctionName, - cppDestroyBindingFunctionParams, + cppDestroyImportFunctionParams, + typeof(void), builders.CsharpImports); AppendCsharpGetDelegateCall( GetTypeName(string.Empty, string.Empty), @@ -8685,6 +8689,7 @@ static ParameterInfo[] AppendBaseTypeCppNativeInvokeCall( typeParams, funcName, invokeParams, + typeof(void), builders.CsharpImports); return invokeParams; @@ -10639,11 +10644,14 @@ static void AppendCsharpImport( Type[] typeParams, string funcName, ParameterInfo[] parameters, + Type returnType, StringBuilder output ) { - output.Append("\t\t[DllImport(Constants.PluginName)]\n"); - output.Append("\t\tpublic static extern void "); + output.Append("\t\t[DllImport(NativeScriptConstants.PluginName)]\n"); + output.Append("\t\tpublic static extern "); + AppendCsharpTypeFullName(returnType, output); + output.Append(' '); AppendCsharpDelegateName( typeTypeName, typeParams, @@ -10857,7 +10865,8 @@ static void AppendExceptions( GetTypeName(string.Empty, string.Empty), null, funcName, - parameters, + ConvertParameters(Type.EmptyTypes), + typeof(void), builders.CsharpImports); // C# delegate diff --git a/Unity/Assets/NativeScriptConstants.cs b/Unity/Assets/NativeScriptConstants.cs index 54e6923..7e91c65 100644 --- a/Unity/Assets/NativeScriptConstants.cs +++ b/Unity/Assets/NativeScriptConstants.cs @@ -10,6 +10,11 @@ /// public static class NativeScriptConstants { + /// + /// Name of the plugin used by [DllImport] when running outside the editor + /// + public const string PluginName = "NativeScript"; + /// /// Path within the Unity project to the exposed types JSON file /// diff --git a/Unity/ProjectSettings/GraphicsSettings.asset b/Unity/ProjectSettings/GraphicsSettings.asset index a847871..d8b1468 100644 --- a/Unity/ProjectSettings/GraphicsSettings.asset +++ b/Unity/ProjectSettings/GraphicsSettings.asset @@ -36,7 +36,8 @@ GraphicsSettings: - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} m_PreloadedShaders: [] m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} diff --git a/Unity/ProjectSettings/ProjectSettings.asset b/Unity/ProjectSettings/ProjectSettings.asset index 52eead6..2a82354 100644 --- a/Unity/ProjectSettings/ProjectSettings.asset +++ b/Unity/ProjectSettings/ProjectSettings.asset @@ -3,9 +3,10 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 12 + serializedVersion: 14 productGUID: 435980e4cf9ff4aa8b71e496e8163063 AndroidProfiler: 0 + AndroidFilterTouchesWhenObscured: 0 defaultScreenOrientation: 4 targetDevice: 2 useOnDemandResources: 0 @@ -38,8 +39,6 @@ PlayerSettings: width: 1 height: 1 m_SplashScreenLogos: [] - m_SplashScreenBackgroundLandscape: {fileID: 0} - m_SplashScreenBackgroundPortrait: {fileID: 0} m_VirtualRealitySplashScreen: {fileID: 0} m_HolographicTrackingLossScreen: {fileID: 0} defaultScreenWidth: 1024 @@ -49,7 +48,6 @@ PlayerSettings: m_StereoRenderingPath: 0 m_ActiveColorSpace: 0 m_MTRendering: 1 - m_MobileMTRendering: 0 m_StackTraceTypes: 010000000100000001000000010000000100000001000000 iosShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1 @@ -63,14 +61,19 @@ PlayerSettings: allowedAutorotateToLandscapeLeft: 1 useOSAutorotation: 1 use32BitDisplayBuffer: 1 + preserveFramebufferAlpha: 0 disableDepthAndStencilBuffers: 0 + androidBlitType: 0 defaultIsFullScreen: 1 defaultIsNativeResolution: 1 + macRetinaSupport: 1 runInBackground: 0 captureSingleScreen: 0 muteOtherAudioSources: 0 Prepare IOS For Recording: 0 Force IOS Speakers When Recording: 0 + deferSystemGesturesMode: 0 + hideHomeButton: 0 submitAnalytics: 1 usePlayerLog: 1 bakeCollisionMeshes: 0 @@ -89,20 +92,22 @@ PlayerSettings: allowFullscreenSwitch: 1 graphicsJobMode: 0 macFullscreenMode: 2 - d3d9FullscreenMode: 1 d3d11FullscreenMode: 1 xboxSpeechDB: 0 xboxEnableHeadOrientation: 0 xboxEnableGuest: 0 xboxEnablePIXSampling: 0 + metalFramebufferOnly: 0 n3dsDisableStereoscopicView: 0 n3dsEnableSharedListOpt: 1 n3dsEnableVSync: 0 - ignoreAlphaClear: 0 xboxOneResolution: 0 + xboxOneSResolution: 0 + xboxOneXResolution: 3 xboxOneMonoLoggingLevel: 0 xboxOneLoggingLevel: 1 xboxOneDisableEsram: 0 + xboxOnePresentImmediateThreshold: 0 videoMemoryForVertexBuffers: 0 psp2PowerMode: 0 psp2AcquireBGM: 1 @@ -124,6 +129,7 @@ PlayerSettings: bundleVersion: 1.0 preloadedAssets: [] metroInputSource: 0 + wsaTransparentSwapchain: 0 m_HolographicPauseOnTrackingLoss: 1 xboxOneDisableKinectGpuReservation: 0 xboxOneEnable7thCore: 0 @@ -134,12 +140,23 @@ PlayerSettings: daydream: depthFormat: 0 useSustainedPerformanceMode: 0 + enableVideoLayer: 0 + useProtectedVideoMemory: 0 + minimumSupportedHeadTracking: 0 + maximumSupportedHeadTracking: 1 hololens: depthFormat: 1 + depthBufferSharingEnabled: 0 + oculus: + sharedDepthBuffer: 0 + dashSupport: 0 protectGraphicsMemory: 0 useHDRDisplay: 0 - targetPixelDensity: 0 + m_ColorGamuts: 00000000 + targetPixelDensity: 30 resolutionScalingMode: 0 + androidSupportedAspectRatio: 1 + androidMaxAspectRatio: 2.1 applicationIdentifier: Android: com.jacksondunstan.unityplayground Standalone: unity.DefaultCompany.UnityPlayground @@ -166,7 +183,7 @@ PlayerSettings: serializedVersion: 2 m_Bits: 238 iPhoneSdkVersion: 988 - iOSTargetOSVersionString: 6.0 + iOSTargetOSVersionString: 7.0 tvOSSdkVersion: 0 tvOSRequireExtendedGameController: 0 tvOSTargetOSVersionString: 9.0 @@ -182,15 +199,21 @@ PlayerSettings: iPhone47inSplashScreen: {fileID: 0} iPhone55inPortraitSplashScreen: {fileID: 0} iPhone55inLandscapeSplashScreen: {fileID: 0} + iPhone58inPortraitSplashScreen: {fileID: 0} + iPhone58inLandscapeSplashScreen: {fileID: 0} iPadPortraitSplashScreen: {fileID: 0} iPadHighResPortraitSplashScreen: {fileID: 0} iPadLandscapeSplashScreen: {fileID: 0} iPadHighResLandscapeSplashScreen: {fileID: 0} appleTVSplashScreen: {fileID: 0} + appleTVSplashScreen2x: {fileID: 0} tvOSSmallIconLayers: [] + tvOSSmallIconLayers2x: [] tvOSLargeIconLayers: [] tvOSTopShelfImageLayers: [] + tvOSTopShelfImageLayers2x: [] tvOSTopShelfImageWideLayers: [] + tvOSTopShelfImageWideLayers2x: [] iOSLaunchScreenType: 0 iOSLaunchScreenPortrait: {fileID: 0} iOSLaunchScreenLandscape: {fileID: 0} @@ -208,6 +231,8 @@ PlayerSettings: iOSLaunchScreeniPadFillPct: 100 iOSLaunchScreeniPadSize: 100 iOSLaunchScreeniPadCustomXibPath: + iOSUseLaunchScreenStoryboard: 0 + iOSLaunchScreenCustomStoryboardPath: iOSDeviceRequirements: [] iOSURLSchemes: [] iOSBackgroundModes: 0 @@ -219,6 +244,7 @@ PlayerSettings: iOSManualSigningProvisioningProfileID: tvOSManualSigningProvisioningProfileID: appleEnableAutomaticSigning: 0 + clonedFromGUID: 00000000000000000000000000000000 AndroidTargetDevice: 3 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} @@ -226,7 +252,9 @@ PlayerSettings: AndroidKeyaliasName: AndroidTVCompatibility: 1 AndroidIsGame: 1 + AndroidEnableTango: 0 androidEnableBanner: 1 + androidUseLowAccuracyLocation: 0 m_AndroidBanners: - width: 320 height: 180 @@ -240,6 +268,7 @@ PlayerSettings: m_Icon: {fileID: 0} m_Width: 128 m_Height: 128 + m_Kind: 0 m_BuildTargetBatching: [] m_BuildTargetGraphicsAPIs: - m_BuildTarget: AndroidPlayer @@ -300,10 +329,21 @@ PlayerSettings: - m_BuildTarget: tvOS m_Enabled: 0 m_Devices: [] + m_BuildTargetEnableVuforiaSettings: [] openGLRequireES31: 0 openGLRequireES31AEP: 0 - webPlayerTemplate: APPLICATION:Default m_TemplateCustomTags: {} + mobileMTRendering: + Android: 1 + iPhone: 1 + tvOS: 1 + m_BuildTargetGroupLightmapEncodingQuality: + - m_BuildTarget: Standalone + m_EncodingQuality: 1 + - m_BuildTarget: XboxOne + m_EncodingQuality: 1 + - m_BuildTarget: PS4 + m_EncodingQuality: 1 wiiUTitleID: 0005000011000000 wiiUGroupID: 00010000 wiiUCommonSaveSize: 4096 @@ -350,6 +390,9 @@ PlayerSettings: switchTitleNames_9: switchTitleNames_10: switchTitleNames_11: + switchTitleNames_12: + switchTitleNames_13: + switchTitleNames_14: switchPublisherNames_0: switchPublisherNames_1: switchPublisherNames_2: @@ -362,6 +405,9 @@ PlayerSettings: switchPublisherNames_9: switchPublisherNames_10: switchPublisherNames_11: + switchPublisherNames_12: + switchPublisherNames_13: + switchPublisherNames_14: switchIcons_0: {fileID: 0} switchIcons_1: {fileID: 0} switchIcons_2: {fileID: 0} @@ -374,6 +420,9 @@ PlayerSettings: switchIcons_9: {fileID: 0} switchIcons_10: {fileID: 0} switchIcons_11: {fileID: 0} + switchIcons_12: {fileID: 0} + switchIcons_13: {fileID: 0} + switchIcons_14: {fileID: 0} switchSmallIcons_0: {fileID: 0} switchSmallIcons_1: {fileID: 0} switchSmallIcons_2: {fileID: 0} @@ -386,6 +435,9 @@ PlayerSettings: switchSmallIcons_9: {fileID: 0} switchSmallIcons_10: {fileID: 0} switchSmallIcons_11: {fileID: 0} + switchSmallIcons_12: {fileID: 0} + switchSmallIcons_13: {fileID: 0} + switchSmallIcons_14: {fileID: 0} switchManualHTML: switchAccessibleURLs: switchLegalInformation: @@ -427,6 +479,8 @@ PlayerSettings: switchLocalCommunicationIds_7: switchParentalControl: 0 switchAllowsScreenshot: 1 + switchAllowsVideoCapturing: 1 + switchAllowsRuntimeAddOnContentInstall: 0 switchDataLossConfirmation: 0 switchSupportedNpadStyles: 3 switchSocketConfigEnabled: 0 @@ -437,6 +491,9 @@ PlayerSettings: switchUdpSendBufferSize: 9 switchUdpReceiveBufferSize: 42 switchSocketBufferEfficiency: 4 + switchSocketInitializeEnabled: 1 + switchNetworkInterfaceManagerInitializeEnabled: 1 + switchPlayerConnectionEnabled: 1 ps4NPAgeRating: 12 ps4NPTitleSecret: ps4NPTrophyPackPath: @@ -455,6 +512,8 @@ PlayerSettings: ps4PronunciationSIGPath: ps4BackgroundImagePath: ps4StartupImagePath: + ps4StartupImagesFolder: + ps4IconImagesFolder: ps4SaveDataImagePath: ps4SdkOverride: ps4BGMPath: @@ -625,12 +684,6 @@ PlayerSettings: n3dsTitle: GameName n3dsProductCode: n3dsApplicationId: 0xFF3FF - stvDeviceAddress: - stvProductDescription: - stvProductAuthor: - stvProductAuthorEmail: - stvProductLink: - stvProductCategory: 0 XboxOneProductId: XboxOneUpdateKey: XboxOneSandboxId: @@ -653,6 +706,7 @@ PlayerSettings: XboxOneSplashScreen: {fileID: 0} XboxOneAllowedProductIds: [] XboxOnePersistentLocalStorageSize: 0 + XboxOneXTitleMemory: 8 xboxOneScriptCompiler: 0 vrEditorSettings: daydream: diff --git a/Unity/ProjectSettings/ProjectVersion.txt b/Unity/ProjectSettings/ProjectVersion.txt index e6cd1f9..e3618f1 100644 --- a/Unity/ProjectSettings/ProjectVersion.txt +++ b/Unity/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2017.3.0f3 +m_EditorVersion: 2017.4.1f1 From 0f3e137a60dfd78f73894bc0170cfa9d288d9f4a Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 5 May 2018 10:23:59 -0700 Subject: [PATCH 61/95] Move CppSource into Assets Rename platform preprocessor symbols to TARGET_OS_NAME Disable bitcode in iOS builds Use static linking for iOS (i.e. [DllImport("__Internal")]) Build iOS into a hidden directory so it's ignored by Unity Remove NativeScriptConstants.PluginName Update Unity project and company name Update README.md Update .gitignore --- .gitignore | 6 +-- README.md | 2 +- Unity/Assets/CppSource.meta | 10 ++++ Unity/{ => Assets}/CppSource/CMakeLists.txt | 47 ++++++++++--------- Unity/Assets/CppSource/CMakeLists.txt.meta | 9 ++++ Unity/Assets/CppSource/Game.meta | 10 ++++ Unity/{ => Assets}/CppSource/Game/Game.cpp | 0 Unity/Assets/CppSource/Game/Game.cpp.meta | 26 ++++++++++ Unity/{ => Assets}/CppSource/Game/Game.h | 0 Unity/Assets/CppSource/Game/Game.h.meta | 26 ++++++++++ Unity/Assets/CppSource/NativeScript.meta | 10 ++++ .../CppSource/NativeScript/Bindings.cpp | 0 .../CppSource/NativeScript/Bindings.cpp.meta | 26 ++++++++++ .../CppSource/NativeScript/Bindings.h | 0 .../CppSource/NativeScript/Bindings.h.meta | 26 ++++++++++ Unity/{ => Assets}/CppSource/iOS.cmake | 0 Unity/Assets/CppSource/iOS.cmake.meta | 9 ++++ Unity/Assets/NativeScript/Bindings.cs | 16 ++++--- Unity/Assets/NativeScriptConstants.cs | 5 -- Unity/CppSource/Game.cpp.meta | 27 ----------- Unity/ProjectSettings/GraphicsSettings.asset | 1 - Unity/ProjectSettings/ProjectSettings.asset | 4 +- 22 files changed, 192 insertions(+), 68 deletions(-) create mode 100644 Unity/Assets/CppSource.meta rename Unity/{ => Assets}/CppSource/CMakeLists.txt (70%) create mode 100644 Unity/Assets/CppSource/CMakeLists.txt.meta create mode 100644 Unity/Assets/CppSource/Game.meta rename Unity/{ => Assets}/CppSource/Game/Game.cpp (100%) create mode 100644 Unity/Assets/CppSource/Game/Game.cpp.meta rename Unity/{ => Assets}/CppSource/Game/Game.h (100%) create mode 100644 Unity/Assets/CppSource/Game/Game.h.meta create mode 100644 Unity/Assets/CppSource/NativeScript.meta rename Unity/{ => Assets}/CppSource/NativeScript/Bindings.cpp (100%) create mode 100644 Unity/Assets/CppSource/NativeScript/Bindings.cpp.meta rename Unity/{ => Assets}/CppSource/NativeScript/Bindings.h (100%) create mode 100644 Unity/Assets/CppSource/NativeScript/Bindings.h.meta rename Unity/{ => Assets}/CppSource/iOS.cmake (100%) create mode 100644 Unity/Assets/CppSource/iOS.cmake.meta delete mode 100644 Unity/CppSource/Game.cpp.meta diff --git a/.gitignore b/.gitignore index aa955b9..7f3848a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,2 @@ -# Typical location for CMake build files and Visual Studio 2017 generated directories -/cmake -/NativeScript.dir -/x64 +# Rider IDE +.idea \ No newline at end of file diff --git a/README.md b/README.md index d07f917..6302ab5 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ C++ is the standard language for video games as well as many other fields. By pr Debug::Log(message); } -* Platform-dependent compilation via the [usual flags](https://docs.unity3d.com/Manual/PlatformDependentCompilation.html) (e.g. `#if UNITY_EDITOR`) +* Platform-dependent compilation (e.g. `#if TARGET_OS_ANDROID`) * [CMake](https://cmake.org/) build system sets up any IDE project or command-line build # Code Generator diff --git a/Unity/Assets/CppSource.meta b/Unity/Assets/CppSource.meta new file mode 100644 index 0000000..a8346ff --- /dev/null +++ b/Unity/Assets/CppSource.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: ec1b3d1da421646d781f3ccc6960a558 +folderAsset: yes +timeCreated: 1525538114 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/CppSource/CMakeLists.txt b/Unity/Assets/CppSource/CMakeLists.txt similarity index 70% rename from Unity/CppSource/CMakeLists.txt rename to Unity/Assets/CppSource/CMakeLists.txt index 73a28d6..306ae25 100644 --- a/Unity/CppSource/CMakeLists.txt +++ b/Unity/Assets/CppSource/CMakeLists.txt @@ -3,29 +3,29 @@ project(NativeScript CXX) # Set platform-dependent compilation defines matching C# if (EDITOR) - add_definitions(-DUNITY_EDITOR) + add_definitions(-DTARGET_OS_EDITOR) if (WIN32) - add_definitions(-DUNITY_EDITOR_WIN) + add_definitions(-DTARGET_OS_EDITOR_WIN) elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - add_definitions(-DUNITY_EDITOR_OSX) + add_definitions(-DTARGET_OS_EDITOR_OSX) elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") - add_definitions(-DUNITY_EDITOR_LINUX) + add_definitions(-DTARGET_OS_EDITOR_LINUX) endif() else() - add_definitions(-DUNITY_STANDALONE) + add_definitions(-DTARGET_OS_STANDALONE) if (WIN32) - add_definitions(-DUNITY_STANDALONE_WIN) + add_definitions(-DTARGET_OS_WIN) elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - add_definitions(-DUNITY_STANDALONE_OSX) + add_definitions(-DTARGET_OS_OSX) elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") - add_definitions(-DUNITY_STANDALONE_LINUX) + add_definitions(-DTARGET_OS_LINUX) endif() endif() if (IOS) - add_definitions(-DUNITY_IOS) + add_definitions(-DTARGET_OS_IPHONE) endif() if (ANDROID_NDK) - add_definitions(-DUNITY_ANDROID) + add_definitions(-DTARGET_OS_ANDROID) endif() # Use NDK on Android @@ -36,22 +36,22 @@ endif() # Set output path if (ANDROID_NDK) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../Assets/Plugins/Android) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/../Assets/Plugins/Android) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/../Assets/Plugins/Android) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../Plugins/Android) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/../Plugins/Android) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/../Plugins/Android) elseif (IOS) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../Assets/Plugins/iOS) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/../Assets/Plugins/iOS) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/../Assets/Plugins/iOS) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../Plugins/.iOS) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/../Plugins/.iOS) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/../Plugins/.iOS) elseif (WIN32 OR (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")) if (EDITOR) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../Assets/Plugins/Editor) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/../Assets/Plugins/Editor) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/../Assets/Plugins/Editor) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../Plugins/Editor) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/../Plugins/Editor) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/../Plugins/Editor) else() - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../Assets/Plugins) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/../Assets/Plugins) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/../Assets/Plugins) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../Plugins) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/../Plugins) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/../Plugins) endif() endif() @@ -75,6 +75,9 @@ set( # Build a library. If on an Apple platform, build it in a bundle. add_library(${PROJECT_NAME} MODULE ${SOURCES}) set_target_properties(${PROJECT_NAME} PROPERTIES BUNDLE TRUE) +if (IOS) + set_xcode_property(${PROJECT_NAME} ENABLE_BITCODE "NO") +endif() # Enable C++11 set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) \ No newline at end of file diff --git a/Unity/Assets/CppSource/CMakeLists.txt.meta b/Unity/Assets/CppSource/CMakeLists.txt.meta new file mode 100644 index 0000000..3ecd08d --- /dev/null +++ b/Unity/Assets/CppSource/CMakeLists.txt.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ff824f6dad1204438ac5993f133fa551 +timeCreated: 1525538114 +licenseType: Free +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Assets/CppSource/Game.meta b/Unity/Assets/CppSource/Game.meta new file mode 100644 index 0000000..7121431 --- /dev/null +++ b/Unity/Assets/CppSource/Game.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 5097e8d235bbf426abeae3e4fc76859f +folderAsset: yes +timeCreated: 1525538114 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/CppSource/Game/Game.cpp b/Unity/Assets/CppSource/Game/Game.cpp similarity index 100% rename from Unity/CppSource/Game/Game.cpp rename to Unity/Assets/CppSource/Game/Game.cpp diff --git a/Unity/Assets/CppSource/Game/Game.cpp.meta b/Unity/Assets/CppSource/Game/Game.cpp.meta new file mode 100644 index 0000000..6bcf89c --- /dev/null +++ b/Unity/Assets/CppSource/Game/Game.cpp.meta @@ -0,0 +1,26 @@ +fileFormatVersion: 2 +guid: cd5ee8d1b4f5748ed98f1f7cd17c386d +timeCreated: 1525538114 +licenseType: Free +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/CppSource/Game/Game.h b/Unity/Assets/CppSource/Game/Game.h similarity index 100% rename from Unity/CppSource/Game/Game.h rename to Unity/Assets/CppSource/Game/Game.h diff --git a/Unity/Assets/CppSource/Game/Game.h.meta b/Unity/Assets/CppSource/Game/Game.h.meta new file mode 100644 index 0000000..c81ed01 --- /dev/null +++ b/Unity/Assets/CppSource/Game/Game.h.meta @@ -0,0 +1,26 @@ +fileFormatVersion: 2 +guid: 568849c22711c4c4aaaf09df05a1d812 +timeCreated: 1525538114 +licenseType: Free +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Assets/CppSource/NativeScript.meta b/Unity/Assets/CppSource/NativeScript.meta new file mode 100644 index 0000000..a82c5d8 --- /dev/null +++ b/Unity/Assets/CppSource/NativeScript.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: c48669dd52f8e49b890586dd9a417de5 +folderAsset: yes +timeCreated: 1525538114 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/CppSource/NativeScript/Bindings.cpp b/Unity/Assets/CppSource/NativeScript/Bindings.cpp similarity index 100% rename from Unity/CppSource/NativeScript/Bindings.cpp rename to Unity/Assets/CppSource/NativeScript/Bindings.cpp diff --git a/Unity/Assets/CppSource/NativeScript/Bindings.cpp.meta b/Unity/Assets/CppSource/NativeScript/Bindings.cpp.meta new file mode 100644 index 0000000..1b1a472 --- /dev/null +++ b/Unity/Assets/CppSource/NativeScript/Bindings.cpp.meta @@ -0,0 +1,26 @@ +fileFormatVersion: 2 +guid: 6b6c5fe253c434b7db04a6d5165c1001 +timeCreated: 1525538114 +licenseType: Free +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/CppSource/NativeScript/Bindings.h b/Unity/Assets/CppSource/NativeScript/Bindings.h similarity index 100% rename from Unity/CppSource/NativeScript/Bindings.h rename to Unity/Assets/CppSource/NativeScript/Bindings.h diff --git a/Unity/Assets/CppSource/NativeScript/Bindings.h.meta b/Unity/Assets/CppSource/NativeScript/Bindings.h.meta new file mode 100644 index 0000000..615fc4b --- /dev/null +++ b/Unity/Assets/CppSource/NativeScript/Bindings.h.meta @@ -0,0 +1,26 @@ +fileFormatVersion: 2 +guid: 2fa6cfa70e93c4d59a7f05e21c18d56b +timeCreated: 1525538114 +licenseType: Free +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + isPreloaded: 0 + isOverridable: 0 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/CppSource/iOS.cmake b/Unity/Assets/CppSource/iOS.cmake similarity index 100% rename from Unity/CppSource/iOS.cmake rename to Unity/Assets/CppSource/iOS.cmake diff --git a/Unity/Assets/CppSource/iOS.cmake.meta b/Unity/Assets/CppSource/iOS.cmake.meta new file mode 100644 index 0000000..f706a0b --- /dev/null +++ b/Unity/Assets/CppSource/iOS.cmake.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 4d9a55f92979e442396f99d94a5e9ec5 +timeCreated: 1525538114 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 286d480..248ee00 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -301,7 +301,11 @@ public DestroyEntry(DestroyFunction function, int cppHandle) } // Name of the plugin when using [DllImport] +#if !UNITY_EDITOR && UNITY_IOS + const string PLUGIN_NAME = "__Internal"; +#else const string PLUGIN_NAME = "NativeScript"; +#endif // Path to load the plugin from when running inside the editor #if UNITY_EDITOR_OSX @@ -491,7 +495,7 @@ static T GetDelegate( typeof(T)) as T; } #else - [DllImport(NativeScriptConstants.PluginName)] + [DllImport(PLUGIN_NAME)] static extern void Init( IntPtr memory, int memorySize, @@ -555,20 +559,20 @@ static extern void Init( IntPtr unboxDouble /*END INIT PARAMS*/); - [DllImport(NativeScriptConstants.PluginName)] + [DllImport(PLUGIN_NAME)] static extern void SetCsharpException(int handle); /*BEGIN IMPORTS*/ - [DllImport(NativeScriptConstants.PluginName)] + [DllImport(PLUGIN_NAME)] public static extern int NewBaseBallScript(int thisHandle); - [DllImport(NativeScriptConstants.PluginName)] + [DllImport(PLUGIN_NAME)] public static extern void DestroyBaseBallScript(int thisHandle); - [DllImport(NativeScriptConstants.PluginName)] + [DllImport(PLUGIN_NAME)] public static extern void MyGameAbstractBaseBallScriptUpdate(int thisHandle); - [DllImport(NativeScriptConstants.PluginName)] + [DllImport(PLUGIN_NAME)] public static extern void SetCsharpExceptionSystemNullReferenceException(int thisHandle); /*END IMPORTS*/ #endif diff --git a/Unity/Assets/NativeScriptConstants.cs b/Unity/Assets/NativeScriptConstants.cs index 7e91c65..54e6923 100644 --- a/Unity/Assets/NativeScriptConstants.cs +++ b/Unity/Assets/NativeScriptConstants.cs @@ -10,11 +10,6 @@ /// public static class NativeScriptConstants { - /// - /// Name of the plugin used by [DllImport] when running outside the editor - /// - public const string PluginName = "NativeScript"; - /// /// Path within the Unity project to the exposed types JSON file /// diff --git a/Unity/CppSource/Game.cpp.meta b/Unity/CppSource/Game.cpp.meta deleted file mode 100644 index bf03a81..0000000 --- a/Unity/CppSource/Game.cpp.meta +++ /dev/null @@ -1,27 +0,0 @@ -fileFormatVersion: 2 -guid: 5189acf91e865474290ba468798fb338 -timeCreated: 1501907744 -licenseType: Free -PluginImporter: - serializedVersion: 2 - iconMap: {} - executionOrder: {} - isPreloaded: 0 - isOverridable: 0 - platformData: - data: - first: - Any: - second: - enabled: 1 - settings: {} - data: - first: - Editor: Editor - second: - enabled: 0 - settings: - DefaultValueInitialized: true - userData: - assetBundleName: - assetBundleVariant: diff --git a/Unity/ProjectSettings/GraphicsSettings.asset b/Unity/ProjectSettings/GraphicsSettings.asset index d8b1468..77bf2f1 100644 --- a/Unity/ProjectSettings/GraphicsSettings.asset +++ b/Unity/ProjectSettings/GraphicsSettings.asset @@ -37,7 +37,6 @@ GraphicsSettings: - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} m_PreloadedShaders: [] m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} diff --git a/Unity/ProjectSettings/ProjectSettings.asset b/Unity/ProjectSettings/ProjectSettings.asset index 2a82354..b6955bb 100644 --- a/Unity/ProjectSettings/ProjectSettings.asset +++ b/Unity/ProjectSettings/ProjectSettings.asset @@ -11,8 +11,8 @@ PlayerSettings: targetDevice: 2 useOnDemandResources: 0 accelerometerFrequency: 60 - companyName: DefaultCompany - productName: UnityPlayground + companyName: JacksonDunstan + productName: UnityNativeScripting defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} From 6e23b68d36e415b9c48151f7fb570832e93d1e5d Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 5 May 2018 14:19:54 -0700 Subject: [PATCH 62/95] Updated README to use Android as a build time example --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6302ab5..ed009f0 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,9 @@ This project aims to give you a viable alternative to C#. Scripting in C++ isn't ## Fast Device Build Times -Changing one line of C# code requires you to make a new build of the game. Typical iOS build times tend to be at least 10 minutes because IL2CPP has to run and then Xcode has to compile a huge amount of C++. +Changing one line of C# code requires you to make a new build of the game. Typical Android build times tend to be at least 10 minutes because IL2CPP has to run and then a huge amount of C++ must be compiled. -By using C++, we can compile the game as a C++ plugin in about 1 second, swap the plugin into the Xcode project, and then immediately run the game. That's a huge productivity boost! +By using C++, we can compile the game as a C++ plugin in about 1 second, swap the plugin into the APK, and then immediately install and run the game. That's a huge productivity boost! ## Fast Compile Times From 40b66d8e371d3fb3d6215338ba018ed6f81295c7 Mon Sep 17 00:00:00 2001 From: jb Date: Mon, 14 May 2018 19:21:55 +0200 Subject: [PATCH 63/95] Fix incorrect path when generating bindings. Fix broken pragma causing warnings --- Unity/Assets/NativeScript/Editor/GenerateBindings.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 0b810fd..83d4726 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -24,7 +24,7 @@ public static class GenerateBindings { // Disable unused field types. JsonUtility actually uses them, but it // does so with reflection. - #pragma warning disable CS0649 + #pragma warning disable 649 [Serializable] class JsonConstructor @@ -289,7 +289,9 @@ struct TypeName static readonly string CppDirPath = Path.Combine( Path.Combine( - ProjectDirPath, + Path.Combine( + ProjectDirPath, + "Assets"), "CppSource"), "NativeScript"); static readonly string CsharpPath = Path.Combine( @@ -308,7 +310,7 @@ static readonly FieldOrderComparer DefaultFieldOrderComparer = new FieldOrderComparer(); // Restore unused field types - #pragma warning restore CS0649 + #pragma warning restore 649 public static void Generate() { From aae2a8320ead9cb7ffaa908801d97cd07c31afa4 Mon Sep 17 00:00:00 2001 From: jb Date: Mon, 14 May 2018 19:26:52 +0200 Subject: [PATCH 64/95] Update the readme to correct path to CppSource --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ed009f0..14f12cc 100644 --- a/README.md +++ b/README.md @@ -161,9 +161,8 @@ With C++, the workflow looks like this: 1. Download or clone this repo 2. Copy everything in `Unity/Assets` directory to your Unity project's `Assets` directory -3. Copy the `Unity/CppSource` directory to your Unity project directory -4. Edit `NativeScriptTypes.json` and specify what parts of the Unity, .NET, and custom DLL APIs you want access to from C++. -5. Edit `Unity/CppSource/Game/Game.cpp` and `Unity/CppSource/Game/Game.h` to create your game. Some example code is provided, but feel free to delete it. You can add more C++ source (`.cpp`) and header (`.h`) files here as your game grows. +3. Edit `NativeScriptTypes.json` and specify what parts of the Unity, .NET, and custom DLL APIs you want access to from C++. +4. Edit `Unity/Assets/CppSource/Game/Game.cpp` and `Unity/Assets/CppSource/Game/Game.h` to create your game. Some example code is provided, but feel free to delete it. You can add more C++ source (`.cpp`) and header (`.h`) files here as your game grows. # Building the C++ Plugin From 800e0cd027c57da62f04b5357436667b16414d65 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Thu, 17 May 2018 08:54:33 -0700 Subject: [PATCH 65/95] Fix generated plugin name in some cases --- Unity/Assets/NativeScript/Editor/GenerateBindings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 83d4726..9e04575 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -10650,7 +10650,7 @@ static void AppendCsharpImport( StringBuilder output ) { - output.Append("\t\t[DllImport(NativeScriptConstants.PluginName)]\n"); + output.Append("\t\t[DllImport(PLUGIN_NAME)]\n"); output.Append("\t\tpublic static extern "); AppendCsharpTypeFullName(returnType, output); output.Append(' '); From 2180b3edfea9d58da5242d9c5752b344d9a0b84c Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Thu, 7 Jun 2018 21:04:08 -0700 Subject: [PATCH 66/95] Generate correct return type for non-void base type methods. Thanks, @JmgrArt! --- Unity/Assets/NativeScript/Editor/GenerateBindings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 9e04575..8d84312 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -8691,7 +8691,7 @@ static ParameterInfo[] AppendBaseTypeCppNativeInvokeCall( typeParams, funcName, invokeParams, - typeof(void), + invokeMethod.ReturnType, builders.CsharpImports); return invokeParams; From 60450d4a58f623bf39770cf9e70da6c9932dd78e Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 10 Jun 2018 22:43:59 -0700 Subject: [PATCH 67/95] Pass Init parameters in 'memory' Never release exposed function delegates Fix miscellaneous Rider warnings --- .../CppSource/NativeScript/Bindings.cpp | 241 ++--- Unity/Assets/NativeScript/Bindings.cs | 626 +++++++------ Unity/Assets/NativeScript/BootScene.unity | 14 +- .../Assets/NativeScript/Editor/EditorMenus.cs | 3 +- .../NativeScript/Editor/GenerateBindings.cs | 871 +++++++----------- .../manifest.json | 0 Unity/ProjectSettings/GraphicsSettings.asset | 1 + Unity/ProjectSettings/PresetManager.asset | 6 + Unity/ProjectSettings/ProjectVersion.txt | 2 +- 9 files changed, 769 insertions(+), 995 deletions(-) rename Unity/{UnityPackageManager => Packages}/manifest.json (100%) create mode 100644 Unity/ProjectSettings/PresetManager.asset diff --git a/Unity/Assets/CppSource/NativeScript/Bindings.cpp b/Unity/Assets/CppSource/NativeScript/Bindings.cpp index a828a47..8e36cbb 100644 --- a/Unity/Assets/CppSource/NativeScript/Bindings.cpp +++ b/Unity/Assets/CppSource/NativeScript/Bindings.cpp @@ -5951,142 +5951,146 @@ enum class InitMode : uint8_t DLLEXPORT void Init( uint8_t* memory, int32_t memorySize, - InitMode initMode, - void (*releaseObject)(int32_t handle), - int32_t (*stringNew)(const char* chars), - void (*setException)(int32_t handle), - int32_t (*arrayGetLength)(int32_t handle), - int32_t (*enumerableGetEnumerator)(int32_t handle), - /*BEGIN INIT PARAMS*/ - int32_t maxManagedObjects, - void (*releaseSystemDecimal)(int32_t handle), - int32_t (*systemDecimalConstructorSystemDouble)(double value), - int32_t (*systemDecimalConstructorSystemUInt64)(uint64_t value), - int32_t (*boxDecimal)(int32_t valHandle), - int32_t (*unboxDecimal)(int32_t valHandle), - UnityEngine::Vector3 (*unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)(float x, float y, float z), - UnityEngine::Vector3 (*unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)(UnityEngine::Vector3& a, UnityEngine::Vector3& b), - int32_t (*boxVector3)(UnityEngine::Vector3& val), - UnityEngine::Vector3 (*unboxVector3)(int32_t valHandle), - int32_t (*unityEngineObjectPropertyGetName)(int32_t thisHandle), - void (*unityEngineObjectPropertySetName)(int32_t thisHandle, int32_t valueHandle), - int32_t (*unityEngineComponentPropertyGetTransform)(int32_t thisHandle), - UnityEngine::Vector3 (*unityEngineTransformPropertyGetPosition)(int32_t thisHandle), - void (*unityEngineTransformPropertySetPosition)(int32_t thisHandle, UnityEngine::Vector3& value), - int32_t (*systemCollectionsIEnumeratorPropertyGetCurrent)(int32_t thisHandle), - int32_t (*systemCollectionsIEnumeratorMethodMoveNext)(int32_t thisHandle), - int32_t (*unityEngineGameObjectMethodAddComponentMyGameBaseBallScript)(int32_t thisHandle), - int32_t (*unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)(UnityEngine::PrimitiveType type), - void (*unityEngineDebugMethodLogSystemObject)(int32_t messageHandle), - int32_t (*unityEngineMonoBehaviourPropertyGetTransform)(int32_t thisHandle), - int32_t (*systemExceptionConstructorSystemString)(int32_t messageHandle), - int32_t (*boxPrimitiveType)(UnityEngine::PrimitiveType val), - UnityEngine::PrimitiveType (*unboxPrimitiveType)(int32_t valHandle), - System::Single (*unityEngineTimePropertyGetDeltaTime)(), - void (*releaseBaseBallScript)(int32_t handle), - void (*baseBallScriptConstructor)(int32_t cppHandle, int32_t* handle), - int32_t (*boxBoolean)(uint32_t val), - int32_t (*unboxBoolean)(int32_t valHandle), - int32_t (*boxSByte)(int8_t val), - System::SByte (*unboxSByte)(int32_t valHandle), - int32_t (*boxByte)(uint8_t val), - System::Byte (*unboxByte)(int32_t valHandle), - int32_t (*boxInt16)(int16_t val), - System::Int16 (*unboxInt16)(int32_t valHandle), - int32_t (*boxUInt16)(uint16_t val), - System::UInt16 (*unboxUInt16)(int32_t valHandle), - int32_t (*boxInt32)(int32_t val), - System::Int32 (*unboxInt32)(int32_t valHandle), - int32_t (*boxUInt32)(uint32_t val), - System::UInt32 (*unboxUInt32)(int32_t valHandle), - int32_t (*boxInt64)(int64_t val), - System::Int64 (*unboxInt64)(int32_t valHandle), - int32_t (*boxUInt64)(uint64_t val), - System::UInt64 (*unboxUInt64)(int32_t valHandle), - int32_t (*boxChar)(uint16_t val), - int16_t (*unboxChar)(int32_t valHandle), - int32_t (*boxSingle)(float val), - System::Single (*unboxSingle)(int32_t valHandle), - int32_t (*boxDouble)(double val), - System::Double (*unboxDouble)(int32_t valHandle) - /*END INIT PARAMS*/) + InitMode initMode) { uint8_t* curMemory = memory; + // Read fixed parameters + Plugin::ReleaseObject = *(void (**)(int32_t handle))curMemory; + curMemory += sizeof(Plugin::ReleaseObject); + Plugin::StringNew = *(int32_t (**)(const char*))curMemory; + curMemory += sizeof(Plugin::StringNew); + Plugin::SetException = *(void (**)(int32_t))curMemory; + curMemory += sizeof(Plugin::SetException); + Plugin::ArrayGetLength = *(int32_t (**)(int32_t))curMemory; + curMemory += sizeof(Plugin::ArrayGetLength); + Plugin::EnumerableGetEnumerator = *(int32_t (**)(int32_t))curMemory; + curMemory += sizeof(Plugin::EnumerableGetEnumerator); + + // Read generated parameters + int32_t maxManagedObjects = *(int32_t*)curMemory; + curMemory += sizeof(int32_t); + /*BEGIN INIT BODY PARAMETER READS*/ + Plugin::ReleaseSystemDecimal = *(void (**)(int32_t handle))curMemory; + curMemory += sizeof(Plugin::ReleaseSystemDecimal); + Plugin::SystemDecimalConstructorSystemDouble = *(int32_t (**)(double value))curMemory; + curMemory += sizeof(Plugin::SystemDecimalConstructorSystemDouble); + Plugin::SystemDecimalConstructorSystemUInt64 = *(int32_t (**)(uint64_t value))curMemory; + curMemory += sizeof(Plugin::SystemDecimalConstructorSystemUInt64); + Plugin::BoxDecimal = *(int32_t (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::BoxDecimal); + Plugin::UnboxDecimal = *(int32_t (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxDecimal); + Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle = *(UnityEngine::Vector3 (**)(float x, float y, float z))curMemory; + curMemory += sizeof(Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle); + Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3 = *(UnityEngine::Vector3 (**)(UnityEngine::Vector3& a, UnityEngine::Vector3& b))curMemory; + curMemory += sizeof(Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3); + Plugin::BoxVector3 = *(int32_t (**)(UnityEngine::Vector3& val))curMemory; + curMemory += sizeof(Plugin::BoxVector3); + Plugin::UnboxVector3 = *(UnityEngine::Vector3 (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxVector3); + Plugin::UnityEngineObjectPropertyGetName = *(int32_t (**)(int32_t thisHandle))curMemory; + curMemory += sizeof(Plugin::UnityEngineObjectPropertyGetName); + Plugin::UnityEngineObjectPropertySetName = *(void (**)(int32_t thisHandle, int32_t valueHandle))curMemory; + curMemory += sizeof(Plugin::UnityEngineObjectPropertySetName); + Plugin::UnityEngineComponentPropertyGetTransform = *(int32_t (**)(int32_t thisHandle))curMemory; + curMemory += sizeof(Plugin::UnityEngineComponentPropertyGetTransform); + Plugin::UnityEngineTransformPropertyGetPosition = *(UnityEngine::Vector3 (**)(int32_t thisHandle))curMemory; + curMemory += sizeof(Plugin::UnityEngineTransformPropertyGetPosition); + Plugin::UnityEngineTransformPropertySetPosition = *(void (**)(int32_t thisHandle, UnityEngine::Vector3& value))curMemory; + curMemory += sizeof(Plugin::UnityEngineTransformPropertySetPosition); + Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent = *(int32_t (**)(int32_t thisHandle))curMemory; + curMemory += sizeof(Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent); + Plugin::SystemCollectionsIEnumeratorMethodMoveNext = *(int32_t (**)(int32_t thisHandle))curMemory; + curMemory += sizeof(Plugin::SystemCollectionsIEnumeratorMethodMoveNext); + Plugin::UnityEngineGameObjectMethodAddComponentMyGameBaseBallScript = *(int32_t (**)(int32_t thisHandle))curMemory; + curMemory += sizeof(Plugin::UnityEngineGameObjectMethodAddComponentMyGameBaseBallScript); + Plugin::UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType = *(int32_t (**)(UnityEngine::PrimitiveType type))curMemory; + curMemory += sizeof(Plugin::UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType); + Plugin::UnityEngineDebugMethodLogSystemObject = *(void (**)(int32_t messageHandle))curMemory; + curMemory += sizeof(Plugin::UnityEngineDebugMethodLogSystemObject); + Plugin::UnityEngineMonoBehaviourPropertyGetTransform = *(int32_t (**)(int32_t thisHandle))curMemory; + curMemory += sizeof(Plugin::UnityEngineMonoBehaviourPropertyGetTransform); + Plugin::SystemExceptionConstructorSystemString = *(int32_t (**)(int32_t messageHandle))curMemory; + curMemory += sizeof(Plugin::SystemExceptionConstructorSystemString); + Plugin::BoxPrimitiveType = *(int32_t (**)(UnityEngine::PrimitiveType val))curMemory; + curMemory += sizeof(Plugin::BoxPrimitiveType); + Plugin::UnboxPrimitiveType = *(UnityEngine::PrimitiveType (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxPrimitiveType); + Plugin::UnityEngineTimePropertyGetDeltaTime = *(System::Single (**)())curMemory; + curMemory += sizeof(Plugin::UnityEngineTimePropertyGetDeltaTime); + Plugin::ReleaseBaseBallScript = *(void (**)(int32_t handle))curMemory; + curMemory += sizeof(Plugin::ReleaseBaseBallScript); + Plugin::BaseBallScriptConstructor = *(void (**)(int32_t cppHandle, int32_t* handle))curMemory; + curMemory += sizeof(Plugin::BaseBallScriptConstructor); + Plugin::BoxBoolean = *(int32_t (**)(uint32_t val))curMemory; + curMemory += sizeof(Plugin::BoxBoolean); + Plugin::UnboxBoolean = *(int32_t (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxBoolean); + Plugin::BoxSByte = *(int32_t (**)(int8_t val))curMemory; + curMemory += sizeof(Plugin::BoxSByte); + Plugin::UnboxSByte = *(System::SByte (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxSByte); + Plugin::BoxByte = *(int32_t (**)(uint8_t val))curMemory; + curMemory += sizeof(Plugin::BoxByte); + Plugin::UnboxByte = *(System::Byte (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxByte); + Plugin::BoxInt16 = *(int32_t (**)(int16_t val))curMemory; + curMemory += sizeof(Plugin::BoxInt16); + Plugin::UnboxInt16 = *(System::Int16 (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxInt16); + Plugin::BoxUInt16 = *(int32_t (**)(uint16_t val))curMemory; + curMemory += sizeof(Plugin::BoxUInt16); + Plugin::UnboxUInt16 = *(System::UInt16 (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxUInt16); + Plugin::BoxInt32 = *(int32_t (**)(int32_t val))curMemory; + curMemory += sizeof(Plugin::BoxInt32); + Plugin::UnboxInt32 = *(System::Int32 (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxInt32); + Plugin::BoxUInt32 = *(int32_t (**)(uint32_t val))curMemory; + curMemory += sizeof(Plugin::BoxUInt32); + Plugin::UnboxUInt32 = *(System::UInt32 (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxUInt32); + Plugin::BoxInt64 = *(int32_t (**)(int64_t val))curMemory; + curMemory += sizeof(Plugin::BoxInt64); + Plugin::UnboxInt64 = *(System::Int64 (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxInt64); + Plugin::BoxUInt64 = *(int32_t (**)(uint64_t val))curMemory; + curMemory += sizeof(Plugin::BoxUInt64); + Plugin::UnboxUInt64 = *(System::UInt64 (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxUInt64); + Plugin::BoxChar = *(int32_t (**)(uint16_t val))curMemory; + curMemory += sizeof(Plugin::BoxChar); + Plugin::UnboxChar = *(int16_t (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxChar); + Plugin::BoxSingle = *(int32_t (**)(float val))curMemory; + curMemory += sizeof(Plugin::BoxSingle); + Plugin::UnboxSingle = *(System::Single (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxSingle); + Plugin::BoxDouble = *(int32_t (**)(double val))curMemory; + curMemory += sizeof(Plugin::BoxDouble); + Plugin::UnboxDouble = *(System::Double (**)(int32_t valHandle))curMemory; + curMemory += sizeof(Plugin::UnboxDouble); + /*END INIT BODY PARAMETER READS*/ + // Init managed object ref counting Plugin::RefCountsLenClass = maxManagedObjects; Plugin::RefCountsClass = (int32_t*)curMemory; curMemory += maxManagedObjects * sizeof(int32_t); - // Init pointers to C# functions - Plugin::StringNew = stringNew; - Plugin::ReleaseObject = releaseObject; - Plugin::SetException = setException; - Plugin::ArrayGetLength = arrayGetLength; - Plugin::EnumerableGetEnumerator = enumerableGetEnumerator; - /*BEGIN INIT BODY*/ - Plugin::ReleaseSystemDecimal = releaseSystemDecimal; + /*BEGIN INIT BODY ARRAYS*/ Plugin::RefCountsSystemDecimal = (int32_t*)curMemory; curMemory += 1000 * sizeof(int32_t); Plugin::RefCountsLenSystemDecimal = 1000; - Plugin::SystemDecimalConstructorSystemDouble = systemDecimalConstructorSystemDouble; - Plugin::SystemDecimalConstructorSystemUInt64 = systemDecimalConstructorSystemUInt64; - Plugin::BoxDecimal = boxDecimal; - Plugin::UnboxDecimal = unboxDecimal; - Plugin::UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle = unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle; - Plugin::UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3 = unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3; - Plugin::BoxVector3 = boxVector3; - Plugin::UnboxVector3 = unboxVector3; - Plugin::UnityEngineObjectPropertyGetName = unityEngineObjectPropertyGetName; - Plugin::UnityEngineObjectPropertySetName = unityEngineObjectPropertySetName; - Plugin::UnityEngineComponentPropertyGetTransform = unityEngineComponentPropertyGetTransform; - Plugin::UnityEngineTransformPropertyGetPosition = unityEngineTransformPropertyGetPosition; - Plugin::UnityEngineTransformPropertySetPosition = unityEngineTransformPropertySetPosition; - Plugin::SystemCollectionsIEnumeratorPropertyGetCurrent = systemCollectionsIEnumeratorPropertyGetCurrent; - Plugin::SystemCollectionsIEnumeratorMethodMoveNext = systemCollectionsIEnumeratorMethodMoveNext; - Plugin::UnityEngineGameObjectMethodAddComponentMyGameBaseBallScript = unityEngineGameObjectMethodAddComponentMyGameBaseBallScript; - Plugin::UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType = unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType; - Plugin::UnityEngineDebugMethodLogSystemObject = unityEngineDebugMethodLogSystemObject; - Plugin::UnityEngineMonoBehaviourPropertyGetTransform = unityEngineMonoBehaviourPropertyGetTransform; - Plugin::SystemExceptionConstructorSystemString = systemExceptionConstructorSystemString; - Plugin::BoxPrimitiveType = boxPrimitiveType; - Plugin::UnboxPrimitiveType = unboxPrimitiveType; - Plugin::UnityEngineTimePropertyGetDeltaTime = unityEngineTimePropertyGetDeltaTime; + Plugin::BaseBallScriptFreeListSize = 1000; Plugin::BaseBallScriptFreeList = (MyGame::BaseBallScript**)curMemory; curMemory += 1000 * sizeof(MyGame::BaseBallScript*); - Plugin::ReleaseBaseBallScript = releaseBaseBallScript; - Plugin::BaseBallScriptConstructor = baseBallScriptConstructor; Plugin::BaseBallScriptFreeWholeListSize = 1000; Plugin::BaseBallScriptFreeWholeList = (Plugin::BaseBallScriptFreeWholeListEntry*)curMemory; curMemory += 1000 * sizeof(Plugin::BaseBallScriptFreeWholeListEntry); - - Plugin::BoxBoolean = boxBoolean; - Plugin::UnboxBoolean = unboxBoolean; - Plugin::BoxSByte = boxSByte; - Plugin::UnboxSByte = unboxSByte; - Plugin::BoxByte = boxByte; - Plugin::UnboxByte = unboxByte; - Plugin::BoxInt16 = boxInt16; - Plugin::UnboxInt16 = unboxInt16; - Plugin::BoxUInt16 = boxUInt16; - Plugin::UnboxUInt16 = unboxUInt16; - Plugin::BoxInt32 = boxInt32; - Plugin::UnboxInt32 = unboxInt32; - Plugin::BoxUInt32 = boxUInt32; - Plugin::UnboxUInt32 = unboxUInt32; - Plugin::BoxInt64 = boxInt64; - Plugin::UnboxInt64 = unboxInt64; - Plugin::BoxUInt64 = boxUInt64; - Plugin::UnboxUInt64 = unboxUInt64; - Plugin::BoxChar = boxChar; - Plugin::UnboxChar = unboxChar; - Plugin::BoxSingle = boxSingle; - Plugin::UnboxSingle = unboxSingle; - Plugin::BoxDouble = boxDouble; - Plugin::UnboxDouble = unboxDouble; - /*END INIT BODY*/ + /*END INIT BODY ARRAYS*/ // Make sure there was enough memory int32_t usedMemory = (int32_t)(curMemory - (uint8_t*)memory); @@ -6100,6 +6104,7 @@ DLLEXPORT void Init( if (initMode == InitMode::FirstBoot) { + // Clear memory memset(memory, 0, memorySize); /*BEGIN INIT BODY FIRST BOOT*/ diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 248ee00..c2a00a6 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -330,81 +330,23 @@ enum InitMode : byte delegate void InitDelegate( IntPtr memory, int memorySize, - InitMode initMode, - IntPtr releaseObject, - IntPtr stringNew, - IntPtr setException, - IntPtr arrayGetLength, - IntPtr enumerableGetEnumerator, - /*BEGIN INIT PARAMS*/ - int maxManagedObjects, - IntPtr releaseSystemDecimal, - IntPtr systemDecimalConstructorSystemDouble, - IntPtr systemDecimalConstructorSystemUInt64, - IntPtr boxDecimal, - IntPtr unboxDecimal, - IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, - IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, - IntPtr boxVector3, - IntPtr unboxVector3, - IntPtr unityEngineObjectPropertyGetName, - IntPtr unityEngineObjectPropertySetName, - IntPtr unityEngineComponentPropertyGetTransform, - IntPtr unityEngineTransformPropertyGetPosition, - IntPtr unityEngineTransformPropertySetPosition, - IntPtr systemCollectionsIEnumeratorPropertyGetCurrent, - IntPtr systemCollectionsIEnumeratorMethodMoveNext, - IntPtr unityEngineGameObjectMethodAddComponentMyGameBaseBallScript, - IntPtr unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType, - IntPtr unityEngineDebugMethodLogSystemObject, - IntPtr unityEngineMonoBehaviourPropertyGetTransform, - IntPtr systemExceptionConstructorSystemString, - IntPtr boxPrimitiveType, - IntPtr unboxPrimitiveType, - IntPtr unityEngineTimePropertyGetDeltaTime, - IntPtr releaseBaseBallScript, - IntPtr baseBallScriptConstructor, - IntPtr boxBoolean, - IntPtr unboxBoolean, - IntPtr boxSByte, - IntPtr unboxSByte, - IntPtr boxByte, - IntPtr unboxByte, - IntPtr boxInt16, - IntPtr unboxInt16, - IntPtr boxUInt16, - IntPtr unboxUInt16, - IntPtr boxInt32, - IntPtr unboxInt32, - IntPtr boxUInt32, - IntPtr unboxUInt32, - IntPtr boxInt64, - IntPtr unboxInt64, - IntPtr boxUInt64, - IntPtr unboxUInt64, - IntPtr boxChar, - IntPtr unboxChar, - IntPtr boxSingle, - IntPtr unboxSingle, - IntPtr boxDouble, - IntPtr unboxDouble - /*END INIT PARAMS*/); + InitMode initMode); public delegate void SetCsharpExceptionDelegate(int handle); - /*BEGIN DELEGATES*/ - public delegate int NewBaseBallScriptDelegate(int param0); - public static NewBaseBallScriptDelegate NewBaseBallScript; + /*BEGIN CPP DELEGATES*/ + public delegate int NewBaseBallScriptDelegateType(int param0); + public static NewBaseBallScriptDelegateType NewBaseBallScript; - public delegate void DestroyBaseBallScriptDelegate(int param0); - public static DestroyBaseBallScriptDelegate DestroyBaseBallScript; + public delegate void DestroyBaseBallScriptDelegateType(int param0); + public static DestroyBaseBallScriptDelegateType DestroyBaseBallScript; - public delegate void MyGameAbstractBaseBallScriptUpdateDelegate(int thisHandle); - public static MyGameAbstractBaseBallScriptUpdateDelegate MyGameAbstractBaseBallScriptUpdate; + public delegate void MyGameAbstractBaseBallScriptUpdateDelegateType(int thisHandle); + public static MyGameAbstractBaseBallScriptUpdateDelegateType MyGameAbstractBaseBallScriptUpdate; - public delegate void SetCsharpExceptionSystemNullReferenceExceptionDelegate(int param0); - public static SetCsharpExceptionSystemNullReferenceExceptionDelegate SetCsharpExceptionSystemNullReferenceException; - /*END DELEGATES*/ + public delegate void SetCsharpExceptionSystemNullReferenceExceptionDelegateType(int param0); + public static SetCsharpExceptionSystemNullReferenceExceptionDelegateType SetCsharpExceptionSystemNullReferenceException; + /*END CPP DELEGATES*/ #endif #if UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX @@ -499,65 +441,7 @@ static T GetDelegate( static extern void Init( IntPtr memory, int memorySize, - InitMode initMode, - IntPtr releaseObject, - IntPtr stringNew, - IntPtr setException, - IntPtr arrayGetLength, - IntPtr enumerableGetEnumerator, - /*BEGIN INIT PARAMS*/ - int maxManagedObjects, - IntPtr releaseSystemDecimal, - IntPtr systemDecimalConstructorSystemDouble, - IntPtr systemDecimalConstructorSystemUInt64, - IntPtr boxDecimal, - IntPtr unboxDecimal, - IntPtr unityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle, - IntPtr unityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3, - IntPtr boxVector3, - IntPtr unboxVector3, - IntPtr unityEngineObjectPropertyGetName, - IntPtr unityEngineObjectPropertySetName, - IntPtr unityEngineComponentPropertyGetTransform, - IntPtr unityEngineTransformPropertyGetPosition, - IntPtr unityEngineTransformPropertySetPosition, - IntPtr systemCollectionsIEnumeratorPropertyGetCurrent, - IntPtr systemCollectionsIEnumeratorMethodMoveNext, - IntPtr unityEngineGameObjectMethodAddComponentMyGameBaseBallScript, - IntPtr unityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType, - IntPtr unityEngineDebugMethodLogSystemObject, - IntPtr unityEngineMonoBehaviourPropertyGetTransform, - IntPtr systemExceptionConstructorSystemString, - IntPtr boxPrimitiveType, - IntPtr unboxPrimitiveType, - IntPtr unityEngineTimePropertyGetDeltaTime, - IntPtr releaseBaseBallScript, - IntPtr baseBallScriptConstructor, - IntPtr boxBoolean, - IntPtr unboxBoolean, - IntPtr boxSByte, - IntPtr unboxSByte, - IntPtr boxByte, - IntPtr unboxByte, - IntPtr boxInt16, - IntPtr unboxInt16, - IntPtr boxUInt16, - IntPtr unboxUInt16, - IntPtr boxInt32, - IntPtr unboxInt32, - IntPtr boxUInt32, - IntPtr unboxUInt32, - IntPtr boxInt64, - IntPtr unboxInt64, - IntPtr boxUInt64, - IntPtr unboxUInt64, - IntPtr boxChar, - IntPtr unboxChar, - IntPtr boxSingle, - IntPtr unboxSingle, - IntPtr boxDouble, - IntPtr unboxDouble - /*END INIT PARAMS*/); + InitMode initMode); [DllImport(PLUGIN_NAME)] static extern void SetCsharpException(int handle); @@ -577,63 +461,63 @@ IntPtr unboxDouble /*END IMPORTS*/ #endif - delegate void ReleaseObjectDelegate(int handle); - delegate int StringNewDelegate(string chars); - delegate void SetExceptionDelegate(int handle); - delegate int ArrayGetLengthDelegate(int handle); - delegate int EnumerableGetEnumeratorDelegate(int handle); + delegate void ReleaseObjectDelegateType(int handle); + delegate int StringNewDelegateType(string chars); + delegate void SetExceptionDelegateType(int handle); + delegate int ArrayGetLengthDelegateType(int handle); + delegate int EnumerableGetEnumeratorDelegateType(int handle); /*BEGIN DELEGATE TYPES*/ - delegate void ReleaseSystemDecimalDelegate(int handle); - delegate int SystemDecimalConstructorSystemDoubleDelegate(double value); - delegate int SystemDecimalConstructorSystemUInt64Delegate(ulong value); - delegate int BoxDecimalDelegate(int valHandle); - delegate int UnboxDecimalDelegate(int valHandle); - delegate UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate(float x, float y, float z); - delegate UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate(ref UnityEngine.Vector3 a, ref UnityEngine.Vector3 b); - delegate int BoxVector3Delegate(ref UnityEngine.Vector3 val); - delegate UnityEngine.Vector3 UnboxVector3Delegate(int valHandle); - delegate int UnityEngineObjectPropertyGetNameDelegate(int thisHandle); - delegate void UnityEngineObjectPropertySetNameDelegate(int thisHandle, int valueHandle); - delegate int UnityEngineComponentPropertyGetTransformDelegate(int thisHandle); - delegate UnityEngine.Vector3 UnityEngineTransformPropertyGetPositionDelegate(int thisHandle); - delegate void UnityEngineTransformPropertySetPositionDelegate(int thisHandle, ref UnityEngine.Vector3 value); - delegate int SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(int thisHandle); - delegate bool SystemCollectionsIEnumeratorMethodMoveNextDelegate(int thisHandle); - delegate int UnityEngineGameObjectMethodAddComponentMyGameBaseBallScriptDelegate(int thisHandle); - delegate int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate(UnityEngine.PrimitiveType type); - delegate void UnityEngineDebugMethodLogSystemObjectDelegate(int messageHandle); - delegate int UnityEngineMonoBehaviourPropertyGetTransformDelegate(int thisHandle); - delegate int SystemExceptionConstructorSystemStringDelegate(int messageHandle); - delegate int BoxPrimitiveTypeDelegate(UnityEngine.PrimitiveType val); - delegate UnityEngine.PrimitiveType UnboxPrimitiveTypeDelegate(int valHandle); - delegate float UnityEngineTimePropertyGetDeltaTimeDelegate(); - delegate void BaseBallScriptConstructorDelegate(int cppHandle, ref int handle); - delegate void ReleaseBaseBallScriptDelegate(int handle); - delegate int BoxBooleanDelegate(bool val); - delegate bool UnboxBooleanDelegate(int valHandle); - delegate int BoxSByteDelegate(sbyte val); - delegate sbyte UnboxSByteDelegate(int valHandle); - delegate int BoxByteDelegate(byte val); - delegate byte UnboxByteDelegate(int valHandle); - delegate int BoxInt16Delegate(short val); - delegate short UnboxInt16Delegate(int valHandle); - delegate int BoxUInt16Delegate(ushort val); - delegate ushort UnboxUInt16Delegate(int valHandle); - delegate int BoxInt32Delegate(int val); - delegate int UnboxInt32Delegate(int valHandle); - delegate int BoxUInt32Delegate(uint val); - delegate uint UnboxUInt32Delegate(int valHandle); - delegate int BoxInt64Delegate(long val); - delegate long UnboxInt64Delegate(int valHandle); - delegate int BoxUInt64Delegate(ulong val); - delegate ulong UnboxUInt64Delegate(int valHandle); - delegate int BoxCharDelegate(char val); - delegate char UnboxCharDelegate(int valHandle); - delegate int BoxSingleDelegate(float val); - delegate float UnboxSingleDelegate(int valHandle); - delegate int BoxDoubleDelegate(double val); - delegate double UnboxDoubleDelegate(int valHandle); + delegate void ReleaseSystemDecimalDelegateType(int handle); + delegate int SystemDecimalConstructorSystemDoubleDelegateType(double value); + delegate int SystemDecimalConstructorSystemUInt64DelegateType(ulong value); + delegate int BoxDecimalDelegateType(int valHandle); + delegate int UnboxDecimalDelegateType(int valHandle); + delegate UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegateType(float x, float y, float z); + delegate UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3DelegateType(ref UnityEngine.Vector3 a, ref UnityEngine.Vector3 b); + delegate int BoxVector3DelegateType(ref UnityEngine.Vector3 val); + delegate UnityEngine.Vector3 UnboxVector3DelegateType(int valHandle); + delegate int UnityEngineObjectPropertyGetNameDelegateType(int thisHandle); + delegate void UnityEngineObjectPropertySetNameDelegateType(int thisHandle, int valueHandle); + delegate int UnityEngineComponentPropertyGetTransformDelegateType(int thisHandle); + delegate UnityEngine.Vector3 UnityEngineTransformPropertyGetPositionDelegateType(int thisHandle); + delegate void UnityEngineTransformPropertySetPositionDelegateType(int thisHandle, ref UnityEngine.Vector3 value); + delegate int SystemCollectionsIEnumeratorPropertyGetCurrentDelegateType(int thisHandle); + delegate bool SystemCollectionsIEnumeratorMethodMoveNextDelegateType(int thisHandle); + delegate int UnityEngineGameObjectMethodAddComponentMyGameBaseBallScriptDelegateType(int thisHandle); + delegate int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegateType(UnityEngine.PrimitiveType type); + delegate void UnityEngineDebugMethodLogSystemObjectDelegateType(int messageHandle); + delegate int UnityEngineMonoBehaviourPropertyGetTransformDelegateType(int thisHandle); + delegate int SystemExceptionConstructorSystemStringDelegateType(int messageHandle); + delegate int BoxPrimitiveTypeDelegateType(UnityEngine.PrimitiveType val); + delegate UnityEngine.PrimitiveType UnboxPrimitiveTypeDelegateType(int valHandle); + delegate float UnityEngineTimePropertyGetDeltaTimeDelegateType(); + delegate void BaseBallScriptConstructorDelegateType(int cppHandle, ref int handle); + delegate void ReleaseBaseBallScriptDelegateType(int handle); + delegate int BoxBooleanDelegateType(bool val); + delegate bool UnboxBooleanDelegateType(int valHandle); + delegate int BoxSByteDelegateType(sbyte val); + delegate sbyte UnboxSByteDelegateType(int valHandle); + delegate int BoxByteDelegateType(byte val); + delegate byte UnboxByteDelegateType(int valHandle); + delegate int BoxInt16DelegateType(short val); + delegate short UnboxInt16DelegateType(int valHandle); + delegate int BoxUInt16DelegateType(ushort val); + delegate ushort UnboxUInt16DelegateType(int valHandle); + delegate int BoxInt32DelegateType(int val); + delegate int UnboxInt32DelegateType(int valHandle); + delegate int BoxUInt32DelegateType(uint val); + delegate uint UnboxUInt32DelegateType(int valHandle); + delegate int BoxInt64DelegateType(long val); + delegate long UnboxInt64DelegateType(int valHandle); + delegate int BoxUInt64DelegateType(ulong val); + delegate ulong UnboxUInt64DelegateType(int valHandle); + delegate int BoxCharDelegateType(char val); + delegate char UnboxCharDelegateType(int valHandle); + delegate int BoxSingleDelegateType(float val); + delegate float UnboxSingleDelegateType(int valHandle); + delegate int BoxDoubleDelegateType(double val); + delegate double UnboxDoubleDelegateType(int valHandle); /*END DELEGATE TYPES*/ #if UNITY_EDITOR_WIN @@ -651,6 +535,67 @@ IntPtr unboxDouble static int destroyQueueCapacity; static object destroyQueueLockObj; + // Fixed delegates + static readonly ReleaseObjectDelegateType ReleaseObjectDelegate = new ReleaseObjectDelegateType(ReleaseObject); + static readonly StringNewDelegateType StringNewDelegate = new StringNewDelegateType(StringNew); + static readonly SetExceptionDelegateType SetExceptionDelegate = new SetExceptionDelegateType(SetException); + static readonly ArrayGetLengthDelegateType ArrayGetLengthDelegate = new ArrayGetLengthDelegateType(ArrayGetLength); + static readonly EnumerableGetEnumeratorDelegateType EnumerableGetEnumeratorDelegate = new EnumerableGetEnumeratorDelegateType(EnumerableGetEnumerator); + + // Generated delegates + /*BEGIN CSHARP DELEGATES*/ + static readonly ReleaseSystemDecimalDelegateType ReleaseSystemDecimalDelegate = new ReleaseSystemDecimalDelegateType(ReleaseSystemDecimal); + static readonly SystemDecimalConstructorSystemDoubleDelegateType SystemDecimalConstructorSystemDoubleDelegate = new SystemDecimalConstructorSystemDoubleDelegateType(SystemDecimalConstructorSystemDouble); + static readonly SystemDecimalConstructorSystemUInt64DelegateType SystemDecimalConstructorSystemUInt64Delegate = new SystemDecimalConstructorSystemUInt64DelegateType(SystemDecimalConstructorSystemUInt64); + static readonly BoxDecimalDelegateType BoxDecimalDelegate = new BoxDecimalDelegateType(BoxDecimal); + static readonly UnboxDecimalDelegateType UnboxDecimalDelegate = new UnboxDecimalDelegateType(UnboxDecimal); + static readonly UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegateType UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate = new UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegateType(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle); + static readonly UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3DelegateType UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate = new UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3DelegateType(UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3); + static readonly BoxVector3DelegateType BoxVector3Delegate = new BoxVector3DelegateType(BoxVector3); + static readonly UnboxVector3DelegateType UnboxVector3Delegate = new UnboxVector3DelegateType(UnboxVector3); + static readonly UnityEngineObjectPropertyGetNameDelegateType UnityEngineObjectPropertyGetNameDelegate = new UnityEngineObjectPropertyGetNameDelegateType(UnityEngineObjectPropertyGetName); + static readonly UnityEngineObjectPropertySetNameDelegateType UnityEngineObjectPropertySetNameDelegate = new UnityEngineObjectPropertySetNameDelegateType(UnityEngineObjectPropertySetName); + static readonly UnityEngineComponentPropertyGetTransformDelegateType UnityEngineComponentPropertyGetTransformDelegate = new UnityEngineComponentPropertyGetTransformDelegateType(UnityEngineComponentPropertyGetTransform); + static readonly UnityEngineTransformPropertyGetPositionDelegateType UnityEngineTransformPropertyGetPositionDelegate = new UnityEngineTransformPropertyGetPositionDelegateType(UnityEngineTransformPropertyGetPosition); + static readonly UnityEngineTransformPropertySetPositionDelegateType UnityEngineTransformPropertySetPositionDelegate = new UnityEngineTransformPropertySetPositionDelegateType(UnityEngineTransformPropertySetPosition); + static readonly SystemCollectionsIEnumeratorPropertyGetCurrentDelegateType SystemCollectionsIEnumeratorPropertyGetCurrentDelegate = new SystemCollectionsIEnumeratorPropertyGetCurrentDelegateType(SystemCollectionsIEnumeratorPropertyGetCurrent); + static readonly SystemCollectionsIEnumeratorMethodMoveNextDelegateType SystemCollectionsIEnumeratorMethodMoveNextDelegate = new SystemCollectionsIEnumeratorMethodMoveNextDelegateType(SystemCollectionsIEnumeratorMethodMoveNext); + static readonly UnityEngineGameObjectMethodAddComponentMyGameBaseBallScriptDelegateType UnityEngineGameObjectMethodAddComponentMyGameBaseBallScriptDelegate = new UnityEngineGameObjectMethodAddComponentMyGameBaseBallScriptDelegateType(UnityEngineGameObjectMethodAddComponentMyGameBaseBallScript); + static readonly UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegateType UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate = new UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegateType(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType); + static readonly UnityEngineDebugMethodLogSystemObjectDelegateType UnityEngineDebugMethodLogSystemObjectDelegate = new UnityEngineDebugMethodLogSystemObjectDelegateType(UnityEngineDebugMethodLogSystemObject); + static readonly UnityEngineMonoBehaviourPropertyGetTransformDelegateType UnityEngineMonoBehaviourPropertyGetTransformDelegate = new UnityEngineMonoBehaviourPropertyGetTransformDelegateType(UnityEngineMonoBehaviourPropertyGetTransform); + static readonly SystemExceptionConstructorSystemStringDelegateType SystemExceptionConstructorSystemStringDelegate = new SystemExceptionConstructorSystemStringDelegateType(SystemExceptionConstructorSystemString); + static readonly BoxPrimitiveTypeDelegateType BoxPrimitiveTypeDelegate = new BoxPrimitiveTypeDelegateType(BoxPrimitiveType); + static readonly UnboxPrimitiveTypeDelegateType UnboxPrimitiveTypeDelegate = new UnboxPrimitiveTypeDelegateType(UnboxPrimitiveType); + static readonly UnityEngineTimePropertyGetDeltaTimeDelegateType UnityEngineTimePropertyGetDeltaTimeDelegate = new UnityEngineTimePropertyGetDeltaTimeDelegateType(UnityEngineTimePropertyGetDeltaTime); + static readonly ReleaseBaseBallScriptDelegateType ReleaseBaseBallScriptDelegate = new ReleaseBaseBallScriptDelegateType(ReleaseBaseBallScript); + static readonly BaseBallScriptConstructorDelegateType BaseBallScriptConstructorDelegate = new BaseBallScriptConstructorDelegateType(BaseBallScriptConstructor); + static readonly BoxBooleanDelegateType BoxBooleanDelegate = new BoxBooleanDelegateType(BoxBoolean); + static readonly UnboxBooleanDelegateType UnboxBooleanDelegate = new UnboxBooleanDelegateType(UnboxBoolean); + static readonly BoxSByteDelegateType BoxSByteDelegate = new BoxSByteDelegateType(BoxSByte); + static readonly UnboxSByteDelegateType UnboxSByteDelegate = new UnboxSByteDelegateType(UnboxSByte); + static readonly BoxByteDelegateType BoxByteDelegate = new BoxByteDelegateType(BoxByte); + static readonly UnboxByteDelegateType UnboxByteDelegate = new UnboxByteDelegateType(UnboxByte); + static readonly BoxInt16DelegateType BoxInt16Delegate = new BoxInt16DelegateType(BoxInt16); + static readonly UnboxInt16DelegateType UnboxInt16Delegate = new UnboxInt16DelegateType(UnboxInt16); + static readonly BoxUInt16DelegateType BoxUInt16Delegate = new BoxUInt16DelegateType(BoxUInt16); + static readonly UnboxUInt16DelegateType UnboxUInt16Delegate = new UnboxUInt16DelegateType(UnboxUInt16); + static readonly BoxInt32DelegateType BoxInt32Delegate = new BoxInt32DelegateType(BoxInt32); + static readonly UnboxInt32DelegateType UnboxInt32Delegate = new UnboxInt32DelegateType(UnboxInt32); + static readonly BoxUInt32DelegateType BoxUInt32Delegate = new BoxUInt32DelegateType(BoxUInt32); + static readonly UnboxUInt32DelegateType UnboxUInt32Delegate = new UnboxUInt32DelegateType(UnboxUInt32); + static readonly BoxInt64DelegateType BoxInt64Delegate = new BoxInt64DelegateType(BoxInt64); + static readonly UnboxInt64DelegateType UnboxInt64Delegate = new UnboxInt64DelegateType(UnboxInt64); + static readonly BoxUInt64DelegateType BoxUInt64Delegate = new BoxUInt64DelegateType(BoxUInt64); + static readonly UnboxUInt64DelegateType UnboxUInt64Delegate = new UnboxUInt64DelegateType(UnboxUInt64); + static readonly BoxCharDelegateType BoxCharDelegate = new BoxCharDelegateType(BoxChar); + static readonly UnboxCharDelegateType UnboxCharDelegate = new UnboxCharDelegateType(UnboxChar); + static readonly BoxSingleDelegateType BoxSingleDelegate = new BoxSingleDelegateType(BoxSingle); + static readonly UnboxSingleDelegateType UnboxSingleDelegate = new UnboxSingleDelegateType(UnboxSingle); + static readonly BoxDoubleDelegateType BoxDoubleDelegate = new BoxDoubleDelegateType(BoxDouble); + static readonly UnboxDoubleDelegateType UnboxDoubleDelegate = new UnboxDoubleDelegateType(UnboxDouble); + /*END CSHARP DELEGATES*/ + /// /// Open the C++ plugin and call its PluginMain() /// @@ -748,76 +693,147 @@ private static void OpenPlugin(InitMode initMode) libraryHandle, "SetCsharpException"); /*BEGIN GETDELEGATE CALLS*/ - NewBaseBallScript = GetDelegate(libraryHandle, "NewBaseBallScript"); - DestroyBaseBallScript = GetDelegate(libraryHandle, "DestroyBaseBallScript"); - MyGameAbstractBaseBallScriptUpdate = GetDelegate(libraryHandle, "MyGameAbstractBaseBallScriptUpdate"); - SetCsharpExceptionSystemNullReferenceException = GetDelegate(libraryHandle, "SetCsharpExceptionSystemNullReferenceException"); + NewBaseBallScript = GetDelegate(libraryHandle, "NewBaseBallScript"); + DestroyBaseBallScript = GetDelegate(libraryHandle, "DestroyBaseBallScript"); + MyGameAbstractBaseBallScriptUpdate = GetDelegate(libraryHandle, "MyGameAbstractBaseBallScriptUpdate"); + SetCsharpExceptionSystemNullReferenceException = GetDelegate(libraryHandle, "SetCsharpExceptionSystemNullReferenceException"); /*END GETDELEGATE CALLS*/ #endif - // Init C++ library - Init( + // Pass parameters through 'memory' + int curMemory = 0; + Marshal.WriteIntPtr( + memory, + curMemory, + Marshal.GetFunctionPointerForDelegate(ReleaseObjectDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr( + memory, + curMemory, + Marshal.GetFunctionPointerForDelegate(StringNewDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr( + memory, + curMemory, + Marshal.GetFunctionPointerForDelegate(SetExceptionDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr( memory, - memorySize, - initMode, - Marshal.GetFunctionPointerForDelegate(new ReleaseObjectDelegate(ReleaseObject)), - Marshal.GetFunctionPointerForDelegate(new StringNewDelegate(StringNew)), - Marshal.GetFunctionPointerForDelegate(new SetExceptionDelegate(SetException)), - Marshal.GetFunctionPointerForDelegate(new ArrayGetLengthDelegate(ArrayGetLength)), - Marshal.GetFunctionPointerForDelegate(new EnumerableGetEnumeratorDelegate(EnumerableGetEnumerator)), - /*BEGIN INIT CALL*/ - 1000, - Marshal.GetFunctionPointerForDelegate(new ReleaseSystemDecimalDelegate(ReleaseSystemDecimal)), - Marshal.GetFunctionPointerForDelegate(new SystemDecimalConstructorSystemDoubleDelegate(SystemDecimalConstructorSystemDouble)), - Marshal.GetFunctionPointerForDelegate(new SystemDecimalConstructorSystemUInt64Delegate(SystemDecimalConstructorSystemUInt64)), - Marshal.GetFunctionPointerForDelegate(new BoxDecimalDelegate(BoxDecimal)), - Marshal.GetFunctionPointerForDelegate(new UnboxDecimalDelegate(UnboxDecimal)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate(UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3)), - Marshal.GetFunctionPointerForDelegate(new BoxVector3Delegate(BoxVector3)), - Marshal.GetFunctionPointerForDelegate(new UnboxVector3Delegate(UnboxVector3)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineObjectPropertyGetNameDelegate(UnityEngineObjectPropertyGetName)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineObjectPropertySetNameDelegate(UnityEngineObjectPropertySetName)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineComponentPropertyGetTransformDelegate(UnityEngineComponentPropertyGetTransform)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformPropertyGetPositionDelegate(UnityEngineTransformPropertyGetPosition)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineTransformPropertySetPositionDelegate(UnityEngineTransformPropertySetPosition)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIEnumeratorPropertyGetCurrentDelegate(SystemCollectionsIEnumeratorPropertyGetCurrent)), - Marshal.GetFunctionPointerForDelegate(new SystemCollectionsIEnumeratorMethodMoveNextDelegate(SystemCollectionsIEnumeratorMethodMoveNext)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodAddComponentMyGameBaseBallScriptDelegate(UnityEngineGameObjectMethodAddComponentMyGameBaseBallScript)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineDebugMethodLogSystemObjectDelegate(UnityEngineDebugMethodLogSystemObject)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineMonoBehaviourPropertyGetTransformDelegate(UnityEngineMonoBehaviourPropertyGetTransform)), - Marshal.GetFunctionPointerForDelegate(new SystemExceptionConstructorSystemStringDelegate(SystemExceptionConstructorSystemString)), - Marshal.GetFunctionPointerForDelegate(new BoxPrimitiveTypeDelegate(BoxPrimitiveType)), - Marshal.GetFunctionPointerForDelegate(new UnboxPrimitiveTypeDelegate(UnboxPrimitiveType)), - Marshal.GetFunctionPointerForDelegate(new UnityEngineTimePropertyGetDeltaTimeDelegate(UnityEngineTimePropertyGetDeltaTime)), - Marshal.GetFunctionPointerForDelegate(new ReleaseBaseBallScriptDelegate(ReleaseBaseBallScript)), - Marshal.GetFunctionPointerForDelegate(new BaseBallScriptConstructorDelegate(BaseBallScriptConstructor)), - Marshal.GetFunctionPointerForDelegate(new BoxBooleanDelegate(BoxBoolean)), - Marshal.GetFunctionPointerForDelegate(new UnboxBooleanDelegate(UnboxBoolean)), - Marshal.GetFunctionPointerForDelegate(new BoxSByteDelegate(BoxSByte)), - Marshal.GetFunctionPointerForDelegate(new UnboxSByteDelegate(UnboxSByte)), - Marshal.GetFunctionPointerForDelegate(new BoxByteDelegate(BoxByte)), - Marshal.GetFunctionPointerForDelegate(new UnboxByteDelegate(UnboxByte)), - Marshal.GetFunctionPointerForDelegate(new BoxInt16Delegate(BoxInt16)), - Marshal.GetFunctionPointerForDelegate(new UnboxInt16Delegate(UnboxInt16)), - Marshal.GetFunctionPointerForDelegate(new BoxUInt16Delegate(BoxUInt16)), - Marshal.GetFunctionPointerForDelegate(new UnboxUInt16Delegate(UnboxUInt16)), - Marshal.GetFunctionPointerForDelegate(new BoxInt32Delegate(BoxInt32)), - Marshal.GetFunctionPointerForDelegate(new UnboxInt32Delegate(UnboxInt32)), - Marshal.GetFunctionPointerForDelegate(new BoxUInt32Delegate(BoxUInt32)), - Marshal.GetFunctionPointerForDelegate(new UnboxUInt32Delegate(UnboxUInt32)), - Marshal.GetFunctionPointerForDelegate(new BoxInt64Delegate(BoxInt64)), - Marshal.GetFunctionPointerForDelegate(new UnboxInt64Delegate(UnboxInt64)), - Marshal.GetFunctionPointerForDelegate(new BoxUInt64Delegate(BoxUInt64)), - Marshal.GetFunctionPointerForDelegate(new UnboxUInt64Delegate(UnboxUInt64)), - Marshal.GetFunctionPointerForDelegate(new BoxCharDelegate(BoxChar)), - Marshal.GetFunctionPointerForDelegate(new UnboxCharDelegate(UnboxChar)), - Marshal.GetFunctionPointerForDelegate(new BoxSingleDelegate(BoxSingle)), - Marshal.GetFunctionPointerForDelegate(new UnboxSingleDelegate(UnboxSingle)), - Marshal.GetFunctionPointerForDelegate(new BoxDoubleDelegate(BoxDouble)), - Marshal.GetFunctionPointerForDelegate(new UnboxDoubleDelegate(UnboxDouble)) - /*END INIT CALL*/ - ); + curMemory, + Marshal.GetFunctionPointerForDelegate(ArrayGetLengthDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr( + memory, + curMemory, + Marshal.GetFunctionPointerForDelegate(EnumerableGetEnumeratorDelegate)); + curMemory += IntPtr.Size; + + /*BEGIN INIT CALL*/ + Marshal.WriteInt32(memory, curMemory, 1000); // max managed objects + curMemory += sizeof(int); + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(ReleaseSystemDecimalDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(SystemDecimalConstructorSystemDoubleDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(SystemDecimalConstructorSystemUInt64Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxDecimalDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxDecimalDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxVector3Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxVector3Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnityEngineObjectPropertyGetNameDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnityEngineObjectPropertySetNameDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnityEngineComponentPropertyGetTransformDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnityEngineTransformPropertyGetPositionDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnityEngineTransformPropertySetPositionDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(SystemCollectionsIEnumeratorPropertyGetCurrentDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(SystemCollectionsIEnumeratorMethodMoveNextDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnityEngineGameObjectMethodAddComponentMyGameBaseBallScriptDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnityEngineDebugMethodLogSystemObjectDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnityEngineMonoBehaviourPropertyGetTransformDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(SystemExceptionConstructorSystemStringDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxPrimitiveTypeDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxPrimitiveTypeDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnityEngineTimePropertyGetDeltaTimeDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(ReleaseBaseBallScriptDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BaseBallScriptConstructorDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxBooleanDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxBooleanDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxSByteDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxSByteDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxByteDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxByteDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxInt16Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxInt16Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxUInt16Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxUInt16Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxInt32Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxInt32Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxUInt32Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxUInt32Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxInt64Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxInt64Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxUInt64Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxUInt64Delegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxCharDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxCharDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxSingleDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxSingleDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(BoxDoubleDelegate)); + curMemory += IntPtr.Size; + Marshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate(UnboxDoubleDelegate)); + curMemory += IntPtr.Size; + /*END INIT CALL*/ + + // Init C++ library + Init(memory, memorySize, initMode); if (UnhandledCppException != null) { Exception ex = UnhandledCppException; @@ -908,7 +924,7 @@ static void DestroyAll() // C# functions for C++ to call //////////////////////////////////////////////////////////////// - [MonoPInvokeCallback(typeof(ReleaseObjectDelegate))] + [MonoPInvokeCallback(typeof(ReleaseObjectDelegateType))] static void ReleaseObject( int handle) { @@ -918,7 +934,7 @@ static void ReleaseObject( } } - [MonoPInvokeCallback(typeof(StringNewDelegate))] + [MonoPInvokeCallback(typeof(StringNewDelegateType))] static int StringNew( string chars) { @@ -926,26 +942,26 @@ static int StringNew( return handle; } - [MonoPInvokeCallback(typeof(SetExceptionDelegate))] + [MonoPInvokeCallback(typeof(SetExceptionDelegateType))] static void SetException(int handle) { UnhandledCppException = ObjectStore.Get(handle) as Exception; } - [MonoPInvokeCallback(typeof(ArrayGetLengthDelegate))] + [MonoPInvokeCallback(typeof(ArrayGetLengthDelegateType))] static int ArrayGetLength(int handle) { return ((Array)ObjectStore.Get(handle)).Length; } - [MonoPInvokeCallback(typeof(EnumerableGetEnumeratorDelegate))] + [MonoPInvokeCallback(typeof(EnumerableGetEnumeratorDelegateType))] static int EnumerableGetEnumerator(int handle) { return ObjectStore.Store(((IEnumerable)ObjectStore.Get(handle)).GetEnumerator()); } /*BEGIN FUNCTIONS*/ - [MonoPInvokeCallback(typeof(ReleaseSystemDecimalDelegate))] + [MonoPInvokeCallback(typeof(ReleaseSystemDecimalDelegateType))] static void ReleaseSystemDecimal(int handle) { try @@ -967,7 +983,7 @@ static void ReleaseSystemDecimal(int handle) } } - [MonoPInvokeCallback(typeof(SystemDecimalConstructorSystemDoubleDelegate))] + [MonoPInvokeCallback(typeof(SystemDecimalConstructorSystemDoubleDelegateType))] static int SystemDecimalConstructorSystemDouble(double value) { try @@ -989,7 +1005,7 @@ static int SystemDecimalConstructorSystemDouble(double value) } } - [MonoPInvokeCallback(typeof(SystemDecimalConstructorSystemUInt64Delegate))] + [MonoPInvokeCallback(typeof(SystemDecimalConstructorSystemUInt64DelegateType))] static int SystemDecimalConstructorSystemUInt64(ulong value) { try @@ -1011,7 +1027,7 @@ static int SystemDecimalConstructorSystemUInt64(ulong value) } } - [MonoPInvokeCallback(typeof(BoxDecimalDelegate))] + [MonoPInvokeCallback(typeof(BoxDecimalDelegateType))] static int BoxDecimal(int valHandle) { try @@ -1034,7 +1050,7 @@ static int BoxDecimal(int valHandle) } } - [MonoPInvokeCallback(typeof(UnboxDecimalDelegate))] + [MonoPInvokeCallback(typeof(UnboxDecimalDelegateType))] static int UnboxDecimal(int valHandle) { try @@ -1057,7 +1073,7 @@ static int UnboxDecimal(int valHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegate))] + [MonoPInvokeCallback(typeof(UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegateType))] static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingle(float x, float y, float z) { try @@ -1079,7 +1095,7 @@ static UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingl } } - [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3Delegate))] + [MonoPInvokeCallback(typeof(UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3DelegateType))] static UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3(ref UnityEngine.Vector3 a, ref UnityEngine.Vector3 b) { try @@ -1101,7 +1117,7 @@ static UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3 } } - [MonoPInvokeCallback(typeof(BoxVector3Delegate))] + [MonoPInvokeCallback(typeof(BoxVector3DelegateType))] static int BoxVector3(ref UnityEngine.Vector3 val) { try @@ -1123,7 +1139,7 @@ static int BoxVector3(ref UnityEngine.Vector3 val) } } - [MonoPInvokeCallback(typeof(UnboxVector3Delegate))] + [MonoPInvokeCallback(typeof(UnboxVector3DelegateType))] static UnityEngine.Vector3 UnboxVector3(int valHandle) { try @@ -1146,7 +1162,7 @@ static UnityEngine.Vector3 UnboxVector3(int valHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineObjectPropertyGetNameDelegate))] + [MonoPInvokeCallback(typeof(UnityEngineObjectPropertyGetNameDelegateType))] static int UnityEngineObjectPropertyGetName(int thisHandle) { try @@ -1169,7 +1185,7 @@ static int UnityEngineObjectPropertyGetName(int thisHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineObjectPropertySetNameDelegate))] + [MonoPInvokeCallback(typeof(UnityEngineObjectPropertySetNameDelegateType))] static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) { try @@ -1190,7 +1206,7 @@ static void UnityEngineObjectPropertySetName(int thisHandle, int valueHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineComponentPropertyGetTransformDelegate))] + [MonoPInvokeCallback(typeof(UnityEngineComponentPropertyGetTransformDelegateType))] static int UnityEngineComponentPropertyGetTransform(int thisHandle) { try @@ -1213,7 +1229,7 @@ static int UnityEngineComponentPropertyGetTransform(int thisHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineTransformPropertyGetPositionDelegate))] + [MonoPInvokeCallback(typeof(UnityEngineTransformPropertyGetPositionDelegateType))] static UnityEngine.Vector3 UnityEngineTransformPropertyGetPosition(int thisHandle) { try @@ -1236,7 +1252,7 @@ static UnityEngine.Vector3 UnityEngineTransformPropertyGetPosition(int thisHandl } } - [MonoPInvokeCallback(typeof(UnityEngineTransformPropertySetPositionDelegate))] + [MonoPInvokeCallback(typeof(UnityEngineTransformPropertySetPositionDelegateType))] static void UnityEngineTransformPropertySetPosition(int thisHandle, ref UnityEngine.Vector3 value) { try @@ -1256,7 +1272,7 @@ static void UnityEngineTransformPropertySetPosition(int thisHandle, ref UnityEng } } - [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorPropertyGetCurrentDelegate))] + [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorPropertyGetCurrentDelegateType))] static int SystemCollectionsIEnumeratorPropertyGetCurrent(int thisHandle) { try @@ -1279,7 +1295,7 @@ static int SystemCollectionsIEnumeratorPropertyGetCurrent(int thisHandle) } } - [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorMethodMoveNextDelegate))] + [MonoPInvokeCallback(typeof(SystemCollectionsIEnumeratorMethodMoveNextDelegateType))] static bool SystemCollectionsIEnumeratorMethodMoveNext(int thisHandle) { try @@ -1302,7 +1318,7 @@ static bool SystemCollectionsIEnumeratorMethodMoveNext(int thisHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameBaseBallScriptDelegate))] + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodAddComponentMyGameBaseBallScriptDelegateType))] static int UnityEngineGameObjectMethodAddComponentMyGameBaseBallScript(int thisHandle) { try @@ -1325,7 +1341,7 @@ static int UnityEngineGameObjectMethodAddComponentMyGameBaseBallScript(int thisH } } - [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegate))] + [MonoPInvokeCallback(typeof(UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegateType))] static int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(UnityEngine.PrimitiveType type) { try @@ -1347,7 +1363,7 @@ static int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveType(Un } } - [MonoPInvokeCallback(typeof(UnityEngineDebugMethodLogSystemObjectDelegate))] + [MonoPInvokeCallback(typeof(UnityEngineDebugMethodLogSystemObjectDelegateType))] static void UnityEngineDebugMethodLogSystemObject(int messageHandle) { try @@ -1367,7 +1383,7 @@ static void UnityEngineDebugMethodLogSystemObject(int messageHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineMonoBehaviourPropertyGetTransformDelegate))] + [MonoPInvokeCallback(typeof(UnityEngineMonoBehaviourPropertyGetTransformDelegateType))] static int UnityEngineMonoBehaviourPropertyGetTransform(int thisHandle) { try @@ -1390,7 +1406,7 @@ static int UnityEngineMonoBehaviourPropertyGetTransform(int thisHandle) } } - [MonoPInvokeCallback(typeof(SystemExceptionConstructorSystemStringDelegate))] + [MonoPInvokeCallback(typeof(SystemExceptionConstructorSystemStringDelegateType))] static int SystemExceptionConstructorSystemString(int messageHandle) { try @@ -1413,7 +1429,7 @@ static int SystemExceptionConstructorSystemString(int messageHandle) } } - [MonoPInvokeCallback(typeof(BoxPrimitiveTypeDelegate))] + [MonoPInvokeCallback(typeof(BoxPrimitiveTypeDelegateType))] static int BoxPrimitiveType(UnityEngine.PrimitiveType val) { try @@ -1435,7 +1451,7 @@ static int BoxPrimitiveType(UnityEngine.PrimitiveType val) } } - [MonoPInvokeCallback(typeof(UnboxPrimitiveTypeDelegate))] + [MonoPInvokeCallback(typeof(UnboxPrimitiveTypeDelegateType))] static UnityEngine.PrimitiveType UnboxPrimitiveType(int valHandle) { try @@ -1458,7 +1474,7 @@ static UnityEngine.PrimitiveType UnboxPrimitiveType(int valHandle) } } - [MonoPInvokeCallback(typeof(UnityEngineTimePropertyGetDeltaTimeDelegate))] + [MonoPInvokeCallback(typeof(UnityEngineTimePropertyGetDeltaTimeDelegateType))] static float UnityEngineTimePropertyGetDeltaTime() { try @@ -1480,7 +1496,7 @@ static float UnityEngineTimePropertyGetDeltaTime() } } - [MonoPInvokeCallback(typeof(BaseBallScriptConstructorDelegate))] + [MonoPInvokeCallback(typeof(BaseBallScriptConstructorDelegateType))] static void BaseBallScriptConstructor(int cppHandle, ref int handle) { try @@ -1502,7 +1518,7 @@ static void BaseBallScriptConstructor(int cppHandle, ref int handle) } } - [MonoPInvokeCallback(typeof(ReleaseBaseBallScriptDelegate))] + [MonoPInvokeCallback(typeof(ReleaseBaseBallScriptDelegateType))] static void ReleaseBaseBallScript(int handle) { try @@ -1526,7 +1542,7 @@ static void ReleaseBaseBallScript(int handle) } } - [MonoPInvokeCallback(typeof(BoxBooleanDelegate))] + [MonoPInvokeCallback(typeof(BoxBooleanDelegateType))] static int BoxBoolean(bool val) { try @@ -1548,7 +1564,7 @@ static int BoxBoolean(bool val) } } - [MonoPInvokeCallback(typeof(UnboxBooleanDelegate))] + [MonoPInvokeCallback(typeof(UnboxBooleanDelegateType))] static bool UnboxBoolean(int valHandle) { try @@ -1571,7 +1587,7 @@ static bool UnboxBoolean(int valHandle) } } - [MonoPInvokeCallback(typeof(BoxSByteDelegate))] + [MonoPInvokeCallback(typeof(BoxSByteDelegateType))] static int BoxSByte(sbyte val) { try @@ -1593,7 +1609,7 @@ static int BoxSByte(sbyte val) } } - [MonoPInvokeCallback(typeof(UnboxSByteDelegate))] + [MonoPInvokeCallback(typeof(UnboxSByteDelegateType))] static sbyte UnboxSByte(int valHandle) { try @@ -1616,7 +1632,7 @@ static sbyte UnboxSByte(int valHandle) } } - [MonoPInvokeCallback(typeof(BoxByteDelegate))] + [MonoPInvokeCallback(typeof(BoxByteDelegateType))] static int BoxByte(byte val) { try @@ -1638,7 +1654,7 @@ static int BoxByte(byte val) } } - [MonoPInvokeCallback(typeof(UnboxByteDelegate))] + [MonoPInvokeCallback(typeof(UnboxByteDelegateType))] static byte UnboxByte(int valHandle) { try @@ -1661,7 +1677,7 @@ static byte UnboxByte(int valHandle) } } - [MonoPInvokeCallback(typeof(BoxInt16Delegate))] + [MonoPInvokeCallback(typeof(BoxInt16DelegateType))] static int BoxInt16(short val) { try @@ -1683,7 +1699,7 @@ static int BoxInt16(short val) } } - [MonoPInvokeCallback(typeof(UnboxInt16Delegate))] + [MonoPInvokeCallback(typeof(UnboxInt16DelegateType))] static short UnboxInt16(int valHandle) { try @@ -1706,7 +1722,7 @@ static short UnboxInt16(int valHandle) } } - [MonoPInvokeCallback(typeof(BoxUInt16Delegate))] + [MonoPInvokeCallback(typeof(BoxUInt16DelegateType))] static int BoxUInt16(ushort val) { try @@ -1728,7 +1744,7 @@ static int BoxUInt16(ushort val) } } - [MonoPInvokeCallback(typeof(UnboxUInt16Delegate))] + [MonoPInvokeCallback(typeof(UnboxUInt16DelegateType))] static ushort UnboxUInt16(int valHandle) { try @@ -1751,7 +1767,7 @@ static ushort UnboxUInt16(int valHandle) } } - [MonoPInvokeCallback(typeof(BoxInt32Delegate))] + [MonoPInvokeCallback(typeof(BoxInt32DelegateType))] static int BoxInt32(int val) { try @@ -1773,7 +1789,7 @@ static int BoxInt32(int val) } } - [MonoPInvokeCallback(typeof(UnboxInt32Delegate))] + [MonoPInvokeCallback(typeof(UnboxInt32DelegateType))] static int UnboxInt32(int valHandle) { try @@ -1796,7 +1812,7 @@ static int UnboxInt32(int valHandle) } } - [MonoPInvokeCallback(typeof(BoxUInt32Delegate))] + [MonoPInvokeCallback(typeof(BoxUInt32DelegateType))] static int BoxUInt32(uint val) { try @@ -1818,7 +1834,7 @@ static int BoxUInt32(uint val) } } - [MonoPInvokeCallback(typeof(UnboxUInt32Delegate))] + [MonoPInvokeCallback(typeof(UnboxUInt32DelegateType))] static uint UnboxUInt32(int valHandle) { try @@ -1841,7 +1857,7 @@ static uint UnboxUInt32(int valHandle) } } - [MonoPInvokeCallback(typeof(BoxInt64Delegate))] + [MonoPInvokeCallback(typeof(BoxInt64DelegateType))] static int BoxInt64(long val) { try @@ -1863,7 +1879,7 @@ static int BoxInt64(long val) } } - [MonoPInvokeCallback(typeof(UnboxInt64Delegate))] + [MonoPInvokeCallback(typeof(UnboxInt64DelegateType))] static long UnboxInt64(int valHandle) { try @@ -1886,7 +1902,7 @@ static long UnboxInt64(int valHandle) } } - [MonoPInvokeCallback(typeof(BoxUInt64Delegate))] + [MonoPInvokeCallback(typeof(BoxUInt64DelegateType))] static int BoxUInt64(ulong val) { try @@ -1908,7 +1924,7 @@ static int BoxUInt64(ulong val) } } - [MonoPInvokeCallback(typeof(UnboxUInt64Delegate))] + [MonoPInvokeCallback(typeof(UnboxUInt64DelegateType))] static ulong UnboxUInt64(int valHandle) { try @@ -1931,7 +1947,7 @@ static ulong UnboxUInt64(int valHandle) } } - [MonoPInvokeCallback(typeof(BoxCharDelegate))] + [MonoPInvokeCallback(typeof(BoxCharDelegateType))] static int BoxChar(char val) { try @@ -1953,7 +1969,7 @@ static int BoxChar(char val) } } - [MonoPInvokeCallback(typeof(UnboxCharDelegate))] + [MonoPInvokeCallback(typeof(UnboxCharDelegateType))] static char UnboxChar(int valHandle) { try @@ -1976,7 +1992,7 @@ static char UnboxChar(int valHandle) } } - [MonoPInvokeCallback(typeof(BoxSingleDelegate))] + [MonoPInvokeCallback(typeof(BoxSingleDelegateType))] static int BoxSingle(float val) { try @@ -1998,7 +2014,7 @@ static int BoxSingle(float val) } } - [MonoPInvokeCallback(typeof(UnboxSingleDelegate))] + [MonoPInvokeCallback(typeof(UnboxSingleDelegateType))] static float UnboxSingle(int valHandle) { try @@ -2021,7 +2037,7 @@ static float UnboxSingle(int valHandle) } } - [MonoPInvokeCallback(typeof(BoxDoubleDelegate))] + [MonoPInvokeCallback(typeof(BoxDoubleDelegateType))] static int BoxDouble(double val) { try @@ -2043,7 +2059,7 @@ static int BoxDouble(double val) } } - [MonoPInvokeCallback(typeof(UnboxDoubleDelegate))] + [MonoPInvokeCallback(typeof(UnboxDoubleDelegateType))] static double UnboxDouble(int valHandle) { try diff --git a/Unity/Assets/NativeScript/BootScene.unity b/Unity/Assets/NativeScript/BootScene.unity index 4c9bb79..8a205bf 100644 --- a/Unity/Assets/NativeScript/BootScene.unity +++ b/Unity/Assets/NativeScript/BootScene.unity @@ -13,7 +13,7 @@ OcclusionCullingSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 8 + serializedVersion: 9 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -38,7 +38,8 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.37311992, g: 0.38074034, b: 0.35872716, a: 1} + m_IndirectSpecularColor: {r: 0.3731316, g: 0.38074902, b: 0.3587254, a: 1} + m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 @@ -54,11 +55,10 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 1 m_LightmapEditorSettings: - serializedVersion: 9 + serializedVersion: 10 m_Resolution: 2 m_BakeResolution: 40 - m_TextureWidth: 1024 - m_TextureHeight: 1024 + m_AtlasSize: 1024 m_AO: 0 m_AOMaxDistance: 1 m_CompAOExponent: 1 @@ -88,6 +88,7 @@ LightmapSettings: m_PVRFilteringAtrousPositionSigmaDirect: 0.5 m_PVRFilteringAtrousPositionSigmaIndirect: 2 m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 m_LightingDataAsset: {fileID: 0} m_UseShadowmask: 1 --- !u!196 &4 @@ -139,7 +140,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 6b5575a60b7c04c7a87ff4e161573c66, type: 3} m_Name: m_EditorClassIdentifier: - MemorySize: 16777216 + MemorySize: 1048576 AutoReload: 1 AutoReloadPollTime: 1 --- !u!4 &643357610 @@ -218,6 +219,7 @@ Camera: m_TargetEye: 3 m_HDR: 1 m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 m_ForceIntoRT: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 diff --git a/Unity/Assets/NativeScript/Editor/EditorMenus.cs b/Unity/Assets/NativeScript/Editor/EditorMenus.cs index 12866f1..a444732 100644 --- a/Unity/Assets/NativeScript/Editor/EditorMenus.cs +++ b/Unity/Assets/NativeScript/Editor/EditorMenus.cs @@ -1,7 +1,6 @@ -using UnityEngine; using UnityEditor; -namespace NativeScript +namespace NativeScript.Editor { /// /// Menus for the Unity Editor diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 8d84312..013fa39 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -8,7 +8,7 @@ using UnityEditor; using UnityEngine; -namespace NativeScript +namespace NativeScript.Editor { /// /// Code generator that reads a JSON file and outputs C# and C++ code @@ -137,8 +137,6 @@ class JsonDocument class StringBuilders { - public readonly StringBuilder CsharpInitParams = - new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CsharpDelegateTypes = new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CsharpStoreInitCalls = @@ -149,7 +147,9 @@ class StringBuilders new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CsharpFunctions = new StringBuilder(InitialStringBuilderCapacity); - public readonly StringBuilder CsharpDelegates = + public readonly StringBuilder CsharpCppDelegates = + new StringBuilder(InitialStringBuilderCapacity); + public readonly StringBuilder CsharpCsharpDelegates = new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CsharpImports = new StringBuilder(InitialStringBuilderCapacity); @@ -171,9 +171,9 @@ class StringBuilders new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppMethodDefinitions = new StringBuilder(InitialStringBuilderCapacity); - public readonly StringBuilder CppInitParams = + public readonly StringBuilder CppInitBodyParameterReads = new StringBuilder(InitialStringBuilderCapacity); - public readonly StringBuilder CppInitBody = + public readonly StringBuilder CppInitBodyArrays = new StringBuilder(InitialStringBuilderCapacity); public readonly StringBuilder CppInitBodyFirstBoot = new StringBuilder(InitialStringBuilderCapacity); @@ -240,11 +240,17 @@ int IComparer.Compare(object x, object y) { FieldInfo xField = (FieldInfo)x; FieldInfo yField = (FieldInfo)y; - return xField.MetadataToken < yField.MetadataToken - ? -1 - : xField.MetadataToken > yField.MetadataToken + return xField == null + ? yField == null + ? 0 + : -1 + : yField == null ? 1 - : 0; + : xField.MetadataToken < yField.MetadataToken + ? -1 + : xField.MetadataToken > yField.MetadataToken + ? 1 + : 0; } } @@ -255,10 +261,9 @@ struct TypeName public int NumTypeParams; } - const int DEFAULT_MAX_SIMULTANEOUS = 1000; - const int DEFAULT_MAX_SIMULTANEOUS_OBJECTS = 1000; - - static readonly Type[] PRIMITIVE_TYPES = { + const int BaseMaxSimultaneous = 1000; + + static readonly Type[] PrimitiveTypes = { typeof(bool), typeof(sbyte), typeof(byte), @@ -270,7 +275,7 @@ struct TypeName typeof(ulong), typeof(char), typeof(float), - typeof(double), + typeof(double) }; const string PostCompileWorkPref = "NativeScriptGenerateBindingsPostCompileWork"; @@ -282,10 +287,9 @@ struct TypeName new Uri(typeof(GameObject).Assembly.CodeBase).LocalPath ).DirectoryName; static readonly string AssetsDirPath = Application.dataPath; - static readonly string ProjectDirPath = - new DirectoryInfo(AssetsDirPath) - .Parent - .FullName; + private static readonly DirectoryInfo ProjectDir = + new DirectoryInfo(AssetsDirPath).Parent; + static readonly string ProjectDirPath = ProjectDir.FullName; static readonly string CppDirPath = Path.Combine( Path.Combine( @@ -308,7 +312,7 @@ struct TypeName static readonly FieldOrderComparer DefaultFieldOrderComparer = new FieldOrderComparer(); - + // Restore unused field types #pragma warning restore 649 @@ -343,7 +347,7 @@ public static void Generate() } } } - determinedNeedStubs:; + determinedNeedStubs: if (needStubs) { @@ -403,10 +407,6 @@ static void AppendStubs( } } } - - // Need at least one init param - builders.CsharpInitParams.Append("object stub"); - builders.CsharpInitCall.Append("null // stub"); } static void AppendStubBaseType( @@ -448,7 +448,7 @@ static void AppendStubBaseType( { output.Append('\n'); ConstructorInfo[] constructors = type.GetConstructors(); - if (constructors != null && constructors.Length > 0) + if (constructors.Length > 0) { foreach (ConstructorInfo ctor in constructors) { @@ -507,14 +507,14 @@ static void DoPostCompileWork(bool canRefreshAssetDb) // it's not specified for a specific type int defaultMaxSimultaneous = doc.DefaultMaxSimultaneous != 0 ? doc.DefaultMaxSimultaneous - : DEFAULT_MAX_SIMULTANEOUS; + : BaseMaxSimultaneous; // Init param for max managed Objects - builders.CppInitParams.Append("\tint32_t maxManagedObjects,\n"); - builders.CsharpInitParams.Append("\t\t\tint maxManagedObjects,\n"); - builders.CsharpInitCall.Append("\t\t\t\t"); + builders.CsharpInitCall.Append("\t\t\tMarshal.WriteInt32(memory, curMemory, "); builders.CsharpInitCall.Append(defaultMaxSimultaneous); - builders.CsharpInitCall.Append(",\n"); + builders.CsharpInitCall.Append("); // max managed objects\n"); + builders.CsharpInitCall.Append("\t\t\tcurMemory += sizeof(int);\n"); + builders.CsharpInitCall.Append(' '); // C# ObjectStore Init call builders.CsharpStoreInitCalls.Append( @@ -560,7 +560,7 @@ static void DoPostCompileWork(bool canRefreshAssetDb) } // Generate boxing and unboxing for primitive types - foreach (Type type in PRIMITIVE_TYPES) + foreach (Type type in PrimitiveTypes) { string dummyString; ParameterInfo[] dummyParams; @@ -685,38 +685,38 @@ static Assembly[] GetAssemblies(string[] assemblyNames) assemblies[8] = typeof(UnityEngine.AI.NavMesh).Assembly; // Unity AI module assemblies[9] = typeof(UnityEngine.Animations.AnimationClipPlayable).Assembly; // Unity animation module assemblies[10] = typeof(UnityEngine.XR.ARRenderMode).Assembly; // Unity AR module - assemblies[11] = typeof(UnityEngine.AudioSettings).Assembly; // Unity audio module - assemblies[12] = typeof(UnityEngine.Cloth).Assembly; // Unity cloth module - assemblies[13] = typeof(UnityEngine.ClusterInput).Assembly; // Unity cluster input module - assemblies[14] = typeof(UnityEngine.ClusterNetwork).Assembly; // Unity custer renderer module + assemblies[11] = typeof(AudioSettings).Assembly; // Unity audio module + assemblies[12] = typeof(Cloth).Assembly; // Unity cloth module + assemblies[13] = typeof(ClusterInput).Assembly; // Unity cluster input module + assemblies[14] = typeof(ClusterNetwork).Assembly; // Unity custer renderer module assemblies[15] = typeof(UnityEngine.CrashReportHandler.CrashReportHandler).Assembly; // Unity crash reporting module assemblies[16] = typeof(UnityEngine.Playables.PlayableDirector).Assembly; // Unity director module assemblies[17] = typeof(UnityEngine.SocialPlatforms.IAchievement).Assembly; // Unity game center module - assemblies[18] = typeof(UnityEngine.ImageConversion).Assembly; // Unity image conversion module - assemblies[19] = typeof(UnityEngine.GUI).Assembly; // Unity IMGUI module - assemblies[20] = typeof(UnityEngine.JsonUtility).Assembly; // Unity JSON serialize module - assemblies[21] = typeof(UnityEngine.ParticleSystem).Assembly; // Unity particle system module + assemblies[18] = typeof(ImageConversion).Assembly; // Unity image conversion module + assemblies[19] = typeof(GUI).Assembly; // Unity IMGUI module + assemblies[20] = typeof(JsonUtility).Assembly; // Unity JSON serialize module + assemblies[21] = typeof(ParticleSystem).Assembly; // Unity particle system module assemblies[22] = typeof(UnityEngine.Analytics.PerformanceReporting).Assembly; // Unity performance reporting module - assemblies[23] = typeof(UnityEngine.Physics2D).Assembly; // Unity physics 2D module - assemblies[24] = typeof(UnityEngine.Physics).Assembly; // Unity physics module - assemblies[25] = typeof(UnityEngine.ScreenCapture).Assembly; // Unity screen capture module - assemblies[26] = typeof(UnityEngine.Terrain).Assembly; // Unity terrain module - assemblies[27] = typeof(UnityEngine.TerrainCollider).Assembly; // Unity terrain physics module - assemblies[28] = typeof(UnityEngine.Font).Assembly; // Unity text rendering module + assemblies[23] = typeof(Physics2D).Assembly; // Unity physics 2D module + assemblies[24] = typeof(Physics).Assembly; // Unity physics module + assemblies[25] = typeof(ScreenCapture).Assembly; // Unity screen capture module + assemblies[26] = typeof(Terrain).Assembly; // Unity terrain module + assemblies[27] = typeof(TerrainCollider).Assembly; // Unity terrain physics module + assemblies[28] = typeof(Font).Assembly; // Unity text rendering module assemblies[29] = typeof(UnityEngine.Tilemaps.Tile).Assembly; // Unity tilemap module assemblies[30] = typeof(UnityEngine.Experimental.UIElements.Button).Assembly; // Unity UI elements module - assemblies[31] = typeof(UnityEngine.Canvas).Assembly; // Unity UI module + assemblies[31] = typeof(Canvas).Assembly; // Unity UI module assemblies[32] = typeof(UnityEngine.Networking.NetworkTransport).Assembly; // Unity cloth module assemblies[33] = typeof(UnityEngine.Analytics.Analytics).Assembly; // Unity analytics module - assemblies[34] = typeof(UnityEngine.RemoteSettings).Assembly; // Unity Unity connect module + assemblies[34] = typeof(RemoteSettings).Assembly; // Unity Unity connect module assemblies[35] = typeof(UnityEngine.Networking.DownloadHandlerAudioClip).Assembly; // Unity web request audio module - assemblies[36] = typeof(UnityEngine.WWWForm).Assembly; // Unity web request module + assemblies[36] = typeof(WWWForm).Assembly; // Unity web request module assemblies[37] = typeof(UnityEngine.Networking.DownloadHandlerTexture).Assembly; // Unity web request texture module - assemblies[38] = typeof(UnityEngine.WWW).Assembly; // Unity web request WWW module - assemblies[39] = typeof(UnityEngine.WheelCollider).Assembly; // Unity vehicles module + assemblies[38] = typeof(WWW).Assembly; // Unity web request WWW module + assemblies[39] = typeof(WheelCollider).Assembly; // Unity vehicles module assemblies[40] = typeof(UnityEngine.Video.VideoClip).Assembly; // Unity video module assemblies[41] = typeof(UnityEngine.XR.InputTracking).Assembly; // Unity VR module - assemblies[42] = typeof(UnityEngine.WindZone).Assembly; // Unity wind module + assemblies[42] = typeof(WindZone).Assembly; // Unity wind module #endif return assemblies; } @@ -920,7 +920,11 @@ static Type[] GetDirectInterfaces(Type type) minimalInterfaces.Add(iType); } } - minimalInterfaces.Sort((x, y) => x.Name.CompareTo(y.Name)); + minimalInterfaces.Sort( + (x, y) => string.Compare( + x.Name, + y.Name, + StringComparison.InvariantCulture)); return minimalInterfaces.ToArray(); } @@ -960,16 +964,11 @@ static void AppendCppConstructorInitializerList( string newline = "\n") { string separator = ": "; - for (int i = 0; i < interfaceTypes.Length; ++i) + foreach (Type interfaceType in interfaceTypes) { - Type interfaceType = interfaceTypes[i]; - AppendIndent( - indent, - output); + AppendIndent(indent, output); output.Append(separator); - AppendCppTypeFullName( - interfaceType, - output); + AppendCppTypeFullName( interfaceType, output); output.Append("(nullptr)"); output.Append(newline); separator = ", "; @@ -1429,7 +1428,7 @@ static void AppendTypeNameWithoutSuffixes( } } - static int AppendType( + static void AppendType( JsonType jsonType, Type type, TypeKind typeKind, @@ -1447,11 +1446,9 @@ static int AppendType( typeKind, null, builders); - return 0; } else { - int totalMaxSimultaneous = 0; Type[] genericArgTypes = type.GetGenericArguments(); if (jsonType.GenericParams != null) { @@ -1474,7 +1471,6 @@ static int AppendType( : jsonType.MaxSimultaneous != 0 ? jsonType.MaxSimultaneous : defaultMaxSimultaneous; - totalMaxSimultaneous += maxSimultaneous; AppendType( jsonType, genericArgTypes, @@ -1499,7 +1495,6 @@ static int AppendType( int maxSimultaneous = jsonType.MaxSimultaneous != 0 ? jsonType.MaxSimultaneous : defaultMaxSimultaneous; - totalMaxSimultaneous += maxSimultaneous; AppendType( jsonType, genericArgTypes, @@ -1518,7 +1513,6 @@ static int AppendType( builders); } } - return totalMaxSimultaneous; } } @@ -1562,11 +1556,6 @@ static void AppendType( builders.TempStrBuilder); string funcName = builders.TempStrBuilder.ToString(); - // Build lowercase function name - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string funcNameLower = builders.TempStrBuilder.ToString(); - // Build ReleaseX parameters ParameterInfo paramInfo = new ParameterInfo(); paramInfo.Name = "handle"; @@ -1621,44 +1610,35 @@ static void AppendType( typeof(void), builders.CppFunctionPointers); - // C++ init param for ReleaseX - AppendCppInitParam( - funcNameLower, + // C++ init body for ReleaseX + AppendCppInitBodyFunctionPointerParameterRead( + funcName, true, default(TypeName), TypeKind.None, parameters, typeof(void), - builders.CppInitParams); - - // C++ init body for ReleaseX - AppendCppInitBody( - funcName, - funcNameLower, - builders.CppInitBody); - - // C# init param for ReleaseX - AppendCsharpInitParam( - funcNameLower, - builders.CsharpInitParams); + builders.CppInitBodyParameterReads); // C# init call arg for ReleaseX - AppendCsharpInitCallArg( + AppendCsharpCsharpDelegate( funcName, - builders.CsharpInitCall); + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); // C++ init body for handle array length - builders.CppInitBody.Append("\tPlugin::RefCounts"); - builders.CppInitBody.Append(funcNameSuffix); - builders.CppInitBody.Append(" = (int32_t*)curMemory;\n"); - builders.CppInitBody.Append("\tcurMemory += "); - builders.CppInitBody.Append(maxSimultaneous); - builders.CppInitBody.Append(" * sizeof(int32_t);\n"); - builders.CppInitBody.Append("\tPlugin::RefCountsLen"); - builders.CppInitBody.Append(funcNameSuffix); - builders.CppInitBody.Append(" = "); - builders.CppInitBody.Append(maxSimultaneous); - builders.CppInitBody.Append(";\n"); + builders.CppInitBodyArrays.Append("\tPlugin::RefCounts"); + builders.CppInitBodyArrays.Append(funcNameSuffix); + builders.CppInitBodyArrays.Append(" = (int32_t*)curMemory;\n"); + builders.CppInitBodyArrays.Append("\tcurMemory += "); + builders.CppInitBodyArrays.Append(maxSimultaneous); + builders.CppInitBodyArrays.Append(" * sizeof(int32_t);\n"); + builders.CppInitBodyArrays.Append("\tPlugin::RefCountsLen"); + builders.CppInitBodyArrays.Append(funcNameSuffix); + builders.CppInitBodyArrays.Append(" = "); + builders.CppInitBodyArrays.Append(maxSimultaneous); + builders.CppInitBodyArrays.Append(";\n"); + builders.CppInitBodyArrays.Append("\t\n"); // C++ ref count state and functions builders.CppGlobalStateAndFunctions.Append("\tint32_t RefCountsLen"); @@ -2044,9 +2024,8 @@ static void AppendEnum( FieldInfo[] fields = type.GetFields( BindingFlags.Static | BindingFlags.Public); - for (int i = 0; i < fields.Length; ++i) + foreach (FieldInfo field in fields) { - FieldInfo field = fields[i]; AppendIndent( indent + 1, builders.CppTypeDefinitions); @@ -2235,9 +2214,8 @@ static void AppendEnum( builders.CppTypeDefinitions.Append('\n'); // Static initialization - for (int i = 0; i < fields.Length; ++i) + foreach (FieldInfo field in fields) { - FieldInfo field = fields[i]; builders.CppMethodDefinitions.Append("const "); AppendCppTypeFullName( type, @@ -2345,10 +2323,6 @@ static void AppendBoxingBindings( builders.TempStrBuilder); boxFuncName = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string boxFuncNameLower = builders.TempStrBuilder.ToString(); - ParameterInfo[] boxParams = { new ParameterInfo { @@ -2363,11 +2337,6 @@ static void AppendBoxingBindings( boxCppParams = new ParameterInfo[0]; - // C# init params - AppendCsharpInitParam( - boxFuncNameLower, - builders.CsharpInitParams); - // C# delegate types AppendCsharpDelegateType( boxFuncName, @@ -2379,9 +2348,10 @@ static void AppendBoxingBindings( builders.CsharpDelegateTypes); // C# init call args - AppendCsharpInitCallArg( + AppendCsharpCsharpDelegate( boxFuncName, - builders.CsharpInitCall); + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); // C# box function AppendCsharpFunctionBeginning( @@ -2412,21 +2382,15 @@ static void AppendBoxingBindings( typeof(object), builders.CppFunctionPointers); - // C++ init params - AppendCppInitParam( - boxFuncNameLower, + // C++ init body + AppendCppInitBodyFunctionPointerParameterRead( + boxFuncName, true, GetTypeName(type), typeKind, boxParams, typeof(object), - builders.CppInitParams); - - // C++ init body - AppendCppInitBody( - boxFuncName, - boxFuncNameLower, - builders.CppInitBody); + builders.CppInitBodyParameterReads); } static void AppendUnboxing( @@ -2445,10 +2409,6 @@ static void AppendUnboxing( builders.TempStrBuilder); string unboxFuncName = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string unboxFuncNameLower = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("operator "); AppendCppTypeFullName( @@ -2476,10 +2436,7 @@ static void AppendUnboxing( ParameterInfo[] unboxCppParams = new ParameterInfo[0]; // C# init params - AppendCsharpInitParam( - unboxFuncNameLower, - builders.CsharpInitParams); - + // C# delegate types AppendCsharpDelegateType( unboxFuncName, @@ -2491,9 +2448,10 @@ static void AppendUnboxing( builders.CsharpDelegateTypes); // C# init call args - AppendCsharpInitCallArg( + AppendCsharpCsharpDelegate( unboxFuncName, - builders.CsharpInitCall); + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); // C# unbox function AppendCsharpFunctionBeginning( @@ -2603,21 +2561,15 @@ static void AppendUnboxing( indent, builders.CppMethodDefinitions); - // C++ init params - AppendCppInitParam( - unboxFuncNameLower, + // C++ init body + AppendCppInitBodyFunctionPointerParameterRead( + unboxFuncName, true, GetTypeName(type), typeKind, unboxParams, type, - builders.CppInitParams); - - // C++ init body - AppendCppInitBody( - unboxFuncName, - unboxFuncNameLower, - builders.CppInitBody); + builders.CppInitBodyParameterReads); } static void AppendCppBoxingMethodNames( @@ -2830,11 +2782,6 @@ static void AppendConstructor( builders.TempStrBuilder); string funcName = builders.TempStrBuilder.ToString(); - // Build lowercase function name - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string funcNameLower = builders.TempStrBuilder.ToString(); - TypeName enclosingTypeTypeName = GetTypeName(enclosingType); // Build C++ constructor method name @@ -2845,9 +2792,6 @@ static void AppendConstructor( string cppMethodName = builders.TempStrBuilder.ToString(); // C# init param declaration - AppendCsharpInitParam( - funcNameLower, - builders.CsharpInitParams); // C# delegate type Type delegateReturnType; @@ -2869,7 +2813,10 @@ static void AppendConstructor( builders.CsharpDelegateTypes); // C# init call param - AppendCsharpInitCallArg(funcName, builders.CsharpInitCall); + AppendCsharpCsharpDelegate( + funcName, + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); // C# function if (enclosingTypeKind == TypeKind.FullStruct) @@ -3035,22 +2982,16 @@ static void AppendConstructor( indent, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append('\n'); - - // C++ init params - AppendCppInitParam( - funcNameLower, + + // C++ init body + AppendCppInitBodyFunctionPointerParameterRead( + funcName, true, GetTypeName(enclosingType), enclosingTypeKind, parameters, enclosingType, - builders.CppInitParams); - - // C++ init body - AppendCppInitBody( - funcName, - funcNameLower, - builders.CppInitBody); + builders.CppInitBodyParameterReads); } static void AppendProperty( @@ -3421,20 +3362,13 @@ static void AppendEventAddRemoveMethod( builders.TempStrBuilder.Append(uppercaseEventName); string funcName = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string funcNameLower = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append(operation); builders.TempStrBuilder.Append(uppercaseEventName); string methodName = builders.TempStrBuilder.ToString(); // C# init param - AppendCsharpInitParam( - funcNameLower, - builders.CsharpInitParams); - + // C# delegate type AppendCsharpDelegateType( funcName, @@ -3446,9 +3380,10 @@ static void AppendEventAddRemoveMethod( builders.CsharpDelegateTypes); // C# init call arg - AppendCsharpInitCallArg( + AppendCsharpCsharpDelegate( funcName, - builders.CsharpInitCall); + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); // C# function AppendCsharpFunctionBeginning( @@ -3530,21 +3465,15 @@ static void AppendEventAddRemoveMethod( builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("}\n\t\n"); - // C++ init params - AppendCppInitParam( - funcNameLower, + // C++ init body + AppendCppInitBodyFunctionPointerParameterRead( + funcName, methodIsStatic, GetTypeName(enclosingType), enclosingTypeKind, methodParams, typeof(void), - builders.CppInitParams); - - // C++ init body - AppendCppInitBody( - funcName, - funcNameLower, - builders.CppInitBody); + builders.CppInitBodyParameterReads); } static MethodInfo GetMethod( @@ -3847,16 +3776,8 @@ static void AppendMethod( builders.TempStrBuilder); string funcName = builders.TempStrBuilder.ToString(); - // Build lowercase function name - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string funcNameLower = builders.TempStrBuilder.ToString(); - // C# init param declaration - AppendCsharpInitParam( - funcNameLower, - builders.CsharpInitParams); - + // C# delegate type AppendCsharpDelegateType( funcName, @@ -3868,9 +3789,10 @@ static void AppendMethod( builders.CsharpDelegateTypes); // C# init call param - AppendCsharpInitCallArg( + AppendCsharpCsharpDelegate( funcName, - builders.CsharpInitCall); + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); // C# function AppendCsharpFunctionBeginning( @@ -4247,27 +4169,20 @@ static void AppendMethod( builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("}\n\t\n"); - // C++ init params - AppendCppInitParam( - funcNameLower, + // C++ init body + AppendCppInitBodyFunctionPointerParameterRead( + funcName, methodIsStatic, GetTypeName(enclosingType), enclosingTypeKind, parameters, returnType, - builders.CppInitParams); - - // C++ init body - AppendCppInitBody( - funcName, - funcNameLower, - builders.CppInitBody); + builders.CppInitBodyParameterReads); } static void AppendCSharpTypeParameters( Type[] typeParams, - StringBuilder output - ) + StringBuilder output) { if (typeParams != null && typeParams.Length > 0) { @@ -4514,9 +4429,7 @@ static void AppendArray( GetTypeName(cppArrayTypeName, "System"), false, cppTypeParams, - cppTypeParams != null ? - builders.CppTemplateSpecializationDeclarations : - builders.CppTypeDeclarations); + builders.CppTemplateSpecializationDeclarations); // C++ type definition (beginning) Type[] interfaceTypes = GetDirectInterfaces(arrayType); @@ -4535,6 +4448,7 @@ static void AppendArray( Type[] cppCtorInitTypes = GetCppCtorInitTypes( arrayType, false); + int localRank = rank; int cppMethodDefinitionsIndent = AppendCppMethodDefinitionsBegin( GetTypeName(cppArrayTypeName, "System"), TypeKind.Class, @@ -4548,9 +4462,9 @@ static void AppendArray( builders.CppMethodDefinitions.Append(subject); builders.CppMethodDefinitions.Append( "InternalLength = 0;\n"); - if (rank > 1) + if (localRank > 1) { - for (int i = 0; i < rank; ++i) + for (int i = 0; i < localRank; ++i) { AppendIndent( extraIndent, @@ -4573,9 +4487,9 @@ static void AppendArray( builders.CppMethodDefinitions.Append(subject); builders.CppMethodDefinitions.Append( "InternalLength;\n"); - if (rank > 1) + if (localRank > 1) { - for (int i = 0; i < rank; ++i) + for (int i = 0; i < localRank; ++i) { AppendIndent( extraIndent, @@ -5538,10 +5452,6 @@ static void AppendArrayConstructor( builders.TempStrBuilder.Append(rank); string funcName = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string funcNameLower = builders.TempStrBuilder.ToString(); - ParameterInfo[] parameters = new ParameterInfo[rank]; for (int i = 0; i < rank; ++i) { @@ -5570,15 +5480,13 @@ static void AppendArrayConstructor( builders.CsharpDelegateTypes); // C# Init Call - AppendCsharpInitCallArg( + AppendCsharpCsharpDelegate( funcName, - builders.CsharpInitCall); + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); // C# Init Param - AppendCsharpInitParam( - funcNameLower, - builders.CsharpInitParams); - + // C# function AppendCsharpFunctionBeginning( arrayType, @@ -5624,21 +5532,15 @@ static void AppendArrayConstructor( arrayType, builders.CppFunctionPointers); - // C++ init param - AppendCppInitParam( - funcNameLower, + // C++ init body + AppendCppInitBodyFunctionPointerParameterRead( + funcName, true, cppArrayTypeTypeName, TypeKind.Class, parameters, arrayType, - builders.CppInitParams); - - // C++ init body - AppendCppInitBody( - funcName, - funcNameLower, - builders.CppInitBody); + builders.CppInitBodyParameterReads); // C++ method declaration AppendIndent( @@ -5919,10 +5821,6 @@ static void AppendArrayMultidimensionalGetLength( builders.TempStrBuilder.Append(rank); string funcName = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string funcNameLower = builders.TempStrBuilder.ToString(); - ParameterInfo[] parameters = { new ParameterInfo { Name = "dimension", @@ -5949,15 +5847,13 @@ static void AppendArrayMultidimensionalGetLength( builders.CsharpDelegateTypes); // C# Init Call - AppendCsharpInitCallArg( + AppendCsharpCsharpDelegate( funcName, - builders.CsharpInitCall); + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); // C# Init Param - AppendCsharpInitParam( - funcNameLower, - builders.CsharpInitParams); - + // C# function AppendCsharpFunctionBeginning( arrayType, @@ -5987,21 +5883,15 @@ static void AppendArrayMultidimensionalGetLength( arrayType, builders.CppFunctionPointers); - // C++ init param - AppendCppInitParam( - funcNameLower, + // C++ init body + AppendCppInitBodyFunctionPointerParameterRead( + funcName, false, cppArrayTypeTypeName, TypeKind.Class, parameters, arrayType, - builders.CppInitParams); - - // C++ init body - AppendCppInitBody( - funcName, - funcNameLower, - builders.CppInitBody); + builders.CppInitBodyParameterReads); // C++ method declaration AppendIndent( @@ -6106,10 +5996,6 @@ static void AppendArrayGetItem( builders.TempStrBuilder); string funcName = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string funcNameLower = builders.TempStrBuilder.ToString(); - ParameterInfo[] parameters = BuildArrayGetItemsParams( rank, "index"); @@ -6125,15 +6011,13 @@ static void AppendArrayGetItem( builders.CsharpDelegateTypes); // C# Init Call - AppendCsharpInitCallArg( + AppendCsharpCsharpDelegate( funcName, - builders.CsharpInitCall); + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); // C# Init Param - AppendCsharpInitParam( - funcNameLower, - builders.CsharpInitParams); - + // C# function AppendCsharpFunctionBeginning( arrayType, @@ -6176,21 +6060,15 @@ static void AppendArrayGetItem( elementType, builders.CppFunctionPointers); - // C++ init param - AppendCppInitParam( - funcNameLower, + // C++ init body + AppendCppInitBodyFunctionPointerParameterRead( + funcName, false, cppArrayTypeTypeName, TypeKind.Class, parameters, elementType, - builders.CppInitParams); - - // C++ init body - AppendCppInitBody( - funcName, - funcNameLower, - builders.CppInitBody); + builders.CppInitBodyParameterReads); } static void AppendArraySetItem( @@ -6208,10 +6086,6 @@ static void AppendArraySetItem( builders.TempStrBuilder); string funcName = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string funcNameLower = builders.TempStrBuilder.ToString(); - // Build parameters as indexes then element ParameterInfo[] parameters = BuildArraySetItemsParams( rank, @@ -6229,15 +6103,13 @@ static void AppendArraySetItem( builders.CsharpDelegateTypes); // C# Init Call - AppendCsharpInitCallArg( + AppendCsharpCsharpDelegate( funcName, - builders.CsharpInitCall); + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); // C# Init Param - AppendCsharpInitParam( - funcNameLower, - builders.CsharpInitParams); - + // C# function AppendCsharpFunctionBeginning( arrayType, @@ -6280,21 +6152,15 @@ static void AppendArraySetItem( arrayType, builders.CppFunctionPointers); - // C++ init param - AppendCppInitParam( - funcNameLower, + // C++ init body + AppendCppInitBodyFunctionPointerParameterRead( + funcName, false, cppArrayTypeTypeName, TypeKind.Class, parameters, arrayType, - builders.CppInitParams); - - // C++ init body - AppendCppInitBody( - funcName, - funcNameLower, - builders.CppInitBody); + builders.CppInitBodyParameterReads); } static void AppendDelegate( @@ -6308,15 +6174,14 @@ static void AppendDelegate( assemblies); if (jsonDelegate.GenericParams != null) { - foreach (JsonGenericParams jsonGenericParams - in jsonDelegate.GenericParams) + for (int i = 0; i < jsonDelegate.GenericParams.Length; ++i) { // C++ template declaration AppendCppTemplateDeclaration( GetTypeName(type), builders.CppTemplateDeclarations); } - + foreach (JsonGenericParams jsonGenericParams in jsonDelegate.GenericParams) { @@ -6389,37 +6254,21 @@ static void AppendDelegate( builders.TempStrBuilder.Append(bindingTypeName); string releaseFuncName = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string releaseFuncNameLower = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append(bindingTypeName); builders.TempStrBuilder.Append("Constructor"); string constructorFuncName = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string constructorFuncNameLower = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append(bindingTypeName); builders.TempStrBuilder.Append("Add"); string addFuncName = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string addFuncNameLower = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append(bindingTypeName); builders.TempStrBuilder.Append("Remove"); string removeFuncName = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string removeFuncNameLower = builders.TempStrBuilder.ToString(); - TypeName typeTypeName = GetTypeName(type); // C++ type declaration @@ -6503,7 +6352,7 @@ static void AppendDelegate( GetTypeName(cppTypeName, type.Namespace), maxSimultaneous, bindingTypeName, - builders.CppInitBody, + builders.CppInitBodyArrays, builders.CppInitBodyFirstBoot); // C++ type definition (begin) @@ -6600,81 +6449,55 @@ static void AppendDelegate( typeof(void), builders.CppFunctionPointers); - // C++ init params - AppendCppInitParam( - releaseFuncNameLower, + // C++ and C# init params + AppendCppInitBodyFunctionPointerParameterRead( + releaseFuncName, true, default(TypeName), TypeKind.None, releaseParams, typeof(void), - builders.CppInitParams); - AppendCppInitParam( - constructorFuncNameLower, + builders.CppInitBodyParameterReads); + AppendCppInitBodyFunctionPointerParameterRead( + constructorFuncName, true, default(TypeName), TypeKind.None, constructorParams, typeof(void), - builders.CppInitParams); - AppendCppInitParam( - addFuncNameLower, + builders.CppInitBodyParameterReads); + AppendCppInitBodyFunctionPointerParameterRead( + addFuncName, false, default(TypeName), TypeKind.None, addRemoveParams, typeof(void), - builders.CppInitParams); - AppendCppInitParam( - removeFuncNameLower, + builders.CppInitBodyParameterReads); + AppendCppInitBodyFunctionPointerParameterRead( + removeFuncName, false, default(TypeName), TypeKind.None, addRemoveParams, typeof(void), - builders.CppInitParams); - - // C++ and C# init params - AppendCppInitBody( - releaseFuncName, - releaseFuncNameLower, - builders.CppInitBody); - AppendCppInitBody( - constructorFuncName, - constructorFuncNameLower, - builders.CppInitBody); - AppendCppInitBody( - addFuncName, - addFuncNameLower, - builders.CppInitBody); - AppendCppInitBody( - removeFuncName, - removeFuncNameLower, - builders.CppInitBody); - AppendCsharpInitParam( - releaseFuncNameLower, - builders.CsharpInitParams); - AppendCsharpInitParam( - constructorFuncNameLower, - builders.CsharpInitParams); - AppendCsharpInitParam( - addFuncNameLower, - builders.CsharpInitParams); - AppendCsharpInitParam( - removeFuncNameLower, - builders.CsharpInitParams); - AppendCsharpInitCallArg( + builders.CppInitBodyParameterReads); + AppendCsharpCsharpDelegate( releaseFuncName, - builders.CsharpInitCall); - AppendCsharpInitCallArg( + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); + AppendCsharpCsharpDelegate( constructorFuncName, - builders.CsharpInitCall); - AppendCsharpInitCallArg( + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); + AppendCsharpCsharpDelegate( addFuncName, - builders.CsharpInitCall); - AppendCsharpInitCallArg( + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); + AppendCsharpCsharpDelegate( removeFuncName, - builders.CsharpInitCall); + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); // C++ method definitions (end) int cppMethodDefinitionsIndent = AppendNamespaceBeginning( @@ -7039,10 +6862,6 @@ static void AppendBaseType( builders.TempStrBuilder.Append(baseTypeTypeName.Name); string releaseFuncName = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string releaseFuncNameLower = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder.Length = 0; AppendCppTypeName( baseTypeTypeName, @@ -7073,7 +6892,7 @@ static void AppendBaseType( throw new Exception(errorBuilder.ToString()); } - jsonConstructors = new JsonConstructor[] + jsonConstructors = new[] { new JsonConstructor { @@ -7155,7 +6974,7 @@ static void AppendBaseType( { cppBaseClass = typeof(object); cppBaseClassTypeParams = null; - cppInterfaceTypes = new Type[] { type }; + cppInterfaceTypes = new [] { type }; } else { @@ -7175,7 +6994,7 @@ static void AppendBaseType( baseTypeTypeName, maxSimultaneous, baseTypeTypeName.Name, - builders.CppInitBody, + builders.CppInitBodyArrays, builders.CppInitBodyFirstBoot); // C++ type declaration @@ -7324,52 +7143,34 @@ static void AppendBaseType( builders.CppFunctionPointers); } - // C++ init params - AppendCppInitParam( - releaseFuncNameLower, + // C++ and C# init params + AppendCppInitBodyFunctionPointerParameterRead( + releaseFuncName, true, default(TypeName), TypeKind.None, releaseParams, typeof(void), - builders.CppInitParams); + builders.CppInitBodyParameterReads); + AppendCsharpCsharpDelegate( + releaseFuncName, + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); for (int i = 0; i < numConstructors; ++i) { - AppendCppInitParam( - constructorFuncNameLowers[i], + string funcName = constructorFuncNames[i]; + AppendCppInitBodyFunctionPointerParameterRead( + funcName, true, default(TypeName), TypeKind.None, constructorParams[i], typeof(void), - builders.CppInitParams); - } - - // C++ and C# init params - AppendCppInitBody( - releaseFuncName, - releaseFuncNameLower, - builders.CppInitBody); - AppendCsharpInitParam( - releaseFuncNameLower, - builders.CsharpInitParams); - AppendCsharpInitCallArg( - releaseFuncName, - builders.CsharpInitCall); - for (int i = 0; i < numConstructors; ++i) - { - string funcName = constructorFuncNames[i]; - string funcNameLower = constructorFuncNameLowers[i]; - AppendCppInitBody( - funcName, - funcNameLower, - builders.CppInitBody); - AppendCsharpInitParam( - funcNameLower, - builders.CsharpInitParams); - AppendCsharpInitCallArg( + builders.CppInitBodyParameterReads); + AppendCsharpCsharpDelegate( funcName, - builders.CsharpInitCall); + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); } // C++ method definitions (end) @@ -7489,7 +7290,7 @@ static void AppendBaseType( AppendCppWholeObjectFreeListInit( maxSimultaneous, baseTypeTypeName.Name, - builders.CppInitBody, + builders.CppInitBodyArrays, builders.CppInitBodyFirstBoot); // C++ binding function to create the base class @@ -7538,7 +7339,7 @@ static void AppendBaseType( // C# usage of the C++ binding function to create from C# default constructor ParameterInfo[] cppDefaultConstructorBindingFunctionParams = ConvertParameters( - new Type[] { typeof(int) }); + new[] { typeof(int) }); AppendCsharpDelegate( true, GetTypeName(string.Empty, string.Empty), @@ -7547,7 +7348,7 @@ static void AppendBaseType( cppDefaultConstructorBindingFunctionParams, typeof(int), TypeKind.None, - builders.CsharpDelegates); + builders.CsharpCppDelegates); AppendCsharpImport( GetTypeName(string.Empty, string.Empty), null, @@ -7600,7 +7401,7 @@ static void AppendBaseType( // C# usage of the C++ binding function to destroy from C# default constructor ParameterInfo[] cppDestroyBindingFunctionParams = ConvertParameters( - new Type[] { typeof(int) }); + new [] { typeof(int) }); AppendCsharpDelegate( true, GetTypeName(string.Empty, string.Empty), @@ -7609,7 +7410,7 @@ static void AppendBaseType( cppDestroyBindingFunctionParams, typeof(void), TypeKind.None, - builders.CsharpDelegates); + builders.CsharpCppDelegates); ParameterInfo[] cppDestroyImportFunctionParams = ConvertParameters( new Type[0]); AppendCsharpImport( @@ -8383,10 +8184,6 @@ static void AppendBaseTypeMethodCallsCsharpMethod( builders.TempStrBuilder.Append(methodName); string funcName = builders.TempStrBuilder.ToString(); - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string funcNameLower = builders.TempStrBuilder.ToString(); - // C++ method declaration for the method ParameterInfo[] invokeParams = ConvertParameters( methodInfo.GetParameters()); @@ -8414,24 +8211,18 @@ static void AppendBaseTypeMethodCallsCsharpMethod( builders.CppFunctionPointers); // C++ and C# Init parameter and body for the C# binding function - AppendCppInitParam( - funcNameLower, + AppendCppInitBodyFunctionPointerParameterRead( + funcName, false, default(TypeName), TypeKind.None, invokeParams, methodInfo.ReturnType, - builders.CppInitParams); - AppendCppInitBody( + builders.CppInitBodyParameterReads); + AppendCsharpCsharpDelegate( funcName, - funcNameLower, - builders.CppInitBody); - AppendCsharpInitParam( - funcNameLower, - builders.CsharpInitParams); - AppendCsharpInitCallArg( - funcName, - builders.CsharpInitCall); + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); // C++ method definition for the method TypeKind returnTypeKind = GetTypeKind( @@ -8683,7 +8474,7 @@ static ParameterInfo[] AppendBaseTypeCppNativeInvokeCall( invokeParams, invokeMethod.ReturnType, invokeReturnTypeKind, - builders.CsharpDelegates); + builders.CsharpCppDelegates); // C# import for the C++ binding function AppendCsharpImport( @@ -9040,9 +8831,8 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( indent + 1, output); output.Append("{\n"); - for (int i = 0; i < methodParams.Length; ++i) + foreach (ParameterInfo parameter in methodParams) { - ParameterInfo parameter = methodParams[i]; if (parameter.Kind == TypeKind.Class || parameter.Kind == TypeKind.ManagedStruct) { @@ -10546,7 +10336,7 @@ static void AppendCsharpDelegate( typeParams, funcName, output); - output.Append("Delegate("); + output.Append("DelegateType("); if (!isStatic) { output.Append("int thisHandle"); @@ -10586,7 +10376,7 @@ static void AppendCsharpDelegate( typeParams, funcName, output); - output.Append("Delegate "); + output.Append("DelegateType "); AppendCsharpDelegateName( typeTypeName, typeParams, @@ -10632,7 +10422,7 @@ static void AppendCsharpGetDelegateCall( typeParams, funcName, output); - output.Append("Delegate>(libraryHandle, \""); + output.Append("DelegateType>(libraryHandle, \""); AppendCsharpDelegateName( typeTypeName, typeParams, @@ -10880,7 +10670,7 @@ static void AppendExceptions( parameters, typeof(void), TypeKind.None, - builders.CsharpDelegates + builders.CsharpCppDelegates ); // C# GetDelegate call @@ -10947,11 +10737,6 @@ static void AppendGetter( builders.TempStrBuilder); string funcName = builders.TempStrBuilder.ToString(); - // Build lowercase function name - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string funcNameLower = builders.TempStrBuilder.ToString(); - // Build method name builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("Get"); @@ -10959,9 +10744,6 @@ static void AppendGetter( string methodName = builders.TempStrBuilder.ToString(); // C# init param declaration - AppendCsharpInitParam( - funcNameLower, - builders.CsharpInitParams); // C# delegate type AppendCsharpDelegateType( @@ -10974,9 +10756,10 @@ static void AppendGetter( builders.CsharpDelegateTypes); // C# init call param - AppendCsharpInitCallArg( + AppendCsharpCsharpDelegate( funcName, - builders.CsharpInitCall); + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); // C# function AppendCsharpFunctionBeginning( @@ -11081,22 +10864,16 @@ static void AppendGetter( builders.CppMethodDefinitions.Append("}\n"); AppendIndent(indent, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append('\n'); - - // C++ init params - AppendCppInitParam( - funcNameLower, + + // C++ init body + AppendCppInitBodyFunctionPointerParameterRead( + funcName, methodIsStatic, GetTypeName(enclosingType), enclosingTypeKind, parameters, fieldType, - builders.CppInitParams); - - // C++ init body - AppendCppInitBody( - funcName, - funcNameLower, - builders.CppInitBody); + builders.CppInitBodyParameterReads); } static void AppendSetter( @@ -11135,11 +10912,6 @@ static void AppendSetter( builders.TempStrBuilder); string funcName = builders.TempStrBuilder.ToString(); - // Build lowercase function name - builders.TempStrBuilder[0] = char.ToLower( - builders.TempStrBuilder[0]); - string funcNameLower = builders.TempStrBuilder.ToString(); - // Build method name builders.TempStrBuilder.Length = 0; builders.TempStrBuilder.Append("Set"); @@ -11147,10 +10919,7 @@ static void AppendSetter( string methodName = builders.TempStrBuilder.ToString(); // C# init param declaration - AppendCsharpInitParam( - funcNameLower, - builders.CsharpInitParams); - + // C# delegate type AppendCsharpDelegateType( funcName, @@ -11162,9 +10931,10 @@ static void AppendSetter( builders.CsharpDelegateTypes); // C# init call param - AppendCsharpInitCallArg( + AppendCsharpCsharpDelegate( funcName, - builders.CsharpInitCall); + builders.CsharpInitCall, + builders.CsharpCsharpDelegates); // C# function AppendCsharpFunctionBeginning( @@ -11268,21 +11038,15 @@ static void AppendSetter( AppendIndent(indent, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append('\n'); - // C++ init params - AppendCppInitParam( - funcNameLower, + // C++ init body + AppendCppInitBodyFunctionPointerParameterRead( + funcName, methodIsStatic, enclosingTypeTypeName, enclosingTypeKind, parameters, typeof(void), - builders.CppInitParams); - - // C++ init body - AppendCppInitBody( - funcName, - funcNameLower, - builders.CppInitBody); + builders.CppInitBodyParameterReads); } static void AppendFieldPropertyFuncName( @@ -12175,26 +11939,28 @@ static void AppendIndent( { output.Append('\t', indent); } - - static void AppendCsharpInitParam( - string funcName, - StringBuilder output) - { - output.Append("\t\t\tIntPtr "); - output.Append(funcName); - output.Append(",\n"); - } - - static void AppendCsharpInitCallArg( + + static void AppendCsharpCsharpDelegate( string funcName, - StringBuilder output) - { - output.Append( - "\t\t\t\tMarshal.GetFunctionPointerForDelegate(new "); - output.Append(funcName); - output.Append("Delegate("); - output.Append(funcName); - output.Append(")),\n"); + StringBuilder initCallOutput, + StringBuilder delegateOutput) + { + initCallOutput.Append( + "\t\t\tMarshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate("); + initCallOutput.Append(funcName); + initCallOutput.Append("Delegate"); + initCallOutput.Append("));\n"); + initCallOutput.Append("\t\t\tcurMemory += IntPtr.Size;\n"); + + delegateOutput.Append("\t\tstatic readonly "); + delegateOutput.Append(funcName); + delegateOutput.Append("DelegateType "); + delegateOutput.Append(funcName); + delegateOutput.Append("Delegate = new "); + delegateOutput.Append(funcName); + delegateOutput.Append("DelegateType("); + delegateOutput.Append(funcName); + delegateOutput.Append(");\n"); } static void AppendCsharpDelegateType( @@ -12222,7 +11988,7 @@ static void AppendCsharpDelegateType( output.Append(' '); output.Append(funcName); - output.Append("Delegate("); + output.Append("DelegateType("); if (!isStatic) { if (enclosingTypeKind == TypeKind.FullStruct) @@ -12259,7 +12025,7 @@ static void AppendCsharpFunctionBeginning( { output.Append("\t\t[MonoPInvokeCallback(typeof("); output.Append(funcName); - output.Append("Delegate))]\n\t\tstatic "); + output.Append("DelegateType))]\n\t\tstatic "); // Return type if (returnType != null) @@ -12781,30 +12547,32 @@ static void AppendCppParameterDeclaration( } } } - - static void AppendDefaultStringParamName( - string str, - StringBuilder output) - { - foreach (char c in str) - { - if (char.IsLetterOrDigit(c)) - { - output.Append(c); - } - } - } - static void AppendCppInitBody( + static void AppendCppInitBodyFunctionPointerParameterRead( string globalVariableName, - string paramName, + bool isStatic, + TypeName enclosingTypeTypeName, + TypeKind enclosingTypeKind, + ParameterInfo[] parameters, + Type returnType, StringBuilder output) { output.Append("\tPlugin::"); output.Append(globalVariableName); - output.Append(" = "); - output.Append(paramName); - output.Append(";\n"); + output.Append(" = *("); + AppendCppFunctionPointer( + string.Empty, // function name + isStatic, + enclosingTypeTypeName, + enclosingTypeKind, + parameters, + returnType, + 2, + output); + output.Append(")curMemory;\n"); + output.Append("\tcurMemory += sizeof(Plugin::"); + output.Append(globalVariableName); + output.Append(");\n"); } static void AppendCppMethodDefinitionBegin( @@ -13029,31 +12797,7 @@ static void AppendCppUnhandledExceptionHandling( AppendIndent(indent, output); output.Append("}\n"); } - - static void AppendCppInitParam( - string funcName, - bool isStatic, - TypeName enclosingTypeTypeName, - TypeKind enclosingTypeKind, - ParameterInfo[] parameters, - Type returnType, - StringBuilder output - ) - { - output.Append('\t'); - AppendCppFunctionPointer( - funcName, - isStatic, - enclosingTypeTypeName, - enclosingTypeKind, - parameters, - returnType, - ',', - output - ); - output.Append('\n'); - } - + static void AppendCppFunctionPointerDefinition( string funcName, bool isStatic, @@ -13072,9 +12816,10 @@ StringBuilder output enclosingTypeKind, parameters, returnType, - ';', + 1, output ); + output.Append(';'); output.Append('\n'); } @@ -13085,7 +12830,7 @@ static void AppendCppFunctionPointer( TypeKind enclosingTypeKind, ParameterInfo[] parameters, Type returnType, - char separator, + int numIndirectionLevels, StringBuilder output) { // Return type @@ -13108,7 +12853,8 @@ static void AppendCppFunctionPointer( output.Append("int32_t"); } - output.Append(" (*"); + output.Append(" ("); + output.Append('*', numIndirectionLevels); output.Append(funcName); output.Append(")("); if (!isStatic) @@ -13189,7 +12935,6 @@ static void AppendCppFunctionPointer( } } output.Append(')'); - output.Append(separator); } static void AppendCppTemplateTypenames( @@ -13568,13 +13313,13 @@ static void AppendCppPrimitiveTypeName( static void RemoveTrailingChars( StringBuilders builders) { - RemoveTrailingChars(builders.CsharpInitParams); RemoveTrailingChars(builders.CsharpDelegateTypes); RemoveTrailingChars(builders.CsharpStoreInitCalls); RemoveTrailingChars(builders.CsharpInitCall); RemoveTrailingChars(builders.CsharpBaseTypes); RemoveTrailingChars(builders.CsharpFunctions); - RemoveTrailingChars(builders.CsharpDelegates); + RemoveTrailingChars(builders.CsharpCppDelegates); + RemoveTrailingChars(builders.CsharpCsharpDelegates); RemoveTrailingChars(builders.CsharpImports); RemoveTrailingChars(builders.CsharpGetDelegateCalls); RemoveTrailingChars(builders.CsharpDestroyFunctionEnumerators); @@ -13585,8 +13330,8 @@ static void RemoveTrailingChars( RemoveTrailingChars(builders.CppTemplateSpecializationDeclarations); RemoveTrailingChars(builders.CppTypeDefinitions); RemoveTrailingChars(builders.CppMethodDefinitions); - RemoveTrailingChars(builders.CppInitParams); - RemoveTrailingChars(builders.CppInitBody); + RemoveTrailingChars(builders.CppInitBodyParameterReads); + RemoveTrailingChars(builders.CppInitBodyArrays); RemoveTrailingChars(builders.CppInitBodyFirstBoot); RemoveTrailingChars(builders.CppGlobalStateAndFunctions); RemoveTrailingChars(builders.CppUnboxingMethodDeclarations); @@ -13627,11 +13372,6 @@ static void InjectBuilders( string csharpContents = File.ReadAllText(CsharpPath); string cppHeaderContents = File.ReadAllText(CppHeaderPath); string cppSourceContents = File.ReadAllText(CppSourcePath); - csharpContents = InjectIntoString( - csharpContents, - "/*BEGIN INIT PARAMS*/\n", - "\n\t\t\t/*END INIT PARAMS*/", - builders.CsharpInitParams.ToString()); csharpContents = InjectIntoString( csharpContents, "/*BEGIN DELEGATE TYPES*/\n", @@ -13645,7 +13385,7 @@ static void InjectBuilders( csharpContents = InjectIntoString( csharpContents, "/*BEGIN INIT CALL*/\n", - "\n\t\t\t\t/*END INIT CALL*/", + "\n\t\t\t/*END INIT CALL*/", builders.CsharpInitCall.ToString()); csharpContents = InjectIntoString( csharpContents, @@ -13659,9 +13399,14 @@ static void InjectBuilders( builders.CsharpFunctions.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN DELEGATES*/\n", - "\n\t\t/*END DELEGATES*/", - builders.CsharpDelegates.ToString()); + "/*BEGIN CPP DELEGATES*/\n", + "\n\t\t/*END CPP DELEGATES*/", + builders.CsharpCppDelegates.ToString()); + csharpContents = InjectIntoString( + csharpContents, + "/*BEGIN CSHARP DELEGATES*/\n", + "\n\t\t/*END CSHARP DELEGATES*/", + builders.CsharpCsharpDelegates.ToString()); csharpContents = InjectIntoString( csharpContents, "/*BEGIN IMPORTS*/\n", @@ -13714,14 +13459,14 @@ static void InjectBuilders( builders.CppMethodDefinitions.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN INIT PARAMS*/\n", - "\n\t/*END INIT PARAMS*/", - builders.CppInitParams.ToString()); + "/*BEGIN INIT BODY PARAMETER READS*/\n", + "\n\t/*END INIT BODY PARAMETER READS*/", + builders.CppInitBodyParameterReads.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN INIT BODY*/\n", - "\n\t/*END INIT BODY*/", - builders.CppInitBody.ToString()); + "/*BEGIN INIT BODY ARRAYS*/\n", + "\n\t/*END INIT BODY ARRAYS*/", + builders.CppInitBodyArrays.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, "/*BEGIN INIT BODY FIRST BOOT*/\n", diff --git a/Unity/UnityPackageManager/manifest.json b/Unity/Packages/manifest.json similarity index 100% rename from Unity/UnityPackageManager/manifest.json rename to Unity/Packages/manifest.json diff --git a/Unity/ProjectSettings/GraphicsSettings.asset b/Unity/ProjectSettings/GraphicsSettings.asset index 77bf2f1..d8b1468 100644 --- a/Unity/ProjectSettings/GraphicsSettings.asset +++ b/Unity/ProjectSettings/GraphicsSettings.asset @@ -37,6 +37,7 @@ GraphicsSettings: - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} m_PreloadedShaders: [] m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} diff --git a/Unity/ProjectSettings/PresetManager.asset b/Unity/ProjectSettings/PresetManager.asset new file mode 100644 index 0000000..636a595 --- /dev/null +++ b/Unity/ProjectSettings/PresetManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1386491679 &1 +PresetManager: + m_ObjectHideFlags: 0 + m_DefaultList: [] diff --git a/Unity/ProjectSettings/ProjectVersion.txt b/Unity/ProjectSettings/ProjectVersion.txt index e3618f1..22977b3 100644 --- a/Unity/ProjectSettings/ProjectVersion.txt +++ b/Unity/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2017.4.1f1 +m_EditorVersion: 2018.1.0f2 From 1cb1135e19576bb3a01205b9c1bc61fd304db746 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 28 Jul 2018 17:16:52 -0700 Subject: [PATCH 68/95] Fix GitHub Issue #19 regarding whole object free list initialization (thanks to JmgrArt!) Update Unity project to 2018.2.0f2 and fix an error by generating IEquatable --- .../CppSource/NativeScript/Bindings.cpp | 101 +++++++++++++++++- .../Assets/CppSource/NativeScript/Bindings.h | 23 ++++ .../NativeScript/Editor/GenerateBindings.cs | 2 +- Unity/Assets/NativeScriptTypes.json | 5 + Unity/Packages/manifest.json | 39 ++++++- Unity/ProjectSettings/ProjectVersion.txt | 2 +- 6 files changed, 167 insertions(+), 5 deletions(-) diff --git a/Unity/Assets/CppSource/NativeScript/Bindings.cpp b/Unity/Assets/CppSource/NativeScript/Bindings.cpp index 8e36cbb..0903692 100644 --- a/Unity/Assets/CppSource/NativeScript/Bindings.cpp +++ b/Unity/Assets/CppSource/NativeScript/Bindings.cpp @@ -2490,6 +2490,87 @@ namespace System } } +namespace System +{ + IEquatable_1::IEquatable_1(decltype(nullptr)) + { + } + + IEquatable_1::IEquatable_1(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IEquatable_1::IEquatable_1(const IEquatable_1& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + } + + IEquatable_1::IEquatable_1(IEquatable_1&& other) + : IEquatable_1(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IEquatable_1::~IEquatable_1() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IEquatable_1& IEquatable_1::operator=(const IEquatable_1& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IEquatable_1& IEquatable_1::operator=(IEquatable_1&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IEquatable_1::operator==(const IEquatable_1& other) const + { + return Handle == other.Handle; + } + + bool IEquatable_1::operator!=(const IEquatable_1& other) const + { + return Handle != other.Handle; + } +} + namespace System { IComparable_1::IComparable_1(decltype(nullptr)) @@ -3867,6 +3948,24 @@ namespace UnityEngine } return nullptr; } + + UnityEngine::Vector3::operator System::IEquatable_1() + { + int32_t handle = Plugin::BoxVector3(*this); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IEquatable_1(Plugin::InternalUse::Only, handle); + } + return nullptr; + } } namespace System @@ -6117,7 +6216,7 @@ DLLEXPORT void Init( for (int32_t i = 0, end = Plugin::BaseBallScriptFreeWholeListSize - 1; i < end; ++i) { - Plugin::BaseBallScriptFreeWholeList[i].Next = Plugin::BaseBallScriptFreeWholeList[i + 1].Next; + Plugin::BaseBallScriptFreeWholeList[i].Next = Plugin::BaseBallScriptFreeWholeList + i + 1; } Plugin::BaseBallScriptFreeWholeList[Plugin::BaseBallScriptFreeWholeListSize - 1].Next = nullptr; Plugin::NextFreeWholeBaseBallScript = Plugin::BaseBallScriptFreeWholeList + 1; diff --git a/Unity/Assets/CppSource/NativeScript/Bindings.h b/Unity/Assets/CppSource/NativeScript/Bindings.h index e7a25bb..13aa459 100644 --- a/Unity/Assets/CppSource/NativeScript/Bindings.h +++ b/Unity/Assets/CppSource/NativeScript/Bindings.h @@ -489,6 +489,11 @@ namespace System template<> struct IEquatable_1; } +namespace System +{ + template<> struct IEquatable_1; +} + namespace System { template<> struct IComparable_1; @@ -934,6 +939,23 @@ namespace System }; } +namespace System +{ + template<> struct IEquatable_1 : virtual System::Object + { + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); + IEquatable_1& operator=(const IEquatable_1& other); + IEquatable_1& operator=(decltype(nullptr)); + IEquatable_1& operator=(IEquatable_1&& other); + bool operator==(const IEquatable_1& other) const; + bool operator!=(const IEquatable_1& other) const; + }; +} + namespace System { template<> struct IComparable_1 : virtual System::Object @@ -1193,6 +1215,7 @@ namespace UnityEngine UnityEngine::Vector3 operator+(UnityEngine::Vector3& a); explicit operator System::ValueType(); explicit operator System::Object(); + explicit operator System::IEquatable_1(); }; } diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 013fa39..9966308 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -10164,7 +10164,7 @@ static void AppendCppWholeObjectFreeListInit( outputFirstBoot.Append(bindingTypeName); outputFirstBoot.Append("FreeWholeList[i].Next = Plugin::"); outputFirstBoot.Append(bindingTypeName); - outputFirstBoot.Append("FreeWholeList[i + 1].Next;\n"); + outputFirstBoot.Append("FreeWholeList + i + 1;\n"); outputFirstBoot.Append("\t\t}\n"); outputFirstBoot.Append("\t\tPlugin::"); diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index 26511b8..b933795 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -78,6 +78,11 @@ "Types": [ "System.Decimal" ] + }, + { + "Types": [ + "UnityEngine.Vector3" + ] } ] }, diff --git a/Unity/Packages/manifest.json b/Unity/Packages/manifest.json index 526aca6..1342d0a 100644 --- a/Unity/Packages/manifest.json +++ b/Unity/Packages/manifest.json @@ -1,4 +1,39 @@ { - "dependencies": { - } + "dependencies": { + "com.unity.ads": "2.0.8", + "com.unity.analytics": "2.0.16", + "com.unity.package-manager-ui": "1.9.11", + "com.unity.purchasing": "2.0.3", + "com.unity.textmeshpro": "1.2.4", + "com.unity.modules.ai": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.cloth": "1.0.0", + "com.unity.modules.director": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.physics2d": "1.0.0", + "com.unity.modules.screencapture": "1.0.0", + "com.unity.modules.terrain": "1.0.0", + "com.unity.modules.terrainphysics": "1.0.0", + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.uielements": "1.0.0", + "com.unity.modules.umbra": "1.0.0", + "com.unity.modules.unityanalytics": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.unitywebrequesttexture": "1.0.0", + "com.unity.modules.unitywebrequestwww": "1.0.0", + "com.unity.modules.vehicles": "1.0.0", + "com.unity.modules.video": "1.0.0", + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.wind": "1.0.0", + "com.unity.modules.xr": "1.0.0" + } } diff --git a/Unity/ProjectSettings/ProjectVersion.txt b/Unity/ProjectSettings/ProjectVersion.txt index 22977b3..0498f4d 100644 --- a/Unity/ProjectSettings/ProjectVersion.txt +++ b/Unity/ProjectSettings/ProjectVersion.txt @@ -1 +1 @@ -m_EditorVersion: 2018.1.0f2 +m_EditorVersion: 2018.2.0f2 From ba3cf0d3e1f3c3eb6e8c05dbe18318d4b0361168 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Tue, 5 Mar 2019 22:17:47 -0800 Subject: [PATCH 69/95] Fix a bug generating the base type constructor function for delegates --- Unity/Assets/NativeScript/Editor/GenerateBindings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 9966308..4e25e7a 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -6751,7 +6751,7 @@ static void AppendDelegate( AppendCsharpBaseTypeConstructorFunction( type, GetTypeName(bindingTypeName, string.Empty), - false, + true, constructorFuncName, constructorParams, new ParameterInfo[0], From 7b3d95ec3ca559a543262b2dcc36daf4808c113f Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Thu, 4 Jul 2019 10:39:27 -0700 Subject: [PATCH 70/95] Use non-experimental namespace for UI Elements in Unity 2019.1+ --- Unity/Assets/NativeScript/Editor/GenerateBindings.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 4e25e7a..16da323 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -704,7 +704,11 @@ static Assembly[] GetAssemblies(string[] assemblyNames) assemblies[27] = typeof(TerrainCollider).Assembly; // Unity terrain physics module assemblies[28] = typeof(Font).Assembly; // Unity text rendering module assemblies[29] = typeof(UnityEngine.Tilemaps.Tile).Assembly; // Unity tilemap module +#if UNITY_2019_1_OR_NEWER + assemblies[30] = typeof(UnityEngine.UIElements.Button).Assembly; // Unity UI elements module +#else assemblies[30] = typeof(UnityEngine.Experimental.UIElements.Button).Assembly; // Unity UI elements module +#endif assemblies[31] = typeof(Canvas).Assembly; // Unity UI module assemblies[32] = typeof(UnityEngine.Networking.NetworkTransport).Assembly; // Unity cloth module assemblies[33] = typeof(UnityEngine.Analytics.Analytics).Assembly; // Unity analytics module From d67249bde28778803d894eb336cac50be9f40b87 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Fri, 2 Aug 2019 17:36:29 -0700 Subject: [PATCH 71/95] Made BootScript only run on Start, not Awake, so that it can be disabled. --- Unity/Assets/NativeScript/BootScript.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unity/Assets/NativeScript/BootScript.cs b/Unity/Assets/NativeScript/BootScript.cs index 1fe063f..9296ee7 100644 --- a/Unity/Assets/NativeScript/BootScript.cs +++ b/Unity/Assets/NativeScript/BootScript.cs @@ -27,7 +27,7 @@ public class BootScript : MonoBehaviour private Coroutine autoReloadCoroutine; #endif - void Awake() + void Start() { #if UNITY_EDITOR lastAutoReloadPollTime = AutoReloadPollTime; From 7107c69e0e0aad14ba22778b20c86ba0b7b32119 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Tue, 6 Aug 2019 21:39:37 -0700 Subject: [PATCH 72/95] - Remove global placement new operator - Add macros for defining placement new within derived classes (and use them in the example) - Fix copy errors on Windows when the temp DLL existed - Fix Bindings.h being included by Bindings.cpp on behalf of Game.h - Git-ignore Unity upgrade logs - Upgrade project to Unity 2019.2.0f1 and change the JSON config to add a newly-required type --- .gitignore | 5 +- Unity/Assets/CppSource/Game/Game.h | 1 + .../CppSource/NativeScript/Bindings.cpp | 147 +++++++++--- .../Assets/CppSource/NativeScript/Bindings.h | 75 +++++- Unity/Assets/NativeScript/Bindings.cs | 2 +- .../NativeScript/Editor/GenerateBindings.cs | 85 ++++++- Unity/Assets/NativeScriptTypes.json | 3 + Unity/Packages/manifest.json | 20 +- Unity/ProjectSettings/EditorSettings.asset | 16 +- Unity/ProjectSettings/GraphicsSettings.asset | 1 + Unity/ProjectSettings/ProjectSettings.asset | 227 ++++++++---------- Unity/ProjectSettings/ProjectVersion.txt | 3 +- .../UnityConnectSettings.asset | 16 +- Unity/ProjectSettings/VFXManager.asset | 11 + Unity/ProjectSettings/XRSettings.asset | 10 + 15 files changed, 444 insertions(+), 178 deletions(-) create mode 100644 Unity/ProjectSettings/VFXManager.asset create mode 100644 Unity/ProjectSettings/XRSettings.asset diff --git a/.gitignore b/.gitignore index 7f3848a..eaec275 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ # Rider IDE -.idea \ No newline at end of file +.idea + +# Unity upgrade logs +Unity/Logs \ No newline at end of file diff --git a/Unity/Assets/CppSource/Game/Game.h b/Unity/Assets/CppSource/Game/Game.h index a8e6e5b..79d31ad 100644 --- a/Unity/Assets/CppSource/Game/Game.h +++ b/Unity/Assets/CppSource/Game/Game.h @@ -16,6 +16,7 @@ namespace MyGame { struct BallScript : MyGame::BaseBallScript { + MY_GAME_BALL_SCRIPT_DEFAULT_CONTENTS MY_GAME_BALL_SCRIPT_DEFAULT_CONSTRUCTOR void Update() override; }; diff --git a/Unity/Assets/CppSource/NativeScript/Bindings.cpp b/Unity/Assets/CppSource/NativeScript/Bindings.cpp index 0903692..b8246ad 100644 --- a/Unity/Assets/CppSource/NativeScript/Bindings.cpp +++ b/Unity/Assets/CppSource/NativeScript/Bindings.cpp @@ -9,30 +9,18 @@ /// MIT /// -// Type definitions -#include "Bindings.h" - // Game type definitions #include "Game.h" +// Type definitions +#include "Bindings.h" + // For assert() #include -// For int32_t, etc. -#include - -// For malloc(), etc. -#include - // For memset(), etc. #include -// Support placement new -void* operator new(size_t, void* p) -{ - return p; -} - // Macro to put before functions that need to be exposed to C# #ifdef _WIN32 #define DLLEXPORT extern "C" __declspec(dllexport) @@ -3624,6 +3612,93 @@ namespace System } } +namespace System +{ + namespace Runtime + { + namespace Serialization + { + IDeserializationCallback::IDeserializationCallback(decltype(nullptr)) + { + } + + IDeserializationCallback::IDeserializationCallback(Plugin::InternalUse, int32_t handle) + { + Handle = handle; + if (handle) + { + Plugin::ReferenceManagedClass(handle); + } + } + + IDeserializationCallback::IDeserializationCallback(const IDeserializationCallback& other) + : IDeserializationCallback(Plugin::InternalUse::Only, other.Handle) + { + } + + IDeserializationCallback::IDeserializationCallback(IDeserializationCallback&& other) + : IDeserializationCallback(Plugin::InternalUse::Only, other.Handle) + { + other.Handle = 0; + } + + IDeserializationCallback::~IDeserializationCallback() + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + } + + IDeserializationCallback& IDeserializationCallback::operator=(const IDeserializationCallback& other) + { + if (this->Handle) + { + Plugin::DereferenceManagedClass(this->Handle); + } + this->Handle = other.Handle; + if (this->Handle) + { + Plugin::ReferenceManagedClass(this->Handle); + } + return *this; + } + + IDeserializationCallback& IDeserializationCallback::operator=(decltype(nullptr)) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + Handle = 0; + } + return *this; + } + + IDeserializationCallback& IDeserializationCallback::operator=(IDeserializationCallback&& other) + { + if (Handle) + { + Plugin::DereferenceManagedClass(Handle); + } + Handle = other.Handle; + other.Handle = 0; + return *this; + } + + bool IDeserializationCallback::operator==(const IDeserializationCallback& other) const + { + return Handle == other.Handle; + } + + bool IDeserializationCallback::operator!=(const IDeserializationCallback& other) const + { + return Handle != other.Handle; + } + } + } +} + namespace System { Decimal::Decimal(decltype(nullptr)) @@ -3774,7 +3849,7 @@ namespace System return nullptr; } - System::Decimal::operator System::IFormattable() + System::Decimal::operator System::IComparable() { int32_t handle = Plugin::BoxDecimal(Handle); if (Plugin::unhandledCsharpException) @@ -3787,7 +3862,25 @@ namespace System if (handle) { Plugin::ReferenceManagedClass(handle); - return System::IFormattable(Plugin::InternalUse::Only, handle); + return System::IComparable(Plugin::InternalUse::Only, handle); + } + return nullptr; + } + + System::Decimal::operator System::IComparable_1() + { + int32_t handle = Plugin::BoxDecimal(Handle); + if (Plugin::unhandledCsharpException) + { + System::Exception* ex = Plugin::unhandledCsharpException; + Plugin::unhandledCsharpException = nullptr; + ex->ThrowReferenceToThis(); + delete ex; + } + if (handle) + { + Plugin::ReferenceManagedClass(handle); + return System::IComparable_1(Plugin::InternalUse::Only, handle); } return nullptr; } @@ -3810,7 +3903,7 @@ namespace System return nullptr; } - System::Decimal::operator System::IComparable() + System::Decimal::operator System::IEquatable_1() { int32_t handle = Plugin::BoxDecimal(Handle); if (Plugin::unhandledCsharpException) @@ -3823,12 +3916,12 @@ namespace System if (handle) { Plugin::ReferenceManagedClass(handle); - return System::IComparable(Plugin::InternalUse::Only, handle); + return System::IEquatable_1(Plugin::InternalUse::Only, handle); } return nullptr; } - System::Decimal::operator System::IComparable_1() + System::Decimal::operator System::Runtime::Serialization::IDeserializationCallback() { int32_t handle = Plugin::BoxDecimal(Handle); if (Plugin::unhandledCsharpException) @@ -3841,12 +3934,12 @@ namespace System if (handle) { Plugin::ReferenceManagedClass(handle); - return System::IComparable_1(Plugin::InternalUse::Only, handle); + return System::Runtime::Serialization::IDeserializationCallback(Plugin::InternalUse::Only, handle); } return nullptr; } - System::Decimal::operator System::IEquatable_1() + System::Decimal::operator System::IFormattable() { int32_t handle = Plugin::BoxDecimal(Handle); if (Plugin::unhandledCsharpException) @@ -3859,7 +3952,7 @@ namespace System if (handle) { Plugin::ReferenceManagedClass(handle); - return System::IEquatable_1(Plugin::InternalUse::Only, handle); + return System::IFormattable(Plugin::InternalUse::Only, handle); } return nullptr; } @@ -5325,7 +5418,7 @@ namespace UnityEngine return nullptr; } - UnityEngine::PrimitiveType::operator System::IFormattable() + UnityEngine::PrimitiveType::operator System::IComparable() { int32_t handle = Plugin::BoxPrimitiveType(*this); if (Plugin::unhandledCsharpException) @@ -5338,7 +5431,7 @@ namespace UnityEngine if (handle) { Plugin::ReferenceManagedClass(handle); - return System::IFormattable(Plugin::InternalUse::Only, handle); + return System::IComparable(Plugin::InternalUse::Only, handle); } return nullptr; } @@ -5361,7 +5454,7 @@ namespace UnityEngine return nullptr; } - UnityEngine::PrimitiveType::operator System::IComparable() + UnityEngine::PrimitiveType::operator System::IFormattable() { int32_t handle = Plugin::BoxPrimitiveType(*this); if (Plugin::unhandledCsharpException) @@ -5374,7 +5467,7 @@ namespace UnityEngine if (handle) { Plugin::ReferenceManagedClass(handle); - return System::IComparable(Plugin::InternalUse::Only, handle); + return System::IFormattable(Plugin::InternalUse::Only, handle); } return nullptr; } diff --git a/Unity/Assets/CppSource/NativeScript/Bindings.h b/Unity/Assets/CppSource/NativeScript/Bindings.h index 13aa459..6835b61 100644 --- a/Unity/Assets/CppSource/NativeScript/Bindings.h +++ b/Unity/Assets/CppSource/NativeScript/Bindings.h @@ -13,6 +13,9 @@ // For int32_t, etc. #include +// For size_t to support placement new and delete +#include + //////////////////////////////////////////////////////////////// // Plugin internals. Do not name these in game code as they may // change without warning. For example: @@ -312,6 +315,17 @@ namespace System struct IComparable; } +namespace System +{ + namespace Runtime + { + namespace Serialization + { + struct IDeserializationCallback; + } + } +} + namespace System { struct Decimal; @@ -1177,6 +1191,29 @@ namespace System }; } +namespace System +{ + namespace Runtime + { + namespace Serialization + { + struct IDeserializationCallback : virtual System::Object + { + IDeserializationCallback(decltype(nullptr)); + IDeserializationCallback(Plugin::InternalUse, int32_t handle); + IDeserializationCallback(const IDeserializationCallback& other); + IDeserializationCallback(IDeserializationCallback&& other); + virtual ~IDeserializationCallback(); + IDeserializationCallback& operator=(const IDeserializationCallback& other); + IDeserializationCallback& operator=(decltype(nullptr)); + IDeserializationCallback& operator=(IDeserializationCallback&& other); + bool operator==(const IDeserializationCallback& other) const; + bool operator!=(const IDeserializationCallback& other) const; + }; + } + } +} + namespace System { struct Decimal : Plugin::ManagedType @@ -1195,11 +1232,12 @@ namespace System Decimal(System::UInt64 value); explicit operator System::ValueType(); explicit operator System::Object(); - explicit operator System::IFormattable(); - explicit operator System::IConvertible(); explicit operator System::IComparable(); explicit operator System::IComparable_1(); + explicit operator System::IConvertible(); explicit operator System::IEquatable_1(); + explicit operator System::Runtime::Serialization::IDeserializationCallback(); + explicit operator System::IFormattable(); }; } @@ -1485,9 +1523,9 @@ namespace UnityEngine explicit operator System::Enum(); explicit operator System::ValueType(); explicit operator System::Object(); - explicit operator System::IFormattable(); - explicit operator System::IConvertible(); explicit operator System::IComparable(); + explicit operator System::IConvertible(); + explicit operator System::IFormattable(); }; } @@ -1550,7 +1588,7 @@ namespace MyGame /*BEGIN MACROS*/ #define MY_GAME_BALL_SCRIPT_DEFAULT_CONSTRUCTOR_DECLARATION \ BallScript(Plugin::InternalUse iu, int32_t handle); - + #define MY_GAME_BALL_SCRIPT_DEFAULT_CONSTRUCTOR_DEFINITION \ BallScript::BallScript(Plugin::InternalUse iu, int32_t handle) \ : UnityEngine::Object(nullptr) \ @@ -1558,7 +1596,10 @@ namespace MyGame , UnityEngine::Behaviour(nullptr) \ , UnityEngine::MonoBehaviour(nullptr) \ , MyGame::AbstractBaseBallScript(nullptr) \ - , MyGame::BaseBallScript(iu, handle) + , MyGame::BaseBallScript(iu, handle) \ + { \ + } + #define MY_GAME_BALL_SCRIPT_DEFAULT_CONSTRUCTOR \ BallScript(Plugin::InternalUse iu, int32_t handle) \ : UnityEngine::Object(nullptr) \ @@ -1568,7 +1609,29 @@ namespace MyGame , MyGame::AbstractBaseBallScript(nullptr) \ , MyGame::BaseBallScript(iu, handle) \ { \ + } + +#define MY_GAME_BALL_SCRIPT_DEFAULT_CONTENTS_DECLARATION \ + void* operator new(size_t, void* p) noexcept; \ + void operator delete(void*, size_t) noexcept; \ + +#define MY_GAME_BALL_SCRIPT_DEFAULT_CONTENTS_DEFINITION \ + void* BallScript::operator new(size_t, void* p) noexcept\ + { \ + return p; \ + } \ + void BallScript::operator delete(void*, size_t) noexcept \ + { \ + } + +#define MY_GAME_BALL_SCRIPT_DEFAULT_CONTENTS\ + void* operator new(size_t, void* p) noexcept \ + { \ + return p; \ } \ + void operator delete(void*, size_t) noexcept \ + { \ + } /*END MACROS*/ //////////////////////////////////////////////////////////////// diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index c2a00a6..bb6745d 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -679,7 +679,7 @@ private static void OpenPlugin(InitMode initMode) string loadPath; #if UNITY_EDITOR_WIN // Copy native library to temporary file - File.Copy(pluginPath, pluginTempPath); + File.Copy(pluginPath, pluginTempPath, true); loadPath = pluginTempPath; #else loadPath = pluginPath; diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 16da323..0855981 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -7067,6 +7067,7 @@ static void AppendBaseType( AppendIndent(indent, builders.CppMacros); builders.CppMacros.Append(derivedTypeTypeName.Name); builders.CppMacros.Append("(Plugin::InternalUse iu, int32_t handle);\n"); + AppendIndent(indent, builders.CppMacros); builders.CppMacros.Append('\n'); // C++ constructor definition macro @@ -7094,7 +7095,13 @@ static void AppendBaseType( AppendCppTypeFullName( baseTypeTypeName, builders.CppMacros); - builders.CppMacros.Append("(iu, handle)\n"); + builders.CppMacros.Append("(iu, handle) \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("{ \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("}\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append('\n'); // C++ constructor inline definition macro builders.CppMacros.Append("#define "); @@ -7123,7 +7130,83 @@ static void AppendBaseType( AppendIndent(indent, builders.CppMacros); builders.CppMacros.Append("{ \\\n"); AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("}\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append('\n'); + + // C++ default contents declaration macro + builders.CppMacros.Append("#define "); + AppendUppercaseWithUnderscores( + derivedTypeTypeName.Namespace, + builders.CppMacros); + builders.CppMacros.Append('_'); + AppendUppercaseWithUnderscores( + derivedTypeTypeName.Name, + builders.CppMacros); + builders.CppMacros.Append("_DEFAULT_CONTENTS_DECLARATION \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("void* operator new(size_t, void* p) noexcept; \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("void operator delete(void*, size_t) noexcept; \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append('\n'); + + // C++ default contents definition macro + builders.CppMacros.Append("#define "); + AppendUppercaseWithUnderscores( + derivedTypeTypeName.Namespace, + builders.CppMacros); + builders.CppMacros.Append('_'); + AppendUppercaseWithUnderscores( + derivedTypeTypeName.Name, + builders.CppMacros); + builders.CppMacros.Append("_DEFAULT_CONTENTS_DEFINITION \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("void* "); + builders.CppMacros.Append(derivedTypeTypeName.Name); + builders.CppMacros.Append("::operator new(size_t, void* p) noexcept\\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("{ \\\n"); + AppendIndent(indent + 1, builders.CppMacros); + builders.CppMacros.Append("return p; \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("} \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("void "); + builders.CppMacros.Append(derivedTypeTypeName.Name); + builders.CppMacros.Append("::operator delete(void*, size_t) noexcept \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("{ \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("}\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append('\n'); + + // C++ default contents inline definition macro + builders.CppMacros.Append("#define "); + AppendUppercaseWithUnderscores( + derivedTypeTypeName.Namespace, + builders.CppMacros); + builders.CppMacros.Append('_'); + AppendUppercaseWithUnderscores( + derivedTypeTypeName.Name, + builders.CppMacros); + builders.CppMacros.Append("_DEFAULT_CONTENTS\\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("void* operator new(size_t, void* p) noexcept \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("{ \\\n"); + AppendIndent(indent + 1, builders.CppMacros); + builders.CppMacros.Append("return p; \\\n"); + AppendIndent(indent, builders.CppMacros); builders.CppMacros.Append("} \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("void operator delete(void*, size_t) noexcept \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("{ \\\n"); + AppendIndent(indent, builders.CppMacros); + builders.CppMacros.Append("}\n"); + AppendIndent(indent, builders.CppMacros); builders.CppMacros.Append('\n'); // C++ function pointers diff --git a/Unity/Assets/NativeScriptTypes.json b/Unity/Assets/NativeScriptTypes.json index b933795..c507547 100644 --- a/Unity/Assets/NativeScriptTypes.json +++ b/Unity/Assets/NativeScriptTypes.json @@ -156,6 +156,9 @@ } ] }, + { + "Name": " System.Runtime.Serialization.IDeserializationCallback" + }, { "Name": "System.Decimal", "Constructors": [ diff --git a/Unity/Packages/manifest.json b/Unity/Packages/manifest.json index 1342d0a..bc19e66 100644 --- a/Unity/Packages/manifest.json +++ b/Unity/Packages/manifest.json @@ -1,11 +1,23 @@ { "dependencies": { + "com.unity.2d.sprite": "1.0.0", + "com.unity.2d.tilemap": "1.0.0", "com.unity.ads": "2.0.8", - "com.unity.analytics": "2.0.16", - "com.unity.package-manager-ui": "1.9.11", - "com.unity.purchasing": "2.0.3", - "com.unity.textmeshpro": "1.2.4", + "com.unity.analytics": "3.3.2", + "com.unity.collab-proxy": "1.2.16", + "com.unity.ext.nunit": "1.0.0", + "com.unity.ide.rider": "1.0.8", + "com.unity.ide.vscode": "1.0.7", + "com.unity.multiplayer-hlapi": "1.0.2", + "com.unity.package-manager-ui": "2.2.0", + "com.unity.purchasing": "2.0.6", + "com.unity.test-framework": "1.0.13", + "com.unity.textmeshpro": "2.0.1", + "com.unity.timeline": "1.1.0", + "com.unity.ugui": "1.0.0", + "com.unity.xr.legacyinputhelpers": "2.0.2", "com.unity.modules.ai": "1.0.0", + "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", "com.unity.modules.assetbundle": "1.0.0", "com.unity.modules.audio": "1.0.0", diff --git a/Unity/ProjectSettings/EditorSettings.asset b/Unity/ProjectSettings/EditorSettings.asset index f33b6fb..4b908a6 100644 --- a/Unity/ProjectSettings/EditorSettings.asset +++ b/Unity/ProjectSettings/EditorSettings.asset @@ -3,14 +3,24 @@ --- !u!159 &1 EditorSettings: m_ObjectHideFlags: 0 - serializedVersion: 4 + serializedVersion: 8 m_ExternalVersionControlSupport: Visible Meta Files m_SerializationMode: 2 + m_LineEndingsForNewScripts: 1 m_DefaultBehaviorMode: 0 + m_PrefabRegularEnvironment: {fileID: 0} + m_PrefabUIEnvironment: {fileID: 0} m_SpritePackerMode: 0 m_SpritePackerPaddingPower: 1 - m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd + m_EtcTextureCompressorBehavior: 0 + m_EtcTextureFastCompressor: 2 + m_EtcTextureNormalCompressor: 2 + m_EtcTextureBestCompressor: 5 + m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmref;asmdef m_ProjectGenerationRootNamespace: - m_UserGeneratedProjectSuffix: m_CollabEditorSettings: inProgressEnabled: 1 + m_EnableTextureStreamingInEditMode: 1 + m_EnableTextureStreamingInPlayMode: 1 + m_AsyncShaderCompilation: 1 + m_ShowLightmapResolutionOverlay: 1 diff --git a/Unity/ProjectSettings/GraphicsSettings.asset b/Unity/ProjectSettings/GraphicsSettings.asset index d8b1468..646b92e 100644 --- a/Unity/ProjectSettings/GraphicsSettings.asset +++ b/Unity/ProjectSettings/GraphicsSettings.asset @@ -38,6 +38,7 @@ GraphicsSettings: - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0} m_PreloadedShaders: [] m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} diff --git a/Unity/ProjectSettings/ProjectSettings.asset b/Unity/ProjectSettings/ProjectSettings.asset index b6955bb..d724f15 100644 --- a/Unity/ProjectSettings/ProjectSettings.asset +++ b/Unity/ProjectSettings/ProjectSettings.asset @@ -3,10 +3,11 @@ --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 - serializedVersion: 14 + serializedVersion: 18 productGUID: 435980e4cf9ff4aa8b71e496e8163063 AndroidProfiler: 0 AndroidFilterTouchesWhenObscured: 0 + AndroidEnableSustainedPerformanceMode: 0 defaultScreenOrientation: 4 targetDevice: 2 useOnDemandResources: 0 @@ -51,9 +52,8 @@ PlayerSettings: m_StackTraceTypes: 010000000100000001000000010000000100000001000000 iosShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1 - tizenShowActivityIndicatorOnLoading: -1 - iosAppInBackgroundBehavior: 0 displayResolutionDialog: 1 + iosUseCustomAppBackgroundBehavior: 0 iosAllowHTTPDownload: 1 allowedAutorotateToPortrait: 1 allowedAutorotateToPortraitUpsideDown: 1 @@ -63,8 +63,10 @@ PlayerSettings: use32BitDisplayBuffer: 1 preserveFramebufferAlpha: 0 disableDepthAndStencilBuffers: 0 + androidStartInFullscreen: 1 + androidRenderOutsideSafeArea: 1 + androidUseSwappy: 0 androidBlitType: 0 - defaultIsFullScreen: 1 defaultIsNativeResolution: 1 macRetinaSupport: 1 runInBackground: 0 @@ -78,6 +80,7 @@ PlayerSettings: usePlayerLog: 1 bakeCollisionMeshes: 0 forceSingleInstance: 0 + useFlipModelSwapchain: 1 resizableWindow: 0 useMacAppStoreValidation: 0 macAppStoreCategory: public.app-category.games @@ -91,16 +94,12 @@ PlayerSettings: visibleInBackground: 0 allowFullscreenSwitch: 1 graphicsJobMode: 0 - macFullscreenMode: 2 - d3d11FullscreenMode: 1 + fullscreenMode: 1 xboxSpeechDB: 0 xboxEnableHeadOrientation: 0 xboxEnableGuest: 0 xboxEnablePIXSampling: 0 metalFramebufferOnly: 0 - n3dsDisableStereoscopicView: 0 - n3dsEnableSharedListOpt: 1 - n3dsEnableVSync: 0 xboxOneResolution: 0 xboxOneSResolution: 0 xboxOneXResolution: 3 @@ -108,18 +107,13 @@ PlayerSettings: xboxOneLoggingLevel: 1 xboxOneDisableEsram: 0 xboxOnePresentImmediateThreshold: 0 - videoMemoryForVertexBuffers: 0 - psp2PowerMode: 0 - psp2AcquireBGM: 1 - wiiUTVResolution: 0 - wiiUGamePadMSAA: 1 - wiiUSupportsNunchuk: 0 - wiiUSupportsClassicController: 0 - wiiUSupportsBalanceBoard: 0 - wiiUSupportsMotionPlus: 0 - wiiUSupportsProController: 0 - wiiUAllowScreenCapture: 1 - wiiUControllerCount: 0 + switchQueueCommandMemory: 1048576 + switchQueueControlMemory: 16384 + switchQueueComputeMemory: 262144 + switchNVNShaderPoolsGranularity: 33554432 + switchNVNDefaultPoolsGranularity: 16777216 + switchNVNOtherPoolsGranularity: 16777216 + vulkanEnableSetSRGBWrite: 0 m_SupportedAspectRatios: 4:3: 1 5:4: 1 @@ -147,10 +141,20 @@ PlayerSettings: hololens: depthFormat: 1 depthBufferSharingEnabled: 0 + lumin: + depthFormat: 0 + frameTiming: 2 + enableGLCache: 0 + glCacheMaxBlobSize: 524288 + glCacheMaxFileSize: 8388608 oculus: sharedDepthBuffer: 0 dashSupport: 0 + lowOverheadMode: 0 + enable360StereoCapture: 0 + isWsaHolographicRemotingEnabled: 0 protectGraphicsMemory: 0 + enableFrameTimingStats: 0 useHDRDisplay: 0 m_ColorGamuts: 00000000 targetPixelDensity: 30 @@ -161,10 +165,10 @@ PlayerSettings: Android: com.jacksondunstan.unityplayground Standalone: unity.DefaultCompany.UnityPlayground Tizen: com.jacksondunstan.unityplayground - iOS: com.jacksondunstan.unityplayground + iPhone: com.jacksondunstan.unityplayground tvOS: com.jacksondunstan.unityplayground buildNumber: - iOS: 0 + iPhone: 0 AndroidBundleVersionCode: 1 AndroidMinSdkVersion: 16 AndroidTargetSdkVersion: 0 @@ -179,11 +183,9 @@ PlayerSettings: APKExpansionFiles: 0 keepLoadedShadersAlive: 0 StripUnusedMeshComponents: 0 - VertexChannelCompressionMask: - serializedVersion: 2 - m_Bits: 238 + VertexChannelCompressionMask: 214 iPhoneSdkVersion: 988 - iOSTargetOSVersionString: 7.0 + iOSTargetOSVersionString: 9.0 tvOSSdkVersion: 0 tvOSRequireExtendedGameController: 0 tvOSTargetOSVersionString: 9.0 @@ -205,11 +207,16 @@ PlayerSettings: iPadHighResPortraitSplashScreen: {fileID: 0} iPadLandscapeSplashScreen: {fileID: 0} iPadHighResLandscapeSplashScreen: {fileID: 0} + iPhone65inPortraitSplashScreen: {fileID: 0} + iPhone65inLandscapeSplashScreen: {fileID: 0} + iPhone61inPortraitSplashScreen: {fileID: 0} + iPhone61inLandscapeSplashScreen: {fileID: 0} appleTVSplashScreen: {fileID: 0} appleTVSplashScreen2x: {fileID: 0} tvOSSmallIconLayers: [] tvOSSmallIconLayers2x: [] tvOSLargeIconLayers: [] + tvOSLargeIconLayers2x: [] tvOSTopShelfImageLayers: [] tvOSTopShelfImageLayers2x: [] tvOSTopShelfImageWideLayers: [] @@ -243,23 +250,34 @@ PlayerSettings: appleDeveloperTeamID: iOSManualSigningProvisioningProfileID: tvOSManualSigningProvisioningProfileID: + iOSManualSigningProvisioningProfileType: 0 + tvOSManualSigningProvisioningProfileType: 0 appleEnableAutomaticSigning: 0 + iOSRequireARKit: 0 + iOSAutomaticallyDetectAndAddCapabilities: 1 + appleEnableProMotion: 0 clonedFromGUID: 00000000000000000000000000000000 - AndroidTargetDevice: 3 + templatePackageId: + templateDefaultScene: + AndroidTargetArchitectures: 1 AndroidSplashScreenScale: 0 androidSplashScreen: {fileID: 0} - AndroidKeystoreName: + AndroidKeystoreName: '{inproject}: ' AndroidKeyaliasName: + AndroidBuildApkPerCpuArchitecture: 0 AndroidTVCompatibility: 1 AndroidIsGame: 1 AndroidEnableTango: 0 androidEnableBanner: 1 androidUseLowAccuracyLocation: 0 + androidUseCustomKeystore: 0 m_AndroidBanners: - width: 320 height: 180 banner: {fileID: 0} androidGamepadSupportLevel: 0 + AndroidValidateAppBundleSize: 1 + AndroidAppBundleSizeToValidate: 150 resolutionDialogBanner: {fileID: 0} m_BuildTargetIcons: - m_BuildTarget: @@ -269,6 +287,7 @@ PlayerSettings: m_Width: 128 m_Height: 128 m_Kind: 0 + m_BuildTargetPlatformIcons: [] m_BuildTargetBatching: [] m_BuildTargetGraphicsAPIs: - m_BuildTarget: AndroidPlayer @@ -279,7 +298,7 @@ PlayerSettings: m_Enabled: 0 m_Devices: - Oculus - - m_BuildTarget: Metro + - m_BuildTarget: Windows Store Apps m_Enabled: 0 m_Devices: [] - m_BuildTarget: N3DS @@ -323,15 +342,16 @@ PlayerSettings: - m_BuildTarget: XboxOne m_Enabled: 0 m_Devices: [] - - m_BuildTarget: iOS + - m_BuildTarget: iPhone m_Enabled: 0 m_Devices: [] - m_BuildTarget: tvOS m_Enabled: 0 m_Devices: [] - m_BuildTargetEnableVuforiaSettings: [] openGLRequireES31: 0 openGLRequireES31AEP: 0 + openGLRequireES32: 0 + vuforiaEnabled: 0 m_TemplateCustomTags: {} mobileMTRendering: Android: 1 @@ -344,25 +364,9 @@ PlayerSettings: m_EncodingQuality: 1 - m_BuildTarget: PS4 m_EncodingQuality: 1 - wiiUTitleID: 0005000011000000 - wiiUGroupID: 00010000 - wiiUCommonSaveSize: 4096 - wiiUAccountSaveSize: 2048 - wiiUOlvAccessKey: 0 - wiiUTinCode: 0 - wiiUJoinGameId: 0 - wiiUJoinGameModeMask: 0000000000000000 - wiiUCommonBossSize: 0 - wiiUAccountBossSize: 0 - wiiUAddOnUniqueIDs: [] - wiiUMainThreadStackSize: 3072 - wiiULoaderThreadStackSize: 1024 - wiiUSystemHeapSize: 128 - wiiUTVStartupScreen: {fileID: 0} - wiiUGamePadStartupScreen: {fileID: 0} - wiiUDrcBufferDisabled: 0 - wiiUProfilerLibPath: + m_BuildTargetGroupLightmapSettings: [] playModeTestRunnerEnabled: 0 + runPlayModeTestAsEditModeTest: 0 actionOnDotNetUnhandledException: 1 enableInternalProfiler: 0 logObjCUncaughtExceptions: 1 @@ -482,7 +486,12 @@ PlayerSettings: switchAllowsVideoCapturing: 1 switchAllowsRuntimeAddOnContentInstall: 0 switchDataLossConfirmation: 0 + switchUserAccountLockEnabled: 0 + switchSystemResourceMemory: 16777216 switchSupportedNpadStyles: 3 + switchNativeFsCacheSize: 32 + switchIsHoldTypeHorizontal: 0 + switchSupportedNpadCount: 8 switchSocketConfigEnabled: 0 switchTcpInitialSendBufferSize: 32 switchTcpInitialReceiveBufferSize: 64 @@ -532,12 +541,15 @@ PlayerSettings: ps4DownloadDataSize: 0 ps4GarlicHeapSize: 2048 ps4ProGarlicHeapSize: 2560 + playerPrefsMaxSize: 32768 ps4Passcode: 5PN2qmWqBlQ9wQj99nsQzldVI5ZuGXbE ps4pnSessions: 1 ps4pnPresence: 1 ps4pnFriends: 1 ps4pnGameCustomData: 1 playerPrefsSupport: 0 + enableApplicationExit: 0 + resetTempFolder: 1 restrictedAudioUsageRights: 0 ps4UseResolutionFallback: 0 ps4ReprojectionSupport: 0 @@ -561,56 +573,9 @@ PlayerSettings: ps4attribEyeToEyeDistanceSettingVR: 0 ps4IncludedModules: [] monoEnv: - psp2Splashimage: {fileID: 0} - psp2NPTrophyPackPath: - psp2NPSupportGBMorGJP: 0 - psp2NPAgeRating: 12 - psp2NPTitleDatPath: - psp2NPCommsID: - psp2NPCommunicationsID: - psp2NPCommsPassphrase: - psp2NPCommsSig: - psp2ParamSfxPath: - psp2ManualPath: - psp2LiveAreaGatePath: - psp2LiveAreaBackroundPath: - psp2LiveAreaPath: - psp2LiveAreaTrialPath: - psp2PatchChangeInfoPath: - psp2PatchOriginalPackage: - psp2PackagePassword: 5PN2qmWqBlQ9wQj99nsQzldVI5ZuGXbE - psp2KeystoneFile: - psp2MemoryExpansionMode: 0 - psp2DRMType: 0 - psp2StorageType: 0 - psp2MediaCapacity: 0 - psp2DLCConfigPath: - psp2ThumbnailPath: - psp2BackgroundPath: - psp2SoundPath: - psp2TrophyCommId: - psp2TrophyPackagePath: - psp2PackagedResourcesPath: - psp2SaveDataQuota: 10240 - psp2ParentalLevel: 1 - psp2ShortTitle: Not Set - psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF - psp2Category: 0 - psp2MasterVersion: 01.00 - psp2AppVersion: 01.00 - psp2TVBootMode: 0 - psp2EnterButtonAssignment: 2 - psp2TVDisableEmu: 0 - psp2AllowTwitterDialog: 1 - psp2Upgradable: 0 - psp2HealthWarning: 0 - psp2UseLibLocation: 0 - psp2InfoBarOnStartup: 0 - psp2InfoBarColor: 0 - psp2ScriptOptimizationLevel: 0 - psmSplashimage: {fileID: 0} splashScreenBackgroundSourceLandscape: {fileID: 0} splashScreenBackgroundSourcePortrait: {fileID: 0} + blurSplashScreenBackground: 1 spritePackerPolicy: webGLMemorySize: 256 webGLExceptionSupport: 0 @@ -622,21 +587,28 @@ PlayerSettings: webGLTemplate: APPLICATION:Default webGLAnalyzeBuildSize: 0 webGLUseEmbeddedResources: 0 - webGLUseWasm: 0 webGLCompressionFormat: 1 + webGLLinkerTarget: 1 + webGLThreadsSupport: 0 + webGLWasmStreaming: 0 scriptingDefineSymbols: 1: platformArchitecture: - iOS: 0 + iPhone: 0 scriptingBackend: Android: 1 Standalone: 0 WebGL: 1 - iOS: 1 + iPhone: 1 + il2cppCompilerConfiguration: {} + managedStrippingLevel: {} incrementalIl2cppBuild: - iOS: 0 + iPhone: 0 + allowUnsafeCode: 0 additionalIl2CppArgs: - scriptingRuntimeVersion: 0 + scriptingRuntimeVersion: 1 + gcIncremental: 0 + gcWBarrierValidation: 0 apiCompatibilityLevelPerPlatform: {} m_RenderingPath: 1 m_MobileRenderingPath: 1 @@ -650,40 +622,22 @@ PlayerSettings: metroApplicationDescription: UnityPlayground wsaImages: {} metroTileShortName: - metroCommandLineArgsFile: metroTileShowName: 0 metroMediumTileShowName: 0 metroLargeTileShowName: 0 metroWideTileShowName: 0 + metroSupportStreamingInstall: 0 + metroLastRequiredScene: 0 metroDefaultTileSize: 1 metroTileForegroundText: 1 metroTileBackgroundColor: {r: 0, g: 0, b: 0, a: 1} metroSplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1} metroSplashScreenUseBackgroundColor: 0 platformCapabilities: {} + metroTargetDeviceFamilies: {} metroFTAName: metroFTAFileTypes: [] metroProtocolName: - metroCompilationOverrides: 1 - tizenProductDescription: - tizenProductURL: - tizenSigningProfileName: - tizenGPSPermissions: 0 - tizenMicrophonePermissions: 0 - tizenDeploymentTarget: - tizenDeploymentTargetType: -1579033 - tizenMinOSVersion: 1 - n3dsUseExtSaveData: 0 - n3dsCompressStaticMem: 1 - n3dsExtSaveDataNumber: 0x12345 - n3dsStackSize: 131072 - n3dsTargetPlatform: 2 - n3dsRegion: 7 - n3dsMediaSize: 0 - n3dsLogoStyle: 3 - n3dsTitle: GameName - n3dsProductCode: - n3dsApplicationId: 0xFF3FF XboxOneProductId: XboxOneUpdateKey: XboxOneSandboxId: @@ -693,6 +647,7 @@ PlayerSettings: XboxOneGameOsOverridePath: XboxOnePackagingOverridePath: XboxOneAppManifestOverridePath: + XboxOneVersion: 1.0.0.0 XboxOnePackageEncryption: 0 XboxOnePackageUpdateGranularity: 2 XboxOneDescription: @@ -707,7 +662,8 @@ PlayerSettings: XboxOneAllowedProductIds: [] XboxOnePersistentLocalStorageSize: 0 XboxOneXTitleMemory: 8 - xboxOneScriptCompiler: 0 + xboxOneScriptCompiler: 1 + XboxOneOverrideIdentityName: vrEditorSettings: daydream: daydreamIconForeground: {fileID: 0} @@ -722,11 +678,30 @@ PlayerSettings: Purchasing: 0 UNet: 0 Unity_Ads: 0 + luminIcon: + m_Name: + m_ModelFolderPath: + m_PortalFolderPath: + luminCert: + m_CertPath: + m_SignPackage: 1 + luminIsChannelApp: 0 + luminVersion: + m_VersionCode: 1 + m_VersionName: facebookSdkVersion: 7.9.1 - apiCompatibilityLevel: 2 + facebookAppId: + facebookCookies: 1 + facebookLogging: 1 + facebookStatus: 1 + facebookXfbml: 0 + facebookFrictionlessRequests: 1 + apiCompatibilityLevel: 6 cloudProjectId: + framebufferDepthMemorylessMode: 0 projectName: organizationId: cloudEnabled: 0 enableNativePlatformBackendsForNewInputSystem: 0 disableOldInputManagerSupport: 0 + legacyClampBlendShapeWeights: 1 diff --git a/Unity/ProjectSettings/ProjectVersion.txt b/Unity/ProjectSettings/ProjectVersion.txt index 0498f4d..7e64146 100644 --- a/Unity/ProjectSettings/ProjectVersion.txt +++ b/Unity/ProjectSettings/ProjectVersion.txt @@ -1 +1,2 @@ -m_EditorVersion: 2018.2.0f2 +m_EditorVersion: 2019.2.0f1 +m_EditorVersionWithRevision: 2019.2.0f1 (20c1667945cf) diff --git a/Unity/ProjectSettings/UnityConnectSettings.asset b/Unity/ProjectSettings/UnityConnectSettings.asset index 1cc5485..c3ae9a0 100644 --- a/Unity/ProjectSettings/UnityConnectSettings.asset +++ b/Unity/ProjectSettings/UnityConnectSettings.asset @@ -3,29 +3,29 @@ --- !u!310 &1 UnityConnectSettings: m_ObjectHideFlags: 0 - m_Enabled: 0 + serializedVersion: 1 + m_Enabled: 1 m_TestMode: 0 - m_TestEventUrl: - m_TestConfigUrl: + m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events + m_EventUrl: https://cdp.cloud.unity3d.com/v1/events + m_ConfigUrl: https://config.uca.cloud.unity3d.com m_TestInitMode: 0 CrashReportingSettings: - m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes + m_EventUrl: https://perf-events.cloud.unity3d.com m_Enabled: 0 + m_LogBufferSize: 10 m_CaptureEditorExceptions: 1 UnityPurchasingSettings: m_Enabled: 0 m_TestMode: 0 UnityAnalyticsSettings: m_Enabled: 0 - m_InitializeOnStartup: 1 m_TestMode: 0 - m_TestEventUrl: - m_TestConfigUrl: + m_InitializeOnStartup: 1 UnityAdsSettings: m_Enabled: 0 m_InitializeOnStartup: 1 m_TestMode: 0 - m_EnabledPlatforms: 4294967295 m_IosGameId: m_AndroidGameId: m_GameIds: {} diff --git a/Unity/ProjectSettings/VFXManager.asset b/Unity/ProjectSettings/VFXManager.asset new file mode 100644 index 0000000..6e0eaca --- /dev/null +++ b/Unity/ProjectSettings/VFXManager.asset @@ -0,0 +1,11 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!937362698 &1 +VFXManager: + m_ObjectHideFlags: 0 + m_IndirectShader: {fileID: 0} + m_CopyBufferShader: {fileID: 0} + m_SortShader: {fileID: 0} + m_RenderPipeSettingsPath: + m_FixedTimeStep: 0.016666668 + m_MaxDeltaTime: 0.05 diff --git a/Unity/ProjectSettings/XRSettings.asset b/Unity/ProjectSettings/XRSettings.asset new file mode 100644 index 0000000..482590c --- /dev/null +++ b/Unity/ProjectSettings/XRSettings.asset @@ -0,0 +1,10 @@ +{ + "m_SettingKeys": [ + "VR Device Disabled", + "VR Device User Alert" + ], + "m_SettingValues": [ + "False", + "False" + ] +} \ No newline at end of file From 5785e672b7e39448cbef9abfa425919add6969d0 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Thu, 8 Aug 2019 22:37:56 -0700 Subject: [PATCH 73/95] Use IL2CPP in standalone builds --- Unity/ProjectSettings/ProjectSettings.asset | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unity/ProjectSettings/ProjectSettings.asset b/Unity/ProjectSettings/ProjectSettings.asset index d724f15..8602e2b 100644 --- a/Unity/ProjectSettings/ProjectSettings.asset +++ b/Unity/ProjectSettings/ProjectSettings.asset @@ -597,7 +597,7 @@ PlayerSettings: iPhone: 0 scriptingBackend: Android: 1 - Standalone: 0 + Standalone: 1 WebGL: 1 iPhone: 1 il2cppCompilerConfiguration: {} From 7f61e75a460358b0cfc1b7f1c931f45204a33697 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Thu, 8 Aug 2019 22:39:19 -0700 Subject: [PATCH 74/95] Omit type parameters in C++ constructor and destructor declarations. --- .../Assets/CppSource/NativeScript/Bindings.h | 270 +++++++++--------- .../NativeScript/Editor/GenerateBindings.cs | 15 - 2 files changed, 135 insertions(+), 150 deletions(-) diff --git a/Unity/Assets/CppSource/NativeScript/Bindings.h b/Unity/Assets/CppSource/NativeScript/Bindings.h index 6835b61..093dc3b 100644 --- a/Unity/Assets/CppSource/NativeScript/Bindings.h +++ b/Unity/Assets/CppSource/NativeScript/Bindings.h @@ -736,11 +736,11 @@ namespace System { template<> struct IEquatable_1 : virtual System::Object { - IEquatable_1(decltype(nullptr)); - IEquatable_1(Plugin::InternalUse, int32_t handle); - IEquatable_1(const IEquatable_1& other); - IEquatable_1(IEquatable_1&& other); - virtual ~IEquatable_1(); + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); IEquatable_1& operator=(const IEquatable_1& other); IEquatable_1& operator=(decltype(nullptr)); IEquatable_1& operator=(IEquatable_1&& other); @@ -753,11 +753,11 @@ namespace System { template<> struct IEquatable_1 : virtual System::Object { - IEquatable_1(decltype(nullptr)); - IEquatable_1(Plugin::InternalUse, int32_t handle); - IEquatable_1(const IEquatable_1& other); - IEquatable_1(IEquatable_1&& other); - virtual ~IEquatable_1(); + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); IEquatable_1& operator=(const IEquatable_1& other); IEquatable_1& operator=(decltype(nullptr)); IEquatable_1& operator=(IEquatable_1&& other); @@ -770,11 +770,11 @@ namespace System { template<> struct IEquatable_1 : virtual System::Object { - IEquatable_1(decltype(nullptr)); - IEquatable_1(Plugin::InternalUse, int32_t handle); - IEquatable_1(const IEquatable_1& other); - IEquatable_1(IEquatable_1&& other); - virtual ~IEquatable_1(); + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); IEquatable_1& operator=(const IEquatable_1& other); IEquatable_1& operator=(decltype(nullptr)); IEquatable_1& operator=(IEquatable_1&& other); @@ -787,11 +787,11 @@ namespace System { template<> struct IEquatable_1 : virtual System::Object { - IEquatable_1(decltype(nullptr)); - IEquatable_1(Plugin::InternalUse, int32_t handle); - IEquatable_1(const IEquatable_1& other); - IEquatable_1(IEquatable_1&& other); - virtual ~IEquatable_1(); + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); IEquatable_1& operator=(const IEquatable_1& other); IEquatable_1& operator=(decltype(nullptr)); IEquatable_1& operator=(IEquatable_1&& other); @@ -804,11 +804,11 @@ namespace System { template<> struct IEquatable_1 : virtual System::Object { - IEquatable_1(decltype(nullptr)); - IEquatable_1(Plugin::InternalUse, int32_t handle); - IEquatable_1(const IEquatable_1& other); - IEquatable_1(IEquatable_1&& other); - virtual ~IEquatable_1(); + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); IEquatable_1& operator=(const IEquatable_1& other); IEquatable_1& operator=(decltype(nullptr)); IEquatable_1& operator=(IEquatable_1&& other); @@ -821,11 +821,11 @@ namespace System { template<> struct IEquatable_1 : virtual System::Object { - IEquatable_1(decltype(nullptr)); - IEquatable_1(Plugin::InternalUse, int32_t handle); - IEquatable_1(const IEquatable_1& other); - IEquatable_1(IEquatable_1&& other); - virtual ~IEquatable_1(); + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); IEquatable_1& operator=(const IEquatable_1& other); IEquatable_1& operator=(decltype(nullptr)); IEquatable_1& operator=(IEquatable_1&& other); @@ -838,11 +838,11 @@ namespace System { template<> struct IEquatable_1 : virtual System::Object { - IEquatable_1(decltype(nullptr)); - IEquatable_1(Plugin::InternalUse, int32_t handle); - IEquatable_1(const IEquatable_1& other); - IEquatable_1(IEquatable_1&& other); - virtual ~IEquatable_1(); + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); IEquatable_1& operator=(const IEquatable_1& other); IEquatable_1& operator=(decltype(nullptr)); IEquatable_1& operator=(IEquatable_1&& other); @@ -855,11 +855,11 @@ namespace System { template<> struct IEquatable_1 : virtual System::Object { - IEquatable_1(decltype(nullptr)); - IEquatable_1(Plugin::InternalUse, int32_t handle); - IEquatable_1(const IEquatable_1& other); - IEquatable_1(IEquatable_1&& other); - virtual ~IEquatable_1(); + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); IEquatable_1& operator=(const IEquatable_1& other); IEquatable_1& operator=(decltype(nullptr)); IEquatable_1& operator=(IEquatable_1&& other); @@ -872,11 +872,11 @@ namespace System { template<> struct IEquatable_1 : virtual System::Object { - IEquatable_1(decltype(nullptr)); - IEquatable_1(Plugin::InternalUse, int32_t handle); - IEquatable_1(const IEquatable_1& other); - IEquatable_1(IEquatable_1&& other); - virtual ~IEquatable_1(); + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); IEquatable_1& operator=(const IEquatable_1& other); IEquatable_1& operator=(decltype(nullptr)); IEquatable_1& operator=(IEquatable_1&& other); @@ -889,11 +889,11 @@ namespace System { template<> struct IEquatable_1 : virtual System::Object { - IEquatable_1(decltype(nullptr)); - IEquatable_1(Plugin::InternalUse, int32_t handle); - IEquatable_1(const IEquatable_1& other); - IEquatable_1(IEquatable_1&& other); - virtual ~IEquatable_1(); + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); IEquatable_1& operator=(const IEquatable_1& other); IEquatable_1& operator=(decltype(nullptr)); IEquatable_1& operator=(IEquatable_1&& other); @@ -906,11 +906,11 @@ namespace System { template<> struct IEquatable_1 : virtual System::Object { - IEquatable_1(decltype(nullptr)); - IEquatable_1(Plugin::InternalUse, int32_t handle); - IEquatable_1(const IEquatable_1& other); - IEquatable_1(IEquatable_1&& other); - virtual ~IEquatable_1(); + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); IEquatable_1& operator=(const IEquatable_1& other); IEquatable_1& operator=(decltype(nullptr)); IEquatable_1& operator=(IEquatable_1&& other); @@ -923,11 +923,11 @@ namespace System { template<> struct IEquatable_1 : virtual System::Object { - IEquatable_1(decltype(nullptr)); - IEquatable_1(Plugin::InternalUse, int32_t handle); - IEquatable_1(const IEquatable_1& other); - IEquatable_1(IEquatable_1&& other); - virtual ~IEquatable_1(); + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); IEquatable_1& operator=(const IEquatable_1& other); IEquatable_1& operator=(decltype(nullptr)); IEquatable_1& operator=(IEquatable_1&& other); @@ -940,11 +940,11 @@ namespace System { template<> struct IEquatable_1 : virtual System::Object { - IEquatable_1(decltype(nullptr)); - IEquatable_1(Plugin::InternalUse, int32_t handle); - IEquatable_1(const IEquatable_1& other); - IEquatable_1(IEquatable_1&& other); - virtual ~IEquatable_1(); + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); IEquatable_1& operator=(const IEquatable_1& other); IEquatable_1& operator=(decltype(nullptr)); IEquatable_1& operator=(IEquatable_1&& other); @@ -957,11 +957,11 @@ namespace System { template<> struct IEquatable_1 : virtual System::Object { - IEquatable_1(decltype(nullptr)); - IEquatable_1(Plugin::InternalUse, int32_t handle); - IEquatable_1(const IEquatable_1& other); - IEquatable_1(IEquatable_1&& other); - virtual ~IEquatable_1(); + IEquatable_1(decltype(nullptr)); + IEquatable_1(Plugin::InternalUse, int32_t handle); + IEquatable_1(const IEquatable_1& other); + IEquatable_1(IEquatable_1&& other); + virtual ~IEquatable_1(); IEquatable_1& operator=(const IEquatable_1& other); IEquatable_1& operator=(decltype(nullptr)); IEquatable_1& operator=(IEquatable_1&& other); @@ -974,11 +974,11 @@ namespace System { template<> struct IComparable_1 : virtual System::Object { - IComparable_1(decltype(nullptr)); - IComparable_1(Plugin::InternalUse, int32_t handle); - IComparable_1(const IComparable_1& other); - IComparable_1(IComparable_1&& other); - virtual ~IComparable_1(); + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); IComparable_1& operator=(const IComparable_1& other); IComparable_1& operator=(decltype(nullptr)); IComparable_1& operator=(IComparable_1&& other); @@ -991,11 +991,11 @@ namespace System { template<> struct IComparable_1 : virtual System::Object { - IComparable_1(decltype(nullptr)); - IComparable_1(Plugin::InternalUse, int32_t handle); - IComparable_1(const IComparable_1& other); - IComparable_1(IComparable_1&& other); - virtual ~IComparable_1(); + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); IComparable_1& operator=(const IComparable_1& other); IComparable_1& operator=(decltype(nullptr)); IComparable_1& operator=(IComparable_1&& other); @@ -1008,11 +1008,11 @@ namespace System { template<> struct IComparable_1 : virtual System::Object { - IComparable_1(decltype(nullptr)); - IComparable_1(Plugin::InternalUse, int32_t handle); - IComparable_1(const IComparable_1& other); - IComparable_1(IComparable_1&& other); - virtual ~IComparable_1(); + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); IComparable_1& operator=(const IComparable_1& other); IComparable_1& operator=(decltype(nullptr)); IComparable_1& operator=(IComparable_1&& other); @@ -1025,11 +1025,11 @@ namespace System { template<> struct IComparable_1 : virtual System::Object { - IComparable_1(decltype(nullptr)); - IComparable_1(Plugin::InternalUse, int32_t handle); - IComparable_1(const IComparable_1& other); - IComparable_1(IComparable_1&& other); - virtual ~IComparable_1(); + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); IComparable_1& operator=(const IComparable_1& other); IComparable_1& operator=(decltype(nullptr)); IComparable_1& operator=(IComparable_1&& other); @@ -1042,11 +1042,11 @@ namespace System { template<> struct IComparable_1 : virtual System::Object { - IComparable_1(decltype(nullptr)); - IComparable_1(Plugin::InternalUse, int32_t handle); - IComparable_1(const IComparable_1& other); - IComparable_1(IComparable_1&& other); - virtual ~IComparable_1(); + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); IComparable_1& operator=(const IComparable_1& other); IComparable_1& operator=(decltype(nullptr)); IComparable_1& operator=(IComparable_1&& other); @@ -1059,11 +1059,11 @@ namespace System { template<> struct IComparable_1 : virtual System::Object { - IComparable_1(decltype(nullptr)); - IComparable_1(Plugin::InternalUse, int32_t handle); - IComparable_1(const IComparable_1& other); - IComparable_1(IComparable_1&& other); - virtual ~IComparable_1(); + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); IComparable_1& operator=(const IComparable_1& other); IComparable_1& operator=(decltype(nullptr)); IComparable_1& operator=(IComparable_1&& other); @@ -1076,11 +1076,11 @@ namespace System { template<> struct IComparable_1 : virtual System::Object { - IComparable_1(decltype(nullptr)); - IComparable_1(Plugin::InternalUse, int32_t handle); - IComparable_1(const IComparable_1& other); - IComparable_1(IComparable_1&& other); - virtual ~IComparable_1(); + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); IComparable_1& operator=(const IComparable_1& other); IComparable_1& operator=(decltype(nullptr)); IComparable_1& operator=(IComparable_1&& other); @@ -1093,11 +1093,11 @@ namespace System { template<> struct IComparable_1 : virtual System::Object { - IComparable_1(decltype(nullptr)); - IComparable_1(Plugin::InternalUse, int32_t handle); - IComparable_1(const IComparable_1& other); - IComparable_1(IComparable_1&& other); - virtual ~IComparable_1(); + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); IComparable_1& operator=(const IComparable_1& other); IComparable_1& operator=(decltype(nullptr)); IComparable_1& operator=(IComparable_1&& other); @@ -1110,11 +1110,11 @@ namespace System { template<> struct IComparable_1 : virtual System::Object { - IComparable_1(decltype(nullptr)); - IComparable_1(Plugin::InternalUse, int32_t handle); - IComparable_1(const IComparable_1& other); - IComparable_1(IComparable_1&& other); - virtual ~IComparable_1(); + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); IComparable_1& operator=(const IComparable_1& other); IComparable_1& operator=(decltype(nullptr)); IComparable_1& operator=(IComparable_1&& other); @@ -1127,11 +1127,11 @@ namespace System { template<> struct IComparable_1 : virtual System::Object { - IComparable_1(decltype(nullptr)); - IComparable_1(Plugin::InternalUse, int32_t handle); - IComparable_1(const IComparable_1& other); - IComparable_1(IComparable_1&& other); - virtual ~IComparable_1(); + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); IComparable_1& operator=(const IComparable_1& other); IComparable_1& operator=(decltype(nullptr)); IComparable_1& operator=(IComparable_1&& other); @@ -1144,11 +1144,11 @@ namespace System { template<> struct IComparable_1 : virtual System::Object { - IComparable_1(decltype(nullptr)); - IComparable_1(Plugin::InternalUse, int32_t handle); - IComparable_1(const IComparable_1& other); - IComparable_1(IComparable_1&& other); - virtual ~IComparable_1(); + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); IComparable_1& operator=(const IComparable_1& other); IComparable_1& operator=(decltype(nullptr)); IComparable_1& operator=(IComparable_1&& other); @@ -1161,11 +1161,11 @@ namespace System { template<> struct IComparable_1 : virtual System::Object { - IComparable_1(decltype(nullptr)); - IComparable_1(Plugin::InternalUse, int32_t handle); - IComparable_1(const IComparable_1& other); - IComparable_1(IComparable_1&& other); - virtual ~IComparable_1(); + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); IComparable_1& operator=(const IComparable_1& other); IComparable_1& operator=(decltype(nullptr)); IComparable_1& operator=(IComparable_1&& other); @@ -1178,11 +1178,11 @@ namespace System { template<> struct IComparable_1 : virtual System::Object { - IComparable_1(decltype(nullptr)); - IComparable_1(Plugin::InternalUse, int32_t handle); - IComparable_1(const IComparable_1& other); - IComparable_1(IComparable_1&& other); - virtual ~IComparable_1(); + IComparable_1(decltype(nullptr)); + IComparable_1(Plugin::InternalUse, int32_t handle); + IComparable_1(const IComparable_1& other); + IComparable_1(IComparable_1&& other); + virtual ~IComparable_1(); IComparable_1& operator=(const IComparable_1& other); IComparable_1& operator=(decltype(nullptr)); IComparable_1& operator=(IComparable_1&& other); diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 0855981..b3bdfd5 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -11327,9 +11327,6 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeName( typeTypeName, output); - AppendCppTypeParameters( - typeParams, - output); output.Append("(decltype(nullptr));\n"); // Constructor from handle @@ -11337,9 +11334,6 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeName( typeTypeName, output); - AppendCppTypeParameters( - typeParams, - output); output.Append( "(Plugin::InternalUse, int32_t handle);\n"); @@ -11348,9 +11342,6 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeName( typeTypeName, output); - AppendCppTypeParameters( - typeParams, - output); output.Append("(const "); AppendCppTypeName( typeTypeName, @@ -11365,9 +11356,6 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeName( typeTypeName, output); - AppendCppTypeParameters( - typeParams, - output); output.Append('('); AppendCppTypeName( typeTypeName, @@ -11383,9 +11371,6 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeName( typeTypeName, output); - AppendCppTypeParameters( - typeParams, - output); output.Append("();\n"); // Assignment operator to same type From efcc9491a1d9bf1296b315a2263eb8ddcade56f9 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Thu, 8 Aug 2019 22:40:33 -0700 Subject: [PATCH 75/95] Use Cdecl calling convention for all [DllImport] Add [UnmanagedFunctionPointer] to all binding function delegates with Cdecl calling convention --- Unity/Assets/NativeScript/Bindings.cs | 89 ++++++++++++++++--- .../NativeScript/Editor/GenerateBindings.cs | 4 +- 2 files changed, 80 insertions(+), 13 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index bb6745d..07fbb24 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -327,40 +327,46 @@ enum InitMode : byte // Handle to the C++ DLL static IntPtr libraryHandle; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate void InitDelegate( IntPtr memory, int memorySize, InitMode initMode); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void SetCsharpExceptionDelegate(int handle); /*BEGIN CPP DELEGATES*/ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate int NewBaseBallScriptDelegateType(int param0); public static NewBaseBallScriptDelegateType NewBaseBallScript; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void DestroyBaseBallScriptDelegateType(int param0); public static DestroyBaseBallScriptDelegateType DestroyBaseBallScript; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void MyGameAbstractBaseBallScriptUpdateDelegateType(int thisHandle); public static MyGameAbstractBaseBallScriptUpdateDelegateType MyGameAbstractBaseBallScriptUpdate; + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate void SetCsharpExceptionSystemNullReferenceExceptionDelegateType(int param0); public static SetCsharpExceptionSystemNullReferenceExceptionDelegateType SetCsharpExceptionSystemNullReferenceException; /*END CPP DELEGATES*/ #endif #if UNITY_EDITOR_OSX || UNITY_EDITOR_LINUX - [DllImport("__Internal")] + [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr dlopen( string path, int flag); - [DllImport("__Internal")] + [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] static extern IntPtr dlsym( IntPtr handle, string symbolName); - [DllImport("__Internal")] + [DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] static extern int dlclose( IntPtr handle); @@ -395,16 +401,16 @@ static T GetDelegate( typeof(T)) as T; } #elif UNITY_EDITOR_WIN - [DllImport("kernel32")] + [DllImport("kernel32", SetLastError=true, CharSet = CharSet.Ansi)] static extern IntPtr LoadLibrary( string path); - [DllImport("kernel32")] + [DllImport("kernel32", CharSet=CharSet.Ansi, ExactSpelling=true, SetLastError=true)] static extern IntPtr GetProcAddress( IntPtr libraryHandle, string symbolName); - [DllImport("kernel32")] + [DllImport("kernel32.dll", SetLastError=true)] static extern bool FreeLibrary( IntPtr libraryHandle); @@ -437,86 +443,145 @@ static T GetDelegate( typeof(T)) as T; } #else - [DllImport(PLUGIN_NAME)] + [DllImport(PLUGIN_NAME, CallingConvention = CallingConvention.Cdecl)] static extern void Init( IntPtr memory, int memorySize, InitMode initMode); - [DllImport(PLUGIN_NAME)] + [DllImport(PLUGIN_NAME, CallingConvention = CallingConvention.Cdecl)] static extern void SetCsharpException(int handle); /*BEGIN IMPORTS*/ - [DllImport(PLUGIN_NAME)] + [DllImport(PLUGIN_NAME, CallingConvention = CallingConvention.Cdecl)] public static extern int NewBaseBallScript(int thisHandle); - [DllImport(PLUGIN_NAME)] + [DllImport(PLUGIN_NAME, CallingConvention = CallingConvention.Cdecl)] public static extern void DestroyBaseBallScript(int thisHandle); - [DllImport(PLUGIN_NAME)] + [DllImport(PLUGIN_NAME, CallingConvention = CallingConvention.Cdecl)] public static extern void MyGameAbstractBaseBallScriptUpdate(int thisHandle); - [DllImport(PLUGIN_NAME)] + [DllImport(PLUGIN_NAME, CallingConvention = CallingConvention.Cdecl)] public static extern void SetCsharpExceptionSystemNullReferenceException(int thisHandle); /*END IMPORTS*/ #endif + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate void ReleaseObjectDelegateType(int handle); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int StringNewDelegateType(string chars); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate void SetExceptionDelegateType(int handle); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int ArrayGetLengthDelegateType(int handle); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int EnumerableGetEnumeratorDelegateType(int handle); /*BEGIN DELEGATE TYPES*/ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate void ReleaseSystemDecimalDelegateType(int handle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int SystemDecimalConstructorSystemDoubleDelegateType(double value); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int SystemDecimalConstructorSystemUInt64DelegateType(ulong value); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxDecimalDelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int UnboxDecimalDelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate UnityEngine.Vector3 UnityEngineVector3ConstructorSystemSingle_SystemSingle_SystemSingleDelegateType(float x, float y, float z); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate UnityEngine.Vector3 UnityEngineVector3Methodop_AdditionUnityEngineVector3_UnityEngineVector3DelegateType(ref UnityEngine.Vector3 a, ref UnityEngine.Vector3 b); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxVector3DelegateType(ref UnityEngine.Vector3 val); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate UnityEngine.Vector3 UnboxVector3DelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int UnityEngineObjectPropertyGetNameDelegateType(int thisHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate void UnityEngineObjectPropertySetNameDelegateType(int thisHandle, int valueHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int UnityEngineComponentPropertyGetTransformDelegateType(int thisHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate UnityEngine.Vector3 UnityEngineTransformPropertyGetPositionDelegateType(int thisHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate void UnityEngineTransformPropertySetPositionDelegateType(int thisHandle, ref UnityEngine.Vector3 value); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int SystemCollectionsIEnumeratorPropertyGetCurrentDelegateType(int thisHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate bool SystemCollectionsIEnumeratorMethodMoveNextDelegateType(int thisHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int UnityEngineGameObjectMethodAddComponentMyGameBaseBallScriptDelegateType(int thisHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int UnityEngineGameObjectMethodCreatePrimitiveUnityEnginePrimitiveTypeDelegateType(UnityEngine.PrimitiveType type); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate void UnityEngineDebugMethodLogSystemObjectDelegateType(int messageHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int UnityEngineMonoBehaviourPropertyGetTransformDelegateType(int thisHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int SystemExceptionConstructorSystemStringDelegateType(int messageHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxPrimitiveTypeDelegateType(UnityEngine.PrimitiveType val); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate UnityEngine.PrimitiveType UnboxPrimitiveTypeDelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate float UnityEngineTimePropertyGetDeltaTimeDelegateType(); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate void BaseBallScriptConstructorDelegateType(int cppHandle, ref int handle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate void ReleaseBaseBallScriptDelegateType(int handle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxBooleanDelegateType(bool val); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate bool UnboxBooleanDelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxSByteDelegateType(sbyte val); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate sbyte UnboxSByteDelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxByteDelegateType(byte val); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate byte UnboxByteDelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxInt16DelegateType(short val); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate short UnboxInt16DelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxUInt16DelegateType(ushort val); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate ushort UnboxUInt16DelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxInt32DelegateType(int val); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int UnboxInt32DelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxUInt32DelegateType(uint val); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate uint UnboxUInt32DelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxInt64DelegateType(long val); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate long UnboxInt64DelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxUInt64DelegateType(ulong val); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate ulong UnboxUInt64DelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxCharDelegateType(char val); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate char UnboxCharDelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxSingleDelegateType(float val); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate float UnboxSingleDelegateType(int valHandle); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate int BoxDoubleDelegateType(double val); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] delegate double UnboxDoubleDelegateType(int valHandle); /*END DELEGATE TYPES*/ diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index b3bdfd5..bc971d4 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -10397,6 +10397,7 @@ static void AppendCsharpDelegate( TypeKind returnTypeKind, StringBuilder output) { + output.Append("\t\t[UnmanagedFunctionPointer(CallingConvention.Cdecl)]\n"); output.Append("\t\tpublic delegate "); if (returnType == typeof(void)) { @@ -10527,7 +10528,7 @@ static void AppendCsharpImport( StringBuilder output ) { - output.Append("\t\t[DllImport(PLUGIN_NAME)]\n"); + output.Append("\t\t[DllImport(PLUGIN_NAME, CallingConvention = CallingConvention.Cdecl)]\n"); output.Append("\t\tpublic static extern "); AppendCsharpTypeFullName(returnType, output); output.Append(' '); @@ -12044,6 +12045,7 @@ static void AppendCsharpDelegateType( ParameterInfo[] parameters, StringBuilder output) { + output.Append("\t\t[UnmanagedFunctionPointer(CallingConvention.Cdecl)]\n"); output.Append("\t\tdelegate "); // Return type From 74d7d4a93c1d63c029fdff3bb522da779a98e402 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 10 Aug 2019 17:49:51 -0700 Subject: [PATCH 76/95] Close the native library when the editor state changes back to edit mode rather than in OnApplicationQuit, which can be called before other MonoBehaviour messages like OnDestroy. --- Unity/Assets/NativeScript/BootScript.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Unity/Assets/NativeScript/BootScript.cs b/Unity/Assets/NativeScript/BootScript.cs index 9296ee7..74c8268 100644 --- a/Unity/Assets/NativeScript/BootScript.cs +++ b/Unity/Assets/NativeScript/BootScript.cs @@ -1,3 +1,5 @@ +using System; +using UnityEditor; using UnityEngine; namespace NativeScript @@ -25,6 +27,7 @@ public class BootScript : MonoBehaviour public float AutoReloadPollTime = 1.0f; private float lastAutoReloadPollTime; private Coroutine autoReloadCoroutine; + private Action onPlayModeStateChange; #endif void Start() @@ -34,6 +37,10 @@ void Start() #endif DontDestroyOnLoad(gameObject); Bindings.Open(MemorySize); +#if UNITY_EDITOR + onPlayModeStateChange = OnEditorStateChanged; + EditorApplication.playModeStateChanged += onPlayModeStateChange; +#endif } #if UNITY_EDITOR @@ -74,11 +81,15 @@ void Update() } } } -#endif - - void OnApplicationQuit() + + private void OnEditorStateChanged(PlayModeStateChange state) { - Bindings.Close(); + if (state == PlayModeStateChange.EnteredEditMode) + { + EditorApplication.playModeStateChanged -= onPlayModeStateChange; + Bindings.Close(); + } } +#endif } } \ No newline at end of file From b508933669b0c6de493996bce9d52470ba5b699c Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Fri, 23 Aug 2019 18:54:33 -0700 Subject: [PATCH 77/95] Fix issue #29 by returning primitive types in binding functions rather than struct types (e.g. int32_t instead of System::Int32). --- .../CppSource/NativeScript/Bindings.cpp | 44 +++++++++---------- .../NativeScript/Editor/GenerateBindings.cs | 4 ++ 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/Unity/Assets/CppSource/NativeScript/Bindings.cpp b/Unity/Assets/CppSource/NativeScript/Bindings.cpp index b8246ad..cd62a88 100644 --- a/Unity/Assets/CppSource/NativeScript/Bindings.cpp +++ b/Unity/Assets/CppSource/NativeScript/Bindings.cpp @@ -64,33 +64,33 @@ namespace Plugin int32_t (*SystemExceptionConstructorSystemString)(int32_t messageHandle); int32_t (*BoxPrimitiveType)(UnityEngine::PrimitiveType val); UnityEngine::PrimitiveType (*UnboxPrimitiveType)(int32_t valHandle); - System::Single (*UnityEngineTimePropertyGetDeltaTime)(); + float (*UnityEngineTimePropertyGetDeltaTime)(); void (*ReleaseBaseBallScript)(int32_t handle); void (*BaseBallScriptConstructor)(int32_t cppHandle, int32_t* handle); int32_t (*BoxBoolean)(uint32_t val); int32_t (*UnboxBoolean)(int32_t valHandle); int32_t (*BoxSByte)(int8_t val); - System::SByte (*UnboxSByte)(int32_t valHandle); + int8_t (*UnboxSByte)(int32_t valHandle); int32_t (*BoxByte)(uint8_t val); - System::Byte (*UnboxByte)(int32_t valHandle); + uint8_t (*UnboxByte)(int32_t valHandle); int32_t (*BoxInt16)(int16_t val); - System::Int16 (*UnboxInt16)(int32_t valHandle); + int16_t (*UnboxInt16)(int32_t valHandle); int32_t (*BoxUInt16)(uint16_t val); - System::UInt16 (*UnboxUInt16)(int32_t valHandle); + uint16_t (*UnboxUInt16)(int32_t valHandle); int32_t (*BoxInt32)(int32_t val); - System::Int32 (*UnboxInt32)(int32_t valHandle); + int32_t (*UnboxInt32)(int32_t valHandle); int32_t (*BoxUInt32)(uint32_t val); - System::UInt32 (*UnboxUInt32)(int32_t valHandle); + uint32_t (*UnboxUInt32)(int32_t valHandle); int32_t (*BoxInt64)(int64_t val); - System::Int64 (*UnboxInt64)(int32_t valHandle); + int64_t (*UnboxInt64)(int32_t valHandle); int32_t (*BoxUInt64)(uint64_t val); - System::UInt64 (*UnboxUInt64)(int32_t valHandle); + uint64_t (*UnboxUInt64)(int32_t valHandle); int32_t (*BoxChar)(uint16_t val); int16_t (*UnboxChar)(int32_t valHandle); int32_t (*BoxSingle)(float val); - System::Single (*UnboxSingle)(int32_t valHandle); + float (*UnboxSingle)(int32_t valHandle); int32_t (*BoxDouble)(double val); - System::Double (*UnboxDouble)(int32_t valHandle); + double (*UnboxDouble)(int32_t valHandle); /*END FUNCTION POINTERS*/ } @@ -6209,7 +6209,7 @@ DLLEXPORT void Init( curMemory += sizeof(Plugin::BoxPrimitiveType); Plugin::UnboxPrimitiveType = *(UnityEngine::PrimitiveType (**)(int32_t valHandle))curMemory; curMemory += sizeof(Plugin::UnboxPrimitiveType); - Plugin::UnityEngineTimePropertyGetDeltaTime = *(System::Single (**)())curMemory; + Plugin::UnityEngineTimePropertyGetDeltaTime = *(float (**)())curMemory; curMemory += sizeof(Plugin::UnityEngineTimePropertyGetDeltaTime); Plugin::ReleaseBaseBallScript = *(void (**)(int32_t handle))curMemory; curMemory += sizeof(Plugin::ReleaseBaseBallScript); @@ -6221,35 +6221,35 @@ DLLEXPORT void Init( curMemory += sizeof(Plugin::UnboxBoolean); Plugin::BoxSByte = *(int32_t (**)(int8_t val))curMemory; curMemory += sizeof(Plugin::BoxSByte); - Plugin::UnboxSByte = *(System::SByte (**)(int32_t valHandle))curMemory; + Plugin::UnboxSByte = *(int8_t (**)(int32_t valHandle))curMemory; curMemory += sizeof(Plugin::UnboxSByte); Plugin::BoxByte = *(int32_t (**)(uint8_t val))curMemory; curMemory += sizeof(Plugin::BoxByte); - Plugin::UnboxByte = *(System::Byte (**)(int32_t valHandle))curMemory; + Plugin::UnboxByte = *(uint8_t (**)(int32_t valHandle))curMemory; curMemory += sizeof(Plugin::UnboxByte); Plugin::BoxInt16 = *(int32_t (**)(int16_t val))curMemory; curMemory += sizeof(Plugin::BoxInt16); - Plugin::UnboxInt16 = *(System::Int16 (**)(int32_t valHandle))curMemory; + Plugin::UnboxInt16 = *(int16_t (**)(int32_t valHandle))curMemory; curMemory += sizeof(Plugin::UnboxInt16); Plugin::BoxUInt16 = *(int32_t (**)(uint16_t val))curMemory; curMemory += sizeof(Plugin::BoxUInt16); - Plugin::UnboxUInt16 = *(System::UInt16 (**)(int32_t valHandle))curMemory; + Plugin::UnboxUInt16 = *(uint16_t (**)(int32_t valHandle))curMemory; curMemory += sizeof(Plugin::UnboxUInt16); Plugin::BoxInt32 = *(int32_t (**)(int32_t val))curMemory; curMemory += sizeof(Plugin::BoxInt32); - Plugin::UnboxInt32 = *(System::Int32 (**)(int32_t valHandle))curMemory; + Plugin::UnboxInt32 = *(int32_t (**)(int32_t valHandle))curMemory; curMemory += sizeof(Plugin::UnboxInt32); Plugin::BoxUInt32 = *(int32_t (**)(uint32_t val))curMemory; curMemory += sizeof(Plugin::BoxUInt32); - Plugin::UnboxUInt32 = *(System::UInt32 (**)(int32_t valHandle))curMemory; + Plugin::UnboxUInt32 = *(uint32_t (**)(int32_t valHandle))curMemory; curMemory += sizeof(Plugin::UnboxUInt32); Plugin::BoxInt64 = *(int32_t (**)(int64_t val))curMemory; curMemory += sizeof(Plugin::BoxInt64); - Plugin::UnboxInt64 = *(System::Int64 (**)(int32_t valHandle))curMemory; + Plugin::UnboxInt64 = *(int64_t (**)(int32_t valHandle))curMemory; curMemory += sizeof(Plugin::UnboxInt64); Plugin::BoxUInt64 = *(int32_t (**)(uint64_t val))curMemory; curMemory += sizeof(Plugin::BoxUInt64); - Plugin::UnboxUInt64 = *(System::UInt64 (**)(int32_t valHandle))curMemory; + Plugin::UnboxUInt64 = *(uint64_t (**)(int32_t valHandle))curMemory; curMemory += sizeof(Plugin::UnboxUInt64); Plugin::BoxChar = *(int32_t (**)(uint16_t val))curMemory; curMemory += sizeof(Plugin::BoxChar); @@ -6257,11 +6257,11 @@ DLLEXPORT void Init( curMemory += sizeof(Plugin::UnboxChar); Plugin::BoxSingle = *(int32_t (**)(float val))curMemory; curMemory += sizeof(Plugin::BoxSingle); - Plugin::UnboxSingle = *(System::Single (**)(int32_t valHandle))curMemory; + Plugin::UnboxSingle = *(float (**)(int32_t valHandle))curMemory; curMemory += sizeof(Plugin::UnboxSingle); Plugin::BoxDouble = *(int32_t (**)(double val))curMemory; curMemory += sizeof(Plugin::BoxDouble); - Plugin::UnboxDouble = *(System::Double (**)(int32_t valHandle))curMemory; + Plugin::UnboxDouble = *(double (**)(int32_t valHandle))curMemory; curMemory += sizeof(Plugin::UnboxDouble); /*END INIT BODY PARAMETER READS*/ diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index bc971d4..7e56758 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -12918,6 +12918,10 @@ static void AppendCppFunctionPointer( // C linkage requires us to use primitive types output.Append("int16_t"); } + else if (returnType.IsPrimitive) + { + AppendCppPrimitiveTypeName(returnType, output); + } else if (IsFullValueType(returnType)) { AppendCppTypeFullName(returnType, output); From 2a28a2466ed7da1e5857959110d77eee89249a7b Mon Sep 17 00:00:00 2001 From: = Date: Mon, 13 Jan 2020 22:01:55 -0600 Subject: [PATCH 78/95] [#51] Fix performance issue with Object Store When BaseMaxSimultaneous was set to a large number the object-store was spending to much time finding the handle. This was fixed using a dictionary where the keys have the objects full hash. --- Unity/Assets/NativeScript/Bindings.cs | 85 +++++++-------------------- 1 file changed, 20 insertions(+), 65 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 07fbb24..4e694ee 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -4,6 +4,7 @@ using System.Collections; using System.IO; using System.Runtime.InteropServices; +using System.Collections.Generic; using UnityEngine; @@ -24,19 +25,13 @@ public static class Bindings // Holds objects and provides handles to them in the form of ints public static class ObjectStore { + static Dictionary handleLookupByHash; + static Dictionary hashLookupByHandle; + static Stack freeHandleStack; + // 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; @@ -49,19 +44,13 @@ public static void Init(int maxObjects) 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; + freeHandleStack.Push(handle); } - nextHandleIndex = maxObjects - 1; - - // Initialize the hash table - keys = new object[maxObjects]; - values = new int[maxObjects]; } public static int Store(object obj) @@ -75,27 +64,15 @@ public static int Store(object obj) lock (objects) { // Pop a handle off the stack - int handle = handles[nextHandleIndex]; - nextHandleIndex--; + int handle = freeHandleStack.Pop(); // 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); + uint hash = (uint)obj.GetHashCode(); + handleLookupByHash.Add(hash, handle); + hashLookupByHandle.Add(handle, hash); return handle; } @@ -108,6 +85,7 @@ public static object Get(int handle) public static int GetHandle(object obj) { + // Null is always zero if (object.ReferenceEquals(obj, null)) { @@ -116,19 +94,12 @@ public static int GetHandle(object obj) lock (objects) { - // Look up the object in the hash table - int initialIndex = (int)( - ((uint)obj.GetHashCode()) % maxObjects); - int index = initialIndex; - do + // Look up the handle in the hash table + uint hash = (uint)obj.GetHashCode(); + if (handleLookupByHash.ContainsKey(hash)) { - if (object.ReferenceEquals(keys[index], obj)) - { - return values[index]; - } - index = (index + 1) % maxObjects; + return handleLookupByHash[hash]; } - while (index != initialIndex); } // Object not found @@ -150,28 +121,12 @@ public static object Remove(int handle) objects[handle] = null; // Push the handle onto the stack - nextHandleIndex++; - handles[nextHandleIndex] = handle; + freeHandleStack.Push(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); + // Remove the object from the hash dictionary's + var hash = hashLookupByHandle[handle]; + handleLookupByHash.Remove(hash); + hashLookupByHandle.Remove(handle); return obj; } From 42116abf8aac16be2df63c20f56aa0fb19a11b02 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 14 Jan 2020 00:50:14 -0600 Subject: [PATCH 79/95] [#51] add cache construction in the init method --- Unity/Assets/NativeScript/Bindings.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 4e694ee..8ea312b 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -38,6 +38,9 @@ public static class ObjectStore public static void Init(int maxObjects) { ObjectStore.maxObjects = maxObjects; + handleLookupByHash = new Dictionary (); + hashLookupByHandle = new Dictionary (); + freeHandleStack = new Stack (); // Initialize the objects as all null plus room for the // first to always be null. From afd3c8e2bdc992c4639eb42a475bf70aa95a6724 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 14 Jan 2020 23:48:48 -0600 Subject: [PATCH 80/95] [#51] Add collision handling for object store --- Unity/Assets/NativeScript/Bindings.cs | 73 ++++++++++++++++++++------- 1 file changed, 54 insertions(+), 19 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 8ea312b..3310650 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -25,9 +25,10 @@ public static class Bindings // Holds objects and provides handles to them in the form of ints public static class ObjectStore { - static Dictionary handleLookupByHash; + static Dictionary> handleBucketByHash; static Dictionary hashLookupByHandle; - static Stack freeHandleStack; + static HashSet hash; + static Stack handles; // Stored objects. The first is never used so 0 can be "null". static object[] objects; @@ -38,9 +39,9 @@ public static class ObjectStore public static void Init(int maxObjects) { ObjectStore.maxObjects = maxObjects; - handleLookupByHash = new Dictionary (); + handleBucketByHash = new Dictionary> (); hashLookupByHandle = new Dictionary (); - freeHandleStack = new Stack (); + handles = new Stack (); // Initialize the objects as all null plus room for the // first to always be null. @@ -52,7 +53,7 @@ public static void Init(int maxObjects) i < maxObjects; ++i, --handle) { - freeHandleStack.Push(handle); + handles.Push(handle); } } @@ -66,16 +67,28 @@ public static int Store(object obj) lock (objects) { + // Get the hash of the object + uint hash = (uint)obj.GetHashCode(); + // Pop a handle off the stack - int handle = freeHandleStack.Pop(); + int handle = handles.Pop(); // Store the object objects[handle] = obj; - - // Insert into the hash table - uint hash = (uint)obj.GetHashCode(); - handleLookupByHash.Add(hash, handle); - hashLookupByHandle.Add(handle, hash); + + List handleBucket = null; + + // Create new handle bucket if it does not exist + if (!handleBucketByHash.TryGetValue(hash, out handleBucket)) + { + handleBucket = new List (); + handleBucketByHash[hash] = handleBucket; + } + + // Insert into hash table + handleBucket.Add(handle); + + hashLookupByHandle[handle] = hash; return handle; } @@ -88,7 +101,6 @@ public static object Get(int handle) public static int GetHandle(object obj) { - // Null is always zero if (object.ReferenceEquals(obj, null)) { @@ -99,9 +111,20 @@ public static int GetHandle(object obj) { // Look up the handle in the hash table uint hash = (uint)obj.GetHashCode(); - if (handleLookupByHash.ContainsKey(hash)) + List handleBucket = null; + + if (handleBucketByHash.TryGetValue(hash, out handleBucket)) { - return handleLookupByHash[hash]; + for (int i = 0; i < handleBucket.Count; i++) + { + int handleInBucket = handleBucket[i]; + object objectInBucket = objects[handleInBucket]; + + if (object.ReferenceEquals(objectInBucket, obj)) + { + return handleInBucket; + } + } } } @@ -124,12 +147,24 @@ public static object Remove(int handle) objects[handle] = null; // Push the handle onto the stack - freeHandleStack.Push(handle); - + handles.Push(handle); + + uint hash = hashLookupByHandle[handle]; + List handleBucket = null; + // Remove the object from the hash dictionary's - var hash = hashLookupByHandle[handle]; - handleLookupByHash.Remove(hash); - hashLookupByHandle.Remove(handle); + if (handleBucketByHash.TryGetValue(hash, out handleBucket)) + { + for (int i = 0; i < handleBucket.Count; i++) + { + int handleInBucket = handleBucket[i]; + if (handleInBucket == handle) + { + handleBucket.RemoveAt(i); + break; + } + } + } return obj; } From 3b519ac840c0a8eed9ca6acbc307d4cadb63ad08 Mon Sep 17 00:00:00 2001 From: = Date: Wed, 15 Jan 2020 19:32:32 -0600 Subject: [PATCH 81/95] [#51] change object-store to use a dictionary to cache objects Dictionary will take care of hashing/collisions for us. --- Unity/Assets/NativeScript/Bindings.cs | 67 ++++++--------------------- 1 file changed, 14 insertions(+), 53 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 3310650..3f83a8e 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -25,9 +25,10 @@ public static class Bindings // Holds objects and provides handles to them in the form of ints public static class ObjectStore { - static Dictionary> handleBucketByHash; - static Dictionary hashLookupByHandle; - static HashSet hash; + // Lookup handles by object. + static Dictionary objectHandleCache; + + // Stack of available handles. static Stack handles; // Stored objects. The first is never used so 0 can be "null". @@ -39,9 +40,8 @@ public static class ObjectStore public static void Init(int maxObjects) { ObjectStore.maxObjects = maxObjects; - handleBucketByHash = new Dictionary> (); - hashLookupByHandle = new Dictionary (); - handles = new Stack (); + objectHandleCache = new Dictionary (maxObjects); + handles = new Stack (maxObjects); // Initialize the objects as all null plus room for the // first to always be null. @@ -67,28 +67,12 @@ public static int Store(object obj) lock (objects) { - // Get the hash of the object - uint hash = (uint)obj.GetHashCode(); - // Pop a handle off the stack int handle = handles.Pop(); // Store the object objects[handle] = obj; - - List handleBucket = null; - - // Create new handle bucket if it does not exist - if (!handleBucketByHash.TryGetValue(hash, out handleBucket)) - { - handleBucket = new List (); - handleBucketByHash[hash] = handleBucket; - } - - // Insert into hash table - handleBucket.Add(handle); - - hashLookupByHandle[handle] = hash; + objectHandleCache.Add(obj, handle); return handle; } @@ -109,22 +93,13 @@ public static int GetHandle(object obj) lock (objects) { - // Look up the handle in the hash table - uint hash = (uint)obj.GetHashCode(); - List handleBucket = null; + // A handle with a value of 0 is NULL + int handle = 0; - if (handleBucketByHash.TryGetValue(hash, out handleBucket)) + // Get handle from object cache + if (objectHandleCache.TryGetValue(obj, out handle)) { - for (int i = 0; i < handleBucket.Count; i++) - { - int handleInBucket = handleBucket[i]; - object objectInBucket = objects[handleInBucket]; - - if (object.ReferenceEquals(objectInBucket, obj)) - { - return handleInBucket; - } - } + return handle; } } @@ -149,22 +124,8 @@ public static object Remove(int handle) // Push the handle onto the stack handles.Push(handle); - uint hash = hashLookupByHandle[handle]; - List handleBucket = null; - - // Remove the object from the hash dictionary's - if (handleBucketByHash.TryGetValue(hash, out handleBucket)) - { - for (int i = 0; i < handleBucket.Count; i++) - { - int handleInBucket = handleBucket[i]; - if (handleInBucket == handle) - { - handleBucket.RemoveAt(i); - break; - } - } - } + // Remove the object from the cache + objectHandleCache.Remove(obj); return obj; } From bfaf5ee167308ce330c6a72b7a3614f31666a7b6 Mon Sep 17 00:00:00 2001 From: = Date: Sat, 18 Jan 2020 16:05:23 -0600 Subject: [PATCH 82/95] [#51] fix formatting and remove unnecessary variable initialization --- Unity/Assets/NativeScript/Bindings.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 3f83a8e..72a594a 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -40,7 +40,7 @@ public static class ObjectStore public static void Init(int maxObjects) { ObjectStore.maxObjects = maxObjects; - objectHandleCache = new Dictionary (maxObjects); + objectHandleCache = new Dictionary(maxObjects); handles = new Stack (maxObjects); // Initialize the objects as all null plus room for the @@ -93,8 +93,7 @@ public static int GetHandle(object obj) lock (objects) { - // A handle with a value of 0 is NULL - int handle = 0; + int handle; // Get handle from object cache if (objectHandleCache.TryGetValue(obj, out handle)) From 0a6bdb00f5d6cd5d42c9fcfbce758bc5fcdcab6d Mon Sep 17 00:00:00 2001 From: = Date: Sat, 18 Jan 2020 16:26:34 -0600 Subject: [PATCH 83/95] [#51] Revert ObjectStore handles code to original implementation --- Unity/Assets/NativeScript/Bindings.cs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 72a594a..04aef29 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -28,11 +28,14 @@ public static class ObjectStore // Lookup handles by object. static Dictionary objectHandleCache; - // Stack of available handles. - static Stack handles; - // Stored objects. The first is never used so 0 can be "null". static object[] objects; + + // Stack of available handles. + static int[] handles; + + // Index of the next available handle + static int nextHandleIndex; // The maximum number of objects to store. Must be positive. static int maxObjects; @@ -41,20 +44,21 @@ public static void Init(int maxObjects) { ObjectStore.maxObjects = maxObjects; objectHandleCache = new Dictionary(maxObjects); - handles = new Stack (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.Push(handle); + handles[i] = handle; } + nextHandleIndex = maxObjects - 1; } public static int Store(object obj) @@ -68,7 +72,8 @@ public static int Store(object obj) lock (objects) { // Pop a handle off the stack - int handle = handles.Pop(); + int handle = handles[nextHandleIndex]; + nextHandleIndex--; // Store the object objects[handle] = obj; @@ -121,7 +126,8 @@ public static object Remove(int handle) objects[handle] = null; // Push the handle onto the stack - handles.Push(handle); + nextHandleIndex++; + handles[nextHandleIndex] = handle; // Remove the object from the cache objectHandleCache.Remove(obj); From 1c0b627801613a5ffc9c34d653ce5e9c43bfe802 Mon Sep 17 00:00:00 2001 From: = Date: Sat, 18 Jan 2020 16:28:55 -0600 Subject: [PATCH 84/95] [#51] fix minor formatting error --- Unity/Assets/NativeScript/Bindings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 04aef29..72ac143 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -36,7 +36,7 @@ public static class ObjectStore // Index of the next available handle static int nextHandleIndex; - + // The maximum number of objects to store. Must be positive. static int maxObjects; From 5f0e56f7c48bdcc71f419740c22a744f0b4b7383 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sat, 25 Jan 2020 15:43:44 -0800 Subject: [PATCH 85/95] Fix opening the native library on Linux --- Unity/Assets/NativeScript/Bindings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unity/Assets/NativeScript/Bindings.cs b/Unity/Assets/NativeScript/Bindings.cs index 72ac143..3ae570d 100644 --- a/Unity/Assets/NativeScript/Bindings.cs +++ b/Unity/Assets/NativeScript/Bindings.cs @@ -332,7 +332,7 @@ static extern int dlclose( static IntPtr OpenLibrary( string path) { - IntPtr handle = dlopen(path, 0); + IntPtr handle = dlopen(path, 1); // 1 = lazy, 2 = now if (handle == IntPtr.Zero) { throw new Exception("Couldn't open native library: " + path); From 65e70add52952098c5496ce91c4ef85b00c3895d Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Tue, 11 Aug 2020 20:31:02 -0700 Subject: [PATCH 86/95] Fix generating wrong C++ type name for multi-dimensional arrays --- .../Assets/NativeScript/Editor/GenerateBindings.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 7e56758..c36c2e6 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -13267,16 +13267,9 @@ static void AppendCppTypeFullName( output.Append(rank); output.Append('<'); Type elementType = type.GetElementType(); - for (int i = 0; i < rank; ++i) - { - AppendCppTypeFullName( - elementType, - output); - if (i != rank -1) - { - output.Append(", "); - } - } + AppendCppTypeFullName( + elementType, + output); output.Append('>'); } else if (IsDelegate(type)) From 0bac628fcd93c3274bbde8f42577f554191bb578 Mon Sep 17 00:00:00 2001 From: Yevhenii Vitiuk Date: Thu, 10 Dec 2020 09:55:24 +0200 Subject: [PATCH 87/95] Removed prefix "lib" after build C++ library --- Unity/Assets/CppSource/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unity/Assets/CppSource/CMakeLists.txt b/Unity/Assets/CppSource/CMakeLists.txt index 306ae25..d668cf5 100644 --- a/Unity/Assets/CppSource/CMakeLists.txt +++ b/Unity/Assets/CppSource/CMakeLists.txt @@ -33,7 +33,6 @@ if (ANDROID_NDK) set(ANDROID_ABI armeabi-v7a) set(CMAKE_TOOLCHAIN_FILE ${ANDROID_NDK}/build/cmake/android.toolchain.cmake) endif() - # Set output path if (ANDROID_NDK) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../Plugins/Android) @@ -79,5 +78,6 @@ if (IOS) set_xcode_property(${PROJECT_NAME} ENABLE_BITCODE "NO") endif() +set_property(TARGET ${PROJECT_NAME} PROPERTY PREFIX "") # Enable C++11 set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) \ No newline at end of file From 79c7c70b765e1286490cf0bdc1769deee1211498 Mon Sep 17 00:00:00 2001 From: Yevhenii Vitiuk Date: Thu, 10 Dec 2020 10:36:58 +0200 Subject: [PATCH 88/95] Fixed index of tags with Environment.NewLine "\r\n" --- .../NativeScript/Editor/GenerateBindings.cs | 115 ++++++++++-------- 1 file changed, 64 insertions(+), 51 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index c36c2e6..809d780 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -684,7 +684,12 @@ static Assembly[] GetAssemblies(string[] assemblyNames) assemblies[7] = typeof(UnityEngine.Accessibility.VisionUtility).Assembly; // Unity accessibility module assemblies[8] = typeof(UnityEngine.AI.NavMesh).Assembly; // Unity AI module assemblies[9] = typeof(UnityEngine.Animations.AnimationClipPlayable).Assembly; // Unity animation module +#if !UNITY_2020_1_OR_NEWER //This class migrate to package assemblies[10] = typeof(UnityEngine.XR.ARRenderMode).Assembly; // Unity AR module +#else + assemblies[10] = typeof(UnityEngine.XR.InputDevices).Assembly; // Unity AR module without package +#endif + assemblies[11] = typeof(AudioSettings).Assembly; // Unity audio module assemblies[12] = typeof(Cloth).Assembly; // Unity cloth module assemblies[13] = typeof(ClusterInput).Assembly; // Unity cluster input module @@ -710,13 +715,21 @@ static Assembly[] GetAssemblies(string[] assemblyNames) assemblies[30] = typeof(UnityEngine.Experimental.UIElements.Button).Assembly; // Unity UI elements module #endif assemblies[31] = typeof(Canvas).Assembly; // Unity UI module - assemblies[32] = typeof(UnityEngine.Networking.NetworkTransport).Assembly; // Unity cloth module +#if UNITY_2020_1_OR_NEWER + assemblies[32] = typeof(UnityEngine.Networking.Utility).Assembly; // Unity network module +#else + assemblies[32] = typeof(UnityEngine.Networking.NetworkTransport).Assembly; // Unity network module +#endif assemblies[33] = typeof(UnityEngine.Analytics.Analytics).Assembly; // Unity analytics module assemblies[34] = typeof(RemoteSettings).Assembly; // Unity Unity connect module assemblies[35] = typeof(UnityEngine.Networking.DownloadHandlerAudioClip).Assembly; // Unity web request audio module assemblies[36] = typeof(WWWForm).Assembly; // Unity web request module assemblies[37] = typeof(UnityEngine.Networking.DownloadHandlerTexture).Assembly; // Unity web request texture module +#if !UNITY_2020_1_OR_NEWER assemblies[38] = typeof(WWW).Assembly; // Unity web request WWW module +#else + assemblies[38] = typeof(UnityEngine.Networking.UnityWebRequest).Assembly; +#endif assemblies[39] = typeof(WheelCollider).Assembly; // Unity vehicles module assemblies[40] = typeof(UnityEngine.Video.VideoClip).Assembly; // Unity video module assemblies[41] = typeof(UnityEngine.XR.InputTracking).Assembly; // Unity VR module @@ -13445,123 +13458,123 @@ static void InjectBuilders( string cppSourceContents = File.ReadAllText(CppSourcePath); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN DELEGATE TYPES*/\n", - "\n\t\t/*END DELEGATE TYPES*/", + "/*BEGIN DELEGATE TYPES*/"+Environment.NewLine, + Environment.NewLine+"\t\t/*END DELEGATE TYPES*/", builders.CsharpDelegateTypes.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN STORE INIT CALLS*/\n", - "\n\t\t\t/*END STORE INIT CALLS*/", + "/*BEGIN STORE INIT CALLS*/"+Environment.NewLine, + Environment.NewLine+"\t\t\t/*END STORE INIT CALLS*/", builders.CsharpStoreInitCalls.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN INIT CALL*/\n", - "\n\t\t\t/*END INIT CALL*/", + "/*BEGIN INIT CALL*/"+Environment.NewLine, + Environment.NewLine+"\t\t\t/*END INIT CALL*/", builders.CsharpInitCall.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN BASE TYPES*/\n", - "\n/*END BASE TYPES*/", + "/*BEGIN BASE TYPES*/"+Environment.NewLine, + Environment.NewLine+"/*END BASE TYPES*/", builders.CsharpBaseTypes.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN FUNCTIONS*/\n", - "\n\t\t/*END FUNCTIONS*/", + "/*BEGIN FUNCTIONS*/"+Environment.NewLine, + Environment.NewLine+"\t\t/*END FUNCTIONS*/", builders.CsharpFunctions.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN CPP DELEGATES*/\n", - "\n\t\t/*END CPP DELEGATES*/", + "/*BEGIN CPP DELEGATES*/"+Environment.NewLine, + Environment.NewLine+"\t\t/*END CPP DELEGATES*/", builders.CsharpCppDelegates.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN CSHARP DELEGATES*/\n", - "\n\t\t/*END CSHARP DELEGATES*/", + "/*BEGIN CSHARP DELEGATES*/"+Environment.NewLine, + Environment.NewLine+"\t\t/*END CSHARP DELEGATES*/", builders.CsharpCsharpDelegates.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN IMPORTS*/\n", - "\n\t\t/*END IMPORTS*/", + "/*BEGIN IMPORTS*/"+Environment.NewLine, + Environment.NewLine+"\t\t/*END IMPORTS*/", builders.CsharpImports.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN GETDELEGATE CALLS*/\n", - "\n\t\t\t/*END GETDELEGATE CALLS*/", + "/*BEGIN GETDELEGATE CALLS*/"+Environment.NewLine, + Environment.NewLine+"\t\t\t/*END GETDELEGATE CALLS*/", builders.CsharpGetDelegateCalls.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN DESTROY FUNCTION ENUMERATORS*/\n", - "\n\t\t\t/*END DESTROY FUNCTION ENUMERATORS*/", + "/*BEGIN DESTROY FUNCTION ENUMERATORS*/"+Environment.NewLine, + Environment.NewLine+"\t\t\t/*END DESTROY FUNCTION ENUMERATORS*/", builders.CsharpDestroyFunctionEnumerators.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN DESTROY QUEUE CASES*/\n", - "\n\t\t\t\t\t\t/*END DESTROY QUEUE CASES*/", + "/*BEGIN DESTROY QUEUE CASES*/"+Environment.NewLine, + Environment.NewLine+"\t\t\t\t\t\t/*END DESTROY QUEUE CASES*/", builders.CsharpDestroyQueueCases.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN FUNCTION POINTERS*/\n", - "\n\t/*END FUNCTION POINTERS*/", + "/*BEGIN FUNCTION POINTERS*/"+Environment.NewLine, + Environment.NewLine+"\t/*END FUNCTION POINTERS*/", builders.CppFunctionPointers.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN TYPE DECLARATIONS*/\n", - "\n/*END TYPE DECLARATIONS*/", + "/*BEGIN TYPE DECLARATIONS*/"+Environment.NewLine, + Environment.NewLine+"/*END TYPE DECLARATIONS*/", builders.CppTypeDeclarations.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN TEMPLATE DECLARATIONS*/\n", - "\n/*END TEMPLATE DECLARATIONS*/", + "/*BEGIN TEMPLATE DECLARATIONS*/"+Environment.NewLine, + Environment.NewLine+"/*END TEMPLATE DECLARATIONS*/", builders.CppTemplateDeclarations.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN TEMPLATE SPECIALIZATION DECLARATIONS*/\n", - "\n/*END TEMPLATE SPECIALIZATION DECLARATIONS*/", + "/*BEGIN TEMPLATE SPECIALIZATION DECLARATIONS*/"+Environment.NewLine, + Environment.NewLine+"/*END TEMPLATE SPECIALIZATION DECLARATIONS*/", builders.CppTemplateSpecializationDeclarations.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN TYPE DEFINITIONS*/\n", - "\n/*END TYPE DEFINITIONS*/", + "/*BEGIN TYPE DEFINITIONS*/"+Environment.NewLine, + Environment.NewLine+"/*END TYPE DEFINITIONS*/", builders.CppTypeDefinitions.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN METHOD DEFINITIONS*/\n", - "\n/*END METHOD DEFINITIONS*/", + "/*BEGIN METHOD DEFINITIONS*/"+Environment.NewLine, + Environment.NewLine+"/*END METHOD DEFINITIONS*/", builders.CppMethodDefinitions.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN INIT BODY PARAMETER READS*/\n", - "\n\t/*END INIT BODY PARAMETER READS*/", + "/*BEGIN INIT BODY PARAMETER READS*/"+Environment.NewLine, + Environment.NewLine+"\t/*END INIT BODY PARAMETER READS*/", builders.CppInitBodyParameterReads.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN INIT BODY ARRAYS*/\n", - "\n\t/*END INIT BODY ARRAYS*/", + "/*BEGIN INIT BODY ARRAYS*/"+Environment.NewLine, + Environment.NewLine+"\t/*END INIT BODY ARRAYS*/", builders.CppInitBodyArrays.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN INIT BODY FIRST BOOT*/\n", - "\n\t\t/*END INIT BODY FIRST BOOT*/", + "/*BEGIN INIT BODY FIRST BOOT*/"+Environment.NewLine, + Environment.NewLine+"\t\t/*END INIT BODY FIRST BOOT*/", builders.CppInitBodyFirstBoot.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN GLOBAL STATE AND FUNCTIONS*/\n", - "\n\t/*END GLOBAL STATE AND FUNCTIONS*/", + "/*BEGIN GLOBAL STATE AND FUNCTIONS*/"+Environment.NewLine, + Environment.NewLine+"\t/*END GLOBAL STATE AND FUNCTIONS*/", builders.CppGlobalStateAndFunctions.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN UNBOXING METHOD DECLARATIONS*/\n", - "\n\t\t/*END UNBOXING METHOD DECLARATIONS*/", + "/*BEGIN UNBOXING METHOD DECLARATIONS*/"+Environment.NewLine, + Environment.NewLine+"\t\t/*END UNBOXING METHOD DECLARATIONS*/", builders.CppUnboxingMethodDeclarations.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN STRING DEFAULT PARAMETERS*/\n", - "\n\t/*END STRING DEFAULT PARAMETERS*/", + "/*BEGIN STRING DEFAULT PARAMETERS*/"+Environment.NewLine, + Environment.NewLine+"\t/*END STRING DEFAULT PARAMETERS*/", builders.CppStringDefaultParams.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN MACROS*/\n", - "\n/*END MACROS*/", + "/*BEGIN MACROS*/"+Environment.NewLine, + Environment.NewLine+"/*END MACROS*/", builders.CppMacros.ToString()); File.WriteAllText(CsharpPath, csharpContents); @@ -13577,13 +13590,13 @@ static string InjectIntoString( { for (int startIndex = 0; ; ) { - int beginIndex = contents.IndexOf(beginMarker, startIndex); + int beginIndex = contents.IndexOf(beginMarker, startIndex, StringComparison.OrdinalIgnoreCase); if (beginIndex < 0) { return contents; } int afterBeginIndex = beginIndex + beginMarker.Length; - int endIndex = contents.IndexOf(endMarker, afterBeginIndex); + int endIndex = contents.IndexOf(endMarker, afterBeginIndex, StringComparison.OrdinalIgnoreCase); if (endIndex < 0) { throw new Exception( From 7573b1a9d7dcf9916d15a0c25272c76c389b050d Mon Sep 17 00:00:00 2001 From: Yevhenii Vitiuk Date: Fri, 11 Dec 2020 12:32:27 +0200 Subject: [PATCH 89/95] Fix cmake lib prefix for mingw on win32 platform --- Unity/Assets/CppSource/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Unity/Assets/CppSource/CMakeLists.txt b/Unity/Assets/CppSource/CMakeLists.txt index d668cf5..2baa025 100644 --- a/Unity/Assets/CppSource/CMakeLists.txt +++ b/Unity/Assets/CppSource/CMakeLists.txt @@ -33,6 +33,7 @@ if (ANDROID_NDK) set(ANDROID_ABI armeabi-v7a) set(CMAKE_TOOLCHAIN_FILE ${ANDROID_NDK}/build/cmake/android.toolchain.cmake) endif() + # Set output path if (ANDROID_NDK) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/../Plugins/Android) @@ -78,6 +79,9 @@ if (IOS) set_xcode_property(${PROJECT_NAME} ENABLE_BITCODE "NO") endif() -set_property(TARGET ${PROJECT_NAME} PROPERTY PREFIX "") +if(WIN32 AND MINGW) + set_property(TARGET ${PROJECT_NAME} PROPERTY PREFIX "") +endif() + # Enable C++11 set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11) \ No newline at end of file From faa5558ac836543c37f116e5ec636dcaf924a803 Mon Sep 17 00:00:00 2001 From: Yevhenii Vitiuk Date: Fri, 11 Dec 2020 12:36:03 +0200 Subject: [PATCH 90/95] Replace all "\n" symbol by Environment.NewLine --- .../NativeScript/Editor/GenerateBindings.cs | 1987 +++++++++-------- 1 file changed, 1006 insertions(+), 981 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 809d780..29fe4c7 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -437,16 +437,16 @@ static void AppendStubBaseType( AppendCSharpTypeParameters( typeParams, output); - output.Append('\n'); + output.AppendLine(); AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 1, output); output.Append("// Stub version. GenerateBindings is still in progress. "); output.Append(timestamp); - output.Append('\n'); + output.AppendLine(); if (type.IsClass) { - output.Append('\n'); + output.AppendLine(); ConstructorInfo[] constructors = type.GetConstructors(); if (constructors.Length > 0) { @@ -463,22 +463,22 @@ static void AppendStubBaseType( AppendCsharpParams( ctorParams, output); - output.Append(")\n"); + output.AppendLine(")"); output.Append("\t\t\t: base("); AppendCsharpFunctionCallParameters( ctorParams, output); - output.Append(")\n"); - output.Append("\t\t{\n"); - output.Append("\t\t}\n"); - output.Append("\t\t\n"); + output.AppendLine(")"); + output.AppendLine("\t\t{"); + output.AppendLine("\t\t}"); + output.AppendLine("\t\t"); break; } } } } AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendNamespaceEnding(indent, output); } @@ -512,15 +512,15 @@ static void DoPostCompileWork(bool canRefreshAssetDb) // Init param for max managed Objects builders.CsharpInitCall.Append("\t\t\tMarshal.WriteInt32(memory, curMemory, "); builders.CsharpInitCall.Append(defaultMaxSimultaneous); - builders.CsharpInitCall.Append("); // max managed objects\n"); - builders.CsharpInitCall.Append("\t\t\tcurMemory += sizeof(int);\n"); + builders.CsharpInitCall.AppendLine("); // max managed objects"); + builders.CsharpInitCall.AppendLine("\t\t\tcurMemory += sizeof(int);"); builders.CsharpInitCall.Append(' '); // C# ObjectStore Init call builders.CsharpStoreInitCalls.Append( "\t\t\tNativeScript.Bindings.ObjectStore.Init("); builders.CsharpStoreInitCalls.Append(defaultMaxSimultaneous); - builders.CsharpStoreInitCalls.Append(");\n"); + builders.CsharpStoreInitCalls.AppendLine(");"); // Generate types if (doc.Types != null) @@ -978,8 +978,13 @@ static void AppendCppConstructorInitializerList( Type[] interfaceTypes, int indent, StringBuilder output, - string newline = "\n") + string newline = null) { + if (string.IsNullOrWhiteSpace(newline)) + { + newline = Environment.NewLine; + } + string separator = ": "; foreach (Type interfaceType in interfaceTypes) { @@ -1554,7 +1559,7 @@ static void AppendType( builders.CsharpStoreInitCalls); builders.CsharpStoreInitCalls.Append(">.Init("); builders.CsharpStoreInitCalls.Append(maxSimultaneous); - builders.CsharpStoreInitCalls.Append(");\n"); + builders.CsharpStoreInitCalls.AppendLine(");"); // Build function name suffix builders.TempStrBuilder.Length = 0; @@ -1602,15 +1607,15 @@ static void AppendType( typeof(void), parameters, builders.CsharpFunctions); - builders.CsharpFunctions.Append( - "if (handle != 0)\n\t\t\t{\n"); + builders.CsharpFunctions.AppendLine("if (handle != 0)"); + builders.CsharpFunctions.AppendLine("\t\t\t{"); builders.CsharpFunctions.Append( "\t\t\t\tNativeScript.Bindings.StructStore<"); AppendCsharpTypeFullName( type, builders.CsharpFunctions); - builders.CsharpFunctions.Append( - ">.Remove(handle);\n\t\t\t}"); + builders.CsharpFunctions.AppendLine(">.Remove(handle);"); + builders.CsharpFunctions.Append("\t\t\t}"); AppendCsharpFunctionEnd( typeof(void), new Type[0], @@ -1646,57 +1651,61 @@ static void AppendType( // C++ init body for handle array length builders.CppInitBodyArrays.Append("\tPlugin::RefCounts"); builders.CppInitBodyArrays.Append(funcNameSuffix); - builders.CppInitBodyArrays.Append(" = (int32_t*)curMemory;\n"); + builders.CppInitBodyArrays.AppendLine(" = (int32_t*)curMemory;"); builders.CppInitBodyArrays.Append("\tcurMemory += "); builders.CppInitBodyArrays.Append(maxSimultaneous); - builders.CppInitBodyArrays.Append(" * sizeof(int32_t);\n"); + builders.CppInitBodyArrays.AppendLine(" * sizeof(int32_t);"); builders.CppInitBodyArrays.Append("\tPlugin::RefCountsLen"); builders.CppInitBodyArrays.Append(funcNameSuffix); builders.CppInitBodyArrays.Append(" = "); builders.CppInitBodyArrays.Append(maxSimultaneous); - builders.CppInitBodyArrays.Append(";\n"); - builders.CppInitBodyArrays.Append("\t\n"); + builders.CppInitBodyArrays.AppendLine(";"); + builders.CppInitBodyArrays.AppendLine("\t"); // C++ ref count state and functions builders.CppGlobalStateAndFunctions.Append("\tint32_t RefCountsLen"); builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); - builders.CppGlobalStateAndFunctions.Append(";\n\tint32_t* RefCounts"); + builders.CppGlobalStateAndFunctions.AppendLine(";"); + builders.CppGlobalStateAndFunctions.Append("\tint32_t* RefCounts"); builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); - builders.CppGlobalStateAndFunctions.Append(";\n\t\n\tvoid ReferenceManaged"); + builders.CppGlobalStateAndFunctions.AppendLine(";"); + builders.CppGlobalStateAndFunctions.AppendLine("\t"); + builders.CppGlobalStateAndFunctions.Append("\tvoid ReferenceManaged"); builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); - builders.CppGlobalStateAndFunctions.Append("(int32_t handle)\n"); - builders.CppGlobalStateAndFunctions.Append("\t{\n"); + builders.CppGlobalStateAndFunctions.AppendLine("(int32_t handle)"); + builders.CppGlobalStateAndFunctions.AppendLine("\t{"); builders.CppGlobalStateAndFunctions.Append("\t\tassert(handle >= 0 && handle < RefCountsLen"); builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); - builders.CppGlobalStateAndFunctions.Append(");\n"); - builders.CppGlobalStateAndFunctions.Append("\t\tif (handle != 0)\n"); - builders.CppGlobalStateAndFunctions.Append("\t\t{\n"); + builders.CppGlobalStateAndFunctions.AppendLine(");"); + builders.CppGlobalStateAndFunctions.AppendLine("\t\tif (handle != 0)"); + builders.CppGlobalStateAndFunctions.AppendLine("\t\t{"); builders.CppGlobalStateAndFunctions.Append("\t\t\tRefCounts"); builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); - builders.CppGlobalStateAndFunctions.Append("[handle]++;\n"); - builders.CppGlobalStateAndFunctions.Append("\t\t}\n"); - builders.CppGlobalStateAndFunctions.Append("\t}\n"); - builders.CppGlobalStateAndFunctions.Append("\t\n"); + builders.CppGlobalStateAndFunctions.AppendLine("[handle]++;"); + builders.CppGlobalStateAndFunctions.AppendLine("\t\t}"); + builders.CppGlobalStateAndFunctions.AppendLine("\t}"); + builders.CppGlobalStateAndFunctions.AppendLine("\t"); builders.CppGlobalStateAndFunctions.Append("\tvoid DereferenceManaged"); builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); - builders.CppGlobalStateAndFunctions.Append("(int32_t handle)\n"); - builders.CppGlobalStateAndFunctions.Append("\t{\n"); + builders.CppGlobalStateAndFunctions.AppendLine("(int32_t handle)"); + builders.CppGlobalStateAndFunctions.AppendLine("\t{"); builders.CppGlobalStateAndFunctions.Append("\t\tassert(handle >= 0 && handle < RefCountsLen"); builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); - builders.CppGlobalStateAndFunctions.Append(");\n"); - builders.CppGlobalStateAndFunctions.Append("\t\tif (handle != 0)\n"); - builders.CppGlobalStateAndFunctions.Append("\t\t{\n"); + builders.CppGlobalStateAndFunctions.AppendLine(");"); + builders.CppGlobalStateAndFunctions.AppendLine("\t\tif (handle != 0)"); + builders.CppGlobalStateAndFunctions.AppendLine("\t\t{"); builders.CppGlobalStateAndFunctions.Append("\t\t\tint32_t numRemain = --RefCounts"); builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); - builders.CppGlobalStateAndFunctions.Append("[handle];\n"); - builders.CppGlobalStateAndFunctions.Append("\t\t\tif (numRemain == 0)\n"); - builders.CppGlobalStateAndFunctions.Append("\t\t\t{\n"); + builders.CppGlobalStateAndFunctions.AppendLine("[handle];"); + builders.CppGlobalStateAndFunctions.AppendLine("\t\t\tif (numRemain == 0)"); + builders.CppGlobalStateAndFunctions.AppendLine("\t\t\t{"); builders.CppGlobalStateAndFunctions.Append("\t\t\t\tRelease"); builders.CppGlobalStateAndFunctions.Append(funcNameSuffix); - builders.CppGlobalStateAndFunctions.Append("(handle);\n"); - builders.CppGlobalStateAndFunctions.Append("\t\t\t}\n"); - builders.CppGlobalStateAndFunctions.Append("\t\t}\n"); - builders.CppGlobalStateAndFunctions.Append("\t}\n\t\n"); + builders.CppGlobalStateAndFunctions.AppendLine("(handle);"); + builders.CppGlobalStateAndFunctions.AppendLine("\t\t\t}"); + builders.CppGlobalStateAndFunctions.AppendLine("\t\t}"); + builders.CppGlobalStateAndFunctions.AppendLine("\t}"); + builders.CppGlobalStateAndFunctions.AppendLine("\t"); } // C++ type declaration @@ -2035,7 +2044,7 @@ static void AppendEnum( AppendCppPrimitiveTypeName( underlyingType, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append(" Value;\n"); + builders.CppTypeDefinitions.AppendLine(" Value;"); // Enumerator fields FieldInfo[] fields = type.GetFields( @@ -2052,7 +2061,7 @@ static void AppendEnum( builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append(' '); builders.CppTypeDefinitions.Append(field.Name); - builders.CppTypeDefinitions.Append(";\n"); + builders.CppTypeDefinitions.AppendLine(";"); } // Constructor from primitive type @@ -2065,7 +2074,7 @@ static void AppendEnum( AppendCppPrimitiveTypeName( underlyingType, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append(" value);\n"); + builders.CppTypeDefinitions.AppendLine(" value);"); // Conversion operator to primitive type AppendIndent( @@ -2075,7 +2084,7 @@ static void AppendEnum( AppendCppPrimitiveTypeName( underlyingType, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append("() const;\n"); + builders.CppTypeDefinitions.AppendLine("() const;"); // Equality operator AppendIndent( @@ -2083,7 +2092,7 @@ static void AppendEnum( builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append("bool operator==("); builders.CppTypeDefinitions.Append(type.Name); - builders.CppTypeDefinitions.Append(" other);\n"); + builders.CppTypeDefinitions.AppendLine(" other);"); // Inequality operator AppendIndent( @@ -2091,7 +2100,7 @@ static void AppendEnum( builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append("bool operator!=("); builders.CppTypeDefinitions.Append(type.Name); - builders.CppTypeDefinitions.Append(" other);\n"); + builders.CppTypeDefinitions.AppendLine(" other);"); AppendNamespaceBeginning( type.Namespace, @@ -2108,23 +2117,23 @@ static void AppendEnum( AppendCppPrimitiveTypeName( underlyingType, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(" value)\n"); + builders.CppMethodDefinitions.AppendLine(" value)"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(": Value(value)\n"); + builders.CppMethodDefinitions.AppendLine(": Value(value)"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine(); // Conversion operator to primitive type AppendIndent( @@ -2137,23 +2146,23 @@ static void AppendEnum( AppendCppPrimitiveTypeName( underlyingType, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("() const\n"); + builders.CppMethodDefinitions.AppendLine("() const"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("return Value;\n"); + builders.CppMethodDefinitions.AppendLine("return Value;"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; // Equality operator AppendIndent( @@ -2165,23 +2174,23 @@ static void AppendEnum( builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("::operator==("); builders.CppMethodDefinitions.Append(type.Name); - builders.CppMethodDefinitions.Append(" other)\n"); + builders.CppMethodDefinitions.AppendLine(" other)"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("return Value == other.Value;\n"); + builders.CppMethodDefinitions.AppendLine("return Value == other.Value;"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; // Inequality operator AppendIndent( @@ -2193,23 +2202,23 @@ static void AppendEnum( builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("::operator!=("); builders.CppMethodDefinitions.Append(type.Name); - builders.CppMethodDefinitions.Append(" other)\n"); + builders.CppMethodDefinitions.AppendLine(" other)"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("return Value != other.Value;\n"); + builders.CppMethodDefinitions.AppendLine("return Value != other.Value;"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; AppendBoxing( type, @@ -2224,11 +2233,11 @@ static void AppendEnum( AppendIndent( indent, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append("};\n"); + builders.CppTypeDefinitions.AppendLine("};"); AppendNamespaceEnding( indent, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append('\n'); + builders.CppTypeDefinitions.AppendLine();; // Static initialization foreach (FieldInfo field in fields) @@ -2246,9 +2255,9 @@ static void AppendEnum( builders.CppMethodDefinitions.Append('('); builders.CppMethodDefinitions.Append( field.GetRawConstantValue()); - builders.CppMethodDefinitions.Append(");\n"); + builders.CppMethodDefinitions.AppendLine(");"); } - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; } static void AppendBoxing( @@ -2546,7 +2555,7 @@ static void AppendUnboxing( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 1, builders.CppMethodDefinitions); @@ -2560,18 +2569,19 @@ static void AppendUnboxing( } builders.CppMethodDefinitions.Append("Plugin::"); builders.CppMethodDefinitions.Append(unboxFuncName); - builders.CppMethodDefinitions.Append("(Handle));\n"); + builders.CppMethodDefinitions.AppendLine("(Handle));"); AppendCppUnhandledExceptionHandling( indent + 1, builders.CppMethodDefinitions); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("return returnVal;\n"); + builders.CppMethodDefinitions.AppendLine("return returnVal;"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n\t\n"); + builders.CppMethodDefinitions.AppendLine("}"); + builders.CppMethodDefinitions.AppendLine("\t"); // C++ method definitions (end) AppendCppMethodDefinitionsEnd( @@ -2651,7 +2661,7 @@ static void AppendCppBoxingMethodDefinition( AppendIndent( indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( indent + 1, output); @@ -2666,20 +2676,20 @@ static void AppendCppBoxingMethodDefinition( { output.Append("*this"); } - output.Append(");\n"); + output.AppendLine(");"); AppendCppUnhandledExceptionHandling( indent + 1, output); AppendIndent( indent + 1, output); - output.Append( - "if (handle)\n"); + output.AppendLine( + "if (handle)"); AppendIndent( indent + 1, output); - output.Append( - "{\n"); + output.AppendLine( + "{"); AppendIndent( indent + 2, output); @@ -2689,7 +2699,7 @@ static void AppendCppBoxingMethodDefinition( null, "handle", output); - output.Append(";\n"); + output.AppendLine(";"); AppendIndent( indent + 2, output); @@ -2697,24 +2707,24 @@ static void AppendCppBoxingMethodDefinition( AppendCppTypeFullName( boxedType, output); - output.Append("(Plugin::InternalUse::Only, handle);\n"); + output.AppendLine("(Plugin::InternalUse::Only, handle);"); AppendIndent( indent + 1, output); - output.Append( - "}\n"); + output.AppendLine( + "}"); AppendIndent( indent + 1, output); - output.Append("return nullptr;\n"); + output.AppendLine("return nullptr;"); AppendIndent( indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( indent, output); - output.Append('\n'); + output.AppendLine();; } static void AppendHandleStoreTypeName( @@ -2939,7 +2949,7 @@ static void AppendConstructor( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendCppPluginFunctionCall( true, GetTypeName(enclosingType), @@ -2955,26 +2965,26 @@ static void AppendConstructor( AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "*this = returnValue;\n"); + builders.CppMethodDefinitions.AppendLine( + "*this = returnValue;"); } else { AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "Handle = returnValue;\n"); + builders.CppMethodDefinitions.AppendLine( + "Handle = returnValue;"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "if (returnValue)\n"); + builders.CppMethodDefinitions.AppendLine( + "if (returnValue)"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "{\n"); + builders.CppMethodDefinitions.AppendLine( + "{"); AppendIndent( indent + 2, builders.CppMethodDefinitions); @@ -2984,21 +2994,21 @@ static void AppendConstructor( enclosingTypeParams, "returnValue", builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(";\n"); + builders.CppMethodDefinitions.AppendLine(";"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "}\n"); + builders.CppMethodDefinitions.AppendLine( + "}"); } AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; // C++ init body AppendCppInitBodyFunctionPointerParameterRead( @@ -3189,7 +3199,7 @@ static void AppendFullValueTypeDefaultConstructor( AppendTypeNameWithoutGenericSuffix( enclosingType.Name, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append("();\n"); + builders.CppTypeDefinitions.AppendLine("();"); AppendIndent( indent, @@ -3201,19 +3211,19 @@ static void AppendFullValueTypeDefaultConstructor( AppendTypeNameWithoutGenericSuffix( enclosingType.Name, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("()\n"); + builders.CppMethodDefinitions.AppendLine("()"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; } static void AppendFullValueTypeFields( @@ -3236,7 +3246,7 @@ static void AppendFullValueTypeFields( builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append(' '); builders.CppTypeDefinitions.Append(field.Name); - builders.CppTypeDefinitions.Append(";\n"); + builders.CppTypeDefinitions.AppendLine(";"); } } @@ -3466,7 +3476,7 @@ static void AppendEventAddRemoveMethod( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendCppPluginFunctionCall( methodIsStatic, GetTypeName(enclosingType), @@ -3480,7 +3490,8 @@ static void AppendEventAddRemoveMethod( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n\t\n"); + builders.CppMethodDefinitions.AppendLine("}"); + builders.CppMethodDefinitions.AppendLine("\t"); // C++ init body AppendCppInitBodyFunctionPointerParameterRead( @@ -4165,7 +4176,7 @@ static void AppendMethod( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendCppPluginFunctionCall( methodIsStatic, GetTypeName(enclosingType), @@ -4184,7 +4195,8 @@ static void AppendMethod( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n\t\n"); + builders.CppMethodDefinitions.AppendLine("}"); + builders.CppMethodDefinitions.AppendLine("\t"); // C++ init body AppendCppInitBodyFunctionPointerParameterRead( @@ -4270,7 +4282,7 @@ static void AppendCppFunctionCall( } output.Append('('); output.Append(param.Name); - output.Append(");\n"); + output.AppendLine(");"); } } if (!enclosingTypeIsStatic) @@ -4278,8 +4290,8 @@ static void AppendCppFunctionCall( AppendIndent( indent, output); - output.Append( - "int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this);\n"); + output.AppendLine( + "int thisHandle = NativeScript.Bindings.ObjectStore.GetHandle(this);"); } AppendIndent( indent, @@ -4313,31 +4325,31 @@ static void AppendCppFunctionCall( output.Append(", "); } } - output.Append(");\n"); + output.AppendLine(");"); AppendIndent( indent, output); - output.Append("if (NativeScript.Bindings.UnhandledCppException != null)\n"); + output.AppendLine("if (NativeScript.Bindings.UnhandledCppException != null)"); AppendIndent( indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( indent + 1, output); - output.Append("Exception ex = NativeScript.Bindings.UnhandledCppException;\n"); + output.AppendLine("Exception ex = NativeScript.Bindings.UnhandledCppException;"); AppendIndent( indent + 1, output); - output.Append("NativeScript.Bindings.UnhandledCppException = null;\n"); + output.AppendLine("NativeScript.Bindings.UnhandledCppException = null;"); AppendIndent( indent + 1, output); - output.Append("throw ex;\n"); + output.AppendLine("throw ex;"); AppendIndent( indent, output); - output.Append("}\n"); + output.AppendLine("}"); } static void AppendArray( @@ -4477,8 +4489,8 @@ static void AppendArray( extraIndent, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append(subject); - builders.CppMethodDefinitions.Append( - "InternalLength = 0;\n"); + builders.CppMethodDefinitions.AppendLine( + "InternalLength = 0;"); if (localRank > 1) { for (int i = 0; i < localRank; ++i) @@ -4490,8 +4502,8 @@ static void AppendArray( builders.CppMethodDefinitions.Append( "InternalLengths["); builders.CppMethodDefinitions.Append(i); - builders.CppMethodDefinitions.Append( - "] = 0;\n"); + builders.CppMethodDefinitions.AppendLine( + "] = 0;"); } } }, @@ -4502,8 +4514,8 @@ static void AppendArray( builders.CppMethodDefinitions.Append( "InternalLength = "); builders.CppMethodDefinitions.Append(subject); - builders.CppMethodDefinitions.Append( - "InternalLength;\n"); + builders.CppMethodDefinitions.AppendLine( + "InternalLength;"); if (localRank > 1) { for (int i = 0; i < localRank; ++i) @@ -4520,8 +4532,8 @@ static void AppendArray( builders.CppMethodDefinitions.Append( "InternalLengths["); builders.CppMethodDefinitions.Append(i); - builders.CppMethodDefinitions.Append( - "];\n"); + builders.CppMethodDefinitions.AppendLine( + "];"); } } }, @@ -4532,8 +4544,8 @@ static void AppendArray( AppendIndent( indent + 1, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append( - "int32_t InternalLength;\n"); + builders.CppTypeDefinitions.AppendLine( + "int32_t InternalLength;"); if (rank > 1) { AppendIndent( @@ -4542,7 +4554,7 @@ static void AppendArray( builders.CppTypeDefinitions.Append( "int32_t InternalLengths["); builders.CppTypeDefinitions.Append(rank); - builders.CppTypeDefinitions.Append("];\n"); + builders.CppTypeDefinitions.AppendLine("];"); } AppendArrayConstructor( @@ -4611,7 +4623,7 @@ static void AppendArray( AppendTypeNameWithoutGenericSuffix( "operator[]", builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append("(int32_t index);\n"); + builders.CppTypeDefinitions.AppendLine("(int32_t index);"); // C++ operator[] method definition AppendCppArrayIndexOperatorMethodDefinition( @@ -4652,88 +4664,88 @@ static void AppendArrayIterator( StringBuilder cppMethodDefinitions) { // Iterator type definition - cppTypeDefinitions.Append("namespace Plugin\n"); - cppTypeDefinitions.Append("{\n"); + cppTypeDefinitions.AppendLine("namespace Plugin"); + cppTypeDefinitions.AppendLine("{"); cppTypeDefinitions.Append("\tstruct "); cppTypeDefinitions.Append(bindingArrayTypeName); - cppTypeDefinitions.Append("Iterator\n"); - cppTypeDefinitions.Append("\t{\n"); + cppTypeDefinitions.AppendLine("Iterator"); + cppTypeDefinitions.AppendLine("\t{"); cppTypeDefinitions.Append("\t\tSystem::"); cppTypeDefinitions.Append(cppGenericArrayTypeName); - cppTypeDefinitions.Append("& array;\n"); - cppTypeDefinitions.Append("\t\tint index;\n"); + cppTypeDefinitions.AppendLine("& array;"); + cppTypeDefinitions.AppendLine("\t\tint index;"); cppTypeDefinitions.Append("\t\t"); cppTypeDefinitions.Append(bindingArrayTypeName); cppTypeDefinitions.Append("Iterator(System::"); cppTypeDefinitions.Append(cppGenericArrayTypeName); - cppTypeDefinitions.Append("& array, int32_t index);\n"); + cppTypeDefinitions.AppendLine("& array, int32_t index);"); cppTypeDefinitions.Append("\t\t"); cppTypeDefinitions.Append(bindingArrayTypeName); - cppTypeDefinitions.Append("Iterator& operator++();\n"); + cppTypeDefinitions.AppendLine("Iterator& operator++();"); cppTypeDefinitions.Append("\t\tbool operator!=(const "); cppTypeDefinitions.Append(bindingArrayTypeName); - cppTypeDefinitions.Append("Iterator& other);\n"); + cppTypeDefinitions.AppendLine("Iterator& other);"); cppTypeDefinitions.Append("\t\t"); AppendCppTypeFullName( elementType, cppTypeDefinitions); - cppTypeDefinitions.Append(" operator*();\n"); - cppTypeDefinitions.Append("\t};\n"); - cppTypeDefinitions.Append("}\n"); - cppTypeDefinitions.Append('\n'); + cppTypeDefinitions.AppendLine(" operator*();"); + cppTypeDefinitions.AppendLine("\t};"); + cppTypeDefinitions.AppendLine("}"); + cppTypeDefinitions.AppendLine();; // begin() and end() declarations - cppTypeDefinitions.Append("namespace System\n"); - cppTypeDefinitions.Append("{\n"); + cppTypeDefinitions.AppendLine("namespace System"); + cppTypeDefinitions.AppendLine("{"); cppTypeDefinitions.Append("\tPlugin::"); cppTypeDefinitions.Append(bindingArrayTypeName); cppTypeDefinitions.Append("Iterator begin(System::"); cppTypeDefinitions.Append(cppGenericArrayTypeName); - cppTypeDefinitions.Append("& array);\n"); + cppTypeDefinitions.AppendLine("& array);"); cppTypeDefinitions.Append("\tPlugin::"); cppTypeDefinitions.Append(bindingArrayTypeName); cppTypeDefinitions.Append("Iterator end(System::"); cppTypeDefinitions.Append(cppGenericArrayTypeName); - cppTypeDefinitions.Append("& array);\n"); - cppTypeDefinitions.Append("}\n"); - cppTypeDefinitions.Append('\n'); + cppTypeDefinitions.AppendLine("& array);"); + cppTypeDefinitions.AppendLine("}"); + cppTypeDefinitions.AppendLine();; // Iterator method definitions - cppMethodDefinitions.Append("namespace Plugin\n"); - cppMethodDefinitions.Append("{\n"); + cppMethodDefinitions.AppendLine("namespace Plugin"); + cppMethodDefinitions.AppendLine("{"); cppMethodDefinitions.Append('\t'); cppMethodDefinitions.Append(bindingArrayTypeName); cppMethodDefinitions.Append("Iterator::"); cppMethodDefinitions.Append(bindingArrayTypeName); cppMethodDefinitions.Append("Iterator(System::"); cppMethodDefinitions.Append(cppGenericArrayTypeName); - cppMethodDefinitions.Append("& array, int32_t index)\n"); - cppMethodDefinitions.Append("\t\t: array(array)\n"); - cppMethodDefinitions.Append("\t\t, index(index)\n"); - cppMethodDefinitions.Append("\t{\n"); - cppMethodDefinitions.Append("\t}\n"); - cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.AppendLine("& array, int32_t index)"); + cppMethodDefinitions.AppendLine("\t\t: array(array)"); + cppMethodDefinitions.AppendLine("\t\t, index(index)"); + cppMethodDefinitions.AppendLine("\t{"); + cppMethodDefinitions.AppendLine("\t}"); + cppMethodDefinitions.AppendLine("\t"); cppMethodDefinitions.Append('\t'); cppMethodDefinitions.Append(bindingArrayTypeName); cppMethodDefinitions.Append("Iterator& "); cppMethodDefinitions.Append(bindingArrayTypeName); cppMethodDefinitions.Append("Iterator::"); - cppMethodDefinitions.Append("operator++()\n"); - cppMethodDefinitions.Append("\t{\n"); - cppMethodDefinitions.Append("\t\tindex++;\n"); - cppMethodDefinitions.Append("\t\treturn *this;\n"); - cppMethodDefinitions.Append("\t}\n"); - cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.AppendLine("operator++()"); + cppMethodDefinitions.AppendLine("\t{"); + cppMethodDefinitions.AppendLine("\t\tindex++;"); + cppMethodDefinitions.AppendLine("\t\treturn *this;"); + cppMethodDefinitions.AppendLine("\t}"); + cppMethodDefinitions.AppendLine("\t"); cppMethodDefinitions.Append("\tbool "); cppMethodDefinitions.Append(bindingArrayTypeName); cppMethodDefinitions.Append("Iterator::"); cppMethodDefinitions.Append("operator!=(const "); cppMethodDefinitions.Append(bindingArrayTypeName); - cppMethodDefinitions.Append("Iterator& other)\n"); - cppMethodDefinitions.Append("\t{\n"); - cppMethodDefinitions.Append("\t\treturn index != other.index;\n"); - cppMethodDefinitions.Append("\t}\n"); - cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.AppendLine("Iterator& other)"); + cppMethodDefinitions.AppendLine("\t{"); + cppMethodDefinitions.AppendLine("\t\treturn index != other.index;"); + cppMethodDefinitions.AppendLine("\t}"); + cppMethodDefinitions.AppendLine("\t"); cppMethodDefinitions.Append('\t'); AppendCppTypeFullName( elementType, @@ -4741,39 +4753,39 @@ static void AppendArrayIterator( cppMethodDefinitions.Append(' '); cppMethodDefinitions.Append(bindingArrayTypeName); cppMethodDefinitions.Append("Iterator::"); - cppMethodDefinitions.Append("operator*()\n"); - cppMethodDefinitions.Append("\t{\n"); - cppMethodDefinitions.Append("\t\treturn array[index];\n"); - cppMethodDefinitions.Append("\t}\n"); - cppMethodDefinitions.Append("}\n"); - cppMethodDefinitions.Append('\n'); + cppMethodDefinitions.AppendLine("operator*()"); + cppMethodDefinitions.AppendLine("\t{"); + cppMethodDefinitions.AppendLine("\t\treturn array[index];"); + cppMethodDefinitions.AppendLine("\t}"); + cppMethodDefinitions.AppendLine("}"); + cppMethodDefinitions.AppendLine();; // begin() and end() definitions - cppMethodDefinitions.Append("namespace System\n"); - cppMethodDefinitions.Append("{\n"); + cppMethodDefinitions.AppendLine("namespace System"); + cppMethodDefinitions.AppendLine("{"); cppMethodDefinitions.Append("\tPlugin::"); cppMethodDefinitions.Append(bindingArrayTypeName); cppMethodDefinitions.Append("Iterator begin(System::"); cppMethodDefinitions.Append(cppGenericArrayTypeName); - cppMethodDefinitions.Append("& array)\n"); - cppMethodDefinitions.Append("\t{\n"); + cppMethodDefinitions.AppendLine("& array)"); + cppMethodDefinitions.AppendLine("\t{"); cppMethodDefinitions.Append("\t\treturn Plugin::"); cppMethodDefinitions.Append(bindingArrayTypeName); - cppMethodDefinitions.Append("Iterator(array, 0);\n"); - cppMethodDefinitions.Append("\t}\n"); - cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.AppendLine("Iterator(array, 0);"); + cppMethodDefinitions.AppendLine("\t}"); + cppMethodDefinitions.AppendLine("\t"); cppMethodDefinitions.Append("\tPlugin::"); cppMethodDefinitions.Append(bindingArrayTypeName); cppMethodDefinitions.Append("Iterator end(System::"); cppMethodDefinitions.Append(cppGenericArrayTypeName); - cppMethodDefinitions.Append("& array)\n"); - cppMethodDefinitions.Append("\t{\n"); + cppMethodDefinitions.AppendLine("& array)"); + cppMethodDefinitions.AppendLine("\t{"); cppMethodDefinitions.Append("\t\treturn Plugin::"); cppMethodDefinitions.Append(bindingArrayTypeName); - cppMethodDefinitions.Append("Iterator(array, array.GetLength() - 1);\n"); - cppMethodDefinitions.Append("\t}\n"); - cppMethodDefinitions.Append("}\n"); - cppMethodDefinitions.Append('\n'); + cppMethodDefinitions.AppendLine("Iterator(array, array.GetLength() - 1);"); + cppMethodDefinitions.AppendLine("\t}"); + cppMethodDefinitions.AppendLine("}"); + cppMethodDefinitions.AppendLine();; } static void AppendGenericEnumerableIterator( @@ -4785,45 +4797,45 @@ static void AppendGenericEnumerableIterator( StringBuilder cppMethodDefinitions) { // Iterator type definition - cppTypeDefinitions.Append("namespace Plugin\n"); - cppTypeDefinitions.Append("{\n"); + cppTypeDefinitions.AppendLine("namespace Plugin"); + cppTypeDefinitions.AppendLine("{"); cppTypeDefinitions.Append("\tstruct "); cppTypeDefinitions.Append(bindingEnumerableTypeName); - cppTypeDefinitions.Append("Iterator\n"); - cppTypeDefinitions.Append("\t{\n"); + cppTypeDefinitions.AppendLine("Iterator"); + cppTypeDefinitions.AppendLine("\t{"); cppTypeDefinitions.Append("\t\t"); AppendCppTypeFullName( enumeratorType, cppTypeDefinitions); - cppTypeDefinitions.Append(" enumerator;\n"); - cppTypeDefinitions.Append("\t\tbool hasMore;\n"); + cppTypeDefinitions.AppendLine(" enumerator;"); + cppTypeDefinitions.AppendLine("\t\tbool hasMore;"); cppTypeDefinitions.Append("\t\t"); cppTypeDefinitions.Append(bindingEnumerableTypeName); - cppTypeDefinitions.Append("Iterator(decltype(nullptr));\n"); + cppTypeDefinitions.AppendLine("Iterator(decltype(nullptr));"); cppTypeDefinitions.Append("\t\t"); cppTypeDefinitions.Append(bindingEnumerableTypeName); cppTypeDefinitions.Append("Iterator("); AppendCppTypeFullName( enumerableType, cppTypeDefinitions); - cppTypeDefinitions.Append("& enumerable);\n"); + cppTypeDefinitions.AppendLine("& enumerable);"); cppTypeDefinitions.Append("\t\t~"); cppTypeDefinitions.Append(bindingEnumerableTypeName); - cppTypeDefinitions.Append("Iterator();\n"); + cppTypeDefinitions.AppendLine("Iterator();"); cppTypeDefinitions.Append("\t\t"); cppTypeDefinitions.Append(bindingEnumerableTypeName); - cppTypeDefinitions.Append("Iterator& operator++();\n"); + cppTypeDefinitions.AppendLine("Iterator& operator++();"); cppTypeDefinitions.Append("\t\tbool operator!=(const "); cppTypeDefinitions.Append(bindingEnumerableTypeName); - cppTypeDefinitions.Append("Iterator& other);\n"); + cppTypeDefinitions.AppendLine("Iterator& other);"); cppTypeDefinitions.Append("\t\t"); AppendCppTypeFullName( elementType, cppTypeDefinitions); - cppTypeDefinitions.Append(" operator*();\n"); - cppTypeDefinitions.Append("\t};\n"); - cppTypeDefinitions.Append("}\n"); - cppTypeDefinitions.Append('\n'); + cppTypeDefinitions.AppendLine(" operator*();"); + cppTypeDefinitions.AppendLine("\t};"); + cppTypeDefinitions.AppendLine("}"); + cppTypeDefinitions.AppendLine();; // begin() and end() declarations int indent = AppendNamespaceBeginning( @@ -4838,7 +4850,7 @@ static void AppendGenericEnumerableIterator( AppendCppTypeFullName( enumerableType, cppTypeDefinitions); - cppTypeDefinitions.Append("& enumerable);\n"); + cppTypeDefinitions.AppendLine("& enumerable);"); AppendIndent( indent, cppTypeDefinitions); @@ -4848,25 +4860,25 @@ static void AppendGenericEnumerableIterator( AppendCppTypeFullName( enumerableType, cppTypeDefinitions); - cppTypeDefinitions.Append("& enumerable);\n"); + cppTypeDefinitions.AppendLine("& enumerable);"); AppendNamespaceEnding( indent, cppTypeDefinitions); - cppTypeDefinitions.Append('\n'); + cppTypeDefinitions.AppendLine();; // Iterator method definitions - cppMethodDefinitions.Append("namespace Plugin\n"); - cppMethodDefinitions.Append("{\n"); + cppMethodDefinitions.AppendLine("namespace Plugin"); + cppMethodDefinitions.AppendLine("{"); cppMethodDefinitions.Append('\t'); cppMethodDefinitions.Append(bindingEnumerableTypeName); cppMethodDefinitions.Append("Iterator::"); cppMethodDefinitions.Append(bindingEnumerableTypeName); - cppMethodDefinitions.Append("Iterator(decltype(nullptr))\n"); - cppMethodDefinitions.Append("\t\t: enumerator(nullptr)\n"); - cppMethodDefinitions.Append("\t\t, hasMore(false)\n"); - cppMethodDefinitions.Append("\t{\n"); - cppMethodDefinitions.Append("\t}\n"); - cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.AppendLine("Iterator(decltype(nullptr))"); + cppMethodDefinitions.AppendLine("\t\t: enumerator(nullptr)"); + cppMethodDefinitions.AppendLine("\t\t, hasMore(false)"); + cppMethodDefinitions.AppendLine("\t{"); + cppMethodDefinitions.AppendLine("\t}"); + cppMethodDefinitions.AppendLine("\t"); cppMethodDefinitions.Append('\t'); cppMethodDefinitions.Append(bindingEnumerableTypeName); cppMethodDefinitions.Append("Iterator::"); @@ -4875,45 +4887,45 @@ static void AppendGenericEnumerableIterator( AppendCppTypeFullName( enumerableType, cppMethodDefinitions); - cppMethodDefinitions.Append("& enumerable)\n"); - cppMethodDefinitions.Append("\t\t: enumerator(enumerable.GetEnumerator())\n"); - cppMethodDefinitions.Append("\t{\n"); - cppMethodDefinitions.Append("\t\thasMore = enumerator.MoveNext();\n"); - cppMethodDefinitions.Append("\t}\n"); - cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.AppendLine("& enumerable)"); + cppMethodDefinitions.AppendLine("\t\t: enumerator(enumerable.GetEnumerator())"); + cppMethodDefinitions.AppendLine("\t{"); + cppMethodDefinitions.AppendLine("\t\thasMore = enumerator.MoveNext();"); + cppMethodDefinitions.AppendLine("\t}"); + cppMethodDefinitions.AppendLine("\t"); cppMethodDefinitions.Append('\t'); cppMethodDefinitions.Append(bindingEnumerableTypeName); cppMethodDefinitions.Append("Iterator::~"); cppMethodDefinitions.Append(bindingEnumerableTypeName); - cppMethodDefinitions.Append("Iterator()\n"); - cppMethodDefinitions.Append("\t{\n"); - cppMethodDefinitions.Append("\t\tif (enumerator != nullptr)\n"); - cppMethodDefinitions.Append("\t\t{\n"); - cppMethodDefinitions.Append("\t\t\tenumerator.Dispose();\n"); - cppMethodDefinitions.Append("\t\t}\n"); - cppMethodDefinitions.Append("\t}\n"); - cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.AppendLine("Iterator()"); + cppMethodDefinitions.AppendLine("\t{"); + cppMethodDefinitions.AppendLine("\t\tif (enumerator != nullptr)"); + cppMethodDefinitions.AppendLine("\t\t{"); + cppMethodDefinitions.AppendLine("\t\t\tenumerator.Dispose();"); + cppMethodDefinitions.AppendLine("\t\t}"); + cppMethodDefinitions.AppendLine("\t}"); + cppMethodDefinitions.AppendLine("\t"); cppMethodDefinitions.Append('\t'); cppMethodDefinitions.Append(bindingEnumerableTypeName); cppMethodDefinitions.Append("Iterator& "); cppMethodDefinitions.Append(bindingEnumerableTypeName); cppMethodDefinitions.Append("Iterator::"); - cppMethodDefinitions.Append("operator++()\n"); - cppMethodDefinitions.Append("\t{\n"); - cppMethodDefinitions.Append("\t\thasMore = enumerator.MoveNext();\n"); - cppMethodDefinitions.Append("\t\treturn *this;\n"); - cppMethodDefinitions.Append("\t}\n"); - cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.AppendLine("operator++()"); + cppMethodDefinitions.AppendLine("\t{"); + cppMethodDefinitions.AppendLine("\t\thasMore = enumerator.MoveNext();"); + cppMethodDefinitions.AppendLine("\t\treturn *this;"); + cppMethodDefinitions.AppendLine("\t}"); + cppMethodDefinitions.AppendLine("\t"); cppMethodDefinitions.Append("\tbool "); cppMethodDefinitions.Append(bindingEnumerableTypeName); cppMethodDefinitions.Append("Iterator::"); cppMethodDefinitions.Append("operator!=(const "); cppMethodDefinitions.Append(bindingEnumerableTypeName); - cppMethodDefinitions.Append("Iterator& other)\n"); - cppMethodDefinitions.Append("\t{\n"); - cppMethodDefinitions.Append("\t\treturn hasMore;\n"); - cppMethodDefinitions.Append("\t}\n"); - cppMethodDefinitions.Append("\t\n"); + cppMethodDefinitions.AppendLine("Iterator& other)"); + cppMethodDefinitions.AppendLine("\t{"); + cppMethodDefinitions.AppendLine("\t\treturn hasMore;"); + cppMethodDefinitions.AppendLine("\t}"); + cppMethodDefinitions.AppendLine("\t"); cppMethodDefinitions.Append('\t'); AppendCppTypeFullName( elementType, @@ -4921,12 +4933,12 @@ static void AppendGenericEnumerableIterator( cppMethodDefinitions.Append(' '); cppMethodDefinitions.Append(bindingEnumerableTypeName); cppMethodDefinitions.Append("Iterator::"); - cppMethodDefinitions.Append("operator*()\n"); - cppMethodDefinitions.Append("\t{\n"); - cppMethodDefinitions.Append("\t\treturn enumerator.GetCurrent();\n"); - cppMethodDefinitions.Append("\t}\n"); - cppMethodDefinitions.Append("}\n"); - cppMethodDefinitions.Append('\n'); + cppMethodDefinitions.AppendLine("operator*()"); + cppMethodDefinitions.AppendLine("\t{"); + cppMethodDefinitions.AppendLine("\t\treturn enumerator.GetCurrent();"); + cppMethodDefinitions.AppendLine("\t}"); + cppMethodDefinitions.AppendLine("}"); + cppMethodDefinitions.AppendLine();; // begin() and end() definitions indent = AppendNamespaceBeginning( @@ -4941,25 +4953,25 @@ static void AppendGenericEnumerableIterator( AppendCppTypeFullName( enumerableType, cppMethodDefinitions); - cppMethodDefinitions.Append("& enumerable)\n"); + cppMethodDefinitions.AppendLine("& enumerable)"); AppendIndent( indent, cppMethodDefinitions); - cppMethodDefinitions.Append("{\n"); + cppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 1, cppMethodDefinitions); cppMethodDefinitions.Append("return Plugin::"); cppMethodDefinitions.Append(bindingEnumerableTypeName); - cppMethodDefinitions.Append("Iterator(enumerable);\n"); + cppMethodDefinitions.AppendLine("Iterator(enumerable);"); AppendIndent( indent, cppMethodDefinitions); - cppMethodDefinitions.Append("}\n"); + cppMethodDefinitions.AppendLine("}"); AppendIndent( indent, cppMethodDefinitions); - cppMethodDefinitions.Append('\n'); + cppMethodDefinitions.AppendLine();; AppendIndent( indent, cppMethodDefinitions); @@ -4969,25 +4981,25 @@ static void AppendGenericEnumerableIterator( AppendCppTypeFullName( enumerableType, cppMethodDefinitions); - cppMethodDefinitions.Append("& enumerable)\n"); + cppMethodDefinitions.AppendLine("& enumerable)"); AppendIndent( indent, cppMethodDefinitions); - cppMethodDefinitions.Append("{\n"); + cppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 1, cppMethodDefinitions); cppMethodDefinitions.Append("return Plugin::"); cppMethodDefinitions.Append(bindingEnumerableTypeName); - cppMethodDefinitions.Append("Iterator(nullptr);\n"); + cppMethodDefinitions.AppendLine("Iterator(nullptr);"); AppendIndent( indent, cppMethodDefinitions); - cppMethodDefinitions.Append("}\n"); + cppMethodDefinitions.AppendLine("}"); AppendNamespaceEnding( indent, cppMethodDefinitions); - cppMethodDefinitions.Append('\n'); + cppMethodDefinitions.AppendLine();; } static void AppendCppArrayIndexOperatorMethodDefinition( @@ -5009,11 +5021,11 @@ static void AppendCppArrayIndexOperatorMethodDefinition( AppendTypeNameWithoutGenericSuffix( enclosingTypeTypeName.Name, output); - output.Append("::operator[](int32_t index)\n"); + output.AppendLine("::operator[](int32_t index)"); AppendIndent( indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( indent + 1, output); @@ -5026,15 +5038,15 @@ static void AppendCppArrayIndexOperatorMethodDefinition( output.Append(i); output.Append(", "); } - output.Append("index);\n"); + output.AppendLine("index);"); AppendIndent( indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( indent, output); - output.Append('\n'); + output.AppendLine();; } static void AppendCppArrayTypeName( @@ -5215,11 +5227,11 @@ static void AppendArrayElementProxy( AppendTypeNameWithoutGenericSuffix( cppElementProxyTypeName, builders.CppTemplateSpecializationDeclarations); - builders.CppTemplateSpecializationDeclarations.Append(";\n"); + builders.CppTemplateSpecializationDeclarations.AppendLine(";"); AppendNamespaceEnding( indent, builders.CppTemplateSpecializationDeclarations); - builders.CppTemplateSpecializationDeclarations.Append('\n'); + builders.CppTemplateSpecializationDeclarations.AppendLine();; // C++ element proxy type definition AppendNamespaceBeginning( @@ -5230,15 +5242,15 @@ static void AppendArrayElementProxy( builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append("template<> struct "); builders.CppTypeDefinitions.Append(cppElementProxyTypeName); - builders.CppTypeDefinitions.Append('\n'); + builders.CppTypeDefinitions.AppendLine();; AppendIndent( indent, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append("{\n"); + builders.CppTypeDefinitions.AppendLine("{"); AppendIndent( indent + 1, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append("int32_t Handle;\n"); + builders.CppTypeDefinitions.AppendLine("int32_t Handle;"); for (int i = 0; i < rank; ++i) { AppendIndent( @@ -5246,7 +5258,7 @@ static void AppendArrayElementProxy( builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append("int32_t Index"); builders.CppTypeDefinitions.Append(i); - builders.CppTypeDefinitions.Append(";\n"); + builders.CppTypeDefinitions.AppendLine(";"); } AppendIndent( indent + 1, @@ -5263,7 +5275,7 @@ static void AppendArrayElementProxy( builders.CppTypeDefinitions.Append(", "); } } - builders.CppTypeDefinitions.Append(");\n"); + builders.CppTypeDefinitions.AppendLine(");"); if (rank == maxRank) { AppendIndent( @@ -5273,7 +5285,7 @@ static void AppendArrayElementProxy( AppendCppTypeFullName( elementType, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append(" item);\n"); + builders.CppTypeDefinitions.AppendLine(" item);"); AppendIndent( indent + 1, builders.CppTypeDefinitions); @@ -5281,7 +5293,7 @@ static void AppendArrayElementProxy( AppendCppTypeFullName( elementType, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append("();\n"); + builders.CppTypeDefinitions.AppendLine("();"); } else { @@ -5295,14 +5307,14 @@ static void AppendArrayElementProxy( elementType, builders.CppTypeDefinitions); builders.CppTypeDefinitions.Append(" operator[]("); - builders.CppTypeDefinitions.Append("int32_t index);\n"); + builders.CppTypeDefinitions.AppendLine("int32_t index);"); } AppendIndent( indent, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append("};\n"); - builders.CppTypeDefinitions.Append("}\n"); - builders.CppTypeDefinitions.Append('\n'); + builders.CppTypeDefinitions.AppendLine("};"); + builders.CppTypeDefinitions.AppendLine("}"); + builders.CppTypeDefinitions.AppendLine();; // C++ element proxy method definitions (beginning) int cppMethodDefinitionsIndent = AppendNamespaceBeginning( @@ -5330,15 +5342,15 @@ static void AppendArrayElementProxy( builders.CppMethodDefinitions.Append(", "); } } - builders.CppMethodDefinitions.Append(")\n"); + builders.CppMethodDefinitions.AppendLine(")"); AppendIndent( cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Handle = handle;\n"); + builders.CppMethodDefinitions.AppendLine("Handle = handle;"); for (int i = 0; i < rank; ++i) { AppendIndent( @@ -5348,16 +5360,16 @@ static void AppendArrayElementProxy( builders.CppMethodDefinitions.Append(i); builders.CppMethodDefinitions.Append(" = index"); builders.CppMethodDefinitions.Append(i); - builders.CppMethodDefinitions.Append(";\n"); + builders.CppMethodDefinitions.AppendLine(";"); } AppendIndent( cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; if (rank == maxRank) { @@ -5372,11 +5384,11 @@ static void AppendArrayElementProxy( AppendCppTypeFullName( elementType, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(" item)\n"); + builders.CppMethodDefinitions.AppendLine(" item)"); AppendIndent( cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendCppPluginFunctionCall( false, GetTypeName(cppArrayTypeName, "System"), @@ -5390,11 +5402,11 @@ static void AppendArrayElementProxy( AppendIndent( cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; // C++ element proxy type conversion operator definition AppendIndent( @@ -5406,11 +5418,11 @@ static void AppendArrayElementProxy( AppendCppTypeFullName( elementType, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("()\n"); + builders.CppMethodDefinitions.AppendLine("()"); AppendIndent( cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendCppPluginFunctionCall( false, GetTypeName(cppArrayTypeName, "System"), @@ -5429,7 +5441,7 @@ static void AppendArrayElementProxy( AppendIndent( cppMethodDefinitionsIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); } else { @@ -5594,13 +5606,13 @@ static void AppendArrayConstructor( AppendCppTypeFullName( interfaceType, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("(nullptr)\n"); + builders.CppMethodDefinitions.AppendLine("(nullptr)"); separator = ", "; } AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendCppPluginFunctionCall( true, cppArrayTypeTypeName, @@ -5614,18 +5626,18 @@ static void AppendArrayConstructor( AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "Handle = returnValue;\n"); + builders.CppMethodDefinitions.AppendLine( + "Handle = returnValue;"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "if (returnValue)\n"); + builders.CppMethodDefinitions.AppendLine( + "if (returnValue)"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "{\n"); + builders.CppMethodDefinitions.AppendLine( + "{"); AppendIndent( indent + 2, builders.CppMethodDefinitions); @@ -5635,7 +5647,7 @@ static void AppendArrayConstructor( cppTypeParams, "returnValue", builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(";\n"); + builders.CppMethodDefinitions.AppendLine(";"); if (rank > 1) { AppendIndent( @@ -5651,7 +5663,7 @@ static void AppendArrayConstructor( builders.CppMethodDefinitions.Append(" * "); } } - builders.CppMethodDefinitions.Append(";\n"); + builders.CppMethodDefinitions.AppendLine(";"); for (int i = 0; i < rank; ++i) { AppendIndent( @@ -5661,7 +5673,7 @@ static void AppendArrayConstructor( builders.CppMethodDefinitions.Append(i); builders.CppMethodDefinitions.Append("] = length"); builders.CppMethodDefinitions.Append(i); - builders.CppMethodDefinitions.Append(";\n"); + builders.CppMethodDefinitions.AppendLine(";"); } } else @@ -5669,22 +5681,22 @@ static void AppendArrayConstructor( AppendIndent( indent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "InternalLength = length0;\n"); + builders.CppMethodDefinitions.AppendLine( + "InternalLength = length0;"); } AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "}\n"); + builders.CppMethodDefinitions.AppendLine( + "}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; } static void AppendArrayCppGetLengthFunction( @@ -5722,46 +5734,46 @@ static void AppendArrayCppGetLengthFunction( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "int32_t returnVal = InternalLength;\n"); + builders.CppMethodDefinitions.AppendLine( + "int32_t returnVal = InternalLength;"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("if (returnVal == 0)\n"); + builders.CppMethodDefinitions.AppendLine("if (returnVal == 0)"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "returnVal = Array::GetLength();\n"); + builders.CppMethodDefinitions.AppendLine( + "returnVal = Array::GetLength();"); AppendIndent( indent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "InternalLength = returnVal;\n"); + builders.CppMethodDefinitions.AppendLine( + "InternalLength = returnVal;"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("};\n"); + builders.CppMethodDefinitions.AppendLine("};"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("return returnVal;\n"); + builders.CppMethodDefinitions.AppendLine("return returnVal;"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; } static void AppendArrayCppGetRankFunction( @@ -5800,21 +5812,21 @@ static void AppendArrayCppGetRankFunction( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("return "); builders.CppMethodDefinitions.Append(rank); - builders.CppMethodDefinitions.Append(";\n"); + builders.CppMethodDefinitions.AppendLine(";"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; } static void AppendArrayMultidimensionalGetLength( @@ -5938,35 +5950,35 @@ static void AppendArrayMultidimensionalGetLength( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append( "assert(dimension >= 0 && dimension < "); builders.CppMethodDefinitions.Append(rank); - builders.CppMethodDefinitions.Append(");\n"); + builders.CppMethodDefinitions.AppendLine(");"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "int32_t length = InternalLengths[dimension];\n"); + builders.CppMethodDefinitions.AppendLine( + "int32_t length = InternalLengths[dimension];"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("if (length)\n"); + builders.CppMethodDefinitions.AppendLine("if (length)"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("return length;\n"); + builders.CppMethodDefinitions.AppendLine("return length;"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendCppPluginFunctionCall( false, GetTypeName(cppArrayTypeName, "System"), @@ -5980,8 +5992,8 @@ static void AppendArrayMultidimensionalGetLength( AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append( - "InternalLengths[dimension] = returnValue;\n"); + builders.CppMethodDefinitions.AppendLine( + "InternalLengths[dimension] = returnValue;"); AppendCppMethodReturn( typeof(int), TypeKind.Primitive, @@ -5990,11 +6002,11 @@ static void AppendArrayMultidimensionalGetLength( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; } static void AppendArrayGetItem( @@ -6388,11 +6400,11 @@ static void AppendDelegate( AppendIndent( indent + 1, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append("int32_t CppHandle;\n"); + builders.CppTypeDefinitions.AppendLine("int32_t CppHandle;"); AppendIndent( indent + 1, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append("int32_t ClassHandle;\n"); + builders.CppTypeDefinitions.AppendLine("int32_t ClassHandle;"); // C++ method declarations AppendIndent( @@ -6632,24 +6644,24 @@ static void AppendDelegate( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("Plugin::"); builders.CppMethodDefinitions.Append(addFuncName); - builders.CppMethodDefinitions.Append("(Handle, del.Handle);\n"); + builders.CppMethodDefinitions.AppendLine("(Handle, del.Handle);"); AppendCppUnhandledExceptionHandling( indent + 1, builders.CppMethodDefinitions); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; // C++ remove AppendCppMethodDefinitionBegin( @@ -6664,24 +6676,24 @@ static void AppendDelegate( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("Plugin::"); builders.CppMethodDefinitions.Append(removeFuncName); - builders.CppMethodDefinitions.Append("(Handle, del.Handle);\n"); + builders.CppMethodDefinitions.AppendLine("(Handle, del.Handle);"); AppendCppUnhandledExceptionHandling( indent + 1, builders.CppMethodDefinitions); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; // C# GetDelegate call AppendCsharpGetDelegateCall( @@ -6693,27 +6705,27 @@ static void AppendDelegate( // C# class (beginning) builders.CsharpBaseTypes.Append("class "); builders.CsharpBaseTypes.Append(bindingTypeName); - builders.CsharpBaseTypes.Append('\n'); - builders.CsharpBaseTypes.Append("{\n"); + builders.CsharpBaseTypes.AppendLine();; + builders.CsharpBaseTypes.AppendLine("{"); // C# class fields - builders.CsharpBaseTypes.Append("\tpublic int CppHandle;\n"); + builders.CsharpBaseTypes.AppendLine("\tpublic int CppHandle;"); builders.CsharpBaseTypes.Append("\tpublic "); AppendCsharpTypeFullName( type, builders.CsharpBaseTypes); - builders.CsharpBaseTypes.Append(" Delegate;\n"); - builders.CsharpBaseTypes.Append("\t\n"); + builders.CsharpBaseTypes.AppendLine(" Delegate;"); + builders.CsharpBaseTypes.AppendLine("\t"); // C# class constructor builders.CsharpBaseTypes.Append("\tpublic "); builders.CsharpBaseTypes.Append(bindingTypeName); - builders.CsharpBaseTypes.Append("(int cppHandle)\n"); - builders.CsharpBaseTypes.Append("\t{\n"); - builders.CsharpBaseTypes.Append("\t\tCppHandle = cppHandle;\n"); - builders.CsharpBaseTypes.Append("\t\tDelegate = NativeInvoke;\n"); - builders.CsharpBaseTypes.Append("\t}\n"); - builders.CsharpBaseTypes.Append("\t\n"); + builders.CsharpBaseTypes.AppendLine("(int cppHandle)"); + builders.CsharpBaseTypes.AppendLine("\t{"); + builders.CsharpBaseTypes.AppendLine("\t\tCppHandle = cppHandle;"); + builders.CsharpBaseTypes.AppendLine("\t\tDelegate = NativeInvoke;"); + builders.CsharpBaseTypes.AppendLine("\t}"); + builders.CsharpBaseTypes.AppendLine("\t"); // Build the name of the C++ binding function that C# calls builders.TempStrBuilder.Length = 0; @@ -6741,8 +6753,8 @@ static void AppendDelegate( builders); // C# class (ending) - builders.CsharpBaseTypes.Append("}\n"); - builders.CsharpBaseTypes.Append('\n'); + builders.CsharpBaseTypes.AppendLine("}"); + builders.CsharpBaseTypes.AppendLine();; // Invoke() is how C++ invokes the delegate AppendBaseTypeMethodCallsCsharpMethod( @@ -7048,7 +7060,7 @@ static void AppendBaseType( AppendIndent( indent + 1, builders.CppTypeDefinitions); - builders.CppTypeDefinitions.Append("int32_t CppHandle;\n"); + builders.CppTypeDefinitions.AppendLine("int32_t CppHandle;"); // C++ constructor declarations for (int i = 0; i < numConstructors; ++i) @@ -7076,12 +7088,12 @@ static void AppendBaseType( AppendUppercaseWithUnderscores( derivedTypeTypeName.Name, builders.CppMacros); - builders.CppMacros.Append("_DEFAULT_CONSTRUCTOR_DECLARATION \\\n"); + builders.CppMacros.AppendLine("_DEFAULT_CONSTRUCTOR_DECLARATION \\"); AppendIndent(indent, builders.CppMacros); builders.CppMacros.Append(derivedTypeTypeName.Name); - builders.CppMacros.Append("(Plugin::InternalUse iu, int32_t handle);\n"); + builders.CppMacros.AppendLine("(Plugin::InternalUse iu, int32_t handle);"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append('\n'); + builders.CppMacros.AppendLine();; // C++ constructor definition macro builders.CppMacros.Append("#define "); @@ -7092,12 +7104,12 @@ static void AppendBaseType( AppendUppercaseWithUnderscores( derivedTypeTypeName.Name, builders.CppMacros); - builders.CppMacros.Append("_DEFAULT_CONSTRUCTOR_DEFINITION \\\n"); + builders.CppMacros.AppendLine("_DEFAULT_CONSTRUCTOR_DEFINITION \\"); AppendIndent(indent, builders.CppMacros); builders.CppMacros.Append(derivedTypeTypeName.Name); builders.CppMacros.Append("::"); builders.CppMacros.Append(derivedTypeTypeName.Name); - builders.CppMacros.Append("(Plugin::InternalUse iu, int32_t handle) \\\n"); + builders.CppMacros.AppendLine("(Plugin::InternalUse iu, int32_t handle) \\"); AppendCppConstructorInitializerList( cppCtorInitTypes, indent + 1, @@ -7108,13 +7120,13 @@ static void AppendBaseType( AppendCppTypeFullName( baseTypeTypeName, builders.CppMacros); - builders.CppMacros.Append("(iu, handle) \\\n"); + builders.CppMacros.AppendLine("(iu, handle) \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("{ \\\n"); + builders.CppMacros.AppendLine("{ \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("}\n"); + builders.CppMacros.AppendLine("}"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append('\n'); + builders.CppMacros.AppendLine();; // C++ constructor inline definition macro builders.CppMacros.Append("#define "); @@ -7125,10 +7137,10 @@ static void AppendBaseType( AppendUppercaseWithUnderscores( derivedTypeTypeName.Name, builders.CppMacros); - builders.CppMacros.Append("_DEFAULT_CONSTRUCTOR \\\n"); + builders.CppMacros.AppendLine("_DEFAULT_CONSTRUCTOR \\"); AppendIndent(indent, builders.CppMacros); builders.CppMacros.Append(derivedTypeTypeName.Name); - builders.CppMacros.Append("(Plugin::InternalUse iu, int32_t handle) \\\n"); + builders.CppMacros.AppendLine("(Plugin::InternalUse iu, int32_t handle) \\"); AppendCppConstructorInitializerList( cppCtorInitTypes, indent + 1, @@ -7139,13 +7151,13 @@ static void AppendBaseType( AppendCppTypeFullName( baseTypeTypeName, builders.CppMacros); - builders.CppMacros.Append("(iu, handle) \\\n"); + builders.CppMacros.AppendLine("(iu, handle) \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("{ \\\n"); + builders.CppMacros.AppendLine("{ \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("}\n"); + builders.CppMacros.AppendLine("}"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append('\n'); + builders.CppMacros.AppendLine();; // C++ default contents declaration macro builders.CppMacros.Append("#define "); @@ -7156,13 +7168,13 @@ static void AppendBaseType( AppendUppercaseWithUnderscores( derivedTypeTypeName.Name, builders.CppMacros); - builders.CppMacros.Append("_DEFAULT_CONTENTS_DECLARATION \\\n"); + builders.CppMacros.AppendLine("_DEFAULT_CONTENTS_DECLARATION \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("void* operator new(size_t, void* p) noexcept; \\\n"); + builders.CppMacros.AppendLine("void* operator new(size_t, void* p) noexcept; \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("void operator delete(void*, size_t) noexcept; \\\n"); + builders.CppMacros.AppendLine("void operator delete(void*, size_t) noexcept; \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append('\n'); + builders.CppMacros.AppendLine();; // C++ default contents definition macro builders.CppMacros.Append("#define "); @@ -7173,27 +7185,27 @@ static void AppendBaseType( AppendUppercaseWithUnderscores( derivedTypeTypeName.Name, builders.CppMacros); - builders.CppMacros.Append("_DEFAULT_CONTENTS_DEFINITION \\\n"); + builders.CppMacros.AppendLine("_DEFAULT_CONTENTS_DEFINITION \\"); AppendIndent(indent, builders.CppMacros); builders.CppMacros.Append("void* "); builders.CppMacros.Append(derivedTypeTypeName.Name); - builders.CppMacros.Append("::operator new(size_t, void* p) noexcept\\\n"); + builders.CppMacros.AppendLine("::operator new(size_t, void* p) noexcept\\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("{ \\\n"); + builders.CppMacros.AppendLine("{ \\"); AppendIndent(indent + 1, builders.CppMacros); - builders.CppMacros.Append("return p; \\\n"); + builders.CppMacros.AppendLine("return p; \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("} \\\n"); + builders.CppMacros.AppendLine("} \\"); AppendIndent(indent, builders.CppMacros); builders.CppMacros.Append("void "); builders.CppMacros.Append(derivedTypeTypeName.Name); - builders.CppMacros.Append("::operator delete(void*, size_t) noexcept \\\n"); + builders.CppMacros.AppendLine("::operator delete(void*, size_t) noexcept \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("{ \\\n"); + builders.CppMacros.AppendLine("{ \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("}\n"); + builders.CppMacros.AppendLine("}"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append('\n'); + builders.CppMacros.AppendLine();; // C++ default contents inline definition macro builders.CppMacros.Append("#define "); @@ -7204,23 +7216,23 @@ static void AppendBaseType( AppendUppercaseWithUnderscores( derivedTypeTypeName.Name, builders.CppMacros); - builders.CppMacros.Append("_DEFAULT_CONTENTS\\\n"); + builders.CppMacros.AppendLine("_DEFAULT_CONTENTS\\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("void* operator new(size_t, void* p) noexcept \\\n"); + builders.CppMacros.AppendLine("void* operator new(size_t, void* p) noexcept \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("{ \\\n"); + builders.CppMacros.AppendLine("{ \\"); AppendIndent(indent + 1, builders.CppMacros); - builders.CppMacros.Append("return p; \\\n"); + builders.CppMacros.AppendLine("return p; \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("} \\\n"); + builders.CppMacros.AppendLine("} \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("void operator delete(void*, size_t) noexcept \\\n"); + builders.CppMacros.AppendLine("void operator delete(void*, size_t) noexcept \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("{ \\\n"); + builders.CppMacros.AppendLine("{ \\"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append("}\n"); + builders.CppMacros.AppendLine("}"); AppendIndent(indent, builders.CppMacros); - builders.CppMacros.Append('\n'); + builders.CppMacros.AppendLine();; // C++ function pointers AppendCppFunctionPointerDefinition( @@ -7403,11 +7415,11 @@ static void AppendBaseType( builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("DLLEXPORT int32_t "); builders.CppMethodDefinitions.Append(cppDefaultConstructorBindingFunctionName); - builders.CppMethodDefinitions.Append("(int32_t handle)\n"); + builders.CppMethodDefinitions.AppendLine("(int32_t handle)"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 1, builders.CppMethodDefinitions); @@ -7416,7 +7428,7 @@ static void AppendBaseType( builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("* memory = Plugin::StoreWhole"); builders.CppMethodDefinitions.Append(baseTypeTypeName.Name); - builders.CppMethodDefinitions.Append("();\n"); + builders.CppMethodDefinitions.AppendLine("();"); AppendIndent( indent + 1, builders.CppMethodDefinitions); @@ -7427,15 +7439,16 @@ static void AppendBaseType( AppendCppTypeFullName( derivedTypeTypeName, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("(Plugin::InternalUse::Only, handle);\n"); + builders.CppMethodDefinitions.AppendLine("(Plugin::InternalUse::Only, handle);"); AppendIndent( indent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("return thiz->CppHandle;\n"); + builders.CppMethodDefinitions.AppendLine("return thiz->CppHandle;"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n\n"); + builders.CppMethodDefinitions.AppendLine("}"); + builders.CppMethodDefinitions.AppendLine(); // C# usage of the C++ binding function to create from C# default constructor ParameterInfo[] cppDefaultConstructorBindingFunctionParams = ConvertParameters( @@ -7472,11 +7485,11 @@ static void AppendBaseType( builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("DLLEXPORT void "); builders.CppMethodDefinitions.Append(cppDestroyBindingFunctionName); - builders.CppMethodDefinitions.Append("(int32_t cppHandle)\n"); + builders.CppMethodDefinitions.AppendLine("(int32_t cppHandle)"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( indent + 1, builders.CppMethodDefinitions); @@ -7485,7 +7498,7 @@ static void AppendBaseType( builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append("* instance = Plugin::Get"); builders.CppMethodDefinitions.Append(baseTypeTypeName.Name); - builders.CppMethodDefinitions.Append("(cppHandle);\n"); + builders.CppMethodDefinitions.AppendLine("(cppHandle);"); AppendIndent( indent + 1, builders.CppMethodDefinitions); @@ -7493,11 +7506,12 @@ static void AppendBaseType( AppendCppTypeName( baseTypeTypeName, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("();\n"); + builders.CppMethodDefinitions.AppendLine("();"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n\n"); + builders.CppMethodDefinitions.AppendLine("}"); + builders.CppMethodDefinitions.AppendLine(); // C# usage of the C++ binding function to destroy from C# default constructor ParameterInfo[] cppDestroyBindingFunctionParams = ConvertParameters( @@ -7529,23 +7543,23 @@ static void AppendBaseType( // C# DestroyFunction enumerator builders.CsharpDestroyFunctionEnumerators.Append("\t\t\t"); builders.CsharpDestroyFunctionEnumerators.Append(baseTypeTypeName.Name); - builders.CsharpDestroyFunctionEnumerators.Append(",\n"); + builders.CsharpDestroyFunctionEnumerators.AppendLine(","); // C# Destroy queue cases builders.CsharpDestroyQueueCases.Append("\t\t\t\t\t\tcase DestroyFunction."); builders.CsharpDestroyQueueCases.Append(baseTypeTypeName.Name); - builders.CsharpDestroyQueueCases.Append(":\n"); + builders.CsharpDestroyQueueCases.AppendLine(":"); builders.CsharpDestroyQueueCases.Append("\t\t\t\t\t\t\t"); builders.CsharpDestroyQueueCases.Append(cppDestroyBindingFunctionName); - builders.CsharpDestroyQueueCases.Append("(entry.CppHandle);\n"); - builders.CsharpDestroyQueueCases.Append("\t\t\t\t\t\t\tbreak;\n"); + builders.CsharpDestroyQueueCases.AppendLine("(entry.CppHandle);"); + builders.CsharpDestroyQueueCases.AppendLine("\t\t\t\t\t\t\tbreak;"); } // C# class (beginning) builders.CsharpBaseTypes.Append("namespace "); builders.CsharpBaseTypes.Append(baseTypeTypeName.Namespace); - builders.CsharpBaseTypes.Append('\n'); - builders.CsharpBaseTypes.Append("{\n"); + builders.CsharpBaseTypes.AppendLine();; + builders.CsharpBaseTypes.AppendLine("{"); builders.CsharpBaseTypes.Append("\tclass "); builders.CsharpBaseTypes.Append(baseTypeTypeName.Name); if (jsonBaseType != null) @@ -7555,12 +7569,12 @@ static void AppendBaseType( type, builders.CsharpBaseTypes); } - builders.CsharpBaseTypes.Append('\n'); - builders.CsharpBaseTypes.Append("\t{\n"); + builders.CsharpBaseTypes.AppendLine();; + builders.CsharpBaseTypes.AppendLine("\t{"); // C# class fields - builders.CsharpBaseTypes.Append("\t\tpublic int CppHandle;\n"); - builders.CsharpBaseTypes.Append("\t\t\n"); + builders.CsharpBaseTypes.AppendLine("\t\tpublic int CppHandle;"); + builders.CsharpBaseTypes.AppendLine("\t\t"); if (derivedTypeTypeName.Name != null) { @@ -7569,33 +7583,33 @@ static void AppendBaseType( { builders.CsharpBaseTypes.Append("\t\tpublic "); builders.CsharpBaseTypes.Append(baseTypeTypeName.Name); - builders.CsharpBaseTypes.Append("()\n"); - builders.CsharpBaseTypes.Append("\t\t{\n"); - builders.CsharpBaseTypes.Append( - "\t\t\tint handle = NativeScript.Bindings.ObjectStore.Store(this);\n"); + builders.CsharpBaseTypes.AppendLine("()"); + builders.CsharpBaseTypes.AppendLine("\t\t{"); + builders.CsharpBaseTypes.AppendLine( + "\t\t\tint handle = NativeScript.Bindings.ObjectStore.Store(this);"); builders.CsharpBaseTypes.Append( "\t\t\tCppHandle = NativeScript.Bindings.New"); builders.CsharpBaseTypes.Append(baseTypeTypeName.Name); - builders.CsharpBaseTypes.Append("(handle);\n"); - builders.CsharpBaseTypes.Append("\t\t}\n"); - builders.CsharpBaseTypes.Append("\t\t\n"); + builders.CsharpBaseTypes.AppendLine("(handle);"); + builders.CsharpBaseTypes.AppendLine("\t\t}"); + builders.CsharpBaseTypes.AppendLine("\t\t"); } // C# finalizer/destructor builders.CsharpBaseTypes.Append("\t\t~"); builders.CsharpBaseTypes.Append(baseTypeTypeName.Name); - builders.CsharpBaseTypes.Append("()\n"); - builders.CsharpBaseTypes.Append("\t\t{\n"); - builders.CsharpBaseTypes.Append("\t\t\tif (CppHandle != 0)\n"); - builders.CsharpBaseTypes.Append("\t\t\t{\n"); + builders.CsharpBaseTypes.AppendLine("()"); + builders.CsharpBaseTypes.AppendLine("\t\t{"); + builders.CsharpBaseTypes.AppendLine("\t\t\tif (CppHandle != 0)"); + builders.CsharpBaseTypes.AppendLine("\t\t\t{"); builders.CsharpBaseTypes.Append( "\t\t\t\tNativeScript.Bindings.QueueDestroy(NativeScript.Bindings.DestroyFunction."); builders.CsharpBaseTypes.Append(baseTypeTypeName.Name); - builders.CsharpBaseTypes.Append(", CppHandle);\n"); - builders.CsharpBaseTypes.Append("\t\t\t\tCppHandle = 0;\n"); - builders.CsharpBaseTypes.Append("\t\t\t}\n"); - builders.CsharpBaseTypes.Append("\t\t}\n"); - builders.CsharpBaseTypes.Append("\t\t\n"); + builders.CsharpBaseTypes.AppendLine(", CppHandle);"); + builders.CsharpBaseTypes.AppendLine("\t\t\t\tCppHandle = 0;"); + builders.CsharpBaseTypes.AppendLine("\t\t\t}"); + builders.CsharpBaseTypes.AppendLine("\t\t}"); + builders.CsharpBaseTypes.AppendLine("\t\t"); } // C# class constructors @@ -7612,16 +7626,16 @@ static void AppendBaseType( parameters, builders.CsharpBaseTypes); } - builders.CsharpBaseTypes.Append(")\n"); + builders.CsharpBaseTypes.AppendLine(")"); builders.CsharpBaseTypes.Append("\t\t\t: base("); AppendCsharpFunctionCallParameters( parameters, builders.CsharpBaseTypes); - builders.CsharpBaseTypes.Append(")\n"); - builders.CsharpBaseTypes.Append("\t\t{\n"); - builders.CsharpBaseTypes.Append("\t\t\tCppHandle = cppHandle;\n"); - builders.CsharpBaseTypes.Append("\t\t}\n"); - builders.CsharpBaseTypes.Append("\t\t\n"); + builders.CsharpBaseTypes.AppendLine(")"); + builders.CsharpBaseTypes.AppendLine("\t\t{"); + builders.CsharpBaseTypes.AppendLine("\t\t\tCppHandle = cppHandle;"); + builders.CsharpBaseTypes.AppendLine("\t\t}"); + builders.CsharpBaseTypes.AppendLine("\t\t"); } // C# constructor delegate type @@ -7975,9 +7989,9 @@ static void AppendBaseType( } // C# class (ending) - builders.CsharpBaseTypes.Append("\t}\n"); - builders.CsharpBaseTypes.Append("}\n"); - builders.CsharpBaseTypes.Append("\n"); + builders.CsharpBaseTypes.AppendLine("\t}"); + builders.CsharpBaseTypes.AppendLine("}"); + builders.CsharpBaseTypes.AppendLine(); // C++ method definitions (end) AppendCppMethodDefinitionsEnd( @@ -8077,8 +8091,8 @@ static void AppendBaseTypeProperty( builders.CsharpBaseTypes); builders.CsharpBaseTypes.Append(']'); } - builders.CsharpBaseTypes.Append('\n'); - builders.CsharpBaseTypes.Append("\t\t{\n"); + builders.CsharpBaseTypes.AppendLine();; + builders.CsharpBaseTypes.AppendLine("\t\t{"); TypeKind propertyTypeKind = GetTypeKind( propertyInfo.PropertyType); @@ -8115,8 +8129,8 @@ static void AppendBaseTypeProperty( builders); } - builders.CsharpBaseTypes.Append("\t\t}\n"); - builders.CsharpBaseTypes.Append("\t\t\n"); + builders.CsharpBaseTypes.AppendLine("\t\t}"); + builders.CsharpBaseTypes.AppendLine("\t\t"); } static void AppendBaseTypeEvent( @@ -8142,8 +8156,8 @@ static void AppendBaseTypeEvent( builders.CsharpBaseTypes); builders.CsharpBaseTypes.Append(' '); builders.CsharpBaseTypes.Append(eventInfo.Name); - builders.CsharpBaseTypes.Append('\n'); - builders.CsharpBaseTypes.Append("\t\t{\n"); + builders.CsharpBaseTypes.AppendLine();; + builders.CsharpBaseTypes.AppendLine("\t\t{"); TypeKind eventHandlerTypeKind = GetTypeKind( eventInfo.EventHandlerType); @@ -8180,8 +8194,8 @@ static void AppendBaseTypeEvent( builders); } - builders.CsharpBaseTypes.Append("\t\t\t}\n"); - builders.CsharpBaseTypes.Append("\t\t\t\n"); + builders.CsharpBaseTypes.AppendLine("\t\t\t}"); + builders.CsharpBaseTypes.AppendLine("\t\t\t"); } static void AppendBaseTypeNativePropertyOrEvent( @@ -8238,8 +8252,8 @@ static void AppendBaseTypeNativePropertyOrEvent( operationType, 1, operationType.Length - 1); - builders.CsharpBaseTypes.Append('\n'); - builders.CsharpBaseTypes.Append("\t\t\t{\n"); + builders.CsharpBaseTypes.AppendLine();; + builders.CsharpBaseTypes.AppendLine("\t\t\t{"); AppendCsharpBaseTypeCppMethodCallMethodBody( methodInfo, nativeInvokeFuncName, @@ -8247,7 +8261,7 @@ static void AppendBaseTypeNativePropertyOrEvent( propertyOrEventTypeKind, 4, builders.CsharpBaseTypes); - builders.CsharpBaseTypes.Append("\t\t\t}\n"); + builders.CsharpBaseTypes.AppendLine("\t\t\t}"); } static void AppendCsharpParams( @@ -8339,7 +8353,7 @@ static void AppendBaseTypeMethodCallsCsharpMethod( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendCppPluginFunctionCall( false, GetTypeName(type), @@ -8358,11 +8372,11 @@ static void AppendBaseTypeMethodCallsCsharpMethod( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; // C# delegate type for the binding function that C++ calls ParameterInfo[] invokeParamsWithThis = new ParameterInfo[ @@ -8524,7 +8538,7 @@ static ParameterInfo[] AppendBaseTypeCppNativeInvokeCall( AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); if (invokeMethod.ReturnType != typeof(void)) { TypeKind returnTypeKind = GetTypeKind(invokeMethod.ReturnType); @@ -8534,21 +8548,21 @@ static ParameterInfo[] AppendBaseTypeCppNativeInvokeCall( if (returnTypeKind == TypeKind.Class || returnTypeKind == TypeKind.ManagedStruct) { - builders.CppMethodDefinitions.Append("return nullptr;\n"); + builders.CppMethodDefinitions.AppendLine("return nullptr;"); } else { - builders.CppMethodDefinitions.Append("return {};\n"); + builders.CppMethodDefinitions.AppendLine("return {};"); } } AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; // C++ binding function that C# calls. Calls the C++ method. TypeKind invokeReturnTypeKind = GetTypeKind( @@ -8630,20 +8644,20 @@ static void AppendCsharpBaseTypeReleaseFunction( AppendCsharpTypeFullName( bindingTypeTypeName, output); - output.Append(" thiz;\n"); + output.AppendLine(" thiz;"); } if (typeIsDelegate) { - output.Append("\t\t\t\tif (classHandle != 0)\n"); - output.Append("\t\t\t\t{\n"); + output.AppendLine("\t\t\t\tif (classHandle != 0)"); + output.AppendLine("\t\t\t\t{"); output.Append("\t\t\t\t\tthiz = ("); AppendCsharpTypeFullName( bindingTypeTypeName, output); - output.Append(")ObjectStore.Remove(classHandle);\n"); - output.Append("\t\t\t\t\tthiz.CppHandle = 0;\n"); - output.Append("\t\t\t\t}\n"); - output.Append("\t\t\t\t\n"); + output.AppendLine(")ObjectStore.Remove(classHandle);"); + output.AppendLine("\t\t\t\t\tthiz.CppHandle = 0;"); + output.AppendLine("\t\t\t\t}"); + output.AppendLine("\t\t\t\t"); } if (derivedName != null) { @@ -8651,12 +8665,12 @@ static void AppendCsharpBaseTypeReleaseFunction( AppendCsharpTypeFullName( bindingTypeTypeName, output); - output.Append(")ObjectStore.Get(handle);\n"); - output.Append("\t\t\t\tint cppHandle = thiz.CppHandle;\n"); - output.Append("\t\t\t\tthiz.CppHandle = 0;\n"); + output.AppendLine(")ObjectStore.Get(handle);"); + output.AppendLine("\t\t\t\tint cppHandle = thiz.CppHandle;"); + output.AppendLine("\t\t\t\tthiz.CppHandle = 0;"); output.Append("\t\t\t\tQueueDestroy(DestroyFunction."); output.Append(bindingTypeTypeName.Name); - output.Append(", cppHandle);\n"); + output.AppendLine(", cppHandle);"); } output.Append("\t\t\t\tObjectStore.Remove(handle);"); AppendCsharpFunctionReturn( @@ -8692,8 +8706,8 @@ static void AppendCsharpBaseTypeCppMethodCallMethod( AppendCsharpParams( invokeParams, output); - output.Append(")\n"); - output.Append("\t\t{\n"); + output.AppendLine(")"); + output.AppendLine("\t\t{"); AppendCsharpBaseTypeCppMethodCallMethodBody( invokeMethod, nativeInvokeFuncName, @@ -8701,8 +8715,8 @@ static void AppendCsharpBaseTypeCppMethodCallMethod( invokeReturnTypeKind, 3, output); - output.Append("\t\t}\n"); - output.Append("\t\n"); + output.AppendLine("\t\t}"); + output.AppendLine("\t"); } static void AppendCsharpBaseTypeCppMethodCallMethodBody( @@ -8716,15 +8730,15 @@ static void AppendCsharpBaseTypeCppMethodCallMethodBody( AppendIndent( indent, output); - output.Append("if (CppHandle != 0)\n"); + output.AppendLine("if (CppHandle != 0)"); AppendIndent( indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( indent + 1, output); - output.Append("int thisHandle = CppHandle;\n"); + output.AppendLine("int thisHandle = CppHandle;"); AppendCppFunctionCall( nativeInvokeFuncName, invokeParamsWithThis, @@ -8753,17 +8767,17 @@ static void AppendCsharpBaseTypeCppMethodCallMethodBody( AppendHandleStoreTypeName( invokeMethod.ReturnType, output); - output.Append(".Get(returnVal);\n"); + output.AppendLine(".Get(returnVal);"); break; default: - output.Append("returnVal;\n"); + output.AppendLine("returnVal;"); break; } } AppendIndent( indent, output); - output.Append("}\n"); + output.AppendLine("}"); if (invokeMethod.ReturnType != typeof(void)) { AppendIndent( @@ -8773,7 +8787,7 @@ static void AppendCsharpBaseTypeCppMethodCallMethodBody( AppendCsharpTypeFullName( invokeMethod.ReturnType, output); - output.Append(");\n"); + output.AppendLine(");"); } } @@ -8804,11 +8818,11 @@ static void AppendCsharpBaseTypeConstructorFunction( cppConstructorParams, output); } - output.Append(");\n"); + output.AppendLine(");"); if (typeIsDelegate) { - output.Append( - "\t\t\t\tclassHandle = NativeScript.Bindings.ObjectStore.Store(thiz);\n"); + output.AppendLine( + "\t\t\t\tclassHandle = NativeScript.Bindings.ObjectStore.Store(thiz);"); output.Append( "\t\t\t\thandle = NativeScript.Bindings.ObjectStore.Store(thiz.Delegate);"); } @@ -8918,19 +8932,19 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( output.Append(", "); } } - output.Append(")\n"); + output.AppendLine(")"); AppendIndent( indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( indent + 1, output); - output.Append("try\n"); + output.AppendLine("try"); AppendIndent( indent + 1, output); - output.Append("{\n"); + output.AppendLine("{"); foreach (ParameterInfo parameter in methodParams) { if (parameter.Kind == TypeKind.Class || @@ -8947,7 +8961,7 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( output); output.Append("(Plugin::InternalUse::Only, "); output.Append(parameter.Name); - output.Append("Handle);\n"); + output.AppendLine("Handle);"); } } AppendIndent( @@ -8987,45 +9001,45 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( { output.Append(".Handle"); } - output.Append(";\n"); + output.AppendLine(";"); AppendIndent( indent + 1, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( indent + 1, output); - output.Append( - "catch (System::Exception ex)\n"); + output.AppendLine( + "catch (System::Exception ex)"); AppendIndent( indent + 1, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( indent + 2, output); - output.Append( - "Plugin::SetException(ex.Handle);\n"); + output.AppendLine( + "Plugin::SetException(ex.Handle);"); if (method.ReturnType != typeof(void)) { AppendIndent( indent + 2, output); - output.Append( - "return {};\n"); + output.AppendLine( + "return {};"); } AppendIndent( indent + 1, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( indent + 1, output); - output.Append("catch (...)\n"); + output.AppendLine("catch (...)"); AppendIndent( indent + 1, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( indent + 2, output); @@ -9034,37 +9048,37 @@ static void AppendCppBaseTypeMethodInvokeBindingFunction( AppendCppTypeFullName( type, output); - output.Append("\";\n"); + output.AppendLine("\";"); AppendIndent( indent + 2, output); - output.Append( - "System::Exception ex(msg);\n"); + output.AppendLine( + "System::Exception ex(msg);"); AppendIndent( indent + 2, output); - output.Append( - "Plugin::SetException(ex.Handle);\n"); + output.AppendLine( + "Plugin::SetException(ex.Handle);"); if (method.ReturnType != typeof(void)) { AppendIndent( indent + 2, output); - output.Append( - "return {};\n"); + output.AppendLine( + "return {};"); } AppendIndent( indent + 1, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( indent, output); - output.Append('\n'); + output.AppendLine();; } static void AppendCppBaseTypeInequalityOperator( @@ -9091,24 +9105,24 @@ static void AppendCppBaseTypeInequalityOperator( AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); - output.Append("& other) const\n"); + output.AppendLine("& other) const"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append( - "return Handle != other.Handle;\n"); + output.AppendLine( + "return Handle != other.Handle;"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append('\n'); + output.AppendLine();; } static void AppendCppBaseTypeEqualityOperator( @@ -9135,24 +9149,24 @@ static void AppendCppBaseTypeEqualityOperator( AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); - output.Append("& other) const\n"); + output.AppendLine("& other) const"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append( - "return Handle == other.Handle;\n"); + output.AppendLine( + "return Handle == other.Handle;"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append('\n'); + output.AppendLine();; } static void AppendCppBaseTypeMoveAssignmentOperator( @@ -9187,60 +9201,60 @@ static void AppendCppBaseTypeMoveAssignmentOperator( AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); - output.Append("&& other)\n"); + output.AppendLine("&& other)"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 1, output); output.Append("Plugin::Remove"); output.Append(bindingTypeName); - output.Append("(CppHandle);\n"); + output.AppendLine("(CppHandle);"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("CppHandle = 0;\n"); + output.AppendLine("CppHandle = 0;"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("if (Handle)\n"); + output.AppendLine("if (Handle)"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("int32_t handle = Handle;\n"); + output.AppendLine("int32_t handle = Handle;"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("int32_t classHandle = ClassHandle;\n"); + output.AppendLine("int32_t classHandle = ClassHandle;"); } AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("Handle = 0;\n"); + output.AppendLine("Handle = 0;"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("ClassHandle = 0;\n"); + output.AppendLine("ClassHandle = 0;"); } AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append( - "if (Plugin::DereferenceManagedClassNoRelease(handle))\n"); + output.AppendLine( + "if (Plugin::DereferenceManagedClassNoRelease(handle))"); AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 3, output); @@ -9251,50 +9265,50 @@ static void AppendCppBaseTypeMoveAssignmentOperator( { output.Append(", classHandle"); } - output.Append(");\n"); + output.AppendLine(");"); AppendCppUnhandledExceptionHandling( cppMethodDefinitionsIndent + 3, output); AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("}\n"); + output.AppendLine("}"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append( - "ClassHandle = other.ClassHandle;\n"); + output.AppendLine( + "ClassHandle = other.ClassHandle;"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("other.ClassHandle = 0;\n"); + output.AppendLine("other.ClassHandle = 0;"); } AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("Handle = other.Handle;\n"); + output.AppendLine("Handle = other.Handle;"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("other.Handle = 0;\n"); + output.AppendLine("other.Handle = 0;"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("return *this;\n"); + output.AppendLine("return *this;"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append('\n'); + output.AppendLine();; } static void AppendCppBaseTypeAssignmentOperatorNullptr( @@ -9321,51 +9335,51 @@ static void AppendCppBaseTypeAssignmentOperatorNullptr( AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); - output.Append( - "::operator=(decltype(nullptr))\n"); + output.AppendLine( + "::operator=(decltype(nullptr))"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("if (Handle)\n"); + output.AppendLine("if (Handle)"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("int32_t handle = Handle;\n"); + output.AppendLine("int32_t handle = Handle;"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("int32_t classHandle = ClassHandle;\n"); + output.AppendLine("int32_t classHandle = ClassHandle;"); } AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("Handle = 0;\n"); + output.AppendLine("Handle = 0;"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("ClassHandle = 0;\n"); + output.AppendLine("ClassHandle = 0;"); } AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append( - "if (Plugin::DereferenceManagedClassNoRelease(handle))\n"); + output.AppendLine( + "if (Plugin::DereferenceManagedClassNoRelease(handle))"); AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 3, output); @@ -9376,41 +9390,41 @@ static void AppendCppBaseTypeAssignmentOperatorNullptr( { output.Append(", classHandle"); } - output.Append(");\n"); + output.AppendLine(");"); AppendCppUnhandledExceptionHandling( cppMethodDefinitionsIndent + 3, output); AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("}\n"); + output.AppendLine("}"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("ClassHandle = 0;\n"); + output.AppendLine("ClassHandle = 0;"); } AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("Handle = 0;\n"); + output.AppendLine("Handle = 0;"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("return *this;\n"); + output.AppendLine("return *this;"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append('\n'); + output.AppendLine();; } static void AppendCppBaseTypeAssignmentOperatorSameType( @@ -9443,11 +9457,11 @@ static void AppendCppBaseTypeAssignmentOperatorSameType( AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); - output.Append("& other)\n"); + output.AppendLine("& other)"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendSetHandle( typeTypeName, TypeKind.Class, @@ -9461,21 +9475,21 @@ static void AppendCppBaseTypeAssignmentOperatorSameType( AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append( - "ClassHandle = other.ClassHandle;\n"); + output.AppendLine( + "ClassHandle = other.ClassHandle;"); } AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("return *this;\n"); + output.AppendLine("return *this;"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append('\n'); + output.AppendLine();; } static void AppendCppBaseTypeDestructor( @@ -9505,11 +9519,11 @@ static void AppendCppBaseTypeDestructor( AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); - output.Append("()\n"); + output.AppendLine("()"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("{\n"); + output.AppendLine("{"); if (!string.IsNullOrEmpty(derivedTypeName)) { AppendIndent( @@ -9517,57 +9531,57 @@ static void AppendCppBaseTypeDestructor( output); output.Append("Plugin::RemoveWhole"); output.Append(bindingTypeName); - output.Append("(this);\n"); + output.AppendLine("(this);"); } AppendIndent( cppMethodDefinitionsIndent + 1, output); output.Append("Plugin::Remove"); output.Append(typeName); - output.Append("(CppHandle);\n"); + output.AppendLine("(CppHandle);"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("CppHandle = 0;\n"); + output.AppendLine("CppHandle = 0;"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("if (Handle)\n"); + output.AppendLine("if (Handle)"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("int32_t handle = Handle;\n"); + output.AppendLine("int32_t handle = Handle;"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("int32_t classHandle = ClassHandle;\n"); + output.AppendLine("int32_t classHandle = ClassHandle;"); } AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("Handle = 0;\n"); + output.AppendLine("Handle = 0;"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("ClassHandle = 0;\n"); + output.AppendLine("ClassHandle = 0;"); } AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append( - "if (Plugin::DereferenceManagedClassNoRelease(handle))\n"); + output.AppendLine( + "if (Plugin::DereferenceManagedClassNoRelease(handle))"); AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 3, output); @@ -9578,26 +9592,26 @@ static void AppendCppBaseTypeDestructor( { output.Append(", classHandle"); } - output.Append(");\n"); + output.AppendLine(");"); AppendCppUnhandledExceptionHandling( cppMethodDefinitionsIndent + 3, output); AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append('\n'); + output.AppendLine();; } static void AppendCppBaseTypeHandleConstructor( @@ -9622,8 +9636,8 @@ static void AppendCppBaseTypeHandleConstructor( AppendCppTypeName( typeTypeName, output); - output.Append( - "(Plugin::InternalUse, int32_t handle)\n"); + output.AppendLine( + "(Plugin::InternalUse, int32_t handle)"); AppendCppConstructorInitializerList( interfaceTypes, cppMethodDefinitionsIndent + 1, @@ -9631,50 +9645,50 @@ static void AppendCppBaseTypeHandleConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("Handle = handle;\n"); + output.AppendLine("Handle = handle;"); AppendIndent( cppMethodDefinitionsIndent + 1, output); output.Append("CppHandle = Plugin::Store"); output.Append(bindingTypeName); - output.Append("(this);\n"); + output.AppendLine("(this);"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("if (Handle)\n"); + output.AppendLine("if (Handle)"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append( - "Plugin::ReferenceManagedClass(Handle);\n"); + output.AppendLine( + "Plugin::ReferenceManagedClass(Handle);"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("}\n"); + output.AppendLine("}"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append( - "ClassHandle = 0;\n"); + output.AppendLine( + "ClassHandle = 0;"); } AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append('\n'); + output.AppendLine();; } static void AppendCppBaseTypeMoveConstructor( @@ -9705,7 +9719,7 @@ static void AppendCppBaseTypeMoveConstructor( AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); - output.Append("&& other)\n"); + output.AppendLine("&& other)"); AppendCppConstructorInitializerList( interfaceTypes, cppMethodDefinitionsIndent + 1, @@ -9713,48 +9727,48 @@ static void AppendCppBaseTypeMoveConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append( - "Handle = other.Handle;\n"); + output.AppendLine( + "Handle = other.Handle;"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append( - "CppHandle = other.CppHandle;\n"); + output.AppendLine( + "CppHandle = other.CppHandle;"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append( - "ClassHandle = other.ClassHandle;\n"); + output.AppendLine( + "ClassHandle = other.ClassHandle;"); } AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("other.Handle = 0;\n"); + output.AppendLine("other.Handle = 0;"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("other.CppHandle = 0;\n"); + output.AppendLine("other.CppHandle = 0;"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("other.ClassHandle = 0;\n"); + output.AppendLine("other.ClassHandle = 0;"); } AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append('\n'); + output.AppendLine();; } static void AppendCppBaseTypeCopyConstructor( @@ -9786,7 +9800,7 @@ static void AppendCppBaseTypeCopyConstructor( AppendCppTypeParameters( typeIsDelegate ? typeParams : null, output); - output.Append("& other)\n"); + output.AppendLine("& other)"); AppendCppConstructorInitializerList( interfaceTypes, cppMethodDefinitionsIndent + 1, @@ -9794,51 +9808,51 @@ static void AppendCppBaseTypeCopyConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append( - "Handle = other.Handle;\n"); + output.AppendLine( + "Handle = other.Handle;"); AppendIndent( cppMethodDefinitionsIndent + 1, output); output.Append("CppHandle = Plugin::Store"); output.Append(typeName); - output.Append("(this);\n"); + output.AppendLine("(this);"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("if (Handle)\n"); + output.AppendLine("if (Handle)"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append( - "Plugin::ReferenceManagedClass(Handle);\n"); + output.AppendLine( + "Plugin::ReferenceManagedClass(Handle);"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("}\n"); + output.AppendLine("}"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append( - "ClassHandle = other.ClassHandle;\n"); + output.AppendLine( + "ClassHandle = other.ClassHandle;"); } AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append('\n'); + output.AppendLine();; } static void AppendCppBaseTypeNullptrConstructor( @@ -9863,7 +9877,7 @@ static void AppendCppBaseTypeNullptrConstructor( AppendCppTypeName( cppTypeTypeName, output); - output.Append("(decltype(nullptr))\n"); + output.AppendLine("(decltype(nullptr))"); AppendCppConstructorInitializerList( interfaceTypes, cppMethodDefinitionsIndent + 1, @@ -9871,28 +9885,28 @@ static void AppendCppBaseTypeNullptrConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 1, output); output.Append("CppHandle = Plugin::Store"); output.Append(typeName); - output.Append("(this);\n"); + output.AppendLine("(this);"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("ClassHandle = 0;\n"); + output.AppendLine("ClassHandle = 0;"); } AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append('\n'); + output.AppendLine();; } static void AppendCppBaseTypeConstructor( @@ -9925,27 +9939,27 @@ static void AppendCppBaseTypeConstructor( AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 1, output); output.Append("CppHandle = Plugin::Store"); output.Append(bindingTypeName); - output.Append("(this);\n"); + output.AppendLine("(this);"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("System::Int32* handle = (System::Int32*)&Handle;\n"); + output.AppendLine("System::Int32* handle = (System::Int32*)&Handle;"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("int32_t cppHandle = CppHandle;\n"); + output.AppendLine("int32_t cppHandle = CppHandle;"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("System::Int32* classHandle = (System::Int32*)&ClassHandle;\n"); + output.AppendLine("System::Int32* classHandle = (System::Int32*)&ClassHandle;"); } AppendCppPluginFunctionCall( true, @@ -9960,60 +9974,60 @@ static void AppendCppBaseTypeConstructor( AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("if (Handle)\n"); + output.AppendLine("if (Handle)"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append( - "Plugin::ReferenceManagedClass(Handle);\n"); + output.AppendLine( + "Plugin::ReferenceManagedClass(Handle);"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("else\n"); + output.AppendLine("else"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent( cppMethodDefinitionsIndent + 2, output); output.Append("Plugin::Remove"); output.Append(bindingTypeName); - output.Append("(CppHandle);\n"); + output.AppendLine("(CppHandle);"); if (typeIsDelegate) { AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("ClassHandle = 0;\n"); + output.AppendLine("ClassHandle = 0;"); } AppendIndent( cppMethodDefinitionsIndent + 2, output); - output.Append("CppHandle = 0;\n"); + output.AppendLine("CppHandle = 0;"); AppendIndent( cppMethodDefinitionsIndent + 1, output); - output.Append("}\n"); + output.AppendLine("}"); AppendCppUnhandledExceptionHandling( cppMethodDefinitionsIndent + 1, output); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent( cppMethodDefinitionsIndent, output); - output.Append('\n'); + output.AppendLine();; } static void AppendCppPointerFreeListInit( @@ -10028,7 +10042,7 @@ static void AppendCppPointerFreeListInit( output.Append(typeName); output.Append("FreeListSize = "); output.Append(maxSimultaneous); - output.Append(";\n"); + output.AppendLine(";"); output.Append("\tPlugin::"); output.Append(typeName); @@ -10039,7 +10053,7 @@ static void AppendCppPointerFreeListInit( AppendCppTypeParameters( typeParams, output); - output.Append("**)curMemory;\n"); + output.AppendLine("**)curMemory;"); output.Append("\tcurMemory += "); output.Append(maxSimultaneous); @@ -10050,14 +10064,14 @@ static void AppendCppPointerFreeListInit( AppendCppTypeParameters( typeParams, output); - output.Append("*);\n"); + output.AppendLine("*);"); - output.Append("\t\n"); + output.AppendLine("\t"); outputFirstBoot.Append("\t\tfor (int32_t i = 0, end = Plugin::"); outputFirstBoot.Append(typeName); - outputFirstBoot.Append("FreeListSize - 1; i < end; ++i)\n"); - outputFirstBoot.Append("\t\t{\n"); + outputFirstBoot.AppendLine("FreeListSize - 1; i < end; ++i)"); + outputFirstBoot.AppendLine("\t\t{"); outputFirstBoot.Append("\t\t\tPlugin::"); outputFirstBoot.Append(typeName); outputFirstBoot.Append("FreeList[i] = ("); @@ -10069,22 +10083,22 @@ static void AppendCppPointerFreeListInit( outputFirstBoot); outputFirstBoot.Append("*)(Plugin::"); outputFirstBoot.Append(typeName); - outputFirstBoot.Append("FreeList + i + 1);\n"); - outputFirstBoot.Append("\t\t}\n"); + outputFirstBoot.AppendLine("FreeList + i + 1);"); + outputFirstBoot.AppendLine("\t\t}"); outputFirstBoot.Append("\t\tPlugin::"); outputFirstBoot.Append(typeName); outputFirstBoot.Append("FreeList[Plugin::"); outputFirstBoot.Append(typeName); - outputFirstBoot.Append("FreeListSize - 1] = nullptr;\n"); + outputFirstBoot.AppendLine("FreeListSize - 1] = nullptr;"); outputFirstBoot.Append("\t\tPlugin::NextFree"); outputFirstBoot.Append(typeName); outputFirstBoot.Append(" = Plugin::"); outputFirstBoot.Append(typeName); - outputFirstBoot.Append("FreeList + 1;\n"); + outputFirstBoot.AppendLine("FreeList + 1;"); - outputFirstBoot.Append("\t\t\n"); + outputFirstBoot.AppendLine("\t\t"); } static void AppendCppPointerFreeListStateAndFunctions( @@ -10101,13 +10115,13 @@ static void AppendCppPointerFreeListStateAndFunctions( AppendCppTypeParameters( typeParams, output); - output.Append(" pointers\n"); - output.Append("\t\n"); + output.AppendLine(" pointers"); + output.AppendLine("\t"); // Size variable output.Append("\tint32_t "); output.Append(bindingTypeName); - output.Append("FreeListSize;\n"); + output.AppendLine("FreeListSize;"); // Free list variable output.Append('\t'); @@ -10119,7 +10133,7 @@ static void AppendCppPointerFreeListStateAndFunctions( output); output.Append("** "); output.Append(bindingTypeName); - output.Append("FreeList;\n"); + output.AppendLine("FreeList;"); // Next free variable output.Append('\t'); @@ -10131,8 +10145,8 @@ static void AppendCppPointerFreeListStateAndFunctions( output); output.Append("** NextFree"); output.Append(bindingTypeName); - output.Append(";\n"); - output.Append("\t\n"); + output.AppendLine(";"); + output.AppendLine("\t"); // Store function output.Append("\tint32_t Store"); @@ -10144,11 +10158,11 @@ static void AppendCppPointerFreeListStateAndFunctions( AppendCppTypeParameters( typeParams, output); - output.Append("* del)\n"); - output.Append("\t{\n"); + output.AppendLine("* del)"); + output.AppendLine("\t{"); output.Append("\t\tassert(NextFree"); output.Append(bindingTypeName); - output.Append(" != nullptr);\n"); + output.AppendLine(" != nullptr);"); output.Append("\t\t"); AppendCppTypeFullName( cppTypeTypeName, @@ -10158,7 +10172,7 @@ static void AppendCppPointerFreeListStateAndFunctions( output); output.Append("** pNext = NextFree"); output.Append(bindingTypeName); - output.Append(";\n"); + output.AppendLine(";"); output.Append("\t\tNextFree"); output.Append(bindingTypeName); output.Append(" = ("); @@ -10168,13 +10182,13 @@ static void AppendCppPointerFreeListStateAndFunctions( AppendCppTypeParameters( typeParams, output); - output.Append("**)*pNext;\n"); - output.Append("\t\t*pNext = del;\n"); + output.AppendLine("**)*pNext;"); + output.AppendLine("\t\t*pNext = del;"); output.Append("\t\treturn (int32_t)(pNext - "); output.Append(bindingTypeName); - output.Append("FreeList);\n"); - output.Append("\t}\n"); - output.Append("\t\n"); + output.AppendLine("FreeList);"); + output.AppendLine("\t}"); + output.AppendLine("\t"); // Get function output.Append('\t'); @@ -10186,23 +10200,23 @@ static void AppendCppPointerFreeListStateAndFunctions( output); output.Append("* Get"); output.Append(bindingTypeName); - output.Append("(int32_t handle)\n"); - output.Append("\t{\n"); + output.AppendLine("(int32_t handle)"); + output.AppendLine("\t{"); output.Append( "\t\tassert(handle >= 0 && handle < "); output.Append(bindingTypeName); - output.Append("FreeListSize);\n"); + output.AppendLine("FreeListSize);"); output.Append("\t\treturn "); output.Append(bindingTypeName); - output.Append("FreeList[handle];\n"); - output.Append("\t}\n"); - output.Append("\t\n"); + output.AppendLine("FreeList[handle];"); + output.AppendLine("\t}"); + output.AppendLine("\t"); // Remove function output.Append("\tvoid Remove"); output.Append(bindingTypeName); - output.Append("(int32_t handle)\n"); - output.Append("\t{\n"); + output.AppendLine("(int32_t handle)"); + output.AppendLine("\t{"); output.Append("\t\t"); AppendCppTypeFullName( cppTypeTypeName, @@ -10212,7 +10226,7 @@ static void AppendCppPointerFreeListStateAndFunctions( output); output.Append("** pRelease = "); output.Append(bindingTypeName); - output.Append("FreeList + handle;\n"); + output.AppendLine("FreeList + handle;"); output.Append("\t\t*pRelease = ("); AppendCppTypeFullName( cppTypeTypeName, @@ -10222,12 +10236,12 @@ static void AppendCppPointerFreeListStateAndFunctions( output); output.Append("*)NextFree"); output.Append(bindingTypeName); - output.Append(";\n"); + output.AppendLine(";"); output.Append("\t\tNextFree"); output.Append(bindingTypeName); - output.Append(" = pRelease;\n"); - output.Append("\t}\n"); - output.Append("\t\n"); + output.AppendLine(" = pRelease;"); + output.AppendLine("\t}"); + output.AppendLine("\t"); } static void AppendCppWholeObjectFreeListInit( @@ -10240,46 +10254,46 @@ static void AppendCppWholeObjectFreeListInit( output.Append(bindingTypeName); output.Append("FreeWholeListSize = "); output.Append(maxSimultaneous); - output.Append(";\n"); + output.AppendLine(";"); output.Append("\tPlugin::"); output.Append(bindingTypeName); output.Append("FreeWholeList = (Plugin::"); output.Append(bindingTypeName); - output.Append("FreeWholeListEntry*)curMemory;\n"); + output.AppendLine("FreeWholeListEntry*)curMemory;"); output.Append("\tcurMemory += "); output.Append(maxSimultaneous); output.Append(" * sizeof(Plugin::"); output.Append(bindingTypeName); - output.Append("FreeWholeListEntry);\n"); + output.AppendLine("FreeWholeListEntry);"); - output.Append("\t\n"); + output.AppendLine("\t"); outputFirstBoot.Append("\t\tfor (int32_t i = 0, end = Plugin::"); outputFirstBoot.Append(bindingTypeName); - outputFirstBoot.Append("FreeWholeListSize - 1; i < end; ++i)\n"); - outputFirstBoot.Append("\t\t{\n"); + outputFirstBoot.AppendLine("FreeWholeListSize - 1; i < end; ++i)"); + outputFirstBoot.AppendLine("\t\t{"); outputFirstBoot.Append("\t\t\tPlugin::"); outputFirstBoot.Append(bindingTypeName); outputFirstBoot.Append("FreeWholeList[i].Next = Plugin::"); outputFirstBoot.Append(bindingTypeName); - outputFirstBoot.Append("FreeWholeList + i + 1;\n"); - outputFirstBoot.Append("\t\t}\n"); + outputFirstBoot.AppendLine("FreeWholeList + i + 1;"); + outputFirstBoot.AppendLine("\t\t}"); outputFirstBoot.Append("\t\tPlugin::"); outputFirstBoot.Append(bindingTypeName); outputFirstBoot.Append("FreeWholeList[Plugin::"); outputFirstBoot.Append(bindingTypeName); - outputFirstBoot.Append("FreeWholeListSize - 1].Next = nullptr;\n"); + outputFirstBoot.AppendLine("FreeWholeListSize - 1].Next = nullptr;"); outputFirstBoot.Append("\t\tPlugin::NextFreeWhole"); outputFirstBoot.Append(bindingTypeName); outputFirstBoot.Append(" = Plugin::"); outputFirstBoot.Append(bindingTypeName); - outputFirstBoot.Append("FreeWholeList + 1;\n"); + outputFirstBoot.AppendLine("FreeWholeList + 1;"); - outputFirstBoot.Append("\t\t\n"); + outputFirstBoot.AppendLine("\t\t"); } static void AppendCppWholeObjectFreeListStateAndFunctions( @@ -10296,17 +10310,17 @@ static void AppendCppWholeObjectFreeListStateAndFunctions( AppendCppTypeParameters( typeParams, output); - output.Append(" objects\n"); - output.Append("\t\n"); + output.AppendLine(" objects"); + output.AppendLine("\t"); // Union with a pointer and a whole object output.Append("\tunion "); output.Append(bindingTypeName); - output.Append("FreeWholeListEntry\n"); - output.Append("\t{\n"); + output.AppendLine("FreeWholeListEntry"); + output.AppendLine("\t{"); output.Append("\t\t"); output.Append(bindingTypeName); - output.Append("FreeWholeListEntry* Next;\n"); + output.AppendLine("FreeWholeListEntry* Next;"); output.Append("\t\t"); AppendCppTypeFullName( cppTypeTypeName, @@ -10314,28 +10328,28 @@ static void AppendCppWholeObjectFreeListStateAndFunctions( AppendCppTypeParameters( typeParams, output); - output.Append(" Value;\n"); - output.Append("\t};\n"); + output.AppendLine(" Value;"); + output.AppendLine("\t};"); // Size output.Append("\tint32_t "); output.Append(bindingTypeName); - output.Append("FreeWholeListSize;\n"); + output.AppendLine("FreeWholeListSize;"); // Free list entries output.Append('\t'); output.Append(bindingTypeName); output.Append("FreeWholeListEntry* "); output.Append(bindingTypeName); - output.Append("FreeWholeList;\n"); + output.AppendLine("FreeWholeList;"); // Pointer to next free entry output.Append('\t'); output.Append(bindingTypeName); output.Append("FreeWholeListEntry* NextFreeWhole"); output.Append(bindingTypeName); - output.Append(";\n"); - output.Append("\t\n"); + output.AppendLine(";"); + output.AppendLine("\t"); // Store function output.Append('\t'); @@ -10347,22 +10361,22 @@ static void AppendCppWholeObjectFreeListStateAndFunctions( output); output.Append("* StoreWhole"); output.Append(bindingTypeName); - output.Append("()\n"); - output.Append("\t{\n"); + output.AppendLine("()"); + output.AppendLine("\t{"); output.Append("\t\tassert(NextFreeWhole"); output.Append(bindingTypeName); - output.Append(" != nullptr);\n"); + output.AppendLine(" != nullptr);"); output.Append("\t\t"); output.Append(bindingTypeName); output.Append("FreeWholeListEntry* pNext = NextFreeWhole"); output.Append(bindingTypeName); - output.Append(";\n"); + output.AppendLine(";"); output.Append("\t\tNextFreeWhole"); output.Append(bindingTypeName); - output.Append(" = pNext->Next;\n"); - output.Append("\t\treturn &pNext->Value;\n"); - output.Append("\t}\n"); - output.Append("\t\n"); + output.AppendLine(" = pNext->Next;"); + output.AppendLine("\t\treturn &pNext->Value;"); + output.AppendLine("\t}"); + output.AppendLine("\t"); // Remove function output.Append("\tvoid RemoveWhole"); @@ -10374,30 +10388,30 @@ static void AppendCppWholeObjectFreeListStateAndFunctions( AppendCppTypeParameters( typeParams, output); - output.Append("* instance)\n"); - output.Append("\t{\n"); + output.AppendLine("* instance)"); + output.AppendLine("\t{"); output.Append("\t\t"); output.Append(bindingTypeName); output.Append("FreeWholeListEntry* pRelease = ("); output.Append(bindingTypeName); - output.Append("FreeWholeListEntry*)instance;\n"); + output.AppendLine("FreeWholeListEntry*)instance;"); output.Append("\t\tif (pRelease >= "); output.Append(bindingTypeName); output.Append("FreeWholeList && pRelease < "); output.Append(bindingTypeName); output.Append("FreeWholeList + ("); output.Append(bindingTypeName); - output.Append("FreeWholeListSize - 1))\n"); - output.Append("\t\t{\n"); + output.AppendLine("FreeWholeListSize - 1))"); + output.AppendLine("\t\t{"); output.Append("\t\t\tpRelease->Next = NextFreeWhole"); output.Append(bindingTypeName); - output.Append(";\n"); + output.AppendLine(";"); output.Append("\t\t\tNextFreeWhole"); output.Append(bindingTypeName); - output.Append(" = pRelease->Next;\n"); - output.Append("\t\t}\n"); - output.Append("\t}\n"); - output.Append("\t\n"); + output.AppendLine(" = pRelease->Next;"); + output.AppendLine("\t\t}"); + output.AppendLine("\t}"); + output.AppendLine("\t"); } static void AppendCsharpDelegate( @@ -10410,7 +10424,7 @@ static void AppendCsharpDelegate( TypeKind returnTypeKind, StringBuilder output) { - output.Append("\t\t[UnmanagedFunctionPointer(CallingConvention.Cdecl)]\n"); + output.AppendLine("\t\t[UnmanagedFunctionPointer(CallingConvention.Cdecl)]"); output.Append("\t\tpublic delegate "); if (returnType == typeof(void)) { @@ -10470,7 +10484,7 @@ static void AppendCsharpDelegate( output.Append(", "); } } - output.Append(");\n"); + output.AppendLine(");"); output.Append("\t\tpublic static "); AppendCsharpDelegateName( typeTypeName, @@ -10483,7 +10497,8 @@ static void AppendCsharpDelegate( typeParams, funcName, output); - output.Append(";\n\t\t\n"); + output.AppendLine(";"); + output.AppendLine("\t\t"); } static void AppendCsharpDelegateName( @@ -10529,7 +10544,7 @@ static void AppendCsharpGetDelegateCall( typeParams, funcName, output); - output.Append("\");\n"); + output.AppendLine("\");"); } static void AppendCsharpImport( @@ -10541,7 +10556,7 @@ static void AppendCsharpImport( StringBuilder output ) { - output.Append("\t\t[DllImport(PLUGIN_NAME, CallingConvention = CallingConvention.Cdecl)]\n"); + output.AppendLine("\t\t[DllImport(PLUGIN_NAME, CallingConvention = CallingConvention.Cdecl)]"); output.Append("\t\tpublic static extern "); AppendCsharpTypeFullName(returnType, output); output.Append(' '); @@ -10576,7 +10591,8 @@ StringBuilder output output.Append(", "); } } - output.Append(");\n\t\t\n"); + output.AppendLine(");"); + output.AppendLine("\t\t"); } static void AppendExceptions( @@ -10665,32 +10681,32 @@ static void AppendExceptions( AppendCppTypeFullName( exceptionType, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; AppendIndent( throwerIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( throwerIndent + 1, builders.CppMethodDefinitions); builders.CppMethodDefinitions.Append(exceptionType.Name); - builders.CppMethodDefinitions.Append("Thrower(int32_t handle)\n"); + builders.CppMethodDefinitions.AppendLine("Thrower(int32_t handle)"); AppendIndent( throwerIndent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(": System::Runtime::InteropServices::_Exception(nullptr)\n"); + builders.CppMethodDefinitions.AppendLine(": System::Runtime::InteropServices::_Exception(nullptr)"); AppendIndent( throwerIndent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(", System::Runtime::Serialization::ISerializable(nullptr)\n"); + builders.CppMethodDefinitions.AppendLine(", System::Runtime::Serialization::ISerializable(nullptr)"); AppendIndent( throwerIndent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(", System::Exception(nullptr)\n"); + builders.CppMethodDefinitions.AppendLine(", System::Exception(nullptr)"); AppendIndent( throwerIndent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append(", System::SystemException(nullptr)\n"); + builders.CppMethodDefinitions.AppendLine(", System::SystemException(nullptr)"); AppendIndent( throwerIndent + 2, builders.CppMethodDefinitions); @@ -10698,56 +10714,57 @@ static void AppendExceptions( AppendCppTypeFullName( exceptionType, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("(Plugin::InternalUse::Only, handle)\n"); + builders.CppMethodDefinitions.AppendLine("(Plugin::InternalUse::Only, handle)"); AppendIndent( throwerIndent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( throwerIndent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( throwerIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; AppendIndent( throwerIndent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("virtual void ThrowReferenceToThis()\n"); + builders.CppMethodDefinitions.AppendLine("virtual void ThrowReferenceToThis()"); AppendIndent( throwerIndent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendIndent( throwerIndent + 2, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("throw *this;\n"); + builders.CppMethodDefinitions.AppendLine("throw *this;"); AppendIndent( throwerIndent + 1, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent( throwerIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("};\n"); + builders.CppMethodDefinitions.AppendLine("};"); AppendNamespaceEnding( throwerIndent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; // C++ function builders.CppMethodDefinitions.Append("DLLEXPORT void "); builders.CppMethodDefinitions.Append(funcName); - builders.CppMethodDefinitions.Append("(int32_t handle)\n"); - builders.CppMethodDefinitions.Append("{\n"); - builders.CppMethodDefinitions.Append("\tdelete Plugin::unhandledCsharpException;\n"); + builders.CppMethodDefinitions.AppendLine("(int32_t handle)"); + builders.CppMethodDefinitions.AppendLine("{"); + builders.CppMethodDefinitions.AppendLine("\tdelete Plugin::unhandledCsharpException;"); builders.CppMethodDefinitions.Append("\tPlugin::unhandledCsharpException = new "); AppendCppTypeFullName( exceptionType, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("Thrower(handle);\n"); - builders.CppMethodDefinitions.Append("}\n\n"); + builders.CppMethodDefinitions.AppendLine("Thrower(handle);"); + builders.CppMethodDefinitions.AppendLine("}"); + builders.CppMethodDefinitions.AppendLine(); // Build parameters ParameterInfo[] parameters = ConvertParameters( @@ -10945,7 +10962,7 @@ static void AppendGetter( indent, builders.CppMethodDefinitions); AppendIndent(indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendCppPluginFunctionCall( methodIsStatic, GetTypeName(enclosingType), @@ -10962,9 +10979,9 @@ static void AppendGetter( indent + 1, builders.CppMethodDefinitions); AppendIndent(indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent(indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; // C++ init body AppendCppInitBodyFunctionPointerParameterRead( @@ -11123,7 +11140,7 @@ static void AppendSetter( indent, builders.CppMethodDefinitions); AppendIndent(indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("{\n"); + builders.CppMethodDefinitions.AppendLine("{"); AppendCppPluginFunctionCall( methodIsStatic, enclosingTypeTypeName, @@ -11135,9 +11152,9 @@ static void AppendSetter( indent + 1, builders.CppMethodDefinitions); AppendIndent(indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append("}\n"); + builders.CppMethodDefinitions.AppendLine("}"); AppendIndent(indent, builders.CppMethodDefinitions); - builders.CppMethodDefinitions.Append('\n'); + builders.CppMethodDefinitions.AppendLine();; // C++ init body AppendCppInitBodyFunctionPointerParameterRead( @@ -11193,11 +11210,11 @@ static void AppendCppTemplateDeclaration( typeTypeName, output); output.Append(";"); - output.Append('\n'); + output.AppendLine();; AppendNamespaceEnding( indent, output); - output.Append('\n'); + output.AppendLine();; } static int AppendCppTypeDeclaration( @@ -11216,9 +11233,9 @@ static int AppendCppTypeDeclaration( AppendTypeNameWithoutGenericSuffix( typeTypeName.Name, output); - output.Append('\n'); + output.AppendLine();; AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent, output); output.Append('}'); } @@ -11237,11 +11254,11 @@ static int AppendCppTypeDeclaration( output); output.Append(";"); } - output.Append('\n'); + output.AppendLine();; AppendNamespaceEnding( indent, output); - output.Append('\n'); + output.AppendLine();; return indent; } @@ -11325,11 +11342,11 @@ static void AppendCppTypeDefinitionBegin( break; } } - output.Append('\n'); + output.AppendLine();; AppendIndent( indent, output); - output.Append("{\n"); + output.AppendLine("{"); if (!isStatic) { switch (typeKind) @@ -11341,15 +11358,15 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeName( typeTypeName, output); - output.Append("(decltype(nullptr));\n"); + output.AppendLine("(decltype(nullptr));"); // Constructor from handle AppendIndent(indent + 1, output); AppendCppTypeName( typeTypeName, output); - output.Append( - "(Plugin::InternalUse, int32_t handle);\n"); + output.AppendLine( + "(Plugin::InternalUse, int32_t handle);"); // Copy constructor AppendIndent(indent + 1, output); @@ -11363,7 +11380,7 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeParameters( typeParams, output); - output.Append("& other);\n"); + output.AppendLine("& other);"); // Move constructor AppendIndent(indent + 1, output); @@ -11377,7 +11394,7 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeParameters( typeParams, output); - output.Append("&& other);\n"); + output.AppendLine("&& other);"); // Destructor AppendIndent(indent + 1, output); @@ -11385,7 +11402,7 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeName( typeTypeName, output); - output.Append("();\n"); + output.AppendLine("();"); // Assignment operator to same type AppendIndent(indent + 1, output); @@ -11402,7 +11419,7 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeParameters( typeParams, output); - output.Append("& other);\n"); + output.AppendLine("& other);"); // Assignment operator to nullptr AppendIndent(indent + 1, output); @@ -11412,7 +11429,7 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeParameters( typeParams, output); - output.Append("& operator=(decltype(nullptr));\n"); + output.AppendLine("& operator=(decltype(nullptr));"); // Move assignment operator to same type AppendIndent(indent + 1, output); @@ -11429,7 +11446,7 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeParameters( typeParams, output); - output.Append("&& other);\n"); + output.AppendLine("&& other);"); // Equality operator with same type AppendIndent(indent + 1, output); @@ -11440,7 +11457,7 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeParameters( typeParams, output); - output.Append("& other) const;\n"); + output.AppendLine("& other) const;"); // Inequality operator with same type AppendIndent(indent + 1, output); @@ -11451,7 +11468,7 @@ static void AppendCppTypeDefinitionBegin( AppendCppTypeParameters( typeParams, output); - output.Append("& other) const;\n"); + output.AppendLine("& other) const;"); break; } } @@ -11470,11 +11487,11 @@ static void AppendCppTypeDefinitionEnd( { output.Append(';'); } - output.Append('\n'); + output.AppendLine();; AppendNamespaceEnding( indent, output); - output.Append('\n'); + output.AppendLine();; } static int AppendCppMethodDefinitionsBegin( @@ -11507,7 +11524,7 @@ static int AppendCppMethodDefinitionsBegin( AppendCppTypeName( enclosingTypeTypeName, output); - output.Append("(decltype(nullptr))\n"); + output.AppendLine("(decltype(nullptr))"); if (enclosingTypeKind == TypeKind.Class) { AppendCppConstructorInitializerList( @@ -11516,12 +11533,12 @@ static int AppendCppMethodDefinitionsBegin( output); } AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); extraDefault(indent + 1, "this->"); AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent(indent, output); - output.Append('\n'); + output.AppendLine();; // Handle constructor AppendIndent(indent, output); @@ -11535,7 +11552,7 @@ static int AppendCppMethodDefinitionsBegin( AppendCppTypeName( enclosingTypeTypeName, output); - output.Append("(Plugin::InternalUse, int32_t handle)\n"); + output.AppendLine("(Plugin::InternalUse, int32_t handle)"); if (enclosingTypeKind == TypeKind.Class) { AppendCppConstructorInitializerList( @@ -11544,13 +11561,13 @@ static int AppendCppMethodDefinitionsBegin( output); } AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 1, output); - output.Append("Handle = handle;\n"); + output.AppendLine("Handle = handle;"); AppendIndent(indent + 1, output); - output.Append("if (handle)\n"); + output.AppendLine("if (handle)"); AppendIndent(indent + 1, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 2, output); AppendReferenceManagedHandleFunctionCall( enclosingTypeTypeName, @@ -11558,14 +11575,14 @@ static int AppendCppMethodDefinitionsBegin( enclosingTypeParams, "handle", output); - output.Append(";\n"); + output.AppendLine(";"); AppendIndent(indent + 1, output); - output.Append("}\n"); + output.AppendLine("}"); extraDefault(indent + 1, "this->"); AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent(indent, output); - output.Append('\n'); + output.AppendLine();; // Copy constructor AppendIndent(indent, output); @@ -11586,20 +11603,20 @@ static int AppendCppMethodDefinitionsBegin( AppendCppTypeParameters( enclosingTypeParams, output); - output.Append("& other)\n"); + output.AppendLine("& other)"); AppendIndent(indent + 1, output); output.Append(": "); AppendCppTypeName( enclosingTypeTypeName, output); - output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); + output.AppendLine("(Plugin::InternalUse::Only, other.Handle)"); AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); extraCopy(indent + 1, "other."); AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent(indent, output); - output.Append('\n'); + output.AppendLine();; // Move constructor AppendIndent(indent, output); @@ -11620,23 +11637,23 @@ static int AppendCppMethodDefinitionsBegin( AppendCppTypeParameters( enclosingTypeParams, output); - output.Append("&& other)\n"); + output.AppendLine("&& other)"); AppendIndent(indent, output); output.Append("\t: "); AppendCppTypeName( enclosingTypeTypeName, output); - output.Append("(Plugin::InternalUse::Only, other.Handle)\n"); + output.AppendLine("(Plugin::InternalUse::Only, other.Handle)"); AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 1, output); - output.Append("other.Handle = 0;\n"); + output.AppendLine("other.Handle = 0;"); extraCopy(indent + 1, "other."); extraDefault(indent + 1, "other."); AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent(indent, output); - output.Append('\n'); + output.AppendLine();; // Destructor AppendIndent(indent, output); @@ -11653,13 +11670,13 @@ static int AppendCppMethodDefinitionsBegin( AppendCppTypeParameters( enclosingTypeParams, output); - output.Append("()\n"); + output.AppendLine("()"); AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 1, output); - output.Append("if (Handle)\n"); + output.AppendLine("if (Handle)"); AppendIndent(indent + 1, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 2, output); AppendDereferenceManagedHandleFunctionCall( enclosingTypeTypeName, @@ -11667,15 +11684,15 @@ static int AppendCppMethodDefinitionsBegin( enclosingTypeParams, "Handle", output); - output.Append(";\n"); + output.AppendLine(";"); AppendIndent(indent + 2, output); - output.Append("Handle = 0;\n"); + output.AppendLine("Handle = 0;"); AppendIndent(indent + 1, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent(indent, output); - output.Append('\n'); + output.AppendLine();; // Assignment operator to same type AppendIndent(indent, output); @@ -11699,9 +11716,9 @@ static int AppendCppMethodDefinitionsBegin( AppendCppTypeParameters( enclosingTypeParams, output); - output.Append("& other)\n"); + output.AppendLine("& other)"); AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendSetHandle( enclosingTypeTypeName, enclosingTypeKind, @@ -11712,11 +11729,11 @@ static int AppendCppMethodDefinitionsBegin( output); extraCopy(indent + 1, "other."); AppendIndent(indent + 1, output); - output.Append("return *this;\n"); + output.AppendLine("return *this;"); AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent(indent, output); - output.Append('\n'); + output.AppendLine();; // Assignment operator to nullptr AppendIndent(indent, output); @@ -11733,13 +11750,13 @@ static int AppendCppMethodDefinitionsBegin( AppendCppTypeParameters( enclosingTypeParams, output); - output.Append("::operator=(decltype(nullptr))\n"); + output.AppendLine("::operator=(decltype(nullptr))"); AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 1, output); - output.Append("if (Handle)\n"); + output.AppendLine("if (Handle)"); AppendIndent(indent + 1, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 2, output); AppendDereferenceManagedHandleFunctionCall( enclosingTypeTypeName, @@ -11747,17 +11764,17 @@ static int AppendCppMethodDefinitionsBegin( enclosingTypeParams, "Handle", output); - output.Append(";\n"); + output.AppendLine(";"); AppendIndent(indent + 2, output); - output.Append("Handle = 0;\n"); + output.AppendLine("Handle = 0;"); AppendIndent(indent + 1, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent(indent + 1, output); - output.Append("return *this;\n"); + output.AppendLine("return *this;"); AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent(indent, output); - output.Append('\n'); + output.AppendLine();; // Move assignment operator to same type AppendIndent(indent, output); @@ -11781,13 +11798,13 @@ static int AppendCppMethodDefinitionsBegin( AppendCppTypeParameters( enclosingTypeParams, output); - output.Append("&& other)\n"); + output.AppendLine("&& other)"); AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 1, output); - output.Append("if (Handle)\n"); + output.AppendLine("if (Handle)"); AppendIndent(indent + 1, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 2, output); AppendDereferenceManagedHandleFunctionCall( enclosingTypeTypeName, @@ -11795,21 +11812,21 @@ static int AppendCppMethodDefinitionsBegin( enclosingTypeParams, "Handle", output); - output.Append(";\n"); + output.AppendLine(";"); AppendIndent(indent + 1, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent(indent + 1, output); - output.Append("Handle = other.Handle;\n"); + output.AppendLine("Handle = other.Handle;"); extraCopy(indent + 1, "other."); AppendIndent(indent + 1, output); - output.Append("other.Handle = 0;\n"); + output.AppendLine("other.Handle = 0;"); extraDefault(indent + 1, "other."); AppendIndent(indent + 1, output); - output.Append("return *this;\n"); + output.AppendLine("return *this;"); AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent(indent, output); - output.Append('\n'); + output.AppendLine();; // Equality operator with same type AppendIndent(indent, output); @@ -11827,15 +11844,15 @@ static int AppendCppMethodDefinitionsBegin( AppendCppTypeParameters( enclosingTypeParams, output); - output.Append("& other) const\n"); + output.AppendLine("& other) const"); AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 1, output); - output.Append("return Handle == other.Handle;\n"); + output.AppendLine("return Handle == other.Handle;"); AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent(indent, output); - output.Append('\n'); + output.AppendLine();; // Inequality operator with same type AppendIndent(indent, output); @@ -11853,15 +11870,15 @@ static int AppendCppMethodDefinitionsBegin( AppendCppTypeParameters( enclosingTypeParams, output); - output.Append("& other) const\n"); + output.AppendLine("& other) const"); AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 1, output); - output.Append("return Handle != other.Handle;\n"); + output.AppendLine("return Handle != other.Handle;"); AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent(indent, output); - output.Append('\n'); + output.AppendLine();; } return cppMethodDefinitionsIndent; } @@ -11879,9 +11896,9 @@ static void AppendSetHandle( AppendIndent(indent, output); output.Append("if ("); output.Append(thisHandleExpression); - output.Append(")\n"); + output.AppendLine(")"); AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 1, output); AppendDereferenceManagedHandleFunctionCall( enclosingTypeTypeName, @@ -11889,20 +11906,20 @@ static void AppendSetHandle( enclosingTypeParams, thisHandleExpression, output); - output.Append(";\n"); + output.AppendLine(";"); AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); AppendIndent(indent, output); output.Append(thisHandleExpression); output.Append(" = "); output.Append(otherHandleExpression); - output.Append(";\n"); + output.AppendLine(";"); AppendIndent(indent, output); output.Append("if ("); output.Append(thisHandleExpression); - output.Append(")\n"); + output.AppendLine(")"); AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 1, output); AppendReferenceManagedHandleFunctionCall( enclosingTypeTypeName, @@ -11910,9 +11927,9 @@ static void AppendSetHandle( enclosingTypeParams, thisHandleExpression, output); - output.Append(";\n"); + output.AppendLine(";"); AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); } static void AppendReferenceManagedHandleFunctionCall( @@ -11968,11 +11985,11 @@ static void AppendCppMethodDefinitionsEnd( StringBuilder output) { RemoveTrailingChars(output); - output.Append('\n'); + output.AppendLine();; AppendNamespaceEnding( indent, output); - output.Append('\n'); + output.AppendLine();; } static int AppendNamespaceBeginning( @@ -11993,9 +12010,9 @@ static int AppendNamespaceBeginning( AppendIndent(indent, output); output.Append("namespace "); output.Append(namespaceName, startIndex, len); - output.Append('\n'); + output.AppendLine();; AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); if (separatorIndex < 0) { break; @@ -12015,7 +12032,7 @@ static void AppendNamespaceEnding( for (; indent >= 0; --indent) { AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); } } @@ -12035,8 +12052,8 @@ static void AppendCsharpCsharpDelegate( "\t\t\tMarshal.WriteIntPtr(memory, curMemory, Marshal.GetFunctionPointerForDelegate("); initCallOutput.Append(funcName); initCallOutput.Append("Delegate"); - initCallOutput.Append("));\n"); - initCallOutput.Append("\t\t\tcurMemory += IntPtr.Size;\n"); + initCallOutput.AppendLine("));"); + initCallOutput.AppendLine("\t\t\tcurMemory += IntPtr.Size;"); delegateOutput.Append("\t\tstatic readonly "); delegateOutput.Append(funcName); @@ -12046,7 +12063,7 @@ static void AppendCsharpCsharpDelegate( delegateOutput.Append(funcName); delegateOutput.Append("DelegateType("); delegateOutput.Append(funcName); - delegateOutput.Append(");\n"); + delegateOutput.AppendLine(");"); } static void AppendCsharpDelegateType( @@ -12058,7 +12075,7 @@ static void AppendCsharpDelegateType( ParameterInfo[] parameters, StringBuilder output) { - output.Append("\t\t[UnmanagedFunctionPointer(CallingConvention.Cdecl)]\n"); + output.AppendLine("\t\t[UnmanagedFunctionPointer(CallingConvention.Cdecl)]"); output.Append("\t\tdelegate "); // Return type @@ -12098,7 +12115,7 @@ static void AppendCsharpDelegateType( AppendCsharpBindingParameterDeclaration( parameters, output); - output.Append(");\n"); + output.AppendLine(");"); } static void AppendCsharpFunctionBeginning( @@ -12112,7 +12129,8 @@ static void AppendCsharpFunctionBeginning( { output.Append("\t\t[MonoPInvokeCallback(typeof("); output.Append(funcName); - output.Append("DelegateType))]\n\t\tstatic "); + output.AppendLine("DelegateType))]"); + output.Append("\t\tstatic "); // Return type if (returnType != null) @@ -12157,10 +12175,14 @@ static void AppendCsharpFunctionBeginning( AppendCsharpBindingParameterDeclaration( parameters, output); - output.Append(")\n\t\t{\n\t\t\t"); + output.AppendLine(")"); + output.AppendLine("\t\t{"); + output.Append("\t\t\t"); // Start try/catch block - output.Append("try\n\t\t\t{\n\t\t\t\t"); + output.AppendLine("try"); + output.AppendLine("\t\t\t{"); + output.Append("\t\t\t\t"); // Get "this" if (!isStatic @@ -12174,8 +12196,10 @@ static void AppendCsharpFunctionBeginning( AppendHandleStoreTypeName( enclosingType, output); + output.AppendLine( + ".Get(thisHandle);"); output.Append( - ".Get(thisHandle);\n\t\t\t\t"); + "\t\t\t\t"); } // Get managed type params from ObjectStore @@ -12197,7 +12221,8 @@ static void AppendCsharpFunctionBeginning( AppendHandleStoreTypeName(paramType, output); output.Append(".Get("); output.Append(param.Name); - output.Append("Handle);\n\t\t\t\t"); + output.AppendLine("Handle);"); + output.Append("\t\t\t\t"); } } @@ -12254,7 +12279,8 @@ static void AppendStructStoreReplace( string structVariable, StringBuilder output) { - output.Append("\n\t\t\t\t"); + output.AppendLine(); + output.Append("\t\t\t\t"); AppendHandleStoreTypeName( enclosingType, output); @@ -12280,7 +12306,8 @@ static void AppendCsharpFunctionReturn( || param.Kind == TypeKind.ManagedStruct) && (param.IsOut || param.IsRef)) { - output.Append("\n\t\t\t\tint "); + output.AppendLine(); + output.Append("\t\t\t\tint "); output.Append(param.Name); output.Append("HandleNew = "); AppendHandleStoreTypeName( @@ -12297,7 +12324,8 @@ static void AppendCsharpFunctionReturn( } output.Append('('); output.Append(param.Name); - output.Append(");\n\t\t\t\t"); + output.AppendLine(");"); + output.Append("\t\t\t\t"); output.Append(param.Name); output.Append("Handle = "); output.Append(param.Name); @@ -12308,7 +12336,8 @@ static void AppendCsharpFunctionReturn( // Return if (returnType != typeof(void)) { - output.Append("\n\t\t\t\treturn "); + output.AppendLine(); + output.Append("\t\t\t\treturn "); if ( forceReturnReturnValue || returnTypeKind == TypeKind.Enum @@ -12350,8 +12379,8 @@ static void AppendCsharpFunctionEnd( ParameterInfo[] parameters, StringBuilder output) { - output.Append('\n'); - output.Append("\t\t\t}\n"); + output.AppendLine();; + output.AppendLine("\t\t\t}"); if (exceptionTypes == null || Array.IndexOf( exceptionTypes, @@ -12379,8 +12408,8 @@ static void AppendCsharpFunctionEnd( returnType, parameters, output); - output.Append("\t\t}\n"); - output.Append("\t\t\n"); + output.AppendLine("\t\t}"); + output.AppendLine("\t\t"); } static void AppendCsharpCatchException( @@ -12393,14 +12422,14 @@ static void AppendCsharpCatchException( AppendCsharpTypeFullName( exceptionType, output); - output.Append(" ex)\n"); - output.Append("\t\t\t{\n"); - output.Append("\t\t\t\tUnityEngine.Debug.LogException(ex);\n"); + output.AppendLine(" ex)"); + output.AppendLine("\t\t\t{"); + output.AppendLine("\t\t\t\tUnityEngine.Debug.LogException(ex);"); output.Append("\t\t\t\tNativeScript.Bindings."); AppendCsharpSetCsharpExceptionFunctionName( exceptionType, output); - output.Append("(NativeScript.Bindings.ObjectStore.Store(ex));\n"); + output.AppendLine("(NativeScript.Bindings.ObjectStore.Store(ex));"); foreach (ParameterInfo param in parameters) { if (param.IsOut) @@ -12410,7 +12439,7 @@ static void AppendCsharpCatchException( if (param.Kind == TypeKind.Class || param.Kind == TypeKind.ManagedStruct) { - output.Append("Handle = default(int);\n"); + output.AppendLine("Handle = default(int);"); } else { @@ -12418,7 +12447,7 @@ static void AppendCsharpCatchException( AppendCsharpTypeFullName( param.DereferencedParameterType, output); - output.Append(");\n"); + output.AppendLine(");"); } } } @@ -12435,9 +12464,9 @@ static void AppendCsharpCatchException( { output.Append("int"); } - output.Append(");\n"); + output.AppendLine(");"); } - output.Append("\t\t\t}\n"); + output.AppendLine("\t\t\t}"); } static void AppendCsharpSetCsharpExceptionFunctionName( @@ -12656,10 +12685,10 @@ static void AppendCppInitBodyFunctionPointerParameterRead( returnType, 2, output); - output.Append(")curMemory;\n"); + output.AppendLine(")curMemory;"); output.Append("\tcurMemory += sizeof(Plugin::"); output.Append(globalVariableName); - output.Append(");\n"); + output.AppendLine(");"); } static void AppendCppMethodDefinitionBegin( @@ -12718,7 +12747,7 @@ static void AppendCppMethodDefinitionBegin( null, // don't substitute method type params false, output); - output.Append(")\n"); + output.AppendLine(")"); } static void AppendCppMethodReturn( @@ -12745,7 +12774,7 @@ static void AppendCppMethodReturn( output.Append("(Plugin::InternalUse::Only, returnValue)"); break; } - output.Append(";\n"); + output.AppendLine(";"); } } @@ -12772,7 +12801,7 @@ static void AppendCppPluginFunctionCall( output.Append(param.Name); output.Append("Handle = "); output.Append(param.Name); - output.Append("->Handle;\n"); + output.AppendLine("->Handle;"); } } @@ -12840,7 +12869,7 @@ static void AppendCppPluginFunctionCall( output.Append(", "); } } - output.Append(");\n"); + output.AppendLine(");"); AppendCppUnhandledExceptionHandling( indent, @@ -12870,19 +12899,19 @@ static void AppendCppUnhandledExceptionHandling( StringBuilder output) { AppendIndent(indent, output); - output.Append("if (Plugin::unhandledCsharpException)\n"); + output.AppendLine("if (Plugin::unhandledCsharpException)"); AppendIndent(indent, output); - output.Append("{\n"); + output.AppendLine("{"); AppendIndent(indent + 1, output); - output.Append("System::Exception* ex = Plugin::unhandledCsharpException;\n"); + output.AppendLine("System::Exception* ex = Plugin::unhandledCsharpException;"); AppendIndent(indent + 1, output); - output.Append("Plugin::unhandledCsharpException = nullptr;\n"); + output.AppendLine("Plugin::unhandledCsharpException = nullptr;"); AppendIndent(indent + 1, output); - output.Append("ex->ThrowReferenceToThis();\n"); + output.AppendLine("ex->ThrowReferenceToThis();"); AppendIndent(indent + 1, output); - output.Append("delete ex;\n"); + output.AppendLine("delete ex;"); AppendIndent(indent, output); - output.Append("}\n"); + output.AppendLine("}"); } static void AppendCppFunctionPointerDefinition( @@ -12907,7 +12936,7 @@ StringBuilder output output ); output.Append(';'); - output.Append('\n'); + output.AppendLine();; } static void AppendCppFunctionPointer( @@ -13111,7 +13140,7 @@ static void AppendCppMethodDeclaration( output); output.Append(')'); - output.Append(";\n"); + output.AppendLine(";"); } static void AppendCsharpTypeFullName( @@ -13432,17 +13461,12 @@ static void RemoveTrailingChars( for (i = len - 1; i >= 0; --i) { char cur = builder[i]; - switch (cur) + if (!char.IsWhiteSpace(cur) && cur != ',') { - case '\n': - case '\t': - case ',': - break; - default: - goto after; + break; } } - after: + if (i < len - 1) { builder.Remove(i + 1, len - i - 1); @@ -13458,123 +13482,123 @@ static void InjectBuilders( string cppSourceContents = File.ReadAllText(CppSourcePath); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN DELEGATE TYPES*/"+Environment.NewLine, - Environment.NewLine+"\t\t/*END DELEGATE TYPES*/", + "/*BEGIN DELEGATE TYPES*/", + "\t\t/*END DELEGATE TYPES*/", builders.CsharpDelegateTypes.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN STORE INIT CALLS*/"+Environment.NewLine, - Environment.NewLine+"\t\t\t/*END STORE INIT CALLS*/", + "/*BEGIN STORE INIT CALLS*/", + "\t\t\t/*END STORE INIT CALLS*/", builders.CsharpStoreInitCalls.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN INIT CALL*/"+Environment.NewLine, - Environment.NewLine+"\t\t\t/*END INIT CALL*/", + "/*BEGIN INIT CALL*/", + "\t\t\t/*END INIT CALL*/", builders.CsharpInitCall.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN BASE TYPES*/"+Environment.NewLine, - Environment.NewLine+"/*END BASE TYPES*/", + "/*BEGIN BASE TYPES*/", + "/*END BASE TYPES*/", builders.CsharpBaseTypes.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN FUNCTIONS*/"+Environment.NewLine, - Environment.NewLine+"\t\t/*END FUNCTIONS*/", + "/*BEGIN FUNCTIONS*/", + "\t\t/*END FUNCTIONS*/", builders.CsharpFunctions.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN CPP DELEGATES*/"+Environment.NewLine, - Environment.NewLine+"\t\t/*END CPP DELEGATES*/", + "/*BEGIN CPP DELEGATES*/", + "\t\t/*END CPP DELEGATES*/", builders.CsharpCppDelegates.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN CSHARP DELEGATES*/"+Environment.NewLine, - Environment.NewLine+"\t\t/*END CSHARP DELEGATES*/", + "/*BEGIN CSHARP DELEGATES*/", + "\t\t/*END CSHARP DELEGATES*/", builders.CsharpCsharpDelegates.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN IMPORTS*/"+Environment.NewLine, - Environment.NewLine+"\t\t/*END IMPORTS*/", + "/*BEGIN IMPORTS*/", + "\t\t/*END IMPORTS*/", builders.CsharpImports.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN GETDELEGATE CALLS*/"+Environment.NewLine, - Environment.NewLine+"\t\t\t/*END GETDELEGATE CALLS*/", + "/*BEGIN GETDELEGATE CALLS*/", + "\t\t\t/*END GETDELEGATE CALLS*/", builders.CsharpGetDelegateCalls.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN DESTROY FUNCTION ENUMERATORS*/"+Environment.NewLine, - Environment.NewLine+"\t\t\t/*END DESTROY FUNCTION ENUMERATORS*/", + "/*BEGIN DESTROY FUNCTION ENUMERATORS*/", + "\t\t\t/*END DESTROY FUNCTION ENUMERATORS*/", builders.CsharpDestroyFunctionEnumerators.ToString()); csharpContents = InjectIntoString( csharpContents, - "/*BEGIN DESTROY QUEUE CASES*/"+Environment.NewLine, - Environment.NewLine+"\t\t\t\t\t\t/*END DESTROY QUEUE CASES*/", + "/*BEGIN DESTROY QUEUE CASES*/", + "\t\t\t\t\t\t/*END DESTROY QUEUE CASES*/", builders.CsharpDestroyQueueCases.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN FUNCTION POINTERS*/"+Environment.NewLine, - Environment.NewLine+"\t/*END FUNCTION POINTERS*/", + "/*BEGIN FUNCTION POINTERS*/", + "\t/*END FUNCTION POINTERS*/", builders.CppFunctionPointers.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN TYPE DECLARATIONS*/"+Environment.NewLine, - Environment.NewLine+"/*END TYPE DECLARATIONS*/", + "/*BEGIN TYPE DECLARATIONS*/", + "/*END TYPE DECLARATIONS*/", builders.CppTypeDeclarations.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN TEMPLATE DECLARATIONS*/"+Environment.NewLine, - Environment.NewLine+"/*END TEMPLATE DECLARATIONS*/", + "/*BEGIN TEMPLATE DECLARATIONS*/", + "/*END TEMPLATE DECLARATIONS*/", builders.CppTemplateDeclarations.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN TEMPLATE SPECIALIZATION DECLARATIONS*/"+Environment.NewLine, - Environment.NewLine+"/*END TEMPLATE SPECIALIZATION DECLARATIONS*/", + "/*BEGIN TEMPLATE SPECIALIZATION DECLARATIONS*/", + "/*END TEMPLATE SPECIALIZATION DECLARATIONS*/", builders.CppTemplateSpecializationDeclarations.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN TYPE DEFINITIONS*/"+Environment.NewLine, - Environment.NewLine+"/*END TYPE DEFINITIONS*/", + "/*BEGIN TYPE DEFINITIONS*/", + "/*END TYPE DEFINITIONS*/", builders.CppTypeDefinitions.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN METHOD DEFINITIONS*/"+Environment.NewLine, - Environment.NewLine+"/*END METHOD DEFINITIONS*/", + "/*BEGIN METHOD DEFINITIONS*/", + "/*END METHOD DEFINITIONS*/", builders.CppMethodDefinitions.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN INIT BODY PARAMETER READS*/"+Environment.NewLine, - Environment.NewLine+"\t/*END INIT BODY PARAMETER READS*/", + "/*BEGIN INIT BODY PARAMETER READS*/", + "\t/*END INIT BODY PARAMETER READS*/", builders.CppInitBodyParameterReads.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN INIT BODY ARRAYS*/"+Environment.NewLine, - Environment.NewLine+"\t/*END INIT BODY ARRAYS*/", + "/*BEGIN INIT BODY ARRAYS*/", + "\t/*END INIT BODY ARRAYS*/", builders.CppInitBodyArrays.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN INIT BODY FIRST BOOT*/"+Environment.NewLine, - Environment.NewLine+"\t\t/*END INIT BODY FIRST BOOT*/", + "/*BEGIN INIT BODY FIRST BOOT*/", + "\t\t/*END INIT BODY FIRST BOOT*/", builders.CppInitBodyFirstBoot.ToString()); cppSourceContents = InjectIntoString( cppSourceContents, - "/*BEGIN GLOBAL STATE AND FUNCTIONS*/"+Environment.NewLine, - Environment.NewLine+"\t/*END GLOBAL STATE AND FUNCTIONS*/", + "/*BEGIN GLOBAL STATE AND FUNCTIONS*/", + "\t/*END GLOBAL STATE AND FUNCTIONS*/", builders.CppGlobalStateAndFunctions.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN UNBOXING METHOD DECLARATIONS*/"+Environment.NewLine, - Environment.NewLine+"\t\t/*END UNBOXING METHOD DECLARATIONS*/", + "/*BEGIN UNBOXING METHOD DECLARATIONS*/", + "\t\t/*END UNBOXING METHOD DECLARATIONS*/", builders.CppUnboxingMethodDeclarations.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN STRING DEFAULT PARAMETERS*/"+Environment.NewLine, - Environment.NewLine+"\t/*END STRING DEFAULT PARAMETERS*/", + "/*BEGIN STRING DEFAULT PARAMETERS*/", + "\t/*END STRING DEFAULT PARAMETERS*/", builders.CppStringDefaultParams.ToString()); cppHeaderContents = InjectIntoString( cppHeaderContents, - "/*BEGIN MACROS*/"+Environment.NewLine, - Environment.NewLine+"/*END MACROS*/", + "/*BEGIN MACROS*/", + "/*END MACROS*/", builders.CppMacros.ToString()); File.WriteAllText(CsharpPath, csharpContents); @@ -13588,7 +13612,8 @@ static string InjectIntoString( string endMarker, string text) { - for (int startIndex = 0; ; ) + int startIndex = 0; + while(true) { int beginIndex = contents.IndexOf(beginMarker, startIndex, StringComparison.OrdinalIgnoreCase); if (beginIndex < 0) @@ -13609,7 +13634,7 @@ static string InjectIntoString( } string begin = contents.Substring(0, afterBeginIndex); string end = contents.Substring(endIndex); - contents = begin + text + end; + contents = begin + Environment.NewLine + text + Environment.NewLine + end; startIndex = beginIndex + 1; } } From a2afdbbbd2fd0248b838533babf8e249963361b1 Mon Sep 17 00:00:00 2001 From: "Youngkyoung, Lee" Date: Tue, 9 Feb 2021 00:10:31 +0900 Subject: [PATCH 91/95] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 14f12cc..8b108f6 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ With C++, the workflow looks like this: 2. Create a directory for build files. Anywhere is fine. 3. Open a Command Prompt by clicking the Start button, typing "Command Prompt", then clicking the app 4. Execute `cd /path/to/your/build/directory` -5. Execute `cmake -G "Visual Studio VERSION YEAR Win64" -DEDITOR=TRUE /path/to/your/project/CppSource`. Replace `VERSION` and `YEAR` with the version of Visual Studio you want to use. To see the options, execute `cmake --help` and look at the list at the bottom. For example, use `"Visual Studio 15 2017 Win64"` for Visual Studio 2017. Any version, including Community, works just fine. Remove `-DEDITOR=TRUE` for standalone builds. +5. Execute `cmake -G "Visual Studio VERSION YEAR Win64" -DEDITOR=TRUE /path/to/your/project/CppSource`. Replace `VERSION` and `YEAR` with the version of Visual Studio you want to use. To see the options, execute `cmake --help` and look at the list at the bottom. For example, use `"Visual Studio 15 2017 Win64"` for Visual Studio 2017. Any version, including Community, works just fine. Remove `-DEDITOR=TRUE` for standalone builds. If you are using Visual Studio 2019, execute `cmake -G "Visual Studio 16" -A "x64" -DEDITOR=TRUE /path/to/your/project/CppSource` instead. 6. The project files are now generated in your build directory 7. Open `NativeScript.sln` and click `Build > Build Solution`. From 00443ef39d5418f3c744654c0d3d4036c2a81634 Mon Sep 17 00:00:00 2001 From: Jackson Dunstan Date: Sun, 21 Feb 2021 17:15:26 -0800 Subject: [PATCH 92/95] Don't use "= default" on the System.Object destructor so its "noexcept" matches derived classes --- Unity/Assets/CppSource/NativeScript/Bindings.cpp | 4 ++++ Unity/Assets/CppSource/NativeScript/Bindings.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Unity/Assets/CppSource/NativeScript/Bindings.cpp b/Unity/Assets/CppSource/NativeScript/Bindings.cpp index cd62a88..8cb2e2e 100644 --- a/Unity/Assets/CppSource/NativeScript/Bindings.cpp +++ b/Unity/Assets/CppSource/NativeScript/Bindings.cpp @@ -966,6 +966,10 @@ namespace System : ManagedType(nullptr) { } + + Object::~Object() + { + } bool Object::operator==(decltype(nullptr)) const { diff --git a/Unity/Assets/CppSource/NativeScript/Bindings.h b/Unity/Assets/CppSource/NativeScript/Bindings.h index 093dc3b..4da12a4 100644 --- a/Unity/Assets/CppSource/NativeScript/Bindings.h +++ b/Unity/Assets/CppSource/NativeScript/Bindings.h @@ -585,7 +585,7 @@ namespace System Object(); Object(Plugin::InternalUse iu, int32_t handle); Object(decltype(nullptr)); - virtual ~Object() = default; + virtual ~Object(); bool operator==(decltype(nullptr)) const; bool operator!=(decltype(nullptr)) const; virtual void ThrowReferenceToThis(); From e8c9b6b414e9ee406596f9428fe2b1d5d6aeb439 Mon Sep 17 00:00:00 2001 From: philipcass <244523+philipcass@users.noreply.github.com> Date: Mon, 22 Feb 2021 15:36:28 +0000 Subject: [PATCH 93/95] Fix for standalone builds defaulting to int parameters There was a mis-match in how types were specified in editor/build delegates. Changed so they both now use the same switch statement --- .../NativeScript/Editor/GenerateBindings.cs | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 29fe4c7..3b1bc12 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -10573,18 +10573,21 @@ StringBuilder output for (int i = 0; i < parameters.Length; ++i) { ParameterInfo param = parameters[i]; - if (param.Kind == TypeKind.FullStruct) - { - AppendCsharpTypeFullName( - param.ParameterType, - output); - output.Append(" param"); - output.Append(i); - } - else + switch (param.Kind) { - output.Append("int param"); - output.Append(i); + case TypeKind.FullStruct: + case TypeKind.Primitive: + case TypeKind.Enum: + AppendCsharpTypeFullName( + param.ParameterType, + output); + output.Append(" param"); + output.Append(i); + break; + default: + output.Append("int param"); + output.Append(i); + break; } if (i != parameters.Length-1) { @@ -13639,4 +13642,4 @@ static string InjectIntoString( } } } -} \ No newline at end of file +} From c53adea79b78cdd6ba5fc5505f66eddab73596ea Mon Sep 17 00:00:00 2001 From: philipcass <244523+philipcass@users.noreply.github.com> Date: Mon, 1 Mar 2021 14:14:11 +0000 Subject: [PATCH 94/95] Fix CPP event accessors Added hacky fix to resolve event accessors both adding delegates --- Unity/Assets/NativeScript/Editor/GenerateBindings.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 3b1bc12..61af988 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -3427,7 +3427,15 @@ static void AppendEventAddRemoveMethod( builders.CsharpFunctions); builders.CsharpFunctions.Append('.'); builders.CsharpFunctions.Append(eventName); - builders.CsharpFunctions.Append(" += del;"); + // TODO: More safely differenciate between add/removing event delegates + if (funcName.Contains("RemoveEvent")) + { + builders.CsharpFunctions.Append(" -= del;"); + } + else + { + builders.CsharpFunctions.Append(" += del;"); + } AppendCsharpFunctionEnd( typeof(void), null, From 2eb88245bec25c36fa83716f9016bd056cc33dff Mon Sep 17 00:00:00 2001 From: philipcass <244523+philipcass@users.noreply.github.com> Date: Mon, 1 Mar 2021 14:20:36 +0000 Subject: [PATCH 95/95] Set abstract base method declarations as virtual The codegen would set all abstract base methods to be non-virtual, this allows derived classes to cleanly override abstract function implementations --- Unity/Assets/NativeScript/Editor/GenerateBindings.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs index 3b1bc12..f927d2e 100644 --- a/Unity/Assets/NativeScript/Editor/GenerateBindings.cs +++ b/Unity/Assets/NativeScript/Editor/GenerateBindings.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections; using System.Collections.Generic; using System.IO; @@ -4155,7 +4155,8 @@ static void AppendMethod( AppendCppMethodDeclaration( cppMethodName, enclosingTypeIsStatic, - false, + // Mark as virtual if method/class is not static or generic + cppMethodIsStatic || enclosingTypeIsStatic || methodTypeParams != null? false : true, cppMethodIsStatic, cppReturnType, methodTypeParams,