You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
1.8 KiB
75 lines
1.8 KiB
<!DOCTYPE html>
|
|
<html lang="zh">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<base href="../../../" />
|
|
<script src="page.js"></script>
|
|
<link type="text/css" rel="stylesheet" href="page.css" />
|
|
</head>
|
|
<body>
|
|
<h1>[name]</h1>
|
|
|
|
<p class="desc">
|
|
一个简单的缓存系统,内部使用[page:FileLoader]。
|
|
</p>
|
|
|
|
<h2>代码示例</h2>
|
|
|
|
<p>
|
|
要在所有使用[page:FileLoader]的加载器上启用缓存, 需设置</p>
|
|
<code>
|
|
THREE.Cache.enabled = true.
|
|
</code>
|
|
|
|
<h2>例子</h2>
|
|
|
|
<p>
|
|
[example:webgl_geometry_text WebGL / geometry / text ]<br />
|
|
[example:webgl_interactive_instances_gpu WebGL / interactive / instances / gpu]<br />
|
|
[example:webgl_loader_ttf WebGL / loader / ttf]
|
|
</p>
|
|
|
|
<h2>属性</h2>
|
|
|
|
<h3>[property:Boolean enabled]</h3>
|
|
<p>是否启用缓存,默认为*false*.</p>
|
|
|
|
<h3>[property:Object files]</h3>
|
|
<p>一个[page:Object object]所持有的缓存文件。</p>
|
|
|
|
|
|
<h2>方法</h2>
|
|
|
|
<h3>[method:undefined add]( [param:String key], file )</h3>
|
|
<p>
|
|
[page:String key] — 通过引用缓存文件的[page:String key]。<br />
|
|
[page:Object file] — 所被缓存的文件<br /><br />
|
|
|
|
使用key为引用文件增加一个缓存入口。如果该key已持有一个文件,则会被覆盖。
|
|
</p>
|
|
|
|
<h3>[method:Any get]( [param:String key] )</h3>
|
|
<p>
|
|
[page:String key] — 一个字符串key <br /><br />
|
|
|
|
获得该[page:String key]的值。 如果该key不存在,则以*undefined*被返回。
|
|
</p>
|
|
|
|
<h3>[method:undefined remove]( [param:String key] )</h3>
|
|
<p>
|
|
[page:String key] — 引用缓存文件的一个字符串key<br /><br />
|
|
|
|
使用key来删除相应的缓存文件。
|
|
</p>
|
|
|
|
<h3>[method:undefined clear]()</h3>
|
|
<p>清除所有缓存中的值。</p>
|
|
|
|
|
|
<h2>源</h2>
|
|
|
|
<p>
|
|
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
|
</p>
|
|
</body>
|
|
</html>
|
|
|