Skip to content
smartargs
VantageDocumentation

Presentation reference

The component that plays cues on a unit, the cue data authored on abilities, buffs and unit definitions, and the API for playing a cue at a point. For how to use it, see Presentation.

VtUnitPresenter

Component. Add it with Add Component → Vantage → Presentation → VtUnitPresenter. Adds VtUnit automatically.

Plays the presentation cues authored on abilities, buffs and the unit definition when the matching gameplay event fires: cast start and cast, the impact of an ability on its target, being hit, dying, reviving, and buffs applied and removed. One component on the unit prefab replaces the per-event wiring every game otherwise writes.

Inspector fields

Field Type Default Description
Animator (animator) Animator None Animator that receives the cue triggers. Empty = first Animator in the children.
Audio Source (audioSource) AudioSource None Plays cue sounds. Empty = first AudioSource in the children, else a one-shot at the unit’s position.
Vfx Anchor (vfxAnchor) Transform None Where effect prefabs spawn. Empty = this transform.
Dead Bool Parameter (deadBoolParameter) string "Dead" Animator bool set true on death and false on revive. Empty = not set.

Scripting API

Member Description
event Action<VtPresentationCue, GameObject> OnCuePlayed Fires after a cue was played: the cue and the spawned effect, or null.
void Initialize() Find the unit’s components and start listening for its events. Runs on its own when the component wakes up; call it after adding the component from code. Safe to call more than once.
GameObject Play(in VtPresentationCue cue) Play cue on this unit now. Returns the spawned effect, or null.

VtAutoDestroy

Component. Add it with Add Component → Vantage → Presentation → VtAutoDestroy.

Destroys its GameObject after seconds. Added to effect prefabs spawned from a VtPresentationCue with a lifetime.

Inspector fields

Field Type Default Range Description
Seconds (seconds) float 1 ≥ 0 Seconds until the object is destroyed.

VtPresentationCue

Serializable struct.

What to show and play at one gameplay moment: an animator trigger, a sound and an effect prefab, each optional. Authored on abilities, buffs and unit definitions; VtUnitPresenter plays them when the matching event fires. Gameplay never reads a cue.

Inspector fields

Field Type Default Range Description
Animator Trigger (animatorTrigger) string Empty Animator trigger parameter to set. Empty = none.
Sound (sound) AudioClip None Sound played once at the unit. Empty = none.
Vfx Prefab (vfxPrefab) GameObject None Effect prefab spawned at the unit’s effect anchor. Empty = none.
Vfx Seconds (vfxSeconds) float 0 ≥ 0 Seconds until the spawned effect is destroyed. 0 = the prefab manages its own lifetime.
Scale To Area (scaleToArea) bool Off Area cues only: scale the effect’s width and depth by the area radius. Author the prefab for a radius of 1.

Scripting API

Member Description
bool IsEmpty { get; } True when the cue has nothing to play.

VtPresentation

Static class.

Plays a VtPresentationCue at a point in the world instead of on a unit: where an area ability lands, or each pulse of a lingering ground effect. The sound plays at the point and the effect prefab spawns there, scaled to the area when the cue has VtPresentationCue.scaleToArea on. Animator triggers are ignored because there is no unit.

Scripting API

Member Description
static event Action<VtPresentationCue, Vector3, float> OnPlayedAt Fires after a cue played at a point: the cue, the point and the area radius, or 0.
static GameObject PlayAt(in VtPresentationCue cue, Vector3 position, float areaRadius = 0f) Play cue at position. Returns the spawned effect, or null.