public void UpdatePlanetData() { nearestPlanet = GetNearestPlanet(); if (nearestPlanet != null) { altitude = Math.Abs((cubeGrid.GetPosition() - nearestPlanet.GetNearestPoint(cubeGrid.GetPosition())).Length()); } }
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; } }