Метод повышения сложности аппарата перенесен в DifficultyManager

This commit is contained in:
se_ga 2026-03-20 13:41:10 +03:00
parent 8432a3ab4c
commit 631e9f873a
3 changed files with 17 additions and 15 deletions

View File

@ -412,20 +412,7 @@ public class GameManager : MonoBehaviour
}
}
}
public void upgradeFeeshkaDifficulty()
{
string difficultyType = SettingsManager.GetString("BaseBotDifficulty", "Обычная");
if (difficultyType == "Обычная")
{
PlayerPrefs.SetInt("PulsesCounter", 0);
Setting difficultySetting = SettingsManager.Container.TryGetSetting("BaseBotDifficulty");
difficultySetting.StringValue = "Повышенная";
SettingsManager.OnSettingsChanged?.Invoke();
SettingsManager.SaveContainerToFile();
AdminPanel.GetComponent<SettingsScreen>().RefreshViews();
print("Сложность повышена");
}
}
IEnumerator AddBotRecordEvery2Days()

View File

@ -54,4 +54,19 @@ public class DifficultyManager : MonoBehaviour
currentOpponent = 0;
CharacterController.ResetCharactersDifficulty();
}
public void upgradeFeeshkaDifficulty()
{
string difficultyType = SettingsManager.GetString("BaseBotDifficulty", "Обычная");
if (difficultyType == "Обычная")
{
PlayerPrefs.SetInt("PulsesCounter", 0);
Setting difficultySetting = SettingsManager.Container.TryGetSetting("BaseBotDifficulty");
difficultySetting.StringValue = "Повышенная";
SettingsManager.OnSettingsChanged?.Invoke();
SettingsManager.SaveContainerToFile();
GameManager.instance.AdminPanel.GetComponent<SettingsScreen>().RefreshViews();
print("Сложность повышена");
}
}
}

View File

@ -70,7 +70,7 @@ public static class EndOfTurnHandler
gm.botScale.SetMedalsCount(gm.vsBotScore);
//если фишку победили, то повышаем.
if (gm.vsBotScore == gm.botsAmount) gm.upgradeFeeshkaDifficulty();
if (gm.vsBotScore == gm.botsAmount) DifficultyManager.Instance.upgradeFeeshkaDifficulty();
}
private static void PvpEndroundHandler()