Combining Windows 10 features with Unity games in your own plugin

News

Extraordinary Robot
Robot
Joined
Jun 27, 2006
Location
Chicago, IL
In case you're curious how to add Universal Windows Platform functionalities that isn't already covered with Unity APIs or with existing plugins - here is how you can write your own plugins targeting UWP.

Edit: one little correction, instead of checking all boxes for the stub plugin, just select the "Editor" box.

If you want to check again after watching the video, here are the steps in a nutshell - I have written about it in detail on my blog ... but in German.

Or you quickly look at the unity explanation.

- Create two folders in Unity, Plugins and Plugins\WSA

- in Visual Studio, create a project (Visual C#, Windows Universal, Class Library with .NET 4.6)

- create a new class file naming it after the contained functionality

- in the same, newly created solution: create a subproject (visual c#, classic desktop, class library with .NET 3.5). This will be a stub.

- change the build architecture to "Any CPU"

- delete both Class1.cs-files

- in the stub project, add an existing element, search for the previously created class and add it as a Link. Hit the little down-arrow next to "add" for that.

- put "using System.Threading.Tasks;" between "#if NETFX_CORE" and "#endif" as compiler directives.

- make the "class Plugin" public

now change the properties of both projects

- the build path of the original class library project should be the unity game folder\Plugins\WSA

- the stub project gets a new assembly name and standard namespace - it should be exactly the same as the other project's

- the output/build path should be unity game folder\Plugins

Build the solution to unity :)

Switch to Unity:

- the DLL in the plugins\WSA folder should be linked to the placeholder in the plugins-folder

Feel free to follow me on my

Facebook Page & Twitter:

Follow @kris_rothe

njs.gif


Continue reading...
 
Back
Top Bottom