Class AmbientGeneric
Namespace: ValveResourceFormat.Renderer.Entities
Assembly: Renderer.dll
ambient_generic. Plays one sound, either looping from the moment the map starts or fired by entity I/O. The pitch controls, dynamic presets, and LFO modulation are not simulated.
public sealed class AmbientGeneric : BaseEntityInheritance
object ← BaseEntity ← AmbientGeneric
Inherited Members
BaseEntity.Scene, BaseEntity.RootNode, BaseEntity.Transform, BaseEntity.LayerName, BaseEntity.EntitySystem, BaseEntity.Data, BaseEntity.Classname, BaseEntity.TargetName, BaseEntity.SpawnFlags, BaseEntity.ParentTransform, BaseEntity.Owner, BaseEntity.MoveParent, BaseEntity.EntityScale, BaseEntity.ModelName, BaseEntity.Origin, BaseEntity.Angles, BaseEntity.Velocity, BaseEntity.AngularVelocity, BaseEntity.NextThink, BaseEntity.MoveDoneTime, BaseEntity.IsRemoved, BaseEntity.Collider, BaseEntity.IsSolid, BaseEntity.IsTrigger, BaseEntity.IsDrawn, BaseEntity.InPlayableWorld, BaseEntity.IsCollidable, BaseEntity.TouchingEntities, BaseEntity.HasSpawnFlags<TSpawnFlags>(TSpawnFlags), BaseEntity.Spawn(), BaseEntity.Activate(), BaseEntity.Think(), BaseEntity.RoundStart(), BaseEntity.MoveDone(), BaseEntity.TryGetTouchBounds(out Vector3, out Vector3), BaseEntity.ObjectCaps, BaseEntity.Use(BaseEntity?), BaseEntity.Teleport(Vector3, Vector3?), BaseEntity.AcceptInput(string, EntityInputData), BaseEntity.SetNextThink(float), BaseEntity.SetMoveDoneTime(float), BaseEntity.GetSurfaceVelocity(Vector3), BaseEntity.AngleMod(float)
Constructors
AmbientGeneric(EntitySystem, EntitySpawnInfo)
Initializes an ambient_generic from its keyvalues.
public AmbientGeneric(EntitySystem system, EntitySpawnInfo spawnInfo)Parameters
system EntitySystem
spawnInfo EntitySpawnInfo
Properties
IsLooping
Gets whether the sound repeats until stopped.
public bool IsLooping { get; }Property Value
IsPlaying
Gets whether the sound is playing.
public bool IsPlaying { get; }Property Value
SoundName
Gets the sound event this plays, the message keyvalue.
public string? SoundName { get; }Property Value
Volume
Gets the volume, 0 to 1. Authored as health, which runs 0 to 10.
public float Volume { get; }Property Value
Methods
Activate()
Called once every entity in the map has spawned, for anything that needs to resolve other entities by name. Source's Activate.
public override void Activate()OnRemove()
Called as the entity leaves the world, before its nodes are taken out of the scene. Source's UpdateOnRemove: the place to let go of anything the entity started, such as a playing sound.
protected override void OnRemove()Spawn()
Sets up the entity: loads its model, reads class-specific keyvalues, and schedules its first think. Called by right after construction, before the entity enters the world.
public override void Spawn()StartSound()
Starts the sound, restarting it if it was already going.
public void StartSound()StopSound()
Stops the sound, fading it out first when the entity was authored to.
public void StopSound()Think()
Runs when comes due.
public override void Think()
