Entity Components
Rukhanka Animation separates controller evaluation, pose calculation, and rendering. Bakers convert authoring Animators, clips, rigs, and skinned meshes into ECS components and blob assets. See Runtime Architecture for system ordering.
Animator Controller System
AnimatorControllerLayerComponent is a buffer on the animated rig entity. Each element stores one controller layer's runtime state, speed, and weight. The controller advances these states; FillAnimationsFromControllerSystem then fills AnimationToProcessComponent with the clips, normalized times, masks, and weights to sample.
The layer buffer implements IEnableableComponent. Disabling it pauses controller processing for the whole rig, not just one layer. Existing submitted clip times remain unchanged unless another system modifies the submission buffer. Re-enabling it resumes controller advancement.
Animation Process System
RigDefinitionComponent identifies a rig and references its baked skeleton. It also implements IEnableableComponent. Disabling it stops pose processing, while an enabled controller can continue advancing. Re-enabling the rig can therefore jump to the controller's current pose.
AnimationToProcessComponent is the submission buffer consumed by CPU or GPU animation processing. A scripted controller can own this buffer without an Animator Controller. It must clear and refill it for each update it owns.
Use enabled-state changes to control the two stages independently:
using Rukhanka;
using Unity.Entities;
public static class AnimationEnableState
{
public static void SetControllerPaused(EntityManager entityManager, Entity rig, bool paused)
{
if (entityManager.HasBuffer<AnimatorControllerLayerComponent>(rig))
entityManager.SetComponentEnabled<AnimatorControllerLayerComponent>(rig, !paused);
}
public static void SetPoseProcessingEnabled(EntityManager entityManager, Entity rig, bool enabled)
{
if (entityManager.HasComponent<RigDefinitionComponent>(rig))
entityManager.SetComponentEnabled<RigDefinitionComponent>(rig, enabled);
}
}
Call these helpers from a system at an appropriate synchronization point. They control components already present on a rig; they do not add authoring data or create missing buffers. Disabling a rig is distinct from destroying it or disabling its renderers.
Other useful links are AnimatorEntityRefComponent on bone entities (rig entity and bone index), and SkinnedMeshRendererComponent on skinned meshes (animated rig reference and mesh blob). A bone index is specific to the baked rig and can change after an Avatar optimization mask or rig rebake. Do not cache internal frame-buffer offsets across updates.