Reputation: 167
So I know it's possible to create a unity game and port - deploy it to the windows 10 store. but I have a different scenario (see below) that my boss wants but I've got no idea if this is even possible.
I need to create a UWP app and add a "unity 3d" container that allows me to view and interact with a unity scene.
I want to view a unity scene in the UWP app and have a list of assets, displayed in a listview within the UWP, based on the selected asset (within the UWP app), the scene should be updated.
Upvotes: 2
Views: 1748
Reputation: 161
I had a similar problem where I wanted to combine Unity with a XAML-UI in UWP. What worked for me was the .NET scripting backend for Unity. (You can install it with the Unity Download Assistant in case you missed it when installing Unity the first time.)
You create a new Unity project, go to "Player Settings" and set the property "Scripting Backend" to ".Net". Then you Build a UWP solution, and Unity generates you a .sln with the familiar UWP-structure (with files like App.xaml.cs, MainPage.xaml.cs and so on.) From these files, you can call your Unity scripts - and yes, you can also call code from xaml.cs in the unity scripts. The AppsCallbacksClass can be used to execute code on the AppThread(=Unity) or the UIThread(UWP).
Check out the Docs here (Scripting-Backend and AppCallbacks especially): https://docs.unity3d.com/Manual/WindowsStore.html
and the Xaml-Unity-Connection example here: https://bitbucket.org/Unity-Technologies/windowsstoreappssamples/src
Upvotes: 4