GraphMotion
Animation system for elements displayed in the graph canvas of a visualization Context.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Class
- Namespace: Unity.GraphToolkit.Editor.GraphVisualization
- Assembly: UnityEditor
public sealed class GraphMotion
Remarks
Obtain an instance from Context.Motion. Each method targets a graph element identified by a reference produced by the same Context. The owning context scopes animations: stopping or pausing through one GraphMotion instance only affects the graph elements referenced by that instance. Call GraphMotion.Play after GraphMotion.Pause to resume the looped animation.
Additional Resources: Context.Motion
Examples
NodeReference nodeRef = context.GetNodeReference(nodeID);// Start a looping animation on the node.context.Motion.Play(nodeRef);// Pause it without hiding the accent bar.context.Motion.Pause(nodeRef);// Resume the animation at a faster speed.context.Motion.Play(nodeRef, animationSpeed: 2f);// Stop the animation. If a FillAmount was set, the bar remains visible at that fill.context.Motion.Stop(nodeRef);