WWW.LoadFromCacheOrDownload
【WWW.LoadFromCacheOrDownload】
static WWWLoadFromCacheOrDownload(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.
本条通常不会遇到,基本上不会有磁盘空间不足的情况。
WWW.LoadFromCacheOrDownload的更多相关文章
- AssetBundle之LoadFromCacheOrDownload()取代"new WWW (url)的作用
1.为了充分利用缓存功能.2.缓存的资源包完全由文件名和版本号唯一标识,URL所有域名和路径信息在缓存被忽略.3.由于缓存的资源包通过文件名而不是完整的URL来识别,在任何时候资源包被下载,你可以更改 ...
- Unity3D 5.3 新版AssetBundle使用方案及策略
1.概览 Unity3D 5.0版本之后的AssetBundle机制和之前的4.x版本已经发生了很大的变化,一些曾经常用的流程已经不再使用,甚至一些老的API已经被新的API所取代. 因此,本文的主要 ...
- 深入浅出聊优化:从Draw Calls到GC
前言: 刚开始写这篇文章的时候选了一个很土的题目...<Unity3D优化全解析>.因为这是一篇临时起意才写的文章,而且陈述的都是既有的事实,因而给自己“文(dou)学(bi)”加工留下的 ...
- Unity AssetBundle爬坑手记
这篇文章从AssetBundle的打包,使用,管理以及内存占用各个方面进行了比较全面的分析,对AssetBundle使用过程中的一些坑进行填补指引以及喷! AssetBundle是Unity推荐的 ...
- Unity3D移动平台动态读取外部文件全解析
前言: 一直有个想法,就是把工作中遇到的坑通过自己的深挖,总结成一套相同问题的解决方案供各位同行拍砖探讨.眼瞅着2015年第一个工作日就要来到了,小匹夫也休息的差不多了,寻思着也该写点东西活动活动大脑 ...
- AssetBundle loading failed because.....已解决
http://blog.csdn.net/ldghd/article/details/9632455 ***************************** 一 ******* ...
- 使用 Sublime Text 2 开发 Unity3D 项目
用 Sublime 已经有很长一段时间,很舒适,很贴心,根本停不下来.之前因为是开发页游,所以是用 AS3 开发,近段时间,新开了个手游项目,引擎方面选定了 Unity3D,老实说,之前没有太多的 3 ...
- 优化 从Draw Calls到GC
原文出处: 慕容小匹夫的博客(@慕容小匹夫) 欢迎分享原创到伯乐头条 前言: 刚开始写这篇文章的时候选了一个很土的题目...<Unity3D优化全解析>.因为这是一篇临时起意才写的文章 ...
- Unity5 AssetBundle 打包以及加载
using UnityEngine; using System.Collections; using System.Collections.Generic; using UnityEditor; us ...
随机推荐
- BZOJ1725,POJ3254 [Usaco2006 Nov]Corn Fields牧场的安排
题意 Farmer John新买了一块长方形的牧场,这块牧场被划分成M列N行\((1 \leq M \leq 12, 1 \leq N \leq 12)\),每一格都是一块正方形的土地.FJ打算在牧场 ...
- node 升级
npm install -g n npm update –g
- as3 阻止后续侦听器
public class Test1 extends Sprite { private var spr:Sprite; private var spr2:Sprite; public function ...
- Java中文件的常用操作
一.文件的移动 File afile =new File("D:\\workspace\\Test\\test.avl"); if(afile.renameTo(new File ...
- Ubantu 安装fftw3
FFTW官网 FFTW ( the Faster Fourier Transform in the West) 是一个快速计算离散傅里叶变换的标准C语言程序集. ubuntu下安装指令: sudo a ...
- 算法提高 P1001【大数乘法】
当两个比较大的整数相乘时,可能会出现数据溢出的情形.为避免溢出,可以采用字符串的方法来实现两个大数之间的乘法.具体来说,首先以字符串的形式输入两个整数,每个整数的长度不会超过8位,然后把它们相乘的结果 ...
- GOF23设计模式之原型模式(prototype)
一.原型模式概述 1.通过new产生一个对象需要非常繁琐的数据准备和访问权限,则可以使用原型模式. 2.就是java中的克隆技术,以某个对象为原型,复制出新的对象,显然,新的对象具备原型对象的特点. ...
- java代码-----实现打印三角形
总结:今天我有个体会,喜欢不代表了解,了解不代表精通.我好失败 对于正三角形,就是注意空格.打星号.的实现. package com.a.b; public class Gl { public sta ...
- python稀疏矩阵得到每列最大k项的值,对list内为类对象的排序(scipy.sparse.csr.csr_matrix)
print(train_set.tdm) print(type(train_set.tdm)) 输出得到: (0, 3200) 0.264940780338 (0, 1682) 0.356545827 ...
- Linux系统命令与脚本开发
系统命令 # cat EFO cat >> file << EOF neirong EOF # 清空 >file 清空文件 [root@Poppy conf]# sed ...