public void Loadbutton() { dataNode = JsonManager.LoadAllText(filename + ".json"); foreach (GameObject go in goList) { Destroy(go); } goList = new List <GameObject>(); ggList = new List <GGbrah>(); dataList = JsonManager.DeserializeJson <List <GGbrahData> >(dataNode); for (int i = 0; i < dataList.Count; i++) { GameObject go = new GameObject(); go.AddComponent(typeof(GGbrah)); GGbrah gg = go.GetComponent <GGbrah>(); gg.Init(); gg.ImportBallData(dataList[i]); ggList.Add(gg); goList.Add(go); } }
public void NewButton() { GameObject go = new GameObject(); go.AddComponent(typeof(GGbrah)); GGbrah gg = go.GetComponent <GGbrah>(); gg.RandomInit(); ggList.Add(gg); goList.Add(go); }