public override void Remove(CacheItem item, string key, bool isMainSlbServer = true) { var cacheKey = GenerateCacheKey(item, key); if (CachePool.Contains(cacheKey)) { CachePool.Remove(cacheKey); } }
public static void UnloadSoundAsset(AudioSource audioSource, int soundId) { if (audioSource != null) { SoundDeploy deploy = _soundTableT.GetSection(soundId); CachePool.Remove(deploy.resource); Resources.UnloadAsset(audioSource.clip); } }
public static void FadeOutMusic(float fade = 1f) { if (_music != null && _music.AudioSource != null) { CachePool.Remove(_music.Resources); Resources.UnloadAsset(_music.AudioSource.clip); Object.Destroy(_music.AudioSource.gameObject); } }
public static void StopEnvironmentMusic(float fade = 3f) { if (_environment != null && _environment.AudioSource != null) { CachePool.Remove(_environment.Resources); Resources.UnloadAsset(_environment.AudioSource.clip); Object.Destroy(_environment.AudioSource.gameObject); } }
public override void ClearAll() { lock (Padlock) { foreach (var cacheItem in CachePool) { CachePool.Remove(cacheItem.Key); } } }
public override void ClearItem(CacheItem item, bool isMainSlbServer = true) { lock (Padlock) { foreach (var cacheItem in CachePool.Where(p => p.Key.StartsWith(item.ToString()))) { CachePool.Remove(cacheItem.Key); } } }
public static void StopMusic() { if (_music != null && _music.AudioSource != null) { CachePool.Remove(_music.Resources); Resources.UnloadAsset(_music.AudioSource.clip); Object.Destroy(_music.AudioSource.gameObject); _music.AudioSource = null; } }