Beispiel #1
0
            public IRes CreateRes(string name)
            {
                AssetData data = AssetDataTable.S.GetAssetData(name);

                switch (data.AssetType)
                {
                case ResLoadType.AssetBundle:
                    return(AssetBundleRes.Allocate(name));

                case ResLoadType.ABAsset:
                    return(AssetRes.Allocate(name));

                case ResLoadType.ABScene:
                    return(SceneRes.Allocate(name));

                default:
                    return(null);
                }
            }
Beispiel #2
0
        protected void InitAssetBundleName()
        {
            m_AssetBundleArray = null;

            AssetData config = AssetDataTable.S.GetAssetData(AssetName);

            if (config == null)
            {
                return;
            }

            string assetBundleName = AssetDataTable.S.GetAssetBundleName(config.AssetName, config.AssetBundleIndex);

            if (string.IsNullOrEmpty(assetBundleName))
            {
                return;
            }
            m_AssetBundleArray    = new string[1];
            m_AssetBundleArray[0] = assetBundleName;
        }
Beispiel #3
0
        private void SetSerizlizeData(SerializeData data)
        {
            if (data == null)
            {
                return;
            }

            m_Key        = data.key;
            m_ABUnitList = new List <ABUnit>(data.abUnitArray);

            if (data.assetDataArray != null)
            {
                m_AssetDataMap = new Dictionary <string, AssetData>();

                for (int i = 0; i < data.assetDataArray.Length; ++i)
                {
                    AssetData config = data.assetDataArray[i];
                    AddAssetData(config);
                }
            }
        }
Beispiel #4
0
        private SerializeData GetSerializeData()
        {
            SerializeData sd = new SerializeData();

            sd.key         = m_Key;
            sd.abUnitArray = m_ABUnitList.ToArray();
            if (m_AssetDataMap != null)
            {
                AssetData[] acArray = new AssetData[m_AssetDataMap.Count];

                int index = 0;
                foreach (var item in m_AssetDataMap)
                {
                    acArray[index++] = item.Value;
                }

                sd.assetDataArray = acArray;
            }

            return(sd);
        }
Beispiel #5
0
            public bool CheckResType(string name)
            {
                AssetData data = AssetDataTable.S.GetAssetData(name);

                return(data != null);
            }