Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using Parse;
- using System.Threading.Tasks;
- public class User : MonoBehaviour {
- // Use this for initialization
- void Start () {
- //Signup("thieumao","1234567","[email protected]","0917735107");
- //Signup("motmao", "123456", "[email protected]");
- Login("thieumao","123456");
- }
- private void Signup(string myName, string myPass, string myEmail, string myPhone = null)
- {
- var user = new ParseUser()
- {
- Username = myName,
- Password = myPass,
- Email = myEmail
- };
- // other fields can be set just like with ParseObject
- user["phone"] = myPhone;
- Task signUpTask = user.SignUpAsync();
- }
- private void Login(string myName, string myPass)
- {
- ParseUser.LogInAsync(myName, myPass).ContinueWith(t =>
- {
- if (t.IsFaulted || t.IsCanceled)
- {
- // The login failed. Check the error to see why.
- print(">> The login failed. Check the error to see why.");
- }
- else
- {
- // Login was successful.
- print(">> Login was successful.");
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment