Class LiveLink<T>
Live link is used by a device to set the properties of an actor.
Implements
Namespace: Unity.LiveCapture
Assembly: Unity.LiveCapture.dll
Syntax
[Serializable]
[Obsolete("Override LiveCaptureDevice.LiveUpdate to set properties to the actors in the scene.")]
public abstract class LiveLink<T> : ILiveLink where T : struct, IAnimationJob
Type Parameters
Name | Description |
---|---|
T | The animation job used to apply the animated properties. |
Remarks
The playable API is used to create a playable that uses an animation job to sets an actor's properties, which it injects as an output on a playable graph. This allows using a timeline to drive some or all of the actor's properties without needing to modify the timeline asset.
Methods
Build(PlayableGraph)
Rebuilds the live link using the specified PlayableGraph.
Declaration
public void Build(PlayableGraph graph)
Parameters
Type | Name | Description |
---|---|---|
PlayableGraph | graph | The PlayableGraph to drive the live link from. |
CreateAnimationJob(Animator)
Called to create the animation job used to output a take to the actor via the animator.
Declaration
protected abstract T CreateAnimationJob(Animator animator)
Parameters
Type | Name | Description |
---|---|---|
Animator | animator | The animator the job must output to. |
Returns
Type | Description |
---|---|
T | The new job. |
GetAnimator()
Gets the animator the live link outputs to.
Declaration
public Animator GetAnimator()
Returns
Type | Description |
---|---|
Animator | The animator component. |
IsActive()
Gets if the live link is configured to output to the actor's properties.
Declaration
public bool IsActive()
Returns
Type | Description |
---|---|
bool | True if output is enabled; false otherwise. |
IsValid()
Checks if the playables driving the live link are valid.
Declaration
public bool IsValid()
Returns
Type | Description |
---|---|
bool | true if valid; otherwise, false. |
SetActive(bool)
Sets if the live link outputs to the actor's properties.
Declaration
public void SetActive(bool value)
Parameters
Type | Name | Description |
---|---|---|
bool | value | True to enable output; false to disable output. |
SetAnimator(Animator)
Sets the animator the live link outputs to.
Declaration
public void SetAnimator(Animator animator)
Parameters
Type | Name | Description |
---|---|---|
Animator | animator | The animator to use, or null to clear the assigned animator. |
Update()
Updates the live link output.
Declaration
public void Update()
Update(T)
Called to update the contents of the animation job from the current take evaluation.
Declaration
protected abstract T Update(T jobData)
Parameters
Type | Name | Description |
---|---|---|
T | jobData | The animation job to update. |
Returns
Type | Description |
---|---|
T | The updated job. |