// Update is called once per frame void Update() { if (canReceiveLogin) { resultStr = clientConnect.GetResultStr(); if (resultStr != null && resultStr.Length != 0) { //Debug.Log(resultStr.Length); //Debug.Log(resultStr); if (resultStr.Substring(0, MSG_loginSuccess.Length) == MSG_loginSuccess) { StartCoroutine(WaitCloseLogin(1)); Txt_ShowMsg.text = MSG_loginSuccess; //clientConnect.EmptyByte(); canReceiveLogin = false; } else if (resultStr.Substring(0, MSG_registerSuccess.Length) == MSG_registerSuccess) { StartCoroutine(WaitCloseLogin(1)); Txt_ShowMsg.text = MSG_registerSuccess; canReceiveLogin = false; } else if (resultStr.Substring(0, MSG_passwordError.Length) == MSG_passwordError) { Txt_ShowMsg.text = MSG_passwordError; //clientConnect.EmptyByte(); canReceiveLogin = false; Debug.Log("wrong"); } } } }