HelpMePlz 13 мар 2022, 21:50
В коде ничего такого нету, просто считывает данные, если есть такой PlayerPrefs, то переменной присваивает это значение. Вот весь скрипт
public void Start()
{
Debug.Log("Save Manager: START");
if (!PlayerPrefs.HasKey("SelectedLanguage_"))
{
PlayerPrefs.SetString("SelectedLanguage_", "en");
LoadTranslate();
}
else
{
LoadTranslate();
}
if (PlayerPrefs.GetString("SelectedLanguage_") == "en")
{
buttonController.LanguageChoose.value = 0;
}
else if (PlayerPrefs.GetString("SelectedLanguage_") == "ru")
{
buttonController.LanguageChoose.value = 1;
}
for (int a = 0; a < collection.characters.Length; ++a)
{
if (PlayerPrefs.HasKey("CharacterPlusPrimogems" + a))
{
collection.characters[a].PlusPrimogems = PlayerPrefs.GetInt("CharacterPlusPrimogems" + a);
collection.characters[a].C = PlayerPrefs.GetInt("CharacterC_Count" + a);
collection.characters[a].ConstaText.text = $"C{collection.characters[a].C}";
collection.characters[a].Locked.SetActive(false);
if (collection.characters[a].C > 0)
collection.characters[a].Dublicate = true;
}
}
for (int a = 0; a < collection.weapons.Length; ++a)
{
if (PlayerPrefs.HasKey("WeaponPlusPrimogems" + a))
{
collection.weapons[a].PlusPrimogems = PlayerPrefs.GetInt("WeaponPlusPrimogems" + a);
collection.weapons[a].C = PlayerPrefs.GetInt("WeaponC_Count" + a);
collection.weapons[a].ConstaText.text = $"P{collection.weapons[a].C}";
collection.weapons[a].Locked.SetActive(false);
if (collection.weapons[a].C > 0)
collection.weapons[a].Dublicate = true;
}
}
if (PlayerPrefs.HasKey("MyPrimogems"))
myMoney.Primogems = PlayerPrefs.GetInt("MyPrimogems");
if (PlayerPrefs.HasKey("StandartGacha"))
myMoney.StandartGacha = PlayerPrefs.GetInt("StandartGacha");
if (PlayerPrefs.HasKey("EventGacha"))
myMoney.EventGacha = PlayerPrefs.GetInt("EventGacha");
if (PlayerPrefs.HasKey("RareGarant"))
wish.RareGarant = PlayerPrefs.GetInt("RareGarant");
if (PlayerPrefs.HasKey("LegendaryGarant"))
wish.LegendaryGarant = PlayerPrefs.GetInt("LegendaryGarant");
if (PlayerPrefs.HasKey("LegendaryWeapon"))
wish.LegendaryWeapon = PlayerPrefs.GetInt("LegendaryWeapon");
if (PlayerPrefs.HasKey("StandartLegendary"))
wish.StandartLegendary = PlayerPrefs.GetInt("StandartLegendary");
if (PlayerPrefs.HasKey("BannerNumber"))
banners.BannerNumber = PlayerPrefs.GetInt("BannerNumber");
BannersUpdate();
myMoney.UpdateInfo();
}