Esempio n. 1
0
    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);
    }
Esempio n. 2
0
    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);
    }