예제 #1
0
        public override void Remove(CacheItem item, string key, bool isMainSlbServer = true)
        {
            var cacheKey = GenerateCacheKey(item, key);

            if (CachePool.Contains(cacheKey))
            {
                CachePool.Remove(cacheKey);
            }
        }
예제 #2
0
파일: Sound.cs 프로젝트: zhfelon1/th-haruhi
 public static void UnloadSoundAsset(AudioSource audioSource, int soundId)
 {
     if (audioSource != null)
     {
         SoundDeploy deploy = _soundTableT.GetSection(soundId);
         CachePool.Remove(deploy.resource);
         Resources.UnloadAsset(audioSource.clip);
     }
 }
예제 #3
0
파일: Sound.cs 프로젝트: zhfelon1/th-haruhi
 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);
     }
 }
예제 #4
0
파일: Sound.cs 프로젝트: zhfelon1/th-haruhi
 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);
     }
 }
예제 #5
0
 public override void ClearAll()
 {
     lock (Padlock)
     {
         foreach (var cacheItem in CachePool)
         {
             CachePool.Remove(cacheItem.Key);
         }
     }
 }
예제 #6
0
 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);
         }
     }
 }
예제 #7
0
파일: Sound.cs 프로젝트: zhfelon1/th-haruhi
 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;
     }
 }