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.Collections.Generic.List<CommentBlock> |
edges
Json list of edges
Declaration
[SerializeField]
public List<SerializableEdge> edges
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<SerializableEdge> |
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.Collections.Generic.Dictionary<System.String, SerializableEdge> |
exposedParameters
All exposed parameters in the graph
Declaration
[SerializeField]
public List<ExposedParameter> exposedParameters
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<ExposedParameter> |
nodes
List of all the nodes in the graph.
Declaration
[NonSerialized]
public List<BaseNode> nodes
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<BaseNode> |
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.Collections.Generic.Dictionary<System.String, BaseNode> |
pinnedElements
All pinned elements in the graph
Declaration
[SerializeField]
public List<PinnedElement> pinnedElements
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<PinnedElement> |
position
Declaration
public Vector3 position
Field Value
Type | Description |
---|---|
UnityEngine.Vector3 |
scale
Declaration
public Vector3 scale
Field Value
Type | Description |
---|---|
UnityEngine.Vector3 |
serializedNodes
Json list of nodes (Serialized)
Declaration
[SerializeField]
public List<JsonElement> serializedNodes
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<JsonElement> |
Properties
| Improve this Doc View SourceisEnabled
Declaration
public bool isEnabled { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceAddCommentBlock(CommentBlock)
Add a group
Declaration
public void AddCommentBlock(CommentBlock block)
Parameters
Type | Name | Description |
---|---|---|
CommentBlock | block |
AddExposedParameter(String, Type, Object)
Add an exposed parameter
Declaration
public string AddExposedParameter(string name, Type type, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | parameter name |
System.Type | type | parameter type |
System.Object | value | default value |
Returns
Type | Description |
---|---|
System.String |
AddNode(BaseNode)
Adds a node to the graph
Declaration
public BaseNode AddNode(BaseNode node)
Parameters
Type | Name | Description |
---|---|---|
BaseNode | node |
Returns
Type | Description |
---|---|
BaseNode |
ClosePinned(Type)
Closes a pinned element of type viewType
Declaration
public void ClosePinned(Type viewType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | 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 |
---|---|---|
NodePort | inputPort | input port |
NodePort | outputPort | output port |
System.Boolean | autoDisconnectInputs |
Returns
Type | Description |
---|---|
SerializableEdge | 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 |
---|---|---|
BaseNode | inputNode | input node |
System.String | inputFieldName | input field name |
BaseNode | outputNode | output node |
System.String | outputFieldName | output field name |
Disconnect(SerializableEdge)
Disconnect an edge
Declaration
public void Disconnect(SerializableEdge edge)
Parameters
Type | Name | Description |
---|---|---|
SerializableEdge | edge |
Disconnect(String)
Disconnect an edge
Declaration
public void Disconnect(string edgeGUID)
Parameters
Type | Name | Description |
---|---|---|
System.String | edgeGUID |
GetExposedParameter(String)
Get the exposed parameter from name
Declaration
public ExposedParameter GetExposedParameter(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | name |
Returns
Type | Description |
---|---|
ExposedParameter | the parameter or null |
GetExposedParameterFromGUID(String)
Get exposed parameter from GUID
Declaration
public ExposedParameter GetExposedParameterFromGUID(string guid)
Parameters
Type | Name | Description |
---|---|---|
System.String | guid | GUID of the parameter |
Returns
Type | Description |
---|---|
ExposedParameter | The parameter |
GetParameterValue(String)
Get the parameter value
Declaration
public object GetParameterValue(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | parameter name |
Returns
Type | Description |
---|---|
System.Object | value |
GetParameterValue<T>(String)
Get the parameter value template
Declaration
public T GetParameterValue<T>(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | 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.Type | viewType | type of the pinned element |
Returns
Type | Description |
---|---|
PinnedElement | the pinned element |
RemoveCommentBlock(CommentBlock)
Removes a group
Declaration
public void RemoveCommentBlock(CommentBlock block)
Parameters
Type | Name | Description |
---|---|---|
CommentBlock | block |
RemoveExposedParameter(ExposedParameter)
Remove an exposed parameter
Declaration
public void RemoveExposedParameter(ExposedParameter ep)
Parameters
Type | Name | Description |
---|---|---|
ExposedParameter | ep | the parameter to remove |
RemoveExposedParameter(String)
Remove an exposed parameter
Declaration
public void RemoveExposedParameter(string guid)
Parameters
Type | Name | Description |
---|---|---|
System.String | guid | GUID of the parameter |
RemoveNode(BaseNode)
Removes a node from the graph
Declaration
public void RemoveNode(BaseNode node)
Parameters
Type | Name | Description |
---|---|---|
BaseNode | 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.String | name | name of the parameter |
System.Object | value | new value |
Returns
Type | Description |
---|---|
System.Boolean | 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.Type | t1 | |
System.Type | t2 |
Returns
Type | Description |
---|---|
System.Boolean |
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.String | guid | GUID of the parameter |
System.Object | value | new value |
UpdateExposedParameterName(ExposedParameter, String)
Update the exposed parameter name
Declaration
public void UpdateExposedParameterName(ExposedParameter parameter, string name)
Parameters
Type | Name | Description |
---|---|---|
ExposedParameter | parameter | The parameter |
System.String | name | new name |
UpdateExposedParameterVisibility(ExposedParameter, Boolean)
Update parameter visibility
Declaration
public void UpdateExposedParameterVisibility(ExposedParameter parameter, bool isHidden)
Parameters
Type | Name | Description |
---|---|---|
ExposedParameter | parameter | The parameter |
System.Boolean | 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.Action |
onExposedParameterListChanged
Triggered when something is changed in the list of exposed parameters
Declaration
public event Action onExposedParameterListChanged
Event Type
Type | Description |
---|---|
System.Action |
onExposedParameterModified
Declaration
public event Action<string> onExposedParameterModified
Event Type
Type | Description |
---|---|
System.Action<System.String> |
onGraphChanges
Triggered when the graph is changed
Declaration
public event Action<GraphChanges> onGraphChanges
Event Type
Type | Description |
---|---|
System.Action<GraphChanges> |