예제 #1
0
        public IEnumerator GetSubCategoryDetail(long sub_id, string sub_name, SubCategoryDownloadCallback callback)
        {
            bool toEnd = false;

            yield return(null);

            foreach (Category cat in catList)
            {
                foreach (SubCategory scat in cat.SubCategorys)
                {
                    if (scat.sub_id == sub_id)
                    {
                        SubCategory sc = new SubCategory();
                        sc = scat;
                        callback(sc);
                        toEnd = true;
                        break;
                    }
                }
                if (toEnd)
                {
                    break;
                }
            }
        }
예제 #2
0
 public void GetSubCategoryDetail(long sub_id, string sub_name, SubCategoryDownloadCallback callback)
 {
     StartCoroutine(collector.GetSubCategoryDetail(sub_id, sub_name, callback));
 }
예제 #3
0
        //test !!!!need to rewrite in the future
        public IEnumerator GetSubCategoryDetail(long subCategoryId, string subCategoryName, SubCategoryDownloadCallback callback)
        {
            long subCategoryParentID = subCategoryId / 100;
            WWW  cases = new WWW(baseUrl + "/magento/Json/" + subCategoryParentID + "/sc/" + EncodeUriComponent(subCategoryName) + ".json");

            yield return(cases);

            string json = cases.text;

            SubCategory result = JsonConvert.DeserializeObject <SubCategory>(json);

            callback(result);
        }