class Graph
This class represents an InstantTerra graph.
InstantTerra instantTerra = new InstantTerra(); // Start the instance
Project project = instantTerra.GetProject(); // Get the current project
Graph graph = instantTerra.GetProject().GetGraph(); // Get the graph
enum Graph.NodeLocation
This enum represents the location of a node from another node.
GetNodeCount
()Number of nodes in the graph.
Returns the number of nodes in the graph.
int nodeCount = graph.GetNodeCount();
GetAllNodes ()List of nodes.
Returns the list of nodes in the graph.
List<Node> nodes = graph.GetAllNodes();
GetNodeModels ()List of node models.
Returns the list of node models.
List<NodeModel> nodes = graph.GetNodeModels();
AddNode (ApiNodeType
nodeType, int positionX, int positionY)The created Node.
Creates and returns the node on the graph.
Node newNode = graph.AddNode(ApiNodeType.PerlinNoise, 10, 10);
AddNodeFromModel (NodeModel
nodeModel, int positionX, int positionY)The created Node.
Creates and returns the node from the node model on the graph.
Node newNode = graph.AddNodeFromModel(perlinNodeModel, 10, 10);
AddNodeNextTo (ApiNodeType
nodeType, Graph.NodeLocation
nodeLocation, Node
previousNode)The created Node.
Creates and returns the node on the graph next to the specified node.
Node newNode = graph.AddNodeNextTo(ApiNodeType.PerlinNoise, NodeLocation.Right, previousNode);
AddNodeFromModelNextTo (NodeModel
nodeModel, Graph.NodeLocation
nodeLocation, Node
previousNode)The created Node.
Creates and returns the node on the graph next to the specified node.
Node newNode = graph.AddNodeFromModelNextTo(perlinNodeModel, NodeLocation.Right, previousNode);
RemoveNode (Node
nodeToRemove)Removes the Node from the graph.
graph.RemoveNode(nodeToRemove);
GetNodeLinks (Node
node)List of links.
Returns the list of node links.
List<Link> links = graph.GetNodeLinks(perlinNoiseNode);
AddLink (Node startNode,
Connector
startConnector, Node endNode,
Connector
endConnector)The created link.
Adds a link between nodes
Link link = graph.AddLink(startNode, startConnector, endNode, endConnector);
AddLinkUsingName (Node
startNode,The created link.
Adds a link between nodes
Link link = graph.AddLinkUsingName(startNode, startConnectorName, endNode, endConnectorName);
RemoveLink (Link
linkToRemove)true if the link has been removed
Remove a link
graph.RemoveLink(link);
IsGraphAvailable ()True if the graph exists, otherwise False.
Returns the status of the graph.
bool isAvailable = graph.IsGraphAvailable();
Copyright © 2022 · All Rights Reserved · Wysilab