AgreementPopup.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class AgreementPopup : MonoBehaviour
  5. {
  6. void Start()
  7. {
  8. if (PlayerPrefs.GetInt("AgreementPopupChecked", 0) == 1) {
  9. this.gameObject.SetActive(false);
  10. LoginView.ins.SetAgreementChecked(true);
  11. }
  12. }
  13. public void Agree() {
  14. PlayerPrefs.SetInt("AgreementPopupChecked", 1);
  15. this.gameObject.SetActive(false);
  16. LoginView.ins.SetAgreementChecked(true);
  17. }
  18. [System.NonSerialized] public System.Action onDisagree;
  19. public void Disagree() {
  20. PlayerPrefs.SetInt("AgreementPopupChecked", 0);
  21. this.gameObject.SetActive(false);
  22. LoginView.ins.SetAgreementChecked(false);
  23. onDisagree?.Invoke();
  24. }
  25. public void EnterUserAgreement() {
  26. GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
  27. o.GetComponent<AgreementView>().EnterUserAgreement();
  28. }
  29. public void EnterPrivacyAgreement() {
  30. GameObject o = GameObject.Instantiate(Resources.Load<GameObject>("Prefabs/Views/AgreementView"));
  31. o.GetComponent<AgreementView>().EnterPrivacyAgreement();
  32. }
  33. }