Beispiel #1
0
 private bool endFuncOne(AssetBundle ab)
 {
     if (ab)
     {
         ab.Unload(false);
         this.dlFCT_COMP++;
         this.ABM_Instance.AddRealABDL_NowCount_LV(1);
     }
     this.progressFCT++;
     if (this.progressFCT >= this.abid.assetBundleInfoList.Count)
     {
         this.bIsAllEnd = true;
         if (this.actEndCallBackAll != null)
         {
             this.actEndCallBackAll(0);
         }
         try
         {
             AssetBundleMng.Instance().WriteAllRecord();
         }
         catch
         {
             global::Debug.LogWarning("書込み失敗");
         }
         return(true);
     }
     return(false);
 }
	private void Awake()
	{
		Cache defaultCache = Caching.defaultCache;
		defaultCache.maximumAvailableStorageSpace = 4294967296L;
		defaultCache.expirationDelay = 12960000;
		AssetBundleMng.instance = this;
		this.LoadVersionInfo();
	}
Beispiel #3
0
 public void StartDownloadAssetBundle(int count, int downloadStream = 4)
 {
     if (this.USE_ASSET_BUNDLE != ABPrefabType.None)
     {
         this.realABDL_TotalCount_LV = count;
         this.dlList     = new Dictionary <string, AssetBundleInfoData>();
         this.curInfoIDX = 0;
         this.isAssetBundleDownloading = true;
         this.currentDownloadStream    = ((downloadStream <= 0) ? 1 : Math.Min(downloadStream, 4));
         AssetBundleMng.Instance().InitODLStream();
     }
 }
Beispiel #4
0
 private void UpdateDownLoad()
 {
     if (AssetBundleMng.Instance() == null)
     {
         return;
     }
     if (AssetBundleMng.Instance().IsStopDownload())
     {
         return;
     }
     if (this.curInfoIDX > -1)
     {
         if (this.curInfoIDX < this.abidList.Count)
         {
             if (this.dlList.Count < this.currentDownloadStream)
             {
                 int dlallCount = AssetBundleMng.Instance().GetDLAllCount(this.abidList[this.curInfoIDX]);
                 if (dlallCount > 0)
                 {
                     AssetBundleMng.Instance().DownLoad_AllAssetBundleData(this.abidList[this.curInfoIDX].name, this.abidList[this.curInfoIDX], null);
                     this.dlList.Add(this.abidList[this.curInfoIDX].name, this.abidList[this.curInfoIDX]);
                 }
                 this.curInfoIDX++;
             }
         }
         else if (this.curInfoIDX >= this.abidList.Count && this.dlList.Count < this.currentDownloadStream)
         {
             int odlstreamNum = this.currentDownloadStream - this.dlList.Count;
             AssetBundleMng.Instance().SetODLStreamNum(odlstreamNum);
         }
         foreach (string text in this.dlList.Keys)
         {
             AB_DownLoad_ALLInfo ab_DownLoad_ALLInfo = AssetBundleMng.Instance().GetAB_DownLoad_ALLInfo(text);
             if (ab_DownLoad_ALLInfo != null && ab_DownLoad_ALLInfo.bIsAllEnd)
             {
                 this.dlList.Remove(text);
                 if (ab_DownLoad_ALLInfo.cur_abdlI != null && ab_DownLoad_ALLInfo.cur_abdlI.www != null)
                 {
                     ab_DownLoad_ALLInfo.cur_abdlI.www.Dispose();
                 }
                 GC.Collect();
                 break;
             }
         }
         if (this.curInfoIDX >= this.abidList.Count && this.dlList.Count == 0)
         {
             this.isAssetBundleDownloading = false;
             this.curInfoIDX = -1;
         }
     }
 }
Beispiel #5
0
    public int RealABDL_NowCount_LV()
    {
        int num = AssetBundleMng.Instance().RealABDL_NowCount_LV();

        if (num > this.realABDL_TotalCount_LV)
        {
            num = this.realABDL_TotalCount_LV;
        }
        if (this.realABDL_TotalCount_LV == 0)
        {
            return(1);
        }
        return(num);
    }
Beispiel #6
0
    private IEnumerator LoadABData_FromWWW()
    {
        string strROOT  = AssetBundleMng.Instance().GetAssetBundleRootPath();
        string fullpath = string.Empty;

        for (int i = 0; i < this.abFolderList.Count; i++)
        {
            fullpath = string.Concat(new object[]
            {
                strROOT,
                this.abFolderList[i],
                "?",
                AssetDataMng.assetVersion
            });
            bool downloadStart = true;
            while (downloadStart)
            {
                this.www_err_bk = string.Empty;
                WWWHelper www = new WWWHelper(fullpath, null, null, 40f);
                yield return(base.StartCoroutine(www.StartRequest(new Action <string, string, WWWHelper.TimeOut>(this.OnReceivedAssetBundleData))));

                if (string.IsNullOrEmpty(this.www_err_bk))
                {
                    downloadStart = false;
                }
                else
                {
                    bool bClosed = false;
                    this.OpenAlert(delegate
                    {
                        bClosed = true;
                    });
                    while (!bClosed)
                    {
                        yield return(null);
                    }
                }
            }
        }
        int assetBundleCategoryCount = (this.abidList != null) ? this.abidList.Count : 0;

        if (this.actCallBack_AB_Init != null)
        {
            this.actCallBack_AB_Init(assetBundleCategoryCount);
        }
        yield break;
    }
Beispiel #7
0
 private void WaitBackgroundDownload(TutorialObserver tutorialObserver)
 {
     if (AssetBundleMng.Instance().IsStopDownload())
     {
         AssetBundleMng.Instance().RestartDownload();
     }
     if (AssetDataMng.Instance().IsAssetBundleDownloading())
     {
         this.tutorialUI.Fade.StartFade(TutorialFade.FadeType.BLACK, false, 0.5f, delegate
         {
             this.controlToGame.WaitBackgroundDownload(new Action(base.ResumeScript));
         });
     }
     else
     {
         base.ResumeScript();
     }
     tutorialObserver.DownloaddAssetBundleLevelIndex++;
 }
Beispiel #8
0
    public List <DLProgressInfo> GetAll_AB_DownloadStreamProgress()
    {
        List <DLProgressInfo> list = new List <DLProgressInfo>();

        foreach (string name in this.dlList.Keys)
        {
            AB_DownLoad_ALLInfo ab_DownLoad_ALLInfo = AssetBundleMng.Instance().GetAB_DownLoad_ALLInfo(name);
            if (ab_DownLoad_ALLInfo != null && !ab_DownLoad_ALLInfo.bIsAllEnd)
            {
                list.Add(new DLProgressInfo
                {
                    name     = ab_DownLoad_ALLInfo.abid.name,
                    progress = ab_DownLoad_ALLInfo.progressAll,
                    fct      = ab_DownLoad_ALLInfo.dlFCT,
                    fct_comp = ab_DownLoad_ALLInfo.dlFCT_COMP
                });
            }
        }
        return(list);
    }
Beispiel #9
0
    public bool AB_StartDownLoad(string _level = "", int downloadStream = 4)
    {
        this.level = _level;
        bool flag = AssetBundleMng.Instance().InitDownLoad_All(this.level);

        if (flag)
        {
            this.dlList     = new Dictionary <string, AssetBundleInfoData>();
            this.curInfoIDX = 0;
            this.isAssetBundleDownloading = true;
            this.currentDownloadStream    = ((downloadStream <= 0) ? 1 : Math.Min(downloadStream, 4));
            AssetBundleMng.Instance().InitODLStream();
            this.realABDL_TotalCount_LV = 0;
            foreach (AssetBundleInfoData abid in this.abidList)
            {
                this.realABDL_TotalCount_LV += AssetBundleMng.Instance().GetDLAllCount(abid);
            }
        }
        return(flag);
    }
Beispiel #10
0
    public int GetDownloadAssetBundleCount(string level, out int size)
    {
        int num = 0;

        size = 0;
        if (this.USE_ASSET_BUNDLE != ABPrefabType.None)
        {
            if (!this.IsAssetBundleDownloading())
            {
                this.level = level;
                AssetBundleMng.Instance().InitDownLoad_All(level);
            }
            int num2 = 0;
            foreach (AssetBundleInfoData abid in this.abidList)
            {
                num  += AssetBundleMng.Instance().GetDLAllCount(abid, out num2);
                size += num2;
            }
        }
        return(num);
    }
    public static IEnumerator CheckDiskSpace(AssetBundleInfo info, AssetBundleMng manager)
    {
        long size = AssetBundleDiskSpaceCheck.GetFileSize(long.Parse(info.size));

        while (!AssetBundleDiskSpaceCheck.IsFreeSpace(size + manager.GetDownloadFileSize()))
        {
            while (0 < manager.GetCountDownloadProcess())
            {
                yield return(null);
            }
            bool isOpen = true;
            AlertManager.ShowAlertDialog(delegate(int nop)
            {
                isOpen = false;
            }, "LOCAL_ERROR_SAVE_DATA_IO");
            while (isOpen)
            {
                yield return(null);
            }
        }
        yield break;
    }
Beispiel #12
0
    private IEnumerator PreloadSpawnMonsters()
    {
        AssetBundleMng.Instance().SetLevel(string.Empty);
        string p17    = MonsterObject.GetFilePath("17");
        string p18    = MonsterObject.GetFilePath("74");
        string p19    = MonsterObject.GetFilePath("152");
        bool   finish = false;

        AssetDataMng.Instance().LoadObjectASync(p17, delegate(UnityEngine.Object _obj)
        {
            finish = true;
        });
        while (!finish)
        {
            yield return(null);
        }
        finish = false;
        AssetDataMng.Instance().LoadObjectASync(p18, delegate(UnityEngine.Object _obj)
        {
            finish = true;
        });
        while (!finish)
        {
            yield return(null);
        }
        finish = false;
        AssetDataMng.Instance().LoadObjectASync(p19, delegate(UnityEngine.Object _obj)
        {
            finish = true;
        });
        while (!finish)
        {
            yield return(null);
        }
        yield break;
    }
Beispiel #13
0
 private void RestartDownload()
 {
     AssetBundleMng.Instance().RestartDownload();
     base.ResumeScript();
 }
Beispiel #14
0
 public UnityEngine.Object LoadObject(string path, Action <UnityEngine.Object> actEnd = null, bool showAlert = true)
 {
     if (actEnd == null && AssetDataCacheMng.Instance() != null)
     {
         bool flag = AssetDataCacheMng.Instance().IsCacheExist(path);
         if (flag)
         {
             return(AssetDataCacheMng.Instance().GetCache(path));
         }
     }
     UnityEngine.Object @object;
     if (this.USE_ASSET_BUNDLE == ABPrefabType.None)
     {
         @object = Resources.Load(path);
     }
     else
     {
         if (this.USE_RESOURCE_DATA_FOR_AB)
         {
             @object = Resources.Load(path);
         }
         else if (this.IsAssetBundleData(path))
         {
             @object = null;
         }
         else
         {
             @object = Resources.Load(path);
         }
         if (@object == null)
         {
             string resourceName = string.Empty;
             for (int i = 0; i < this.abidList.Count; i++)
             {
                 if (path.Length > this.abidList[i].abPath.Length && path.StartsWith(this.abidList[i].abPath))
                 {
                     resourceName = path.Substring(this.abidList[i].abPath.Length);
                     if (actEnd != null)
                     {
                         if (AssetBundleMng.Instance().LoadObjectASync(this.abidList[i], resourceName, actEnd))
                         {
                             return(null);
                         }
                     }
                     else
                     {
                         @object = AssetBundleMng.Instance().LoadObject(this.abidList[i], resourceName);
                         if (!(@object == null))
                         {
                             break;
                         }
                     }
                 }
             }
             global::Debug.Assert(null != @object, "AssetDataMng:LoadObject = " + path + "がない");
         }
     }
     if (@object == null && showAlert)
     {
         string messageString = string.Empty;
         if (File.Exists(path))
         {
             messageString = StringMaster.GetString("AlertFileErrorMemory");
         }
         else
         {
             messageString = StringMaster.GetString("AlertFileErrorNotFound");
         }
         NativeMessageDialog.Show(messageString);
     }
     if (actEnd != null)
     {
         actEnd(@object);
     }
     return(@object);
 }
	private void OnDestroy()
	{
		AssetBundleMng.instance = null;
	}
Beispiel #16
0
    private IEnumerator StartEvent()
    {
        RestrictionInput.StartLoad(RestrictionInput.LoadType.LARGE_IMAGE_MASK_OFF);
        ClassSingleton <MonsterUserDataMng> .Instance.Initialize();

        GUIMonsterIcon.InitMonsterGO(Singleton <GUIMain> .Instance.transform);
        ClassSingleton <GUIMonsterIconList> .Instance.Initialize();

        yield return(base.StartCoroutine(AssetBundleMng.Instance().WaitCacheReady()));

        yield return(base.StartCoroutine(StoreInit.Instance().InitStore()));

        this.googlePlay.Bootup();
        yield return(base.StartCoroutine(this.AuthLogin()));

        yield return(base.StartCoroutine(APIUtil.Instance().StartGameLogin()));

        if (DataMng.Instance().RespDataCM_Login == null)
        {
            SoundMng.Instance().PlayBGM("BGMInternal/bgm_103/sound", 0.3f, null);
            this.screenCollider.playOkSE = false;
            this.switchTitleImage(GUIScreenTitle.TitleStete.returnVal);
            RestrictionInput.EndLoad();
            GUIFadeControll.ActionRestart();
            yield break;
        }
        this.titleState = (GUIScreenTitle.TitleStete)DataMng.Instance().RespDataCM_Login.state;
        this.switchTitleImage(this.titleState);
        GUIFadeControll.ActionRestart();
        string responseContactCode = PlayerPrefs.GetString("InquiryCode", string.Empty);

        if (string.IsNullOrEmpty(responseContactCode))
        {
            GameWebAPI.RequestCM_InquiryCodeRequest requestCM_InquiryCodeRequest = new GameWebAPI.RequestCM_InquiryCodeRequest();
            requestCM_InquiryCodeRequest.OnReceived = delegate(GameWebAPI.InquiryCodeRequest response)
            {
                PlayerPrefs.SetString("InquiryCode", response.inquiryCode);
            };
            GameWebAPI.RequestCM_InquiryCodeRequest request = requestCM_InquiryCodeRequest;
            yield return(base.StartCoroutine(request.Run(null, null, null)));
        }
        this.userID.gameObject.SetActive(true);
        this.userCode.gameObject.SetActive(true);
        this.appVersion.gameObject.SetActive(true);
        this.buildNumLabel.gameObject.SetActive(true);
        this.NpVersion.gameObject.SetActive(true);
        this.userCode.text   = string.Format(StringMaster.GetString("TitleUserCode"), DataMng.Instance().RespDataCM_Login.playerInfo.userCode);
        this.appVersion.text = string.Format(StringMaster.GetString("TitleAppVersion"), VersionManager.version);
        GameWebAPI.RespDataCM_Login.TutorialStatus tutorialStatus = DataMng.Instance().RespDataCM_Login.tutorialStatus;
        if ("0" == tutorialStatus.endFlg && "0" == tutorialStatus.statusId)
        {
            this.cacheClearButtonCollider.enabled  = false;
            this.cacheClearButtonLabel.color       = Color.gray;
            this.cacheClearButtonLabel.effectColor = Color.gray;
            this.cacheClearButtonSprite.spriteName = "Common02_Btn_BaseG";
        }
        yield return(this.backup.CheckClearMissionForGoogle());

        if (GUICollider.IsAllColliderDisable())
        {
            GUICollider.EnableAllCollider(string.Empty);
        }
        RestrictionInput.EndLoad();
        if ("0" != tutorialStatus.endFlg)
        {
            CMD_BaseSelect.LoadSetting();
            CMD_ChipSortModal.LoadSetting();
        }
        yield break;
    }