static void CreatePlayerLiveLinkCacheDir() { if (!Directory.Exists(EntityScenesPaths.GetLiveLinkCacheDirPath())) { Directory.CreateDirectory(EntityScenesPaths.GetLiveLinkCacheDirPath()); } }
public static unsafe void WritePlayerLiveLinkCacheGUID() { CreatePlayerLiveLinkCacheDir(); var cacheGUIDPath = $"{EntityScenesPaths.GetLiveLinkCacheDirPath()}/livelinkcacheguid"; using (var stream = new StreamBinaryWriter(cacheGUIDPath)) { Hash128 guid = LiveLinkCacheGUID; stream.WriteBytes(&guid, sizeof(Hash128)); } }
public static unsafe void ReadPlayerLiveLinkCacheGUID() { var cacheGUIDPath = $"{EntityScenesPaths.GetLiveLinkCacheDirPath()}/livelinkcacheguid"; if (File.Exists(cacheGUIDPath)) { using (var rdr = new StreamBinaryReader(cacheGUIDPath)) { Hash128 guid = default; rdr.ReadBytes(&guid, sizeof(Hash128)); LiveLinkCacheGUID = guid; } } }
public static void ClearPlayerLiveLinkCache() { var cachePath = EntityScenesPaths.GetLiveLinkCacheDirPath(); if (Directory.Exists(cachePath)) { try { Directory.Delete(cachePath, true); } catch (SystemException exception) { Debug.LogError($"Failed to delete LiveLink cache! {exception.Message}"); } } }