Added defualt graph properties inspector;

Added sticky note;

Changed the name of BaseNode to SlotContainerNode in case we need other type of nodes in the future;
This commit is contained in:
Misaki
2024-11-04 01:02:30 +09:00
parent 5a9d8b9420
commit 7eec130b39
53 changed files with 517 additions and 436 deletions

View File

@@ -48,8 +48,8 @@ namespace Misaki.GraphView.Editor
_searchContextElements.Clear();
var types = string.IsNullOrEmpty(_owner.GraphViewConfig.searchNamespace) ?
TypeCache.GetTypesDerivedFrom<BaseNode>().ToArray() :
TypeCache.GetTypesDerivedFrom<BaseNode>().Where(t => !string.IsNullOrEmpty(t.Namespace) && t.Namespace.StartsWith(_owner.GraphViewConfig.searchNamespace)).ToArray();
TypeCache.GetTypesDerivedFrom<SlotContainerNode>().ToArray() :
TypeCache.GetTypesDerivedFrom<SlotContainerNode>().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;
BaseNode node = null;
SlotContainerNode node = null;
if (element.Target is ExposedProperty property)
{
node = new PropertyInputNode(property);
}
else if (element.Target is Type nodeType)
{
node = Activator.CreateInstance(nodeType) as BaseNode;
node = Activator.CreateInstance(nodeType) as SlotContainerNode;
}
if (node == null)