Closed ghost closed 5 years ago
I use the method to get the array "GetArray". But I don’t get it. But I get an error in Unity - Unexpected node type. Please tell me what can I do wrong?
I work with firebase database.
The link path I pass is https://[database-name].firebaseio.com/players.json.
JSON {"ttt1":{"maxScore":34,"name":"ttt2"},"aaaa":{"maxScore":46,"name":"ttt3"}}
My class: [System.Serializable] public class PlayerModel { public string name; public int maxScore;
public override string ToString() { return UnityEngine.JsonUtility.ToJson(this, false); }
}
Because Firebase works only with objects using key-value instead, check the response using Postman or other tool
I use the method to get the array "GetArray". But I don’t get it. But I get an error in Unity - Unexpected node type. Please tell me what can I do wrong?
I work with firebase database.
The link path I pass is https://[database-name].firebaseio.com/players.json.
JSON {"ttt1":{"maxScore":34,"name":"ttt2"},"aaaa":{"maxScore":46,"name":"ttt3"}}
My class: [System.Serializable] public class PlayerModel { public string name; public int maxScore;
}