void SetNodes(NodeData[] nodes) { var attributesCounter = 0; foreach (NodeData node in nodes) { var newNode = nodeFactory.GetNode(node); Constellation.AddNode(newNode, node.Guid); if (IsAttribute(node) && Attributes != null) { IAttribute nodeAttribute = newNode.NodeType as IAttribute; if (node.Name != "ObjectAttribute" && attributesCounter < Attributes.Count) { nodeAttribute.SetAttribute(Attributes[attributesCounter].Variable); } else if (attributesCounter < Attributes.Count) { nodeAttribute.SetAttribute(new Variable().Set(Attributes[attributesCounter].UnityObject as object)); } attributesCounter++; } } }