LoginUDSDK.cs 760 B

123456789101112131415161718192021222324252627282930313233
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using UnityEngine.SceneManagement;
  6. using udSDK;
  7. public class LoginUDSDK : MonoBehaviour
  8. {
  9. public GameObject username;
  10. public GameObject password;
  11. private string Username;
  12. private string Password;
  13. public void Start()
  14. {
  15. Debug.Log("udSDK Starting Wrapper");
  16. }
  17. public void Login()
  18. {
  19. GlobalUDContext.SavedUsernameKey = username.GetComponent<InputField>().text;
  20. GlobalUDContext.SavedPasswordKey = password.GetComponent<InputField>().text;
  21. GlobalUDContext.Login();
  22. }
  23. public void LoadByIndex(int sceneIndex)
  24. {
  25. Login();
  26. SceneManager.LoadScene(sceneIndex);
  27. }
  28. }