public void PlayVoiceLine(NPCType m_nPCType, int p_index) { AudioDialogueInfo audioDialogueInfo = m_audioDialogueInfo.Where(adi => adi.NPCType == m_nPCType).SingleOrDefault(); if (audioDialogueInfo == null) { return; } m_audioSource.PlayOneShot(audioDialogueInfo.AudioList[p_index]); }
public void PlayVoiceRandomLine(NPCType m_nPCType) { AudioDialogueInfo audioDialogueInfo = m_audioDialogueInfo.Where(adi => adi.NPCType == m_nPCType).SingleOrDefault(); if (audioDialogueInfo == null) { return; } m_audioSource.PlayOneShot(audioDialogueInfo.AudioList[Random.Range(0, audioDialogueInfo.AudioList.Count)]); }