pomelo-unityclient-socket icon indicating copy to clipboard operation
pomelo-unityclient-socket copied to clipboard

fix the bug, change 'List<object>' to JsonArray

Open rayosu opened this issue 10 years ago • 2 comments

if you use protobuf and you will use this way to get the array data var jWeapons = json["weapons"] as List;

this commit fix the bug, when you used protobuf still can use: var jWeapons = json["weapons"] as JsonArray; that the right way to get array in json.

rayosu avatar Mar 17 '15 02:03 rayosu

为啥要这么改?是因为unity4.6.3 在ios上用IL2CPP方式simple-json解析数组或者List会出错么?

zk-luke avatar Mar 25 '15 13:03 zk-luke

不是, 只是这是一个bug. 你没启动protobuf的时候, 网络json解析你使用了JsonArray类型来存json中的数组. 而你protobuf中的转换代码却使用了List. 这导致前后的json操作API不一致. 所有代码都受影响.

rayosu avatar Mar 25 '15 14:03 rayosu