Esempio n. 1
0
        //创建bundle数据
        BundleData CreateBdlData(string bundle_id)
        {
            BdlCfgInfo bdlCfg = AbsResConfig.GetBdlCfg(bundle_id);
            string     url    = bdlCfg.path; //修正路径(已经是小写)
            //url = url.ToLower();

            AssetData data;

            if (m_url2data.TryGetValue(url, out data))
            {
                return(data as BundleData);
            }

            BundleData bdlData = new BundleData();

            bdlData.Init(url);

            if (bdlCfg.depends != null)
            {
                //有依赖项
                BundleData dpData;
                for (int i = 0; i < bdlCfg.depends.Length; ++i)
                {
                    dpData = CreateBdlData(bdlCfg.depends[i].id);
                    bdlData.AddDepend(dpData);
                }
            }

            bdlData.active_time = DateUtil.TimeFromStart;

            m_url2data[url] = bdlData;

            return(bdlData);
        }
Esempio n. 2
0
        //-------∽-★-∽------∽-★-∽--------∽-★-∽数据管理∽-★-∽--------∽-★-∽------∽-★-∽--------//

        protected override AssetData CreateData(string url_)
        {
            AssetData data;

            if (m_url2data.TryGetValue(url_, out data))
            {
                return(data as BundleData);
            }

            AssetDataII data2 = new AssetDataII();

            data2.Init(url_);

            ResCfgInfo resCfg = AbsResConfig.GetResCfg(url_);
            BundleData dpData = CreateBdlData(resCfg.bundle.id);

            data2.SetDepend(dpData);

            m_url2data[url_] = data2;
            return(data2);
        }