RSX Code Reference
    Preparing search index...
    • rsx
    • CarbonStateGraph

    Class CarbonStateGraph

    The CarbonStateGraph class implements a CarbonGraph that can be used to create state based behaviors.

    Hierarchy (View Summary)

    Index
    _isEnabling: true
    comments: GraphComment[]

    All GraphComment objects to display in the editor for this Graph

    isValidationCritical: boolean

    The status of the validation, undefined until validate was called.

    nodes: GraphNode[]

    All GraphNode objects registerded with this graph.

    userData: Map<string, any>

    A Map suitable for storing custom user-defined data.

    validationStatus: Map<GraphObject, string>

    The status of the validation since the last call to validate.

    variables: GraphVariable[]

    All GraphVariable objects registered with this graph.

    viewportPosition: Vector2

    Determines the panning position of the user has last moved the graph canvas to.

    viewportZoomScale: number

    Determines the zoom scale of the user has the graph canvas at.

    controlFlowInputPinName: "CF[In]"
    controlFlowOutputPinName: "CF[Out]"
    • get defaultVariableType(): Type
      Virtual

      Gets the default type of a newly constructed empty variable.

      Returns Type

    • get isDestroyed(): boolean

      Determines if the resource is destroyed.

      Returns boolean

      This can happen when the Resource was forcefully unloaded or reverted. For this reason, it is safer to hold on to a instead of directly referencing a resource pointer, as the current Resource can always be retrieved via .value.

    • get name(): string

      Name of the resource. Use primarily for easier identification and not important to the engine itself.

      Returns string

    • get uuid(): UUID

      Returns a universally unique identifier of this resource.

      Returns UUID

    • Adds a new comment to the graph.

      Parameters

      • region: Immutable<Rect2>

        The region to create the new comment on, including the origin and it's size.

      • title: string

        A string that represents the title for the comment.

      • Optionaldescription: string

        A string that represents a description for the comment.

      Returns GraphComment

      The newly created commented object.

    • Adds the specified GraphVariable.

      Parameters

      Returns boolean

      true if the variable was added, false on error.

      If a variable with the same name already exists, a suffix will be appened.

    • Duplicates the resource and creates a unique UUID for the duplicated resource.

      Returns Resource

      The duplicated resource or null, if the duplication failed.

    • Invoken when the graph was deserialized and objects need to be enabled. This typically entails restoring object pointers that cannot be serialized.

      Returns void

    • Virtual

      Method called by RSX to perform any operations needed after deserialization.

      Returns void

      Use this API to restore your serializable data into live objects.

    • Virtual

      Method called by RSX to disable the resource.

      Returns void

      Use this API to deactivate the resource before it is serialized.

    • Virtual

      Method called by RSX to enable the resource.

      Returns void

      Use this API to activate the resource after it has been disabled by serialization.

    • Virtual

      Method called by RSX to perform initialization of the resource.

      Parameters

      Returns void

      Use this API to initialize data and default construct all fields.

    • Virtual

      Method called by RSX to perform any operations before serialization.

      Returns void

      Use this API to bake your live data into serializable data.

    • Reverts the resource to the on-disk representation.

      Returns boolean

      This is a potentially expensive call, as it needs to deserialize and replace all existing in-memory resource handles.

    • Forcefully unloads the resource.

      Returns void

    • Virtual

      Ensures that the state of the graph is valid.

      Returns void

      Implementing classes must call super. The method is typically called after deserialization or major edits to the graph. If validation fails, error information must be added to the validationStatus map.

    An event called when a change on the graph was made.

    An event called when a change on the graph was made.

    onNodeAdded: Event<[GraphNode]>

    An event called whenever a new GraphNode is added.

    onNodeRemoved: Event<[GraphNode]>

    An event called whenever a GraphNode is removed.

    onConnectionAdded: Event<[GraphConnection]>

    An event called whenever a new connection was made.

    onConnectionRemoved: Event<[GraphConnection]>

    An event called whenever a connection is removed.

    onVariableAdded: Event<[GraphVariable]>

    An event called whenever a new GraphVariable is added.

    onVariableRemoved: Event<[GraphVariable]>

    An event called whenever a new GraphVariable was removed.

    onVariableChanged: Event<[GraphVariable]>

    An event called whenever a new GraphVariable was changed, e.g. name, type or meta-data.

    onVariableDefaultValueChanged: Event<[GraphVariable]>

    An event called whenever a new GraphVariable was default value changed.

    onCommentAdded: Event<[GraphComment]>

    An event called whenever a new GraphComment is added.

    onCommentRemoved: Event<[GraphComment]>

    An event called whenever a new GraphComment was removed.

    onValidationError: Event<[Map<GraphObject, string>]>

    An event called whenever validation resulted in errors.

    onExecutionConnectionVisited: Event<[GraphConnection, GraphExecutionState]>

    An event called whenever a connection was visited by the execution.

    onExecutionRootVisited: Event<[GraphNode, GraphExecutionState]>

    An event called whenever a root node was visited by the execution.