Параметры
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);
//Убедитесь, что ваш новый Cache действителен
if (newCache.valid)
{
//If you wanted to set your newly created cache to the active cache
Caching.currentCacheForWriting = newCache;
}
}
}