public void StartChat() { ControlChat chatNewComponent = FindObjectOfType <ControlChat>(); chatNewComponent.UserName = this.idInput.text.Trim(); chatNewComponent.Connect(); enabled = false; PlayerPrefs.SetString(GUI_PlayerOptions.UserNamePlayerPref, chatNewComponent.UserName); }
public void Start() { this.chatNewComponent = FindObjectOfType <ControlChat>(); string prefsName = PlayerPrefs.GetString(GUI_PlayerOptions.UserNamePlayerPref); if (!string.IsNullOrEmpty(prefsName)) { this.idInput.text = prefsName; } }
private void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); //Kill the whole tree } }