proyecto26 / RestClient

🦄 A Promise based REST and HTTP client for Unity 🎮
https://assetstore.unity.com/packages/slug/102501
MIT License
1.24k stars 174 forks source link

GET Array in Unity #91

Closed ghost closed 5 years ago

ghost commented 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);
}

}

jdnichollsc commented 5 years ago

Because Firebase works only with objects using key-value instead, check the response using Postman or other tool