ChangeLoginPopup.cs 940 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class ChangeLoginPopup : ScreenBase
  5. {
  6. public GameObject ParentAndroid;
  7. public GameObject ParentIos;
  8. // Start is called before the first frame update
  9. void Start()
  10. {
  11. #if UNITY_ANDROID
  12. ParentAndroid.SetActive(true);
  13. #endif
  14. #if UNITY_IOS
  15. ParentIos.SetActive(true);
  16. #endif
  17. if (PlayerPrefs.GetInt("ErrorLogin") == 0)
  18. {
  19. PlayerPrefs.DeleteAll();
  20. PlayerPrefs.SetInt("ErrorLogin",1);
  21. PlayerPrefs.Save();
  22. }
  23. }
  24. // Update is called once per frame
  25. public void OnLoginFB()
  26. {
  27. WrapperFB.Login();
  28. }
  29. public void OnLoginGuest()
  30. {
  31. PlayerPrefs.SetInt("GUEST", 1);
  32. PlayerPrefs.Save();
  33. }
  34. void OnDestroy()
  35. {
  36. PlayerPrefs.SetInt("GUEST", 0);
  37. PlayerPrefs.Save();
  38. }
  39. }