1
Fork 0
mirror of https://github.com/Steffo99/beat-td.git synced 2024-11-29 10:24:18 +00:00
beat-td/Assets/Scripts/InstantiateEverySeconds.cs
2018-04-22 18:40:31 +02:00

20 lines
442 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, transform.position, transform.rotation);
cooldown = period;
}
}
}