@@ -29,6 +29,14 @@ a single binary. So, what Unity is getting is:
29
29
all its .NET dependencies
30
30
- ` grpc_csharp_ext.dll ` , which is the native gRCP library used by the C# wrapper.
31
31
32
+ ### Unity Package
33
+
34
+ The goal of this repo is to use it within Unity. In order to do that, open the
35
+ Package Manager in Unity, and add ` org.visualpinball.engine.missionpinball ` under
36
+ * Add package from git URL* .
37
+
38
+ The Unity package is build and published to our registry on every merge to master.
39
+
32
40
## Setup
33
41
34
42
You currently need Python and MPF installed locally.
@@ -42,23 +50,24 @@ Or, if you already have it:
42
50
43
51
After that, ` mpf --version ` should return at least ** MPF v0.55.0-dev.37** .
44
52
45
- ## Usage
46
-
47
- Test code in the repo. Init:
48
-
49
- ``` cs
50
- var mpfApi = new MpfApi (@" path\to\machine\folder" );
51
-
52
- // spawn MPF and connect to it
53
- await mpfApi .Launch ();
53
+ ## Development Setup
54
54
55
- // start MPF
56
- mpfApi .Start ();
55
+ In order to import the package locally instead from our registry, clone and
56
+ compile it. This will copy the necessary binaries into the Unity folder. Only
57
+ then, import the project into Unity.
57
58
58
- // retrieve machine configuration
59
- var descr = await mpfApi .GetMachineDescription ();
59
+ Since the Unity folder contains ` .meta ` files of the binaries, but not the
60
+ actual binaries, ` .meta ` files of uncompiled platforms are cleaned up by Unity.
61
+ In order to not accidentally commit those files, we recommend to ignore them:
60
62
61
- Console .WriteLine ($" Description: {descr }" );
63
+ ``` bash
64
+ git update-index --assume-unchanged VisualPinball.Engine.Mpf.Unity/Plugins/linux-x64/libgrpc_csharp_ext.so.meta
65
+ git update-index --assume-unchanged VisualPinball.Engine.Mpf.Unity/Plugins/osx-x64/VisualPinball.Engine.Mpf.dll.meta
66
+ git update-index --assume-unchanged VisualPinball.Engine.Mpf.Unity/Plugins/osx-x64/libgrpc_csharp_ext.dylib.meta
67
+ git update-index --assume-unchanged VisualPinball.Engine.Mpf.Unity/Plugins/win-x64/VisualPinball.Engine.Mpf.dll.meta
68
+ git update-index --assume-unchanged VisualPinball.Engine.Mpf.Unity/Plugins/win-x64/grpc_csharp_ext.dll.meta
69
+ git update-index --assume-unchanged VisualPinball.Engine.Mpf.Unity/Plugins/win-x86/VisualPinball.Engine.Mpf.dll.meta
70
+ git update-index --assume-unchanged VisualPinball.Engine.Mpf.Unity/Plugins/win-x86/grpc_csharp_ext.dll.meta
62
71
```
63
72
64
73
## License
0 commit comments