KROYSDOCS
HomeWhat's newv0.1.0
SCRIPTING API / Animation / AnimationEvent

AnimationEvent

Data sent to scripts when an animator crosses an animation event marker during playback.

Kindstruct
NamespaceKroys.EngineScripting
Members13
SourceAnimationEvent.cs
DECLARATION

Declaration

Namespace Kroys.EngineScripting.

Declaration
public readonly struct AnimationEvent
REFERENCE

Members

Constructors
#public AnimationEvent( string name, float timeSeconds, float normalizedTime, bool hasPayload, float payload, string stringPayload, string functionName, int actionType, ulong audioClipHandle, float audioVolume, bool audioSpatial, string particleTargetName)
Creates an event record (the engine creates them when an animator crosses a marker).
constructor
Properties
#public string Name { get; }
Event marker name, for example Footstep or GunFire.
property
#public float TimeSeconds { get; }
Event marker time in seconds within the clip or state timeline.
property
#public float NormalizedTime { get; }
Event marker time normalized by the clip duration.
property
#public bool HasPayload { get; }
True when the event has a numeric payload.
property
#public float Payload { get; }
Optional numeric payload configured on the event.
property
#public string StringPayload { get; }
Optional text payload configured on the event.
property
#public string FunctionName { get; }
Optional function label configured on the event.
property
#public int ActionType { get; }
Built-in event action type. 0 = script only, 1 = play audio, 2 = trigger particles, 3 = both.
property
#public ulong AudioClipHandle { get; }
Native asset handle of the audio clip assigned to the event, or zero when none is assigned.
property
#public float AudioVolume { get; }
Volume used by the built-in audio action.
property
#public bool AudioSpatial { get; }
True when the built-in audio action should be spatialized from the animator entity.
property
#public string ParticleTargetName { get; }
Optional particle emitter entity name used by the built-in particle action. Empty means the animator entity or its children.
property
Signatures
public AnimationEvent( string name, float timeSeconds, float normalizedTime, bool hasPayload, float payload, string stringPayload, string functionName, int actionType, ulong audioClipHandle, float audioVolume, bool audioSpatial, string particleTargetName)
public string Name { get; }
public float TimeSeconds { get; }
public float NormalizedTime { get; }
public bool HasPayload { get; }
public float Payload { get; }
public string StringPayload { get; }
public string FunctionName { get; }
public int ActionType { get; }
public ulong AudioClipHandle { get; }
public float AudioVolume { get; }
public bool AudioSpatial { get; }
public string ParticleTargetName { get; }

KroysEngine 0.1.0 documentation, built from the engine repository by Tools/BuildDocsSite.py.