public void LoseLevel() { levelEnded = true; gameOverScreen.SetActive(true); gameOverScreen.GetComponent <Animator>().SetTrigger("Die"); if (ApplicationDatas.Game.CurrentLevel >= 0) { ApplicationDatas.Game.Shards += shardsCount / 3; ApplicationDatas.Save(); } }
private void SetupLoad() { Load.interactable = ApplicationDatas.HasSave(); if (Load.interactable) { Load.transform.FindChild("Text").GetComponent <Text>().color = btnUnlocked; } else { Load.transform.FindChild("Text").GetComponent <Text>().color = btnLocked; } }
public void WinLevel() { levelEnded = true; victoryScreen.SetActive(true); victoryScreen.GetComponent <Animator>().SetTrigger("Win"); if (ApplicationDatas.Game.CurrentLevel >= 0) { ApplicationDatas.Game.Shards += shardsCount; if (ApplicationDatas.Game.CurrentLevel + 1 > ApplicationDatas.Game.LevelsCleared && ApplicationDatas.Game.CurrentLevel < ApplicationDatas.MAX_LEVEL - 1) { ApplicationDatas.Game.LevelsCleared = ApplicationDatas.Game.CurrentLevel + 1; } ApplicationDatas.Save(); } }
private void UpdateUpgradeLevel(Transform upgrade) { Upgrades bonus = (Upgrades)System.Enum.Parse(typeof(Upgrades), upgrade.name); Transform level = upgrade.Find("Group/Level"); for (int i = 0; i < ApplicationDatas.Game.Bonus[bonus]; ++i) { level.GetChild(i).GetComponent <Image>().sprite = bonusBought; } Text price = upgrade.Find("Group/Price/Text").GetComponent <Text>(); if (ApplicationDatas.Game.Bonus[bonus] < prices[bonus].Count) { price.text = prices[bonus][ApplicationDatas.Game.Bonus[bonus]].ToString(); } else { upgrade.Find("Group/Price/MAX").gameObject.SetActive(true); price.gameObject.SetActive(false); upgrade.Find("Group/Price/Image").gameObject.SetActive(false); } UpdateShards(); ApplicationDatas.Save(); }
public void ClearDatas() { ApplicationDatas.Clear(); SetupLoad(); eventSys.UpdateEventSystem(); }
public void LoadGame() { ApplicationDatas.Load(); SceneManager.LoadScene("Overworld"); }