/// <summary> /// Emit the sound event passed as an arguement /// </summary> public virtual void EmitSoundEvent(SoundEvent ev) { if (HubrisCore.Instance == null) { Debug.LogError($"LiveEntity {this.gameObject.name} can't emit an event, HubrisCore is null"); return; } // Shouldn't be emitting sounds if we're dead or invisible if (Stats.IsDead || Stats.Invisible) { return; } HubrisCore.Instance.BroadcastSoundEvent(ev); }
public void BroadcastSoundEvent(SoundEvent ev) { AcSoundEvent?.Invoke(ev); }
/// <summary> /// Public interface for a sound emitter to make this entity aware of a sound event /// </summary> public virtual void AddSoundEvent(SoundEvent ev) { _soundEventList.Add(ev); }