AnimatedProperty<TJob, TValue> Class

Summary

[Pro-Only] A base wrapper which allows access to the value of properties that are controlled by animations.
Assembly
Animancer.dll
Namespace
Animancer
Interfaces
  • IDisposable
Base Types
Derived Types
graph BT Type-->Base0["AnimancerJob<TJob>"] Base0-->Base1["Object"] Type-.->Interface0["IDisposable"] Type["AnimatedProperty<TJob, TValue>"] class Type type-node Derived0["AnimatedFloat"]-->Type click Derived0 "/animancer/api/Animancer/AnimatedFloat" Derived1["AnimatedInt"]-->Type click Derived1 "/animancer/api/Animancer/AnimatedInt" Derived2["AnimatedBool"]-->Type click Derived2 "/animancer/api/Animancer/AnimatedBool"

Syntax

public abstract class AnimatedProperty<TJob, TValue> : AnimancerJob<TJob>, IDisposable 
    where TJob : struct, IAnimationJob where TValue : struct

Examples

Example: Animation Jobs

Type Parameters

Name Description
TJob
TValue

Constructors

Name Summary
AnimatedProperty(IAnimancerComponent, int, NativeArrayOptions) Allocates room for a specified number of properties to be filled by InitialiseProperty(int, Transform, Type, string).
AnimatedProperty(IAnimancerComponent, string) Initialises a single property.
AnimatedProperty(IAnimancerComponent, string[]) Initialises a group of properties.

Fields

Name Constant Value Summary
_Properties
The properties wrapped by this object.
_Values
The value of each of the Animancer.AnimatedProperty`2._Properties from the most recent update.

Properties

Name Value Summary
this[int] TValue
Returns the value of the property at the specified `index`.
Value TValue
Returns the value of the first property.

Methods

Name Value Summary
CreateJob() void
Creates and assigns the AnimancerJob._Job.
Destroy() void
Destroys the _Playable and restores the graph connection it was intercepting.
Dispose() void
Called by Animancer.AnimancerPlayable.OnPlayableDestroy(UnityEngine.Playables.Playable) to clean up the Unity.Collections.NativeArray`1s.
GetValue(int) TValue
Returns the value of the property at the specified `index`.
GetValues() TValue[]
Returns a new array containing the values of all properties.

Use Animancer.AnimatedProperty`2.GetValues(`1[]@) to avoid allocating a new array every call.
GetValues(TValue[]) void
Resizes the `values` if necessary and copies the value of each property into it.
InitialiseProperty(Animator, int, string) void
Initialises a property on the target UnityEngine.Animator.
InitialiseProperty(Animator, int, Transform, Type, string) void
Initialises the specified `index` to read a property with the specified `name`.

Operators

Name Value Summary
implicit operator TValue(AnimatedProperty<TJob, TValue>) TValue