(サンプルコード)
using UnityEngine;
public class AutoGene2 : MonoBehaviour
{
public GameObject ballPrefab;
private float timer = 0;
void Update()
{
timer += Time.deltaTime;
if(timer >= 1.0f)
{
Instantiate(ballPrefab, transform.position, Quaternion.identity);
timer = 0;
}
}
}
(実行結果)