(サンプルコード)
using UnityEngine;
public class AutoGene3 : MonoBehaviour
{
public GameObject ballPrefab;
private void Start()
{
// InvokeRepeating("メソッド名", 開始までの遅延秒数, 繰り返し間隔(秒));
InvokeRepeating("BallGene", 1.0f, 1.0f);
}
void BallGene()
{
Instantiate(ballPrefab, transform.position, Quaternion.identity);
}
}
(実行結果)