コード例 #1
0
ファイル: NodeGo.cs プロジェクト: MikeWise2718/pipeshl
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();                   //This goes first

            if (GUILayout.Button("Change Node Name")) // If the button is clicked
            {
                NodeGo nodego = (NodeGo)target;       //The target script
                nodego.ChangeName();
            }
        }
コード例 #2
0
ファイル: LinkCloudCtrl.cs プロジェクト: MikeWise2718/pipeshl
        void CreateLinkCloudGos()
        {
            var lcld = getLinkCloud();

            if (linkcloudgos == null)
            {
                linkcloudgos                  = new GameObject();
                linkcloudgos.name             = "LinkCloud-" + gogencount;
                linkcloudgos.transform.parent = rman.rgo.transform;
                gogencount++;
            }
            if (linksvisible)
            {
                foreach (var lnkname in lcld.linknamelist)
                {
                    var lnk   = lcld.GetLink(lnkname);
                    var cname = linkcolor(lnk.name);
                    var go    = LinkGo.MakeNewLinkGo(rman, lnk, linkRadius, cname);
                    go.transform.parent = linkcloudgos.transform;
                }
            }
            if (nodesvisible)
            {
                foreach (string lptname in lcld.linkpoints())
                {
                    var lpt   = lcld.GetNode(lptname);
                    var cname = nodecolor(lpt.name);
                    var go    = NodeGo.MakeNewNodeGo(rman, lpt, linkNodeSize, cname);
                    go.transform.parent = linkcloudgos.transform;
                }
                if (showNearestPoint)
                {
                    var npt   = FindClosestPointOnLineCloud(nearestPointRef);
                    var nname = "linknearsph-";
                    var pnsph = GraphUtil.CreateMarkerSphere(nname, npt, size: 2.5f * linkNodeSize, clr: "red");
                    pnsph.transform.parent = linkcloudgos.transform;
                }
            }
            stats_nodes_links.x = lcld.nodecount();
            stats_nodes_links.y = lcld.linkcount();
        }