Scripting API

Scripting API

AnimationEventAttribute

Class in Abyss.Core, from Abyss.Core.

Marks a plain-data struct as an event a clip can fire: placed on a clip's timeline in its model's inspector, its fields filled in there, and read by a game's systems as the clip passes it.

public sealed class AnimationEventAttribute : Attribute

Remarks

Described as a component is, by the same generator: its fields measured rather than written down, flattened with dotted names, and shown as [Range], [Tooltip] and [HideInInspector] say. It is registered with the world as a component nothing carries, so an inspector edits its fields with the widgets a component's get; Add Component never lists it.

Kept by its name. A clip's events are written into its model's import settings by the type's name, and its fields by theirs, as a scene keeps a component, so renaming the struct leaves the events on clips naming the old one. The struct must be partial.

[AnimationEvent][StructLayout(LayoutKind.Sequential)]public partial struct Footstep{    public Foot Foot;    [Range(0f, 1f)] public float Volume;}
foreach (Fired<Footstep> step in context.Events<Footstep>()){    Sounds.Play(step.Animator, step.Event.Foot, step.Event.Volume);}

Properties

Name

public string? Name { get; set; }

The name a clip's events name it by; defaults to the type name.