UnityEngine.WWW.LoadFromCacheOrDownload C# (CSharp) Method

LoadFromCacheOrDownload() public static method

Loads an AssetBundle with the specified version number from the cache. If the AssetBundle is not currently cached, it will automatically be downloaded and stored in the cache for future retrieval from local storage.

public static LoadFromCacheOrDownload ( string url, int version, [ crc ) : WWW
url string The URL to download the AssetBundle from, if it is not present in the cache. Must be '%' escaped.
version int Version of the AssetBundle. The file will only be loaded from the disk cache if it has previously been downloaded with the same version parameter. By incrementing the version number requested by your application, you can force Caching to download a new copy of the AssetBundle from url.
crc [ An optional CRC-32 Checksum of the uncompressed contents. If this is non-zero, then the content will be compared against the checksum before loading it, and give an error if it does not match. You can use this to avoid data corruption from bad downloads or users tampering with the cached files on disk. If the CRC does not match, Unity will try to redownload the data, and if the CRC on the server does not match it will fail with an error. Look at the error string returned to see the correct CRC value to use for an AssetBundle.
return WWW
        public static WWW LoadFromCacheOrDownload(string url, int version, [UnityEngine.Internal.DefaultValue("0")] uint crc)
        {
            Hash128 hash = new Hash128(0, 0, 0, (uint) version);
            return LoadFromCacheOrDownload(url, hash, crc);
        }

Same methods

WWW::LoadFromCacheOrDownload ( string url, Hash128 hash ) : WWW
WWW::LoadFromCacheOrDownload ( string url, Hash128 hash, [ crc ) : WWW
WWW::LoadFromCacheOrDownload ( string url, int version ) : WWW

Usage Example

コード例 #1
0
        public static WWW LoadFromCacheOrDownload(string url, int version, [UnityEngine.Internal.DefaultValue("0")] uint crc)
        {
            Hash128 hash = new Hash128(0u, 0u, 0u, (uint)version);

            return(WWW.LoadFromCacheOrDownload(url, hash, crc));
        }
All Usage Examples Of UnityEngine.WWW::LoadFromCacheOrDownload