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); } }
public static NetImageRes Allocate(string name) { NetImageRes res = SafeObjectPool <NetImageRes> .Instance.Allocate(); if (res != null) { res.AssetName = name; res.SetUrl(name.Substring(9)); } return(res); }