Arbor 3: FSM & BT Graph Editor  3.1.3
NodeGraph Class Referenceabstract

Base class of node graph. More...

Inheritance diagram for NodeGraph:
ArborFSMInternal BehaviourTreeInternal ArborFSM BehaviourTree

Public Member Functions

Node GetNodeFromIndex (int index)
 Get Node from index. More...
 
Node GetNodeFromID (int nodeID)
 Gets Arbor.Node from the node identifier. More...
 
CalculatorNode GetCalculatorFromIndex (int index)
 Get CalculatorNode from index. More...
 
int GetCalculatorIndex (CalculatorNode calculator)
 Get CalculatorNode index. More...
 
CalculatorNode GetCalculatorFromID (int calculatorID)
 Gets Arbor.CalculatorNode from the calculator identifier. More...
 
CalculatorNode CreateCalculator (int nodeID, System.Type calculatorType)
 Create calculator. More...
 
CalculatorNode CreateCalculator (System.Type calculatorType)
 Create calculator. More...
 
CalculatorNode FindCalculator (Calculator calculator)
 Acquisition of CalculatorNodes Calculator belongs. More...
 
bool DeleteCalculator (CalculatorNode calculatorNode)
 Delete calculator. More...
 
CommentNode GetCommentFromIndex (int index)
 Get CommentNode from index. More...
 
int GetCommentIndex (CommentNode comment)
 Get CommentNode index. More...
 
CommentNode GetCommentFromID (int commentID)
 Gets Arbor.CommentNode from the comment identifier. More...
 
CommentNode CreateComment (int nodeID)
 Create comment. More...
 
CommentNode CreateComment ()
 Create comment. More...
 
void DeleteComment (CommentNode comment)
 Delete comment. More...
 
GroupNode GetGroupFromIndex (int index)
 Get GroupNode from index. More...
 
GroupNode CreateGroup (int nodeID)
 Create group. More...
 
GroupNode CreateGroup ()
 Create group. More...
 
void DeleteGroup (GroupNode group)
 Delete group. More...
 
GroupNode GetGroupFromID (int groupID)
 Gets Arbor.GroupNode from the group identifier. More...
 
CalculatorBranchRerouteNode CreateCalculatorBranchRerouteNode (Vector2 position, System.Type type, int nodeID)
 Create CalculatorBranchRerouteNode. More...
 
CalculatorBranchRerouteNode CreateCalculatorBranchRerouteNode (Vector2 position, System.Type type)
 Create CalculatorBranchRerouteNode. More...
 
void DeleteCalculatorBranchRerouteNode (CalculatorBranchRerouteNode rerouteNode)
 Delete CalculatorBranchRerouteNode. More...
 
virtual void OnValidateNodes ()
 Called when the node is changed. More...
 
bool DeleteNode (Node node)
 Delete node. More...
 
Node FindNodeContainsBehaviour (NodeBehaviour behaviour)
 Acquisition of nodes NodeBehaviour belongs. More...
 
CalculatorBranch GetCalculatorBranchFromIndex (int index)
 Get CalculatorBranch from index. More...
 
int GetCalculatorBranchIndex (CalculatorBranch branch)
 Get CalculatorBranch index. More...
 
CalculatorBranch GetCalculatorBranchFromID (int branchID)
 Gets Arbor.CalculatorBranch from the calculator branch identifier. More...
 
CalculatorBranch ConnectCalculatorBranch (int branchID, int inputNodeID, Object inputObj, CalculatorSlot inputSlot, int outputNodeID, Object outputObj, CalculatorSlot outputSlot)
 Connect CalculatorSlot. More...
 
CalculatorBranch ConnectCalculatorBranch (int inputNodeID, Object inputObj, CalculatorSlot inputSlot, int outputNodeID, Object outputObj, CalculatorSlot outputSlot)
 Connect CalculatorSlot. More...
 
void DisconnectCalculatorBranch (Object obj)
 Method to be used internally. More...
 
void DeleteCalculatorBranch (CalculatorBranch branch)
 Delete calculator branch. More...
 
bool CheckLoopCalculatorBranch (int inputNodeID, Object inputObj, int outputNodeID, Object outputObj)
 Check if CalculatorBranch is looping. More...
 
delegate void NodeGraphCallback (NodeGraph nodeGraph)
 Delegate for NodeGraph callback More...
 
void DestroySubComponents ()
 Method to be used internally. More...
 
override string ToString ()
 Convert graph to string (for debugging). More...
 

Static Public Member Functions

static NodeGraph FindGraph (string name)
 Get the NodeGraph that in the scene with the name. More...
 
static NodeGraph FindGraph (string name, System.Type type)
 Get the NodeGraph that in the scene with the name. More...
 
static T FindGraph< T > (string name)
 Get the NodeGraph that in the scene with the name. More...
 
static NodeGraph[] FindGraphs (string name)
 Get the NodeGraph of the same name that is in the scene. More...
 
static NodeGraph[] FindGraphs (string name, System.Type type)
 Get the NodeGraph of the same name that is in the scene. More...
 
static T[] FindGraphs< T > (string name)
 Get the NodeGraph of the same name that is in the scene. More...
 
static NodeGraph FindGraph (GameObject gameObject, string name)
 Get NodeGraph in the name that has been attached to the GameObject. More...
 
static NodeGraph FindGraph (GameObject gameObject, string name, System.Type type)
 Get NodeGraph in the name that has been attached to the GameObject. More...
 
static T FindGraph< T > (GameObject gameObject, string name)
 Get NodeGraph in the name that has been attached to the GameObject. More...
 
static NodeGraph[] FindGraphs (GameObject gameObject, string name)
 Get the NodeGraph of the same name that is attached to a GameObject. More...
 
static NodeGraph[] FindGraphs (GameObject gameObject, string name, System.Type type)
 Get the NodeGraph of the same name that is attached to a GameObject. More...
 
static T[] FindGraphs< T > (GameObject gameObject, string name)
 Get the NodeGraph of the same name that is attached to a GameObject. More...
 
static NodeGraph Create (GameObject gameObject, System.Type classType)
 Create NodeGraph More...
 
static GraphType Create< GraphType > (GameObject gameObject)
 Create NodeGraph More...
 
static NodeGraph Instantiate (NodeGraph sourceGraph, NodeBehaviour ownerBehaviour)
 Instantiate NodeGraph More...
 
static GraphType Instantiate< GraphType > (GraphType sourceGraph, NodeBehaviour ownerBehaviour)
 Instantiate NodeGraph More...
 
static void Destroy (NodeGraph nodeGraph)
 Destroy NodeGraph More...
 

Public Attributes

string graphName
 The Graph name. More...
 

Protected Member Functions

abstract bool OnDeleteNode (Node node)
 Delete node. More...
 
virtual void OnValidate ()
 See MonoBehaviour.OnValidate. More...
 
virtual void OnReset ()
 Reset or create callback. More...
 

Properties

string displayGraphName [get]
 Display name of the node graph. More...
 
NodeGraph parentGraph [get]
 Parent graph More...
 
NodeGraph rootGraph [get]
 Root graph More...
 
Object ownerBehaviourObject [get, set]
 Object of NodeBehaviour own this graph More...
 
NodeBehaviour ownerBehaviour [get, set]
 NodeBehaviour is the owner of this graph More...
 
bool external [get]
 Flag instantiated from external graph More...
 
int nodeCount [get]
 Get a count of Node. More...
 
int calculatorCount [get]
 Get a count of CalculatorNode. More...
 
CalculatorNode[] calculators [get]
 Gets all of Arbor.CalculatorNode. More...
 
int commentCount [get]
 Get a count of CommentNode. More...
 
CommentNode[] comments [get]
 Gets all of Arbor.CommentNode. More...
 
int groupCount [get]
 Get a count of GroupNode. More...
 
CalculatorBranchRerouteNodeList calculatorBranchRerouteNodes [get]
 CalculatorBranchRerouteNode list More...
 
int calculatorBranchCount [get]
 Get a count of CalculatorBranch. More...
 
CalculatorBranch[] calculatorBranchies [get]
 Gets all of Arbor.CalculatorBranch. More...
 

Events

NodeGraphCallback destroyCallback
 Call back when being destroyed More...
 
NodeGraphCallback stateChangedCallback
 Call back when the state changes More...
 

Detailed Description

Base class of node graph.

Member Function Documentation

bool CheckLoopCalculatorBranch ( int  inputNodeID,
Object  inputObj,
int  outputNodeID,
Object  outputObj 
)

Check if CalculatorBranch is looping.

Parameters
inputNodeIDInput slot side node ID
inputObjInput slot side Object
outputNodeIDOutput slot side node ID
outputObjOutput slot side Object
Returns
Returns true if it is looping.
CalculatorBranch ConnectCalculatorBranch ( int  branchID,
int  inputNodeID,
Object  inputObj,
CalculatorSlot  inputSlot,
int  outputNodeID,
Object  outputObj,
CalculatorSlot  outputSlot 
)

Connect CalculatorSlot.

Parameters
branchIDID of the CalculatorBranch to be created
inputNodeIDInput node ID.
inputObjInput object.
inputSlotInput slot.
outputNodeIDOutput node ID.
outputObjOutput object.
outputSlotOutput slot.
Returns
Connected CalculatorBranch
CalculatorBranch ConnectCalculatorBranch ( int  inputNodeID,
Object  inputObj,
CalculatorSlot  inputSlot,
int  outputNodeID,
Object  outputObj,
CalculatorSlot  outputSlot 
)

Connect CalculatorSlot.

Parameters
inputNodeIDInput node ID.
inputObjInput object.
inputSlotInput slot.
outputNodeIDOutput node ID.
outputObjOutput object.
outputSlotOutput slot.
Returns
Connected CalculatorBranch
static NodeGraph Create ( GameObject  gameObject,
System.Type  classType 
)
static

Create NodeGraph

Parameters
gameObjectGameObject
classTypeNodeGraph type
Returns
The created NodeGraph
static GraphType Create< GraphType > ( GameObject  gameObject)
static

Create NodeGraph

Template Parameters
GraphTypeNodeGraph type
Parameters
gameObjectGameObject
Returns
The created NodeGraph
Type Constraints
GraphType :NodeGraph 
CalculatorNode CreateCalculator ( int  nodeID,
System.Type  calculatorType 
)

Create calculator.

Parameters
nodeIDNode ID
calculatorTypeCalculator type
Returns
The created calculator. If the node ID is not unique, return null without creating it.
CalculatorNode CreateCalculator ( System.Type  calculatorType)

Create calculator.

Parameters
calculatorTypeCalculator type
Returns
The created calculator.
CalculatorBranchRerouteNode CreateCalculatorBranchRerouteNode ( Vector2  position,
System.Type  type,
int  nodeID 
)

Create CalculatorBranchRerouteNode.

Parameters
positionPosition of the node
typeValue type
nodeIDNode ID
Returns
The created CalculatorBranchRerouteNode. If the node ID is not unique, return null without creating it.
CalculatorBranchRerouteNode CreateCalculatorBranchRerouteNode ( Vector2  position,
System.Type  type 
)
CommentNode CreateComment ( int  nodeID)

Create comment.

Parameters
nodeIDNode ID
Returns
The created comment. If the node ID is not unique, return null without creating it.
CommentNode CreateComment ( )

Create comment.

Returns
The created comment.
GroupNode CreateGroup ( int  nodeID)

Create group.

Parameters
nodeIDNode ID
Returns
The created group. If the node ID is not unique, return null without creating it.
GroupNode CreateGroup ( )

Create group.

Returns
The created group.
bool DeleteCalculator ( CalculatorNode  calculatorNode)

Delete calculator.

Parameters
calculatorNodeCalculator that you want to delete.
Returns
true if deleted
void DeleteCalculatorBranch ( CalculatorBranch  branch)

Delete calculator branch.

Parameters
branchCalculator branch that you want to delete.
void DeleteCalculatorBranchRerouteNode ( CalculatorBranchRerouteNode  rerouteNode)

Delete CalculatorBranchRerouteNode.

Parameters
rerouteNodeCalculatorBranchRerouteNode that you want to delete.
void DeleteComment ( CommentNode  comment)

Delete comment.

Parameters
commentComment that you want to delete.
void DeleteGroup ( GroupNode  group)

Delete group.

Parameters
groupGroup that you want to delete.
bool DeleteNode ( Node  node)

Delete node.

Parameters
nodeNode that you want to delete.
Returns
true if deleted
static void Destroy ( NodeGraph  nodeGraph)
static

Destroy NodeGraph

Parameters
nodeGraphNodeGraph
void DestroySubComponents ( )

Method to be used internally.

In particular there is no need to call.

void DisconnectCalculatorBranch ( Object  obj)

Method to be used internally.

In particular there is no need to call.

CalculatorNode FindCalculator ( Calculator  calculator)

Acquisition of CalculatorNodes Calculator belongs.

Parameters
calculatorCalculator
Returns
CalculatorNodes Calculator belongs. Return null if not.
static NodeGraph FindGraph ( string  name)
static

Get the NodeGraph that in the scene with the name.

Parameters
nameThe name of the search NodeGraph.
Returns
Found NodeGraph. Returns null if not found.
static NodeGraph FindGraph ( string  name,
System.Type  type 
)
static

Get the NodeGraph that in the scene with the name.

Parameters
nameThe name of the search NodeGraph.
typeThe type of the search NodeGraph.
Returns
Found NodeGraph. Returns null if not found.
static NodeGraph FindGraph ( GameObject  gameObject,
string  name 
)
static

Get NodeGraph in the name that has been attached to the GameObject.

Parameters
gameObjectWant to search GameObject.
nameThe name of the search NodeGraph.
Returns
Found NodeGraph. Returns null if not found.
static NodeGraph FindGraph ( GameObject  gameObject,
string  name,
System.Type  type 
)
static

Get NodeGraph in the name that has been attached to the GameObject.

Parameters
gameObjectWant to search GameObject.
nameThe name of the search NodeGraph.
typeThe type of the search NodeGraph.
Returns
Found NodeGraph. Returns null if not found.
static T FindGraph< T > ( string  name)
static

Get the NodeGraph that in the scene with the name.

Template Parameters
TThe type of the search NodeGraph.
Parameters
nameThe name of the search NodeGraph.
Returns
Found NodeGraph. Returns null if not found.
Type Constraints
T :NodeGraph 
static T FindGraph< T > ( GameObject  gameObject,
string  name 
)
static

Get NodeGraph in the name that has been attached to the GameObject.

Template Parameters
TThe type of the search NodeGraph.
Parameters
gameObjectWant to search GameObject.
nameThe name of the search NodeGraph.
Returns
Found NodeGraph. Returns null if not found.
Type Constraints
T :NodeGraph 
static NodeGraph [] FindGraphs ( string  name)
static

Get the NodeGraph of the same name that is in the scene.

Parameters
nameThe name of the search NodeGraph.
Returns
Array of found NodeGraph.
static NodeGraph [] FindGraphs ( string  name,
System.Type  type 
)
static

Get the NodeGraph of the same name that is in the scene.

Parameters
nameThe name of the search NodeGraph.
typeThe type of the search NodeGraph.
Returns
Array of found NodeGraph.
static NodeGraph [] FindGraphs ( GameObject  gameObject,
string  name 
)
static

Get the NodeGraph of the same name that is attached to a GameObject.

Parameters
gameObjectWant to search GameObject.
nameThe name of the search NodeGraph.
Returns
Array of found NodeGraph.
static NodeGraph [] FindGraphs ( GameObject  gameObject,
string  name,
System.Type  type 
)
static

Get the NodeGraph of the same name that is attached to a GameObject.

Parameters
gameObjectWant to search GameObject.
nameThe name of the search NodeGraph.
typeThe type of the search NodeGraph.
Returns
Array of found NodeGraph.
static T [] FindGraphs< T > ( string  name)
static

Get the NodeGraph of the same name that is in the scene.

Template Parameters
TThe type of the search NodeGraph.
Parameters
nameThe name of the search NodeGraph.
Returns
Array of found NodeGraph.
Type Constraints
T :NodeGraph 
static T [] FindGraphs< T > ( GameObject  gameObject,
string  name 
)
static

Get the NodeGraph of the same name that is attached to a GameObject.

Template Parameters
TThe type of the search NodeGraph.
Parameters
gameObjectWant to search GameObject.
nameThe name of the search NodeGraph.
Returns
Array of found NodeGraph.
Type Constraints
T :NodeGraph 
Node FindNodeContainsBehaviour ( NodeBehaviour  behaviour)

Acquisition of nodes NodeBehaviour belongs.

Parameters
behaviourNodeBehaviour
Returns
Nodess NodeBehaviour belongs. Return null if not.
CalculatorBranch GetCalculatorBranchFromID ( int  branchID)

Gets Arbor.CalculatorBranch from the calculator branch identifier.

Parameters
branchIDThe calculator branch identifier.
Returns
Found Arbor.CalculatorBranch. Returns null if not found.
CalculatorBranch GetCalculatorBranchFromIndex ( int  index)

Get CalculatorBranch from index.

Parameters
indexIndex
Returns
CalculatorBranch
int GetCalculatorBranchIndex ( CalculatorBranch  branch)

Get CalculatorBranch index.

Parameters
branchCalculatorBranch
Returns
Index. If not, it returns -1.
CalculatorNode GetCalculatorFromID ( int  calculatorID)

Gets Arbor.CalculatorNode from the calculator identifier.

Parameters
calculatorIDThe calculator identifier.
Returns
Found Arbor.CalculatorNode. Returns null if not found.
CalculatorNode GetCalculatorFromIndex ( int  index)

Get CalculatorNode from index.

Parameters
indexIndex
Returns
CalculatorNode
int GetCalculatorIndex ( CalculatorNode  calculator)

Get CalculatorNode index.

Parameters
calculatorCalculatorNode
Returns
Index. If not, it returns -1.
CommentNode GetCommentFromID ( int  commentID)

Gets Arbor.CommentNode from the comment identifier.

Parameters
commentIDThe comment identifier.
Returns
Found Arbor.CommentNode. Returns null if not found.
CommentNode GetCommentFromIndex ( int  index)

Get CommentNode from index.

Parameters
indexIndex
Returns
CommentNode
int GetCommentIndex ( CommentNode  comment)

Get CommentNode index.

Parameters
commentCommentNode
Returns
Index. If not, it returns -1.
GroupNode GetGroupFromID ( int  groupID)

Gets Arbor.GroupNode from the group identifier.

Parameters
groupIDThe group identifier.
Returns
Found Arbor.GroupNode. Returns null if not found.
GroupNode GetGroupFromIndex ( int  index)

Get GroupNode from index.

Parameters
indexIndex
Returns
GroupNode
Node GetNodeFromID ( int  nodeID)

Gets Arbor.Node from the node identifier.

Parameters
nodeIDThe node identifier.
Returns
Found Arbor.Node. Returns null if not found.
Node GetNodeFromIndex ( int  index)

Get Node from index.

Parameters
indexIndex
Returns
Node
static NodeGraph Instantiate ( NodeGraph  sourceGraph,
NodeBehaviour  ownerBehaviour 
)
static

Instantiate NodeGraph

Parameters
sourceGraphSource graph
ownerBehaviourNodeBehaviour with chart ownership
Returns
Instantiated graph
static GraphType Instantiate< GraphType > ( GraphType  sourceGraph,
NodeBehaviour  ownerBehaviour 
)
static

Instantiate NodeGraph

Template Parameters
GraphTypeGraph type
Parameters
sourceGraphSource graph
ownerBehaviourNodeBehaviour with chart ownership
Returns
Instantiated graph
Type Constraints
GraphType :NodeGraph 
delegate void NodeGraphCallback ( NodeGraph  nodeGraph)

Delegate for NodeGraph callback

Parameters
nodeGraphEvent occurred NodeGraph
abstract bool OnDeleteNode ( Node  node)
protectedpure virtual

Delete node.

Parameters
nodeThe node to delete
Returns
Returns true if deleted, false otherwise.

Implemented in BehaviourTreeInternal, and ArborFSMInternal.

virtual void OnReset ( )
protectedvirtual

Reset or create callback.

Reimplemented in ArborFSMInternal, and BehaviourTreeInternal.

virtual void OnValidate ( )
protectedvirtual

See MonoBehaviour.OnValidate.

Reimplemented in ArborFSMInternal.

virtual void OnValidateNodes ( )
virtual

Called when the node is changed.

Reimplemented in BehaviourTreeInternal.

override string ToString ( )

Convert graph to string (for debugging).

Returns
Converted string

Member Data Documentation

string graphName

The Graph name.


It is used for identification and retrieval when there is more than one Graph in one GameObject.

Property Documentation

int calculatorBranchCount
get

Get a count of CalculatorBranch.

CalculatorBranch [] calculatorBranchies
get

Gets all of Arbor.CalculatorBranch.

CalculatorBranchRerouteNodeList calculatorBranchRerouteNodes
get
int calculatorCount
get

Get a count of CalculatorNode.

CalculatorNode [] calculators
get

Gets all of Arbor.CalculatorNode.

int commentCount
get

Get a count of CommentNode.

CommentNode [] comments
get

Gets all of Arbor.CommentNode.

string displayGraphName
get

Display name of the node graph.

If graphName is empty or null, it returns "(No Name)".

bool external
get

Flag instantiated from external graph

int groupCount
get

Get a count of GroupNode.

int nodeCount
get

Get a count of Node.

NodeBehaviour ownerBehaviour
getset

NodeBehaviour is the owner of this graph

Object ownerBehaviourObject
getset

Object of NodeBehaviour own this graph

NodeGraph parentGraph
get

Parent graph

NodeGraph rootGraph
get

Root graph

Event Documentation

NodeGraphCallback destroyCallback

Call back when being destroyed

NodeGraphCallback stateChangedCallback

Call back when the state changes