Version: 2023.1

Cache

struct in UnityEngine

切换到手册

描述

Data structure for cache. For more information, see Caching.AddCache.

**Note:** The Cache API is not supported in WebGL because AssetBundles are stored in the browser cache for the WebGL platform.

变量

expirationDelayAssetBundle 在被自动删除前可在缓存中保持未使用状态的秒数。
index返回缓存列表中缓存的索引。
maximumAvailableStorageSpace允许您指定可以为缓存分配的总字节数。
path返回缓存的路径。
readOnly如果缓存为只读,则返回 true。
ready如果缓存已就绪,则返回 true。
spaceFree返回缓存中当前未使用的字节数。
spaceOccupied返回已用磁盘空间(以字节为单位)。
valid如果缓存有效,则返回 true。

公共函数

ClearCache删除当前应用程序存入缓存中的所有缓存内容。