Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. class Main : MonoBehaviour {
  2.  
  3.     void Start(){
  4.         Login("User1", "suco_de_laranja");
  5.     }
  6.    
  7.     void Login(string user, string password){
  8.         Request request = new Request("http://game/api.php?action=checkCredentials&user="+user+"&password="+password);
  9.         request.onDownload+= (Data result) => {
  10.             if(result.sucess){
  11.                 Request requestData = new Request("http://game/api.php?action=getUserData&user="+user+"&password="+password);
  12.                 requestData.onDownload+= (Data result) => {
  13.                     if(result.sucess){
  14.                         Debug.log("usuário logado!");
  15.                     }else{
  16.                         Debug.log("Falha no login!");
  17.                     }
  18.                 };
  19.             }
  20.         };
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement