bengkel 4 bring your unity game to windows phone 8

Post on 09-May-2015

131 Views

Category:

Presentations & Public Speaking

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

BRING YOUR UNITY GAME TO WINDOWS PHONE 8Gathot Fajar – Creacle Studio

Bengkel Gamelan 17/04/2014

[]

Bengkel Gamelan 17/04/2014

Requirements• Unity 4.3• Windows Phone SDK 8.0• Windows 8 or later• For Mac User• Boot Camp, VMWare, Parallels, etc

• Windows 8.1 & VS2013 (if you target WinRT)• Microsoft Account• WP Dev Account

Bengkel Gamelan 17/04/2014

Porting Overview#IF UNITY_WP8#IF UNITY_WINRT

Bengkel Gamelan 17/04/2014

Common Tasks• Orientation Support• Live Tile• Writing Platform Specific Code• Share Task, Share Media Task• Rate & Review • Graphics Issues• Pausing and Resuming your Game• Back Button Support• Fast App Resume

Bengkel Gamelan 17/04/2014

Live Tiles

Bengkel Gamelan 17/04/2014

Live Tiles

Bengkel Gamelan 17/04/2014

Flip Tile

Bengkel Gamelan 17/04/2014

Cycle Tile

Bengkel Gamelan 17/04/2014

Iconic Tile

Bengkel Gamelan 17/04/2014

Live Tile (Basic code)

Bengkel Gamelan 17/04/2014

ShellTile tile = ShellTile.ActiveTiles.FirstOrDefault(); if (tile != null) { FlipTileData flipTile = new FlipTileData();

flipTile.Title = "Mad Race"; flipTile.BackTitle = "Best Score";

flipTile.BackContent = content; flipTile.BackgroundImage = new Uri("/ikon.png", UriKind.Relative); flipTile.BackBackgroundImage = new Uri("/ikonBack.png", UriKind.Relative);

tile.Update(flipTile); }

Create Your Own Plugin• Create New VS Solution• Other Project Types -> Visual Studio Solutions -> Blank

Solution

• Create 2 new projects• Real Project (for Windows Phone) : Windows Phone Class

Library .Net 4.5• Fake Project (for Editor) : Windows -> Class Library .Net 3.5

• Change Assembly Name & Namespace to solution name

Bengkel Gamelan 17/04/2014

Pause & ResumeAction WP Event Unity Event What

happened

User taps tile to launch your game

Activated (with e.IsApplicationInstance Preserved to false)

Awake () Start()

Start your game. Begin fresh (not resuming).

User taps the Windows button to switch to another app

Deactivated OnApplicationPause(true)

Save any state that needs to persist across sessions. No network calls, no CPU cycles.

Bengkel Gamelan 17/04/2014

Pause & Resume (cont.)Action WP Event Unity Event What happened

User comes back to the game (via task manager or back button)

Activated (with e.IsApplicaTion Instance Preserved to true)

OnApplicationPause(false)

Resume the game. You get all the resources back.

Phone rings Obscured OnApplicationPause(true)

Pause your game. Networking won’t be cancelled, your game still has CPU cycles. You are in memory and active.

Bengkel Gamelan 17/04/2014

Pause & Resume (cont.)Action WP Event Unity Event What

happened

The notification UI goes away, user dismisses it

Unobscured OnApplicationPause(false)

Resume your game.

User clicks the back button at the root of your game and app exits

Closing OnApplicationQuit

Save state and exit your game.

Bengkel Gamelan 17/04/2014

Handling the Back Buttonif (Input.GetKey(KeyCode.Escape)){

Application.Quit();}

Bengkel Gamelan 17/04/2014

Fast App Resume• /Properties/WMAppManifest.xml

Bengkel Gamelan 17/04/2014

3rd Party Library

•Telerik•Coding4Fun

Bengkel Gamelan 17/04/2014

THANK YOU#gathotfajargathotfajar@gmail.com

Bengkel Gamelan 17/04/2014

top related