-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3d141c6
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
} | ||
} |