This commit is contained in:
2026-04-09 02:55:12 +05:30
parent cace0cc664
commit ced9c9fa35
13 changed files with 5758 additions and 1514 deletions
@@ -15,6 +15,7 @@ public class AudioDirectory : ScriptableObject
public AudioClip gameMusic;
[Header("SFX")]
public AudioClip[] coinsSfx;
[Header("Ball")]
public AudioClip[] ballHits;
public AudioClip[] puckHits;
@@ -295,6 +295,11 @@ public class AudioManager : MonoBehaviour
return clips[Random.Range(0, clips.Length)];
}
public void PlayCoinsSfx(){
if (audioDirectory.coinsSfx != null && audioDirectory.coinsSfx.Length > 0)
uiSfxSource.PlayOneShot(audioDirectory.coinsSfx[Random.Range(0, audioDirectory.coinsSfx.Length)]);
}
public void PlayTimerBeep(){
if (audioDirectory.timerBeep != null && audioDirectory.timerBeep.Length > 0)
uiSfxSource.PlayOneShot(audioDirectory.timerBeep[Random.Range(0, audioDirectory.timerBeep.Length)]);
+8 -1
View File
@@ -7,8 +7,15 @@ public static class CoinHelper
return float.Parse(whole + "." + fraction);
}
public static int RcToCoins(float coins){
string s = coins.ToString("N1");
int whole = int.Parse(s.Split('.')[0]);
int fraction = int.Parse(s.Split('.')[1]);
return (whole * 4) + fraction;
}
public static string FormatString(int coins)
{
return Format(coins).ToString("N2");
return Format(coins).ToString("N1");
}
}
+20
View File
@@ -0,0 +1,20 @@
using TMPro;
using UnityEngine;
[RequireComponent(typeof(TMP_Text))]
public class CopyTextTMP : MonoBehaviour
{
public TMP_Text origin;
TMP_Text _text;
void Awake()
{
_text = GetComponent<TMP_Text>();
}
void Update()
{
_text.text = origin.text;
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 981262cae0f1178448cf21d0273828dc