123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using UnityEngine;
- public class ButtonsHandler : MonoBehaviour
- {
- public UIButton CloseAdware;
- public GameObject Header;
- public UITexture Placeholder;
- public MeshRenderer VideoAd;
- public GameObject RootObject;
- private PlayerSidesColliderScriptCS hPlayerSidesColliderScriptCS;
- private PlayerFrontColliderScriptCS hPlayerFrontColliderScriptCS;
- //public Camera Camera;
- private void Start()
- {
- //Camera = transform.root.GetComponent<Camera>();
- CloseAdware.onClick.Add(new EventDelegate(OnCloseAd));
- CloseAdware.transform.localPosition = new Vector3(CloseAdware.transform.localPosition.x, CloseAdware.transform.localPosition.y, 0);
- hPlayerSidesColliderScriptCS = (PlayerSidesColliderScriptCS)GameObject.Find("PlayerSidesCollider").GetComponent(typeof(PlayerSidesColliderScriptCS));
- hPlayerFrontColliderScriptCS = (PlayerFrontColliderScriptCS)GameObject.Find("PlayerFrontCollider").GetComponent(typeof(PlayerFrontColliderScriptCS));
- }
- internal void Update()
- {
- VideoAd.transform.localScale = new Vector3(Placeholder.width,Placeholder.height,1);
- }
- private void OnCloseAd()
- {
- //PlayerPrefs.SetInt("AddLifeStep", 2);
- Adware.Instance.Close();
- InGameScriptCS.Instance.Resurected = false;
- ControllerScriptCS.Instance.RealDeath = true;
- NGUIMenuScript.Instance.toggleHUDGroupState(true, false);
- UIEnergy.Instance.Restore();
- NGUIMenuScript.Instance.CloseMenu(NGUIMenuScript.NGUIMenus.RaceEnd);
- PlayerController.Instance.Alive();
- InGameScriptCS.Instance.InvokeResurrection();
- hPlayerSidesColliderScriptCS.InvokeResurrection();
- hPlayerFrontColliderScriptCS.InvokeResurrection();
- NGUIMenuScript.Instance.startResumeGameCounter(true);
- Text_PauseCounter.Show();
- }
- }
|