Esempio n. 1
0
        public void LoadConfig(JsonData data)
        {
            Data = data;
            var listGroup = data["list"];

            for (int i = 0; containor.Count < listGroup.Count; i++)
            {
                ResourceGroup rg = new ResourceGroup(manager);
                rg.LoadConfig(listGroup [i]);
                AddResourceGroup(rg);
            }
        }
Esempio n. 2
0
        public void SetConfig(JsonData data)
        {
            int index = -1;

            int.TryParse(data ["index"].ToString(), out index);
            if (index >= containor.Count)
            {
                ResourceGroup rg = new ResourceGroup(manager);
                rg.LoadConfig(data["data"]);
                AddResourceGroup(rg);
                Data["list"].Add(data ["data"]);
            }
            else
            {
                Data ["list"][index] = data ["data"];
            }
            Debug.Log(Data.ToJson());
            JsonConfiguration.WriteData(Data, Paths.RESOURCE_GROUP);
        }