|
|
@@ -85,14 +85,18 @@ public class EnemyCreater : MonoBehaviour
|
|
|
if (t == null) continue;
|
|
|
for (int j = 0; j < t.spawnTime.Length; j++)
|
|
|
{
|
|
|
- CreaterControl createrControl = new();
|
|
|
- createrControl.isCreated = false;
|
|
|
- createrControl.tile = t;
|
|
|
- createrControl.spawnTimeId = j;
|
|
|
- createrControl.pos = new Vector3(x + UnityEngine.Random.Range(-t.radius.x/2,t.radius.x/2) , y + UnityEngine.Random.Range(-t.radius.y/2,t.radius.y/2), 0);
|
|
|
- createrControl.waveStartTime = startTime;
|
|
|
- createrControl.mapLayer = map.layers[i - 1];
|
|
|
- createCharacter.Add(createrControl);
|
|
|
+ if(t.spawnTime[j].curLayer == i - 1)
|
|
|
+ {
|
|
|
+ CreaterControl createrControl = new();
|
|
|
+ createrControl.isCreated = false;
|
|
|
+ createrControl.tile = t;
|
|
|
+ createrControl.spawnTimeId = j;
|
|
|
+ createrControl.pos = new Vector3(x + UnityEngine.Random.Range(-t.radius.x / 2, t.radius.x / 2), y + UnityEngine.Random.Range(-t.radius.y / 2, t.radius.y / 2), 0);
|
|
|
+ createrControl.waveStartTime = startTime;
|
|
|
+ createrControl.mapLayer = map.layers[i - 1];
|
|
|
+ createCharacter.Add(createrControl);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|