cachePath | 缓存文件夹的路径。 |
使用给定路径添加缓存。
这允许您将新缓存添加到缓存列表。将返回一个 Cache 引用。
using System.IO; using UnityEngine;
public class Example : MonoBehaviour { void AddCacheAtPath(string path) { if (!Directory.Exists(path)) Directory.CreateDirectory(path);
Cache newCache = Caching.AddCache(path);
//Make sure your new Cache is valid if (newCache.valid) { //If you wanted to set your newly created cache to the active cache Caching.currentCacheForWriting = newCache; } } }