public override bool CanLoadResourceImmediately <TResource>(object owner, string uri)
        {
            if (IsCached(uri))
            {
                return(true);
            }

            var resourceName             = UrlHelper.GetResourceName(uri);
            AssetBundleManifest manifest = null;
            var bundlesLoader            = GetExistBundlesLoader(out manifest);

            var assetInfo = manifest.AssetInfos[resourceName];
            var bundle    = manifest.GetBundleByAssetName(resourceName);

            if (!bundlesLoader.IsCached(UrlHelper.GetUriWithPrefix(bundlesLoader.SupportsMask, bundle.Name)))
            {
                return(false);
            }

            foreach (var dependentBundle in assetInfo.Dependencies)
            {
                if (!bundlesLoader.IsCached(UrlHelper.GetUriWithPrefix(bundlesLoader.SupportsMask, dependentBundle)))
                {
                    return(false);
                }
            }

            return(true);
        }
        public override T LoadResourceImmediately <T>(object owner, string uri)
        {
            if (IsCached(uri))
            {
                return(GetCachedResource <T>(owner, uri));
            }

            var resourceName             = UrlHelper.GetResourceName(uri);
            AssetBundleManifest manifest = null;
            var bundlesLoader            = GetExistBundlesLoader(out manifest);

            var assetInfo = manifest.AssetInfos[resourceName];
            var bundle    = manifest.GetBundleByAssetName(resourceName);


            if (!bundlesLoader.IsCached(UrlHelper.GetUriWithPrefix(bundlesLoader.SupportsMask, bundle.Name)))
            {
                throw new ResourceSystemException(string.Format("Bundle {0} not loaded in cache", bundle.Name));
            }

            foreach (var dependentBundle in assetInfo.Dependencies)
            {
                if (!bundlesLoader.IsCached(UrlHelper.GetUriWithPrefix(bundlesLoader.SupportsMask, dependentBundle)))
                {
                    throw new ResourceSystemException(string.Format("Dependent Bundle {0} for Bundle {1} not loaded in cache", dependentBundle, bundle.Name));
                }
            }

            var cachedBundle = bundlesLoader.LoadResourceImmediately <AssetBundle>(this, UrlHelper.GetUriWithPrefix(bundlesLoader.SupportsMask, bundle.Name));

            T asset = null;

            if (resourceName.EndsWith(".prefab"))
            {
                var prefab = cachedBundle.LoadAsset <GameObject>(resourceName);
                if (typeof(T) == typeof(GameObject))
                {
                    asset = prefab as T;
                }
                else
                {
                    asset = prefab.GetComponent <T>();
                }
            }
            else
            {
                asset = cachedBundle.LoadAsset <T>(resourceName);
            }

            if (asset == null)
            {
                throw new ResourceSystemException(string.Format("Asset {0} not loaded from bundle", resourceName));
            }

            _memoryCache.Add(owner, uri, asset);
            return(asset);
        }