Files
com.misaki.graph-view/Runtime/Models/Nodes/DataNode.cs
Misaki c853994bf5 Added IExecutable and ISlotContainer interface.
Changed SlotContainerNode to ExecutableNode
2024-11-05 02:25:15 +09:00

35 lines
917 B
C#

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;
/// <summary>
/// Initialize the node with the graph object, this method is called when the node is added to the graph.
/// </summary>
public virtual void Initialize(GraphObject graph)
{
graphObject = graph;
}
/// <summary>
/// Unload the node, this method is called when the node is removed from the graph.
/// </summary>
public virtual void Dispose()
{
graphObject = null;
}
}
}