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
Fields
Location (Required)
The location of the sound file.
[DocumentAsJson("Required", "", false)]
[JsonProperty]
private AssetLocation Location { set; }
Field Value
Frame (Recommended) (Default: 0)
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
Chance (Optional) (Default: 1)
The chance to play this sound.
[DocumentAsJson("Optional", "1", false)]
public float Chance
Field Value
Looping (Optional) (Default: False)
Should this sound loop whilst the animation is playing?
[DocumentAsJson("Optional", "False", false)]
public bool Looping
Field Value
Path (Optional)
Alternative form for Location.
[DocumentAsJson("Optional", "", false)]
[JsonProperty]
private AssetLocation Path { set; }
Field Value
Pitch (Optional) (Default: 1)
Controls a random pitch for the sound.
[DocumentAsJson("Optional", "1", false)]
[JsonProperty]
private NatFloat Pitch { set; }
Field Value
RandomizePitch (Optional) (Default: False)
If true, sets the pitch to be randomized on sound play between 0.75 and 1.25. If false, the pitch will be 1. If not set, then the pitch is provided by Pitch.
[DocumentAsJson("Optional", "False", false)]
[JsonProperty]
private bool RandomizePitch { set; }
Field Value
Range (Optional) (Default: 32)
At this many meters away, the sound will be 1% of the volume.
[DocumentAsJson("Optional", "32", false)]
[JsonProperty]
private float Range { set; }
Field Value
Volume (Optional) (Default: 1)
Controls a random volume for the sound.
[DocumentAsJson("Optional", "1", false)]
[JsonProperty]
private NatFloat Volume { set; }