Bug Fix in Text Animation Script
This commit is contained in:
parent
68d2750ff1
commit
79eaa64ccf
@ -6,25 +6,26 @@ using UnityEngine.UI;
|
|||||||
|
|
||||||
public class FetchingScoresAnimation : MonoBehaviour
|
public class FetchingScoresAnimation : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
private Text textComponent;
|
||||||
|
|
||||||
void Update()
|
void Start()
|
||||||
{
|
{
|
||||||
|
textComponent = GetComponent<Text>();
|
||||||
AnimateText();
|
AnimateText();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void AnimateText()
|
private async void AnimateText()
|
||||||
{
|
{
|
||||||
Text text = GetComponent<Text>();
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
await Task.Run(async () => {
|
textComponent.text = "Fetching Scores";
|
||||||
text.text = "Fetching Scores.";
|
|
||||||
await Task.Delay(1000);
|
await Task.Delay(1000);
|
||||||
text.text = "Fetching Scores..";
|
textComponent.text = "Fetching Scores.";
|
||||||
await Task.Delay(1000);
|
await Task.Delay(1000);
|
||||||
text.text = "Fetching Scores...";
|
textComponent.text = "Fetching Scores..";
|
||||||
|
await Task.Delay(1000);
|
||||||
|
textComponent.text = "Fetching Scores...";
|
||||||
await Task.Delay(1000);
|
await Task.Delay(1000);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user