Skip to content

Commit 466b95c

Browse files
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
1 parent 2f5600b commit 466b95c

7 files changed

Lines changed: 3386 additions & 977 deletions

File tree

README.md

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -147,45 +147,46 @@ To configure the code generator, open `NativeScriptTypes.json` and notice the ex
147147

148148
The code generator supports:
149149

150-
* Class types (i.e. Classes with methods, etc. Parameters, etc. are fine.)
151-
* Constructors
152-
* Methods
153-
* Fields
154-
* Properties (getters and setters)
155-
* Generic return types
156-
* `MonoBehaviour` classes with "message" functions (except `OnAudioFilterRead`)
150+
* Class types (including generics)
151+
* Base classes (including generics)
152+
* Constructors (including generic parameters)
153+
* Methods (including generic parameters and return types)
154+
* Fields (including generic types)
155+
* Properties (getters and setters) (including generic types)
156+
* `MonoBehaviour` classes with "message" functions like `Update` (except `OnAudioFilterRead`)
157157
* `out` and `ref` parameters
158158

159159
The code generator does not support (yet):
160160

161161
* Struct types
162162
* Arrays (single- or multi-dimensional)
163-
* Generic functions and types
164163
* Delegates
165164
* `MonoBehaviour` contents (e.g. fields) except for "message" functions
166165
* Overloaded operators
167166
* Exceptions
168167
* Default parameters
168+
* Interfaces
169169

170170
The JSON file is laid out as follows:
171171

172-
* Path - Absolute path to the DLL
173-
* Types - Array of types in the DLL to generate
174-
* Name - Name of the type including namespace (e.g. `UnityEngine.GameObject`)
175-
* Constructors - Array of constructors to generate
176-
* Types - Parameter types of the constructor including namespace
177-
* Methods - Array of methods to generate
178-
* Name - Name of the method
179-
* ParamTypes - Parameter types to the method including namespace
180-
* GenericTypes - Sets of type parameters to generate
181-
* Name - Name of the type parameter (e.g. `T`)
182-
* Type - Type to generate for the type parameter including namespace
183-
* Properties - Array of property names to generate
184-
* Fields - Array of field names to generate
185-
* MonoBehaviours
186-
* Name - Name of the `MonoBehaviour` class to generate
187-
* Namespace - Namespace to put the `MonoBehaviour` class in
188-
* Messages - Array of message names to generate (e.g. `Update`)
172+
* **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.
173+
* **Types** - Array of types in the DLL to generate
174+
* **Name** - Name of the type including namespace (e.g. `UnityEngine.GameObject`)
175+
* **Constructors** - Array of constructors to generate
176+
* **Types** - Parameter types of the constructor including namespace
177+
* **Methods** - Array of methods to generate
178+
* **Name** - Name of the method
179+
* **ParamTypes** - Parameter types to the method including namespace
180+
* **GenericTypes** - Sets of type parameters to generate (for the method)
181+
* **Types** - Type names in the set
182+
* **Properties** - Array of property names to generate
183+
* **Fields** - Array of field names to generate
184+
* **GenericTypes** - Sets of type parameters to generate (for the type)
185+
* **Types** - Type names in the set
186+
* **MonoBehaviours**
187+
* **Name** - Name of the `MonoBehaviour` class to generate
188+
* **Namespace** - Namespace to put the `MonoBehaviour` class in
189+
* **Messages** - Array of message names to generate (e.g. `Update`)
189190

190191
# Updating To A New Version
191192

Unity/Assets/NativeScript/Bindings.cs

Lines changed: 259 additions & 124 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)