public static void Play(SfxName sfxName) { int clipCount = m_Instance.m_ClipsList[(int)sfxName].Count; int clipIndex = 0; if (clipCount > 1) { clipIndex = UnityEngine.Random.RandomRange(0, clipCount); } Play(sfxName, clipIndex); }
public static void Play(SfxName sfxName, int clipIndex) { if (m_Instance == null) { return; } if (clipIndex >= m_Instance.m_ClipsList[(int)sfxName].Count) { return; } AudioClip clip = m_Instance.m_ClipsList[(int)sfxName][clipIndex]; Play(clip); }