using System.Collections; using System.Collections.Generic; using UnityEngine; public class BannerSpace : MonoBehaviour { [SerializeField] private RectTransform rect; public float OffSet = -133f; private void Awake() { GameManager.ADS.OnDestroyBannerAd += OnDestroyBannerAd; } private void OnEnable() { if (rect == null) { rect = GetComponent(); } if (rect != null) { if (GameManager.DB.IsRemoveADS == true) { rect.offsetMax = new Vector2(rect.offsetMax.x, 0); } else { rect.offsetMax = new Vector2(rect.offsetMax.x, OffSet); } } } private void OnDestroyBannerAd(bool isDestroy) { if (rect != null) { if (isDestroy == true) { rect.offsetMax = new Vector2(rect.offsetMax.x, 0); } else { rect.offsetMax = new Vector2(rect.offsetMax.x, OffSet); } } } }