docs.unity.cn
    Show / Hide Table of Contents

    Class GraphGenerator

    GraphGenerator API to generate SystemGraph assets from scripts.

    Inheritance
    Object
    GraphGenerator
    Namespace: Mechatronics.SystemGraph
    Syntax
    public class GraphGenerator

    Methods

    AddComment(GraphDescriptor, String, String)

    Add a comment in the Graph

    Declaration
    public static CommentDescriptor AddComment(GraphDescriptor desc, string displayName, string contents)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    String displayName

    The DisplayName title of the comment

    String contents

    The description content of the comment

    Returns
    Type Description
    CommentDescriptor

    Returns a new CommentDescriptor

    AddDynamicPort(GraphDescriptor, NodeDescriptor, String, Type, PortDirection, FieldExtra)

    Add a dynamic port on a node

    Declaration
    public static PortDescriptor AddDynamicPort(GraphDescriptor desc, NodeDescriptor node, string portName, Type portType, PortDirection direction, FieldExtra extra)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    NodeDescriptor node

    The node on which to add a Port

    String portName

    The name of the port

    Type portType

    The type of the Port to add

    PortDirection direction

    The direction of the port on the node

    FieldExtra extra

    The extra field information to attribute to this Port

    Returns
    Type Description
    PortDescriptor

    Returns a new PortDescriptor

    AddEdge(GraphDescriptor, PortDescriptor, PortDescriptor, SystemEdge)

    Add an edge between two ports

    Declaration
    public static EdgeDescriptor AddEdge(GraphDescriptor desc, PortDescriptor fromPort, PortDescriptor toPort, SystemEdge edgeVisual = null)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    PortDescriptor fromPort

    The source port to connect

    PortDescriptor toPort

    The destination port to connect

    SystemEdge edgeVisual

    Edge visual element to assign to the new edge

    Returns
    Type Description
    EdgeDescriptor

    Returns a new EdgeDescriptor

    AddGroup(GraphDescriptor, String)

    Add a new group to the graph

    Declaration
    public static GroupDescriptor AddGroup(GraphDescriptor desc, string groupName)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    String groupName

    The group name

    Returns
    Type Description
    GroupDescriptor

    Returns a new GroupDescriptor

    AddMeta(GraphDescriptor, String, String)

    Add a new Meta Key value pair to the Graph

    Declaration
    public static MetaDescriptor AddMeta(GraphDescriptor desc, string key, string value)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    String key

    The data key

    String value

    The data value

    Returns
    Type Description
    MetaDescriptor

    Returns a new MetaDescriptor

    AddNode(GraphDescriptor, NodeEditor)

    Add a new Node to the Graph, from the specified NodeEditor type

    Declaration
    public static NodeDescriptor AddNode(GraphDescriptor desc, NodeEditor nodeEditor)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    NodeEditor nodeEditor

    The NodeEditor type to create a NodeDescriptor in the Graph

    Returns
    Type Description
    NodeDescriptor

    Returns a new NodeDescriptor

    AddNode(GraphDescriptor, String)

    Add a new Node to the Graph, from the specified fullTypeName

    Declaration
    public static NodeDescriptor AddNode(GraphDescriptor desc, string fullTypeName)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    String fullTypeName

    The fullTypeName to create a NodeDescriptor in the Graph

    Returns
    Type Description
    NodeDescriptor

    Returns a new NodeDescriptor

    AddNode(GraphDescriptor, String, String)

    Add a new Node to the Graph, from the specified category and nodeTypeName

    Declaration
    public static NodeDescriptor AddNode(GraphDescriptor desc, string category, string nodeTypeName)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    String category

    The category to create a NodeDescriptor in the Graph

    String nodeTypeName

    The nodeTypeName to create a NodeDescriptor in the Graph

    Returns
    Type Description
    NodeDescriptor

    Returns a new NodeDescriptor

    AddNode(GraphDescriptor, Type)

    Add a new Node to the Graph, from the specified category and nodeTypeName

    Declaration
    public static NodeDescriptor AddNode(GraphDescriptor desc, Type nodeType)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    Type nodeType

    The type of the node to create

    Returns
    Type Description
    NodeDescriptor

    Returns a new NodeDescriptor

    AddNodeToGroup(GraphDescriptor, GroupDescriptor, NodeDescriptor)

    Add specified node to a group

    Declaration
    public static bool AddNodeToGroup(GraphDescriptor desc, GroupDescriptor group, NodeDescriptor node)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    GroupDescriptor group

    The group on which to add this node

    NodeDescriptor node

    The node to add to the group

    Returns
    Type Description
    Boolean

    Returns true for success

    AddParameter(GraphDescriptor, String, String, Boolean)

    Add a parameter in the graph

    Declaration
    public static ParameterDescriptor AddParameter(GraphDescriptor desc, string parameterName, string parameterType, bool isExposed = true)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    String parameterName

    the name of the Parameter to add

    String parameterType

    the type of Parameter to add

    Boolean isExposed

    if set to true [is exposed].

    Returns
    Type Description
    ParameterDescriptor

    Returns a new ParameterDescriptor

    AddParameter(GraphDescriptor, Type, String)

    Add a parameter in the graph.

    Declaration
    public static ParameterDescriptor AddParameter(GraphDescriptor desc, Type propertyType, string paramName)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    Type propertyType

    Type of the property.

    String paramName

    The name of the newly created parameter

    Returns
    Type Description
    ParameterDescriptor

    Returns a new ParameterDescriptor

    AddParameterNode(GraphDescriptor, ParameterDescriptor)

    Create a Node bound to a parameter

    Declaration
    public static NodeDescriptor AddParameterNode(GraphDescriptor desc, ParameterDescriptor paramDesc)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    ParameterDescriptor paramDesc

    The bound parameter that we want to attach to the created node

    Returns
    Type Description
    NodeDescriptor

    Returns a new bound NodeDescriptor

    AddSystemGraphNode(GraphDescriptor, String)

    Add an embedded SystemGraph Node to the Graph

    Declaration
    public static NodeDescriptor AddSystemGraphNode(GraphDescriptor desc, string graphPath)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    String graphPath

    The path of the graph asset to embed in the Graph

    Returns
    Type Description
    NodeDescriptor

    Returns a new embedded SystemGraph NodeDescriptor

    AddToPortList<T>(GraphDescriptor, NodeDescriptor, IPortEditor, String, T)

    Add a new Port in the PortList

    Declaration
    public static PortDescriptor AddToPortList<T>(GraphDescriptor desc, NodeDescriptor node, IPortEditor listPort, string name, T portRef)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    NodeDescriptor node

    The node on which to add a Port to the portlist

    IPortEditor listPort

    The node editor IPortDescription on which to add

    String name

    Name of the Port to add

    T portRef

    The instance of the Port to add

    Returns
    Type Description
    PortDescriptor

    Returns a new PortDescriptor

    Type Parameters
    Name Description
    T

    AddToPortList<T>(GraphDescriptor, NodeDescriptor, String)

    Add a new Port in the PortList

    Declaration
    public static PortDescriptor AddToPortList<T>(GraphDescriptor desc, NodeDescriptor node, string listPortName)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    NodeDescriptor node

    The node on which to add a Port to the portlist

    String listPortName

    Name of the Port to add

    Returns
    Type Description
    PortDescriptor

    Returns a new PortDescriptor

    Type Parameters
    Name Description
    T

    AddToPortList<T>(GraphDescriptor, NodeDescriptor, String, T)

    Add a new Port in the PortList

    Declaration
    public static PortDescriptor AddToPortList<T>(GraphDescriptor desc, NodeDescriptor node, string listPortName, T newPort)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    NodeDescriptor node

    The node on which to add a Port to the portlist

    String listPortName

    Name of the Port to add

    T newPort

    The instance of the Port to add

    Returns
    Type Description
    PortDescriptor

    Returns a new PortDescriptor

    Type Parameters
    Name Description
    T

    AlignNodes(List<NodeDescriptor>, Alignment)

    Aligns the nodes.

    Declaration
    public static void AlignNodes(List<NodeDescriptor> lstNode, Alignment alignment)
    Parameters
    Type Name Description
    List<NodeDescriptor> lstNode

    The list of nodes to align.

    Alignment alignment

    The alignment to set.

    AppendSerialization(GraphDescriptor, SystemGraphData, GraphGenerator.SerializationHandlers)

    Append serialized graph to the GraphDescriptor, only items that don't already exists

    Declaration
    public static bool AppendSerialization(GraphDescriptor desc, SystemGraphData graphData, GraphGenerator.SerializationHandlers serializationHandlers)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor to Reset

    SystemGraphData graphData

    The Graph Data to append

    GraphGenerator.SerializationHandlers serializationHandlers

    Handlers that are called during load for all elements of the graph

    Returns
    Type Description
    Boolean

    Returns true for success

    AssignAssetPath(GraphDescriptor, String)

    Assign a filepath to the GraphDescriptor

    Declaration
    public static bool AssignAssetPath(GraphDescriptor desc, string targetPath)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor to Reset

    String targetPath

    The target path to save the asset

    Returns
    Type Description
    Boolean

    Returns true for success

    Beautify(GraphDescriptor, GraphGenerator.AfterBeautify, GraphGenerator.BeautifyLayout)

    Beautify the specified Graph

    Declaration
    public static void Beautify(GraphDescriptor desc, GraphGenerator.AfterBeautify postBeautify = null, GraphGenerator.BeautifyLayout layout = null)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    GraphGenerator.AfterBeautify postBeautify

    Delegate that will be called after beautify has been done

    GraphGenerator.BeautifyLayout layout

    The layout rules for beautification

    CreateAsset(String)

    Create a GraphDescriptor at the specified targetPath

    Declaration
    public static GraphDescriptor CreateAsset(string targetPath)
    Parameters
    Type Name Description
    String targetPath

    The target path to save the asset

    Returns
    Type Description
    GraphDescriptor

    Returns a new GraphDescriptor

    CreateEdgeGuid(SerializedEdge)

    Creates the edge unique identifier.

    Declaration
    public static int CreateEdgeGuid(SerializedEdge edge)
    Parameters
    Type Name Description
    SerializedEdge edge

    The serialized edge.

    Returns
    Type Description
    Int32

    Generated guid for that edge.

    CreateInMemory()

    Create a new GraphDescriptor in memory

    Declaration
    public static GraphDescriptor CreateInMemory()
    Returns
    Type Description
    GraphDescriptor

    Returns a new GraphDescriptor

    CreateInMemory(String)

    Create a new GraphDescriptor in memory created from the string

    Declaration
    public static GraphDescriptor CreateInMemory(string graphString)
    Parameters
    Type Name Description
    String graphString

    The graph string.

    Returns
    Type Description
    GraphDescriptor

    Returns a new GraphDescriptor

    CreateNodeEditorForParameter(SerializedParameter)

    Create the related NodeEditor for the specified parameter

    Declaration
    public static NodeEditor CreateNodeEditorForParameter(SerializedParameter param)
    Parameters
    Type Name Description
    SerializedParameter param

    SerializedParameter with information

    Returns
    Type Description
    NodeEditor

    Returns related NodeEditor instance

    CreateNodeEditorForParameter(String, String, PortDirection, FieldExtra)

    Create the related NodeEditor for the specified parameter

    Declaration
    public static NodeEditor CreateNodeEditorForParameter(string paramName, string paramTypeName, PortDirection direction, FieldExtra rw)
    Parameters
    Type Name Description
    String paramName

    The parameter type

    String paramTypeName

    Name of the parameter type.

    PortDirection direction

    The direction.

    FieldExtra rw

    The rw.

    Returns
    Type Description
    NodeEditor

    Returns related NodeEditor instance

    DestroyAsset(GraphDescriptor)

    Destroyed and remove asset described by GraphDescriptor parameter

    Declaration
    public static bool DestroyAsset(GraphDescriptor desc)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor to remove

    Returns
    Type Description
    Boolean

    Returns true for success

    DistributeNodes(GraphDescriptor, List<NodeDescriptor>, Distribution, Single)

    Distributes the nodes.

    Declaration
    public static void DistributeNodes(GraphDescriptor desc, List<NodeDescriptor> lstNode, Distribution distribution, float forcedSpacing = 0F)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The graph descriptor.

    List<NodeDescriptor> lstNode

    The list of nodes to operate on.

    Distribution distribution

    The distribution pattern.

    Single forcedSpacing

    The forced spacing to apply to distribution.

    EnforceUniqueNodeName(GraphDescriptor, NodeDescriptor)

    Enforce nodeDesc to use a unique name

    Declaration
    public static void EnforceUniqueNodeName(GraphDescriptor graphDesc, NodeDescriptor nodeDesc)
    Parameters
    Type Name Description
    GraphDescriptor graphDesc

    The GraphDescriptor

    NodeDescriptor nodeDesc

    The node descriptor on which to validate it's uniquename

    FindNodeEditorForTitle(String)

    Find the related NodeEditor for the specified nodeTitle in the cache

    Declaration
    public static NodeEditor FindNodeEditorForTitle(string nodeTitle)
    Parameters
    Type Name Description
    String nodeTitle

    The node title to find in the node editor cache

    Returns
    Type Description
    NodeEditor

    Returns related NodeEditor instance

    FindNodeTypeForTitle(String)

    Finds the node type for title.

    Declaration
    public static Type FindNodeTypeForTitle(string nodeTitle)
    Parameters
    Type Name Description
    String nodeTitle

    The node title.

    Returns
    Type Description
    Type

    Resolved Node Type.

    GenerateUniqueNodeName(SerializedNode, List<SerializedNode>, out Boolean, String)

    Generate a unique name for node, if name is not unique in the graph

    Declaration
    public static string GenerateUniqueNodeName(SerializedNode p, List<SerializedNode> lstNode, out bool modified, string jsonNameKey = "_displayName")
    Parameters
    Type Name Description
    SerializedNode p

    The node to generate a unique name for

    List<SerializedNode> lstNode

    The list of nodes in the graph

    Boolean modified

    Is set to true when the name has been modified

    String jsonNameKey

    The name of the json field that contains the name, if upgrading, it's possible this field is not the same between versions

    Returns
    Type Description
    String

    Returns a unique name for node p

    GetNode(GraphDescriptor, String)

    Retrieve a node from it's guid in the GraphDescritor

    Declaration
    public static NodeDescriptor GetNode(GraphDescriptor desc, string guid)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor to Reset

    String guid

    The Node Guid to retrieve

    Returns
    Type Description
    NodeDescriptor

    Returns the NodeDescriptor for specified guid

    GetNodeCategory(String)

    Retrieve the NodeCategory attribute for specified nodeType name

    Declaration
    public static NodeCategoryAttribute GetNodeCategory(string nodeType)
    Parameters
    Type Name Description
    String nodeType

    The nodeType for which to retrieve the NodeCategory attribute, specified as: CATEGORY/TYPE

    Returns
    Type Description
    NodeCategoryAttribute

    Returns the NodeCategory Attribute

    GetOtherPortOnEdgeGuid(GraphDescriptor, Int32, PortDescriptor)

    Retrieve the other port connected to an edge

    Declaration
    public static PortDescriptor GetOtherPortOnEdgeGuid(GraphDescriptor desc, int edgeGuid, PortDescriptor port)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    Int32 edgeGuid

    The edge guid to retrieve

    PortDescriptor port

    The source port from which to extract the other port

    Returns
    Type Description
    PortDescriptor

    Returns the other port of the edge

    GetParameter(GraphDescriptor, String)

    Get a parameter descriptor by name

    Declaration
    public static ParameterDescriptor GetParameter(GraphDescriptor desc, string name)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    String name

    The name of the parameter to get

    Returns
    Type Description
    ParameterDescriptor

    Returns a ParameterDescriptor or null if not found

    GetParameterByGuid(GraphDescriptor, String)

    Get a parameter descriptor by guid

    Declaration
    public static ParameterDescriptor GetParameterByGuid(GraphDescriptor desc, string guid)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    String guid

    The unique identifier.

    Returns
    Type Description
    ParameterDescriptor

    Returns a ParameterDescriptor or null if not found

    GetParameterValue<T>(GraphDescriptor, ParameterDescriptor, out T)

    Get the default value of a parameter in the graph

    Declaration
    public static bool GetParameterValue<T>(GraphDescriptor desc, ParameterDescriptor paramDesc, out T value)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor instance

    ParameterDescriptor paramDesc

    The parameter desc.

    T value

    Default value of the port

    Returns
    Type Description
    Boolean

    Returns true if successful

    Type Parameters
    Name Description
    T

    GetPort(NodeDescriptor, String)

    Get a Port from a guid inside a Node

    Declaration
    public static PortDescriptor GetPort(NodeDescriptor node, string guid)
    Parameters
    Type Name Description
    NodeDescriptor node

    Node Descriptor that contains the port to extract

    String guid

    The guid of the port to extract

    Returns
    Type Description
    PortDescriptor

    Returns the PortDescriptor that matches the guid

    GetPortValue<T>(PortDescriptor, out T)

    Get the default value of a port in the graph

    Declaration
    public static bool GetPortValue<T>(PortDescriptor portDesc, out T value)
    Parameters
    Type Name Description
    PortDescriptor portDesc

    The port to change default value

    T value

    Default value of the port

    Returns
    Type Description
    Boolean

    Returns true if successful

    Type Parameters
    Name Description
    T

    LoadAsset(String, Boolean)

    Load a GraphDescriptor from the specified targetPath

    Declaration
    public static GraphDescriptor LoadAsset(string targetPath, bool syncSerialization = true)
    Parameters
    Type Name Description
    String targetPath

    The target path to save the asset

    Boolean syncSerialization

    Synchronize serialization after load

    Returns
    Type Description
    GraphDescriptor

    Returns a new GraphDescriptor

    MirrorSide(PortDirection)

    Retrieve the other side of the PortDirection in parameter

    Declaration
    public static PortDirection MirrorSide(PortDirection side)
    Parameters
    Type Name Description
    PortDirection side

    The side to mirror

    Returns
    Type Description
    PortDirection

    Returns the other side

    NodeNameForJSON(String)

    Extract a node name from the serialize node json data member

    Declaration
    public static string NodeNameForJSON(string json)
    Parameters
    Type Name Description
    String json

    The json of a serialized node

    Returns
    Type Description
    String

    Returns the name of the node from the json value

    NodeTypeFromString(String)

    Retrieve the Type of a nodeType string representation

    Declaration
    public static Type NodeTypeFromString(string nodeType)
    Parameters
    Type Name Description
    String nodeType

    The nodeType for which to retrieve the NodeCategory attribute, specified as: CATEGORY/TYPE

    Returns
    Type Description
    Type

    Returns Type associated with the parameter

    RefreshNode(GraphDescriptor, NodeDescriptor)

    Refresh the NodeEditor of the specified NodeDescriptor

    Declaration
    public static void RefreshNode(GraphDescriptor desc, NodeDescriptor nodeDesc)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    NodeDescriptor nodeDesc

    The Node Descriptor to refresh

    RefreshNodeVisuals(NodeDescriptor)

    Refreshes the node visuals.

    Declaration
    public static void RefreshNodeVisuals(NodeDescriptor desc)
    Parameters
    Type Name Description
    NodeDescriptor desc

    The node descriptor to refresh.

    RemoveComment(GraphDescriptor, CommentDescriptor)

    Remove a comment from the Graph

    Declaration
    public static bool RemoveComment(GraphDescriptor desc, CommentDescriptor comment)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    CommentDescriptor comment

    The CommentDescriptor to remove

    Returns
    Type Description
    Boolean

    Returns true for success

    RemoveDynamicPort(GraphDescriptor, NodeDescriptor, String)

    Remove a dynamic port of a node

    Declaration
    public static bool RemoveDynamicPort(GraphDescriptor desc, NodeDescriptor node, string portName)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    NodeDescriptor node

    The node on which to remove a Port

    String portName

    The name of the port

    Returns
    Type Description
    Boolean

    Returns true for success

    RemoveEdge(GraphDescriptor, EdgeDescriptor)

    Remove an edge from the graph

    Declaration
    public static bool RemoveEdge(GraphDescriptor desc, EdgeDescriptor edge)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    EdgeDescriptor edge

    The EdgeDescriptor to remove

    Returns
    Type Description
    Boolean

    Returns true for success

    RemoveGroup(GraphDescriptor, GroupDescriptor)

    Remove a group from the graph

    Declaration
    public static bool RemoveGroup(GraphDescriptor desc, GroupDescriptor group)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    GroupDescriptor group

    The group to remove

    Returns
    Type Description
    Boolean

    Returns true for success

    RemoveLastPortFromList(GraphDescriptor, NodeDescriptor, IPortEditor)

    Remove the Last Port from an existing portlist

    Declaration
    public static bool RemoveLastPortFromList(GraphDescriptor desc, NodeDescriptor node, IPortEditor listPort)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    NodeDescriptor node

    The node on which to add a Port to the portlist

    IPortEditor listPort

    The NodeEditor IPortDescription on which to remove the port

    Returns
    Type Description
    Boolean

    Returns true for success

    RemoveMeta(GraphDescriptor, MetaDescriptor)

    Remove a meta key value pair from the Graph

    Declaration
    public static bool RemoveMeta(GraphDescriptor desc, MetaDescriptor meta)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    MetaDescriptor meta

    The MetaDescriptor to remove

    Returns
    Type Description
    Boolean

    Returns true for success

    RemoveNode(GraphDescriptor, NodeDescriptor)

    Remove a node from the Graph

    Declaration
    public static bool RemoveNode(GraphDescriptor desc, NodeDescriptor node)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    NodeDescriptor node

    The NodeDescriptor to remove

    Returns
    Type Description
    Boolean

    Returns true for success

    RemoveNode(GraphDescriptor, String)

    Remove a node by guid from the Graph

    Declaration
    public static bool RemoveNode(GraphDescriptor desc, string guid)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    String guid

    The Node Guid to remove

    Returns
    Type Description
    Boolean

    Returns true for success

    RemoveNodeFromGroup(GraphDescriptor, GroupDescriptor, NodeDescriptor)

    Remove specified node from a group

    Declaration
    public static bool RemoveNodeFromGroup(GraphDescriptor desc, GroupDescriptor group, NodeDescriptor node)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    GroupDescriptor group

    The group on which to remove this node

    NodeDescriptor node

    The node to remove to the group

    Returns
    Type Description
    Boolean

    Returns true for success

    RemoveParameter(GraphDescriptor, ParameterDescriptor)

    Remove a parameter from the graph

    Declaration
    public static bool RemoveParameter(GraphDescriptor desc, ParameterDescriptor parameter)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    ParameterDescriptor parameter

    The Parameter Descriptor to remove

    Returns
    Type Description
    Boolean

    Returns true for success

    Reset(GraphDescriptor, Boolean)

    Reset values and potentially reset serialization data from the GraphDescriptor

    Declaration
    public static bool Reset(GraphDescriptor desc, bool resetSerialization = true)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor to Reset

    Boolean resetSerialization

    if set to true [reset serialization].

    Returns
    Type Description
    Boolean

    Returns true for success

    SaveAsset(GraphDescriptor, Boolean, Boolean)

    Save a GraphDescriptor to file

    Declaration
    public static bool SaveAsset(GraphDescriptor desc, bool forceBeautifyOnFirstLoad = true, bool validateOnSave = true)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The desc.

    Boolean forceBeautifyOnFirstLoad

    if set to true [force beautify on first load].

    Boolean validateOnSave

    if set to true [validate on save].

    Returns
    Type Description
    Boolean

    Returns true for success

    SetNodeWaveform(GraphDescriptor, NodeDescriptor, Double, Double, Boolean)

    Specify the parameters of the waveform to set on a Synchronous Node Descriptor

    Declaration
    public static ClockEvent SetNodeWaveform(GraphDescriptor desc, NodeDescriptor node, double timeOffset, double frequency, bool useClockSourceFrequency = false)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor

    NodeDescriptor node

    The node to on which to set this waveform

    Double timeOffset

    The TimeOffset in seconds

    Double frequency

    The frequency of this waveform

    Boolean useClockSourceFrequency

    Set to true to bind this waveform to the frequency of the scheduler clock source

    Returns
    Type Description
    ClockEvent

    Returns a new ClockEvent

    SetParameterValue<T>(GraphDescriptor, ParameterDescriptor, T)

    Set the default value of a parameter in the graph

    Declaration
    public static bool SetParameterValue<T>(GraphDescriptor desc, ParameterDescriptor paramDesc, T value)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor instance

    ParameterDescriptor paramDesc

    The parameter desc.

    T value

    The value to set

    Returns
    Type Description
    Boolean

    Returns true if successful

    Type Parameters
    Name Description
    T

    SetPortValue<T>(PortDescriptor, T)

    Set the default value of a port in the graph

    Declaration
    public static bool SetPortValue<T>(PortDescriptor portDesc, T value)
    Parameters
    Type Name Description
    PortDescriptor portDesc

    The port to change default value

    T value

    The value to set

    Returns
    Type Description
    Boolean

    Returns true if successful

    Type Parameters
    Name Description
    T

    SyncFromSerialization(GraphDescriptor)

    Synchronize the GraphDescriptor from it's serialization object

    Declaration
    public static void SyncFromSerialization(GraphDescriptor desc)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor to synchronize

    ToJson(GraphDescriptor)

    Retrieve the GraphDescriptor JSon representation

    Declaration
    public static string ToJson(GraphDescriptor desc)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The GraphDescriptor to Reset

    Returns
    Type Description
    String

    Returns a json string representation of the graph

    UpgradeGraph(SystemGraphData)

    Upgrades the graph.

    Declaration
    public static bool UpgradeGraph(SystemGraphData data)
    Parameters
    Type Name Description
    SystemGraphData data

    The SystemGraph data object.

    Returns
    Type Description
    Boolean

    true if upgrade happened, false otherwise.

    ValidateAndRepair(GraphDescriptor)

    Validate and automatically repair de graph

    Declaration
    public static bool ValidateAndRepair(GraphDescriptor desc)
    Parameters
    Type Name Description
    GraphDescriptor desc

    The graph descriptor to validate

    Returns
    Type Description
    Boolean

    Returns true if the graph was repaired

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Tuesday, October 18, 2022
    Terms of use