コード例 #1
0
 public void UpdatePlanetData()
 {
     nearestPlanet = GetNearestPlanet();
     if (nearestPlanet != null)
     {
         altitude = Math.Abs((cubeGrid.GetPosition() - nearestPlanet.GetNearestPoint(cubeGrid.GetPosition())).Length());
     }
 }
コード例 #2
0
        public void Update()
        {
            if (nearestPlanet != null)
            {
                altitude = (nearestPlanet.GetNearestPoint(cubeGrid.GetPosition()) - cubeGrid.GetPosition());
            }

            long msStop    = DateTime.Now.Ticks;
            long timeTaken = msStop - last_slow_update;

            if (timeTaken >= 3000)
            {
                SlowUpdate();
                last_slow_update = msStop;
            }
        }