diff --git a/Unity-Files/Assets/Animations/Game Over Screen/FetchingScoresAnimation.cs b/Unity-Files/Assets/Animations/Game Over Screen/FetchingScoresAnimation.cs index b5cd7d6..3915e92 100644 --- a/Unity-Files/Assets/Animations/Game Over Screen/FetchingScoresAnimation.cs +++ b/Unity-Files/Assets/Animations/Game Over Screen/FetchingScoresAnimation.cs @@ -6,25 +6,26 @@ using UnityEngine.UI; public class FetchingScoresAnimation : MonoBehaviour { + private Text textComponent; - void Update() + void Start() { + textComponent = GetComponent(); AnimateText(); } private async void AnimateText() { - Text text = GetComponent(); while (true) { - await Task.Run(async () => { - text.text = "Fetching Scores."; - await Task.Delay(1000); - text.text = "Fetching Scores.."; - await Task.Delay(1000); - text.text = "Fetching Scores..."; - await Task.Delay(1000); - }); + textComponent.text = "Fetching Scores"; + await Task.Delay(1000); + textComponent.text = "Fetching Scores."; + await Task.Delay(1000); + textComponent.text = "Fetching Scores.."; + await Task.Delay(1000); + textComponent.text = "Fetching Scores..."; + await Task.Delay(1000); } } }