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

@@ -48,8 +48,8 @@ namespace Misaki.GraphView.Editor
_searchContextElements.Clear();
var types = string.IsNullOrEmpty(_owner.GraphViewConfig.searchNamespace) ?
TypeCache.GetTypesDerivedFrom<SlotContainerNode>().ToArray() :
TypeCache.GetTypesDerivedFrom<SlotContainerNode>().Where(t => !string.IsNullOrEmpty(t.Namespace) && t.Namespace.StartsWith(_owner.GraphViewConfig.searchNamespace)).ToArray();
TypeCache.GetTypesDerivedFrom<ExecutableNode>().ToArray() :
TypeCache.GetTypesDerivedFrom<ExecutableNode>().Where(t => !string.IsNullOrEmpty(t.Namespace) && t.Namespace.StartsWith(_owner.GraphViewConfig.searchNamespace)).ToArray();
foreach (var type in types)
{
@@ -142,14 +142,14 @@ namespace Misaki.GraphView.Editor
var element = (SearchContextElement)searchTreeEntry.userData;
SlotContainerNode node = null;
ExecutableNode node = null;
if (element.Target is ExposedProperty property)
{
node = new PropertyInputNode(property);
node = new PropertyInput(property);
}
else if (element.Target is Type nodeType)
{
node = Activator.CreateInstance(nodeType) as SlotContainerNode;
node = Activator.CreateInstance(nodeType) as ExecutableNode;
}
if (node == null)