示例#1
0
        public void Load(ConfigNode node, List <RDNode> nodes)
        {
            string text   = string.Empty;
            RDNode rDNode = null;

            RDNode.Anchor anchor  = RDNode.Anchor.RIGHT;
            RDNode.Anchor anchor2 = RDNode.Anchor.LEFT;
            if (node.HasValue("parentID"))
            {
                text = node.GetValue("parentID");
            }
            if (text != string.Empty)
            {
                rDNode = this.FindNodeByID(text, nodes);
            }
            if (rDNode != null)
            {
                if (node.HasValue("lineFrom"))
                {
                    anchor = (RDNode.Anchor)((int)Enum.Parse(typeof(RDNode.Anchor), node.GetValue("lineFrom")));
                }
                if (node.HasValue("lineTo"))
                {
                    anchor2 = (RDNode.Anchor)((int)Enum.Parse(typeof(RDNode.Anchor), node.GetValue("lineTo")));
                }
                this.parent = new RDParentAnchor(rDNode, anchor);
                this.anchor = anchor2;
            }
            else
            {
                Debug.LogError("No RDNode registered with id " + text + "!");
            }
        }
示例#2
0
        public void Load(ConfigNode node)
        {
            this._config = node;
            ConfigNode[] nodes = node.GetNodes("RDNode");
            int          num   = nodes.Length;

            for (int i = 0; i < num; i++)
            {
                ConfigNode node2  = nodes[i];
                RDNode     rDNode = new RDNode();
                rDNode.Load(node2);
                rDNode.LoadParts();
                this._nodes.Add(rDNode);
            }
            for (int j = 0; j < num; j++)
            {
                this._nodes[j].LoadLinks(nodes[j], this._nodes);
            }
        }