The task: to deserialize from the json string and put it into a variable. All business happens in Unity
Code:
[Serializable] class packageF { public player[] players = null; } class player { public string name; public float x; public float y; public int Class; //int anim; //bool isRight; } packageF CreateFromJSON(string jsonString) { return JsonUtility.FromJson<packageF> (jsonString); } When I use CreateFromJSON (json), it throws an ArgumentException: JSON must represent an object type.
What to do?