Add option not to spawn walkers at begin play

This commit is contained in:
nsubiron 2017-06-28 23:05:10 +02:00
parent eca43e2aff
commit 68b52dd23d
2 changed files with 6 additions and 2 deletions

View File

@ -86,7 +86,7 @@ void AWalkerSpawnerBase::BeginPlay()
GetRandomEngine()->Shuffle(BeginSpawnPoints);
if (bSpawnWalkers) {
if (bSpawnWalkers && bSpawnWalkersAtBeginPlay) {
uint32 Count = 0u;
for (auto i = 0; i < NumberOfWalkers; ++i) {
if (TryToSpawnWalkerAt(*BeginSpawnPoints[i % BeginSpawnPoints.Num()])) {

View File

@ -78,10 +78,14 @@ private:
private:
/** If false, no walker will be spawned. */
/** If false, no walker will be spawned at all. */
UPROPERTY(Category = "Walker Spawner", EditAnywhere)
bool bSpawnWalkers = true;
/** If false, no walker will be spawned at begin play. */
UPROPERTY(Category = "Walker Spawner", EditAnywhere, meta = (EditCondition = bSpawnWalkers))
bool bSpawnWalkersAtBeginPlay = true;
/** Number of walkers to be present within the volume. */
UPROPERTY(Category = "Walker Spawner", EditAnywhere, meta = (EditCondition = bSpawnWalkers, ClampMin = "1"))
int32 NumberOfWalkers = 10;