TO SQUASH: Fixed issue.
This commit is contained in:
@@ -6,6 +6,8 @@ public class SharkSpawner : Spawner
|
||||
|
||||
public SpriteRenderer gameBoardSpriteRenderer;
|
||||
|
||||
public Player player;
|
||||
|
||||
private Bounds gameBoardBounds;
|
||||
|
||||
private float spawnTimer = 0f;
|
||||
@@ -28,7 +30,7 @@ public class SharkSpawner : Spawner
|
||||
{
|
||||
spawnTimer += Time.fixedDeltaTime;
|
||||
|
||||
if (spawnTimer >= 1f && isActive && isSpawning)
|
||||
if (spawnTimer >= 1f && isActive && isSpawning && player.level >= 10)
|
||||
{
|
||||
spawnTimer = 0f;
|
||||
if (Random.value < spawnProbability)
|
||||
@@ -36,7 +38,7 @@ public class SharkSpawner : Spawner
|
||||
GameObject shark = Instantiate(sharkPrefab, spawnPosition, Quaternion.identity);
|
||||
Shark sharkScript = shark.GetComponent<Shark>();
|
||||
sharkScript.gameBoardSpriteRenderer = gameBoardSpriteRenderer;
|
||||
sharkScript.player = FindAnyObjectByType<Player>();
|
||||
sharkScript.player = player;
|
||||
isActive = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user