Hi,
Im trying to deserialise a get request where i get a json back with the following
[{"GameName":"Game1","GameLocation":"Test1"},{"GameName":"Game2","GameLocation":"Test2"}]
Im useing the following script
using System.Collections;
using System.Collections.Generic;
namespace APP
{
[System.Serializable]
public class GameFinder
{
public string Token;
public string UserName;
public string CompanyName;
public string[] GameAreas;
public List<string> GameName = new List<string>();
public List<string> GameLocation = new List<string>();
//public string[] GameName;
//public string[] GameLocation;
// public string ProductName;
}
//And im using this
IEnumerator GetGameList(WWW www)
{
yield return www;
if (www.error == null)
{
Debug.Log("WWW List Ok!: " + www.text);
string data = JsonWriter.Serialize(www.text);
apb = JsonReader.Deserialize<APP.GameFinder>(www.text);
}
else
{
Debug.Log("WWW List Error: " + www.error);
}
}
Im getting this error
InvalidCastException: Cannot cast from source type to destination type.
Pathfinding.Serialization.JsonFx.JsonReader.Deserialize[GameFinder] (System.String value)