Added IExecutable and ISlotContainer interface.

Changed SlotContainerNode to ExecutableNode
This commit is contained in:
Misaki
2024-11-05 02:25:15 +09:00
parent 7eec130b39
commit c853994bf5
51 changed files with 443 additions and 400 deletions

View File

@@ -0,0 +1,35 @@
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;
}
}
}