using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class sample : MonoBehaviour
{
// Start is called before the first frame update
void Start()
StartCoroutine(SpawnTarget());
}
// Update is called once per frame
void Update()
IEnumerator SpawnTarget()
yield return new WaitForSeconds(spawnRate);
int index - Random.Range(0, targets[index];