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

public class Enemy : MonoBehaviour
{
    [SerializeField] private GameObject bulletData;

    private float timeSpan;
    
    // Start is called before the first frame update
    void Start()
    {
        //時間設定
        timeSpan = 0.2f;
    }

    // Update is called once per frame
    void Update()
    {
        //規定時間経過したか判定
        if (timeSpan <= 0)
        {
            //時間設定
            timeSpan = 0.2f;
            
            //弾を生成
            Instantiate(bulletData, transform.position, Quaternion.identity);
        }
        else
        {
            //カウントダウン
            timeSpan -= Time.deltaTime;
        }
    }
}
