Table of Contents

Class AnimationSound

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

A sound that should play alongside an animation. Open in GitHub

[DocumentAsJson]
public class AnimationSound
Inheritance
AnimationSound
Inherited Members
Extension Methods

Fields

Attributes

[JsonIgnore]
public SoundAttributes Attributes

Field Value

SoundAttributes

Chance

The chance to play this sound.

[DocumentAsJson("Optional", "1", false)]
public float Chance

Field Value

float

Frame

The sound will play when this frame is reached. Should be set if Looping is false.

[DocumentAsJson("Recommended", "0", false)]
public int Frame

Field Value

int

Looping

Should this sound loop whilst the animation is playing?

[DocumentAsJson("Optional", "False", false)]
public bool Looping

Field Value

bool

Methods

Clone()

public AnimationSound Clone()

Returns

AnimationSound

CreateFromBytes(BinaryReader, string)

[Obsolete("Prefer using the BinarySpanReader overload.")]
public static AnimationSound CreateFromBytes(BinaryReader reader, string version)

Parameters

reader BinaryReader
version string

Returns

AnimationSound

CreateFromBytes(ref BinarySpanReader, string)

public static AnimationSound CreateFromBytes(ref BinarySpanReader reader, string version)

Parameters

reader BinarySpanReader
version string

Returns

AnimationSound

OnDeserialized(StreamingContext)

[OnDeserialized]
protected void OnDeserialized(StreamingContext context)

Parameters

context StreamingContext

ToBytes(BinaryWriter)

public void ToBytes(BinaryWriter writer)

Parameters

writer BinaryWriter