Integrating Azure Mobile Services with Unity for Windows 8 and Windows Phone
Bitrave made an awesome open-source Unity plugin to integrate Azure mobile services into Unity, it is available for Windows 8 and Windows Phone and coming soon to iOS and Android. The project is hosted on Github, and provides both source code and pre-built binaries for the plugin itself, and a sample project that contains everything.
They provided a very useful guide that gives a lot of information. I wanted to clarify some of the things on the Azure side to make it as simple as possible.
It is very easy to get started. First, download the pre-built binaries from the Github project inside the AzureMobileServicesPlugin\Output folder.
To add the plugin to your Unity project, simple copy the Plugins folder into the Assets folder in your project.
Create a new mobile service through the Azure portal.
Create a new table in the mobile service by clicking Data and then Create.
Initializing an Azure mobile service:
var azure = new AzureMobileServices("
You can find your mobile service URL in the Dashboard and key in the Manage Keys section.
Create a data structure for your data.
private class MyTable { public int? id { get; set; } public string myData { get; set; } }
To insert an item to the database:
var data = new MyTable() { myData = GetData(), id = 1 }; azure.Insert
to update:
azure.Update
to delete:
azure.Delete
To lookup items in the database:
azure.Lookup
Make sure to check out the build instructions on the guide when building your project.
There is a Unity contest for Windows 8 and Windows Phone 8 right now that is giving away over $100,000 in cash, you can find it here.