public void PlaySlidingSound(SlidingSoundType type, Vector3 sourcePosition) { List <AudioClip> audioList = null; switch (type) { case SlidingSoundType.SlideInWood: audioList = SlideInWoodAudioList; break; case SlidingSoundType.SlideInMetal: audioList = SlideInMetalAudioList; break; } PlayRandomWaitForLastToFinish(audioList, sourcePosition); }
public void StopSlidingSound(SlidingSoundType type) { List <AudioClip> audioList = null; switch (type) { case SlidingSoundType.SlideInWood: audioList = SlideInWoodAudioList; break; case SlidingSoundType.SlideInMetal: audioList = SlideInMetalAudioList; break; } if (_clipListSourceDict.ContainsKey(audioList)) { GameObject obj = _clipListSourceDict[audioList]; if (obj != null) { Destroy(obj); _clipListSourceDict.Remove(audioList); } } }