Working Developer Settings

This commit is contained in:
2025-09-24 13:31:15 +02:00
parent 8b96a5d0c3
commit 783541a776
24 changed files with 965 additions and 754 deletions

View File

@@ -8,6 +8,24 @@ namespace Minigames.DivingForPictures
/// </summary>
public class ObstacleCollision : PlayerCollisionBehavior
{
protected override void OnEnable()
{
base.OnEnable();
// Subscribe to immunity events
OnImmunityStarted += HandleImmunityStarted;
OnImmunityEnded += HandleImmunityEnded;
}
protected override void OnDisable()
{
// Unsubscribe from immunity events
OnImmunityStarted -= HandleImmunityStarted;
OnImmunityEnded -= HandleImmunityEnded;
base.OnDisable();
}
protected override void HandleCollisionResponse(Collider2D obstacle)
{
// Mark the obstacle as having dealt damage to prevent multiple hits
@@ -21,21 +39,20 @@ namespace Minigames.DivingForPictures
}
/// <summary>
/// Override to prevent input blocking during damage immunity
/// Since obstacles pass through the player, we don't want to block input
/// Handler for immunity started event - replaces OnImmunityStart method
/// </summary>
protected override void OnImmunityStart()
private void HandleImmunityStarted()
{
Debug.Log($"[ObstacleCollision] Damage immunity started for {damageImmunityDuration} seconds");
Debug.Log($"[ObstacleCollision] Damage immunity started for {_gameSettings.EndlessDescenderDamageImmunityDuration} seconds");
// Don't block input for obstacle damage - let player keep moving
// The shared immunity system will handle the collision prevention
}
/// <summary>
/// Override to handle immunity end
/// Handler for immunity ended event - replaces OnImmunityEnd method
/// </summary>
protected override void OnImmunityEnd()
private void HandleImmunityEnded()
{
Debug.Log($"[ObstacleCollision] Damage immunity ended");
// No special handling needed - shared immunity system handles collider re-enabling

View File

@@ -298,8 +298,9 @@ namespace Minigames.DivingForPictures
/// </summary>
private bool IsValidSpawnPosition(Vector3 position)
{
// Use OverlapCircle to check for collisions with tiles
Collider2D collision = Physics2D.OverlapCircle(position, _settings.EndlessDescenderObstacleSpawnCollisionRadius, _devSettings.ObstacleTileLayerMask);
// 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);
return collision == null;
}