- Home /
How do you know if a value is a list?
How to know if a value in this Json is of type List?
foreach (string nameObj in j.keys)
{
//if(Control if nameObj is of type list)
foreach (JSONObject value in j.GetField(nameObj).list)
{
string[] c = value.ToString().Replace ("\"", "").Split (',');
Vector3 coo = new Vector3 (System.Convert.ToSingle(c[0]),System.Convert.ToSingle(c[1]),0);
if(nameObj == "Robot")
{
//code instructions
}
else if(nameObj.Contains("Platf"))
{
//code instructions
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613180624im_/https://answers.unity.com/themes/thub/images/avi.jpg)