void cvText(string value, InfoData csv) { if (GameObject.Find("16_9_main/sideBar/Panel/container") != null) { createAndMove crt = GameObject.Find("16_9_main/sideBar/Panel/container").GetComponent <createAndMove>(); crt.createNewBox(csv.name, value); } }
void getCSV() { string filePath = getPath(); string[,] data = LoadCsv(filePath); if (GameObject.Find("16_9_main/sideBar/Panel/container") != null) { createAndMove crt = GameObject.Find("16_9_main/sideBar/Panel/container").GetComponent <createAndMove>(); for (int i = 0; i < Parent.Count; i++) { //Debug.Log("box " + Parent[i].name); crt.deleteBox(Parent[i].name); } } try { for (int i = 0; i < Parent.Count; i++) { Destroy(Parent[i]); } Parent.Clear(); //Debug.Log("clear model"); Models.Clear(); } catch (Exception e) { Debug.Log(e); } for (int i = 0; i < data.GetLength(0); i++) { csv.name = data[i, 0]; csv.url = data[i, 1]; csv.keypath = data[i, 2]; csv.latpath = data[i, 3]; csv.lngpath = data[i, 4]; csv.myclass = data[i, 5]; if (data[i, 6] != "disable") { Parent.Add(new GameObject(csv.name)); StartCoroutine(getData(csv)); } } }
void cvNumber(string value, InfoData csv) { string str = ""; float val = float.Parse(value); average.Add(val); float min = val; float max = val; if (GameObject.Find("16_9_main/sideBar/Panel/container") != null) { createAndMove crt = GameObject.Find("16_9_main/sideBar/Panel/container").GetComponent <createAndMove>(); if (GameObject.Find("16_9_main/sideBar/Panel/container/" + csv.name) == null) { crt.createNewBoxSet(csv.name, val.ToString(), min.ToString(), max.ToString()); } else { str = GameObject.Find("16_9_main/sideBar/Panel/container/" + csv.name + "/minVal").GetComponent <Text>().text; if (float.Parse(str) > val) { min = val; } else { min = float.Parse(str); } str = GameObject.Find("16_9_main/sideBar/Panel/container/" + csv.name + "/maxVal").GetComponent <Text>().text; if (float.Parse(str) < val) { max = val; } else { max = float.Parse(str); } crt.deleteBox(csv.name); crt.createNewBoxSet(csv.name, average.Average().ToString(), min.ToString(), max.ToString()); } } }
void cvQuality(string value, InfoData csv) { string str = ""; string nom = ""; int check = 0; nominal.Add(value.ToLower()); nominal = nominal.OrderBy(val => val).ToList(); for (int i = 0; i < nominal.Count; i++) { if (nom != nominal[i]) { if (i - check > 0) { str = str + nominal[i - 1] + " : " + (i - check) + "\t"; } nom = nominal[i]; check = i; } //str = str + nominal[i]; } str = str + nominal[nominal.Count - 1] + " : " + (nominal.Count - check); //Debug.Log(str); if (GameObject.Find("16_9_main/sideBar/Panel/container") != null) { createAndMove crt = GameObject.Find("16_9_main/sideBar/Panel/container").GetComponent <createAndMove>(); if (GameObject.Find("16_9_main/sideBar/Panel/container/" + csv.name) == null) { crt.createNewBox(csv.name, str); } else { crt.deleteBox(csv.name); crt.createNewBox(csv.name, str); } } }