private void OnEnable() { string @string = TankPrefs.GetString("challengeName", Social.localUser.userName); if (@string != "") { nameChangePlaceholder.text = @string; nameChangeField.text = @string; } nameChangeOkButton.onClick.RemoveAllListeners(); nameChangeOkButton.onClick.AddListener(delegate { string text = Utilities.SanitizeInput(nameChangeField.text); if (text != "" && text.Length >= nameChangeLengthMin && text.Length <= nameChangeLengthMax) { TankPrefs.SetString("challengeName", text); } MenuController.HideMenu <NameChangePopup>(); TankPrefs.Save(); PlayerDataManager.SaveToCloudOnNextInterval = true; }); }