The feel is fine
This commit is contained in:
@@ -221,9 +221,9 @@ namespace Minigames.DivingForPictures
|
||||
while (true)
|
||||
{
|
||||
// Calculate next spawn time with variation
|
||||
float nextSpawnTime = _settings.EndlessDescenderObstacleSpawnInterval +
|
||||
Random.Range(-_settings.EndlessDescenderObstacleSpawnIntervalVariation,
|
||||
_settings.EndlessDescenderObstacleSpawnIntervalVariation);
|
||||
float nextSpawnTime = _settings.ObstacleSpawnInterval +
|
||||
Random.Range(-_settings.ObstacleSpawnIntervalVariation,
|
||||
_settings.ObstacleSpawnIntervalVariation);
|
||||
nextSpawnTime = Mathf.Max(0.1f, nextSpawnTime); // Ensure minimum interval
|
||||
|
||||
yield return new WaitForSeconds(nextSpawnTime);
|
||||
@@ -257,7 +257,7 @@ namespace Minigames.DivingForPictures
|
||||
bool foundValidPosition = false;
|
||||
|
||||
// Try to find a valid spawn position
|
||||
for (int attempts = 0; attempts < _settings.EndlessDescenderObstacleMaxSpawnAttempts; attempts++)
|
||||
for (int attempts = 0; attempts < _settings.ObstacleMaxSpawnAttempts; attempts++)
|
||||
{
|
||||
spawnPosition = GetRandomSpawnPosition();
|
||||
|
||||
@@ -270,13 +270,13 @@ namespace Minigames.DivingForPictures
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"[ObstacleSpawner] Position {spawnPosition} invalid (attempt {attempts + 1}/{_settings.EndlessDescenderObstacleMaxSpawnAttempts})");
|
||||
Debug.Log($"[ObstacleSpawner] Position {spawnPosition} invalid (attempt {attempts + 1}/{_settings.ObstacleMaxSpawnAttempts})");
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundValidPosition)
|
||||
{
|
||||
Debug.LogWarning($"[ObstacleSpawner] SPAWN MISSED: Could not find valid spawn position after {_settings.EndlessDescenderObstacleMaxSpawnAttempts} attempts at {Time.time:F2}");
|
||||
Debug.LogWarning($"[ObstacleSpawner] SPAWN MISSED: Could not find valid spawn position after {_settings.ObstacleMaxSpawnAttempts} attempts at {Time.time:F2}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ namespace Minigames.DivingForPictures
|
||||
{
|
||||
// Use OverlapCircle to check for collisions with tiles using just the layer
|
||||
// Convert the single layer to a layer mask inline (1 << layerNumber)
|
||||
Collider2D collision = Physics2D.OverlapCircle(position, _settings.EndlessDescenderObstacleSpawnCollisionRadius, 1 << _devSettings.TrenchTileLayer);
|
||||
Collider2D collision = Physics2D.OverlapCircle(position, _settings.ObstacleSpawnCollisionRadius, 1 << _devSettings.TrenchTileLayer);
|
||||
return collision == null;
|
||||
}
|
||||
|
||||
@@ -412,8 +412,8 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
// Randomize properties using settings
|
||||
obstacleComponent.MoveSpeed = Random.Range(
|
||||
_settings.EndlessDescenderObstacleMinMoveSpeed,
|
||||
_settings.EndlessDescenderObstacleMaxMoveSpeed);
|
||||
_settings.ObstacleMinMoveSpeed,
|
||||
_settings.ObstacleMaxMoveSpeed);
|
||||
|
||||
// Set spawner reference (since FloatingObstacle has this built-in now)
|
||||
obstacleComponent.SetSpawner(this);
|
||||
@@ -544,7 +544,7 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
// Draw collision radius at spawn point
|
||||
Gizmos.color = Color.red;
|
||||
Gizmos.DrawWireSphere(center, _settings.EndlessDescenderObstacleSpawnCollisionRadius);
|
||||
Gizmos.DrawWireSphere(center, _settings.ObstacleSpawnCollisionRadius);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user