Class ScriptGraphView
The ScriptGraphView allows for the visual editing of a script graph.
Inheritance
System.Object
ScriptGraphView
Syntax
public class ScriptGraphView : GraphView
Constructors
ScriptGraphView(String, Boolean)
Creates a new graph view.
Declaration
public ScriptGraphView(string title, bool showDebugInfo)
Parameters
Type |
Name |
Description |
System.String |
title |
The title to display.
|
System.Boolean |
showDebugInfo |
Whether or not to display the debug info on node views.
|
Properties
Graph
Gets the graph that's currently being displayed/edited.
Declaration
public ScriptGraphGraph Graph { get; }
Property Value
IsClearing
Declaration
public bool IsClearing { get; }
Property Value
Type |
Description |
System.Boolean |
|
MaxZoom
Declaration
public static float MaxZoom { get; set; }
Property Value
Type |
Description |
System.Single |
|
MinZoom
Declaration
public static float MinZoom { get; set; }
Property Value
Type |
Description |
System.Single |
|
NodeViewTypesRegistry
Gets the registry that contains all the node view types for each node type.
Declaration
protected ScriptNodeViewTypesRegistry NodeViewTypesRegistry { get; }
Property Value
Selection
Declaration
public ScriptGraphViewSelection Selection { get; }
Property Value
ShowDebugInfo
Gets/sets whether or not to show debug info on the node views.
Declaration
public bool ShowDebugInfo { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
ZoomStep
Declaration
public static float ZoomStep { get; set; }
Property Value
Type |
Description |
System.Single |
|
Methods
AddNewGroupNode(GroupNode, Vector2)
Declaration
public void AddNewGroupNode(GroupNode newGroupNode, Vector2 position)
Parameters
Type |
Name |
Description |
GroupNode |
newGroupNode |
|
Vector2 |
position |
|
AddNewNode(IScriptNode, Vector2, Boolean)
Adds the given node to the graph and graph view at the given position.
Declaration
public void AddNewNode(IScriptNode newNode, Vector2 position, bool autoAddToGroup = true)
Parameters
Type |
Name |
Description |
IScriptNode |
newNode |
The node to add.
|
Vector2 |
position |
The position in the graph view.
|
System.Boolean |
autoAddToGroup |
If set to true, nodes will be automatically added to any group node they are on top of.
|
AddNewReferenceNode(ReferenceNode, Vector2)
Adds a reference node to the graph.
Declaration
public void AddNewReferenceNode(ReferenceNode referenceNode, Vector2 position)
Parameters
Type |
Name |
Description |
ReferenceNode |
referenceNode |
The reference node to add.
|
Vector2 |
position |
The position where the reference node should be placed in the graph.
|
Declaration
public override void BuildContextualMenu(ContextualMenuPopulateEvent e)
Parameters
Type |
Name |
Description |
ContextualMenuPopulateEvent |
e |
|
ClearHighlights()
Removes all the highlight colors from nodes.
Declaration
public void ClearHighlights()
Connect(InPort, OutPort, ReferenceNode)
Declaration
public Edge Connect(InPort inPort, OutPort outPort, ReferenceNode referenceNode = null)
Parameters
Type |
Name |
Description |
InPort |
inPort |
|
OutPort |
outPort |
|
ReferenceNode |
referenceNode |
|
Returns
Dispose()
Declaration
FrameNode(IScriptNode)
Focus view on the node's view.
Declaration
public void FrameNode(IScriptNode node)
Parameters
FrameNodes(IEnumerable<IScriptNode>)
Focus view on the nodes' view.
Declaration
public void FrameNodes(IEnumerable<IScriptNode> frameNodes)
Parameters
Type |
Name |
Description |
IEnumerable<IScriptNode> |
frameNodes |
The nodes.
|
GetCompatiblePorts(Port, NodeAdapter)
Declaration
public override List<Port> GetCompatiblePorts(Port startPort, NodeAdapter nodeAdapter)
Parameters
Type |
Name |
Description |
Port |
startPort |
|
NodeAdapter |
nodeAdapter |
|
Returns
Type |
Description |
List<Port> |
|
GetGroupView(GroupNode)
Declaration
public GroupNodeView GetGroupView(GroupNode groupNode)
Parameters
Type |
Name |
Description |
GroupNode |
groupNode |
|
Returns
GetReferenceNodeView(ReferenceNode)
Declaration
public ScriptNodeView GetReferenceNodeView(ReferenceNode referenceNode)
Parameters
Type |
Name |
Description |
ReferenceNode |
referenceNode |
|
Returns
GetView(IScriptNode)
Declaration
public ScriptNodeView GetView(IScriptNode node)
Parameters
Returns
HighlightFailedNode(IScriptNode, Boolean)
Colors the node's view red in the script graph view, to indicate that it failed.
Declaration
public void HighlightFailedNode(IScriptNode node, bool warning = false)
Parameters
Type |
Name |
Description |
IScriptNode |
node |
The node to mark.
|
System.Boolean |
warning |
If true, it's just a warning, color orange instead of red.
|
HighlightFailedNodes(IEnumerable<IScriptNode>, Boolean)
Colors the node's view red in the script graph view, to indicate that it failed.
Declaration
public void HighlightFailedNodes(IEnumerable<IScriptNode> markNodes, bool warning = false)
Parameters
Type |
Name |
Description |
IEnumerable<IScriptNode> |
markNodes |
The nodes to mark.
|
System.Boolean |
warning |
If true, it's just a warning, color orange instead of red.
|
Initialize()
Initializes the script graph view.
Declaration
InitializePort(Port)
Declaration
public void InitializePort(Port port)
Parameters
Type |
Name |
Description |
Port |
port |
|
Load(ScriptGraphGraph)
Loads the given script graph into the graph view.
Declaration
public void Load(ScriptGraphGraph graphToLoad)
Parameters
Reload()
Declaration
RemoveFromGroup(GroupNode, IScriptNode)
Declaration
public void RemoveFromGroup(GroupNode groupNode, IScriptNode node)
Parameters
Type |
Name |
Description |
GroupNode |
groupNode |
|
IScriptNode |
node |
|
RemoveFromGroup(GroupNode, ReferenceNode)
Declaration
public void RemoveFromGroup(GroupNode groupNode, ReferenceNode referenceNode)
Parameters
Type |
Name |
Description |
GroupNode |
groupNode |
|
ReferenceNode |
referenceNode |
|
TriggerKeyDown(KeyCode, EventModifiers, Vector2)
Declaration
public void TriggerKeyDown(KeyCode keyCode, EventModifiers modifiers, Vector2 originalMousePosition)
Parameters
Type |
Name |
Description |
KeyCode |
keyCode |
|
EventModifiers |
modifiers |
|
Vector2 |
originalMousePosition |
|
Events
OnInitialized
Event triggers whenever the script graph view has been initialized.
Declaration
public event Action OnInitialized
Event Type
OnShowDebugInfoChanged
Event triggers when the debug info has been updated.
Declaration
public event Action<bool> OnShowDebugInfoChanged
Event Type
Type |
Description |
Action<System.Boolean> |
|