SwiftlyS2

SoundEvent

Class SoundEvent

Namespace: SwiftlyS2.Shared.Sounds

Assembly: SwiftlyS2.CS2.dll

public class SoundEvent : IDisposable

Inheritance

Implements

Inherited Members

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

GetBool(string)

public bool GetBool(string fieldName)
Parameters
Returns

GetFloat(string)

public float GetFloat(string fieldName)
Parameters
Returns

GetFloat3(string)

public Vector GetFloat3(string fieldName)
Parameters
Returns

GetInt32(string)

public int GetInt32(string fieldName)
Parameters
Returns

GetUInt32(string)

public uint GetUInt32(string fieldName)
Parameters
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

SetUInt32(string, uint)

public void SetUInt32(string fieldName, uint value)
Parameters

On this page