Hey guys, so I got this small game I am working on and I am using PoolManager, I am not getting any errors but when I use my restart button using this code…
using UnityEngine;
using System.Collections;
public class FullRestart : MonoBehaviour
{
void OnClick()
{
Application.LoadLevel ("Level_1");
}
}
I am not getting it to again start the enemies to spawn, they don’t spawn ever again and I am not getting any error. The code for my spawning enemies is this and its set to false until I press a button in game…
using UnityEngine;
using System.Collections;
using PathologicalGames;
public class EnemySpawning : MonoBehaviour
{
public float spawnTime = 3.0f;
float timeLeft = 0.0f;
public static bool isSpawning = false;
public Transform español = null;
void Update ()
{
if (isSpawning != false)
{
timeLeft -= Time.deltaTime;
if (timeLeft <= 0.0f)
{
Transform t = PoolManager.Pools["Enemy"].Spawn(español, transform.position, Quaternion.identity);
timeLeft = spawnTime;
}
}
}
}
So if you guys ever faced a problem like this please I would love to get some help, thank you all in advance!