Esempio n. 1
0
        public bool AddAssetData(AssetData assetData)
        {
            if (m_AssetDataMap == null)
            {
                m_AssetDataMap = new Dictionary <string, AssetData>();
            }

            string key = assetData.assetName.Trim().ToLower();

            if (m_AssetDataMap.ContainsKey(key))
            {
                AssetData oldAsset = GetAssetData(key);
                string    msg      = string.Format("#Aleady Add AssetData :{0} ", assetData.assetName);
                Log.w(msg);
                return(false);
            }

            m_AssetDataMap.Add(key, assetData);
            return(true);
        }
Esempio n. 2
0
        protected void InitAssetBundleName()
        {
            AssetData asset = AssetDataTable.S.GetAssetData(m_Name);

            if (asset == null)
            {
                Log.e("#Not Find AssetData For Asset:" + m_Name);
                return;
            }

            string assetBundleName = AssetDataTable.S.GetAssetBundleNameByAssetName(asset.assetName);

            if (string.IsNullOrEmpty(assetBundleName))
            {
                Log.e("#Not Find AssetBundle In Table:" + asset.assetName);
                return;
            }

            m_AssetBundleName = assetBundleName;
        }
Esempio n. 3
0
        public bool AddAssetBundle(string name, string[] depends, string md5, int fileSize, long buildTime)
        {
            if (string.IsNullOrEmpty(name))
            {
                return(false);
            }
            if (m_ABUnit == null)
            {
                m_ABUnit = new ABUnit(name, depends, md5, fileSize, buildTime);
            }

            AssetData config = GetAssetData(name);

            if (config != null)
            {
                Debug.LogError("#Already add AssetData");
                return(false);
            }

            //Debug.LogError("AddAssetBundle:" + name);
            AddAssetData(new AssetData(name, eResType.kAssetBundle));
            return(true);
        }
Esempio n. 4
0
        public SerializeData GetSerializeData()
        {
            SerializeData data = new SerializeData();

            data.key       = m_Key;
            data.buildTime = m_BuildTime;
            if (m_ABUnit != null)
            {
                data.abUnit = m_ABUnit;
            }

            if (m_AssetDataMap != null)
            {
                AssetData[] acArray = new AssetData[m_AssetDataMap.Count];
                int         index   = 0;
                foreach (var item in m_AssetDataMap)
                {
                    acArray[index++] = item.Value;
                }

                data.assetDataArray = acArray;
            }
            return(data);
        }
Esempio n. 5
0
            public bool CheckResType(string name)
            {
                AssetData data = AssetDataTable.S.GetAssetData(name);

                return(data != null);
            }