1234567891011121314151617181920212223242526272829303132333435363738 |
- using UnityEngine;
- public class UIFirstPlay : MonoBehaviour
- {
- public GameObject ShopButton;
- public UIButton Ok;
- public UIButton Url;
- internal void Start ()
- {
- if (PlayerPrefs.GetInt("FirstTimeInfoShown", 0) == 0)
- {
- ShopButton.SetActive(false);
- Ok.onClick.Add(new EventDelegate(OnOk));
- Url.onClick.Add(new EventDelegate(OnUrl));
- }
- else
- {
- gameObject.SetActive(false);
- }
- }
- public void OnOk()
- {
- PlayerPrefs.SetInt("FirstTimeInfoShown",1);
- PlayerPrefs.Save();
- ShopButton.SetActive(true);
- gameObject.SetActive(false);
- }
- public void OnUrl()
- {
- Application.OpenURL("http://www.kringlan.is/");
- OnOk();
- }
- }
|