AgHandler.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using UnityEngine;
  2. using System.Collections;
  3. public class AgHandler : MonoBehaviour
  4. {
  5. public ScreenBase BaseAgePopup;
  6. public GameObject UIWarning;
  7. public MessageCodeCap UIMessage;
  8. public ScreenBase RegScreen;
  9. public CheckBoxConditionsHandler CheckBoxConditionsHandler;
  10. public CheckBoxConditionsHandler CheckBoxAgeHandler;
  11. public UIButton ButtonAgree;
  12. void Start()
  13. {
  14. ButtonAgree.onClick.Add(new EventDelegate(ClickOk));
  15. UIWarning.SetActive(false);
  16. }
  17. void ClickOk()
  18. {
  19. if (CheckBoxConditionsHandler.Check && CheckBoxAgeHandler.Check)
  20. {
  21. ServerGiftManager.Instance.SetAgeAction(state =>
  22. {
  23. //Debug.Log(state.ToString());
  24. switch (state.ToString())
  25. {
  26. case "1":
  27. LoginManager.Instance.Age = true;
  28. BaseAgePopup.Hide();
  29. RegistrationManager.Instance.Registration.SetActive(true);
  30. StartCoroutine(RegistrationManager.Instance.EnterNameDialog());
  31. break;
  32. case "":
  33. break;
  34. }
  35. });
  36. }
  37. }
  38. }