2.0 KiB (Stored with Git LFS)
2.0 KiB (Stored with Git LFS)
Unity-Plugin-OptiTrack
OptiTrack plugin for the game engine Unity.
How to Setup a Project
In order to start developing on the Unity plugin you must first create a regular 3D example Unity project, then sync the GitHub projects into the "Assets" folder. Unity will then load all the resources for the plugin into the project automatically and you can start developing.
How to Start Developing
Here are the official Unity Docs on setting up Visual Studio as the debug environment.
Roughly this involves the setting a version of Visual Studio as the script editor:
- Go to Edit > Preferences > External Tools
- Set "External Script Editor" to "Visual Studio ####"
And also attaching the editor to Unity to hit debug breakpoints:
- Setup a Unity Project with the OptiTrack plugin repository.
- Double click one of the C# files.
- In Visual Studio press the "Attach to Unity" button where the build button usually is located.
- Play your game in Unity.
- Anytime debug breakpoints in the C# files are hit, then you can debug in Visual Studio.
Packaging Plugins for Release
Packaging plugins for Unity requires the following steps:
- Select the plugin root directory.
- Right click and select "Export Package..."
- This will generate a (.unitypackage) file, which is all you need.
Gotchas
- The "Native.cs" and "Client.cs" files in the Unity client are very important. They link with NatNetCAPI.cpp/h which is how a C# application can link to a streaming client primarily written in C++. There is a project in the NatNetSDK that also interfaces with these two files called the PInvoke sample. If you make updates to these files, then also make the same changes to the files in the PInvoke sample in the Perforce repository for Motive as well.