API

Class FlowGraphExperimental

Class used to represent a flow graph. A flow graph is a graph of blocks that can be used to create complex logic. Blocks can be added to the graph and connected to each other. The graph can then be started, which will init and start all of its event blocks.

FlowGraph is still in development and is subject to change.

Index
metadata?: any

Optional host-format metadata associated with this graph.

name: string

A human-readable name for this graph.

onStateChangedObservable: Observable<FlowGraphState> = ...

An observable that is triggered when the state of the graph changes.

uniqueId: string

A unique identifier for this graph. Auto-generated if not provided.

EditorURL: string = ...

Define the URL to load the flow graph editor script from.

  • get sceneEventCoordinator(): FlowGraphSceneEventCoordinator
    Experimental

    The scene event coordinator for this graph. Provides access to runtime event state such as currently pressed keys.

    Returns FlowGraphSceneEventCoordinator

  • Experimental

    Register a block with the graph. This does not wire any connections; it simply ensures the block is tracked so that serialization, editor display, and validation see it even when it is not reachable from an event block.

    Parameters

    Returns void

  • Experimental

    Serializes a graph

    Parameters

    • serializationObject: any = {}

      the object to write the values in

    • OptionalvalueSerializeFunction: (key: string, value: any, serializationObject: any) => void

      a function to serialize complex values

    Returns void

  • Experimental

    Sets a new scene for this flow graph, re-wiring all event listeners. This is useful when the scene the flow graph should listen to changes (e.g. when a new scene is loaded in an editor preview). If the graph is currently running, it will be stopped first and must be restarted manually after calling this method.

    Parameters

    • scene: Scene

      the new scene to attach to

    Returns void