コード例 #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);
            }
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: ResFactory.cs プロジェクト: Hengle/UnityLearn
        public static Res Create(string assetName, string assetBundleName)
        {
            Res res = null;

            if (assetBundleName != null)
            {
                res = new AssetRes(assetName, assetBundleName);
            }
            else if (assetName.StartsWith("resources://"))
            {
                res = new ResourcesRes(assetName);
            }
            else
            {
                res = new AssetBundleRes(assetName);
            }

            return(res);
        }
コード例 #4
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));
                }
コード例 #5
0
 public virtual void OnAsyncLoadFinish(IResLoader loader, ResourcesRes res)
 {
 }
コード例 #6
0
 public void OnSyncLoadFinish(IResLoader loader, ResourcesRes res)
 {
 }