void saveButtonClicked() { string nameUser = ScoreUtils.DEFAULT_STR_PLAYER_NAME; foreach (GameObject buttonGO in buttonsPlayerNameGO) { if (buttonGO.name.Equals(NameUtils.NAME_INPUT_LEADERBOARD)) { tk2dUITextInput textInput = buttonGO.GetComponent <tk2dUITextInput>(); nameUser = textInput.Text; if (nameUser.Length < ScoreUtils.TOTAL_CHARACTERS_NAME) { Debug.Log(nameUser); return; } nameUser = nameUser.ToUpper(); } } foreach (GameObject buttonGO in buttonsGO) { buttonGO.SetActive(true); } foreach (GameObject buttonGO in buttonsPlayerNameGO) { buttonGO.SetActive(false); } ScoreUtils.addUserLeaderboard(nameUser, score, position, leaderboard); }