ZoeRobotIngles/Assets/Jogos/WhackAVirus/Scripts/WhackSpawner.cs

28 lines
536 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WhackSpawner : MonoBehaviour
{
public GameObject toSpawn;
private bool alreadySpawned = false;
public void SpawnDied()
{
alreadySpawned = false;
}
public void SpawnEnemy()
{
if (!WhackManager.instance.isOver)
{
if (!alreadySpawned)
{
Instantiate(toSpawn, transform, false);
alreadySpawned = true;
}
}
}
}