Added IExecutable and ISlotContainer interface.
Changed SlotContainerNode to ExecutableNode
This commit is contained in:
35
Runtime/Models/Nodes/DataNode.cs
Normal file
35
Runtime/Models/Nodes/DataNode.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user