Ejemplo n.º 1
0
    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);
        }
    }
Ejemplo n.º 2
0
    public void NewButton()
    {
        GameObject go = new GameObject();

        go.AddComponent(typeof(GGbrah));
        GGbrah gg = go.GetComponent <GGbrah>();

        gg.RandomInit();
        ggList.Add(gg);
        goList.Add(go);
    }