public void init(IComponent c, Node node, NodeMEntity entity, PortOrientation orientation) { //port = CreateInstance("NodePort") as NodePort; parent = node; component = c; parentEntity = entity; // tree = PropertyTree.Create(component); if (orientation == PortOrientation.Out) { port = node.AddDynamicOutput(typeof(bool)); } else { port = node.AddDynamicInput(typeof(bool)); } style = new NodeIComponentStyle(); style.unfolded = false; style.portVisible = false; tree = PropertyTree.Create(component); AssetDatabase.SaveAssets(); }
public NodeIComponent(IComponent c, Node node, PortOrientation orientation) { // port = CreateInstance("NodePort") as NodePort; parent = node; component = c; // tree = PropertyTree.Create(component); if (port == null) { if (orientation == PortOrientation.Out) { port = node.AddDynamicOutput(typeof(bool)); } else { port = node.AddDynamicInput(typeof(bool)); } } style = new NodeIComponentStyle(); style.unfolded = false; style.portVisible = false; tree = PropertyTree.Create(component); }