Intro to porting Unity 3D games to UWP: Building and deploying

Windows

Windows
Please, Log in or Register to view URLs content!


Did you know that you can easily get your Unity 3D game into the Windows Store simply by creating it in Unity or porting an existing game to the Universal Windows Platform (UWP)? That’s a big deal, because the Windows Store opens up the whole spectrum of Windows 10 devices, and their users, to your game: PCs, tablets, Windows 10 phones, Xbox One, and even HoloLens.

In this post, we’re going to go over how to deploy a game from Unity 3D to a UWP project and then build your new UWP game in Visual Studio.

What you need


To develop, compile, and submit a Unity game to the Windows Store, you will need:

  • Please, Log in or Register to view URLs content!
    – Either the Unity free version or Unity Pro will work. The add-ons for publishing to the Windows Store are free for both basic and Unity Pro users.
  • Please, Log in or Register to view URLs content!
    – You can use any Visual Studio SKU, including the free Visual Studio Community. To target Universal Windows Platform, you will need at least Visual Studio 2015 Update 1.
  • Please, Log in or Register to view URLs content!
    – If you do not own a Windows 10 license, you can get a 90-day evaluation version. If you are running Mac OS X or will install on Apple hardware, check different options for installing using Boot Camp, VMWare, or Parallels.
  • Please, Log in or Register to view URLs content!
    – This will be needed to submit your game to the Windows Store. During this process you will register and get verified as an individual or as a business who can submit apps and games to the store. This registration allows you to submit apps and games to PC, Phone, Tablet and also in the future to HoloLens and Xbox. There is a small registration fee for individuals to sign up, although free Dev Center accounts are often available through Microsoft-sponsored programs (e.g. for startups).
  • Windows 10 test devices – While the Visual Studio simulators and emulators can replicate multi-touch and different display resolutions, it is recommended that you test on a real ARM mobile device with touch capability if you are developing a mobile/touch experience.

In this post, we will use Unity 5.3.3, Visual Studio 2015 Update 1, and Windows 10 Version 1511. For your benefit, it is recommended that you use at least Unity 5.3.2. Newer versions may have a different application programming interface.

Configuring developer mode in Windows 10


For Windows 10, whether using a desktop, tablet, or phone, you need to enable that device for development under System Settings.

To do so, navigate to System Settings and choose “Update & security.” Then choose, “For developers.” From here, you can simply select and enable “Developer mode.”

Please, Log in or Register to view URLs content!


Deploying your game from Unity


For the purposes of this post, let’s assume that you have already created a game in Unity. If you haven’t, though, there are several great Unity 3D
Please, Log in or Register to view URLs content!
available to get you started.

If your game was originally built for iOS or Android, it is important that you don’t have any platform specific controls or DLLs before attempting this. If you have platform specific code or libraries, the process outlined in this post may throw errors before you get to the end.

To start, we’re going to open up your Unity project and configure the build settings. To configure your settings in Unity, first click “File,” then “Build Settings.”



Please, Log in or Register to view URLs content!


Next, choose Windows Store in the Platform Window. Then select Universal 10 in the SDK dropdown.

Please, Log in or Register to view URLs content!


Select XAML in the UWP Build Type dropdown.

Please, Log in or Register to view URLs content!


Next, click the Player Settings… button.

Please, Log in or Register to view URLs content!


Enter your game details in the “Player Settings” window such as your default icon and product name. Your build settings are now properly configured in Unity3D to allow you to export to UWP.

Please, Log in or Register to view URLs content!


Click on the Build button in the Build Settings window. You will be prompted with a Build Windows Store dialog to select a folder for building your game.

Please, Log in or Register to view URLs content!


Once you have selected the folder, Unity will begin building your game, targeting the platform you selected. This can take several minutes if you have a lot of assets.

Please, Log in or Register to view URLs content!


A Windows Explorer window should now display the folder containing all the files generated by Unity.

Please, Log in or Register to view URLs content!


You will need to remember the location of your Visual Studio solution for the next step.

Building your UWP game in Visual Studio


From here on out, you’ll be working in Visual Studio. We’ve already exported your Unity 3D game into a UWP solution.

To get started in Visual Studio, navigate to the folder where you deployed the solution and open it in Visual Studio.

In order to distribute your UWP app to other users, either on the store or for
Please, Log in or Register to view URLs content!
, you need to follow the steps to create an
Please, Log in or Register to view URLs content!
package for it. When you create the appxupload, an additional appx package will be generated to use for testing and sideloading.

First, select either x86 or x64 from the platform dropdown as the platform.

Please, Log in or Register to view URLs content!


From the menu, click Build -> Build Solution or press F6.

Please, Log in or Register to view URLs content!


Allow the NuGet Package Manager to restore packages.

Please, Log in or Register to view URLs content!


Set the target to Local Machine. Then click Run. You can watch the progress of the build in the Output window.

Please, Log in or Register to view URLs content!


Finally, verify that the build succeeded.

Please, Log in or Register to view URLs content!


Now you are ready to deploy your app in Windows Store.

Note: If you intend to share the app with friends outside of Windows Store first, you can also sideload this app to install it on any Windows 10 device.

You will need to associate your app to with the Windows Store. To do so, navigate to the Project menu and choose Store -> Associate App with the Store….

Please, Log in or Register to view URLs content!


Your app is now enabled for test purchase and notification scenarios if you choose to do so.

When you associate your app with the store, the following values are downloaded to the app manifest file for the current project on your local machine:

  • Package Display Name
  • Package Name
  • Publisher ID
  • Publisher Display Name
  • Version

Note that you can override the default package.appxmanifest file by creating a custom .xml file for the manifest. As a general rule, however, you do not want to do this and really don’t want to alter the manifest file at all if you aren’t completely sure of what you are doing.

Wrapping Up


In this post, we’ve covered how to take your Unity 3D game and prepare it for deployment to the Windows Store. By using Unity 3D and Visual Studio together in your development toolchain, you can gain a much wider audience for your games. Just as exciting, you can potentially deploy your games to a greater variety of devices from tablets to phablets to gaming consoles to the latest emerging technologies built around Windows 10.

  • For more on developing games for Windows 10, check out the Windows 10 game development guide.
  • For more details on deploying Unity projects to Windows 10, consult Unity 3D’s
    Please, Log in or Register to view URLs content!
    .
  • For more information on deploying to the Windows Store, see
    Please, Log in or Register to view URLs content!
    .
  • You can also learn more about Windows 10
    Please, Log in or Register to view URLs content!
    on MSDN.

Please, Log in or Register to view URLs content!
 

Users who are viewing this thread

Top