コード例 #1
0
ファイル: LiveEntity.cs プロジェクト: BenjaBobs/Hubris
        /// <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
ファイル: LiveEntity.cs プロジェクト: BenjaBobs/Hubris
 /// <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);
 }