public static SendDataController getInstance() { if (instance == null) { instance = new SendDataController(); instance.socket = ConnectSocket.getSocketInstance(); } return(instance); }
public void ButtonClick() { if (usernameInputField.text.Equals("")) { resultText.text = "请输入用户名"; } else { PlayerPrefs.SetString("UserName", usernameInputField.text); resultText.text = ""; SendDataController.getInstance().ConnectToServerRequest(usernameInputField.text); } }