12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- 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));
- }
- public void Update()
- {
- if(Adware.Instance.CurrnentIndex > 0)
- {
- VideoAd.transform.localScale = new Vector3(Screen.width * UIRoot.Instance.GetPixelSizeAdjustment(Screen.height) * 0.125f, Screen.width * UIRoot.Instance.GetPixelSizeAdjustment(Screen.width) * 0.125f / 3, 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();
- }
- }
|