Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

GraphMotion.Play

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void Play(WireReference wire, float animationSpeed);

Parameters

Parameter Description
wire The wire on which to play the animation.
animationSpeed Speed multiplier for the animation. Higher values move the animated segment faster.

Description

Starts a looping animation on the referenced wire.

Throws ArgumentException when wire doesn't correspond to a wire in the current Context.

Start a flow animation on a wire to highlight an active data path through the graph at the default speed.

 WireReference wire = context.GetWireReference(outputPortID, inputPortID);
 context.Motion.Play(wire);

Declaration

public void Play(TransitionReference transition, float animationSpeed);

Parameters

Parameter Description
transition The transition on which to play the animation.
animationSpeed Speed multiplier for the animation. Higher values move the animated segment faster.

Description

Starts a looping animation on the referenced transition.

On a transition between two states, the animation sweeps a gradient band along the transition wire. On a self transition, the animation sweeps the same gradient band around the transition arrow's border. Throws ArgumentException when transition doesn't correspond to a transition in the current Context.

Start a flow animation on a transition to highlight an active state machine path at the default speed.

 TransitionReference transitionRef = context.GetTransitionReference(transitionID);
 context.Motion.Play(transitionRef);

Declaration

public void Play(NodeReference node, float animationSpeed);

Parameters

Parameter Description
node The node on which to play the animation.
animationSpeed Speed multiplier for the animation. Higher values move the animated segment faster. The default value is 1.

Description

Starts a looping animation on the referenced node's accent.

The animation loops indefinitely until you call GraphMotion.Stop or GraphMotion.Pause. While the animation plays, the accent bar overrides any fill amount previously set through NodeReference.FillAmount or the node model's FillAmount property. Call GraphMotion.Play again on the same node after GraphMotion.Pause to resume the animation at the new speed. Throws ArgumentException when node doesn't correspond to a node in the current Context.

 NodeReference nodeRef = context.GetNodeReference(nodeID);
 context.Motion.Play(nodeRef);

Declaration

public void Play(StateReference state, float animationSpeed);

Parameters

Parameter Description
state The state on which to play the animation.
animationSpeed Speed multiplier for the animation. Higher values move the animated segment faster. The default value is 1.

Description

Starts a looping animation on the referenced state's accent.

The animation loops indefinitely until you call GraphMotion.Stop or GraphMotion.Pause. While the animation plays, the accent bar overrides any fill amount previously set through StateReference.FillAmount or the state's IState.FillAmount property. Call GraphMotion.Play again on the same state after GraphMotion.Pause to resume the animation at the new speed. Throws ArgumentException when state doesn't correspond to a state in the current Context.

 StateReference stateRef = context.GetStateReference(stateID);
 context.Motion.Play(stateRef);