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

public class BounceOncollisionWithPlayer : MonoBehaviour
{
    public InAudioNode Sound;
    bool tweening = false;
    void OnCollisionEnter2D(Collision2D collision)
    {
        if (tweening) return;

        InAudio.Play(gameObject, Sound);
        tweening = true;
        transform.DOPunchScale(Vector3.one * 0.1f, 0.25f, 20, 1f).OnComplete(() => { tweening = false; });
    }
}
