mirror of
https://github.com/Steffo99/beat-td.git
synced 2024-11-22 23:34:19 +00:00
21 lines
402 B
C#
21 lines
402 B
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class InstantiateEverySeconds : MonoBehaviour {
|
|||
|
|
|||
|
public GameObject target;
|
|||
|
public float period;
|
|||
|
|
|||
|
private float cooldown = 0;
|
|||
|
|
|||
|
void Update () {
|
|||
|
cooldown -= Time.deltaTime;
|
|||
|
if (cooldown <= 0)
|
|||
|
{
|
|||
|
Instantiate(target);
|
|||
|
cooldown = period;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|