zoukankan      html  css  js  c++  java
  • WWW.LoadFromCacheOrDownload

    WWW.LoadFromCacheOrDownload

      static WWW LoadFromCacheOrDownload(string url, int version, uint crc = 0);

      url:Must be '%' escaped.

      version: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 AssetBunlde from url.

      crc: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. 

      注意要点:

      Cached AssetBundles are uniquely identified solely by the filename and version number; all domain and path information in url is ignored by Caching. Since cached AssetBundles are identified by filename instead of the full URL, you can change the directory from where the asset bundle is downloaded at any time. This is useful for pushing out new versions of the game and ensuring that files are not cached incorrectly by the browser or by a CDN. For WebPlayer applications that use the shared cache, Caching adds unique identifying information to identically-named AssetBundles in order to prevent name collisions between applications.

      If the cache folder does not have any space for caching additional files, LoadFromCacheOrDownload will iteratively delete the least-recently-used AssetBundles from the Cache until sufficient space is available to store the new AssetBundle. If making space is not possible (because the hard disk is full, or all files in the cache are currently in use), LoadFromCacheOrDownload() will bypass Caching and stream the file into memory like a normal "new WWW()" call

      本条通常不会遇到,基本上不会有磁盘空间不足的情况。

    参考:file:///C:/Program%20Files%20(x86)/Unity/Editor/Data/Documentation/html/en/ScriptReference/WWW.LoadFromCacheOrDownload.html

  • 相关阅读:
    对话框事件
    C# 实现retry
    Linq中的group by多表多字段,Sum求和
    词干提取(stemming)和词形还原(lemmatization)
    GIT简单应用实例
    像素、分辨率、dpi的区别和联系
    二值图像、灰度图像、彩色图像
    更好的做科研
    数据挖掘竞赛利器-Stacking和Blending方式
    如何成为一名成功的博士生
  • 原文地址:https://www.cnblogs.com/tekkaman/p/4028554.html
Copyright © 2011-2022 走看看