public void PlayAudioEvent(BaseAudioEventInfo baseAudioEvent) { if (baseAudioEvent == null) { return; } if (!(baseAudioEvent is AudioEvent audioEvent)) { // TODO return; } var entry = ResolveAudioEventEntry(audioEvent); if (entry == null) { logger.Warn($"Missing Audio File: {audioEvent.Name}"); return; } var source = GetSound(entry, audioEvent.Control.HasFlag(AudioControlFlags.Loop)); _sources.Add(source); source.Volume = (float)audioEvent.Volume; source.Play(); }
public void PlayAudioEvent(BaseAudioEventInfo baseAudioEvent) { var source = PlayAudioEventBase(baseAudioEvent); if (source == null) { return; } source.Play(); }
public AudioSource PlayAudioEvent(BaseAudioEventInfo baseAudioEvent, bool looping = false) { var source = PlayAudioEventBase(baseAudioEvent, looping); if (source == null) { return(null); } source.Play(); return(source); }
public void PlayAudioEvent(GameObject emitter, BaseAudioEventInfo baseAudioEvent) { var source = PlayAudioEventBase(baseAudioEvent); if (source == null) { return; } // TODO: fix issues with some units //_3dengine.SetSourcePosition(source, emitter.Transform.Translation); source.Play(); }
public AudioSource PlayAudioEvent(GameObject emitter, BaseAudioEventInfo baseAudioEvent, bool looping = false) { var source = PlayAudioEventBase(baseAudioEvent, looping); if (source == null) { return(null); } // TODO: fix issues with some units //_3dengine.SetSourcePosition(source, emitter.Transform.Translation); source.Play(); return(source); }
private bool ValidateAudioEvent(BaseAudioEventInfo baseAudioEvent) { if (baseAudioEvent == null) { return(false); } if (!(baseAudioEvent is AudioEvent)) { // TODO return(false); } return(true); }
private AudioSource PlayAudioEventBase(BaseAudioEventInfo baseAudioEvent) { if (!ValidateAudioEvent(baseAudioEvent)) { return(null); } var audioEvent = baseAudioEvent as AudioEvent; var entry = ResolveAudioEventEntry(audioEvent); if (entry == null) { logger.Warn($"Missing Audio File: {audioEvent.Name}"); return(null); } var source = GetSound(entry, audioEvent.SubmixSlider, audioEvent.Control.HasFlag(AudioControlFlags.Loop)); source.Volume = (float)audioEvent.Volume; return(source); }