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

namespace Nan.Scripts
{
    public class Bomb : MonoBehaviour
    {
        [SerializeField] private GameObject _effect;

        private void Start()
        {
            StartCoroutine(Loop());
        }

        private IEnumerator Loop()
        {
            for (var i = 0; i < 10; ++i)
            {
                var effect = Instantiate(_effect);
                effect.transform.position = transform.position + new Vector3(Random.Range(-1, 1.0f), Random.Range(-1, 1.0f));
                yield return new WaitForSeconds(0.02f);
            }
            Destroy(gameObject);
        }
    }
}