123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using UnityEngine;
- public class ButtonsHandler : MonoBehaviour
- {
- public UIButton CloseAdware;
- public GameObject Header;
- public UITexture Placeholder;
- public MeshRenderer VideoAd;
- public GameObject RootObject;
- //public Camera Camera;
- private void Start()
- {
- //Camera = transform.root.GetComponent<Camera>();
- CloseAdware.onClick.Add(new EventDelegate(OnCloseAd));
- }
- internal void Update()
- {
- //if (Adware.Instance.CurrnentIndex > 0)
- //{
- VideoAd.transform.localScale = new Vector3(Screen.width * UIRoot.Instance.GetPixelSizeAdjustment(Screen.height) *1.05f/2, Screen.width * UIRoot.Instance.GetPixelSizeAdjustment(Screen.width)*1.05f/2, 1);
- //}
- //else
- //{
- // VideoAd.transform.localScale = new Vector3(Screen.width * UIRoot.Instance.GetPixelSizeAdjustment(Screen.width) * 0.125f / 2, Screen.height * UIRoot.Instance.GetPixelSizeAdjustment(Screen.height) * 0.125f, 1);
- //}
- }
- private void OnCloseAd()
- {
- VideoTimer.Instance.Play = false;
- //Adware.Instance.onFinished();
- AdManager.Instance.Active = false;
- Adware.Instance.RequesNextAd();
- Adware.Instance.Close();
- PlayerPrefs.SetInt("AddLifeStep", 2);
- InGameScriptCS.Instance.LifeLost = false;
- PlayerPrefs.Save();
- SoundManagerCS.Instance.EndVideoAd();
- }
- }
|