Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.17 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5.  
  6. public class SubmitLogin : MonoBehaviour {
  7.  
  8.     public InputField usernameField, passwordField, emailField;
  9.     private string isSubmitted;
  10.  
  11.     private DataInserter di;
  12.  
  13.     // Use this for initialization
  14.     void Start ()
  15.     {
  16.         di = FindObjectOfType<DataInserter>();
  17.         emailField = emailField.GetComponent<InputField>();
  18.         passwordField = passwordField.GetComponent<InputField>();
  19.         emailField = emailField.GetComponent<InputField>();
  20.     }
  21.  
  22.     public void submitInfo()
  23.     {
  24.         di.inputUsername = usernameField.text;
  25.         di.inputPassword = passwordField.text;
  26.         di.inputEmail = emailField.text;
  27.         isSubmitted = "true";
  28.         di.CreateUser(usernameField.text, passwordField.text, emailField.text, isSubmitted);
  29.         StartCoroutine(ReplyFromServer());
  30.     }
  31.  
  32.     IEnumerator ReplyFromServer()
  33.     {
  34.         yield return new WaitForSeconds(1f);
  35.         WWW message = new WWW(di.createUserURL);
  36.         yield return message;
  37.         string messageString = message.text;
  38.         print(messageString);
  39.     }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement