예제 #1
0
        private string nodecolor(string nodename)
        {
            if (NodeHasOverrideColor(nodename))
            {
                return(nodeColorOverrides[nodename]);
            }
            if (sman == null)
            {
                return("steelblue");
            }
            var nl = nodename.Length;

            var colselecter = SceneMan.RmColorModeE.nodecloud;
            var gcr         = GetGraphCtrl();

            if (gcr.voiceEnabled(nodename))
            {
                colselecter = SceneMan.RmColorModeE.nodecloudx;
            }
            return(sman.getcolorname(colselecter, nodename));
        }
예제 #2
0
        void CreatePathGos()
        {
            if (_path == null)
            {
                return;                // nothing to do
            }
            DeletePathGos();

            if (pathgo == null)
            {
                pathgo = new GameObject("Path-" + gogeninst);
                gogeninst++;
            }
            pathgo.transform.parent = sman.rgo.transform;
            int i     = 0;
            int ilast = path.waypts.Count - 1;
            var lclr  = sman.getcolorname(SceneMan.RmColorModeE.pathlink);
            var nclr  = sman.getcolorname(SceneMan.RmColorModeE.pathnode);

            foreach (var w in _path.waypts)
            {
                var    lnk   = w.link;
                string wname = "way:" + i + " (" + lnk.name + ")";
                if (visible)
                {
                    var pathcyl = GraphUtil.CreatePipe(wname, lnk.node1.pt, lnk.node2.pt, pathRadius, clr: lclr);
                    pathcyl.transform.parent = pathgo.transform;
                    if (i != ilast)
                    {
                        var mkname = "pathsph-" + pathsphcnt;
                        var psph   = GraphUtil.CreateMarkerSphere(mkname, w.toNode.pt, size: pathNodeSize, clr: nclr);
                        psph.transform.parent = pathgo.transform;
                        w.toNode.transform    = pathgo.transform;

                        //RegionMan.Log("path point i:" + i +"  w.tolpt.pt:"+w.tolpt.pt+ "  w.tolpt.ptwc:" + w.tolpt.ptwc);
                    }
                    if (showNearestWegPoints)
                    {
                        var npt   = w.link.FindClosestPointOnLink(nearestPointRef);
                        var nname = "nearsph-" + pathsphcnt;
                        var pnsph = GraphUtil.CreateMarkerSphere(nname, npt, size: 1.5f * pathNodeSize, clr: "orange");
                        pnsph.transform.parent = pathgo.transform;
                    }
                }
                i++;
                pathsphcnt++;
            }
            if (showNearestPathPoint)
            {
                float pathdst = 0;
                FindClosestPointOnPath(nearestPointRef, out pathdst);
                var pp    = path.MovePositionAlongPath(pathdst);
                var nspwc = sman.rgo.transform.TransformPoint(pp.pt);
                var nname = "nearpathsph";
                //RegionMan.Log("pp pp.pt:" + pp.pt + "  pp.ptwc:" + pp.ptwc);
                var go = new GameObject();
                go.name = nname + "-go";
                go.transform.position = nspwc;
                var cname = "lilac";
                var pnsph = GraphUtil.CreateMarkerSphere(nname, nspwc, size: 1.1f * pathNodeSize, clr: cname);
                if (sman != null)
                {
                    //                    if (sman.garnish != RouterGarnishE.none || sman.statusctrl.outMode != StatusCtrl.outModeE.geninfo)
                    if (sman.garnish != RouteGarnishE.none)
                    {
                        //RegionMan.Log("Adding text");
                        addFloatingText(go, nspwc, "Hello Sphere", cname, yrot: 0, yoff: 1.1f);
                    }
                }
                pnsph.transform.parent = go.transform;
                go.transform.parent    = pathgo.transform;
            }
        }