public void ChangePasswordFct() { if (newPsd != rnewPsd || (string.IsNullOrEmpty(newPsd) && string.IsNullOrEmpty(rnewPsd))) { GameObject dialogMessage = Instantiate(messageAlert); dialogMessage.transform.parent = transform; dialogMessage.transform.position = newPassword.transform.position; dialogMessage.transform.Find("Message").gameObject.GetComponent <Text>().text = "Password doesen't match"; } else { SocketIO.Emit("newPassword", new JSONObject(myJsonParaser.ChangePassword(UserData.userName, currentPsd, newPsd))); } }