using System.Collections.Generic;
namespace XNode
{
[NodeColorHeader(0.1f, 0.1f, 0.1f, 0.35f)]
[NodeColorBody(0.1f, 0.1f, 0.1f, 0.35f)]
[CreateNodeMenu("Group")]
public class NodeGroup : Node
{
public int width = 400;
public int height = 400;
public override object GetValue(NodePort port)
{
return null;
}
/// Gets nodes in this group
public List GetNodes()
{
var result = new List();
foreach (Node node in graph.nodes)
{
if (node == this)
{
continue;
}
if (node == null)
{
continue;
}
if (node.position.x < position.x)
{
continue;
}
if (node.position.y < position.y)
{
continue;
}
if (node.position.x > position.x + width)
{
continue;
}
if (node.position.y > position.y + height + 30)
{
continue;
}
result.Add(node);
}
return result;
}
}
}