Beispiel #1
0
 private void RessetStats()
 {
     PlayerPrefs.SetInt("PlayerHp", 3);
     PlayerPrefs.SetInt("PlayerArmor", 0);
     PlayerPrefs.SetInt("PlayerStepCounter", 0);
     PlayerPrefs.SetInt("SpecialCounter", 0);
     PlayerHp          = 3;
     PlayerArmor       = 0;
     PlayerStepCounter = 0;
     MageCounter       = 0;
     if (PlayerHpObject == null)
     {
         return;
     }
     SpecialCounter.GetComponentInChildren <TextMeshProUGUI>().text    = MageCounter.ToString();
     PlayerHpObject.GetComponentInChildren <TextMeshProUGUI>().text    = PlayerHp.ToString();
     PlayerArmorObject.GetComponentInChildren <TextMeshProUGUI>().text = PlayerArmor.ToString();
     PlayerStepObject.GetComponentInChildren <TextMeshProUGUI>().text  = PlayerStepCounter.ToString();
 }
Beispiel #2
0
 public virtual void CheckTile(int index)
 {
     PlayerStepCounter++;
     PlayerStepObject.GetComponentInChildren <TextMeshProUGUI>().text = PlayerStepCounter.ToString();
     if (Current[index].MonsterType.ToString() == "Potion")
     {
         Potion(index);
     }
     else if (Current[index].MonsterType.ToString() == "Monster")
     {
         Monster(index);
     }
     else if (Current[index].MonsterType.ToString() == "Armor")
     {
         Armor(index);
     }
     else if (Current[index].MonsterType.ToString() == "ManaPots")
     {
         Mana(index);
     }
 }
Beispiel #3
0
 public virtual void Resett()
 {
     PlayerHp          = PlayerPrefs.GetInt("PlayerHp", 10);
     PlayerArmor       = PlayerPrefs.GetInt("PlayerArmor", 0);
     PlayerIndex       = 4;
     PlayerLevel       = PlayerPrefs.GetInt("PlayerLevel", 0);
     PlayerStepCounter = PlayerPrefs.GetInt("PlayerStepCounter", PlayerStepCounter);
     if (Generate)
     {
         GenerateNext(); AllTiles[0] = PlayerTile;
     }
     else
     {
         AllTiles = Levels[PlayerLevel].Tiles;
     }
     RandomField();
     PlayerHpObject    = GameObject.FindGameObjectWithTag("PlayerHp");
     PlayerArmorObject = GameObject.FindGameObjectWithTag("PlayerArmor");
     PlayerStepObject  = GameObject.FindGameObjectWithTag("PlayerStep");
     PlayerHpObject.GetComponentInChildren <TextMeshProUGUI>().text    = PlayerHp.ToString();
     PlayerArmorObject.GetComponentInChildren <TextMeshProUGUI>().text = PlayerArmor.ToString();
     PlayerStepObject.GetComponentInChildren <TextMeshProUGUI>().text  = PlayerStepCounter.ToString();
 }