Beispiel #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);
            }
        }
        public IRes Create(ResSearchKeys resSearchKeys)
        {
            var resourcesRes = ResourcesRes.Allocate(resSearchKeys.AssetName,
                                                     resSearchKeys.AssetName.StartsWith("resources://")
                    ? InternalResNamePrefixType.Url
                    : InternalResNamePrefixType.Folder);

            resourcesRes.AssetType = resSearchKeys.AssetType;
            return(resourcesRes);
        }
Beispiel #3
0
        public static ResInfo Create(ResLoadInfo resLoadInfo)
        {
            switch (resLoadInfo.mResFromType)
            {
            case ResFromType.ResourcesRes:
                return(ResourcesRes.Allocate(resLoadInfo));

            case ResFromType.NetImageRes:
                return(NetImageRes.Allocate(resLoadInfo));

            case ResFromType.ABRes:
                if (ABDataHolder.Instance.GetABResLoadFrom() == ABResLoadFrom.EditorRes)
#if UNITY_EDITOR
                { return(EditorRes.Allocate(resLoadInfo)); }
#else
                { return(null); }
#endif
                else
                {
                    return(ABRes.Allocate(resLoadInfo));
                }