Мелкие фиксы

This commit is contained in:
se_ga 2026-08-19 09:18:27 +03:00
parent 991822149f
commit 2f94741b92
6 changed files with 57 additions and 248 deletions

View File

@ -4212,8 +4212,7 @@ MonoBehaviour:
choose: {fileID: 1703329793}
timer: {fileID: 899274035}
switchEffectPrefab: {fileID: 2610659100565043189, guid: 5d8706b81b3dfae4f8f7c5d49d659cb2, type: 3}
Player1Land: {fileID: 2610659100565043189, guid: 1b275e29696820140be2ae6fa7cca3a5, type: 3}
Player2Land: {fileID: 2610659100565043189, guid: b3b0c5cfeae48cd408bc39678ff7d125, type: 3}
player1LandClip: {fileID: 8300000, guid: 58bc5999efcd9ea4d8ec6efd48af6f1d, type: 3}
--- !u!4 &151433695
Transform:
m_ObjectHideFlags: 0
@ -6531,9 +6530,6 @@ MonoBehaviour:
botScale: {fileID: 1811884475}
Player1Scale: {fileID: 988266649}
Player2Scale: {fileID: 1723865212}
OnNoMoney:
m_PersistentCalls:
m_Calls: []
player1Chip: {fileID: 4478126490810938235, guid: 1e042d6979719a240abdf06769829f7f, type: 3}
player2Chip: {fileID: 4478126490810938235, guid: 376ff57f7b90bd845a887cfd6ba95427, type: 3}
botChip: {fileID: 4478126490810938235, guid: afe8782fb49b2254cbdae76f1a9f22a8, type: 3}
@ -40834,7 +40830,6 @@ MonoBehaviour:
label: {fileID: 1253636793}
prefix: "\u0426\u0435\u043D\u0430:"
GameModePriceKey: PricePVE
ValutaNameKey: ValutaName
--- !u!114 &1253636793
MonoBehaviour:
m_ObjectHideFlags: 0
@ -64638,7 +64633,6 @@ MonoBehaviour:
label: {fileID: 2081061934}
prefix: "\u0426\u0435\u043D\u0430:"
GameModePriceKey: PricePVP
ValutaNameKey: ValutaName
--- !u!114 &2081061934
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -4,12 +4,12 @@ public class CheckLeadersFromMenuState : IState
{
Leaderboard lb;
float timeToExit = 60f;
float timeToExit = 20f;
float timeElapsed = 0;
bool ready = false;
public void enter()
{
ComWrapper.InputRecieved +=ResetTimer;
//ComWrapper.InputRecieved += ResetTimer;
lb = GameManager.instance.leaderboard;
//вкл
@ -19,11 +19,11 @@ public class CheckLeadersFromMenuState : IState
timeElapsed = 0;
}
void ResetTimer(string s) => timeElapsed = 0;
//void ResetTimer(string s) => timeElapsed = 0;
public void exit()
{
ComWrapper.InputRecieved-=ResetTimer;
//ComWrapper.InputRecieved-=ResetTimer;
lb.ClearRowsText();
lb.gameObject.SetActive(false);
SoundManager.instance.playSwitch();
@ -31,19 +31,23 @@ public class CheckLeadersFromMenuState : IState
public void update()
{
//проверка
bool exitCombo = In.GetButtonDownAnyPlayer(PlayerAction.left) && In.GetButtonDownAnyPlayer(PlayerAction.right);
if (exitCombo)
if (!ready)
{
GameManager.instance.stateMachine.ChangeState(new MenuState());
ready = !In.AnyButton();
return;
}
//проверка
//bool exitCombo = !In.GetButtonAnyPlayer(PlayerAction.down) && In.AnyButton();
//if (keepDownButton) ResetTimer("");
bool keepDownButton = In.GetButtonAnyPlayer(PlayerAction.down);
float accelerationSign = keepDownButton ? 1 : -1f;
lb.accelerationY = Mathf.Abs(lb.accelerationY) * accelerationSign;
bool exitCombo = In.GetButtonDownAnyPlayer(PlayerAction.left) && In.GetButtonDownAnyPlayer(PlayerAction.right);
timeElapsed += Time.deltaTime;
if (timeElapsed > timeToExit)
if (timeElapsed > timeToExit || exitCombo)
{
GameManager.instance.stateMachine.ChangeState(new MenuState());
}

View File

@ -51,7 +51,7 @@ public class MenuState : IState
sNoPrize = new Vector2(-0, -70f),
eNoPrize = new Vector2(15, -409);
Vector3
sCoin = new Vector3(0.22f, -1.9f, 0),
sCoin = new Vector3(0, -2.9f, 0),
eCoin = new Vector3(-8.65f, 5.25f, 0);
Vector2 sSmallPrizesOutSize = new Vector2(560, 100);

View File

@ -20,18 +20,15 @@ public class SoundManager : MonoBehaviour
public AudioSource choose;
public AudioSource timer;
public GameObject switchEffectPrefab;
public GameObject Player1Land, Player2Land;
// Кешированные длительности клипов
private float switchEffectDuration;
private float player1LandDuration;
private float player2LandDuration;
private float effectsVolume;
// Кешированные AudioClips для пула
private AudioClip switchEffectClip;
private AudioClip player1LandClip;
private AudioClip player2LandClip;
[SerializeField] AudioClip player1LandClip;
// Пул объектов для звуковых эффектов
private const int AUDIO_POOL_SIZE = 12;
@ -53,32 +50,26 @@ public class SoundManager : MonoBehaviour
else
{
Destroy(gameObject);
return;
}
Instantiate(new GameObject()).AddComponent(typeof(VfxPrefab));
switchEffectClip = switchEffectPrefab.GetComponent<AudioSource>().clip;
switchEffectDuration = switchEffectClip.length;
player1LandDuration = player1LandClip.length;
PaymentSystem.onCoinAdded += playAddCoin;
PaymentSystem.onCoinRemoved += playRemoveCoin;
PaymentSystem.OnNotEnoughMoney += playNoMoney;
ApplySettings();
SettingsManager.OnSettingsChanged.AddListener(ApplySettings);
}
private void Start()
{
try
{
switchEffectClip = switchEffectPrefab.GetComponent<AudioSource>().clip;
switchEffectDuration = switchEffectClip.length;
player1LandClip = Player1Land.GetComponent<AudioSource>().clip;
player1LandDuration = player1LandClip.length;
player2LandClip = Player2Land.GetComponent<AudioSource>().clip;
player2LandDuration = player2LandClip.length;
PaymentSystem.onCoinAdded += playAddCoin;
PaymentSystem.onCoinRemoved += playRemoveCoin;
PaymentSystem.OnNotEnoughMoney += playNoMoney;
ApplySettings();
SettingsManager.OnSettingsChanged.AddListener(ApplySettings);
}
catch { }
}
private void InitializeAudioPool()
@ -102,7 +93,7 @@ public class SoundManager : MonoBehaviour
public void ApplySettings()
{
//print("Применяем настройки звука");
print("Применяем настройки звука");
musicVolume = SettingsManager.GetFloat("MusicVolume", 0.5f);
promoVolume = SettingsManager.GetFloat("PromoVolume", 0.5f);
@ -153,7 +144,7 @@ public class SoundManager : MonoBehaviour
}
public void playDropDown()
{
// Используем пул объектов вместо создания новых
GameObject effect = GetPooledAudioObject();
@ -168,7 +159,7 @@ public class SoundManager : MonoBehaviour
//audioSource.pitch = 1 + Random.Range(0, 2) * 0.6f;
audioSource.pitch = GameManager.instance.currentPlayer == CellState.Player1 ? 1 : 1.3f;
audioSource.volume = effectsVolume;
effect.SetActive(true);
audioSource.Play();

View File

@ -15,11 +15,22 @@ public class SpecialPrizeToggler : MonoBehaviour
[SerializeField] private TextMeshProUGUI PrizeText;
private void OnEnable() => PrizeSystemManager.PrizesChanged += Refresh;
private void OnEnable()
{
SettingsManager.OnSettingsChanged.AddListener(Refresh);
PrizeSystemManager.PrizesChanged += Refresh;
}
private void OnDisable() => PrizeSystemManager.PrizesChanged -= Refresh;
private void OnDisable()
{
SettingsManager.OnSettingsChanged.RemoveListener(Refresh);
PrizeSystemManager.PrizesChanged -= Refresh;
}
private void Refresh()
{
Refresh(PrizeSystemManager.cachedPrizes);
}
private void Refresh(List<Prize> prizes)
{
var qrPrizes = CollectQrPrizes(prizes);

File diff suppressed because one or more lines are too long