Table of Contents

Class AnimatePresenceNode

Namespace
Velvet
Assembly
Velvet.Docs.dll

Container node that manages mount / unmount animations of its children. When keyed children become null, it does not delete them immediately and retains them until the exit animation completes. Children should preferably be MotionNode. Non-MotionNode children (e.g. ElementNode) also work as transition-less (immediate deletion), but a Debug.LogWarning is emitted because they are not animation targets. TextNode is skipped without a warning. Note: FragmentNode cannot be included directly as a child (it is not expanded). Use MotionNode or a direct VNode. Children without a key receive a position-based automatic key, so reordering can cause unintended exit / enter animations. Set explicit keys on children that participate in animation.

public sealed class AnimatePresenceNode : VNode
Inheritance
object
AnimatePresenceNode
Inherited Members

Properties

Children

Array of child nodes. May include MotionNode. Null children are treated as removed.

DelayChildrenSec

A fixed delay (seconds) added before ANY child animates. Combined with the per-child stagger: child i is delayed by DelayChildrenSec + StaggerSec * staggerIndex(i).

Initial

When false, the enter animation on initial mount is skipped. Defaults to true (animate on initial mount as well).

Mode

Exit / enter sequencing. Defaults to Sync (exit and enter overlap). Wait holds a brand-new child back until in-flight exits finish. PopLayout pulls an exiting child out of flow so siblings reflow around it immediately.

OnExitComplete

Invoked once when every in-flight exit animation has finished (the exiting set empties). Not fired when an exit is cancelled by the key re-entering, nor for children removed without an exit animation.

StaggerDirection

Direction the stagger sweeps. 1 (default) staggers first-to-last; -1 staggers last-to-first (the last child animates first).

StaggerSec

Delay interval (seconds) applied sequentially to children's enter animations. The i-th child receives an additional delay of StaggerSec * i. 0 (default) means no stagger (all children start animating simultaneously).

Methods

StaggerDelaySec(int, int)

The total additional delay for the child at index of count siblings: DelayChildrenSec plus the stagger offset, swept per StaggerDirection.