示例#1
0
        /// <summary>
        /// 获取依赖的AbInfo,
        /// </summary>
        private List <AssetObject> GetSortDependAssetObject()
        {
            List <AssetObject> tDependAbInfoList = new List <AssetObject>();

            string[] tDependAssetPath = null;
            if (AppConfig.mAssetLoadMode == AppConfig.AssetLoadMode.AssetBundle)
            {
                tDependAssetPath = global::Hotfix.ManagerIndex.AssetManager.mAbManifest.GetDirectDependencies(mPath);
            }
            else
            {
                tDependAssetPath = HotFixAgent.AssetDataBase.GetDependencies(mPath);
            }

            foreach (var tDependAb in tDependAssetPath)
            {
                AssetObject tDepenAssetObject = Spawn(tDependAb);
                tDependAbInfoList.AddRange(tDepenAssetObject.mDependObj);
                tDependAbInfoList.Add(tDepenAssetObject);
            }

            return(tDependAbInfoList);
        }
示例#2
0
        /// <summary>
        /// 获取资源对象
        /// </summary>
        public static AssetObject Spawn(string pPath)
        {
            if (mAssetObjDic.ContainsKey(pPath) == false)
            {
                AssetObject tAssetObject = new AssetObject();
                tAssetObject.mPath = pPath;

                if (AppConfig.mAssetLoadMode == AppConfig.AssetLoadMode.Editor &&
                    pPath.StartsWith("Assets/Res") == false)
                {
                    tAssetObject.mPath = string.Format("Assets/Res/{0}", pPath);
                }

                int tLastIndex = tAssetObject.mPath.LastIndexOf("/");
                tAssetObject.mName = tAssetObject.mPath.Substring(tLastIndex + 1);

                tAssetObject.mRefCount  = 0;
                tAssetObject.mDependObj = tAssetObject.GetSortDependAssetObject();

                mAssetObjDic.Add(pPath, tAssetObject);
            }

            return(mAssetObjDic[pPath]);
        }