using DG.Tweening;
using UnityEngine;

public class PlayerSpottedPopUp : MonoBehaviour
{
    [SerializeField] private float scaleMultiplier = 1.5f;
    [SerializeField] private float lifetime = 1f;
    [SerializeField] private Transform exclamationMarkImageTransform;

    private Vector3 _originalScale;
    private float _lifeTimeBuffer = 0.03f;

    public void Init()
    {
        _originalScale = exclamationMarkImageTransform.localScale;
        BounceScale();
        Destroy(gameObject, lifetime + _lifeTimeBuffer);
    }

    private void BounceScale()
    {
        //exclamationMarkImageTransform.DOScale(_originalScale * scaleMultiplier, lifetime);
        transform.DOPunchScale(exclamationMarkImageTransform.localScale, scaleMultiplier, (int)lifetime);
    }
}
