Hello,
i am trying to aprse a json string like:
{
“EngineStatus”: 1,
“EngineValue”: 10
}
My Model looks like:
[Serializable]
public class ValueModel {
public int EngineValue { get; set; }
public int EngineStatus { get; set; }
}
the execution:
void Start()
{
var json = “{"EngineStatus": "1","EngineValue": "10"}”;
var model = JsonUtility.FromJson(json);
Debug.Log("engine Status: " + model.EngineStatus);
Debug.Log("engine Value. " + model.EngineValue);
}
I am very new to unity, maybe you can help me.
Debug log is always: 0
NOTE i changed the json as from TJHeuvel-net mentioned but it is still the same issue.