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 assetName, string ownerBundleName, short assetType) { switch (assetType) { case ResType.AssetBundle: return(AssetBundleRes.Allocate(assetName)); case ResType.ABAsset: return(AssetRes.Allocate(assetName, ownerBundleName)); case ResType.ABScene: return(SceneRes.Allocate(assetName)); case ResType.Internal: return(InternalRes.Allocate(assetName)); case ResType.NetImageRes: return(NetImageRes.Allocate(assetName)); case ResType.LocalImageRes: return(LocalImageRes.Allocate(assetName)); default: Log.E("Invalid assetType :" + assetType); return(null); } }
/// <summary> /// 创建资源 /// </summary> /// <param name="data"></param> public static Res Create(ResData data) { switch (data.type) { case ResType.Bundle: return(BundleRes.Allocate(data)); case ResType.Asset: return(AssetRes.Allocate(data)); case ResType.Resource: return(ResourceRes.Allocate(data)); default: return(null); } }
public IRes Create(ResSearchKeys resSearchKeys) { return(AssetRes.Allocate(resSearchKeys.AssetName, resSearchKeys.OwnerBundle, resSearchKeys.AssetType)); }