public void Stop(Tags p_tag) { if (!_dictAudioTriggers.ContainsKey(p_tag)) { Debug.LogWarning($"Trigger for tag '{p_tag}' does not exist."); return; } AudioTrigger __trigger = _dictAudioTriggers[p_tag]; __trigger.Node?.Cancel(); }
public void Play(Tags p_tag) { if (!_dictAudioTriggers.ContainsKey(p_tag)) { Debug.LogWarning($"Trigger for tag '{p_tag}' does not exist."); return; } AudioTrigger __trigger = _dictAudioTriggers[p_tag]; __trigger.Node?.Cancel(); SoundNode __node = Sound.Play2DSound(__trigger.GetRandomClip(), __trigger.isLoop, GetVolumeForLayer(__trigger.layer), __trigger.layer); __trigger.SetNode(__node); }