private void Start() { this.chatNewComponent = FindObjectOfType <UChat>(); if (PlayerPrefs.GetString(UserNamePlayerPref) == "") { PlayerPrefs.SetString(UserNamePlayerPref, "Player " + Random.Range(0, 9999)); } string prefsName = PlayerPrefs.GetString(UserNamePlayerPref); if (!string.IsNullOrEmpty(prefsName)) { this.idInput.text = prefsName; } }
public void StartChat() { UChat chatNewComponent = FindObjectOfType <UChat>(); chatNewComponent.UserName = this.idInput.text.Trim(); chatNewComponent.Connect(); //enabled = false; if (this.idInput.text == null) { PlayerPrefs.SetString(UserNamePlayerPref, chatNewComponent.UserName + Random.Range(0, 999)); } else { PlayerPrefs.SetString(UserNamePlayerPref, chatNewComponent.UserName); } MainMenuManager.manage.levelBattleOnline(); }
private void Awake() { manage = this; }