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 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); } }