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.

39 lines
1.1 KiB

using System;
using System.Collections.Generic;
using Codice.Client.Common.TreeGrouper;
using TNodeCore.Models;
using TNodeCore.RuntimeCache;
namespace TNodeCore.Runtime{
public class RuntimeNode{
public NodeData NodeData { get; set; }
//the link connect to node's in port
public List<NodeLink> InputLink;
//the link connect to node's out port
public List<NodeLink> OutputLink;
public Type type;
public void SetInput(string portName,object value){
NodeData.SetValue(portName, value);
}
public object GetOutput(string portName){
return NodeData.GetValue(portName);
}
public RuntimeNode(NodeData nodeData){
NodeData = nodeData;
//Caching the type of the node
type = nodeData.GetType();
}
public List<string> GetInputNodesId(){
List<string> dependencies = new List<string>();
foreach (NodeLink link in InputLink)
{
dependencies.Add(link.outPort.nodeDataId);
}
return dependencies;
}
}
}