using System; using UnityEngine; namespace Misaki.GraphView { [Serializable] public abstract class DataNode { [SerializeField] protected GraphObject graphObject; [SerializeField] protected string id = Guid.NewGuid().ToString(); public Rect position; public GraphObject GraphObject => graphObject; public string Id => id; /// /// Initialize the node with the graph object, this method is called when the node is added to the graph. /// public virtual void Initialize(GraphObject graph) { graphObject = graph; } /// /// Dispose the node, this method is called when the node is removed from the graph. /// public virtual void Dispose() { graphObject = null; } } }