Beispiel #1
0
        public static void CreateShopList()
        {
            if (ShopDataManager.CurrentDayShopInfo == "Loaded")
            {
                string path     = Application.persistentDataPath + "/Data/DayInfo.json";
                string contents = File.ReadAllText(path);
                dayData = JsonUtility.FromJson <DataManager.DayData>(contents);

                string path1     = Application.persistentDataPath + "/Data/ShopStatus.json";
                string contents1 = File.ReadAllText(path1);
                shopStatus = JsonUtility.FromJson <ShopStatus>(contents1);
            }
        }
Beispiel #2
0
        void CreateShopStatusFile()
        {
            ShopStatus shopStatus = new ShopStatus();

            shopStatus.id           = new List <int>();
            shopStatus.status       = new List <string>();
            shopStatus.image1Status = new List <string>();
            shopStatus.image2Status = new List <string>();
            shopStatus.image3Status = new List <string>();
            shopStatus.image4Status = new List <string>();
            shopStatus.address      = new List <string>();
            shopStatus.sku          = new List <string>();
            shopStatus.uploadStatus = new List <string>();

            for (int i = 0; i < shopsInfo.data.shops.Count; i++)
            {
                shopStatus.id.Add(shopsInfo.data.shops[i].id);
                shopStatus.status.Add("Pending");
                shopStatus.image1Status.Add("Pending");
                shopStatus.image2Status.Add("Pending");
                shopStatus.image3Status.Add("Pending");
                shopStatus.image4Status.Add("Pending");
                shopStatus.address.Add(shopsInfo.data.shops[i].address);
                shopStatus.uploadStatus.Add("Pending");
            }
            for (int i = 0; i < shopsInfo.data.sku.Count; i++)
            {
                shopStatus.sku.Add(shopsInfo.data.sku[i].name);
            }

            string data = JsonUtility.ToJson(shopStatus);

            File.WriteAllText(Application.persistentDataPath + "/Data/ShopStatus.json", data);

            /// Load Local Json Data
            ShopDataCreator.CreateShopList();
            UIManager.instance.ActivateScreen(2);
            ShopDataCreator.instance.Populate();
        }