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

Binary file not shown.

View File

@@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 87fd15c93c1b9461e934061d65ad617c
AudioImporter:
externalObjects: {}
serializedVersion: 8
defaultSettings:
serializedVersion: 2
loadType: 2
sampleRateSetting: 1
sampleRateOverride: 44100
compressionFormat: 1
quality: 0.79999995
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

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()