Files
apt-nl-map/static/Magic4/js/three.js-dev/docs/api/zh/loaders/Cache.html
2024-12-04 10:21:04 +08:00

76 lines
1.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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:null add]( [param:String key], file )</h3>
<p>
[page:String key] — 通过引用缓存文件的[page:String key]。<br />
[page:Object file] — 所被缓存的文件<br /><br />
使用key为引用文件增加一个缓存入口。如果该key已持有一个文件则会被覆盖。
</p>
<h3>[method:null get]( [param:String key] )</h3>
<p>
[page:String key] — 一个字符串key <br /><br />
获得该[page:String key]的值。 如果该key不存在则以*undefined*被返回。
</p>
<h3>[method:null remove]( [param:String key] )</h3>
<p>
[page:String key] — 引用缓存文件的一个字符串key<br /><br />
使用key来删除相应的缓存文件。
</p>
<h3>[method:null 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>