Advertisement
Guest User

Untitled

a guest
Apr 11th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using UnityEngine.Networking;
  4. using System.Collections;
  5.  
  6. public class GameUI : MonoBehaviour {
  7.  
  8. public GameObject login;
  9. public InputField username;
  10. public InputField email;
  11. public InputField password;
  12. public Text status;
  13.  
  14. public string UserName{...}
  15.  
  16. public string Email{...}
  17.  
  18. public void Register(){
  19. status.text = "Registering";
  20. MsgRegistrationRequest msg = new MsgRegistrationRequest(){
  21. userName = username.text,
  22. userEmail = email.text,
  23. userPassword = password.text
  24. };
  25. NetworkManager.singleton.client.Send(MsgTypes.RegistrationRequest, msg);
  26.  
  27. }
  28.  
  29. public void Login(){
  30. status.text = "Logging in";
  31. MsgLoginRequest msg = new MsgLoginRequest(){
  32. userName = username.text,
  33. userPassword = password.text
  34. };
  35. NetworkManager.singleton.client.Send(MsgTypes.LoginRequest, msg);
  36.  
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement