Updated RelayNode;

Added ISlot interface;
Added ProxySlot;
This commit is contained in:
Misaki
2024-11-08 20:56:19 +09:00
parent e15570459c
commit 994297a3f2
22 changed files with 426 additions and 268 deletions

View File

@@ -1,15 +1,13 @@
using System;
using System.Collections.Generic;
using Unity.Properties;
using UnityEditor.UIElements;
using UnityEngine.UIElements;
using Object = UnityEngine.Object;
namespace Misaki.GraphView.Editor.Editor.Helpers
namespace Misaki.GraphView.Editor
{
public class PropertyFieldHelper
{
private static readonly Dictionary<Type, Func<string, VisualElement>> _propertyFieldCreators = new ()
private static readonly Dictionary<Type, Func<string, VisualElement>> _propertyFieldCreators = new()
{
{typeof(float), (s) => new FloatField(s)},
{typeof(int), (s) => new IntegerField(s)},
@@ -18,7 +16,7 @@ namespace Misaki.GraphView.Editor.Editor.Helpers
{typeof(bool), (s) => new Toggle(s)},
{typeof(string), (s) => new TextField(s)}
};
public static VisualElement CreatePropertyField(Type propertyType, object dataSource, PropertyPath bindingPath, string label)
{
if (_propertyFieldCreators.TryGetValue(propertyType, out var creator))