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