Class BaseGraph
Inheritance
Implements
Inherited Members
Namespace: GraphProcessor
Assembly: com.alelievr.NodeGraphProcessor.Runtime.dll
Syntax
[Serializable]
public class BaseGraph : ScriptableObject, ISerializationCallbackReceiver
Fields
| Improve this Doc View SourcecommentBlocks
All groups in the graph
Declaration
[SerializeField]
public List<CommentBlock> commentBlocks
Field Value
Type | Description |
---|---|
System. |
edges
Json list of edges
Declaration
[SerializeField]
public List<SerializableEdge> edges
Field Value
Type | Description |
---|---|
System. |
edgesPerGUID
Dictionary of edges per GUID, faster than a search in a list
Declaration
[NonSerialized]
public Dictionary<string, SerializableEdge> edgesPerGUID
Field Value
Type | Description |
---|---|
System. |
exposedParameters
All exposed parameters in the graph
Declaration
[SerializeField]
public List<ExposedParameter> exposedParameters
Field Value
Type | Description |
---|---|
System. |
nodes
List of all the nodes in the graph.
Declaration
[NonSerialized]
public List<BaseNode> nodes
Field Value
Type | Description |
---|---|
System. |
nodesPerGUID
Dictionary to access node per GUID, faster than a search in a list
Declaration
[NonSerialized]
public Dictionary<string, BaseNode> nodesPerGUID
Field Value
Type | Description |
---|---|
System. |
pinnedElements
All pinned elements in the graph
Declaration
[SerializeField]
public List<PinnedElement> pinnedElements
Field Value
Type | Description |
---|---|
System. |
position
Declaration
public Vector3 position
Field Value
Type | Description |
---|---|
Unity |
scale
Declaration
public Vector3 scale
Field Value
Type | Description |
---|---|
Unity |
serializedNodes
Json list of nodes (Serialized)
Declaration
[SerializeField]
public List<JsonElement> serializedNodes
Field Value
Type | Description |
---|---|
System. |
Properties
| Improve this Doc View SourceisEnabled
Declaration
public bool isEnabled { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
| Improve this Doc View SourceAddCommentBlock(CommentBlock)
Add a group
Declaration
public void AddCommentBlock(CommentBlock block)
Parameters
Type | Name | Description |
---|---|---|
Comment |
block |
AddExposedParameter(String, Type, Object)
Add an exposed parameter
Declaration
public string AddExposedParameter(string name, Type type, object value)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | parameter name |
System. |
type | parameter type |
System. |
value | default value |
Returns
Type | Description |
---|---|
System. |
AddNode(BaseNode)
Adds a node to the graph
Declaration
public BaseNode AddNode(BaseNode node)
Parameters
Type | Name | Description |
---|---|---|
Base |
node |
Returns
Type | Description |
---|---|
Base |
ClosePinned(Type)
Closes a pinned element of type viewType
Declaration
public void ClosePinned(Type viewType)
Parameters
Type | Name | Description |
---|---|---|
System. |
viewType | type of the pinned element |
Connect(NodePort, NodePort, Boolean)
Connect two ports with an edge
Declaration
public SerializableEdge Connect(NodePort inputPort, NodePort outputPort, bool autoDisconnectInputs = true)
Parameters
Type | Name | Description |
---|---|---|
Node |
inputPort | input port |
Node |
outputPort | output port |
System. |
autoDisconnectInputs |
Returns
Type | Description |
---|---|
Serializable |
the connecting edge |
Deserialize()
Declaration
public void Deserialize()
Disconnect(BaseNode, String, BaseNode, String)
Disconnect two ports
Declaration
public void Disconnect(BaseNode inputNode, string inputFieldName, BaseNode outputNode, string outputFieldName)
Parameters
Type | Name | Description |
---|---|---|
Base |
inputNode | input node |
System. |
inputFieldName | input field name |
Base |
outputNode | output node |
System. |
outputFieldName | output field name |
Disconnect(SerializableEdge)
Disconnect an edge
Declaration
public void Disconnect(SerializableEdge edge)
Parameters
Type | Name | Description |
---|---|---|
Serializable |
edge |
Disconnect(String)
Disconnect an edge
Declaration
public void Disconnect(string edgeGUID)
Parameters
Type | Name | Description |
---|---|---|
System. |
edgeGUID |
GetExposedParameter(String)
Get the exposed parameter from name
Declaration
public ExposedParameter GetExposedParameter(string name)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | name |
Returns
Type | Description |
---|---|
Exposed |
the parameter or null |
GetExposedParameterFromGUID(String)
Get exposed parameter from GUID
Declaration
public ExposedParameter GetExposedParameterFromGUID(string guid)
Parameters
Type | Name | Description |
---|---|---|
System. |
guid | GUID of the parameter |
Returns
Type | Description |
---|---|
Exposed |
The parameter |
GetParameterValue(String)
Get the parameter value
Declaration
public object GetParameterValue(string name)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | parameter name |
Returns
Type | Description |
---|---|
System. |
value |
GetParameterValue<T>(String)
Get the parameter value template
Declaration
public T GetParameterValue<T>(string name)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | parameter name |
Returns
Type | Description |
---|---|
T | value |
Type Parameters
Name | Description |
---|---|
T | type of the parameter |
OnAfterDeserialize()
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
Declaration
public void OnBeforeSerialize()
OnEnable()
Declaration
protected virtual void OnEnable()
OpenPinned(Type)
Open a pinned element of type viewType
Declaration
public PinnedElement OpenPinned(Type viewType)
Parameters
Type | Name | Description |
---|---|---|
System. |
viewType | type of the pinned element |
Returns
Type | Description |
---|---|
Pinned |
the pinned element |
RemoveCommentBlock(CommentBlock)
Removes a group
Declaration
public void RemoveCommentBlock(CommentBlock block)
Parameters
Type | Name | Description |
---|---|---|
Comment |
block |
RemoveExposedParameter(ExposedParameter)
Remove an exposed parameter
Declaration
public void RemoveExposedParameter(ExposedParameter ep)
Parameters
Type | Name | Description |
---|---|---|
Exposed |
ep | the parameter to remove |
RemoveExposedParameter(String)
Remove an exposed parameter
Declaration
public void RemoveExposedParameter(string guid)
Parameters
Type | Name | Description |
---|---|---|
System. |
guid | GUID of the parameter |
RemoveNode(BaseNode)
Removes a node from the graph
Declaration
public void RemoveNode(BaseNode node)
Parameters
Type | Name | Description |
---|---|---|
Base |
node |
SetParameterValue(String, Object)
Set parameter value from name. (Warning: the parameter name can be changed by the user)
Declaration
public bool SetParameterValue(string name, object value)
Parameters
Type | Name | Description |
---|---|---|
System. |
name | name of the parameter |
System. |
value | new value |
Returns
Type | Description |
---|---|
System. |
true if the value have been assigned |
TypesAreConnectable(Type, Type)
Tell if two types can be connected in the context of a graph
Declaration
public static bool TypesAreConnectable(Type t1, Type t2)
Parameters
Type | Name | Description |
---|---|---|
System. |
t1 | |
System. |
t2 |
Returns
Type | Description |
---|---|
System. |
UpdateComputeOrder()
Update the compute order of the nodes in the graph
Declaration
public void UpdateComputeOrder()
UpdateExposedParameter(String, Object)
Update an exposed parameter value
Declaration
public void UpdateExposedParameter(string guid, object value)
Parameters
Type | Name | Description |
---|---|---|
System. |
guid | GUID of the parameter |
System. |
value | new value |
UpdateExposedParameterName(ExposedParameter, String)
Update the exposed parameter name
Declaration
public void UpdateExposedParameterName(ExposedParameter parameter, string name)
Parameters
Type | Name | Description |
---|---|---|
Exposed |
parameter | The parameter |
System. |
name | new name |
UpdateExposedParameterVisibility(ExposedParameter, Boolean)
Update parameter visibility
Declaration
public void UpdateExposedParameterVisibility(ExposedParameter parameter, bool isHidden)
Parameters
Type | Name | Description |
---|---|---|
Exposed |
parameter | The parameter |
System. |
isHidden | is Hidden |
Events
| Improve this Doc View SourceonEnabled
Triggered when the graph is enabled
Declaration
public event Action onEnabled
Event Type
Type | Description |
---|---|
System. |
onExposedParameterListChanged
Triggered when something is changed in the list of exposed parameters
Declaration
public event Action onExposedParameterListChanged
Event Type
Type | Description |
---|---|
System. |
onExposedParameterModified
Declaration
public event Action<string> onExposedParameterModified
Event Type
Type | Description |
---|---|
System. |
onGraphChanges
Triggered when the graph is changed
Declaration
public event Action<GraphChanges> onGraphChanges
Event Type
Type | Description |
---|---|
System. |