void PrintAllChildren(GameObject _Node) { Debug.Log(_Node.name); if (_Node.GetComponent <NodeRenderer>().GetNodeChildrenList().Count != 0) { foreach (GameObject EachNode in _Node.GetComponent <NodeRenderer>().GetNodeChildrenList()) { PrintAllChildren(EachNode); NewNodeController.CreateNodeConnection(_Node, EachNode, GameObject_NodeConnection, Color.red); } } }
public void OnBeginDrag(PointerEventData _EventData) { NodeController NewNodeController = GameObject.Find("GameController").GetComponent <NodeController>(); NewNodeUtilityGroup = Instantiate(GameObject_NodeUtilityGroup, transform.position, Quaternion.identity, GameObject.Find("NodeGroup").transform) as GameObject; Original_Position = NewNodeUtilityGroup.transform.TransformPoint(0, 0, 0); NewNodeUtilityGroup.name = "New Node Utility Group"; ClearNode(); CreateNewNode(); NewNodeUtilityGroup.GetComponent <NodeUtilityGroupRenderer> ().SetNewNode(NewNode); NewNodeUtilityGroup.GetComponent <NodeUtilityGroupRenderer> ().SetIsDraggable(true); NewNodeUtilityGroup.GetComponent <NodeUtilityGroupRenderer> ().SetIsNewPosition(false); NewNodeConnection = NewNodeController.CreateNodeConnection(OriginalNode, NewNode, GameObject_NodeConnection, Color.red); GeneratePossiblePositions(); }