using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class CoinDrop : MonoBehaviour
{
    [SerializeField] private TMP_Text text;

    public void Init(int amount)
    {
        text.text = $"+{amount}";

        StartCoroutine(SelfDestruct());
    }

    private IEnumerator SelfDestruct()
    {
        yield return new WaitForSeconds(1.5f);

        Destroy(this.gameObject);
    }
}
