コード例 #1
0
 public void AddMethod(NodeInfoItem n)
 {
     listMethods.Add(n);
 }
コード例 #2
0
 public void DeleteNodeInfo(NodeInfoItem info)
 {
     listProperty.Remove(info);
     listMethods.Remove(info);
 }
コード例 #3
0
 public void AddField(NodeInfoItem n)
 {
     listProperty.Add(n);
 }
コード例 #4
0
        private void LoadData()
        {
            string json = string.Empty;
            var    o    = EditorGUIUtility.Load(NodeConsts.ResourcesFolder + "/" + NodeConsts.CLASS_DATA_FILE);

            if (o != null)
            {
                json = ((TextAsset)o).text;
                JsonUtility.FromJsonOverwrite(json, this);
                for (int i = 0; i < listNodes.Count; i++)
                {
                    listNodes[i].UpdateNodeDependesy(context);
                }
            }

            if (listNodes == null)
            {
                listNodes = new List <Node>();
            }

            if (snapShots == null)
            {
                snapShots = new List <SnapShot>();
            }

            if (snapShots.Count == 0)
            {
                CreateNewSnapeShot("DEFAULT");
            }

            if (context.currentSnapeShot == null)
            {
                context.currentSnapeShot = snapShots[0];
            }

            #if UML_NODE_DEBUB
            //fill with some data
            if (listNodes == null || listNodes.Count == 0)
            {
                Debug.Log("Add some data");
                var n1 = new Node(new Rect(10, 10, NodeConsts.NodeWith, NodeConsts.NodeHeight), "Win1", context);
                var n2 = new Node(new Rect(210, 210, NodeConsts.NodeWith, NodeConsts.NodeHeight), "Win2", context);
                var n3 = new Node(new Rect(410, 310, NodeConsts.NodeWith, NodeConsts.NodeHeight), "Win3", context);

                var f1 = new NodeInfoItem("1", n1, context);
                var f2 = new NodeInfoItem("2", n2, context);
                var f3 = new NodeInfoItem("3", n3, context);
                var f4 = new NodeInfoItem("4", n3, context);
                var f5 = new NodeInfoItem("5", n3, context);
                var f6 = new NodeInfoItem("6", n3, context);
                var f7 = new NodeInfoItem("7", n3, context);

                n1.AddField(f1);
                n2.AddField(f2);
                n3.AddField(f3);
                n3.AddField(f4);
                n3.AddField(f5);
                n3.AddField(f6);
                n3.AddField(f7);

                nodeRelation.AddRelation(n1.id, f1.ID, n2.id);
                nodeRelation.AddRelation(n3.id, f7.ID, n1.id);

                listNodes = new List <Node>()
                {
                    n1, n2, n3
                };
            }
            #endif
        }