Class CaveMusicTrack
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
Represent a dynamically composed track made out of individual small pieces of music mixed together defined by specific rules Requirements:
- Start/Stop Multiple Trackpieces
- Set their volumne dynamically
- Decide which Trackpieces to play
- Allow individual rules per Trackpiece Specific examples:
- Play Thunder ambient only if thunderlevel above 10
- Thunder ambient volume based on thunderlevel (between 0.3 and 1.1?)
- Play Aquatic Drone only when y below 60
- Play Deep Drone only when y below 50 Open in GitHub
[JsonObject(MemberSerialization.OptIn)]
public class CaveMusicTrack : IMusicTrack
- Inheritance
-
CaveMusicTrack
- Implements
- Inherited Members
- Extension Methods
Fields
ShouldPlayCaveMusic
public static bool ShouldPlayCaveMusic
Field Value
Properties
IsActive
Is the track active?
public bool IsActive { get; }
Property Value
Name
The name of the music track.
public string Name { get; }
Property Value
PositionString
public string PositionString { get; }
Property Value
StartPriority
The start priority of the track. A higher priority will leave active tracks playing.
public float StartPriority { get; }
Property Value
Methods
BeginPlay(TrackedPlayerProperties)
Starts playing the track.
public void BeginPlay(TrackedPlayerProperties props)
Parameters
propsTrackedPlayerPropertiesThe properties of the current track.
BeginSort()
Called before sorting by start priority happens
public void BeginSort()
ContinuePlay(float, TrackedPlayerProperties)
Do we continue playing this track?
public bool ContinuePlay(float dt, TrackedPlayerProperties props)
Parameters
dtfloatDelta time or Change in time
propsTrackedPlayerPropertiesThe properties of the current track.
Returns
- bool
Are we still playing or do we stop?
FadeOut(float, Action)
Fade out the track to end.
public void FadeOut(float seconds, Action onFadedOut = null)
Parameters
secondsfloatSeconds to fade out across.
onFadedOutActionDelegate to have happen once the fade-out is done.
FastForward(float)
public void FastForward(float seconds)
Parameters
secondsfloat
Initialize(IAssetManager, ICoreClientAPI, IMusicEngine)
Initializes the music track
public void Initialize(IAssetManager assetManager, ICoreClientAPI capi, IMusicEngine musicEngine)
Parameters
assetManagerIAssetManagerthe global Asset Manager
capiICoreClientAPIThe Core Client API
musicEngineIMusicEngine
ShouldPlay(TrackedPlayerProperties, ClimateCondition, BlockPos)
Should the game play this track?
public bool ShouldPlay(TrackedPlayerProperties props, ClimateCondition conds, BlockPos pos)
Parameters
propsTrackedPlayerPropertiesThe properties of the current track.
condsClimateConditionposBlockPos
Returns
- bool
Do we play this track?
UpdateVolume()
Updates the volume of the track.
public void UpdateVolume()