Example #1
0
    private void CreateGetFlagNodes()
    {
        foreach (var nodeData in _containerCache.GetFlagNodeData)
        {
            var tempNode = _targetGraphView.CreateGetFlagNode(nodeData.FlagName, Vector2.zero);
            tempNode.GUID = nodeData.Guid;
            _targetGraphView.AddElement(tempNode);

            var nodePorts = _containerCache.NodeLinks.Where(x => x.BaseNodeGuid == nodeData.Guid).ToList();
            nodePorts.ForEach(x => {
                if (x.PortName != "Other")
                {
                    _targetGraphView.AddChoicePort(tempNode, x.PortName);
                }
            });

            tempNode.SetPosition(new Rect(
                                     nodeData.Position,
                                     _targetGraphView.defaultNodeSize
                                     ));
        }
    }