コード例 #1
0
 public void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #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();
        }