using System.Collections; using System.Collections.Generic; using LitJson; using UnityEngine; using UnityEngine.UI; public class DataTypeManager : MonoBehaviour { List objlist=new List(); public void init(JsonData data) { int max =this.transform.childCount; for (int i = 0;i(); rw.color = GetColor(int.Parse(data["value"][i]["status"].ToString())); go.GetComponent().sizeDelta = new Vector2(float.Parse(data["value"][i]["count"].ToString())/total*100f, go.GetComponent().sizeDelta.y); } } public static Color GetColor(int colorid) { switch(colorid) { case 1: return Color.green; break; case 2: return Color.yellow; break; case 3: return Color.red; break; case 4: return Color.gray; break; } return Color.gray; } }