void GetTeamPos(Variant data)//队员坐标 打断点可以知道data 是mempos = [{cid,x,y}] { //debug.Log("GetTeamPos:::"+data.dump()); teamlist_position.Clear(); if (data != null) { List <Variant> l = data["mempos"]._arr; foreach (var v in l) { TeamPosition temp = new TeamPosition(); temp.cid = v["cid"]; temp.x = (uint)((v["x"]) / 53.3f); temp.y = (uint)((v["y"]) / 53.3f); teamlist_position.Add(temp); } } }
private void GetTeamPos(Variant data) { this.teamlist_position.Clear(); bool flag = data != null; if (flag) { List <Variant> arr = data["mempos"]._arr; foreach (Variant current in arr) { TeamPosition teamPosition = new TeamPosition(); teamPosition.cid = current["cid"]; teamPosition.x = (uint)(current["x"] / 53.3f); teamPosition.y = (uint)(current["y"] / 53.3f); this.teamlist_position.Add(teamPosition); } } }