Unity for Windows: III–Publishing your unity game to Windows Phone Store

原地址:http://digitalerr0r.wordpress.com/2013/08/27/unity-for-windows-iiipublishing-to-windows-phone-store/

Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

In Part II we covered how you can publish your game to Windows Store, so it runs on Windows 8 driven devices.

Today we are going to export our game to Windows Phone 8, and publish it to the Windows Phone Store, making it available to Windows Phone 8 devices! Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

Important: This guide is general and can be of help for all Unity games, not just the example here. It’s a living document and will be updated as I learn new stuff.

The Windows Phone Store gives your app a place to live, where millions of users might buy the game you worked hard to create.

Again, you can follow these steps (ish) to publish any game you might have created for Windows Phone using Unity.

I. Handling the Back button

All Windows Phone devices is equipted with a back button:
Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

It’s the tiny arrow on the left side. It is a requirement from the Windows Phone Store that this button is handeled. Luckily, this is very easy to do.

Unity comes with a nice set of tools to handle keyboard input – as you know. The back button on Windows Phone 8 is the same as the Escape key, so to implement logic on your back button, just check if the Escape key was pressed and handle it correctly:

if (Input.GetKeyDown(KeyCode.Escape))
{
    HandleBackbutton();
}

Then the body of this function in  a level might look like:

void HandleBackbutton()
{
    Application.LoadLevel(“MainMenu”);
}

or on the main menu:

void HandleBackbutton()
{
    Application.Quit();
}

 

In your game handler logic for all the various scenes you might have, add this to every scene to make sure the back button is handled correctly! Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

Simple, right? Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

II. Setting publishing settings in Unity and exporting

Open the game you want to export (we are using the game from Part I) in Unity, click File->Build Settings.. to open the project settings properties:

Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

Select Windows Phone 8 and click Switch Platform.

Now the main platform for the game is Windows Phone 8, but you can still export to the other platforms as well.

Click Player Settings.. to open the player settings properties:

Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

Set the Orientation to Auto Rotation:
Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

Then select the orientations you want to support:
Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

Click Build from the Build Settings screen and select a folder where to place the solution. I created a folder named WindowsPhone8 in the Unity project folder. Let it build the solution, it might take a few minutes.

Unity will now open the directory where the solution was exported.
Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

 

 

To open this, you will need Visual Studio 2012. If you are a student you might can get a licence from www.dreamspark.com, if not, you can download the express version for free here: http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-for-windows-phone

When installed, open the Invad0rs solution. You can see the project is loaded:

Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

Here you can change the splash screen by editing the SplashScreenImage.jpg, and the game tiles (app icons that can be seen on the phone):

Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

Now, test if the application runds by either running it on a Device or in the Simulator (included in Visual Studio 2012).

If you want to run on a device, just connect it to the computer and press play in Visual Studio:
Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

Next, we need to set a few properties for the assembly we will generate. Click PROJECT->Invad0rs properties
Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

In the Application tab, press the Assembly Information button:

Set the language to the main language of the game (must!), and if needed, change the rest of the properties.

Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

Click OK.

Next, we must change the Applications Tiles (the icon/tile the player sees on the phone). Go to the Assets folder of the exported solution (not in the Unity solution) and edit the files you see there (don’t change the resolution):

Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

(Don’t worry about the AlignmentGrid – just leave it)

Also, change the files in the Tiles folder:
Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

III. Adding support for Fast App Resume

To explain this simple, Fast App Resume will resume the game from where it left if you decide to go out of the game (using the Windows button) and then relaunch the game.

Open your solution and right click the WMAppManigest.xaml file and select View Code:

Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

The start of the code looks something like this, and I’m highlighting the line of interest:

<?xml version=”1.0″ encoding=”utf-8″?>
<Deployment xmlns=”
http://schemas.microsoft.com/windowsphone/2012/deployment”AppPlatformVersion=”8.0″>
  <DefaultLanguage xmlns=”” code=”en-US” />
  <App xmlns=”” ProductID=”{8F1EA4A3-0B57-4556-970D-D27298EA5B45}” Title=”SteamLands” RuntimeType=”Silverlight” Version=”1.0.0.0″ Genre=”apps.normal” Author=”Crust Development” Description=”You got lost in the wrong streets of SteamLands. Survive.” Publisher=”Crust Development” PublisherID=”{36e0404a-2921-4b73-8632-3bf364496337}”>
    <IconPath IsRelative=”true” IsResource=”false”>Assets\ApplicationIcon.png</IconPath>
    <Capabilities>
      <Capability Name=”ID_CAP_IDENTITY_DEVICE” />
      <Capability Name=”ID_CAP_MEDIALIB_AUDIO” />
      <Capability Name=”ID_CAP_MEDIALIB_PLAYBACK” />
      <Capability Name=”ID_CAP_NETWORKING” />
      <Capability Name=”ID_CAP_SENSORS” />
    </Capabilities>
    <Tasks>
      <DefaultTask Name=”_default” NavigationPage=”MainPage.xaml” />
    </Tasks>
    <Tokens>

This line is where we will all the Fast App Resume attribute:
ActivationPolicy=”Resume”

Modify the line so it looks like this:
<DefaultTask Name=”_default” NavigationPage=”MainPage.xaml” ActivationPolicy=”Resume”/>

Done – if you run the game on your device, and play for a while, then press the Windows key to do something else or make a call, and then press the app tile again to relaunch the game – it will continue from where you left!

IV. Setting the build to Master
When publishing a Windows Phone 8 game, you need to set the build settings to Master. This is to get rid of the Development Build message in the bottom right side of the app.

Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

V. Testing the solution with the built in Store Test Kit
Before we can send in the app, we need to do a Store Test on the app. Click PROJECT->Open Store Test Kit
Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

Run the automated tests to make sure the first test is passed (the XAP Package Requirements):
Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

Build the solution in Release mode:
Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

You can find the package in the Bin folder of the generated Visual Studio 2012 solution Unity created for us:
Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

 

VI. Creating you Windows Phone Store developer account
Go to http://dev.windowsphone.com to register your Windows Phone Developer Account.

 

VII. Submit the Windows Phone 8 game
Submitting the app is simple. Go to http://dev.windowsphone.com and click Dashboard:
Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

Now, click SUBMIT APP:

Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

 

Follow these steps and upload the XAP file you created earlier at step 2:
Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

After this, click Review and submit to send the app for review. This can take a few days.

If it passes, congratulations! If not, fix the issues and try again, but don’t give up! Unity for Windows: III–Publishing your unity game to Windows 
Phone Store

Good luck!

This entry was posted in TutorialUnityWindows Phone. Bookmark the permalink.

5 Responses to Unity for Windows: III–Publishing your unity game to Windows Phone Store

Unity for Windows: III–Publishing your unity game to Windows Phone Store,布布扣,bubuko.com

Unity for Windows: III–Publishing your unity game to Windows Phone Store

上一篇:tmux复制到windows剪贴板/粘贴板的坑


下一篇:Unity Game Starter Kit for Windows Store and Windows Phone Store games