pomelo-unityclient-socket
pomelo-unityclient-socket copied to clipboard
fix the bug, change 'List<object>' to JsonArray
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.
为啥要这么改?是因为unity4.6.3 在ios上用IL2CPP方式simple-json解析数组或者List会出错么?
不是, 只是这是一个bug. 你没启动protobuf的时候, 网络json解析你使用了JsonArray类型来存json中的数组. 而你protobuf中的转换代码却使用了List