API ReferenceSounds
SoundEvent
Class SoundEvent
Namespace: SwiftlyS2.Shared.Sounds
Assembly: SwiftlyS2.CS2.dll
public class SoundEvent : IDisposableInheritance
Implements
Inherited Members
- object.Equals(object?)
- object.Equals(object?, object?)
- object.GetHashCode()
- object.GetType()
- object.MemberwiseClone()
- object.ReferenceEquals(object?, object?)
- object.ToString()
Constructors
SoundEvent()
public SoundEvent()SoundEvent(string, float, float)
public SoundEvent(string name, float volume = 1, float pitch = 1)Parameters
Properties
Name
The sound event name.
public string Name { get; set; }Property Value
Pitch
The pitch of the sound event.
public float Pitch { get; set; }Property Value
Recipients
The recipients of the sound event.
public ref CRecipientFilter Recipients { get; }Property Value
SourceEntityIndex
The index of the entity that this sound event is emitted from. Setting to -1 (default) will emit the sound from the recipient location.
public int SourceEntityIndex { get; set; }Property Value
Volume
The volume of the sound event.
public float Volume { get; set; }Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()Emit()
Emit the sound event.
Thread unsafe, use async variant instead for non-main thread context. Returns: The emitted sound event guid.
[ThreadUnsafe]
public uint Emit()Returns
EmitAsync()
Emit the sound event asynchronously.
public Task<uint> EmitAsync()Returns
- Task<uint> — The emitted sound event guid.
GetBool(string)
public bool GetBool(string fieldName)Parameters
- fieldName string
Returns
GetFloat(string)
public float GetFloat(string fieldName)Parameters
- fieldName string
Returns
GetFloat3(string)
public Vector GetFloat3(string fieldName)Parameters
- fieldName string
Returns
GetInt32(string)
public int GetInt32(string fieldName)Parameters
- fieldName string
Returns
GetUInt32(string)
public uint GetUInt32(string fieldName)Parameters
- fieldName string
Returns
SetBool(string, bool)
public void SetBool(string fieldName, bool value)Parameters
SetFloat(string, float)
public void SetFloat(string fieldName, float value)Parameters
SetFloat3(string, float, float, float)
public void SetFloat3(string fieldName, float x, float y, float z)Parameters
SetFloat3(string, Vector)
public void SetFloat3(string fieldName, Vector vec)Parameters
SetInt32(string, int)
public void SetInt32(string fieldName, int value)Parameters
SetSourceEntity(CEntityInstance)
public void SetSourceEntity(CEntityInstance entity)Parameters
- entity CEntityInstance
SetUInt32(string, uint)
public void SetUInt32(string fieldName, uint value)Parameters