示例#1
0
        /// <summary>
        /// 获取章节所用到的所有资源
        /// </summary>
        /// <param name="chapterID"></param>
        /// <returns></returns>
        public List <string> GetChapterAssetList(long chapterID)
        {
            List <ConfAssetManifest> chapterAssets;

            ConfAssetManifest.GetConfigByCondition($"chapterID = {chapterID}", out chapterAssets);
            return(chapterAssets.Select(chaterAsset => chaterAsset.AssetBundleName).ToList());
        }
示例#2
0
        public static bool GetConfig(string fieldName, object fieldValue, out ConfAssetManifest config)
        {
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhereCondition("conf_AssetManifest", fieldName, fieldValue);

            if (sqReader != null)
            {
                try
                {
                    sqReader.Read();
                    if (sqReader.HasRows)
                    {
                        config = GetConfByDic(sqReader);
                    }
                    else
                    {
                        config = null;
                        return(false);
                    }
                    return(true);
                }
                catch (Exception ex)
                {
                    SqliteDriver.SQLiteHelper.OnError(string.Format("AssetManifest 表找不到列={0} 值={1}的数据\n{2}", fieldName, fieldValue, ex));
                }
                config = null;
                return(false);
            }
            config = null;
            return(false);
        }
示例#3
0
        private static ConfAssetManifest GetConfByDic(DataTable reader)
        {
            int    id              = reader.GetInt32(0);
            int    chapterID       = reader.GetInt32(1);
            string AssetBundleName = reader.GetString(2);
            int    AssetLevel      = reader.GetInt32(3);

            ConfAssetManifest new_obj_ConfAssetManifest = new ConfAssetManifest(id,
                                                                                chapterID,
                                                                                AssetBundleName,
                                                                                AssetLevel
                                                                                );

            return(new_obj_ConfAssetManifest);
        }
示例#4
0
 private static void GetArrrayList()
 {
     if (cacheArray.Count <= 0)
     {
         DataTable sqReader = SQLiteHelper.Instance().GetReadFullTable("conf_AssetManifest");
         if (sqReader != null)
         {
             while (sqReader.Read())
             {
                 ConfAssetManifest _conf = GetConfByDic(sqReader);
                 cacheArray.Add(_conf);
                 dic[_conf.id] = _conf;
             }
             resLoaded = true;
         }
     }
 }
示例#5
0
        public static bool GetConfig(int id, out ConfAssetManifest config)
        {
            if (dic.TryGetValue(id, out config))
            {
                return(config != null);
            }
            if (cacheLoaded)
            {
                config = null;
                return(false);
            }
            DataTable sqReader = SQLiteHelper.Instance().GetSelectWhere("conf_AssetManifest", id);

            if (sqReader != null)
            {
                try
                {
                    sqReader.Read();
                    if (sqReader.HasRows)
                    {
                        config = GetConfByDic(sqReader);
                    }
                    else
                    {
                        dic[id] = null;
                        config  = null;
                        return(false);
                    }
                    dic[id] = config;
                    return(true);
                }
                catch (Exception ex)
                {
                    SqliteDriver.SQLiteHelper.OnError(string.Format("AssetManifest 表找不到SN={0} 的数据\n{1}", id, ex));
                }
                config = null;
                return(false);
            }
            else
            {
                config = null;
                return(false);
            }
        }
示例#6
0
        /// <summary>
        /// 下载可选资源
        /// </summary>
        private void DownloadOptionalAssets()
        {
            if (EngineDelegateCore.DynamicResource)
            {
                List <ConfAssetManifest> optionalAssets;
                ConfAssetManifest.GetConfigByCondition("AssetLevel = '1'", out optionalAssets);
                string[] optionalAssetsList = optionalAssets.Select(assetManifest => assetManifest.AssetBundleName).ToArray();

                ResourceMgr.Instance.RequestDynamicAssets(optionalAssetsList, assetUpdateInfo =>
                {
                    float delta = 1 - ((float)assetUpdateInfo.RemainDownloadAssetCount / assetUpdateInfo.TotalAssetCount);
                    Debug.Log("total count :" + assetUpdateInfo.TotalAssetCount + "   remain count :" + assetUpdateInfo.RemainDownloadAssetCount);
                    PregameUILogic.instance.SetDeltaValue(delta * (1.0f / m_totalPreloadCount));
                }, finish =>
                {
                    LoadNext();
                });
            }
            else
            {
                LoadNext();
            }
        }
示例#7
0
 public static void Register()
 {
     ConfAchievement.Init();
     ConfActiveDrop.Init();
     ConfActivityBase.Init();
     ConfAssetManifest.Init();
     Confbranchtask.Init();
     ConfBuilding.Init();
     ConfCartoonScene.Init();
     ConfChapter.Init();
     ConfCharge.Init();
     ConfChat.Init();
     ConfChatItem.Init();
     ConfCheckIn.Init();
     ConfCombineFormula.Init();
     ConfDemoScene.Init();
     ConfDropOut.Init();
     ConfPropGiftItem0.Init();
     ConfPropGiftItem1.Init();
     ConfPropGiftItem2.Init();
     ConfDropOut2.Init();
     Confetl.Init();
     ConfEvent.Init();
     ConfEventAttribute.Init();
     ConfEventPhase.Init();
     Confexhibit.Init();
     ConfExpToLevel.Init();
     Conffailtips.Init();
     ConfFeedback.Init();
     ConfFind.Init();
     ConfFindClue.Init();
     ConfFindTypeIcon.Init();
     ConfGMCMD.Init();
     ConfGuid.Init();
     ConfGuidArt.Init();
     ConfGuidNew.Init();
     ConfGuidNewFunction.Init();
     Confinapppurchase.Init();
     ConfJigsawScene.Init();
     ConfKeyWords.Init();
     ConfLanguage.Init();
     ConfMsgCode.Init();
     ConfNode.Init();
     ConfNpc.Init();
     ConfOfficer.Init();
     ConfPath.Init();
     ConfPoliceRankIcon.Init();
     ConfProp.Init();
     ConfPropGift.Init();
     ConfPropGiftItem0.Init();
     ConfPropGiftItem1.Init();
     ConfPropGiftItem2.Init();
     ConfPush.Init();
     ConfReasoning.Init();
     ConfScene.Init();
     ConfSceneDifficulty.Init();
     ConfSceneSpecial.Init();
     ConfServiceConfig.Init();
     ConfSkill.Init();
     ConfSkyEye.Init();
     ConfSound.Init();
     ConfTask.Init();
     ConfTitle.Init();
 }