Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
2394425147 authored Dec 8, 2021
0 parents commit 3d141c6
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions TitleManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System.Collections;
using System.Collections.Generic;
using Helpers;
using UnityEngine;
using UnityEngine.UI;

namespace Title
{
public class TitleManager : MonoBehaviour
{
public Text anyKeyPressed;

public List<string> textList;

private int _textIndex;
private void Start()
{
textList = new List<string>
{
Localization.ParseAuto($"TITLE_ANYKEY"),
Localization.ParseAuto($"TITLE_THANKS"),
$"{Localization.ParseAuto($"TITLE_BUILDVERSION")} {Application.version}"
};

StartCoroutine(CycleThroughText());
}

private IEnumerator CycleThroughText()
{
while (true)
{
_textIndex = (_textIndex + 1) % textList.Count;
anyKeyPressed.text = textList[_textIndex];
yield return new WaitForSeconds(3);
}

// ReSharper disable once IteratorNeverReturns
}

public void ChangeScene()
{
SceneSwapper.LoadScene("ModeSelection");
}
}
}

0 comments on commit 3d141c6

Please sign in to comment.