Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Context

Provides access to visualization data and features for a graph.
Read time 2 minutesLast updated 7 days ago

Definition

public sealed class Context : IDisposable

Remarks

Create a Context through Registry.CreateVisualizationContext. The context remains valid until you call Context.Dispose. While the context is alive, you can apply visualization changes to graph elements (retrieved as references) in the associated graph. Each context has a unique Context.VisualizationContextID assigned at creation, which lets you distinguish ownership when multiple consumers operate on the same graph. Disposing the context unregisters it from the Registry and clears any visualization data added through it.
Additional Resources: Registry, GraphMotion
Create a visualization context for a graph, retrieve a port reference from it, and set a port preview value. The using statement ensures the context is disposed when no longer needed.

Examples

using Context context = Registry.CreateVisualizationContext(graphID);PortReference port = context.GetPortReference(portUID);port.SetPreview("42.0");

Properties

Property

Description

ConditionCustomizationEnabledWhether the condition customization feature is enabled for this visualization context. Enabled by default.
IsGraphLoadedIndicates whether the graph identified by the associated Graph.ID is currently loaded.
IsValidIndicates whether this context can still be used. The value becomes false after Context.Dispose is called.
MotionThe animation system used to drive animations on graph elements in this visualization context.
NodeCustomizationEnabledWhether the node customization feature is enabled for this visualization context. Enabled by default.
PortPreviewEnabledWhether the port preview feature is enabled for this visualization context. Enabled by default.
StateCustomizationEnabledWhether the state customization feature is enabled for this visualization context. Enabled by default.
TransitionCustomizationEnabledWhether the transition customization feature is enabled for this visualization context. Enabled by default.
VisualizationContextIDThe unique identifier for this context.
WireCustomizationEnabledWhether the wire customization feature is enabled for this visualization context. Enabled by default.

Methods

Method

Description

ClearAllVisualizationClears all visualization data associated with this context.
DisposeReleases this context and clears all associated visualization data.
GetConditionReferenceReturns a ConditionReference that identifies the condition with the given ID within this visualization context.
GetNodeReferenceReturns a NodeReference that identifies the node with the given ID within this visualization context.
GetPortReferenceRetrieves a reference to a port in the graph associated with this context, using the port's unique identifier.
GetStateReferenceReturns a StateReference that identifies the state with the given ID within this visualization context.
GetTransitionReferenceReturns a TransitionReference that identifies the transition with the given ID within this visualization context.
GetWireReferenceReturns a WireReference that identifies the node with the given ID within this visualization context.