예제 #1
0
        /// <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);
        }
예제 #2
0
 public void BroadcastSoundEvent(SoundEvent ev)
 {
     AcSoundEvent?.Invoke(ev);
 }
예제 #3
0
 /// <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);
 }