AgreeConditions.cs 820 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class AgreeConditions : MonoBehaviour {
  6. public UILabel LabelMessage;
  7. public Button OkButton;
  8. public UIButton CloseButton;
  9. public Toggle Check;
  10. public CanvasGroup CanvasCroup;
  11. void Start()
  12. {
  13. //GetComponent<ScreenBase>().Hide();
  14. OkButton.onClick.AddListener(OnClose);
  15. //StartCoroutine(AlphaActive());
  16. }
  17. public IEnumerator AlphaActive()
  18. {
  19. yield return new WaitForSeconds(1f);
  20. GetComponent<UIPanel>().alpha = 1;
  21. }
  22. private void OnClose()
  23. {
  24. if(Check.isOn)
  25. {
  26. PlayerPrefs.SetInt("FirstEnter", 1);
  27. PlayerPrefs.Save();
  28. CanvasCroup.alpha = 0;
  29. }
  30. }
  31. }