Added IExecutable and ISlotContainer interface.
Changed SlotContainerNode to ExecutableNode
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Misaki.GraphView
|
||||
{
|
||||
public static class BaseNodeExtension
|
||||
{
|
||||
public static void ClearAllExecuteFlag(this IList<SlotContainerNode> nodes)
|
||||
{
|
||||
foreach (var node in nodes)
|
||||
{
|
||||
node.ClearExecuteFlag();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Runtime/Helpers/DataNodeExtension.cs
Normal file
18
Runtime/Helpers/DataNodeExtension.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Misaki.GraphView
|
||||
{
|
||||
public static class DataNodeExtension
|
||||
{
|
||||
public static void ClearAllExecuteFlag(this IList<DataNode> nodes)
|
||||
{
|
||||
foreach (var node in nodes)
|
||||
{
|
||||
if (node is IExecutable executable)
|
||||
{
|
||||
executable.ClearExecutionFlag();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,12 @@ namespace Misaki.GraphView
|
||||
for (var i = 0; i < slotCount; i++)
|
||||
{
|
||||
var other = slot.LinkedSlotData[i];
|
||||
var otherSlot = slot.owner.GraphObject.GetNode(other.nodeID).GetSlot(other.slotIndex, other.direction);
|
||||
otherSlot.owner.GetSlot(other.slotIndex, other.direction)?.Unlink(slot);
|
||||
var otherNode = slot.owner.GraphObject.GetNode(other.nodeID);
|
||||
|
||||
if (otherNode is ISlotContainer slotContainer)
|
||||
{
|
||||
slotContainer.GetSlot(other.slotIndex, other.direction)?.Unlink(slot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user