91 lines
2.4 KiB
C#
91 lines
2.4 KiB
C#
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
public class TopPanel : MonoBehaviour
|
||
|
|
{
|
||
|
|
|
||
|
|
[SerializeField] private RectTransform rect = null;
|
||
|
|
|
||
|
|
private void Awake()
|
||
|
|
{
|
||
|
|
if (rect == null)
|
||
|
|
{
|
||
|
|
rect = GetComponent<RectTransform>();
|
||
|
|
}
|
||
|
|
|
||
|
|
if (rect != null)
|
||
|
|
{
|
||
|
|
if (GameManager.DB.IsRemoveADS == true)
|
||
|
|
{
|
||
|
|
//rect.offsetMax = new Vector2(rect.offsetMax.x, 0);
|
||
|
|
rect.sizeDelta = new Vector2(rect.sizeDelta.x, 150);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
//rect.offsetMax = new Vector2(rect.offsetMax.x, -150);
|
||
|
|
rect.sizeDelta = new Vector2(rect.sizeDelta.x, 300);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
GameManager.ADS.OnDestroyBannerAd += OnDestroyBannerAd;
|
||
|
|
}
|
||
|
|
|
||
|
|
private void Start()
|
||
|
|
{
|
||
|
|
if (GameManager.Instance != null)
|
||
|
|
{
|
||
|
|
GameManager.Event.RegistEvent(EEventType.OnClickFullView, this.OnClickFullView);
|
||
|
|
GameManager.Event.RegistEvent(EEventType.OnReturnFullView, this.OnReturnFullView);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public void ClickMoveToStore_Heart()
|
||
|
|
{
|
||
|
|
if (GamePanel.Instance.gameObject.activeInHierarchy == false)
|
||
|
|
{
|
||
|
|
GameManager.Event.InvokeEvent(EEventType.MoveToStore_Heart);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public void ClickMoveToStore_Key()
|
||
|
|
{
|
||
|
|
if (GamePanel.Instance.gameObject.activeInHierarchy == false)
|
||
|
|
GameManager.Event.InvokeEvent(EEventType.MoveToStore_Key);
|
||
|
|
}
|
||
|
|
|
||
|
|
public void ClickSettingButton()
|
||
|
|
{
|
||
|
|
if (GameManager.UI.IsOpendPopup(EPopupType.SettingPopup) == false)
|
||
|
|
{
|
||
|
|
GameManager.Sound.PlaySFX(ESFXType.Button_Hit);
|
||
|
|
GameManager.UI.ShowNStackPopup(EPopupType.SettingPopup);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private void OnClickFullView(object huntingDataID, object huntingListDataID)
|
||
|
|
{
|
||
|
|
gameObject.SetActive(false);
|
||
|
|
}
|
||
|
|
|
||
|
|
private void OnReturnFullView()
|
||
|
|
{
|
||
|
|
gameObject.SetActive(true);
|
||
|
|
}
|
||
|
|
|
||
|
|
private void OnDestroyBannerAd(bool isDestroy)
|
||
|
|
{
|
||
|
|
if (rect != null)
|
||
|
|
{
|
||
|
|
if (isDestroy == true)
|
||
|
|
{
|
||
|
|
//rect.offsetMax = new Vector2(rect.offsetMax.x, 0);
|
||
|
|
rect.sizeDelta = new Vector2(rect.sizeDelta.x, 150);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
//rect.offsetMax = new Vector2(rect.offsetMax.x, -150);
|
||
|
|
rect.sizeDelta = new Vector2(rect.sizeDelta.x, 300);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|