//Switches the view to the next one in the sequence.
 public void ToggleViewpoint()
 {
     switch (_ViewType) {
     case ViewpointType.vpFPV:
         _ViewType = ViewpointType.vpGimbal;
         break;
     case ViewpointType.vpGimbal:
         _ViewType=ViewpointType.vp3rdPerson;
         break;
     case ViewpointType.vp3rdPerson:
         _ViewType=ViewpointType.vpFPV;
         break;
     }
     //and set the button text
     GameObject but = GameObject.Find("ViewpointButton");
     but.GetComponentInChildren<Text>().text = ViewpointText() + "(A)";
 }
Exemple #2
0
    //Switches the view to the next one in the sequence.
    public void ToggleViewpoint()
    {
        switch (_ViewType)
        {
        case ViewpointType.vpFPV:
            _ViewType = ViewpointType.vpGimbal;
            break;

        case ViewpointType.vpGimbal:
            _ViewType = ViewpointType.vp3rdPerson;
            break;

        case ViewpointType.vp3rdPerson:
            _ViewType = ViewpointType.vpFPV;
            break;
        }
        //and set the button text
        GameObject but = GameObject.Find("ViewpointButton");

        but.GetComponentInChildren <Text>().text = ViewpointText() + "(A)";
    }
        private void addGraphics()
        {
            //var camera = new Camera(28.4, 83, 20000, 10, 70, 300)
            //var x = camera.Location.X - 0.01;
            //var y = camera.Location.Y- 0.25;
            var type   = new ViewpointType();
            var extent = MySceneView.GetCurrentViewpoint(type).TargetGeometry.Extent;

            var x = extent.XMin - 0.01;
            var y = extent.YMax + 0.25;

            for (int i = 0; i < 6; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    double   valueX   = x + i * (squareSize + spacing);
                    double   valueY   = y + j * (squareSize + spacing);
                    MapPoint mapPoint = new MapPoint(valueX, valueY);
                    Geometry polygon  = polygonForStartingPoint(mapPoint);
                    addGraphicsForPolygon(polygon);
                }
            }
        }