public void Init(DataEntity data) { mData = data; name.text = mData.name; StartCoroutine(TextureLoader()); }
private void ServerCallBack(string jsonStr) { var data = JSON.Parse(jsonStr); List <DataEntity> dataList = new List <DataEntity>(); for (int i = 0; i < data.Count; i++) { DataEntity dataEntiy = new DataEntity(); var item = data[i]; dataEntiy.id = item["id"]; dataEntiy.createdAt = item["createdAt"]; dataEntiy.name = item["name"]; dataEntiy.avatar = item["avatar"]; var subData = item["Addition"]; for (int j = 0; j < subData.Count; j++) { var arr = subData[j]; List <SubtopicEntity> sbEnityList = new List <SubtopicEntity>(); for (int k = 0; k < arr.Count; k++) { SubtopicEntity subtopicEntity = new SubtopicEntity(); subtopicEntity.subtopic_id = arr["subtopic_id"]; subtopicEntity.subtopic_name = arr["subtopic_name"]; } dataEntiy.additionList.Add(sbEnityList); } subData = item["Geometry"]; for (int j = 0; j < subData.Count; j++) { var arr = subData[j]; List <SubtopicEntity> sbEnityList = new List <SubtopicEntity>(); for (int k = 0; k < arr.Count; k++) { SubtopicEntity subtopicEntity = new SubtopicEntity(); subtopicEntity.subtopic_id = arr["subtopic_id"]; subtopicEntity.subtopic_name = arr["subtopic_name"]; } dataEntiy.geometryList.Add(sbEnityList); } subData = item["Mixed Operations"]; for (int j = 0; j < subData.Count; j++) { var arr = subData[j]; List <SubtopicEntity> sbEnityList = new List <SubtopicEntity>(); for (int k = 0; k < arr.Count; k++) { SubtopicEntity subtopicEntity = new SubtopicEntity(); subtopicEntity.subtopic_id = arr["subtopic_id"]; subtopicEntity.subtopic_name = arr["subtopic_name"]; } dataEntiy.mixedOperationsList.Add(sbEnityList); } subData = item["Number sense"]; for (int j = 0; j < subData.Count; j++) { var arr = subData[j]; List <SubtopicEntity> sbEnityList = new List <SubtopicEntity>(); for (int k = 0; k < arr.Count; k++) { SubtopicEntity subtopicEntity = new SubtopicEntity(); subtopicEntity.subtopic_id = arr["subtopic_id"]; subtopicEntity.subtopic_name = arr["subtopic_name"]; } dataEntiy.numberSenseList.Add(sbEnityList); } subData = item["Subtraction"]; for (int j = 0; j < subData.Count; j++) { var arr = subData[j]; List <SubtopicEntity> sbEnityList = new List <SubtopicEntity>(); for (int k = 0; k < arr.Count; k++) { SubtopicEntity subtopicEntity = new SubtopicEntity(); subtopicEntity.subtopic_id = arr["subtopic_id"]; subtopicEntity.subtopic_name = arr["subtopic_name"]; } dataEntiy.subtractionList.Add(sbEnityList); } dataList.Add(dataEntiy); } CreateScrollItems(dataList); }