Temp reset
This commit is contained in:
parent
0fd0584a50
commit
d0371349db
@ -81,27 +81,51 @@ public class WaveObserver : Singleton<WaveObserver>
|
||||
spawnerSubject.ChangeSpawnSpeed(_levelConfig.Interval * _spawnerTiming);
|
||||
if (paramPrefab.Equals(_levelConfig.ConstantSpawn[0].GetEnemyObject()))
|
||||
{
|
||||
//int currentCount = 0;
|
||||
//for (int i = 0; i < _copyConstantSpawn.Count; i++)
|
||||
//{
|
||||
// if (_levelConfig.ConstantSpawn[i].GetEnemyObject() == paramPrefab)
|
||||
// {
|
||||
// currentCount = --_copyConstantSpawn[i];
|
||||
// break;
|
||||
// Debug.Log("Amout to spawn is now: " + currentCount);
|
||||
// if (currentCount <= 0)
|
||||
// {
|
||||
// //bool hasNextTarget = false;
|
||||
// //for (int j = i; j < _copyConstantSpawn.Count; j++)
|
||||
// //{
|
||||
// // if (_copyConstantSpawn[_copyConstantSpawn.Count - j] > 0)
|
||||
// // {
|
||||
// // spawnerSubject.Prefab = _levelConfig.ConstantSpawn[j].GetEnemyObject();
|
||||
// // hasNextTarget = true;
|
||||
// // Debug.Log(spawnerSubject.Prefab.name);
|
||||
// // }
|
||||
// //}
|
||||
// //if (!hasNextTarget)
|
||||
// //{
|
||||
// foreach (SpawnerTile spawner in _subjects)
|
||||
// {
|
||||
// if (spawner.Prefab.Equals(paramPrefab))
|
||||
// {
|
||||
// spawner.StopSpawn();
|
||||
// Debug.Log("----Spawn Stopped----");
|
||||
// }
|
||||
// }
|
||||
// //}
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
int currentCount = 0;
|
||||
for (int i = 0; i < _copyConstantSpawn.Count; i++)
|
||||
{
|
||||
if (_levelConfig.ConstantSpawn[i].GetEnemyObject() == paramPrefab)
|
||||
{
|
||||
currentCount = --_copyConstantSpawn[i];
|
||||
//break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Debug.Log("Amout to spawn is now: " + currentCount);
|
||||
if (currentCount <= 0)
|
||||
{
|
||||
bool hasNextTarget = false;
|
||||
for (int j = i; j < _copyConstantSpawn.Count; j++)
|
||||
{
|
||||
if (_copyConstantSpawn[_copyConstantSpawn.Count - j] > 0)
|
||||
{
|
||||
spawnerSubject.Prefab = _levelConfig.ConstantSpawn[j].GetEnemyObject();
|
||||
hasNextTarget = true;
|
||||
Debug.Log(spawnerSubject.Prefab.name);
|
||||
}
|
||||
}
|
||||
if (!hasNextTarget)
|
||||
{
|
||||
foreach (SpawnerTile spawner in _subjects)
|
||||
{
|
||||
@ -114,9 +138,6 @@ public class WaveObserver : Singleton<WaveObserver>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by enemy when they spawn
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user