Advertisement
Guest User

Untitled

a guest
Apr 11th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 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. void OnEnable(){...}
  19.  
  20. void OnDisable(){...}
  21.  
  22. public void Register(){
  23. status.text = "Registering";
  24. MsgRegistrationRequest msg = new MsgRegistrationRequest();
  25. msg.userName = username.text;
  26. msg.userEmail = email.text;
  27. msg.userPassword = password.text;
  28. NetworkManager.singleton.client.Send(MsgTypes.RegistrationRequest, msg);
  29.  
  30. }
  31.  
  32. public void Login(){
  33. status.text = "Logging in";
  34. MsgLoginRequest msg = new MsgLoginRequest();
  35. msg.userName = username.text;
  36. msg.userPassword = password.text;
  37. NetworkManager.singleton.client.Send(MsgTypes.LoginRequest, msg);
  38.  
  39. }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement