Manual

Node

class in Doozy.Engine.Nody.Models / Inherits from ScriptableObject

Description

The Node class is the base class for all nodes
See Also: Graph, Socket, Connection

Properties

  • public bool AllowDuplicateNodeName – Returns TRUE if this node can have the same name as another node

  • public bool AllowEmptyNodeName – Returns TRUE if this node can have an empty node name

  • public bool CanBeDeleted – Returns TRUE if this can be deleted

  • public bool DebugMode – Toggle debug mode for this node

  • public bool Ping – Trigger a visual cue for this node, in the Editor, at runtime. Mostly used when this node has been activated

  • public bool UseFixedUpdate – Activate the OnFixedUpdate method for this node, when it is active

  • public bool UseLateUpdate – Activate the OnLateUpdate method for this node, when it is active

  • public bool UseUpdate – Activate the OnUpdate method for this node, when it is active

  • public Graph ActiveGraph – Returns a reference to the currently active graph

  • public int MinimumInputSocketsCount – The minimum number of input sockets for this node. This value is checked when deleting input sockets

  • public int MinimumOutputSocketsCount – The minimum number of output sockets for this node. This value is checked when deleting output sockets

  • public List<Socket> InputSockets – List of all the input sockets this node has

  • public List<Socket> OutputSockets –  List of all the output sockets this node has

  • public ~NodeType~ NodeType – Returns the type of this node

  • public Socket FirstInputSocket – Returns the first input socket. If there isn’t one, it returns null

  • public Socket FirstOutputSocket – Returns the first output socket. If there isn’t one, it returns null

  • public string GraphId – Returns this node’s parent graph id

  • public string Id – Returns this node’s id

  • public string Name – Returns this node’s name

Public Methods

  • public virtual void Activate(Graph portalGraph) – Activate is called when the parent graph is started and this is a global node

  • public virtual void AddDefaultSockets() – [Editor Only] AddDefaultSockets is used when the node is created, only in the editor, and is intended to inject the default or custom sockets for this particular node type

  • public virtual void CheckForErrors() – [Editor Only] Checks if this node has any errors. Because each type of node can have different errors, this method is used to define said custom errors and reflect that in the NodeGraph (NodeGUI) and in the Inspector (NodeEditor)

  • public virtual void CopyNode(Node original) – Used to create copies

  • public virtual void Deactivate() – Deactivate is called when the parent graph is stopped and this is a global node

  • public virtual float GetDefaultNodeHeight() – [Editor Only] Returns the default node height set in NodySettings

  • public virtual float GetDefaultNodeWidth() – [Editor Only] Returns the default node width set in NodySettings

  • public virtual void InitNode(Graph graph, Vector2 pos, int minimumInputSocketsCount = 1, int minimumOutputSocketsCount = 1) – Initializes the node with the given values

  • public virtual void OnCreate() – [Editor Only] Used when the node is created, only in the editor, and is intended to set the default settings for this particular node type

  • public virtual void OnEnter(Node previousActiveNode, Connection connection) – OnEnterNode is called on the frame when this node becomes active just before any of the node’s Update methods are called for the first time

  • public virtual void OnExit(Node nextActiveNode, Connection connection) – OnExitNode is called just before this node becomes inactive

  • public virtual void OnFixedUpdate() – OnFixedUpdate is called every frame, if the node is enabled and active (FixedUpdate Method)

  • public virtual void OnLateUpdate() – OnLateUpdate is called every frame, if the node is enabled and active (LateUpdate Method)

  • public virtual void OnUpdate() – OnUpdate is called every frame, if the node is enabled and active (Update Method)

  • public Socket AddInputSocket(string socketName, Socket.ConnectionMode connectionMode, List<Vector2> connectionPoints, ~Type` valueType, bool canBeDeleted, bool canBeReordered = true) – Convenience method to add a new input socket to this node

  • public Socket AddInputSocket(string socketName, Socket.ConnectionMode connectionMode, ~Type~ valueType, bool canBeDeleted, bool canBeReordered) – Convenience method to add a new input socket to this node. This socket will have two connection points automatically added to it and they will be to the left of and the right the socket.

  • public Socket AddInputSocket(Socket.ConnectionMode connectionMode, ~Type~ valueType, bool canBeDeleted, bool canBeReordered) – Convenience method to add a new input socket to this node. This socket will have two connection points automatically added to it and they will be to the left of and the right the socket

  • public Socket AddOutputSocket(string socketName, Socket.ConnectionMode connectionMode, List<Vector2> connectionPoints, ~Type~ valueType, bool canBeDeleted, bool canBeReordered) – Convenience method to add a new output socket to this node

  • public Socket AddOutputSocket(string socketName, Socket.ConnectionMode connectionMode, ~Type~ valueType, bool canBeDeleted, bool canBeReordered) – Convenience method to add a new output socket to this node. This socket will have two connection points automatically added to it and they will be to the left of and the right the socket

  • public Socket AddOutputSocket(Socket.ConnectionMode connectionMode, ~Type~ valueType, bool canBeDeleted, bool canBeReordered) – Convenience method to add a new output socket to this node. This socket will have two connection points automatically added to it and they will be to the left of and the right the socket

  • private Socket AddSocket(string socketName, SocketDirection direction, ConnectionMode connectionMode, List<Vector2> connectionPoints, ~Type~ valueType, bool canBeDeleted, bool canBeReordered = true) – Adds a socket to this node

  • public bool CanDeleteSocket(Socket socket) – Returns TRUE if the target socket can be deleted, after checking is it is marked as ‘deletable’ and that by deleting it the node minimum sockets count does not go below the set threshold

  • public bool ContainsConnection(string connectionId) – Returns TRUE if a Connection with the given id can be found on one of this node’s sockets

  • public bool ContainsSocket(string socketId) – Returns TRUE if a Socket with the give id can be found on this node

  • public void Disconnect() – Removes all connections this node has. This means that all Input and Output connections will get removed

  • public void DisconnectFromNode(string nodeId) – Removes all connections to and from the given node id. This means that both Input and Output connections to and from the target node id will get removed

  • public string GenerateNewId() – Generates a new unique node id for this node and returns the newly generated id value

  • public Vector2 GetCenterConnectionPointPosition() – [Editor Only] Returns the default center connection point position for a socket

  • public Connection GetConnection(string connectionId) – Returns a connection, from this node, with the matching connection id. Returns null if no connection with the given id is found

  • public List<string> GetConnectedInputNodesIds() – Returns a id list of all the input nodes connected to this node via its output sockets

  • public List<string> GetConnectedInputSocketsIds() – Returns a id list of all the input sockets connected to this node via its output sockets

  • public List<string> GetConnectedOutputNodesIds() – Returns a id list of all the output nodes connected to this node via its input sockets

  • public List<string> GetConnectedOutputSocketsIds() – Returns a id list of all the output sockets connected to this node via its input sockets

  • public Rect GetFooterRect() – [Editor Only] Returns the Rect of this node’s footer

  • public Rect GetHeaderRect() – [Editor Only] Returns the Rect of this node’s header

  • public float GetHeight() – [Editor Only] Returns the height of this node

  • public Socket GetInputSocketFromId(string socketId) – Returns an input socket, of this node, with the matching socket id. Returns null if no socket with the given id is found

  • public Socket GetInputSocketFromName(string socketName) – Returns an input socket, of this node, with the matching socket name. Returns null if no socket with the given name is found

  • private List<Vector2> GetLeftAndCenterAndRightConnectionPoints() – [Editor Only] Returns a list of three connection points positions to the left of, the center of and right of the socket

  • public Vector2 GetLeftConnectionPointPosition() – [Editor Only] Returns the default left connection point position for a socket

  • public List<Vector2> GetLeftAndRightConnectionPoints() – [Editor Only] Returns a list of two connection points positions to the left of and the right of the socket

  • public Vector2 GetPosition() – [Editor Only] Returns the position of this node

  • public Socket GetOutputSocketFromId(string socketId) – Returns an output socket, of this node, with the matching socket id. Returns null if no socket with the given id is found

  • public Socket GetOutputSocketFromName(string socketName) – Returns an output socket, of this node, with the matching socket name. Returns null if no socket with the given name is found

  • public Rect GetRect() – [Editor Only] Returns the Rect of this node

  • public Vector2 GetRightConnectionPointPosition() – [Editor Only] Returns the default right connection point position for a socket

  • public virtual float GetWidth() – [Editor Only] Returns the width of this node

  • public Vector2 GetSize() – [Editor Only] Returns the size of this node (x is width, y is height)

  • public Socket GetSocketFromId(string socketId) – Returns a socket, of this node, with the matching socket id. Returns null if no socket with the given id is found

  • public Socket GetSocketFromName(string socketName) – Returns a socket, of this node, with the matching socket name. Returns null if no socket with the given name is found

  • public float GetX() – [Editor Only] Returns the x coordinate of this node

  • public float GetY() – [Editor Only] Returns the y coordinate of this node

  • public bool IsConnected() – Returns TRUE if at least one socket is connected

  • public bool IsConnectedToNode(string nodeId) – Returns TRUE if this node is connected to the target nodeId

  • public bool IsConnectedToSocket(string socketId) – Returns TRUE if one of this node’s sockets is connected to the target socket

  • public void RemoveConnection(string connectionId) – Removes the connection with the given id. If a connection with the given id does not exist on this socket, nothing will happen

  • public void SetActiveGraph(Graph graph) – Set the active Graph for this node

  • protected void SetAllowEmptyNodeName(bool value) – [Editor Only] Set to allow this node to have an empty node name

  • protected void SetAllowDuplicateNodeName(bool value) – Set to allow this node to have a duplicate node name

  • public void SetName(string value) – Set the name for this node

  • public void SetNodeType(~NodeType~ nodeType) – [Editor Only] Set this node’s type (used mostly for system nodes)

  • public void SetPosition(Vector2 position) – [Editor Only] Set the position of this node’s Rect

  • public void SetPosition(float x, float y) – [Editor Only] Set the position of this node’s Rect

  • public void SetRect(Rect rect) – [Editor Only] Set the Rect values for this node

  • public void SetRect(Vector2 position, Vector2 size) – [Editor Only] Set the Rect values for this node

  • public void SetRect(float x, float y, float width, float height) – [Editor Only] Set the Rect values for this node

  • public void SetSize(Vector2 size) – [Editor Only] Set the size of this node’s Rect

  • public void SetSize(float width, float height) – [Editor Only] Set the size of this node’s Rect

  • public void SetWidth(float value) – [Editor Only] Set the width of this node’s Rect

  • public void SetHeight(float value) – [Editor Only] Set the height of this node’s Rect

  • public void SetX(float value) – [Editor Only] Set the x coordinate of this node’s Rect

  • public void SetY(float value) – [Editor Only] Set the y coordinate of this node’s Rect