using DG.Tweening;
using UnityEngine;

namespace mGame
{
    public class BubbleSplasher : MonoBehaviour
    {
        public Transform resetPos;
        public float lerpTime = .5f;
        private void OnTriggerEnter(Collider other)
        {
            if(other.TryGetComponent(out Bubble bb))
            {
                bb.transform.DOMove(resetPos.position, lerpTime)
                    .OnComplete(
                    () =>
                    {
                        bb.life = 0;
                        bb.DoBubbleBoom(3);
                    });
            }
        }
    }
}

