Added number of photos scoring
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user