Add a levelup sound

This commit is contained in:
2026-02-10 19:51:09 -07:00
parent 6465658b99
commit d47c952794
3 changed files with 25 additions and 0 deletions

View File

@@ -646,6 +646,7 @@ public class GamePlayer : MonoBehaviour
void UpdateStats(BigInteger scoreAddAmount, BigInteger attemptAddAmount)
{
var levelBefore = Tools.GetLevelInfo().level;
var prefix = "";
var suffix = "";
score += scoreAddAmount;
@@ -678,6 +679,7 @@ public class GamePlayer : MonoBehaviour
DiscordRPCHandler.Instance.UpdateRPC("Playing in normal mode", $"Score: {Tools.FormatWithCommas(score)} | High Score: {Tools.FormatWithCommas(highscore)}");
var (_, level, currentXpInLevel, totalXpForLevel, percentDone) = Tools.GetLevelInfo();
levelText.text = $"Level: {Tools.FormatWithCommas(level.ToString())}" + (Application.isMobilePlatform ? " \\u2022 " : "\n") + $"XP: {Tools.FormatWithCommas(currentXpInLevel.ToString())}/{Tools.FormatWithCommas(totalXpForLevel.ToString())} ({Math.Floor(percentDone)}%)";
if (level != levelBefore) AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Levelup"), Camera.main.transform.position, 1f * BazookaManager.Instance.GetSettingSFXVolume());
}
void CheckIfGrounded()