示例#1
0
        // Update is called once per frame
        void Update()
        {
            if (rman != null)
            {
                pathctrl      = rman.pathctrl;
                linkcloudctrl = rman.linkcloudctrl;
                if (pathctrl != null)
                {
                    pathctrl.showNearestPathPoint = true;
                    pathctrl.showNearestWegPoints = true;
                    pathctrl.nearestPointRef      = lastpos;
                }
                if (linkcloudctrl != null)
                {
                    linkcloudctrl.showNearestPoint = true;
                    linkcloudctrl.nearestPointRef  = lastpos;
                }
            }
            var newpos   = transform.position;
            var movedist = Vector3.Distance(newpos, lastpos);

            if (movedist > 0)
            {
                if (rman != null)
                {
                    rman.Regen();
                }
            }
            lastpos = newpos;
        }
示例#2
0
        void initVars()
        {
            theone            = this;
            loglist           = new LinkedList <string>();
            GraphUtil.loglist = loglist;
            RouteMan.Log("RouteMan starting time:" + starttime.ToUniversalTime());
            startStopWatch.Start();

            // Create game object to hold ctrl inspectors
            rmango = GameObject.Find("RouteMan");

            linkcloudctrl = rmango.AddComponent <LinkCloudCtrl>();
            pathctrl      = rmango.AddComponent <PathCtrl>();
            birdctrl      = rmango.AddComponent <BirdCtrl>();
            statusctrl    = rmango.AddComponent <StatusCtrl>();
            errmarkctrl   = rmango.AddComponent <ErrorMarkerCtrl>();
            floorplanctrl = rmango.AddComponent <FloorPlanCtrl>();
            linkcloudctrl.setRouteMan(this);
            pathctrl.setRouteMan(this);
            birdctrl.setRouteMan(this);
            statusctrl.setRouteMan(this);
            errmarkctrl.setRouteMan(this);
            floorplanctrl.setRouteMan(this);

            keyman = new KeywordMan(this);


            // Create game object to hold actual game objects
            rgo = new GameObject("Rgo");
            rgoTransformSetCount += 1;


            statusctrl.outMode = StatusCtrl.outModeE.help;
            statusctrl.RealizeMode();
            keycount = keyman.totalKeywordCount();

            smm = FindObjectOfType <SpatialMapperMan>();

            DisableSpatialMapping();
            RouteMan.Log("RouteMan initialized");
        }