hey, when i use unity JsonUtility.ToJson to make my object to string,but on some mobile device, return wrong result like:
{“hovered”:[{“m_FileID”:-696942,“m_PathID”:0},{“m_FileID”:-696926,“m_PathID”:0},{“m_FileID”:-696850,“m_PathID”:0},{“m_FileID”:-696818,“m_PathID”:0},{“m_FileID”:-696802,“m_PathID”:0},{“m_FileID”:236956,“m_PathID”:0},{“m_FileID”:236926,“m_PathID”:0},{“m_FileID”:236954,“m_PathID”:0}]}
my code is this:
public class Pay
{
[Serializable]
public class ActivityExtendData
{
public int activityID;
public int index;
}
[Serializable]
public class ShopExtendData
{
public int shopID;
}
}
// other place call the function
Pay.ShopExtendData extData = new Pay.ShopExtendData();
extData.shopID = 1002;
string extStr = JsonUtility.ToJson(extData);
the return string “extStr” most time return right json string, on some mobile device return wrong string:
{“hovered”:[{“m_FileID”:-696942,“m_PathID”:0},{“m_FileID”:-696926,“m_PathID”:0},{“m_FileID”:-696850,“m_PathID”:0},{“m_FileID”:-696818,“m_PathID”:0},{“m_FileID”:-696802,“m_PathID”:0},{“m_FileID”:236956,“m_PathID”:0},{“m_FileID”:236926,“m_PathID”:0},{“m_FileID”:236954,“m_PathID”:0}]}
My unity version is:5.6.6f2, use il2cpp