Пример #1
0
 private void ServerOfferLoadReady(MyEvent obj)
 {
     for (int i = 0; i < serverOfferCache.cacheOfferList.Count; i++)
     {
         string id = serverOfferCache.cacheOfferList[i];
         if (mainpageData.HasPriceData(id))
         {
             continue;
         }
         LoaderPool.CacheLoad(id, SimpleLoadDataType.JsonOffer, null);
     }
 }
Пример #2
0
 private void LocalOfferLoadReady(MyEvent obj)
 {
     for (int i = 0; i < localOfferCache.cacheOfferList.Count; i++)
     {
         int tempId = localOfferCache.cacheOfferList[i];
         if (mainpageData.HasPriceData(tempId.ToString()))
         {
             continue;
         }
         LoaderPool.CacheLoad(tempId, SimpleLoadDataType.JsonOffer, OnPriceLoaded);
     }
 }
Пример #3
0
    public void SetCurrentData(OriginalProjectData project, bool saveToLocal = true)
    {
        //SetToLocal(currentData);
        undoDatas.Clear();
        redoDatas.Clear();
        currentData                            = new TotalData();
        currentData.SaveId                     = 0;
        currentData.data                       = project.data;
        currentData.schemeManifest.id          = project.id;
        currentData.schemeManifest.templateId  = project.templateId;
        currentData.schemeManifest.meta        = project.meta;
        currentData.schemeManifest.name        = project.name;
        currentData.schemeManifest.description = project.description;
        currentData.schemeManifest.tempId      = project.tempId;
        currentData.schemeManifest.isNew       = project.isNew;
        currentData.schemeManifest.version     = project.version;

        currentData.schemeManifest.prices.Clear();
        currentData.schemeManifest.tempEffectMetas = project.tempEffectMetas;
        //是否为样板间
        currentData.schemeManifest.isTemplate = project.isTemplate;
        if (project.priceIdList != null)
        {
            currentData.schemeManifest.prices.AddRange(project.priceIdList);
            for (int i = 0; i < project.priceIdList.Count; i++)
            {
                string id = project.priceIdList[i];
                if (mainpageData.HasPriceData(id))
                {
                    continue;
                }
                int tempId;
                if (int.TryParse(id, out tempId))
                {
                    LoaderPool.CacheLoad(tempId, SimpleLoadDataType.JsonOffer, OnPriceLoaded);
                }
                else
                {
                    LoaderPool.CacheLoad(id, SimpleLoadDataType.JsonOffer, OnPriceLoaded);
                }
            }
        }

        //ClearView();
        RefreshView();
        if (saveToLocal == true)
        {
            jsonCacheManager.SaveSchemeToLocal();
        }

        schemeControl.dispatchEvent(new SchemeEvent(SchemeEvent.ChangeScheme));
        Resources.UnloadUnusedAssets();
    }
Пример #4
0
    private void EnterDesign(MsgFromIOS.InfoFromIOS info)
    {
        GlobalConfig.running = true;
        if (Application.platform != RuntimePlatform.IPhonePlayer)
        {
            info.msg = new List <object>()
            {
                "http://cf-hsm-prod-assets.homestyler.com/i/4abd1bba-6d61-481e-9008-25295599e006/iso.jpg"
            };
        }
        switch (info.enterType)
        {
        case "1":
            undoHelper.CreatNewEnter();
            mainpageMachine.setState(ToTwoDState.Name);
            break;

        case "2":    //进入2D
        case "3":    //进入3D
        case "4":    //进入新建方案2D 预置指定模板
        case "5":    //进入新建方案3D 预置指定模板
            mainPageUIController.dispatchEvent(new LoadEvent(LoadEvent.OpenLoadingPage));
            string id     = info.projectId;
            int    tempId = info.tempId;
            if (string.IsNullOrEmpty(id) == true)
            {
                if (localCache.HasCached(tempId))
                {
                    LoaderPool.CacheLoad(tempId, SimpleLoadDataType.JsonScheme, OnCacheLoaded, info);
                    return;
                }
            }
            else
            {
                if (serverCache.HasCached(id))
                {
                    LoaderPool.CacheLoad(id, SimpleLoadDataType.JsonScheme, OnCacheLoaded, info);
                    return;
                }
            }

            LoaderPool.OutterLoad(info.json, SimpleLoadDataType.Json, onloaded, info);
            break;

        default:
            break;
        }
    }