Version: 2017.3
public static Cache AddCache (string cachePath);

参数

cachePath 缓存文件夹的路径。

描述

添加具有给定路径的缓存。

这允许您向缓存列表中添加新缓存。将返回对缓存的引用。

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; } } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961