Skip to content

Commit

Permalink
show atmosphere layer in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
leon-arndt committed Jan 3, 2023
1 parent 596133e commit c45ab47
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
7 changes: 3 additions & 4 deletions .idea/.idea.SkyFriends/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions Assets/Scripts/UserInterface/Overlay/StatusView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ public class StatusView : MonoBehaviour
[SerializeField] private ScriptableVector3 playerPosition;
[SerializeField] private TextMeshProUGUI playerPositionText;

private enum AtmosphereLayer
{
Troposphere,
Stratosphere,
Mesosphere,
Thermosphere,
Exosphere,
Unknown
}

private void Start()
{
Refresh();
Expand All @@ -21,7 +31,8 @@ private void Start()
private void Refresh()
{
var roundedAltitude = Mathf.Round(playerPosition.value.y);
playerPositionText.text = $"Altitude: {roundedAltitude}";
var currentAtmosphereLayer = (AtmosphereLayer)(roundedAltitude / 10);
playerPositionText.text = $"Altitude: {roundedAltitude} ({currentAtmosphereLayer.ToString()})";
}
}
}
}

0 comments on commit c45ab47

Please sign in to comment.