October 3, 2013

Our Unity application will start the communication by calling the Initiate function shown above like so:

Application.ExternalCall ("Initiate");

unityweb2

When we recieve our response, we parse the JSON data. Our team typically uses LitJSON (available for free here), and it seems to suit our needs. For LitJSON to work, we have to establish a class that has our expected values. Here’s an example in C# (though this process would be very similar in UnityScript):

public class ServerData
{
 public string hostname = string.Empty;
 public string authenticated = string.Empty;
 public string existence = string.Empty;
 public string offlinePlay = string.Empty;
}