UIFirstPlay.cs 788 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using UnityEngine;
  2. public class UIFirstPlay : MonoBehaviour
  3. {
  4. public GameObject ShopButton;
  5. public UIButton Ok;
  6. public UIButton Url;
  7. internal void Start ()
  8. {
  9. if (PlayerPrefs.GetInt("FirstTimeInfoShown", 0) == 0)
  10. {
  11. ShopButton.SetActive(false);
  12. Ok.onClick.Add(new EventDelegate(OnOk));
  13. Url.onClick.Add(new EventDelegate(OnUrl));
  14. }
  15. else
  16. {
  17. gameObject.SetActive(false);
  18. }
  19. }
  20. public void OnOk()
  21. {
  22. PlayerPrefs.SetInt("FirstTimeInfoShown",1);
  23. PlayerPrefs.Save();
  24. ShopButton.SetActive(true);
  25. gameObject.SetActive(false);
  26. }
  27. public void OnUrl()
  28. {
  29. Application.OpenURL("http://www.kringlan.is/");
  30. OnOk();
  31. }
  32. }