Added number of photos scoring

This commit is contained in:
2025-11-18 11:33:16 +01:00
parent 63f410298d
commit 219f2239a1
6 changed files with 1231 additions and 50 deletions

View File

@@ -56,6 +56,7 @@ namespace Minigames.DivingForPictures
// Public properties
public int PlayerScore => _playerScore;
public float CurrentVelocityFactor => _currentVelocityFactor;
public int picturesTaken;
// Events
public event Action<int> OnScoreChanged;
@@ -289,9 +290,13 @@ namespace Minigames.DivingForPictures
// Add score
_playerScore += pointsAwarded;
// Add number of pictures taken
picturesTaken += 1;
// Fire events
OnScoreChanged?.Invoke(_playerScore);
OnPictureTaken?.Invoke(monster, pointsAwarded);
OnScoreChanged?.Invoke(picturesTaken);
OnPictureTaken?.Invoke(monster, picturesTaken);
}
/// <summary>
@@ -902,10 +907,13 @@ namespace Minigames.DivingForPictures
// Add score
_playerScore += pointsAwarded;
// Add pictures taken
picturesTaken += 1;
// Fire events
OnScoreChanged?.Invoke(_playerScore);
OnPictureTaken?.Invoke(monster, pointsAwarded);
OnScoreChanged?.Invoke(picturesTaken);
OnPictureTaken?.Invoke(monster, picturesTaken);
}
/// <summary>

View File

@@ -16,7 +16,7 @@ namespace Minigames.DivingForPictures
DivingGameManager.Instance.OnPictureTaken += ShowScorePopup;
// Initialize display
UpdateScoreDisplay(DivingGameManager.Instance.PlayerScore);
UpdateScoreDisplay(DivingGameManager.Instance.picturesTaken);
// Create popup parent if needed
@@ -40,7 +40,7 @@ namespace Minigames.DivingForPictures
{
if (scoreText != null)
{
scoreText.text = $"Score: {score}";
scoreText.text = $"x {score}";
}
}