public void Play(AudioObject _data) { if (Source == null) { return; } if (_data != null && _data.Enabled && _data.GetNextClip() != null) { if (m_AudioData != _data || Source.clip == null || Source.clip.name != _data.Selected.name) { m_AudioData = _data; SetImpulseData(m_AudioData); base.Start(); if (DebugLogIsEnabled) { PrintDebugLog(this, "Play - " + m_AudioData.Selected.name); } } } else if (m_AudioData == null || m_AudioData.StopAtEnd) { Stop(); } }
public void PlayOneShot(AudioObject _data) { if (Source == null) { return; } if (_data != null && _data.Enabled && _data.GetNextClip() != null) { if (Source.isPlaying) { if (_data.Break) { Source.Stop(); } else { return; } } Prepare(_data); Source.PlayOneShot(_data.Selected); } else if (m_AudioData == null || m_AudioData.StopAtEnd) { Stop(); } }