Exemplo n.º 1
0
        public static IRes Create(ResSearchRule resSearchRule, short assetType)
        {
            switch (assetType)
            {
            case ResType.AssetBundle:
                return(AssetBundleRes.Allocate(resSearchRule.AssetName));

            case ResType.ABAsset:
                return(AssetRes.Allocate(resSearchRule.AssetName, resSearchRule.OwnerBundle));

            case ResType.ABScene:
                return(SceneRes.Allocate(resSearchRule.AssetName));

            case ResType.Internal:
                return(ResourcesRes.Allocate(resSearchRule.AssetName,
                                             resSearchRule.AssetName.StartsWith("resources://")
                            ? InternalResNamePrefixType.Url
                            : InternalResNamePrefixType.Folder));

            case ResType.NetImageRes:
                return(NetImageRes.Allocate(resSearchRule.AssetName));

            case ResType.LocalImageRes:
                return(LocalImageRes.Allocate(resSearchRule.AssetName));

            default:
                Log.E("Invalid assetType :" + assetType);
                return(null);
            }
        }
Exemplo n.º 2
0
        public static AssetRes Allocate(string name)
        {
            AssetRes res = ObjectPool <AssetRes> .Instance.Allocate();

            if (res != null)
            {
                res.name = name;
                res.InitAssetBundleName();
            }
            return(res);
        }
Exemplo n.º 3
0
        public static AssetRes Allocate(string name, string onwerBundleName = null)
        {
            AssetRes res = SafeObjectPool <AssetRes> .Instance.Allocate();

            if (res != null)
            {
                res.AssetName        = name;
                res.mOwnerBundleName = onwerBundleName;
                res.InitAssetBundleName();
            }
            return(res);
        }
Exemplo n.º 4
0
        public static IRes Create(string name, short assetType)
        {
            switch (assetType)
            {
            case eResType.kAssetBundle:
                return(AssetBundleRes.Allocate(name));

            case eResType.kABAsset:
                return(AssetRes.Allocate(name));

            case eResType.kABScene:
                return(SceneRes.Allocate(name));

            case eResType.kInternal:
                return(InternalRes.Allocate(name));

            case eResType.kNetImageRes:
                return(NetImageRes.Allocate(name));

            default:
                Log.e("Invalid assetType :" + assetType);
                return(null);
            }
        }
Exemplo n.º 5
0
 public void OnSyncLoadFinish(IResLoader loader, AssetRes res)
 {
 }
Exemplo n.º 6
0
 public void OnSyncLoadFinish(IResLoader loader, AssetRes res)
 {
     //Log.w("OnSyncLoadFinish:AssetRes:" + res.name);
 }
Exemplo n.º 7
0
 public virtual void OnAsyncLoadFinish(IResLoader loader, AssetRes res)
 {
 }