Click or drag to resize
DigitalRuneAnimationControllerRecycle Method
Recycles the animation instances associated with this controller.

Namespace: DigitalRune.Animation
Assembly: DigitalRune.Animation (in DigitalRune.Animation.dll) Version: 1.4.0.0 (1.4.1.14427)
Syntax
public void Recycle()

Field Value

Type: 
if the animation instance is recycled automatically; otherwise, . (The property also returns if the animation instance has already been recycled and the animation controller is no longer valid.)
Remarks

Objects of type AnimationInstance are automatically created when a new animation controller is created. The animation instances maintain the runtime-state of the animations. The animation instances can be recycled when they are no longer used. They can then be reused by the animation system for future animations.

It is recommended to recycle animation instances in order to reduce the number of memory allocations at runtime. Animation instances can be recycled explicitly by calling Recycle. Or, they can be recycled automatically by calling AutoRecycle or setting the property AutoRecycleEnabled to . If AutoRecycleEnabled is set, then the animation system will automatically recycle the animation instances once the animation has stopped.

The method Recycle can be called at any time, regardless of whether AutoRecycleEnabled is set. The property AutoRecycleEnabled can also be changed at any time - it will only take effect when the animation stops.

Once the animation instance has been recycled the struct AnimationController becomes invalid. The property IsValid indicates whether the animation instance is still alive or has already been recycled.

Note that calling the methods Recycle, AutoRecycle, or setting the property AutoRecycleEnabled has no effect if the animation controller is invalid.

See Also