From c45ab472f1397aaca61e5d6e1d80af5be9f1c8d1 Mon Sep 17 00:00:00 2001 From: Leon Arndt Date: Tue, 3 Jan 2023 21:18:48 +0100 Subject: [PATCH] show atmosphere layer in UI --- .idea/.idea.SkyFriends/.idea/workspace.xml | 7 +++---- .../Scripts/UserInterface/Overlay/StatusView.cs | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.idea/.idea.SkyFriends/.idea/workspace.xml b/.idea/.idea.SkyFriends/.idea/workspace.xml index 0013853..fed3c5f 100644 --- a/.idea/.idea.SkyFriends/.idea/workspace.xml +++ b/.idea/.idea.SkyFriends/.idea/workspace.xml @@ -2,9 +2,8 @@ - - - + + diff --git a/Assets/Scripts/UserInterface/Overlay/StatusView.cs b/Assets/Scripts/UserInterface/Overlay/StatusView.cs index 0db7e22..7817bbc 100644 --- a/Assets/Scripts/UserInterface/Overlay/StatusView.cs +++ b/Assets/Scripts/UserInterface/Overlay/StatusView.cs @@ -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(); @@ -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()})"; } } -} \ No newline at end of file +}