Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (alt.GetAltitude() < minDistance)
     {
         if (firstTime)
         {
             unZoomTimer = 0;
         }
         transform.position = new Vector3(Mathf.Lerp(transform.position.x, player.position.x, zoomTimer / timeToGo),
                                          Mathf.Lerp(transform.position.y, player.position.y, zoomTimer / timeToGo),
                                          transform.position.z);
         myCm.orthographicSize = Mathf.Lerp(myCm.orthographicSize, zoom, zoomTimer / (timeToGo / velZoom));
         zoomTimer            += Time.deltaTime;
         if (zoomTimer > (timeToGo / velZoom))
         {
             firstTime = true;
         }
     }
     else
     {
         zoomTimer          = 0;
         transform.position = new Vector3(Mathf.Lerp(transform.position.x, startPosition.x, unZoomTimer / timeToGo),
                                          Mathf.Lerp(transform.position.y, startPosition.y, unZoomTimer / timeToGo),
                                          startPosition.z);
         myCm.orthographicSize = Mathf.Lerp(myCm.orthographicSize, startOrthographicSize, unZoomTimer / (timeToGo / velZoom));
         unZoomTimer          += Time.deltaTime;
     }
 }
Example #2
0
        public void SetCoordinates(double latitude, double longitude, double altitude)
        {
            if (double.IsNaN(latitude) || double.IsNaN(longitude))
            {
                return;
            }

            var latNoised = 0.0;
            var lngNoised = 0.0;

            CalcNoisedCoordinates(latitude, longitude, out latNoised, out lngNoised);

            _client.CurrentLatitude  = latitude;
            _client.CurrentLongitude = longitude;
            _client.CurrentAltitude  = Altitude.GetAltitude(latitude, longitude);

            SaveLatitudeLongitude(latitude, longitude);
        }
Example #3
0
 // Update is called once per frame
 void Update()
 {
     if (timer.GetSeconds() > 9)
     {
         time.text = "Time " + timer.getMinutes() + ":" + timer.GetSeconds();
     }
     else
     {
         time.text = "Time " + timer.getMinutes() + ":0" + timer.GetSeconds();
     }
     gasoline.text = "Gasoline " + playerMove.GetGasoline();
     if ((int)(playerRigid.velocity.y * 10) > 0)
     {
         verticalVel.text = "Vertical vel " + (int)Mathf.Abs(playerRigid.velocity.y * 10) + " Up";
     }
     else if ((int)(playerRigid.velocity.y * 10) < 0)
     {
         verticalVel.text = "Vertical vel " + (int)Mathf.Abs(playerRigid.velocity.y * 10) + " Down";
     }
     else
     {
         verticalVel.text = "Vertical vel " + (int)Mathf.Abs(playerRigid.velocity.y * 10);
     }
     if ((int)(playerRigid.velocity.x * 10) < 0)
     {
         horizontalVel.text = "Horizontal vel " + (int)Mathf.Abs(playerRigid.velocity.x * 10) + " Left";
     }
     else if ((int)(playerRigid.velocity.x * 10) > 0)
     {
         horizontalVel.text = "Horizontal vel " + (int)Mathf.Abs(playerRigid.velocity.x * 10) + " Right";
     }
     else
     {
         horizontalVel.text = "Horizontal vel " + (int)Mathf.Abs(playerRigid.velocity.x * 10);
     }
     altitude.text = "Altitude " + (int)alt.GetAltitude() + "KM";
     points.text   = "Points " + pS.GetPoints();
 }