public void OnMouseUp() { int finalScore = LevelGenerator.GetlevelPartCount() + Coin.chupetes - 5; HighscoreNameInputWindow.Show(finalScore, (string name) => { HighscoreTable.AddHighscoreEntry_Static(finalScore, name); HighscoreTable.Show(); }); pre_score.SetActive(false); }
private void Awake() { instance = this; nameText = transform.Find("nameText").GetComponent <Text>(); scoreText = transform.Find("scoreText").GetComponent <Text>(); nameInputField = transform.Find("nameText").GetComponent <InputField>(); nameInputField.onValidateInput = (string text, int charIndex, char addedChar) => { if (addedChar == ' ') { return('\0'); // Don't add spaces } return(addedChar.ToString().ToUpper()[0]); }; gameObject.SetActive(false); }