You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,16 @@
1
1
Tool created mainly to solve old problem with reloading [native plugins](https://docs.unity3d.com/Manual/NativePlugins.html) without the need to reopen Unity Editor.
2
2
3
-
## Features / overview
4
-
- Automaticly unloads native plugins after stopping game and loads them when needed
3
+
## Features / Overview
4
+
5
+
- Automatically unloads native plugins after stopping game and loads them when needed
5
6
- You can unload/reload them manually, even when game is playing
6
7
- No code change is required (use usual `[DllImport]`)
7
8
-[Low level interface](https://docs.unity3d.com/Manual/NativePluginInterface.html) callbacks `UnityPluginLoad` and `UnityPluginUnload` do fire
8
9
- Works on Windows, Linux and Mac
9
10
- Ability to log native calls to file in order to diagnose crashes caused by them
10
11
11
-
## Instalation
12
+
## Installation
13
+
12
14
1. Download and add unity package from [releases](https://github.com/MCpiroman/UnityNativeTool/releases), or clone this repo to your project (note that if you don't use the prebuilt package and you're willing to use [low level interface callbacks](https://docs.unity3d.com/Manual/NativePluginInterface.html), you'll need to compile the stub plugin yourself form `stubLluiPlugin.c`).
13
15
14
16
2. In project settings, set _Api Compatibility Level_ to .NET 4.x or above.
@@ -20,24 +22,24 @@ Tool created mainly to solve old problem with reloading [native plugins](https:/
20
22
4. Set execution order of script `UnityNativeTool.DllManipulatorScript` to be the lowest of all scripts in game (at least of scripts that use native functions), e.g -10000.
21
23
Edit > Project Settings > Script Execution Order
22
24
23
-
5. One game object in the scene needs to have `DllManipulatorScript` on it. (This script calls `DontDestroayOnLoad(gameObject)` and deletes itself when dupliacate is found, so you don't have to worry about switching scenes).
25
+
5. One game object in the scene needs to have `DllManipulatorScript` on it. (This script calls `DontDestroayOnLoad(gameObject)` and deletes itself when duplicate is found, so you don't have to worry about switching scenes).
24
26
25
27
## Usage
26
28
- Your plugin files must be at path specified in options. By default, add __ (two underscores) at the beginning of your dll files in the Assets/Plugins folder (e.g. on Windows, plugin named `FastCalcs` should be at path `Assets\Plugins\__FastCalcs.dll`).
27
29
- By default, all native functions in main scripts assembly will be mocked (i.e. will be handled by this tool instead of Unity, which allows them to be unloaded). You can change this in options and use provided attributes to specify that yourself (these are in `UnityNativeTool` namespace).
28
30
- If something is not working, first check out available options (and read their descriptions), then [report an issue](https://github.com/mcpiroman/UnityNativeTool/issues/new).
29
31
- Options are accessible via `DllManipulatorScript` editor or window.
30
-
- Although this tool presumably works in builded game, it's intended to be used in editor.
32
+
- Although this tool presumably works in built game, it's intended to be used in editor.
31
33
32
34
## Limitations
33
35
- Marshaling parameter attributes other than `[MarshalAs]`, `[In]` and `[Out]` are not supported.
34
36
- Properties `MarshalCookie`, `MarshalType`, `MarshalTypeRef` and `SafeArrayUserDefinedSubType` on `[MarshalAs]` attribute are not supported (due to [Mono bug](https://github.com/mono/mono/issues/12747)).
35
37
- Explicitly specifying `UnmanagedType.LPArray` in `[MarshalAs]` is not supported (due to [another Mono bug](https://github.com/mono/mono/issues/16570)). Note that this should be default for array types, so in trivial situations you wouldn't need to use it.
36
38
- Properties `ExactSpelling` and `PreserveSig` on `[DllImport]` attribute are not supported (as if anyone uses them).
37
39
-`UnityRenderingExtEvent` and `UnityRenderingExtQuery` native callbacks don't fire.
38
-
- Threads that execute past `OnApplicationQuit` event are not-very-well handled (usualy not something to worry about).
40
+
- Threads that execute past `OnApplicationQuit` event are not-very-well handled (usually not something to worry about).
39
41
40
-
## Preformance
42
+
## Performance
41
43
42
44
| Configuration | Relative call time |
43
45
| --- |:---:|
@@ -49,7 +51,7 @@ Tool created mainly to solve old problem with reloading [native plugins](https:/
49
51
## Planned / possible features
50
52
- Seamless managed/native code debugging
51
53
- Improved thread safety and interthread synchronization
0 commit comments