Click here to Skip to main content
Click here to Skip to main content

Touch-ups before publishing your Unity game to Windows store

, 2 Jan 2014
Rate this:
Please Sign up or sign in to vote.
Two days ago, i have published my first game to windows store and  below are the steps which i followed before publishing the game….. I will continue where digitalerr0r has left.(This article is just an extension or add on to what digitalerr0r has described) After you have added the code snipp

Two days ago, i have published my first game to windows store and  below are the steps which i followed before publishing the game…..

I will continue where digitalerr0r has left.(This article is just an extension or add on to what digitalerr0r has described)

After you have added the code snippet for snapped view,everything looks good,except that you have to show a message “That the game is paused and to resume you have to move to Full screen “.Also there is one more view called Filled View which needs to be handled on Windows 8.

Bongo Soccer Game on windows store

Bongo Soccer Game on windows store

Mono C# Script to  pause the sound (if any)

using UnityEngine;
using System.Collections;

public class Windows8Handler {
    public GUIText paused=GameObject.Find("Paused").GetComponent<GUIText>();

	public  void PauseGame(bool p)
	{
		if (p)
		{
			Time.timeScale = 0.0f;
			AudioListener.pause=true;

		}
		else
		{
			Time.timeScale = 1.0f;
			AudioListener.pause=false;

		}
	}
}

Build the Visual studio C# solution again to have this script change to turn up.

C#/XAML (App.Xaml.cs) code snippet to show the pause message and support FILLED view

//Add this line to app class
private string pauseMe = string.Format("GAME PAUSED!!{0}PLAY IN FULL SCREEN MODE", Environment.NewLine);
//Add this after Window.Current.Activate();
Window.Current.SizeChanged += Current_SizeChanged;
}

void Current_SizeChanged(object sender, WindowSizeChangedEventArgs e)
{
ApplicationViewState myViewState = ApplicationView.Value;

if (myViewState == ApplicationViewState.Snapped)
{
AppCallbacks.Instance.InvokeOnAppThread(new AppCallbackItem(() =&gt;
{
Windows8Handler handler = new Windows8Handler();
handler.PauseGame(true);
handler.paused.text = pauseMe;

}), false);
}
else if (myViewState == ApplicationViewState.Filled)
{
AppCallbacks.Instance.InvokeOnAppThread(new AppCallbackItem(() =&gt;
{

Windows8Handler handler = new Windows8Handler();
handler.PauseGame(true);
handler.paused.text = pauseMe;
}), false);

}
else
{
AppCallbacks.Instance.InvokeOnAppThread(new AppCallbackItem(() =&gt;
{
Windows8Handler handler = new Windows8Handler();
handler.PauseGame(false);
handler.paused.text = string.Empty;
}), false);
}
}

Once this is done just run your solution to see your game in action and also verify the snap and filled views.

Next,you have to add a privacy policy to your game (which will be displayed in the app store)

Adding privacy Policy 

Verify the privacy policy on the settings charm. Now you can build the appx file in master mode to upload .

Important points to avoid game rejection

  • Choose an appropriate age group(12+ if you are doubtful),countries  for your game and also provide valid game rating certificate.
  • Other than keyboard game inputs,you should support either mouse or touch (as most of the PCs and Tablets support).


License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Vidyasagar MSC
Software Developer (Senior)
India India
Microsoft MVP (Games for Windows)
Developer | Blogger | Mentor | Gamer
Coder by profession | Gamer By Heart
Technical Blog : http://onestopdotnet.wordpress.com/
About me: http://about.me/mscvidyasagar
Follow on   Twitter

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 3 Jan 2014
Article Copyright 2014 by Vidyasagar MSC
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid