Unity graph tool solution based on different implementation now focused on Unity.Experimental.Graphview
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
809 B

3 years ago
using TNode.Models;
using UnityEngine;
namespace TNode.Editor.Inspector{
public interface INodeDataBinding<out T>:INodeDataBindingBase{
3 years ago
protected T GetValue(){
var fieldInfo = typeof(T).GetField(BindingPath, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance);
//check field type
if (fieldInfo != null && fieldInfo.FieldType == typeof(T)){
return (T)fieldInfo.GetValue(BindingNodeData);
}
else{
Debug.LogError("Wrong Type for current node data");
}
return default;
}
3 years ago
public T Value => GetValue();
public void OnBindingDataUpdate(){
}
3 years ago
}
}