1.node links correctly

main
taoria 3 years ago
parent 0a4e3a0ca5
commit 4c6f83ddf3
  1. 2
      Sample/MathGraph/Editor/MathEditor.cs.meta
  2. 18
      Sample/MathGraph/Editor/NodeAttribute Editor Config.asset
  3. 2
      Sample/MathGraph/Editor/NodeAttribute Editor Config.asset.meta
  4. 3
      TNode/BaseModels.meta
  5. 3
      TNode/BaseModels/Interfaces.meta
  6. 5
      TNode/BaseModels/Interfaces/IEditorOnlyModel.cs
  7. 3
      TNode/BaseModels/Interfaces/IEditorOnlyModel.cs.meta
  8. 5
      TNode/BaseModels/Interfaces/IModel.cs
  9. 3
      TNode/BaseModels/Interfaces/IModel.cs.meta
  10. 78
      TNode/Editor/BaseViews/DataGraphView.cs
  11. 25
      TNode/Editor/BaseViews/SimpleGraphSubWindow.cs
  12. 18
      TNode/Editor/Cache/NodeEditorExtensions.cs
  13. 3
      TNode/Editor/EditorPersistence.meta
  14. 3
      TNode/Editor/EditorPersistence/GraphEditorData.cs
  15. 0
      TNode/Editor/EditorPersistence/GraphEditorData.cs.meta
  16. 9
      TNode/Editor/EditorPersistence/IGraphViewPersistence.cs
  17. 3
      TNode/Editor/EditorPersistence/IGraphViewPersistence.cs.meta
  18. 0
      TNode/Editor/EditorPersistence/NodeEditorData.cs
  19. 0
      TNode/Editor/EditorPersistence/NodeEditorData.cs.meta
  20. 5
      TNode/Editor/EditorPersistence/SubWindowEditorData.cs
  21. 3
      TNode/Editor/EditorPersistence/SubWindowEditorData.cs.meta
  22. 3
      TNode/Editor/GraphEditor.cs
  23. 3
      TNode/Editor/SearchWindowProvider.cs
  24. 3
      TNode/Editor/Tools/NodeCreator.meta
  25. 25
      TNode/Editor/Tools/NodeCreator/NodeHelper.cs
  26. 3
      TNode/Editor/Tools/NodeCreator/NodeHelper.cs.meta
  27. 3
      TNode/JsonSerialize.meta
  28. 22
      TNode/JsonSerialize/JsonSerializeTool.cs
  29. 3
      TNode/JsonSerialize/JsonSerializeTool.cs.meta
  30. 42
      TNode/JsonSerialize/NodeDataConverter.cs
  31. 3
      TNode/JsonSerialize/NodeDataConverter.cs.meta
  32. 29
      TNode/JsonSerialize/Vector3Converter.cs
  33. 3
      TNode/JsonSerialize/Vector3Converter.cs.meta
  34. 15
      TNode/Models/GraphData.cs
  35. 5
      TNode/Models/NodeData.cs
  36. 18
      TNode/Runtime/RuntimeNode.cs
  37. 3
      TNode/RuntimeCache.meta
  38. 52
      TNode/RuntimeCache/RuntimeCache.cs
  39. 3
      TNode/RuntimeCache/RuntimeCache.cs.meta
  40. 3
      TNode/Tools.meta
  41. 2
      TNode/Tools/NodeDataWrapper.cs
  42. 0
      TNode/Tools/NodeDataWrapper.cs.meta

@ -6,7 +6,7 @@ MonoImporter:
defaultReferences:
- m_ViewDataDictionary: {instanceID: 0}
- mVisualTreeAsset: {fileID: 9197481963319205126, guid: b67f6dcbe2361b649ad2b7845207321b, type: 3}
- nodeEditorData: {fileID: 11400000, guid: acb7b8ebcdf5f4f40bccf1e405c94da3, type: 2}
- graphEditorData: {fileID: 11400000, guid: f582a62cc8e00144f97b4dff1f9ba8cc, type: 2}
executionOrder: 0
icon: {instanceID: 0}
userData:

@ -9,19 +9,7 @@ MonoBehaviour:
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cde084f079a7426daa86ed86cb80ed1b, type: 3}
m_Name: MathEditor
m_Script: {fileID: 11500000, guid: 99ad0af56b40495cb6bd6165e652266c, type: 3}
m_Name: NodeAttribute Editor Config
m_EditorClassIdentifier:
nodeData:
rid: -2
nodePos:
serializedVersion: 2
x: 0
y: 0
width: 0
height: 0
references:
version: 2
RefIds:
- rid: -2
type: {class: , ns: , asm: }
nodesData: []

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: acb7b8ebcdf5f4f40bccf1e405c94da3
guid: f582a62cc8e00144f97b4dff1f9ba8cc
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 54cbaedb5bd248f68813368e888d8854
timeCreated: 1655969230

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: a3385746bf2c4f7699ac027dcb138a53
timeCreated: 1656129728

@ -1,5 +0,0 @@
namespace TNode.BaseModels{
public interface IEditorOnlyModel{
}
}

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 051a8933e6bf4b4ebdff2df9be042774
timeCreated: 1655969265

@ -1,5 +0,0 @@
namespace TNode.BaseModels{
public interface IModel{
}
}

@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 86896378e3c14a3dbf1e736b039f9acc
timeCreated: 1655969210

@ -6,10 +6,12 @@ using TNode.Cache;
using TNode.Editor.Inspector;
using TNode.Editor.Model;
using TNode.Models;
using Unity.VisualScripting;
using UnityEditor;
using UnityEditor.Experimental.GraphView;
using UnityEngine;
using UnityEngine.UIElements;
using Edge = UnityEditor.Experimental.GraphView.Edge;
namespace TNode.Editor.BaseViews{
/*
@ -107,9 +109,13 @@ namespace TNode.Editor.BaseViews{
*/
public abstract class DataGraphView<T>:GraphView,IDataGraphView where T:GraphData{
private T _data;
private SearchWindowProvider _searchWindowProvider;
private bool _isInspectorOn;
private SearchWindowProvider _searchWindowProvider;
private NodeInspector _nodeInspector;
public GraphEditor<T> Owner;
private Dictionary<string,Node> _nodeDict = new();
public T Data{
get{ return _data; }
set{
@ -129,8 +135,8 @@ namespace TNode.Editor.BaseViews{
foreach (var edge in edges){
RemoveElement(edge);
}
Dictionary<string,Node> nodeDict = new Dictionary<string, Node>();
if (nodeDict == null) throw new ArgumentNullException(nameof(nodeDict));
if (_nodeDict == null) throw new ArgumentNullException(nameof(_nodeDict));
foreach (var dataNode in _data.NodeDictionary.Values){
if(dataNode==null)
continue;
@ -138,25 +144,18 @@ namespace TNode.Editor.BaseViews{
//Get the node type
var nodeType = dataNode.GetType();
//Get the derived type of NodeAttribute View from the node type
var nodeViewType = typeof(NodeView<>).MakeGenericType(nodeType);
//Fetch the node view from the node view type
var nodeView = NodeEditorExtensions.CreateInstance(nodeViewType);
//Cast the node view to the nodeViewType
AddElement((Node)nodeView);
var nodePos = Owner.graphEditorData.nodesData.
FirstOrDefault(x => x.nodeGuid == dataNode.id)?.nodePos??new Rect(0,0,200,200);
((INodeView)nodeView).SetNodeData(dataNode);
//Add the node view to the node dictionary
nodeDict.Add(dataNode.id, (Node)nodeView);
AddTNode(dataNode,nodePos);
}
foreach (var edge in _data.NodeLinks){
foreach (var edge in _data.nodeLinks){
var inputNode = _data.NodeDictionary[edge.inPort.nodeDataId];
var outputNode = _data.NodeDictionary[edge.outPort.nodeDataId];
var inputNodeView = nodeDict[inputNode.id];
var outputNodeView = nodeDict[outputNode.id];
var inputNodeView = _nodeDict[inputNode.id];
var outputNodeView = _nodeDict[outputNode.id];
Edge newEdge = new Edge(){
input = inputNodeView.inputContainer.Q<Port>(edge.inPort.portName),
output = outputNodeView.outputContainer.Q<Port>(edge.outPort.portName)
@ -165,7 +164,7 @@ namespace TNode.Editor.BaseViews{
newEdge.output?.Connect(newEdge);
AddElement(newEdge);
}
nodeDict.Clear();
_nodeDict.Clear();
}
//A Constructor for the DataGraphView ,never to override it
public DataGraphView(){
@ -235,9 +234,11 @@ namespace TNode.Editor.BaseViews{
}
public void SaveEditorData(GraphEditorData graphEditorData){
graphEditorData.nodesData.Clear();
graphEditorData.nodesData?.Clear();
//iterator nodes
if (graphEditorData.nodesData == null){
graphEditorData.nodesData = new List<NodeEditorData>();
}
foreach (var node in this.nodes){
var nodeEditorData = new NodeEditorData{
nodePos = node.GetPosition(),
@ -249,25 +250,14 @@ namespace TNode.Editor.BaseViews{
EditorUtility.SetDirty(graphEditorData);
}
}
public void LoadEditorData(GraphEditorData graphEditorData){
//Load node position
foreach (var nodeEditorData in graphEditorData.nodesData){
var node = this.nodes.Select(x => x as INodeView).First(x=>x?.GetNodeData().id==nodeEditorData.nodeGuid);
if (node != null){
((GraphElement)node).SetPosition(nodeEditorData.nodePos);
}
}
}
public void SaveWithEditorData(GraphEditorData graphEditorData){
SaveEditorData(graphEditorData);
SaveGraphData();
}
private void SaveGraphData(){
private void SaveNode(){
foreach (var node in nodes){
if (node is INodeView nodeView){
var nodeData = nodeView.GetNodeData();
@ -276,11 +266,13 @@ namespace TNode.Editor.BaseViews{
}
}
}
//force edge to write as links
}
private void SaveEdge(){
foreach (var edge in edges){
var inputNode = edge.input.node as INodeView;
var outputNode = edge.output.node as INodeView;
var links = new List<NodeLink>();
Debug.Log($"Edge{inputNode},{outputNode}");
if (inputNode != null && outputNode != null){
var inputNodeData = inputNode.GetNodeData();
var outputNodeData = outputNode.GetNodeData();
@ -292,15 +284,24 @@ namespace TNode.Editor.BaseViews{
nodeDataId = outputNodeData.id,
portName = edge.output.name
});
links.Add(newNodeLink);
}
_data.NodeLinks = links;
_data.nodeLinks = links;
}
}
private void SaveGraphData(){
_data.NodeDictionary.Clear();
SaveNode();
SaveEdge();
EditorUtility.SetDirty(_data);
AssetDatabase.SaveAssets();
}
public override List<Port> GetCompatiblePorts(Port startPort, NodeAdapter nodeAdapter){
return ports.Where(x => x.portType == startPort.portType).ToList();
}
@ -316,7 +317,7 @@ namespace TNode.Editor.BaseViews{
}
public void AddTNode(NodeData nodeData, Rect rect){
if (NodeEditorExtensions.CreateNodeViewFromNodeType(nodeData.GetType()) is GraphElement nodeView){
if (NodeEditorExtensions.CreateNodeViewFromNodeType(nodeData.GetType()) is Node nodeView){
nodeView.SetPosition(rect);
AddElement(nodeView);
//Add a select callback to the nodeView
@ -333,6 +334,7 @@ namespace TNode.Editor.BaseViews{
if(nodeView is INodeView nodeViewInterface){
nodeViewInterface.SetNodeData(nodeData);
}
_nodeDict.Add(nodeData.id, nodeView);
}
}

@ -1,9 +1,12 @@
using UnityEditor;
using System.Linq;
using TNode.Editor;
using TNode.Editor.EditorPersistence;
using UnityEditor;
using UnityEditor.Experimental.GraphView;
using UnityEngine.UIElements;
namespace TNode.BaseViews{
public class SimpleGraphSubWindow:GraphElement{
public class SimpleGraphSubWindow:GraphElement,IGraphViewPersistence{
private readonly Dragger _dragger = new Dragger();
protected void ConstructWindowBasicSetting(){
@ -32,5 +35,23 @@ namespace TNode.BaseViews{
ConstructWindowBasicSetting();
BuildWindow(visualTreeAsset);
}
public string GetPersistenceId(){
throw new System.NotImplementedException();
}
public void ResetPos(GraphEditorData editorData){
var res = editorData.subWindowPos.FirstOrDefault(x => x.nodeGuid == this.GetPersistenceId());
}
public void SavePos(GraphEditorData editorData){
}
public void OnRemoveFromGraph(GraphEditorData editorData){
}
}
}

@ -81,9 +81,21 @@ namespace TNode.Cache{
return instance;
}
public static object CreateInstance(Type t){
var implementedType = NodeEditorSingleton.Instance.FromGenericToSpecific[t];
var instance = Activator.CreateInstance(implementedType);
return instance;
if (NodeEditorSingleton.Instance.FromGenericToSpecific.ContainsKey(t)){
var implementedType = NodeEditorSingleton.Instance.FromGenericToSpecific[t];
var instance = Activator.CreateInstance(implementedType);
return instance;
}
else{
Debug.Log($"No given type found {t}");
//check if t is a generic type node view
if (t is{IsGenericType: true} && t.GetGenericTypeDefinition() == typeof(NodeView<>)){
var instance = Activator.CreateInstance(typeof(NodeView<NodeData>));
return instance;
}
return null;
}
}
public static bool HasSpecificType<T>() where T : class{

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: dbf5832fcb3240429c6ca4e68ee28ef9
timeCreated: 1656924665

@ -1,4 +1,5 @@
using System.Collections.Generic;
using TNode.Editor.EditorPersistence;
using TNode.Editor.Model;
using UnityEngine;
@ -7,6 +8,8 @@ namespace TNode.Editor{
[CreateAssetMenu(fileName = "NodeAttribute Editor Config", menuName = "TNode/NodeAttribute Editor Config")]
public class GraphEditorData:ScriptableObject{
public List<NodeEditorData> nodesData;
public List<NodeEditorData> subWindowPos;
public List<IGraphViewPersistence> graphViewPersistence;
}
}

@ -0,0 +1,9 @@
namespace TNode.Editor.EditorPersistence{
public interface IGraphViewPersistence{
public string GetPersistenceId();
public void ResetPos(GraphEditorData editorData);
public void SavePos(GraphEditorData editorData);
public void OnRemoveFromGraph(GraphEditorData editorData);
}
}

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 98a1e33328e84b9fa71241f2a1ce42a1
timeCreated: 1656924679

@ -0,0 +1,5 @@
namespace TNode.Editor.EditorPersistence{
public class SubWindowEditorData{
}
}

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 5c5b739c655d41fb995c162a2db9db48
timeCreated: 1656925041

@ -75,10 +75,13 @@ namespace TNode.Editor{
T asset = ScriptableObject.CreateInstance<T>();
AssetDatabase.CreateAsset(asset, path);
AssetDatabase.SaveAssets();
}
}
else{
_graphView.SaveWithEditorData(graphEditorData);
AssetDatabase.Refresh();
}
}

@ -4,6 +4,7 @@ using System.Drawing;
using TNode.BaseViews;
using TNode.Cache;
using TNode.Editor.BaseViews;
using TNode.Editor.Tools.NodeCreator;
using TNode.Models;
using UnityEditor;
using UnityEditor.Experimental.GraphView;
@ -47,7 +48,7 @@ namespace TNode.Editor{
//Check if type is derived from NodeData
if (typeof(NodeData).IsAssignableFrom(type)){
//Make an instance of the type
if (Activator.CreateInstance(type) is NodeData nodeData){
if (NodeHelper.InstantiateNodeData(type) is { } nodeData){
nodeData.nodeName = "New Node";
((IDataGraphView) _graphView).AddTNode(nodeData, new Rect(localPos.x, localPos.y, 100, 100));
}

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: c5671acbef854a59a67a63c3bab58547
timeCreated: 1656911640

@ -0,0 +1,25 @@
using System;
using TNode.Models;
namespace TNode.Editor.Tools.NodeCreator{
public static class NodeHelper{
/// <summary>
/// always use this to create a new node.
/// </summary>
/// <typeparam name="T"></typeparam>
public static T InstantiateNodeData<T>() where T:NodeData{
var res = Activator.CreateInstance<T>();
res.id = Guid.NewGuid().ToString();
return res;
}
public static NodeData InstantiateNodeData(Type type){
if (Activator.CreateInstance(type) is NodeData res){
res.id = Guid.NewGuid().ToString();
return res;
}
return null;
}
}
}

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a7ebee12f44e439ca625f715a43510fc
timeCreated: 1656911665

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: ec6119d082a947f58ed6402290b65596
timeCreated: 1656817965

@ -0,0 +1,22 @@
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace TNode.JsonSerialize{
public class JsonSerializeTool{
public static JsonSerializerSettings JsonSerializerSettings = new JsonSerializerSettings(){
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
NullValueHandling = NullValueHandling.Ignore,
DateFormatString = "yyyy-MM-dd HH:mm:ss",
Converters = new List<JsonConverter> { new Vector3Converter() },
TypeNameHandling = TypeNameHandling.Auto
};
public static JsonSerializerSettings InternalJsonSerializerSettings = new JsonSerializerSettings(){
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
NullValueHandling = NullValueHandling.Ignore,
Formatting = Formatting.Indented
};
}
}

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 14067671fe28434e9ae2e67a34074c52
timeCreated: 1656819161

@ -0,0 +1,42 @@
using System;
using Newtonsoft.Json;
using TNode.Models;
using UnityEngine;
namespace TNode.JsonSerialize{
public class NodeDataConverter:JsonConverter<NodeData>{
public override void WriteJson(JsonWriter writer, NodeData value, JsonSerializer serializer){
//Write node data with type information
writer.WriteStartObject();
writer.WritePropertyName("type");
Debug.Log(value.GetType().ToString());
writer.WriteValue(value.GetType().Name);
writer.WritePropertyName("data");
serializer.Serialize(writer, value, value.GetType());
writer.WriteEndObject();
}
public override NodeData ReadJson(JsonReader reader, Type objectType, NodeData existingValue, bool hasExistingValue,
JsonSerializer serializer){
//Load type info
reader.Read();
if (reader.Value != null){
var type = reader.Value.ToString();
if (type.Trim().Length==0){
Debug.LogError(type);
throw new JsonSerializationException("Type name is empty");
}
reader.Read();
//Load data
var data = serializer.Deserialize(reader, Type.GetType(type));
return (NodeData) data;
}
return null;
}
}
}

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6f960539f2744729b35ff3011677d8ba
timeCreated: 1656857829

@ -0,0 +1,29 @@
using System;
using System.Numerics;
using Newtonsoft.Json;
namespace TNode.JsonSerialize{
public class Vector3Converter:JsonConverter<Vector3>{
public override void WriteJson(JsonWriter writer, Vector3 value, JsonSerializer serializer){
writer.WriteStartArray();
writer.WriteValue(value.X);
writer.WriteValue(value.Y);
writer.WriteValue(value.Z);
writer.WriteEndArray();
}
public override Vector3 ReadJson(JsonReader reader, Type objectType, Vector3 existingValue, bool hasExistingValue, JsonSerializer serializer){
if (reader.TokenType == JsonToken.Null){
return default(Vector3);
}
else{
var array = serializer.Deserialize<float[]>(reader);
if (array != null) return new Vector3(array[0], array[1], array[2]);
}
return default(Vector3);
}
}
}

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: fecb77054ad348239341a58c50549879
timeCreated: 1656817975

@ -2,26 +2,33 @@
using System.Collections.Generic;
using UnityEngine;
using Newtonsoft.Json;
using TNode.JsonSerialize;
using UnityEngine.Serialization;
namespace TNode.Models{
[Serializable]
public class GraphData:ScriptableObject,ISerializationCallbackReceiver{
[SerializeField]
public Dictionary<string,NodeData> NodeDictionary = new Dictionary<string,NodeData>();
public List<NodeLink> NodeLinks = new List<NodeLink>();
public List<NodeLink> nodeLinks = new List<NodeLink>();
[SerializeField]
[HideInInspector]
[TextArea]
//[HideInInspector]
private string jsonObject;
public void OnBeforeSerialize(){
var serializedData = JsonConvert.SerializeObject(NodeDictionary);
var serializedData = JsonConvert.SerializeObject(NodeDictionary,JsonSerializeTool.JsonSerializerSettings);
jsonObject = serializedData;
}
public void OnAfterDeserialize(){
var deserializedData = JsonConvert.DeserializeObject<Dictionary<string,NodeData>>(jsonObject);
var deserializedData = JsonConvert.DeserializeObject<Dictionary<string,NodeData>>(jsonObject,JsonSerializeTool.JsonSerializerSettings);
var deserializedData2 = JsonUtility.FromJson<Dictionary<string,NodeData>>(jsonObject);
NodeDictionary = deserializedData;
Debug.Log("hi");
}
}
}

@ -1,6 +1,5 @@
using System;
using TNode.Attribute;
using TNode.BaseModels;
using UnityEngine;
namespace TNode.Models{
@ -12,11 +11,11 @@ namespace TNode.Models{
///
/// </summary>
[Serializable]
public class NodeData:IModel{
public class NodeData{
public NodeData() : base(){
//Object Registration
id = Guid.NewGuid().ToString();
}
[DisableOnInspector]
public string id;

@ -1,9 +1,21 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using TNode.Models;
namespace TNode.Runtime{
public class RuntimeNode{
public NodeData NodeData { get; set; }
public class RuntimeNode<T> where T:NodeData{
public T NodeData{ get; set; }
//Links related to runtime node,for fast access.only remember out links
public List<NodeLink> NodeLinks;
public void Process(){
var outputPorts = NodeLinks.Select(x => x.outPort.portName);
}
}
}

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1edb71c09fe64f77ba81a14e0e0fceb8
timeCreated: 1656762418

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using JetBrains.Annotations;
using TNode.Models;
using Unity.VisualScripting;
using UnityEngine.UI;
namespace TNode.RuntimeCache{
public class RuntimeCache{
//Singleton instance for the runtime cache
private static RuntimeCache _instance;
public static RuntimeCache Instance{
get{ return _instance ??= new RuntimeCache(); }
}
//delegate return a value from a nodedata
public delegate object GetValueDelegate(NodeData nodeData);
public readonly Dictionary<Type, List<GetValueDelegate>> CachedDelegatesForGettingValue =
new ();
public void ExecuteOutput<T>(T nodeData) where T:NodeData{
var type = typeof(T);
if(!CachedDelegatesForGettingValue.ContainsKey(type)){
return;
}
var delegates = CachedDelegatesForGettingValue[type];
foreach(var delegateInstance in delegates){
var value = delegateInstance(nodeData);
}
}
public void RegisterRuntimeNode<T>() where T:NodeData{
var type = typeof(T);
if(!CachedDelegatesForGettingValue.ContainsKey(type)){
CachedDelegatesForGettingValue.Add(type, new List<GetValueDelegate>());
}
//iterate properties of the nodeData and add them to the cache
var properties = type.GetProperties();
foreach(var property in properties){
var getValueDelegate = GetValueDelegateForProperty(property);
CachedDelegatesForGettingValue[type].Add(getValueDelegate);
}
}
private GetValueDelegate GetValueDelegateForProperty(PropertyInfo property){
var getValueDelegate = (GetValueDelegate)Delegate.CreateDelegate(typeof(GetValueDelegate), property.GetGetMethod());
return getValueDelegate;
}
}
}

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4557d67036a046a2a3d8f8cf6843624d
timeCreated: 1656762426

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 206b9a7ba6b54706b02c6aa2cb9a18b0
timeCreated: 1656762017

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using TNode.Models;
using UnityEngine;
namespace TNode.Editor{
public class NodeDataWrapper{
@ -33,6 +34,7 @@ namespace TNode.Editor{
if (wrapper == null)
return null;
return wrapper._data;
}
public static implicit operator NodeDataWrapper(NodeData unWrapper){
if (unWrapper == null)
Loading…
Cancel
Save