UNITY, Windows 8, Windows Phone 8 and Windows Azure

Win8_logo Unity_logi
WinAzure_rgb

Over the past few weeks with the Public Beta of Unity for Windows 8 and Windows Phone 8 have had a number of questions about the opportunity of Windows 8, Windows Phone 8 and UNITY3D.

Unity is popular cross-platform game engine with a built-in IDE developed by Unity Technologies. It is used to develop video games for web plugins, desktop platforms, consoles and mobile devices, and is utilized by over one million developers.

Unity in education is primarily used to create mobile and web games, but can also deploy games to consoles or the PC.

The Unity game engine was developed in C/C++, and is able to support code written in C#, JavaScript or Boo. It grew from an OS X supported game development tool in 2005 to the multi-platform game engine that it is today which now supports Windows 8 and Windows Phone 8.

Unity Plugins for Windows 8 and Azure Mobile Services

A number of 3rd Party Unity assets are presently being developed to provide full support for Windows 8 and Windows Azure.

One of these plug-ins is developed by Bit Rave. Bit Rave have extensive experience working with the Windows 8 platform capabilities, and as part of that we decided to build a library for Unity to make Windows 8 integration easier for everyone.

Bit Rave are  currently looking for people interested in joining a closed beta.  Send an email to contact@bitrave.com if you want to participate.

Win8_logo

So what important about Windows 8 features?

Live Tiles

Live Tiles are what makes your Windows experiences come to life.  Bit Rave Live Tiles allows you to update and manage Live Tiles from within Unity.

LiveTiles

For more information on Live Tiles check out Guidelines and checklist for tiles and badges on MSDN.

Square and Wide Tile Support

With both square and wide tile, Bit Rave makes it trivial to support both.

    1: LiveTiles.Update(newSquareLiveTile);   
    2: LiveTiles.Update(newWideLiveTile); 
Text and Images

With support for text tiles and image tiles, there are lots of options.

    1: LiveTiles.Update(newTextLiveTile); 
    2: LiveTiles.Update(newImageLiveTile); 

And for Unity Pro users, you how about a screenshot on your live tile!

    1: LiveTiles.Update(newLiveTile);
Rotating Tile Updates

You can also manage rotating tile updates with just a few lines of code.

    1: LiveTiles.Update(newTextLiveTile); 
    2: LiveTiles.Queue(newImageLiveTile); 
    3: LiveTiles.Queue(newTextAndImageTile); 

Snap View

Windows 8 comes with a variety of devices, all with varying different screen layout capabilities.  Bitrave's Snap View library helps you implement responsive applications for all changes in UI without having to leave Unity.

SnapView

To learn more about the view states, check out Guidelines for Snapped and Fill Views on MSDN.

View Changes

Register for snap, filled, and full screen views with the following line of code.

    1: SnapView.RegisterForViewChange(OnViewChanged);
Orientation Changes

Register for orientation changes with the following line of code:

    1: SnapView.RegisterForOrientationChange(OnOrientationChanged);

Charms

Charms covers both the settings charm, and the share charm for sharing content from within your app.  For integration with the Search charm, it has it's own component appropriately named Search.

Charms

Settings Charm

Setting is how your users find your help, your privacy policies, and find out further information about yoru application.  You can trigger the settings charm manually with a single line of code.

    1: SettingsCharm.Current.ShowSettingsUI();
Share Charm

Sharing is one of the key components of Windows 8 applications.  Sharing allows your application to interact with other applications who can consume the content.  You can allows your application to share with your favourite social media client, or maybe share an image with a photo manipulation app.

Bit Rave for Live Apps allows you to share seamlessly.  To register content for sharing, it can be all done in a single line of code!

    1: ShareCharm.Current.RegisterTextShare("Title",   
    2: "Description",    
    3:  "Hello World!");

Or maybe you want to share an image from within game:

    1: ShareCharm.Current.RegisterTextShare("Title",   
    2: "Description",    
    3:  imageTexture2D);

And for Unity Pro users, how about sharing a screenshot from a camera!

    1: ShareCharm.Current.RegisterTextShare("Title",   
    2: "Description",    
    3:  cameraObject);

And you can even trigger the UI manually from within game:

    1: ShareCharm.ShowShareUI();

Settings

With your Microsoft ID following you between machines, you can now take advantage of Roaming Settings.  Use roaming settings to synchronise high scores and game files across machines.  Bitrave Settings let you do all this simply and easily without having to leave Unity, and also supports Local Settings for non-roaming preferences and data.

Register for updates to settings data with the following line of code.

Roaming Settings

Roaming settings go with you, and all it takes is just a line of code to set them.

    1: RoamingSettings.SetValue("high-score", hiScoreValue);

And just one line of code to retrieve.

    1: var highScore = RoamingSettings.GetValue("high-score");
Local Settings

Local settings act just like roaming settings, but stay on a single machine when you don't want them to roam.  You set and retrieve them in the same way.

    1: LocalSettings.SetValue("high-score", hiScoreValue);

And just one line of code to retrieve.

    1: var highScore = LocalSettings.GetValue("high-score");

WinAzure_rgb

Azure Mobile Services - https://www.windowsazure.com/en-us/develop/mobile/ iOS, Android, Windows 8 and Windows Phone

Azure Mobile Services allow you to take your application to the cloud quickly and easily.

And now you can access Azure Mobile Services directly from your Unity code.

Initialise

Initialisation is just as simple as you'd expect.

    1: var service = AzureMobileServices("url", "token");
Insert

Insert an item into your Azure database in a single line of code from Unity.

    1: service.Insert<ToDoItem>(myItem);
Update

Update items in the Azure databsae with just one line of code from Unity.

service.Update<ToDoItem>(myItem);

Delete

Remove items from the Azure database in 1 line of code from Unity.

    1: service.Delete<ToDoItem>(myItem);
Query

Query items in your Azure Mobile Services from Unity.

    1: service.Where<ToDoItem>(p => p.Category == "Exercise", MyCallback);   
    2: public void MyCallback(List<ToDoItem> items)    
    3: {    
    4: ...    
    5: }

NOTE: await / async will be available when supported by Unity. Until then we are using callbacks.

Lookup

Lookup items in your Azure Mobile Services from Unity.

    1: service.Lookup<ToDoItem>(myItem, MyCallback);   
    2: public void 
    3: MyCallback(ToDoItem item)    
    4: {    
    5: ...    
    6: }

NOTE: await / async will be available when supported by Unity. Until then we are using callbacks.

,Win8_logo Unity_logi

Microsoft recently ran an full day of events to highlight the opportunity of Windows and Unity.

You can watch the content below and get access to all the materials at https://channel9.msdn.com/Events/Windows-Camp/Building-Windows-Games-with-Unity?d=1

Introduction to the Windows 8 platform and the Windows Store