using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;

public class PanelNoAdsTip : BasePanel
{
    [SerializeField] CanvasGroup mCvsBg;
    [SerializeField] RectTransform mRctBg;

    [SerializeField] Button mBtnMask;

    private void Awake()
    {
        UIUtils.BindBtn(mBtnMask, OnClickMask);
    }

    public override void OnOpen()
    {
        base.OnOpen();

        mCvsBg.alpha = 0;
        mRctBg.anchoredPosition = new Vector2(0, -160);

        mCvsBg.DOFade(1, 0.3f);
        mRctBg.DOAnchorPosY(100, 0.3f);

        AudioManager.Instance.PlaySound(AudioClipType.Click_Tip);
    }

    public override void OnClose()
    {
        base.OnClose();

        AudioManager.Instance.PlaySound(AudioClipType.UIClose);
    }

    private void OnClickMask()
    {
        mCvsBg.DOFade(0, 0.3f);
        mRctBg.DOAnchorPosY(-160, 0.3f).onComplete = Close;
    }
}